|
@@ -8,7 +8,8 @@ Page({
|
|
|
data: {
|
|
|
chargPile: null,
|
|
|
orderid: null,
|
|
|
- userId: null
|
|
|
+ userId: null,
|
|
|
+ repaidbalance: 0
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -38,6 +39,33 @@ Page({
|
|
|
}
|
|
|
});
|
|
|
log.info('[扫码]', '[加载完成]', '[参数]', res.data);
|
|
|
+ let userInfo = wx.getStorageSync('userInfo');
|
|
|
+ wx.request({
|
|
|
+ url: getApp().globalData.postHeadAgreement + '/restapi/wechat/syncUser',
|
|
|
+ data: {
|
|
|
+ loginName: userInfo.loginName
|
|
|
+ },
|
|
|
+ method: 'POST',
|
|
|
+ success: function (res) {
|
|
|
+ let {
|
|
|
+ data
|
|
|
+ } = res;
|
|
|
+ log.info('[扫码]', '[同步用户数据]', '[响应]', data);
|
|
|
+ console.info('[扫码]', '[同步用户数据]', '[响应]', data);
|
|
|
+ if (data.code && data.code != 200) {
|
|
|
+ log.info('[扫码]', '[同步用户数据]', '[失败data null||data.code<>200跳转登陆界面]', data);
|
|
|
+ } else {
|
|
|
+ that.setData({
|
|
|
+ repaidbalance:data.repaidbalance
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail(e) {
|
|
|
+ console.log("用户数据同步失败");
|
|
|
+ log.info('[扫码]', '[同步用户数据]', '[fail]', e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -65,7 +93,10 @@ Page({
|
|
|
let {
|
|
|
data
|
|
|
} = res;
|
|
|
+
|
|
|
+
|
|
|
log.info('[扫码]', '[同步用户数据]', '[响应]', data);
|
|
|
+ console.info('[扫码]', '[同步用户数据]', '[响应]', data);
|
|
|
if (data.code && data.code != 200) {
|
|
|
wx.removeStorageSync('userInfo');
|
|
|
wx.removeStorageSync('isLogin');
|
|
@@ -77,7 +108,11 @@ Page({
|
|
|
} else {
|
|
|
wx.setStorageSync('userInfo', data);
|
|
|
wx.setStorageSync('isLogin', true);
|
|
|
-
|
|
|
+ let repaidbalance = data.repaidbalance;
|
|
|
+ that.setData({
|
|
|
+ repaidbalance
|
|
|
+ });
|
|
|
+ console.info("sssssss " + data.repaidbalance)
|
|
|
//开始充电
|
|
|
if (!data.repaidbalance || data.repaidbalance <= 0) {
|
|
|
wx.showModal({
|