|
@@ -3,17 +3,17 @@
|
|
|
<u-navbar title="预约充电"></u-navbar>
|
|
|
<!-- 站点详情 -->
|
|
|
<view class="station-details box">
|
|
|
- <p class="station-name">荆鹏软件园充电站</p>
|
|
|
+ <p class="station-name">{{detail.stationName}}</p>
|
|
|
<view class="details">
|
|
|
<view class="details-item">
|
|
|
- 充电桩类型:直流快充
|
|
|
+ 充电桩类型:{{detail.gunType=='1'?'直流快充':'交流慢充'}}
|
|
|
</view>
|
|
|
|
|
|
<view class="details-item">
|
|
|
- 桩号:80kW快充桩01
|
|
|
+ 桩号:{{detail.deviceName}}
|
|
|
</view>
|
|
|
<view class="details-item">
|
|
|
- 枪号:02号充电枪
|
|
|
+ 枪号:{{id}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -83,7 +83,7 @@
|
|
|
return {
|
|
|
id:0,
|
|
|
detail:{},
|
|
|
- timeList:[15,30],
|
|
|
+ timeList:[],
|
|
|
numList:[60,90,120,0],
|
|
|
apointment:"",
|
|
|
selectTime:15,
|
|
@@ -97,47 +97,27 @@
|
|
|
},
|
|
|
methods:{
|
|
|
submit(){
|
|
|
-
|
|
|
- uni.reLaunch({
|
|
|
- url:"/pages/user/preengaged/preengagedListDetails?&isback=1"
|
|
|
- })
|
|
|
- return;
|
|
|
-
|
|
|
+
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
|
- })
|
|
|
-
|
|
|
- //this.submitForm.deviceNo = this.detail.deviceNo;
|
|
|
- API.startCarCharging(this.submitForm).then((res) => {
|
|
|
+ })
|
|
|
+ API.submitAppointment({
|
|
|
+ gunNo:this.id,
|
|
|
+ waitMinute:this.selectTime,
|
|
|
+ chargingMinute:this.selectNum,
|
|
|
+ }).then((res) => {
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
uni.reLaunch({
|
|
|
- url:"/pages/user/preengaged/preengagedListDetails?id="+res.data.id+"&isback=1"
|
|
|
+ url:"/pages/user/preengaged/preengagedListDetails?id="+res.data+"&isback=1"
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
}).catch(error => {
|
|
|
- uni.hideLoading()
|
|
|
- if (error == '用户账户余额不足!') {
|
|
|
- uni.showModal({
|
|
|
- title: '支付',
|
|
|
- content: '用户账户余额不足,是否充值?',
|
|
|
- success: res => {
|
|
|
- if (res.confirm) {
|
|
|
- //付钱 改为组件
|
|
|
- this.gotoUrl("pages/user/finance/recharge");
|
|
|
-
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: error
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
+ uni.showToast({
|
|
|
+ title: error
|
|
|
+ })
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
getInfo(){
|
|
|
newsApi.findConfigureByKey({
|
|
@@ -149,19 +129,30 @@
|
|
|
}).catch(error => {
|
|
|
|
|
|
})
|
|
|
- return
|
|
|
+
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
|
})
|
|
|
- API.couponList({
|
|
|
- id:this.id,
|
|
|
- selectTime:this.selectTime,
|
|
|
- selectNum:this.selectNum,
|
|
|
+ API.information({
|
|
|
+ gunNo:this.id,
|
|
|
+
|
|
|
}).then((res) => {
|
|
|
uni.hideLoading()
|
|
|
- this.detail= res.data.recordsTotal;
|
|
|
-
|
|
|
+
|
|
|
+ this.detail= {
|
|
|
+ stationName:res.data.gun.stationName,
|
|
|
+ deviceName:res.data.gun.deviceName,
|
|
|
+ gunType:res.data.gun.gunType,
|
|
|
+ };
|
|
|
+ if(res.data.gunShare.reserveMinutes){
|
|
|
+
|
|
|
+ this.timeList=res.data.gunShare.reserveMinutes.split(",")
|
|
|
+ this.selectTime=this.timeList[0]
|
|
|
+ if(this.timeList.indexOf("30")>-1){
|
|
|
+ this.selectTime='30'
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
@@ -170,15 +161,7 @@
|
|
|
})
|
|
|
|
|
|
|
|
|
- newsApi.findConfigureByKey({
|
|
|
- key:"apointment"
|
|
|
- }).then((res) => {
|
|
|
-
|
|
|
- this.apointment = res.data;
|
|
|
-
|
|
|
- }).catch(error => {
|
|
|
-
|
|
|
- })
|
|
|
+
|
|
|
|
|
|
},
|
|
|
getPercent(estimateMinute) {
|
|
@@ -243,7 +226,7 @@
|
|
|
justify-content: space-between;
|
|
|
|
|
|
.details-item {
|
|
|
- width: 45%;
|
|
|
+ width: 95%;
|
|
|
color: rgba(102, 102, 102, 100);
|
|
|
line-height: 20px;
|
|
|
text-align: left;
|