shish 4 anni fa
parent
commit
6619700eef

+ 1 - 1
ghsApp/src/admin/home/me.vue

@@ -26,7 +26,7 @@
               </view>
 
             </view>
-            <button @click="showAllShop" class="admin-button-com default chang-shop_btn" > <i class="iconfont iconqiehuan1"></i> 切换门店 </button>
+            <button v-if="loginInfo.switchShop" @click="showAllShop" class="admin-button-com default chang-shop_btn" > <i class="iconfont iconqiehuan1"></i> 切换门店 </button>
           </view>
           <view class="image-box" >
             <view class="dec"></view>

+ 5 - 14
ghsApp/src/admin/home/workbench.vue

@@ -32,12 +32,7 @@
 		</div>
 		<!-- 消息 -->
 		<div class="module-com news-wrap">
-			<div
-				class="news-list"
-				v-for="(item, index) in data.notice"
-				:key="index"
-				@click="pageToFn(item)"
-			>
+			<div class="news-list" v-for="(item, index) in data.notice" :key="index" @click="pageToFn(item)" >
 				<div class="news-left">
 					<i class="iconfont iconxiaoxi2"></i>
 					<span>{{ item.title }}</span>
@@ -88,27 +83,23 @@
 			</div>
 		</div>
 
+		<view v-if="$util.isEmpty(getLoginInfo.admin) || getLoginInfo.admin.currentShopId == 0"><NotLogin @goToLogin="goToLogin()"></NotLogin></view>
+
 	</view>
 </template>
 
 <script>
 import { mapGetters,mapActions } from "vuex";
-import FabModule from "@/components/plugin/fab";
-import AppAvatarModule from "@/components/module/app-avatar";
-import ModalModule from "@/components/plugin/modal";
+import NotLogin from "@/components/not-login";
 import { getUser } from "@/utils/auth";
 import { consoleIndex } from "@/api/workbench";
 import { closeBook } from "@/api/book";
-import loginModel from "@/components/login-model";
 import productMins from "@/mixins/product";
 import { allProduct } from '@/api/product'
 export default {
 	name: "admin-workbench",
 	components: {
-		ModalModule,
-		FabModule,
-		AppAvatarModule,
-		loginModel
+		NotLogin
 	},
 	mixins: [productMins],
 	data() {

+ 8 - 0
ghsApp/src/components/login-model.vue

@@ -15,6 +15,11 @@
         <view style="margin-top:50upx;">
         <button class="admin-button-com small default buttonText" @click="loginClick">登陆</button>
         </view>
+        <!-- #ifdef MP-WEIXIN -->
+        <view style="margin-top:35upx;">
+          <button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;" @click="wxMobileLogin()">微信手机号一键登录</button>
+        </view>
+        <!-- #endif -->
         <!-- #ifdef APP-PLUS -->
         <view style="margin-top:35upx;">
           <button class="admin-button-com small blue buttonText" @click="mobileLogin">本机号码一键登录</button>
@@ -50,6 +55,9 @@ export default {
     },
     mobileLogin(){
       this.$emit('mobileLogin')
+    },
+    wxMobileLogin(){
+      
     }
   },
 };

+ 15 - 0
ghsApp/src/components/not-login.vue

@@ -0,0 +1,15 @@
+<template>
+  <view class="model" @click="pageTo({url:'/admin/home/login'})"></view>
+</template>
+<style lang="scss" scoped>
+.model {
+  position: fixed;
+  z-index: 9999;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  background: rgba(0, 0, 0, 0.6);
+  opacity:0;
+}
+</style>

+ 9 - 66
ghsApp/src/store/modules/user.js

@@ -1,24 +1,17 @@
 import { getState, setState } from '@/store/modules/vuexStorange'
 import { getSelfInfo } from '@/utils/auth'
 import { shopAll } from '@/api/common'
-/** 员工用户信息 */
 const state = {
 	selfInfo: null,
 	user: null,
 	shopUser: null,
-	userShopAll: []  //用户所有店铺
+	//用户所有店铺
+	userShopAll: []
 }
-
 const getters = {
 	// 员工用户信息
 	getSelfInfo: (state) => {
 		getState(state, 'selfInfo', 'selfInfo')
-		// if (state.selfInfo) return state.selfInfo
-		// let data = {}
-		// getSelfInfo().then(res => {
-		// 	data = res
-		// })
-		// return data
 		return state.selfInfo
 	},
 	// 用户信息
@@ -32,69 +25,26 @@ const getters = {
 		return state.shopUser
 	}
 }
-
 const actions = {
 	// 员工用户信息
-	setSelfInfo({
-		commit,
-		dispatch,
-		getters,
-		rootGetters,
-		rootState,
-		state
-	}, userInfo) {
+	setSelfInfo({commit}, userInfo) {
 		commit('SET_BASIC_USER', userInfo)
 	},
-	delSelfInfo({
-		commit,
-		dispatch,
-		getters,
-		rootGetters,
-		rootState,
-		state
-	}) {
+	delSelfInfo({commit}) {
 		commit('DEL_BASIC_USER')
 	},
 	// 后台管理用户信息
-	setUser({
-		commit,
-		dispatch,
-		getters,
-		rootGetters,
-		rootState,
-		state
-	}, userInfo) {
+	setUser({commit}, userInfo) {
 		commit('SET_USER', userInfo)
 	},
-	delUser({
-		commit,
-		dispatch,
-		getters,
-		rootGetters,
-		rootState,
-		state
-	}) {
+	delUser({commit}) {
 		commit('DEL_USER')
 	},
 	// 商城用户信息
-	setShopUser({
-		commit,
-		dispatch,
-		getters,
-		rootGetters,
-		rootState,
-		state
-	}, userInfo) {
+	setShopUser({commit}, userInfo) {
 		commit('SET_SHOP_USER', userInfo)
 	},
-	delShopUser({
-		commit,
-		dispatch,
-		getters,
-		rootGetters,
-		rootState,
-		state
-	}) {
+	delShopUser({ commit }) {
 		commit('DEL_SHOP_USER')
 	},
 	setUserShopAll({commit,state},info={}){
@@ -103,7 +53,6 @@ const actions = {
 		})
 	}
 }
-
 const mutations = {
 	// 员工用户信息
 	SET_BASIC_USER(state, userInfo = {}) {
@@ -130,10 +79,4 @@ const mutations = {
 		state.userShopAll = info
 	}
 }
-
-export default {
-	state,
-	getters,
-	actions,
-	mutations
-}
+export default { state, getters, actions, mutations }

+ 1 - 1
hdApp/src/admin/home/me.vue

@@ -26,7 +26,7 @@
               </view>
 
             </view>
-            <button @click="shopShow" class="admin-button-com default chang-shop_btn" > <i class="iconfont iconqiehuan1"></i>切换门店</button>
+            <button @click="shopShow" v-if="loginInfo.switchShop" class="admin-button-com default chang-shop_btn" > <i class="iconfont iconqiehuan1"></i>切换门店</button>
           </view>
           <view @click=" pageTo({ url: '/pagesClient/official/renewal' }) " class="image-box" >
             <image :src="`${constant.imgUrl}/ghs/me/upgrade.png`"></image>

+ 8 - 0
hdApp/src/components/login-model.vue

@@ -15,6 +15,11 @@
         <view style="margin-top:50upx;">
         <button class="admin-button-com small default buttonText" @click="loginClick">登陆</button>
         </view>
+        <!-- #ifdef MP-WEIXIN -->
+        <view style="margin-top:35upx;">
+          <button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;" @click="wxMobileLogin()">微信手机号一键登录</button>
+        </view>
+        <!-- #endif -->
         <!-- #ifdef APP-PLUS -->
         <view style="margin-top:35upx;">
           <button class="admin-button-com small blue buttonText" @click="mobileLogin">本机号码一键登录</button>
@@ -49,6 +54,9 @@ export default {
     },
     mobileLogin(){
       this.$emit('mobileLogin')
+    },
+    wxMobileLogin(){
+
     }
   },
 };

+ 36 - 0
hdApp/src/components/not-login.vue

@@ -0,0 +1,36 @@
+<template>
+  <view class="model" @click="goToLogin()" v-if="show">
+  </view>
+</template>
+<script>
+export default {
+  props: {
+    show: {
+      type: Boolean,
+      default: true,
+    }
+  },
+  watch: {
+  },
+  data() {
+    return {
+    };
+  },
+  methods: {
+    goToLogin() {
+      this.$emit('goToLogin')
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.model {
+  position: fixed;
+  z-index: 9999;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  background: rgba(0, 0, 0, 0.6);
+}
+</style>