zhengkaixin 1 سال پیش
والد
کامیت
f2280b5e9e
5فایلهای تغییر یافته به همراه98 افزوده شده و 25 حذف شده
  1. 2 2
      .env.dev.js
  2. 77 18
      pages/searchPile/chargeProcess/charge.vue
  3. 10 1
      pages/searchPile/chargeProcess/dcCharging.vue
  4. 2 2
      pages/user/finance/balance.vue
  5. 7 2
      pages/user/index.vue

+ 2 - 2
.env.dev.js

@@ -4,7 +4,7 @@ const UNI_APP = {
 
 	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 
-	//BASE_URL: 'http://192.168.77.162:8081/charging-station/' ,
+	BASE_URL: 'http://192.168.77.162:8081/charging-station/' ,
 	//PARK_URL: 'http://192.168.11.120:8082/charging-parking/' ,
 	PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
 	XPGJ_URL: 'https://xpgjapi.xiaoxinda.com/' ,
@@ -22,7 +22,7 @@ const UNI_APP = {
 	//openId:"oK9Wr5-ViXQMUP2cjiW3bGIABj1Q",
 	//openId:"oK9Wr5wkU3OwWhQ7mRrLZ5MDZNHo",
 	//openId:"oK9Wr53qHzp7kOSiue_PYjwEqivM",
-	//openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU",//zq
+	openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU",//zq
 	//openId:"oK9Wr50iQUjEAam1s_RpHpXJS5xg",//月卡用户
 	//openId:"oK9Wr5zv8lvirni3txbxRkmpg8d0",//sz
 	//小鹏管家appid

+ 77 - 18
pages/searchPile/chargeProcess/charge.vue

@@ -57,9 +57,9 @@
 
 
 
-			<view class="card" @click="paySelectMethod(1)" :class="{
-				cardselect:payValue==1,
-				cardno:payValue!=1
+			<view class="card" @click="paySelectMethod(paySelectMethodValue)" :class="{
+				cardselect:payValue==1||payValue==4,
+				cardno:!(payValue==1||payValue==4)
 			}">
 				<view class="cardgo">
 					<view class="cardinfo">
@@ -70,11 +70,35 @@
 				</view>
 				<view class="title">会员账户余额充电</view>
 
-				<p>当前余额{{user.balance>0?user.balance.toFixed(2):'0.00'}}元
+				<p v-show="!(payValue==1||payValue==4)">当前余额{{user.balance>0?user.balance.toFixed(2):'0.00'}}元
 					<span @click="paySelectShow()" style="color:#00B962;margin-left: 20px; ">去充值></span>
 
-				</p>
-				<view class="rechargeMain" v-show="payValue==1">
+				</p>
+				<p>优先使用付款方式
+					<span @click="paySelectShow()" style="color:#00B962;margin-left: 20px; ">去充值></span>
+					
+					
+				</p>
+				<view class="rechargeBalance">
+					<view class="rechargeBalanceItem">账户余额{{user.balance>0?user.balance.toFixed(2):'0.00'}}元</view>
+					<view class="rechargeBalanceItem" v-if="chargingFundsBl">|</view>
+					<view class="rechargeBalanceItem"  v-if="chargingFundsBl" >充电金{{user.chargingFunds>0?user.chargingFunds.toFixed(2):'0.00'}}元</view>
+				</view>
+				<view class="rechargeMain" v-if="chargingFundsBl" v-show="payValue==1||payValue==4">
+					
+					<view 
+						class=" recharge-item  "   @click="paySelectMethodValue=1"  :class="payValue == 1? 'active' : ''" >
+						账户余额
+					</view>
+					<view
+						class=" recharge-item  "   @click="paySelectMethodValue=4"  :class="payValue == 4? 'active' : ''">
+						充电金
+					</view>
+				</view>
+				<p v-if="chargingFundsBl" >充电时长</p>
+				<view class="rechargeMain" v-show="payValue==1||payValue==4">
+					
+					
 					<view @click="moneyClick(-1)" :class="!otherNum&&moneyActiveClass == -1? 'active' : ''"
 						class=" recharge-item  ">
 						充满自停
@@ -205,7 +229,7 @@
 				</template>
 
 			</view>
-			<view v-if="cardList.length" class="cardListView">
+			<view v-if="cardList.length&&userCard" class="cardListView">
 				<view  class="cardListItemTitle">点击切换其他卡</view>
 				<view  class="cardListItem" v-for="(item,i) in cardList" 
 				 :key="i"  :class="{
@@ -320,7 +344,7 @@
 
 		</u-popup>
 		<!-- 弹窗2 -->
-		<template>
+		<!-- <template>
 			<view>
 				<u-popup v-model="paySelect" mode="bottom">
 					<view class="paySelect">
@@ -361,7 +385,7 @@
 				</u-popup>
 
 			</view>
-		</template>
+		</template> -->
 		<!-- 弹窗 -->
 		<template>
 			<view>
@@ -441,6 +465,7 @@
 	} from '@/utils'
 	
 	import * as Pay from '@/apis/weixin.js'
+// import { contentStore } from 'core/core.model'
 
 
 
@@ -488,7 +513,7 @@
 				otherNum_f: '',
 				otherNum: '',
 				moneyList_f: [],
-				paySelect: false,
+				paySelect: true,
 				payName: "",
 				payValueTemp: 0,
 				payValue: 0,
@@ -507,6 +532,16 @@
 					tips: "账户余额:99999元",
 					value: "3",
 					select: false,
+				}, {
+					name: "充电金",
+					tips: "账户余额:99999元",
+					value: "4",
+					select: false,
+				}, {
+					name: "充电金",
+					tips: "账户余额:99999元",
+					value: "4",
+					select: false,
 				}],
 				moneyList: [
 
@@ -554,7 +589,9 @@
 				personInfo: {},
 				carNumber: "",
 				show3: false,
-				cardList:[],
+				cardList:[],
+				paySelectMethodValue:1,
+				chargingFundsBl:false,
 			}
 		},
 		computed: {
@@ -621,7 +658,14 @@
 				if (payValueDefault == "1" || payValueDefault == "0") {
 					this.payValue = payValueDefault;
 				}
-
+				if (payValueDefault == "1" || payValueDefault == "4") {
+					this.paySelectMethodValue = payValueDefault;
+					this.payValue = payValueDefault;
+				}
+				
+				if(payValueDefault==4){
+					this.chargingFundsBl=true;
+				}
 			}
 			this.payName = this.payList[this.payValue].name;
 
@@ -703,7 +747,8 @@
 			paySelectCompany() {
 
 			},
-			paySelectMethod(value, company) {
+			paySelectMethod(value, company) {
+				console.log(value)
 				if (this.personInfo.userType == "1") {
 					uni.showToast({
 						title: "游客模式只支持“先付后退”"
@@ -720,9 +765,10 @@
 
 							this.companyPaySelect.car = company.carList[0].carNum;
 						}
-					}
+					}
+					this.$forceUpdate()
 				}
-				console.log(this.companyPaySelect)
+				
 
 			},
 			moneyClick_f(index, item) {
@@ -1134,12 +1180,17 @@
 					this.userCard = res.data.regUserCard
 					this.canUse = res.data.canUse
 					//this.user = res.data
-
+				
 
 					API.personalCenter({
 						stationId: this.stationId
 					}).then((res2) => {
-						this.user = res2.data
+						this.user = res2.data
+						
+						if(this.user.chargingFunds){
+							this.chargingFundsBl=true;
+						}
+						
 						var entRegList = res2.data.entRegList;
 						this.companyList = []
 
@@ -1921,5 +1972,13 @@
 				background-color:  #00b962;
 				color:#fff;
 			}
-	}
+	}
+	.rechargeBalance{
+		display: flex;
+		.rechargeBalanceItem{
+			margin-right: 6px;
+			    color: #666;
+		}
+	}
+	
 </style>

+ 10 - 1
pages/searchPile/chargeProcess/dcCharging.vue

@@ -280,7 +280,16 @@
 							预充金额(元)
 						</view>
 					</view>
-
+					<view class="info-item" v-if="chargingRecord.payType==4">
+						<view class="content" v-if="detail.chargingFunds>0||detail.chargingFunds==0">
+						
+							{{detail.chargingFunds>0&&chargingRecord.dueFee?((detail.chargingFunds*1000-chargingRecord.dueFee*1000)/1000).toFixed(2):detail.chargingFunds.toFixed(2)}}
+						
+						</view>
+						<view class="name">
+							充电金(元)
+						</view>
+					</view>
 					<view class="info-item" v-else>
 						<view class="content" v-if="detail.balance>0||detail.balance==0">
 

+ 2 - 2
pages/user/finance/balance.vue

@@ -26,12 +26,12 @@
 							</view>
 							<view class="h2" v-if="personAccount.availableAmount != null">{{personAccount.availableAmount.toFixed(2)}}</view>
 						</view>
-						<view  class="balanceCard-head-item"  v-if="0" >
+						<view  class="balanceCard-head-item"  v-if="personAccount.chargingFunds" >
 							<view>
 								充电金(元)<u-icon name="question-line" custom-prefix="custom-icon" color="#fff" size="36" @click="show2=true"></u-icon>
 							</view>
 							
-							<view class="h2" v-if="personAccount.availableAmount != null">{{personAccount.availableAmount.toFixed(2)}}</view>
+							<view class="h2" v-if="personAccount.chargingFunds != null">{{personAccount.chargingFunds.toFixed(2)}}</view>
 							
 						</view>
 					</view>

+ 7 - 2
pages/user/index.vue

@@ -55,8 +55,13 @@
 			<!-- 卡包入口 -->
 			<view class="my-infos" v-if="(personInfo&&personInfo.userType==2)">
 				<view class="item">
-					<view class="item-value">
-						{{personAccount.availableAmount != null ? personAccount.availableAmount.toFixed(2) : '0.00'}}
+					<view class="item-value" v-if="personAccount.availableAmount ">
+						{{personAccount.chargingFunds != null ? (personAccount.availableAmount+personAccount.chargingFunds).toFixed(2) : personAccount.availableAmount.toFixed(2)}}
+						
+					</view>
+					<view class="item-value" v-else>
+						0.00
+						
 					</view>
 					<view class="item-title" @click="toBalance">
 						余额<u-icon name="arrow-right" color="#B8BDC4" size="2"></u-icon>