|
@@ -20,6 +20,7 @@ App({
|
|
var that = this;
|
|
var that = this;
|
|
|
|
|
|
this.getLocation();
|
|
this.getLocation();
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -30,6 +31,7 @@ App({
|
|
console.log(res)
|
|
console.log(res)
|
|
},
|
|
},
|
|
fail: (res) => {
|
|
fail: (res) => {
|
|
|
|
+ this.login();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -44,6 +46,8 @@ App({
|
|
status: ['可下单', '服务中', '已满柜', '暂停服务'],
|
|
status: ['可下单', '服务中', '已满柜', '暂停服务'],
|
|
baseAppUrl: projectMode == 2 ? 'https://wash.nanodreamtech.com/' : (projectMode == 1 ? 'https://wash.nanodreamtech.com/' : 'http://127.0.0.1:8000/'),
|
|
baseAppUrl: projectMode == 2 ? 'https://wash.nanodreamtech.com/' : (projectMode == 1 ? 'https://wash.nanodreamtech.com/' : 'http://127.0.0.1:8000/'),
|
|
location: "",
|
|
location: "",
|
|
|
|
+ token:"",
|
|
|
|
+ nid:0,
|
|
islocation: true
|
|
islocation: true
|
|
},
|
|
},
|
|
api: api,
|
|
api: api,
|
|
@@ -85,7 +89,12 @@ App({
|
|
},
|
|
},
|
|
|
|
|
|
login(lat = "", lng = "") {
|
|
login(lat = "", lng = "") {
|
|
|
|
+
|
|
var that = this;
|
|
var that = this;
|
|
|
|
+ if(!lat || !lng){
|
|
|
|
+ lat=wx.getStorageSync('latitude')
|
|
|
|
+ lng=wx.getStorageSync('longitude')
|
|
|
|
+ }
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
console.log(3333333)
|
|
console.log(3333333)
|
|
wx.checkSession({
|
|
wx.checkSession({
|
|
@@ -112,6 +121,9 @@ App({
|
|
}, 1000);
|
|
}, 1000);
|
|
} else {
|
|
} else {
|
|
wx.hideLoading();
|
|
wx.hideLoading();
|
|
|
|
+ that.globalData.token= res.message.token;
|
|
|
|
+ that.globalData.nid= res.message.network_id;
|
|
|
|
+
|
|
wx.setStorageSync('token', res.message.token);
|
|
wx.setStorageSync('token', res.message.token);
|
|
wx.setStorageSync('uid', res.message.user_id);
|
|
wx.setStorageSync('uid', res.message.user_id);
|
|
wx.setStorageSync('exp_time', res.message.exp_time);
|
|
wx.setStorageSync('exp_time', res.message.exp_time);
|