|
|
@@ -28,50 +28,43 @@ export default {
|
|
|
uni.setStorageSync('account', option.account)
|
|
|
}
|
|
|
uni.setStorageSync('currentQuery', JSON.stringify(option))
|
|
|
- // if (isLogin()) {
|
|
|
- // if (this.init) {
|
|
|
- // this.init()
|
|
|
- // }
|
|
|
- // }else{}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ if (!isLogin()) {
|
|
|
+ wxLoginFn(true).then(res => {
|
|
|
+ //客户可以访问的页面
|
|
|
+ var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official','pagesClient/member/bind','pagesShare/pay'];
|
|
|
+ var redirectPage = res.redirectPage;
|
|
|
+ var needRedirect = true;
|
|
|
+ urlArr.forEach((item, index, array) => {
|
|
|
+ if (redirectPage.indexOf(item) != -1) {
|
|
|
+ needRedirect = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (needRedirect === true) {
|
|
|
+ //客户访问不能查看的页面跳转去官网
|
|
|
+ if (res.data.shopAdminId == '0') {
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: "/pagesClient/official/index",
|
|
|
+ type: 2,
|
|
|
+ query: {
|
|
|
+ ...this.option
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getUser(true)
|
|
|
+ //获取门店信息
|
|
|
+ this.setUserShopAll()
|
|
|
+ if (this.init) {
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
onShow(){
|
|
|
if (isLogin()) {
|
|
|
if (this.init) {
|
|
|
this.init()
|
|
|
}
|
|
|
- }else{
|
|
|
- wxLoginFn(true).then(res => {
|
|
|
- //客户可以访问的页面
|
|
|
- var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official','pagesClient/member/bind','pagesShare/pay'];
|
|
|
- var redirectPage = res.redirectPage;
|
|
|
- var needRedirect = true;
|
|
|
- urlArr.forEach((item, index, array) => {
|
|
|
- if (redirectPage.indexOf(item) != -1) {
|
|
|
- needRedirect = false;
|
|
|
- }
|
|
|
- })
|
|
|
- if (needRedirect === true) {
|
|
|
- //客户访问不能查看的页面跳转去官网
|
|
|
- if (res.data.shopAdminId == '0') {
|
|
|
- this.$util.pageTo({
|
|
|
- url: "/pagesClient/official/index",
|
|
|
- type: 2,
|
|
|
- query: {
|
|
|
- ...this.option
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- getUser(true)
|
|
|
- //获取门店信息
|
|
|
- this.setUserShopAll()
|
|
|
- if (this.init) {
|
|
|
- this.init()
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
},
|