|
@@ -5,53 +5,29 @@ const {
|
|
|
Page({
|
|
|
data: {
|
|
|
isLoggedIn: false,
|
|
|
- userInfo: null,
|
|
|
+ userInfo: {},
|
|
|
scanTitle: '扫码加油',
|
|
|
- scanTip: '请扫描加油机键盘上的二维码'
|
|
|
+ scanTip: '请扫描加油机键盘上的二维码',
|
|
|
+ paymentMode:0
|
|
|
},
|
|
|
|
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
- var wxChatID = wx.getStorageSync("WachatID")
|
|
|
- console.log("wxchatid", wxChatID);
|
|
|
- if (wxChatID) {
|
|
|
- api.request_GetSiteInfo().then(res => {
|
|
|
- console.log("站点信息",res)
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ api.request_GetSiteInfo().then(res => {
|
|
|
+ if(res.data.statusCode != 200) return
|
|
|
+ console.log("站点信息",res)
|
|
|
this.setData({
|
|
|
isLoggedIn: true,
|
|
|
- userInfo: null,
|
|
|
+ userInfo: res.data.data.userInfo,
|
|
|
scanTitle: '扫码加油',
|
|
|
- scanTip: '请扫码加油机键盘上的二维码'
|
|
|
+ scanTip: '请扫码加油机键盘上的二维码',
|
|
|
+ paymentMode:res.data.data.site.paymentMode
|
|
|
})
|
|
|
- }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log("获取站点信息失败",err)
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
toLoginOrOrderPage: function () {
|
|
@@ -64,8 +40,26 @@ Page({
|
|
|
url: '../historyOrder/historyOrder',
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ scanCode: function () {
|
|
|
+ const that = this;
|
|
|
+ wx.scanCode({
|
|
|
+ success(res) {
|
|
|
+ console.log('扫码结果:', res.result);
|
|
|
+ wx.showToast({
|
|
|
+ title: res.result,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.error('扫码失败:', err);
|
|
|
+ wx.showToast({
|
|
|
+ title: '扫码失败',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|