shish 4 lat temu
rodzic
commit
742e9dfb52

+ 8 - 6
ghsApp/src/admin/shop/sk.vue

@@ -63,13 +63,15 @@ export default {
         content: '确认绑定?',
         success: function (res) {
           if (res.confirm) {
+            uni.showLoading({mask:true})
             bindLsShop({id:that.form.customId}).then(res=>{
-                if(res.code == 1){
-                  that.$msg(res.msg)
-                  setTimeout(function(){
-                    uni.navigateBack()
-                  },2000)
-                }
+              uni.hideLoading()
+              if(res.code == 1){
+                that.$msg(res.msg)
+                setTimeout(function(){
+                  uni.navigateBack()
+                },2000)
+              }
             })
           }
         }

+ 14 - 15
ghsApp/src/components/module/shopSelect.vue

@@ -23,8 +23,9 @@
     </view>
 </template>
 <script>
-import DropdownList from "@/components/plugin/dropdown-list";
-import {mapGetters,mapState} from "vuex";
+import DropdownList from "@/components/plugin/dropdown-list"
+import {mapGetters,mapState} from "vuex"
+import { shopAll } from '@/api/common'
 export default {
     name:'DorpdownSelect',
     components:{
@@ -61,22 +62,20 @@ export default {
         }
     },
     computed:{
-		...mapGetters(["getMyShopInfo"]),
-        ...mapState({userShopAll:state=>state.user.userShopAll}),
+		...mapGetters(["getMyShopInfo"])
     },
     mounted(){
-        this.shopList = this.userShopAll.map(i=>({...i,name:i.shopName}))
+        this.shopList = []
+        shopAll().then(res=>{
+            if(res.code == 1){
+                if (!this.$util.isEmpty(res.data)){
+					res.data.forEach((i) => {
+						this.shopList.push({id:i.id,name:i.shopName})
+					})
+                }
+            }
+        })
     },
-	watch:{
-        userShopAll (val) {
-			if(!this.$util.isEmpty(val)) {
-				this.shopList = val.map(i=>({
-					...i,
-					name:i.shopName
-				}));
-			}
-		}
-	},
     methods:{
         switchCut(){
             this.dropdownShow = !this.dropdownShow

+ 3 - 3
hdApp/src/admin/home/login.vue

@@ -107,7 +107,7 @@ export default {
 							return false
 						}
 						uni.setStorageSync('token', subRes.data.token)
-						uni.setStorageSync('shopId', subRes.data.admin.currentHdShopId)
+						uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
 						getDictionaries({ token: subRes.data.token }).then(res => {
 							if (that.$util.isEmpty(res)) {
 								return false
@@ -172,7 +172,7 @@ export default {
 										return false
 									}
 									uni.setStorageSync('token', subRes.data.token)
-									uni.setStorageSync('shopId', subRes.data.admin.currentHdShopId)
+									uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
 									getDictionaries({ token: subRes.data.token }).then(res => {
 										if (that.$util.isEmpty(res)) {
 											return false
@@ -245,7 +245,7 @@ export default {
 						return false
 					}
 					uni.setStorageSync('token', subRes.data.token)
-					uni.setStorageSync('shopId', subRes.data.admin.currentHdShopId)
+					uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
 					getDictionaries({ token: subRes.data.token }).then(res => {
 						if (that.$util.isEmpty(res)) {
 							return false

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

@@ -12,12 +12,12 @@
           <view class="me-shop_top">
             <view class="shop-top_left">
 
-              <image :src="shopInfo.shopImg" style="width:110upx;border-radius:100upx;" mode="widthFix" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentHdShopId > 0">
+              <image :src="shopInfo.shopImg" style="width:110upx;border-radius:100upx;" mode="widthFix" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
               </image>
               <image :src="shopInfo.shopImg" style="width:110upx;border-radius:100upx;" mode="widthFix" @click="pageTo({url:'/admin/home/login'})" v-else>
               </image>
 
-              <view class="top-info_box" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentHdShopId > 0">
+              <view class="top-info_box" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
                 <view> {{ shopInfo.shopName||'' }} </view>
                 <view><text>{{ shopInfo.sjName||'' }} | SID {{shopInfo.shopId||''}}</text></view>
               </view>
@@ -92,10 +92,10 @@
             </tui-list-cell>
 
             <!-- #ifdef APP-PLUS -->
-            <tui-list-cell @click="closeApp()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentHdShopId > 0">
+            <tui-list-cell @click="closeApp()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
               <view class="tui-title">关闭APP</view>
             </tui-list-cell>
-            <tui-list-cell @click="loginOut()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentHdShopId > 0">
+            <tui-list-cell @click="loginOut()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
               <view class="tui-title">退出登陆</view>
             </tui-list-cell>
             <!-- #endif -->

+ 2 - 2
hdApp/src/components/not-login.vue

@@ -18,14 +18,14 @@ export default {
 	watch: {
 		getLoginInfo: {
 			handler(newValue) {
-        if(this.$util.isEmpty(newValue.admin) == false && newValue.admin.currentHdShopId > 0){
+        if(this.$util.isEmpty(newValue.admin) == false && newValue.admin.currentShopId > 0){
           this.showModel = false
         }				
 			}
 		}
 	},
 	mounted() {
-    if(this.$util.isEmpty(this.getLoginInfo.admin) || this.getLoginInfo.admin.currentHdShopId == 0){
+    if(this.$util.isEmpty(this.getLoginInfo.admin) || this.getLoginInfo.admin.currentShopId == 0){
       this.showModel = true
     }
 	},

+ 1 - 1
hdApp/src/mixins/globalMixins.js

@@ -60,7 +60,7 @@ export default {
 				hasTokenAutoLogin().then(subRes=>{
 				  //有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
 				  if(subRes.code == 1){
-					uni.setStorageSync('shopId', subRes.data.admin.currentHdShopId)
+					uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
 					getDictionaries({ token: subRes.data.token }).then(res => {
 						if (that.$util.isEmpty(res)) {
 							return false

+ 1 - 1
hdApp/src/pagesClient/official/apply.vue

@@ -292,7 +292,7 @@ export default {
             return false
           }
           uni.setStorageSync('token', subRes.data.token)
-          uni.setStorageSync('shopId', subRes.data.admin.currentHdShopId)
+          uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
           getDictionaries({ token: subRes.data.token }).then(res => {
             if (that.$util.isEmpty(res)) {
               return false

+ 1 - 1
hdApp/src/utils/auth.js

@@ -84,7 +84,7 @@ export async function wxLoginFn(update) {
 						return false
 					}
 					uni.setStorageSync('token', subRes.data.token)
-					uni.setStorageSync('shopId', subRes.data.admin.currentHdShopId)
+					uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
 					getDictionaries({ token: subRes.data.token }).then(res => {
 						if (util.isEmpty(res)) {
 							return false