|
|
@@ -12,7 +12,9 @@ export default {
|
|
|
// 全局混入,插入全局工具函数
|
|
|
$util: this.$util,
|
|
|
// 全局混入,插入全局跳转函数
|
|
|
- pageTo: pageTo,
|
|
|
+ pageTo: pageTo,
|
|
|
+ AUTHORITY_SHOW: false,
|
|
|
+ shopAdminId: null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -20,7 +22,8 @@ export default {
|
|
|
...mapGetters(["getLoginInfo"])
|
|
|
},
|
|
|
// 页面生命周期才触发
|
|
|
- onLoad: function (option) {
|
|
|
+ onLoad: function (option) {
|
|
|
+ console.log(11111)
|
|
|
this.option = option || null
|
|
|
if (option.token) {
|
|
|
uni.setStorageSync('token', option.token)
|
|
|
@@ -28,39 +31,40 @@ export default {
|
|
|
if (option.account) {
|
|
|
uni.setStorageSync('account', option.account)
|
|
|
}
|
|
|
- uni.setStorageSync('currentQuery', JSON.stringify(option))
|
|
|
-
|
|
|
- if(this.$util.isEmpty(this.getLoginInfo)){
|
|
|
- wxLoginFn(true).then(res => {
|
|
|
- //客户可以访问的地址
|
|
|
- var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official', 'pagesClient/member/bind', 'pagesShare/pay','pagesPurchase/ghsProduct'];
|
|
|
- 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()
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ uni.setStorageSync('currentQuery', JSON.stringify(option))
|
|
|
+ console.log(uni.getStorageSync('SHOPADMINID'),'this.shopAdminId')
|
|
|
+ if (uni.getStorageSync('SHOPADMINID') == '0') {
|
|
|
+ this.AUTHORITY_SHOW = true
|
|
|
+ }
|
|
|
+ if (this.$util.isEmpty(this.getLoginInfo)) {
|
|
|
+ wxLoginFn(true).then(res => {
|
|
|
+ //客户可以访问的地址
|
|
|
+ var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official', 'pagesClient/member/bind', 'pagesShare/pay', 'pagesPurchase/ghsProduct'];
|
|
|
+ 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.AUTHORITY_SHOW = true;
|
|
|
+ uni.setStorageSync('SHOPADMINID', res.data.shopAdminId)
|
|
|
+ this.shopAdminId = true;
|
|
|
+ } else {
|
|
|
+ uni.removeStorageSync('SHOPADMINID')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getUser(true)
|
|
|
+ //获取门店信息
|
|
|
+ this.setUserShopAll()
|
|
|
+ if (this.init) {
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
onShow(){
|
|
|
@@ -71,7 +75,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions(['setUserShopAll'])
|
|
|
+ ...mapActions(['setUserShopAll']),
|
|
|
+ toFreeApply_HOME () {
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: "/pagesClient/official/index",
|
|
|
+ type: 2,
|
|
|
+ query: {
|
|
|
+ ...this.option
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
if (this.mInit) {
|