...
|
...
|
@@ -3,6 +3,7 @@ import udid from './common/udid'; |
|
|
import event from './common/event';
|
|
|
import {verify} from './common/api';
|
|
|
import config from './common/config';
|
|
|
import commonModel from './models/common';
|
|
|
import Promise from './vendors/es6-promise';
|
|
|
import { MD5 } from './vendors/crypto';
|
|
|
import { wechatAuthLogin, verifySessionKey } from './common/login';
|
...
|
...
|
@@ -72,6 +73,9 @@ App({ |
|
|
this.globalData.systemInfo = res;
|
|
|
});
|
|
|
|
|
|
// 获取关联店铺
|
|
|
this.getUnionShop();
|
|
|
|
|
|
// 设置渠道来源
|
|
|
if (options && options.query && options.query.union_type) {
|
|
|
this.globalData.union_type = options.query.union_type;
|
...
|
...
|
@@ -112,6 +116,18 @@ App({ |
|
|
this.wechatAuthLogin();
|
|
|
}, 1000);
|
|
|
},
|
|
|
getUnionShop() {
|
|
|
commonModel.getBindShop({ app_id: config.appid})
|
|
|
.then(res => {
|
|
|
if (res.code === 200) {
|
|
|
if (res.data && res.data.shopId) {
|
|
|
this._setSync('app_bind_shop_id', res.data.shopId);
|
|
|
this._setSync('app_bind_union_type', res.data.unionType);
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
_getSync(key) {
|
|
|
try {
|
|
|
return wx.getStorageSync(key);
|
...
|
...
|
|