shish %!s(int64=4) %!d(string=hai) anos
pai
achega
8fd516452f

+ 158 - 0
ghsApp/src/admin/home/login.vue

@@ -0,0 +1,158 @@
+<template>
+	<view class="app-main app-content">
+		<loginModel @comfirm="loginFun" @mobileLogin="mobileLogin"></loginModel>
+	</view>
+</template>
+<script>
+import { mapActions } from "vuex";
+import { getUser} from "@/utils/auth";
+import loginModel from "@/components/login-model";
+import {appLogin} from '@/api/common'
+import { getDictionaries } from '@/api/mini'
+import { replaceClientId } from '@/api/admin'
+import { phoneLogin } from "@/api/auth";
+export default {
+	name: "login",
+	components: {
+		loginModel
+	},
+	mixins: [],
+	data() {
+		return {
+		};
+	},
+	computed: {
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		mobileLogin(){
+			let that = this
+			uni.showLoading({mask:true})
+			uni.preLogin({
+				provider: 'univerify',
+				success:()=>{
+					uni.login({
+						provider: 'univerify',
+						// 自定义登录框样式
+						univerifyStyle: {"fullScreen": true},
+						success:(res)=>{ // 登录成功
+							let openid = res.authResult.openid
+							let access_token = res.authResult.access_token
+							phoneLogin({openid,access_token}).then(subRes=>{
+								let currentShopId = subRes.data.admin.currentShopId || 0
+								if(Number(currentShopId) > 0){
+									//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+									if(subRes.code == 1){
+										if (that.$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 (that.$util.isEmpty(res)) {
+												return false
+											}
+											that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+											that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+										})
+										that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+
+										that.show_login_model = false
+
+										getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+
+										//#ifdef APP-PLUS
+										that.skCustomId = subRes.data.skCustomId
+										that.listenPDAkd()
+										// #endif
+
+										that.setUserShopAll()
+										that.init()
+
+										// #ifdef APP-PLUS
+										//保存安卓的clientId
+										let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+										const clientInfo = plus.push.getClientInfo()
+										let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+										if(hasClientId == '' || hasClientId != currentClientId){
+											replaceClientId({id:currentClientId}).then(res=>{ })
+										}
+										// #endif
+									}
+									uni.hideLoading()
+								}else{
+									that.$msg('您还没有注册')
+								}
+							})
+						},
+						fail(res){  
+							// 登录失败
+							//关闭一键登录弹出窗口
+							uni.closeAuthView()
+							uni.hideLoading()
+						},
+						complete: () => {
+							uni.closeAuthView()
+							uni.hideLoading()
+						}
+					})
+				},
+				fail(res){  
+					// 预登录失败
+					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,
+					//都有可能造成预登录校验失败。
+				}
+			})
+		},
+		loginFun(mobile,password){
+			let that = this
+			uni.showLoading({mask:true})
+			//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+			appLogin({mobile,password}).then(subRes=>{
+
+				if(subRes.code == 1){
+
+					if (that.$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 (that.$util.isEmpty(res)) {
+							return false
+						}
+						that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+						that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+					})
+					that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+
+					that.show_login_model = false
+
+					getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+
+					//#ifdef APP-PLUS
+					that.skCustomId = subRes.data.skCustomId
+					that.listenPDAkd()
+					// #endif
+
+					that.setUserShopAll()
+					that.init()
+					uni.hideLoading()
+					// #ifdef APP-PLUS
+					//保存安卓的clientId
+					let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+					const clientInfo = plus.push.getClientInfo()
+					let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+					if(hasClientId == '' || hasClientId != currentClientId){
+						replaceClientId({id:currentClientId}).then(res=>{ })
+					}
+					// #endif
+				}
+			})
+
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 12 - 11
ghsApp/src/admin/home/me.vue

@@ -4,7 +4,7 @@
     <template v-if="!$util.isEmpty(shopInfo)">
       <view class="me-user_box">
         <view class="user-info_item">
-          <view>
+          <view v-if="shopInfo.shopAdminId > 0">
             <view class="name">
               {{ shopInfo.adminName }}
             </view>
@@ -19,22 +19,24 @@
           <view class="me-shop_top">
             <view class="shop-top_left">
               <image :src="shopInfo.shopImg" style="width:110upx;border-radius:100upx;" mode="widthFix"></image>
-              <view class="top-info_box">
-                <view>
-                  {{ shopInfo.shopName }}
-                </view>
-                <view>
-                  <text>{{ shopInfo.sjName }} | SID {{shopInfo.shopId}}</text>
-                </view>
+
+              <view class="top-info_box" style="font-size:38upx;" v-if="!$util.isEmpty(shopInfo)" @click="pageTo({url:'/admin/home/login'})">
+                <view> 登录/注册 </view>
+              </view>
+
+              <view class="top-info_box" v-else>
+                <view> {{ shopInfo.shopName }} </view>
+                <view> <text>{{ shopInfo.sjName }} | SID {{shopInfo.shopId}}</text> </view>
               </view>
+
             </view>
             <button v-if="getLoginInfo.switchShop" @click="showAllShop" 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" >
-            <view class="dec"> 店铺服务期至: {{ shopInfo.deadline.substr(0,11) }} </view>
+          <view @click="pageTo({ url: '/pagesClient/official/renewal' })" class="image-box" >
+            <view class="dec"> 店铺服务期至 {{ shopInfo.deadline.substr(0,11) }} </view>
             <image :src="`${constant.imgUrl}/ghs/me/upgrade.png`"></image>
           </view>
         </view>
@@ -107,7 +109,6 @@
             <!-- #endif -->
           </view>
         </view>
-        <none-hd :show="no_shop_show_model" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="true" experienceFun></none-hd>
       </view>
     </template>
     <ShopSelect ref="shopSelectComponent" class="bar" :isShowTit="false" top="0upx" @selectShopFn="selectShopFn" />

+ 1 - 140
ghsApp/src/admin/home/workbench.vue

@@ -1,6 +1,5 @@
 <template>
 	<view class="app-main app-content">
-		<view v-if="!$util.isEmpty(loginInfo)">
 		<!-- 今日概况 -->
 		<div class="user-wrap">
 			<div class="user-top">
@@ -89,12 +88,6 @@
 			</div>
 		</div>
 
-		<!--没有开店时的界面-->
-    	<none-hd :show="no_shop_show_model" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="EXPER_AUTH_SHOW" @comfirm="experienceFun"></none-hd>
-		</view>
-		<view v-else>
-		<loginModel :show="show_login_model" @comfirm="loginFun" @mobileLogin="mobileLogin"></loginModel>
-		</view>
 	</view>
 </template>
 
@@ -106,7 +99,6 @@ import ModalModule from "@/components/plugin/modal";
 import { getUser,uniLoginFn } from "@/utils/auth";
 import { consoleIndex } from "@/api/workbench";
 import { closeBook } from "@/api/book";
-import noneHd from "@/components/none-hd";
 import loginModel from "@/components/login-model";
 import {appLogin} from '@/api/common'
 import { getDictionaries } from '@/api/mini'
@@ -120,7 +112,6 @@ export default {
 		ModalModule,
 		FabModule,
 		AppAvatarModule,
-    	noneHd,
 		loginModel
 	},
 	mixins: [productMins],
@@ -196,136 +187,6 @@ export default {
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
-		mobileLogin(){
-			let that = this
-			uni.showLoading({mask:true})
-			uni.preLogin({
-				provider: 'univerify',
-				success:()=>{
-					uni.login({
-						provider: 'univerify',
-						// 自定义登录框样式
-						univerifyStyle: {"fullScreen": true},
-						success:(res)=>{ // 登录成功
-							let openid = res.authResult.openid
-							let access_token = res.authResult.access_token
-							phoneLogin({openid,access_token}).then(subRes=>{
-								let currentShopId = subRes.data.admin.currentShopId || 0
-								if(Number(currentShopId) > 0){
-									//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
-									if(subRes.code == 1){
-										if (that.$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 (that.$util.isEmpty(res)) {
-												return false
-											}
-											that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
-											that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
-										})
-										that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-
-										that.show_login_model = false
-
-										uni.showTabBar()
-
-										getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
-
-										//#ifdef APP-PLUS
-										that.skCustomId = subRes.data.skCustomId
-										that.listenPDAkd()
-										// #endif
-
-										that.setUserShopAll()
-										that.init()
-
-										// #ifdef APP-PLUS
-										//保存安卓的clientId
-										let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
-										const clientInfo = plus.push.getClientInfo()
-										let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
-										if(hasClientId == '' || hasClientId != currentClientId){
-											replaceClientId({id:currentClientId}).then(res=>{ })
-										}
-										// #endif
-									}
-									uni.hideLoading()
-								}else{
-									that.$msg('您还没有注册')
-								}
-							})
-						},
-						fail(res){  
-							// 登录失败
-							//关闭一键登录弹出窗口
-							uni.closeAuthView()
-							uni.hideLoading()
-						},
-						complete: () => {
-							uni.closeAuthView()
-							uni.hideLoading()
-						}
-					})
-				},
-				fail(res){  
-					// 预登录失败
-					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,
-					//都有可能造成预登录校验失败。
-				}
-			})
-		},
-		loginFun(mobile,password){
-			let that = this
-			uni.showLoading({mask:true})
-			//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
-			appLogin({mobile,password}).then(subRes=>{
-
-				if(subRes.code == 1){
-
-					if (that.$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 (that.$util.isEmpty(res)) {
-							return false
-						}
-						that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
-						that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
-					})
-					that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-
-					that.show_login_model = false
-
-					uni.showTabBar()
-
-					getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
-
-					//#ifdef APP-PLUS
-					that.skCustomId = subRes.data.skCustomId
-					that.listenPDAkd()
-					// #endif
-
-					that.setUserShopAll()
-					that.init()
-					uni.hideLoading()
-					// #ifdef APP-PLUS
-					//保存安卓的clientId
-					let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
-					const clientInfo = plus.push.getClientInfo()
-					let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
-					if(hasClientId == '' || hasClientId != currentClientId){
-						replaceClientId({id:currentClientId}).then(res=>{ })
-					}
-					// #endif
-				}
-			})
-
-		},
 		closeBook(){
 			let that = this
 			that.$util.confirmModal({title:"确定关闭?",content:'关闭后可以在底部菜单【我的】,找到【使用教程】重新打开'},() => {
@@ -597,4 +458,4 @@ export default {
 		font-size: 34upx;
 	}
 }
-</style>
+</style>

+ 1 - 1
ghsApp/src/components/login-model.vue

@@ -21,7 +21,7 @@
         </view>
 
         <view style="margin-top:60upx;color:#999999;width:88%;font-size:30upx;">
-          <text style="float:right;" @click="pageTo({ url: '/pagesClient/official/apply'})">注册帐号</text><text style="float:right;margin-right:80upx;" @click="pageTo({ url: '/admin/book/index'})">使用教程</text>
+          <text style="float:right;" @click="pageTo({ url: '/pagesClient/official/apply'})">注册帐号</text>
         </view>
 
       </view>

+ 5 - 55
ghsApp/src/mixins/globalMixins.js

@@ -24,9 +24,6 @@ export default {
       pageTo: pageTo,
       no_shop_show_model: false,
       shopAdminId: null,
-      MODEL_TITLE: '您还没有开店',
-      MODEL_BTN_TEXT: '申请',
-      EXPER_AUTH_SHOW: false,
       show_login_model:false,
       //所有花材列表
       allProduct:[],
@@ -59,38 +56,6 @@ export default {
 
       // #ifdef MP-WEIXIN
 			uniLoginFn(true,1).then(res => {
-				//客户可以访问的页面
-        this.EXPER_AUTH_SHOW = res.data.showDemo == 1 ? true : false
-				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' && res.data.admin.openShop == '1') {
-            this.no_shop_show_model = true;
-            uni.hideTabBar()
-            uni.setStorageSync('HOME_STATUS_STROAGE_SHOW', res.data.shopAdminId)
-            //shish 20210615
-            uni.setStorageSync('HOME_REFRESH', '2')
-					} else if (res.data.admin.openShop == '2' && res.data.shopAdminId == '0') {
-            this.MODEL_TITLE = '已申请'
-            this.MODEL_BTN_TEXT = '审核进度'
-            this.no_shop_show_model = true
-            uni.hideTabBar()
-            uni.removeStorageSync('HOME_STATUS_STROAGE_SHOW')
-            uni.removeStorageSync('HOME_REFRESH')
-            uni.setStorageSync('OPEN_SHOP_ID', res.data.admin.openShop)
-          } else {
-            this.no_shop_show_model = false
-            uni.showTabBar()
-            uni.removeStorageSync('HOME_REFRESH')
-          }
-				}
 				getUser(true)
 				//获取门店信息
 				this.setUserShopAll()
@@ -103,13 +68,12 @@ export default {
       //#ifdef APP-PLUS
       //有token重新获取登陆信息!!!
       const appToken = uni.getStorageSync('token')
-      if(this.$util.isEmpty(appToken)){
-        this.show_login_model = true
-        uni.hideTabBar()
-      }else{
+      if(!this.$util.isEmpty(appToken)){
         let that = this
         appReGetLoginInfo().then(subRes=>{
-
+          if(subRes.code != 1){
+            return
+          }
 					getDictionaries({ token: subRes.data.token }).then(res => {
 						if (!that.$util.isEmpty(res)) {
               store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
@@ -117,7 +81,6 @@ export default {
 						}
 					})
           store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-          uni.showTabBar()
           this.skCustomId = subRes.data.skCustomId
           // #ifdef APP-PLUS
           this.listenPDAkd()
@@ -138,18 +101,6 @@ export default {
 			if (this.init) {
 				this.init()
 			}
-    }
-    if (uni.getStorageSync('HOME_REFRESH') == '1') {
-      this.MODEL_TITLE = '已申请'
-      this.MODEL_BTN_TEXT = '审核进度'
-      this.no_shop_show_model = true
-      uni.hideTabBar()
-    }
-    if (uni.getStorageSync('HOME_REFRESH') == '2') {
-      this.MODEL_TITLE = '您还没有开店哦'
-      this.MODEL_BTN_TEXT = '申请'
-      this.no_shop_show_model = true
-      uni.hideTabBar()
     }
 	},
 	methods: {
@@ -363,7 +314,6 @@ export default {
         uni.removeStorageSync('HOME_REFRESH')
 
         this.no_shop_show_model = false
-        uni.showTabBar()
 
         getUser(true)
         //获取门店信息
@@ -377,4 +327,4 @@ export default {
 			this.mInit()
 		}
 	}
-}
+}

+ 1 - 0
ghsApp/src/pages.json

@@ -1,6 +1,7 @@
 {
 	"pages": [
 		{"path": "admin/home/workbench","style": {"navigationBarTitleText": "","enablePullDownRefresh": true}},
+		{"path": "admin/home/login","style": {"navigationBarTitleText": "","enablePullDownRefresh": false}},
 		{"path": "admin/home/result","style": {"navigationBarTitleText": "","enablePullDownRefresh": true}},
 		{"path": "admin/home/callback","style": {"navigationBarTitleText": "","enablePullDownRefresh": true}},
 		{"path": "admin/home/console","style": {"navigationBarTitleText": ""}},