|
@@ -40,20 +40,36 @@ Page({
|
|
|
onShow: function (options) {
|
|
|
this.setData({
|
|
|
islocation: wx.getStorageSync('islocation'),
|
|
|
- status: app.globalData.status
|
|
|
+ status: app.globalData.status,
|
|
|
+
|
|
|
})
|
|
|
- this.workDesc();
|
|
|
+ var nid =wx.getStorageSync('nid');
|
|
|
+ var token =wx.getStorageSync('token');
|
|
|
+ if(!nid || !token){
|
|
|
+ app.login().then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.setData({
|
|
|
+ token: res.message.token,
|
|
|
+ nid: res.message.network_id
|
|
|
+ })
|
|
|
+ this.workDesc(res.message.network_id);
|
|
|
+ })
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.workDesc(nid);
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
onReady: function () {
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
//网点详情
|
|
|
- workDesc: function () {
|
|
|
+ workDesc: function (nid="") {
|
|
|
var that = this;
|
|
|
- var nid = wx.getStorageSync('nid');
|
|
|
+
|
|
|
if (!nid) {
|
|
|
that.setData({
|
|
|
- worke: { 'title': '请选择网点', 'institution_id': 0, 'business_status': '不可下单', 'distance': 0 }
|
|
|
+ worke: { 'title': '请选择网点', 'institution_id': 0, 'business_status': 3, 'distance': 0 }
|
|
|
})
|
|
|
return false;
|
|
|
}
|