|
@@ -21,7 +21,7 @@ Page({
|
|
|
success: function (res) {
|
|
|
//console.log(res);
|
|
|
//console.log(res.data);
|
|
|
- var chargPile = res.data;
|
|
|
+ var chargPile = res.data;
|
|
|
chargPile.sharpTotalPrice = (chargPile.sharpChargPrice + chargPile.sharpServicePrice).toFixed(4);
|
|
|
chargPile.peakTotalPrice = (chargPile.peakChargPrice + chargPile.peakServicePrice).toFixed(4);
|
|
|
chargPile.flatTotalPrice = (chargPile.flatChargPrice + chargPile.flatServicePrice).toFixed(4);
|
|
@@ -77,25 +77,25 @@ Page({
|
|
|
} else {
|
|
|
wx.setStorageSync('userInfo', data);
|
|
|
wx.setStorageSync('isLogin', true);
|
|
|
-
|
|
|
+
|
|
|
//开始充电
|
|
|
- if (!data.repaidbalance||data.repaidbalance<=0){
|
|
|
+ if (!data.repaidbalance || data.repaidbalance <= 0) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '余额不足,请充值!',
|
|
|
success: function (res) {
|
|
|
- if (res.confirm){
|
|
|
+ if (res.confirm) {
|
|
|
let url = "/pages/chargemoney/chargemoney";
|
|
|
wx.navigateTo({
|
|
|
url
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
log.info('[扫码]', '[同步用户数据]', '[data.repaidbalance null||data.repaidbalance<=0余额不足跳转充值界面]', data);
|
|
|
- } else if (data.repaidbalance > 0 && data.repaidbalance<=15){
|
|
|
+ } else if (data.repaidbalance > 0 && data.repaidbalance <= 15) {
|
|
|
wx.showModal({
|
|
|
- title: '余额:' + data.repaidbalance+'元',
|
|
|
+ title: '余额:' + data.repaidbalance + '元',
|
|
|
showCancel: false,
|
|
|
confirmText: "去充值",
|
|
|
content: '余额过低,请尽快充值!',
|
|
@@ -104,8 +104,8 @@ Page({
|
|
|
let url = "/pages/chargemoney/chargemoney";
|
|
|
wx.navigateTo({
|
|
|
url
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
log.info('[扫码]', '[同步用户数据]', '[0<data.repaidbalance<=15余额过低]', data);
|
|
@@ -118,7 +118,7 @@ Page({
|
|
|
// content: '余额过低,请尽快充值!',
|
|
|
// success: function (res) {
|
|
|
// if (res.confirm) {
|
|
|
-
|
|
|
+
|
|
|
// that.beginCharge_satrt();
|
|
|
// } else if (res.cancel) {
|
|
|
// let url = "/pages/chargemoney/chargemoney";
|
|
@@ -128,10 +128,10 @@ Page({
|
|
|
// }
|
|
|
// }
|
|
|
// });
|
|
|
- } else if (data.repaidbalance > 15 ) {
|
|
|
+ } else if (data.repaidbalance > 15) {
|
|
|
log.info('[扫码]', '[同步用户数据]', '[余额充足开始充电]', data);
|
|
|
that.beginCharge_satrt();
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
fail(e) {
|
|
@@ -142,7 +142,7 @@ Page({
|
|
|
|
|
|
|
|
|
},
|
|
|
- beginCharge_satrt(){
|
|
|
+ beginCharge_satrt() {
|
|
|
wx.showLoading({
|
|
|
title: '开启充电中...',
|
|
|
mask: true
|
|
@@ -188,8 +188,8 @@ Page({
|
|
|
data
|
|
|
} = res;
|
|
|
log.info('[扫码]', '[开始充电]', '[响应]', data);
|
|
|
- if (data && data.code == 200 ) {
|
|
|
- //if (data && data.code == 200 && data.orderid) {
|
|
|
+ if (data && data.code == 200) {
|
|
|
+ //if (data && data.code == 200 && data.orderid) {
|
|
|
//开启充电成功,跳转到正在充电界面
|
|
|
let {
|
|
|
orderid
|
|
@@ -213,8 +213,8 @@ Page({
|
|
|
showCancel: false,
|
|
|
content: data.message
|
|
|
});
|
|
|
- log.info('[扫码]', '[开始充电]', '[失败data.code=502' + data.message+']', data);
|
|
|
- }else {
|
|
|
+ log.info('[扫码]', '[开始充电]', '[失败data.code=502' + data.message + ']', data);
|
|
|
+ } else {
|
|
|
//开启充电失败,提示用户
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|