Browse Source

不同的人显示不同的页面

shish 5 years ago
parent
commit
3ac7761128
3 changed files with 49 additions and 9 deletions
  1. 31 0
      store/src/admin/official/latest-shop.vue
  2. 12 9
      store/src/mixins/globalMixins.js
  3. 6 0
      store/src/pages.json

+ 31 - 0
store/src/admin/official/latest-shop.vue

@@ -0,0 +1,31 @@
+<template>
+  <div class="app-content">
+      最近问店铺
+  </div>
+</template>
+
+<script>
+import AppSwiper from "@/components/app-swiper";
+import AppImg from "@/components/app-img";
+import { applyStatus } from "@/api/official";
+import { share } from "@/mixins";
+export default {
+  name: "shop-list",
+  components: {},
+  mixins: [share],
+  data() {
+    return {
+      
+    };
+  },
+  onLoad() {
+    
+  },
+  methods: {
+    
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 12 - 9
store/src/mixins/globalMixins.js

@@ -27,17 +27,11 @@ export default {
 		if (option.account) {
 			uni.setStorageSync('account', option.account)
 		}
-
 		uni.setStorageSync('currentQuery', JSON.stringify(option))
 		if (isLogin() == false) {
 			wxLoginFn()
 				.then(res => {
-
-					// @傅威 明天要发版,我做了个临时解决方案,这块请优化
-					//现在我们分 官网 和 后台 的页面。其中官网页面不多,只有4个页面
-					//shopId=0 (即非管理员) 时不能让访问后台的页面
-					//不管shopId值是多少(是否管理员),有些页面都应允许访问,如下面的:admin/shopAdmin/bind
-
+					//花粉和未知身份可以访问的地址
 					var urlArr = ['admin/shopAdmin/bind', 'admin/official'];
 					var redirectPage = res.redirectPage;
 					var needRedirect = true;
@@ -46,13 +40,22 @@ export default {
 							needRedirect = false;
 						}
 					})
+
 					if (needRedirect == true) {
-						if (+res.data.shopId > 0) {
+						//花店员工
+						if (res.data.admin.identity == '2') {
 							this.$util.pageTo({
 								url: "/admin/home/workbench",
 								type: 3
 							});
-						} else {
+						//买花人
+						} else if(res.data.admin.identity == '1'){
+							this.$util.pageTo({
+								url: "/admin/official/latest-shop",
+								type: 2
+							});
+						//未知身份
+						}else{
 							this.$util.pageTo({
 								url: "/admin/official/index",
 								type: 2

+ 6 - 0
store/src/pages.json

@@ -97,6 +97,12 @@
 					"style": {
 						"navigationBarTitleText": "回调"
 					}
+				},
+				{
+					"path": "latest-shop",
+					"style": {
+						"navigationBarTitleText": "最近访问的店铺"
+					}
 				}
 			]
 		},