|
@@ -5,15 +5,12 @@
|
|
<view class="title">请选择充电金额</view>
|
|
<view class="title">请选择充电金额</view>
|
|
<p>当前余额¥{{user.balance}}</p>
|
|
<p>当前余额¥{{user.balance}}</p>
|
|
<view class="rechargeMain">
|
|
<view class="rechargeMain">
|
|
- <view class="recharge-item"
|
|
|
|
- @click="moneyClick(item.id)"
|
|
|
|
- :class="!otherNum&&moneyActiveClass == item.id ? 'active' : ''"
|
|
|
|
- v-for="(item,index) in moneyList" :key="item.id">
|
|
|
|
|
|
+ <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}}元
|
|
{{item.name}}元
|
|
</view>
|
|
</view>
|
|
- <view class="recharge-item"
|
|
|
|
- :class="otherNum ? 'active' : ''"
|
|
|
|
- style="
|
|
|
|
|
|
+ <view class="recharge-item" :class="otherNum ? 'active' : ''" style="
|
|
padding: 8px 0px;">
|
|
padding: 8px 0px;">
|
|
<u-input v-model="otherNum" @input="ckInput" type="digit" placeholder="其他充值金额" />
|
|
<u-input v-model="otherNum" @input="ckInput" type="digit" placeholder="其他充值金额" />
|
|
|
|
|
|
@@ -25,14 +22,35 @@
|
|
|
|
|
|
</view>
|
|
</view>
|
|
<p>其他充电模式</p>
|
|
<p>其他充电模式</p>
|
|
- <view
|
|
|
|
-
|
|
|
|
- @click="moneyClick(-1)"
|
|
|
|
- :class="!otherNum&&moneyActiveClass == -1? 'active' : ''"
|
|
|
|
- class="self-stop ">
|
|
|
|
|
|
+ <view @click="moneyClick(-1)" :class="!otherNum&&moneyActiveClass == -1? 'active' : ''" class="self-stop ">
|
|
充满自停
|
|
充满自停
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
+ <!-- 优惠券 -->
|
|
|
|
+ <view class="discounts">
|
|
|
|
+ <view class="title">
|
|
|
|
+ <view class="title-1">
|
|
|
|
+ 优惠券
|
|
|
|
+ </view>
|
|
|
|
+ <view class="title-2">
|
|
|
|
+ 每次只能使用1张
|
|
|
|
+ </view>
|
|
|
|
+ <view class="title-3">
|
|
|
|
+ -¥6.00
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="select">
|
|
|
|
+ <u-radio-group v-model="value" @change="radioGroupChange" wrap="true">
|
|
|
|
+ <u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.name"
|
|
|
|
+ :disabled="item.disabled">
|
|
|
|
+ {{item.name}}
|
|
|
|
+
|
|
|
|
+ </u-radio>
|
|
|
|
+ <view class="explain">使用说明</view>
|
|
|
|
+ </u-radio-group>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -47,16 +65,16 @@
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
- return {
|
|
|
|
- moneyActiveClass:"5",
|
|
|
|
|
|
+ return {
|
|
|
|
+ moneyActiveClass: "5",
|
|
detail: {},
|
|
detail: {},
|
|
//提交信息
|
|
//提交信息
|
|
submitForm: {
|
|
submitForm: {
|
|
deviceNo: '',
|
|
deviceNo: '',
|
|
channelNo: '',
|
|
channelNo: '',
|
|
carNumber: '',
|
|
carNumber: '',
|
|
- chargeStrategy: 2,
|
|
|
|
- amount:0
|
|
|
|
|
|
+ chargeStrategy: 2,
|
|
|
|
+ amount: 0
|
|
//paytype:'YE',
|
|
//paytype:'YE',
|
|
},
|
|
},
|
|
user: {},
|
|
user: {},
|
|
@@ -83,16 +101,29 @@
|
|
},
|
|
},
|
|
|
|
|
|
],
|
|
],
|
|
-
|
|
|
|
|
|
+ // 优惠券
|
|
|
|
+ list: [{
|
|
|
|
+ name: '满50元减6元',
|
|
|
|
+ disabled: false
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '满30元减3元',
|
|
|
|
+ disabled: false
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '满100减15元 未满足使用条件',
|
|
|
|
+ disabled: false
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(op) {
|
|
onLoad(op) {
|
|
if (op.deviceNo) {
|
|
if (op.deviceNo) {
|
|
- this.submitForm.deviceNo = op.deviceNo;
|
|
|
|
- this.submitForm.channelNo = op.gun;
|
|
|
|
|
|
+ this.submitForm.deviceNo = op.deviceNo;
|
|
|
|
+ this.submitForm.channelNo = op.gun;
|
|
this.submitForm.carNumber = '鄂DD12352';
|
|
this.submitForm.carNumber = '鄂DD12352';
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -100,41 +131,41 @@
|
|
onShow() {
|
|
onShow() {
|
|
this.getHomePage()
|
|
this.getHomePage()
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
- ckInput(text){
|
|
|
|
- if(text.indexOf('.')>0){
|
|
|
|
-
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
- this.otherNum=text.substring(0,text.indexOf('.'))
|
|
|
|
- uni.showToast({
|
|
|
|
- title:"请输入正整数"
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- var t =Number(text);
|
|
|
|
- if(t<1){
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
- this.otherNum='';
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- if(t>500){
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
- this.otherNum=500;
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- moneyClick(index) {
|
|
|
|
- this.moneyActiveClass = index;
|
|
|
|
-
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ ckInput(text) {
|
|
|
|
+ if (text.indexOf('.') > 0) {
|
|
|
|
+
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.otherNum = text.substring(0, text.indexOf('.'))
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "请输入正整数"
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ var t = Number(text);
|
|
|
|
+ if (t < 1) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.otherNum = '';
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (t > 500) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.otherNum = 500;
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ moneyClick(index) {
|
|
|
|
+ this.moneyActiveClass = index;
|
|
|
|
+
|
|
},
|
|
},
|
|
- confirm() {
|
|
|
|
-
|
|
|
|
- //console.log(JSON.stringify(this.submitForm))
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ confirm() {
|
|
|
|
+
|
|
|
|
+ //console.log(JSON.stringify(this.submitForm))
|
|
|
|
+
|
|
|
|
+
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: "加载中",
|
|
title: "加载中",
|
|
mask: true,
|
|
mask: true,
|
|
@@ -143,10 +174,10 @@
|
|
//this.submitForm.deviceNo = this.detail.deviceNo;
|
|
//this.submitForm.deviceNo = this.detail.deviceNo;
|
|
API.startCarCharging(this.submitForm).then((res) => {
|
|
API.startCarCharging(this.submitForm).then((res) => {
|
|
console.log(JSON.stringify(this.res))
|
|
console.log(JSON.stringify(this.res))
|
|
- this.gotoUrl("pages/searchPile/chargeProcess/dcCharging?id="+res.data.recordId);
|
|
|
|
|
|
+ this.gotoUrl("pages/searchPile/chargeProcess/dcCharging?id=" + res.data.recordId);
|
|
|
|
|
|
|
|
|
|
- }).catch(error => {
|
|
|
|
|
|
+ }).catch(error => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
if (error == '用户账户余额不足!') {
|
|
if (error == '用户账户余额不足!') {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -186,29 +217,29 @@
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
submit() {
|
|
submit() {
|
|
-
|
|
|
|
- if(this.moneyActiveClass==-1&&!this.otherNum){
|
|
|
|
- this.submitForm.chargeStrategy=0;
|
|
|
|
- this.submitForm.amount=0
|
|
|
|
- }else{
|
|
|
|
- this.submitForm.chargeStrategy=2;
|
|
|
|
- if(this.otherNum){
|
|
|
|
- this.submitForm.amount=this.otherNum
|
|
|
|
- }else{
|
|
|
|
- this.submitForm.amount=this.moneyActiveClass
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ if (this.moneyActiveClass == -1 && !this.otherNum) {
|
|
|
|
+ this.submitForm.chargeStrategy = 0;
|
|
|
|
+ this.submitForm.amount = 0
|
|
|
|
+ } else {
|
|
|
|
+ this.submitForm.chargeStrategy = 2;
|
|
|
|
+ if (this.otherNum) {
|
|
|
|
+ this.submitForm.amount = this.otherNum
|
|
|
|
+ } else {
|
|
|
|
+ this.submitForm.amount = this.moneyActiveClass
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (!this.submitForm.channelNo) {
|
|
if (!this.submitForm.channelNo) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请先选择充电通道'
|
|
title: '请先选择充电通道'
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
if (this.submitForm.chargeStrategy == 0 && this.user.balance < 5) {
|
|
if (this.submitForm.chargeStrategy == 0 && this.user.balance < 5) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '支付',
|
|
title: '支付',
|
|
@@ -257,6 +288,11 @@
|
|
.recharge-item:last-child {
|
|
.recharge-item:last-child {
|
|
font-size: 14px !important;
|
|
font-size: 14px !important;
|
|
color: #999999;
|
|
color: #999999;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .u-input {
|
|
|
|
+ text-align: center !important;
|
|
}
|
|
}
|
|
|
|
|
|
.recharge {
|
|
.recharge {
|
|
@@ -270,13 +306,15 @@
|
|
color: #666;
|
|
color: #666;
|
|
margin-top: 4px;
|
|
margin-top: 4px;
|
|
}
|
|
}
|
|
- .self-stop.active{
|
|
|
|
-
|
|
|
|
- background-color: #EFFFF7;
|
|
|
|
- border-color: #00B962;
|
|
|
|
- color: #00B962;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ .self-stop.active {
|
|
|
|
+
|
|
|
|
+ background-color: #EFFFF7;
|
|
|
|
+ border-color: #00B962;
|
|
|
|
+ color: #00B962;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
.rechargeMain {
|
|
.rechargeMain {
|
|
display: flex;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
@@ -334,9 +372,13 @@
|
|
}
|
|
}
|
|
|
|
|
|
.but-box {
|
|
.but-box {
|
|
- width: 335px;
|
|
|
|
|
|
+ width: 89.3%;
|
|
height: 44px;
|
|
height: 44px;
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
|
|
+ position: fixed;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ left: 0;
|
|
|
|
|
|
.u-size-default[data-v-3bf2dba7] {
|
|
.u-size-default[data-v-3bf2dba7] {
|
|
background-color: rgba(0, 185, 98, 100);
|
|
background-color: rgba(0, 185, 98, 100);
|
|
@@ -345,4 +387,79 @@
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //优惠券
|
|
|
|
+ .discounts {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ width: 100%;
|
|
|
|
+
|
|
|
|
+ .title {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+
|
|
|
|
+ .title-1 {
|
|
|
|
+ width: 48px;
|
|
|
|
+ height: 22px;
|
|
|
|
+ color: rgba(16, 16, 16, 100);
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title-2 {
|
|
|
|
+ margin-left: 4px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title-3 {
|
|
|
|
+ margin-left: 126px;
|
|
|
|
+ height: 19px;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .select {
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ /deep/.u-radio {
|
|
|
|
+ padding: 18px 16px;
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 48px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ background-color: rgba(255, 255, 255, 100);
|
|
|
|
+ text-align: center;
|
|
|
|
+ border: 1px solid rgba(227, 227, 227, 100);
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /deep/.u-radio:nth-child(3) {
|
|
|
|
+ background-color: #e3e3e3 !important;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /deep/.u-radio__icon-wrap {
|
|
|
|
+ left: 16px;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /deep/.u-radio__label {
|
|
|
|
+ margin-left: 40px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .explain {
|
|
|
|
+ width: 64px;
|
|
|
|
+ height: 24px;
|
|
|
|
+ line-height: 24px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 24px;
|
|
|
|
+ right: 12px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ background-color: rgba(255, 255, 255, 100);
|
|
|
|
+ text-align: center;
|
|
|
|
+ border: 1px solid rgba(227, 227, 227, 100);
|
|
|
|
+ color: rgba(0, 185, 98, 100);
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|