zhengkaixin il y a 2 ans
Parent
commit
40ca82ca9b

+ 11 - 0
apis/chargeProcess.js

@@ -58,3 +58,14 @@ export function useCoupon(data) {
 		url: '/mobile/chargingCouponApi/useCoupon'
 	})
 }
+
+
+ 
+ export function userCard(data) {
+ 	return request({
+ 		method: 'get',
+ 		data: data,
+ 		url: '/mobile/regUserCard/userCard'
+ 	})
+ }
+ 

+ 8 - 0
pages.json

@@ -628,6 +628,14 @@
                 "enablePullDownRefresh": false
             }
             
+        },{ "name":"月卡购买",
+            "path" : "pages/monthlyCardActivity/monthlyCardList",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
         }
         
         

+ 18 - 7
pages/monthlyCardActivity/monthlyCardBuy.vue

@@ -19,8 +19,11 @@
 		<view class="slogan-2">
 			单次购买、整月受益!
 		</view>
-		<view class="slogan-3">
+		<view class="slogan-3" >
 			仅限车主购买,适用于平台对外开放充电站
+		</view>
+		<view class="slogan-4" @click="gotoUrl('pages/monthlyCardActivity/monthlyCardList?cardId='+cardId)">
+			查看适用站点
 		</view>
 		<u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
 		<u-modal v-model="showModel" :show-cancel-button="true" @confirm="confirm" confirm-text="支付成功?" title="扫码支付">
@@ -36,8 +39,8 @@
 		</u-modal>
 		<img id="qrcode" style="display: none;">
 		<!-- 立即开通 -->
-		<view class="bottom">
-			<button class="dredge" @click="show = true">立即开通 ¥{{detail.price}}/月</button>
+		<view class="bottom" v-if="detail.price" >
+			<button class="dredge" @click="show = true">立即开通 ¥{{detail.price.toFixed(2)}}/月</button>
 			<p>开通表示阅读并同意
 				<text class="agreement" @click="gotoUrl('pages/article/details?code=FWFZKXY')">《服务费折扣协议》</text>
 			</p>
@@ -58,7 +61,8 @@
 	} from '@/utils/wxpay'
 	export default {
 		data() {
-			return {
+			return {
+				cardId:'3e1b0f8f-61b0-405f-a285-929b5346479f',
 				qrCodeImg: "",
 				showModel: false,
 				list: [{
@@ -82,8 +86,9 @@
 					mask: true,
 				})
 				API.cardDetail({
-					cardId:'3e1b0f8f-61b0-405f-a285-929b5346479f'
+					cardId:this.cardId
 				}).then((response) => {
+					console.log(response)
 					this.detail=response.data.monthlyRentCard
 					uni.hideLoading()
 				}).catch(error => {
@@ -99,7 +104,7 @@
 					mask: true,
 				})
 				API.openCard({
-					cardId:'3e1b0f8f-61b0-405f-a285-929b5346479f'
+					cardId:this.cardId
 				}).then((response) => {
 					this.submitForm.id=response.data.orderInfoId
 					
@@ -247,7 +252,13 @@
 		font-size: 28rpx;
 		text-align: center;
 	}
-
+	.slogan-4 {
+		text-decoration:underline;
+		height: 20px;
+		color: #9F9C99;
+		font-size: 28rpx;
+		text-align: center;
+	}
 	// 立即开通
 	.bottom {
 

+ 327 - 0
pages/monthlyCardActivity/monthlyCardList.vue

@@ -0,0 +1,327 @@
+<template>
+	<view >
+		<ujp-navbar title="适用站点"></ujp-navbar>
+	
+		<view class="carNone" v-if="list.length == 0">
+			<img src="static/img/暂无数据-缺省页.png" alt="">
+			<p class="oldTextjp2" oldstyle="font-size: 18px;">加载中</p>
+		</view>
+		
+		<view class="charing-slow" v-for="(item,index) in list" :key="item.id" >
+<!-- 			<text class="trickle-charge">慢充</text> <text class="station-items">{{item.name}}</text>
+ -->			<text :class="item.type == '1' ? 'fast-charge':(item.type == '2' ? 'trickle-charge':'fast-trickle-charge')">{{item.type==1?'快充':(item.type==2?'慢充':'快\\慢')}}</text> <text class="station-items">{{item.name}}</text>
+			
+			<view class="address">
+				{{item.address}}
+			</view>
+			<view class="price">
+				<view class="num">{{(item.costPrice*100+item.servicePrice*100)/100}}</view>
+				<view class="unit">
+					 元/度 起
+				</view>
+			</view>
+		<!-- 	<view class="park">
+				<text class="park-p">p</text>
+				<text class="park-text">以实际费用为准</text>
+			</view> -->
+			<view class="free">
+				<view class="free-num">
+					<text style="color:#009143;">空闲{{item.availableNum}}</text>/总数{{item.totalNum}}
+				</view>
+				<view class="distance">
+					<text class="iconfont distance-font">&#xe615;</text>
+				</view>
+			</view>
+		</view>
+		<u-divider  v-if="list.length == recordsTotal && recordsTotal != 0" style="margin-top: 10px;background-color: #F2F4F4;">已经到底了</u-divider>
+		
+		
+<!-- 		<u-divider margin-top="20" bg-color="#F2F4F4">已经到底了</u-divider>
+ -->	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/site.js';
+	
+	export default {
+		data() {
+			return {
+				tabbarList: [{
+						iconPath: "home-3-line",
+						selectedIconPath: "home-3-fill",
+						text: '主页 ',
+						count: 0,
+						isDot: true,
+						customIcon: true,
+					},
+					{
+						iconPath: "road-map-line",
+						selectedIconPath: "road-map-fill",
+						text: '找桩',
+						midButton: true,
+						customIcon: true,
+					},
+					{
+						iconPath: "user-5-line",
+						selectedIconPath: "user-5-fill",
+						text: '我的',
+						count: 0,
+						isDot: false,
+						customIcon: true,
+
+					}
+				],
+				current: 0,
+				monthlyRentCardId:null,
+				
+				pageIndex: 1,
+				recordsTotal: 0,
+				list: [],
+			}
+		},onLoad(op){
+			this.monthlyRentCardId=op.cardId
+			this.getInfo()
+		},
+		onReachBottom() {
+			if (this.chargeList.length < this.recordsTotal) {			
+				this.myLoadmore();
+			}
+		},
+		
+		methods: {
+			myLoadmore() {
+				this.pageIndex += 1;
+				this.getInfo()
+			},
+			getInfo(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.searchStationData({
+					monthlyRentCardId:this.monthlyRentCardId
+				}).then((response) => {
+					console.log(response)
+					this.list = [
+						...this.list,
+						...response.data.data
+					];
+					this.recordsTotal = response.data.recordsTotal;
+					//this.detail=response.data.monthlyRentCard
+					uni.hideLoading()
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			}
+		}
+		
+	}
+</script>
+
+<style lang="scss" scoped>
+	.carNone{
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		img{
+			width: 100%;
+			height: 100%;
+		}
+		p{
+			margin-top: -60px;
+		}
+	}
+
+	.top-box {
+		width: 100%;
+		height: 88px;
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 999;
+	}
+	
+	.top {
+		display: flex;
+		justify-content: space-between;
+		width: 100%;
+		height: 44px;
+		color: #666666;
+		background-color: rgba(255, 255, 255, 100);
+		padding: 12px 16px;
+	
+	
+		.u-search[data-v-1a326067] {
+			flex: 0.9;
+		}
+	
+		.list {
+			margin-left: 2px;
+	
+		}
+	}
+	
+	.condition {
+		width: 100%;
+		height: 44px;
+		line-height: 20px;
+		padding: 12px 16px;
+		display: flex;
+	
+		background-color: #fff;
+	
+		.condition-type {
+			margin-left: 36px;
+		}
+	
+		.condition-screen {
+			margin-left: 159px;
+		}
+	}
+	
+
+	
+	.charing-slow {
+		background-color: #fff;
+		margin: 0 12px;
+		border-radius: 8px;
+		padding: 10px 12px 0px;
+		margin-top: 12px;
+		.trickle-charge {
+			display: inline-block;
+			width: 44px;
+			height: 20px;
+			line-height: 20px;
+			border-radius: 50px;
+			background-color: rgba(0, 185, 98, 100);
+			color: rgba(255, 255, 255, 100);
+			font-size: 12px;
+			text-align: center;
+		}
+
+		.fast-charge {
+			display: inline-block;
+			width: 44px;
+			height: 20px;
+			line-height: 20px;
+			border-radius: 50px;
+			background-color: #9d9fff;
+			color: rgba(255, 255, 255, 100);
+			font-size: 12px;
+			text-align: center;
+		}
+		.fast-slow{
+			display: inline-block;
+			width: 44px;
+			height: 20px;
+			line-height: 20px;
+			border-radius: 50px;
+			background-color: #00bac8;
+			color: rgba(255, 255, 255, 100);
+			font-size: 12px;
+			text-align: center;
+		}
+
+		.station-items {
+			display: inline-block;
+			height: 16px;
+			line-height: 16px;
+			font-size: 16px;
+			margin-left: 4px;
+			color: #101010;
+
+
+		}
+
+		.address {
+			margin-top: 8px;
+			line-height: 16px;
+			font-size: 11px;
+			color: rgba(119, 119, 119, 100);
+		}
+
+		.price {
+			display: flex;
+			height: 20px;
+			margin-top: 8px;
+
+			.num {
+				height: 20px;
+				color: rgba(255, 98, 0, 100);
+				font-size: 20px;
+				text-align: left;
+				font-family: Roboto-medium;
+			}
+
+			.unit {
+				height: 14px;
+				line-height: 14px;
+				color: rgba(102, 102, 102, 100);
+				font-size: 14px;
+				text-align: left;
+				font-family: AlibabaPuHui-regular;
+				margin-top: 6px;
+				margin-left: 4px;
+			}
+		}
+
+		.park {
+			margin-top: 10px;
+			display: flex;
+
+			.park-p {
+				display: inline-block;
+				width: 20px;
+				height: 18px;
+				line-height: 12px;
+				text-align: center;
+				background-color: rgba(125, 177, 255, 100);
+				color: #fff;
+			}
+
+			.park-text {
+				display: inline-block;
+				width: 300px;
+				height: 17px;
+				color: rgba(102, 102, 102, 100);
+				font-size: 12px;
+				text-align: left;
+				margin-left: 4px;
+				margin-top: 2px;
+			}
+		}
+
+		.free {
+			display: flex;
+			justify-content: space-between;
+			height: 52px;
+			border-top: 1px solid rgba(238, 242, 240, 100);
+			margin-top: 10px;
+
+			.free-num {
+				line-height: 52px;
+				font-size: 14px
+			}
+
+			.distance {
+				width: 130px;
+				height: 28px;
+				line-height: 28px;
+				color: rgba(255, 255, 255, 100);
+				font-size: 14px;
+				background-color: #00b962;
+				border-radius: 50px;
+				margin: 12px;
+				text-align: center;
+
+				.distance-font {
+					font-size: 16px
+				}
+
+			}
+		}
+	}
+</style>

+ 26 - 6
pages/searchPile/chargeProcess/charge.vue

@@ -87,8 +87,11 @@
 			 	<view class="actively">
 			 		会员活动
 			 	</view>
-				<view class="type">
+				<view class="type" v-if="canUse">
 					充电服务费包月卡
+				</view>
+				<view class="type" style="color: red;" v-if="!canUse">
+					此充电站不支持月卡服务
 				</view>
 			 </view>
 			
@@ -158,7 +161,8 @@
 					},
 
 				],
-				userCard:null,
+				userCard:null,
+				canUse:false,
 				selectObj:{},
 				value:"",
 				// 优惠券
@@ -180,10 +184,10 @@
 		},
 		onLoad(op) {
 			
-			var plus=this.carhelp.getPersonInfoPlus()
-			if(plus){
-				this.userCard=plus.userCard;
-			}
+			// var plus=this.carhelp.getPersonInfoPlus()
+			// if(plus){
+			// 	this.userCard=plus.userCard;
+			// }
 			this.uuid=new Date().getTime();
 			this.stationId= op.stationId;
 			if (op.deviceNo) {
@@ -346,6 +350,22 @@
 					uni.showToast({
 						title: error
 					})
+				})
+				
+			
+				API.userCard({
+					stationId:this.stationId
+				}).then((res) => {
+					console.log(res)
+					this.userCard=res.data.regUserCard
+					this.canUse=res.data.canUse
+					//this.user = res.data
+				
+				 
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
 				})
 			},
 			useCoupon(){

+ 1 - 38
pages/searchPile/searchPile.vue

@@ -93,44 +93,7 @@
 						></u-tag>
 					</view>
 				</view>
-<!--				<view class="preference_group">
-					<view class="preference_group_item"><label class="preference_label">充电桩电压 (V)</label></view>
-					<view>
-						<u-tag
-							class="preference_item_plus"
-							v-for="(item, index) in info.obc_voltage"
-							:key="index"
-							:style="index == preference.obc_voltage_index ? 'background-color:#00B962;color:#FFFFFF' : 'background-color:#EFF4F2;color:#926666'"
-							shape="circle"
-							:text="item.text"
-							@click="selectOBCVoltage(index)"
-						></u-tag>
-					</view>
-				</view>
-				<view class="preference_group">
-					<view class="preference_group_item"><label class="preference_label">充电桩功率 (kw)</label></view>
-					<view style="height: 50rpx;margin-left: 30rpx;">
-						<DoubleSlider
-							ref="obc_voltage"
-							sliderHeight="15rpx"
-							blockSize="36rpx"
-							:minValue="info.obc_power.minValue"
-							:maxValue="info.obc_power.maxValue"
-							v-model="preference.obc_power"
-							:currentMinValue="preference.obc_power.minValue"
-							:currentMaxValue="preference.obc_power.maxValue"
-							labelColor="#B8C9C5"
-							borderRadius="25rpx"
-							borderColor="#00B962"
-							borderStyle="solid"
-							borderWidth="3rpx"
-							blockColor="#FFFFFF"
-							activeColor="#00B962"
-							indicatorColor="#DBDBDB"
-							@change="handlerDoubleSlider"
-					>	</DoubleSlider>
-					</view>
-				</view>-->
+
 				<view class="preference_group">
 					<view style="margin-left: 30rpx;"><u-checkbox shape="circle" v-model="preference.save_preference" @change="radioChange">保存偏好设置</u-checkbox></view>
 				</view>

+ 1 - 0
utils/request.js

@@ -47,6 +47,7 @@ const request = (options) => {
 		}).then((response) => {
  			let [error, res] = response;
 			
+			
 			if (res.data.code == 200&&res.data.result) {
 				
 				var token = res ? res.data.data.token : '';

+ 5 - 0
utils/requestSon.js

@@ -38,6 +38,11 @@ const request = (options) => {
 			//防止连续请求多个接口时loading闪现
 			let [error, res] = response;
 			
+			if(process.car.NODE_ENV=='dev'){
+				console.log("dev环境显示"+options.url)	
+				 console.log(res.data)	
+			}
+			
 			if (res.data.code == 415&&res.data.message=='请先注册信息') {
 				carhelp.signOut()
 				uni.redirectTo({