fuwei %!s(int64=5) %!d(string=hai) anos
pai
achega
323f804272
Modificáronse 1 ficheiros con 36 adicións e 23 borrados
  1. 36 23
      ghs/src/admin/home/me.vue

+ 36 - 23
ghs/src/admin/home/me.vue

@@ -19,25 +19,28 @@
                 <view class="me-shop_content content_box">
                     <view class="me-shop_top">
                         <view class="shop-top_left">
-                        <app-avatar-module src="https://imgm.gmw.cn/attachement/jpg/site215/20210129/3570070943574738873.jpg" :width="100"/> 
-                        <view class="top-info_box">
-                                <view >
-                                    {{infoData.sjName}}
-                                </view>
-                                <view>
-                                    {{infoData.shopName}}
-                                </view>
+                            <app-avatar-module src="https://imgm.gmw.cn/attachement/jpg/site215/20210129/3570070943574738873.jpg" :width="100"/> 
+                            <view class="top-info_box">
+                                    <view >
+                                        {{infoData.sjName}}
+                                    </view>
+                                    <view>
+                                        {{infoData.shopName}}
+                                    </view>
+                            </view>
                         </view>
-                        </view>
-                        <view 
+                        <button 
+                            v-if="loginInfo.super"
+                            @click="changeShop"
+                            class="admin-button-com default chang-shop_btn">
+                            <i class="iconfont iconqiehuan1"></i>
+                            切换店铺
+                        </button>
+                         <!-- <view 
                             v-if="loginInfo.super"
                             class="chang-shop_btn">
-                            <DorpdownSelect 
-							:menuObj.sync="menuObj"  
-							top="200px"
-							:selectItemId.sync="shopId"
-							@selectSussess="selectSussess"></DorpdownSelect>
-                        </view>
+                            切换店铺
+                        </view> -->
                     </view>
                     <view 
                         @click=" pageTo({
@@ -114,18 +117,29 @@
 
                 }
             },
-            async selectSussess(val){
+            async selectSussess(shopId){
                 uni.showLoading({
                     title: '加载中'
                 });
               try {
-                  let res = await toggleShop({ shopId: this.shopId});
+                  let res = await toggleShop({ shopId});
                   getUser(true)
                   this.init()
               } finally {
                  uni.hideLoading(); 
               }
               
+            },
+            changeShop(){
+                console.log(this.userShopAll)
+              let idx = this.userShopAll.findIndex(i=>i.shopId === '2')
+              let shopId = null
+              if(idx === this.userShopAll.length - 1) {
+                  shopId = this.userShopAll[0].id
+              }else{
+                  shopId = this.userShopAll[idx+1].id
+              }
+              this.selectSussess(shopId)
             }
         }
     }
@@ -202,16 +216,15 @@
                     }
                     & .chang-shop_btn {
                         // padding: 20upx 13upx;
-                        width: 176upx;
-                        height: 50upx;
-                        border: 1px solid #DDDDDD;
+                        // width: 176upx;
+                        // height: 50upx;
+                        // border: 1px solid #DDDDDD;
                         border-radius: 25px;
                         color: #666666;
                         position: absolute;
                         right: 20upx;
                         top: 40upx;
-                        text-align: center;
-                        line-height: 50upx;
+                        // text-align: center;
                         & .iconqiehuan1 {
                             margin-right: 10upx;
                         }