ソースを参照

调整样式, 网速慢情况调整,费用说明

zhengkaixin 3 年 前
コミット
8b45470eb0
5 ファイル変更73 行追加60 行削除
  1. 2 26
      apis/login.js
  2. 19 7
      pages/charge/index.vue
  3. 50 23
      pages/login/index.vue
  4. 1 3
      utils/request.js
  5. 1 1
      utils/requestWhite.js

+ 2 - 26
apis/login.js

@@ -3,38 +3,14 @@ import Qs from 'qs';
 
  
 export function findByOpenId(data) {
-	var url=""
-	if(data.form=="job"){
-		url='/mobile/jobUserApi/findByOpenId';
-	}else if(data.form=="hr"){
-		url='/mobile/sysUserApi/findByOpenId';
-	}else{
-		return 
-	}
+	var url='/mobile/regUser/findByOpenId';
 	return requestWhite({
-		method: 'post',
+		method: 'get',
 		data: data,
 		url: url
 	})
 }
 
-export function wechatLogin(data) {
-	 
-	 var url=""
-	 if(data.form=="job"){
-	 	url='/mobile/jobUserApi/wechatLogin';
-	 }else if(data.form=="hr"){
-	 	url='/mobile/sysUserApi/wechatLogin';
-	 }else{
-	 	return 
-	 }
-	 
-	return requestWhite({
-		method: 'post',
-		data:data ,
-		url:url 
-	})
-} 
 export function validateCode(data) {
 	 
 	return requestWhite({

+ 19 - 7
pages/charge/index.vue

@@ -75,15 +75,15 @@
 			<view class="charge">
 				<view class="chargeRadio">
 					<view class="u-flex">
-						<u-icon name="rmb-circle-fill" color="#ff9502" size="90"></u-icon>
+						<u-icon name="rmb-circle-fill"  color="#ff9502" size="90"></u-icon>
 						<view class="chargeRadio-text">
 							<p>余额支付</p>
-							<p>现有余额¥{{user.accountBalance}}</p>
+							<p>现有余额¥{{user.accountBalance}} </p>
 						</view>
 					</view>
-					<u-radio-group>
-						<u-radio></u-radio>
-					</u-radio-group>
+					<u-button type="warning"  style="    height: 34px;"
+						@click='gotoUrl("pages/user/recharge")'
+					>我要充值</u-button>
 				</view>
 			</view>
 		</view>
@@ -95,7 +95,11 @@
 		</view>
 		
 		<u-modal v-model="showPriceList" title="费用说明" >
+			
 			<p v-for="(item,i) in detail.priceList" class="showPriceList" :key="i">{{item.minPower}}W-{{item.maxPower}}W <span>{{item.price}}元每小时</span></p>
+			
+			<p style="    padding: 15px;" v-if="detail.roundingMinute!=null&&detail.roundingMinute!=-1">超过{{detail.roundingMinute}}分钟,按1小时记,不足{{detail.roundingMinute}}分钟,不计费</p>
+			<p style="    padding: 15px;" v-if="detail.priceList.length==0">无费用说明或为免费充电模式</p>
 		</u-modal>
 		
 		<u-modal v-model="showmodel" @confirm="confirm" :showCancelButton="true" title="订单信息" >
@@ -122,6 +126,7 @@
 				showmodel:false,
 				//充电桩信息
 				detail:{
+					roundingMinute:-1,
 					priceList:[],
 				},
 				user:{},
@@ -181,9 +186,16 @@
 			}
 		},
 		onLoad(op) {
-			if(op.id){
-				this.id=op.id;
+			
+			if (op.id) {
+				this.id = op.id;
+				this.carhelp.set("qr-default-id",op.id);
+			}else{
+				//用于支付后返回系统  -- 点金计划
+				this.id =this.carhelp.get("qr-default-id");
 			}
+			
+			
 			this.init()
 			
 			

+ 50 - 23
pages/login/index.vue

@@ -194,31 +194,58 @@
 					return;
 				}
 				this.$refs.uCode.start();
+			},
+			query(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.findByOpenId({
+					
+					openId: this.carhelp.getOpenId(),
+					
+				}).then((response) => {
+					
+					var token = response ? response.data.token : '';
+					this.carhelp.setToken(token);
+					this.carhelp.setPersonInfo(response.data.regUser);
+					//this.gotoUrl("pages/user/index")
+					uni.redirectTo({
+						url: '/pages/index/index'
+					})
+				
+				}).catch(error => {
+					uni.hideLoading();
+					if (!this.carhelp.getOpenId()) {
+						uni.showToast({
+							title: "请使用“微信”访问本系统登录"
+						})
+						return
+					} else if (this.message) {
+						uni.showToast({
+							title: this.message.split(",")[0],
+							icon: "none"
+						})
+					}
+					var time = this.carhelp.get("getvcodetime");
+					if (time) {
+						//this.$refs.uCode.start();
+						var nowtime = new Date().getTime()
+						var differ = (nowtime - time) / 1000
+						if (differ < 2 * 60) {
+							this.sendMsgSecond = 2 * 60 - parseInt(differ)
+							this.isSendMsgIng = true;
+							this.$refs.uCode.start();
+						}
+					}
+					
+				})
 			}
 		},
-		onReady() {
-			if (!this.carhelp.getOpenId()) {
-				uni.showToast({
-					title: "请使用“微信”访问本系统登录"
-				})
-				return
-			} else if (this.message) {
-				uni.showToast({
-					title: this.message.split(",")[0],
-					icon: "none"
-				})
-			}
-			var time = this.carhelp.get("getvcodetime");
-			if (time) {
-				//this.$refs.uCode.start();
-				var nowtime = new Date().getTime()
-				var differ = (nowtime - time) / 1000
-				if (differ < 2 * 60) {
-					this.sendMsgSecond = 2 * 60 - parseInt(differ)
-					this.isSendMsgIng = true;
-					this.$refs.uCode.start();
-				}
-			}
+		onReady() {
+			this.query()
+			
 		}
 	}
 </script>

+ 1 - 3
utils/request.js

@@ -14,7 +14,7 @@ const request = (options) => {
 	 	return requestSon(options);
 	 }
 	 var openId=carhelp.getOpenId()
-	var  urlindex="/wechat/findUserInfo"
+	var  urlindex="/mobile/regUser/findByOpenId"
 	var k=options.url.indexOf(urlindex)==-1;
 	
 	 if(!openId&&k){
@@ -48,8 +48,6 @@ const request = (options) => {
 				var token = res ? res.data.data.token : '';
 				carhelp.setPersonInfo(res.data.data.regUser );
 				
-			
-			
 				carhelp.setToken(token);
 				
 				options.token=token

+ 1 - 1
utils/requestWhite.js

@@ -42,7 +42,7 @@ const request = (options) => {
 			if (res.data.code == 415&&res.data.message=='请先注册信息') {
 				carhelp.signOut()
 				uni.redirectTo({
-					url: '/pages/car/login'
+					url: '/pages/login/index'
 				})
 				return;
 			}