Răsfoiți Sursa

增加不是员工时的判断

wangn 5 ani în urmă
părinte
comite
42e17dd601

+ 1 - 0
ghsApp/src/admin/home/apply.vue

@@ -24,6 +24,7 @@
             </view>
             </view>
         </view>
         </view>
         <kd-entrance></kd-entrance>
         <kd-entrance></kd-entrance>
+        <none-hd :show="AUTHORITY_SHOW" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="true" experienceFun></none-hd>
     </view>
     </view>
 </template>
 </template>
 
 

+ 10 - 7
ghsApp/src/admin/home/me.vue

@@ -122,6 +122,7 @@
 
 
           </view>
           </view>
         </view>
         </view>
+        <none-hd :show="AUTHORITY_SHOW" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="true" experienceFun></none-hd>
       </view>
       </view>
     </template>
     </template>
     <DorpdownSelect
     <DorpdownSelect
@@ -178,13 +179,15 @@ export default {
       this.$refs.dorpdownSelect.dropdownShow = true;
       this.$refs.dorpdownSelect.dropdownShow = true;
     },
     },
     async init () {
     async init () {
-      try {
-        const { data } = await mainMy();
-        this.infoData = data;
-        //不要删除此输出,方法查看 shish 20210512
-        console.log('商家ID',data.sjId,'门店ID',data.shopId)
-        uni.stopPullDownRefresh();
-      } finally {
+      if(!this.AUTHORITY_SHOW) {
+        try {
+          const { data } = await mainMy();
+          this.infoData = data;
+          //不要删除此输出,方法查看 shish 20210512
+          console.log('商家ID',data.sjId,'门店ID',data.shopId)
+          uni.stopPullDownRefresh();
+        } finally {
+        }
       }
       }
     },
     },
     async selectSussess () {
     async selectSussess () {

+ 4 - 1
ghsApp/src/admin/home/member.vue

@@ -57,6 +57,7 @@
       <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
       <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
     </block>
     </block>
     <kd-entrance></kd-entrance>
     <kd-entrance></kd-entrance>
+    <none-hd :show="AUTHORITY_SHOW" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="true" experienceFun></none-hd>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -105,7 +106,9 @@ export default {
   onLoad(option) {},
   onLoad(option) {},
   methods: {
   methods: {
     init() {
     init() {
-      this._list();
+      if(!this.AUTHORITY_SHOW) {
+        this._list();
+      }
     },
     },
     // 列表
     // 列表
     _list() {
     _list() {

+ 1 - 0
ghsApp/src/admin/home/order.vue

@@ -129,6 +129,7 @@
       themeColor="#4C83D6"
       themeColor="#4C83D6"
       fields="day"
       fields="day"
     ></rangeDatePick>
     ></rangeDatePick>
+    <none-hd :show="AUTHORITY_SHOW" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="true" experienceFun></none-hd>
   </div>
   </div>
 </template>
 </template>
 
 

+ 24 - 3
ghsApp/src/admin/home/result.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 <!-- icondaizhifu -->
 <!-- icondaizhifu -->
-	<appResult :title="'入库成功'">
-		<button class="admin-button-com blue big">登录后台</button>
-		<button class="admin-button-com big">开启通知</button>
+	<appResult :title="status == '2' ? '审核中' : '审核通过'" :icon="status == '2' ? 'icondaizhifu' : 'iconchenggong'">
+		<button class="admin-button-com blue big" v-if="status != '2'" @click="loginSys">登录后台{{status}}</button>
+		<button class="admin-button-com big" @click="openInform">开启通知</button>
 	</appResult>
 	</appResult>
 </template>
 </template>
 
 
@@ -10,10 +10,31 @@
 import appResult from "@/components/app-result";
 import appResult from "@/components/app-result";
 export default {
 export default {
 	name: "BillingResult", // 开单结果
 	name: "BillingResult", // 开单结果
+  data(){
+    return {
+      status: '1'
+    }
+    
+  },
 	components: {
 	components: {
 		appResult
 		appResult
 	},
 	},
+  onLoad(option){
+    this.status = option.status
+  },
 	methods: {
 	methods: {
+    loginSys(){
+      this.$util.pageTo({
+        url: '/admin/home/workbench',
+        type: 4
+      })
+    },
+    openInform(){
+      this.pageTo({
+        url: '/pagesClient/official/warn',
+        type: 2
+      })
+    }
 	}
 	}
 };
 };
 </script>
 </script>

+ 8 - 2
ghsApp/src/admin/home/workbench.vue

@@ -111,6 +111,7 @@
 				</div>
 				</div>
 			</template>
 			</template>
 		</modal-module>
 		</modal-module>
+    <none-hd :show="AUTHORITY_SHOW" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="true" experienceFun></none-hd>
 	</div>
 	</div>
 </template>
 </template>
 
 
@@ -304,7 +305,12 @@ export default {
 	},
 	},
 	methods: {
 	methods: {
 		init() {
 		init() {
-			getWeixinId().then(res => {
+			if(!this.AUTHORITY_SHOW) {
+        this._init
+      }
+		},
+    _init(){
+      getWeixinId().then(res => {
 				this.getappIdList = res.data
 				this.getappIdList = res.data
 			});
 			});
 			getUser().then(res => {
 			getUser().then(res => {
@@ -334,7 +340,7 @@ export default {
 					this.totalData[5].value = asset.totalPurchase;
 					this.totalData[5].value = asset.totalPurchase;
 				}
 				}
 			});
 			});
-		},
+    },
 		goPage (item) {
 		goPage (item) {
 			if (item.url === '/admin/my-mall') {
 			if (item.url === '/admin/my-mall') {
 				this.getMyMall()
 				this.getMyMall()

+ 4 - 0
ghsApp/src/components/app-result.vue

@@ -60,6 +60,10 @@ export default {
 			font-size: 170px;
 			font-size: 170px;
 			color: $mainColor1;
 			color: $mainColor1;
 		}
 		}
+    .icondaizhifu {
+			font-size: 170px;
+			color: #ffa92e;
+		}
 		.result-title {
 		.result-title {
 			margin: 50px 0 70px;
 			margin: 50px 0 70px;
 			font-size: 32px;
 			font-size: 32px;

+ 109 - 11
ghsApp/src/mixins/globalMixins.js

@@ -2,6 +2,8 @@ import store from '@/store'
 import { mapGetters,mapActions } from 'vuex'
 import { mapGetters,mapActions } from 'vuex'
 import { pageTo, getCheckLogin, isLogin } from '@/utils/util.js'
 import { pageTo, getCheckLogin, isLogin } from '@/utils/util.js'
 import { getUser, wxLoginFn } from '@/utils/auth'
 import { getUser, wxLoginFn } from '@/utils/auth'
+import { postWxCode, getDictionaries } from '@/api/mini'
+import { getStaffApi } from '@/api/common'
 import constant from '@/constant'
 import constant from '@/constant'
 export default {
 export default {
 	data() {
 	data() {
@@ -33,7 +35,11 @@ export default {
 		if (option.account) {
 		if (option.account) {
 			uni.setStorageSync('account', option.account)
 			uni.setStorageSync('account', option.account)
 		}
 		}
-		uni.setStorageSync('currentQuery', JSON.stringify(option))
+    uni.setStorageSync('currentQuery', JSON.stringify(option))
+    console.log(uni.getStorageSync('SHOP_ADMIN_STROAGE_SHOW'),'this.shopAdminId', this.getLoginInfo, this.getLoginInfo.openShop)
+    if (uni.getStorageSync('SHOP_ADMIN_STROAGE_SHOW') == '0' || this.getLoginInfo.openShop == '2') {
+      this.AUTHORITY_SHOW = true
+    }
 		if(this.$util.isEmpty(this.getLoginInfo)){
 		if(this.$util.isEmpty(this.getLoginInfo)){
 			wxLoginFn(true).then(res => {
 			wxLoginFn(true).then(res => {
 				//客户可以访问的页面
 				//客户可以访问的页面
@@ -47,15 +53,16 @@ export default {
 				})
 				})
 				if (needRedirect === true) {
 				if (needRedirect === true) {
 					//客户访问不能查看的页面跳转去官网
 					//客户访问不能查看的页面跳转去官网
-					if (res.data.shopAdminId == '0') {
-						this.$util.pageTo({
-							url: "/pagesClient/official/index",
-							type: 2,
-							query: {
-								...this.option
-							}
-						});
-					}
+          if (res.data.shopAdminId == '0' && res.data.admin.openShop == '1') {
+            this.AUTHORITY_SHOW = true;
+            uni.setStorageSync('SHOP_ADMIN_STROAGE_SHOW', res.data.shopAdminId)
+					} else if (res.data.admin.openShop == '2' && res.data.shopAdminId == '0') {
+            this.MODEL_TITLE = '已申请'
+            this.MODEL_BTN_TEXT = '查看申请进度'
+            this.AUTHORITY_SHOW = true
+            uni.removeStorageSync('SHOP_ADMIN_STROAGE_SHOW')
+            uni.setStorageSync('OPEN_SHOP_ID', res.data.admin.openShop)
+          }
 				}
 				}
 				getUser(true)
 				getUser(true)
 				//获取门店信息
 				//获取门店信息
@@ -77,7 +84,98 @@ export default {
 
 
 	},
 	},
 	methods: {
 	methods: {
-		...mapActions(['setUserShopAll'])
+    ...mapActions(['setUserShopAll']),
+    toFreeApply_HOME () {
+      let status = ''
+        if (uni.getStorageSync('SHOP_ADMIN_STROAGE_SHOW') == '0') {
+          this.$util.pageTo({
+            url: "/pagesClient/official/index",
+            type: 2,
+            query: {
+              ...this.option
+            }
+          });
+        } else {
+          getStaffApi().then(res => {
+            console.log(res)
+            if (res.data.openShop == '2') {
+              status = '2'
+            } else if (res.data.openShop == '3') {
+              status = '3'
+            }
+            this.$util.pageTo({
+              url: '/admin/home/result',
+              type: 2,
+              query: {
+                status
+              }
+            })
+          }).catch(err => {})
+          // this.$util.pageTo({
+          //   url: '/admin/home/result',
+          //   type: 2,
+          //   query: {
+          //     status: '2'
+          //   }
+          // })
+      }
+    },
+    experienceFun(){
+      /**姜枫 2021.04.30  小程序审核体验账号**/
+      postWxCode().then(subRes => {
+        if (this.$util.isEmpty(subRes)) {
+          return false
+        }
+        uni.setStorageSync('token', subRes.data.token)
+        uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
+        getDictionaries({ token: subRes.data.token }).then(res => {
+          if (this.$util.isEmpty(res)) {
+            return false
+          }
+          this.$store.commit('setDictionariesInfo', {
+            ...res.data.dict,
+            ...res.data
+          })
+          this.$store.commit('setMyShopInfo', {
+            ...res.data.shop,
+            ...res.data
+          })
+        })
+        this.$store.commit('setLoginInfo', {
+          ...subRes.data.admin,
+          ...subRes.data
+        })
+        uni.removeStorageSync('SHOP_ADMIN_STROAGE_SHOW')
+        uni.removeStorageSync('OPEN_SHOP_ID')
+        this.AUTHORITY_SHOW = false
+        //启动更新逻辑 shish 2020.5.18
+        if (subRes.data.update == 1) {
+          const updateManager = wx.getUpdateManager()
+          updateManager.onCheckForUpdate(function (res) {
+            // 请求完新版本信息的回调
+            console.log(res.hasUpdate)
+          })
+          updateManager.onUpdateReady(function () {
+            wx.showModal({
+              title: '更新提示',
+              content: '新版本已经准备好,是否重启应用?',
+              success(res) {
+                if (res.confirm) {
+                  // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+                  updateManager.applyUpdate()
+                }
+              }
+            })
+          })
+          updateManager.onUpdateFailed(function () {})// 新版本下载失败
+          return true;
+        }
+        getUser(true)
+        //获取门店信息
+        this.setUserShopAll();
+        uni.switchTab({url:'/admin/home/workbench'})
+      })
+    },
 	},
 	},
 	mounted() {
 	mounted() {
 		if (this.mInit) {
 		if (this.mInit) {