|
@@ -14,40 +14,98 @@
|
|
|
<view class="left lefttitle">
|
|
|
请选择充电金额
|
|
|
</view>
|
|
|
- <view class="to-recharge" @click="show=true,recordId='',otherNum_f='',fee=0">
|
|
|
+ <!-- <view class="to-recharge" @click="show=true,recordId='',otherNum_f='',fee=0">
|
|
|
去充值
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
+ </view>
|
|
|
+ <view class="card"
|
|
|
+ @click="payValue=0"
|
|
|
+ :class="{
|
|
|
+ cardselect:payValue==0,
|
|
|
+ cardno:payValue!=0
|
|
|
+ }">
|
|
|
+ <view class="cardgo" >
|
|
|
+ <view class="cardinfo">
|
|
|
+ <img src="@/assets/img/icon_success.png" alt="">
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="title">先付后退</view>
|
|
|
+ <p>充电结束后,余额自动退还,不享受会员优惠</p>
|
|
|
+ <view class="rechargeMain" v-show="payValue==0">
|
|
|
+
|
|
|
+ <view class="recharge-item" @click="moneyActiveClass_n=(item.id)"
|
|
|
+ :class="moneyActiveClass_n == item.id ? 'active' : ''" v-for="(item,index) in moneyListN"
|
|
|
+ :key="item.id">
|
|
|
+ {{item.name}}
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
- <p>当前余额{{user.balance>0?user.balance.toFixed(2):'0.00'}}元</p>
|
|
|
- <view class="rechargeMain">
|
|
|
- <view @click="moneyClick(-1)" :class="!otherNum&&moneyActiveClass == -1? 'active' : ''" class=" recharge-item ">
|
|
|
- 充满自停
|
|
|
- </view>
|
|
|
- <view class="recharge-item" @click="moneyClick(item.id)"
|
|
|
- :class="!otherNum&&moneyActiveClass == item.id ? 'active' : ''" v-for="(item,index) in moneyList"
|
|
|
- :key="item.id">
|
|
|
- {{item.name}}元
|
|
|
- </view>
|
|
|
- <view class="recharge-item recharge-item2" :class="otherNum ? 'active' : ''" style="
|
|
|
- padding: 1px 0px;">
|
|
|
- <u-input v-model="otherNum" @input="ckInput" @focus="focus" type="digit" placeholder="其他充电金额" />
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
+ <view class="card"
|
|
|
+ @click="paySelectMethod"
|
|
|
+ :class="{
|
|
|
+ cardselect:payValue==1,
|
|
|
+ cardno:payValue!=1
|
|
|
+ }">
|
|
|
+ <view class="cardgo" >
|
|
|
+ <view class="cardinfo">
|
|
|
+ <img src="@/assets/img/icon_success.png" width="32" alt="">
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="title">会员账户余额充电</view>
|
|
|
+
|
|
|
+ <p>当前余额{{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">
|
|
|
+ <view @click="moneyClick(-1)" :class="!otherNum&&moneyActiveClass == -1? 'active' : ''" class=" recharge-item ">
|
|
|
+ 充满自停
|
|
|
+ </view>
|
|
|
+ <view class="recharge-item" @click="moneyClick(item.id)"
|
|
|
+ :class="!otherNum&&moneyActiveClass == item.id ? 'active' : ''" v-for="(item,index) in moneyList"
|
|
|
+ :key="item.id">
|
|
|
+ {{item.name}}元
|
|
|
+ </view>
|
|
|
+ <view class="recharge-item recharge-item2" :class="otherNum ? 'active' : ''" style="
|
|
|
+ padding: 1px 0px;">
|
|
|
+ <u-input v-model="otherNum" @input="ckInput" @focus="focus" type="digit" placeholder="其他充电金额" />
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <!-- 优惠券2 -->
|
|
|
+ <!-- 优惠券2 -->
|
|
|
+ <view class="discounts2" v-if="false">
|
|
|
+ <view class="left lefttitle">
|
|
|
+ 支付方式
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="right" @click="paySelect=true" style="color:#101010" >
|
|
|
+ {{payName}}
|
|
|
+ <view class="iconfont"></view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="discounts2">
|
|
|
<view class="left lefttitle">
|
|
|
优惠券
|
|
|
- </view>
|
|
|
- <view class="right" @click="chooseCoupons" v-if="selectObj.id">
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="right" v-if="payValue=='0'">
|
|
|
+ 先付后退不享受会员优惠活动
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="right" @click="chooseCoupons" v-else-if="selectObj.id">
|
|
|
{{selectObj.threshold == 0 ? '无门槛' : '满'+selectObj.threshold.toFixed(2)+'元可用'}},
|
|
|
|
|
|
<span class="price" v-if="selectObj.classify == '1'||selectObj.classify == '3'">抵扣{{selectObj.value.toFixed(2)}}元</span>
|
|
@@ -71,8 +129,12 @@
|
|
|
<view class="member" v-if="userCardBool" >
|
|
|
<view class="actively ">
|
|
|
会员活动
|
|
|
- </view>
|
|
|
- <view class="type" v-if="!vin" style="color: red;" >
|
|
|
+ </view>
|
|
|
+ <view class="right" v-if="payValue=='0'">
|
|
|
+ 先付后退不享受会员优惠活动
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="type" v-else-if="!vin" style="color: red;" >
|
|
|
vin码不一致
|
|
|
</view>
|
|
|
<view class="type" v-else-if="canUse">
|
|
@@ -117,7 +179,57 @@
|
|
|
title="余额不足" confirm-text="前往充值"
|
|
|
content="账户余额不足,充值成功后开始充电" @confirm="show=true"></u-modal>
|
|
|
|
|
|
-
|
|
|
+ <!-- 弹窗2 -->
|
|
|
+ <template >
|
|
|
+ <view >
|
|
|
+ <u-popup v-model="paySelect" mode="bottom" >
|
|
|
+ <view class="paySelect">
|
|
|
+ <view class="title lefttitle " >选择支付方式</view>
|
|
|
+ <u-radio-group v-model="payValueTemp">
|
|
|
+
|
|
|
+ <p >
|
|
|
+ <u-radio
|
|
|
+ name="0"
|
|
|
+ active-color="#2979f6" shape="circle" size="48">
|
|
|
+ <p >{{payList[0].name}}<span>({{payList[0].tips}})</span> </p>
|
|
|
+ </u-radio>
|
|
|
+ </p>
|
|
|
+ <p v-if="personInfo.userType=='2'" >
|
|
|
+ <u-radio
|
|
|
+ name="1"
|
|
|
+
|
|
|
+ active-color="#2979f6" shape="circle" size="48">
|
|
|
+ <p >{{payList[1].name}}<span>({{payList[1].tips}})</span> </p>
|
|
|
+ </u-radio>
|
|
|
+ </p>
|
|
|
+ <p v-if="false" >
|
|
|
+ <u-radio
|
|
|
+ name="2"
|
|
|
+ active-color="#2979f6" shape="circle" size="48">
|
|
|
+ <p >{{payList[2].name}}<span>(其他充值金额)</span> </p>
|
|
|
+
|
|
|
+ </u-radio>
|
|
|
+ </p>
|
|
|
+ </u-radio-group>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="recharge" style="padding-bottom: 0;">
|
|
|
+
|
|
|
+
|
|
|
+ <view class="recharge-btn transactionClass" style="margin-top: 60px;">
|
|
|
+
|
|
|
+
|
|
|
+ <u-button
|
|
|
+ class="success-btn" @click="paySelectMethod"
|
|
|
+ shape="circle" type="success" style="margin-top: 12px;margin-bottom: 16px;">
|
|
|
+ <span>确定</span>
|
|
|
+ </u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
<!-- 弹窗 -->
|
|
|
<template >
|
|
|
<view >
|
|
@@ -154,7 +266,7 @@
|
|
|
<view class="recharge-btn transactionClass" style="margin-top: 60px;">
|
|
|
<view >
|
|
|
<u-checkbox-group>
|
|
|
- <u-checkbox active-color="green" v-model="checked" shape="circle" @change="checkboxChange()"></u-checkbox>
|
|
|
+ <u-checkbox active-color="green" v-model="checked" shape="circle"></u-checkbox>
|
|
|
</u-checkbox-group>
|
|
|
我已阅读并同意<span @click="gotoUrl('pages/article/details?code=CZXY')" style="color:#00B962" >《充值协议》</span>
|
|
|
|
|
@@ -195,7 +307,8 @@
|
|
|
stationId:"",
|
|
|
elderMode:false,
|
|
|
isback:true,
|
|
|
- show: false,
|
|
|
+ show: false,
|
|
|
+ moneyActiveClass_n: "50",
|
|
|
moneyActiveClass: "-1",
|
|
|
moneyActiveClass_f: "-1",
|
|
|
detail: {},
|
|
@@ -219,12 +332,29 @@
|
|
|
user: {},
|
|
|
otherNum_f: '',
|
|
|
otherNum: '',
|
|
|
- moneyList_f:[],
|
|
|
+ moneyList_f:[],
|
|
|
+ paySelect:false,
|
|
|
+ payName:"",
|
|
|
+ payValueTemp:0,
|
|
|
+ payValue:0,
|
|
|
+ payList:[{
|
|
|
+ name:"先付后退",
|
|
|
+ tips:"游客不享受平台优惠活动",
|
|
|
+ value:"1",
|
|
|
+ select:false,
|
|
|
+ },{
|
|
|
+ name:"个人账户支付",
|
|
|
+ tips:"享受平台充电8.5折等优惠活动",
|
|
|
+ value:"2",
|
|
|
+ select:false,
|
|
|
+ },{
|
|
|
+ name:"单位账户支付",
|
|
|
+ tips:"账户余额:99999元",
|
|
|
+ value:"3",
|
|
|
+ select:false,
|
|
|
+ }],
|
|
|
moneyList: [
|
|
|
- {
|
|
|
- id: '5',
|
|
|
- name: '5'
|
|
|
- },
|
|
|
+
|
|
|
{
|
|
|
id: '10',
|
|
|
name: '10'
|
|
@@ -243,7 +373,20 @@
|
|
|
},
|
|
|
|
|
|
],
|
|
|
-
|
|
|
+ moneyListN: [
|
|
|
+ {
|
|
|
+ id: '50',
|
|
|
+ name: '50元'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '100',
|
|
|
+ name: '100元'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '150',
|
|
|
+ name: '150元'
|
|
|
+ }
|
|
|
+ ],
|
|
|
userCard:null,
|
|
|
canUse:false,
|
|
|
selectObj:{},
|
|
@@ -253,7 +396,8 @@
|
|
|
vin:true,
|
|
|
bannerList:[],
|
|
|
checked:true,
|
|
|
- selectItem:{},
|
|
|
+ selectItem:{},
|
|
|
+ personInfo:{},
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
@@ -273,7 +417,7 @@
|
|
|
},
|
|
|
onLoad(op) {
|
|
|
|
|
|
- // var plus=this.carhelp.getPersonInfoPlus()
|
|
|
+ this.personInfo=this.carhelp.getPersonInfo()
|
|
|
// if(plus){
|
|
|
// this.userCard=plus.userCard;
|
|
|
// }
|
|
@@ -301,7 +445,17 @@
|
|
|
}
|
|
|
this.init()
|
|
|
},
|
|
|
- onReady(){
|
|
|
+ onReady(){
|
|
|
+ this.personInfo=this.carhelp.getPersonInfo()
|
|
|
+ if(this.personInfo.userType=="1"){
|
|
|
+ this.payValueTemp=0;
|
|
|
+ this.payValue=0;
|
|
|
+ }else{
|
|
|
+ this.payValueTemp=1;
|
|
|
+ this.payValue=1;
|
|
|
+ }
|
|
|
+ this.payName=this.payList[this.payValue].name;
|
|
|
+
|
|
|
this.getBannerInfo("charge-start")
|
|
|
|
|
|
this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
|
|
@@ -310,7 +464,9 @@
|
|
|
else
|
|
|
this.theme('standard')
|
|
|
},
|
|
|
- onShow() {
|
|
|
+ onShow() {
|
|
|
+ this.personInfo=this.carhelp.getPersonInfo()
|
|
|
+
|
|
|
var obj=this.carhelp.get("chooseCoupons");
|
|
|
if(obj){
|
|
|
if(obj.uuid==this.uuid){
|
|
@@ -320,7 +476,28 @@
|
|
|
|
|
|
this.getHomePage()
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ paySelectShow(){
|
|
|
+ if(this.personInfo.userType=="1"){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.show=true;
|
|
|
+ this.recordId='';
|
|
|
+ this.otherNum_f='';
|
|
|
+ this.fee=0
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ paySelectMethod(){
|
|
|
+ if(this.personInfo.userType=="1"){
|
|
|
+ uni.showToast({
|
|
|
+ title:"游客模式只支持“先付后退”"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.payValue=1
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
moneyClick_f(index,item) {
|
|
|
this.otherNum_f='';
|
|
|
this.moneyActiveClass_f = index;
|
|
@@ -330,6 +507,29 @@
|
|
|
// this.selectImg=item
|
|
|
// }
|
|
|
}
|
|
|
+ },
|
|
|
+ rechargeNow2() {
|
|
|
+ //先付后退
|
|
|
+
|
|
|
+
|
|
|
+ this.submitForm_f={};
|
|
|
+ var fee=0;
|
|
|
+ this.submitForm_f.amount=this.fee;
|
|
|
+
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+
|
|
|
+ if(this.recordId){
|
|
|
+ this.submitForm_f.recordId=this.recordId
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ //(this.submitForm)
|
|
|
+ this.wxpy()
|
|
|
+
|
|
|
},
|
|
|
rechargeNow() {
|
|
|
if(!this.checked){
|
|
@@ -570,13 +770,16 @@
|
|
|
radioChange(e){},
|
|
|
confirm() {
|
|
|
|
|
|
- ////(JSON.stringify(this.submitForm))
|
|
|
- if(this.selectObj.id){
|
|
|
- this.submitForm.userCouponId=this.selectObj.id
|
|
|
- }
|
|
|
- if(this.userCardBool&&this.canUse&&this.vin){
|
|
|
- this.submitForm.userCardId=this.userCard.id
|
|
|
+ ////(JSON.stringify(this.submitForm))
|
|
|
+ if(this.payValue!=0){
|
|
|
+ if(this.selectObj.id){
|
|
|
+ this.submitForm.userCouponId=this.selectObj.id
|
|
|
+ }
|
|
|
+ if(this.userCardBool&&this.canUse&&this.vin){
|
|
|
+ this.submitForm.userCardId=this.userCard.id
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
@@ -586,16 +789,26 @@
|
|
|
API.startCarCharging(this.submitForm).then((res) => {
|
|
|
//(JSON.stringify(this.res))
|
|
|
|
|
|
- if(res.data.status=="5"){
|
|
|
- uni.hideLoading()
|
|
|
- this.showmodal=true;
|
|
|
- this.recordId=res.data.recordId;
|
|
|
-
|
|
|
- var fee=res.data.fee;
|
|
|
-
|
|
|
+ if(res.data.status=="5"){
|
|
|
+
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
+ if(this.submitForm.payType=="1"){
|
|
|
+ this.recordId=res.data.recordId;
|
|
|
+ this.fee=res.data.fee;
|
|
|
+
|
|
|
+ this.rechargeNow2()//先付后退
|
|
|
+ }else{
|
|
|
+ this.showmodal=true;
|
|
|
+ this.recordId=res.data.recordId;
|
|
|
+
|
|
|
+ var fee=res.data.fee;
|
|
|
+
|
|
|
+
|
|
|
+ this.fee=(fee-this.user.balance).toFixed(2);
|
|
|
+ this.otherNum_f=this.fee;
|
|
|
+ }
|
|
|
|
|
|
- this.fee=(fee-this.user.balance).toFixed(2);
|
|
|
- this.otherNum_f=this.fee;
|
|
|
}else{
|
|
|
|
|
|
this.gotoUrl("pages/searchPile/chargeProcess/dcCharging?id=" + res.data.recordId);
|
|
@@ -676,7 +889,9 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- submitInit(){
|
|
|
+ submitInit(){
|
|
|
+
|
|
|
+
|
|
|
if (this.moneyActiveClass == -1 && !this.otherNum) {
|
|
|
this.submitForm.chargeStrategy = 0;
|
|
|
this.submitForm.amount = 0
|
|
@@ -687,10 +902,12 @@
|
|
|
} else {
|
|
|
this.submitForm.amount = this.moneyActiveClass
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
submit() {
|
|
|
- this.submitInit()
|
|
|
+
|
|
|
|
|
|
|
|
|
if (!this.submitForm.channelNo) {
|
|
@@ -698,8 +915,15 @@
|
|
|
title: '请先选择充电通道'
|
|
|
})
|
|
|
return
|
|
|
+ }
|
|
|
+ this.submitForm.payType=this.payList[this.payValue].value;
|
|
|
+ if(this.submitForm.payType=="1"){
|
|
|
+ this.submitForm.amount = this.moneyActiveClass_n
|
|
|
+ this.submitForm.chargeStrategy = 2;
|
|
|
+ }else{
|
|
|
+ this.submitInit()
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.confirm()
|
|
|
|
|
|
|
|
@@ -761,7 +985,27 @@
|
|
|
color: #999999;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ .paySelect{
|
|
|
+ padding: 16px;
|
|
|
+ .title{
|
|
|
+ font-size:40rpx
|
|
|
+ }
|
|
|
+ p {
|
|
|
+ width: 100%;
|
|
|
+ span{
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ .u-radio__label{
|
|
|
+ color: #333333 ;
|
|
|
+ }
|
|
|
+ .u-radio{
|
|
|
+ width: 100% !important;;
|
|
|
+ }
|
|
|
+ color: #333333 ;
|
|
|
+ margin-top: 16rpx;
|
|
|
+ font-size:32rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
.recharge {
|
|
|
padding: 16px;
|
|
@@ -972,8 +1216,8 @@ position: relative;
|
|
|
color: rgba(16, 16, 16, 100);
|
|
|
/* font-size: 20px;*/
|
|
|
@include themeify{
|
|
|
- width:themed('buttonWidth1');
|
|
|
- font-size: themed('font-size5');
|
|
|
+ width:160rpx;
|
|
|
+ font-size: 40rpx;
|
|
|
}
|
|
|
}
|
|
|
.right{
|
|
@@ -1095,5 +1339,49 @@ position: relative;
|
|
|
right: 0;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ .card {
|
|
|
+
|
|
|
+ padding: 10px;
|
|
|
+ margin-top: 10px;
|
|
|
+ .title{
|
|
|
+
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .cardselect {
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 2px solid rgba(0, 185, 98, 1);
|
|
|
+ .title{
|
|
|
+ color:#00B962;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .cardgo{
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .cardinfo{
|
|
|
+ background-color: #57ad55;
|
|
|
+ width: 64rpx;
|
|
|
+ height: 64rpx;
|
|
|
+ position: absolute;
|
|
|
+ top: -10px;
|
|
|
+ right: -10px;
|
|
|
+ border-radius: 0 0 0 8px;
|
|
|
+ img{
|
|
|
+ width: 64rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .cardno {
|
|
|
+ border: 2px solid rgba(204, 204, 204, 1);
|
|
|
+ border-radius: 8px;
|
|
|
+ .title{
|
|
|
+
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .cardgo{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
</style>
|