|
|
@@ -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({
|
|
|
@@ -91,6 +94,7 @@
|
|
|
import DorpdownSelect from "@/components/module/dorpdownSelect";
|
|
|
import { selectShop } from '@/mixins'
|
|
|
import { getUser } from '@/utils/auth'
|
|
|
+ import { mapGetters } from 'vuex'
|
|
|
export default { // 我的
|
|
|
name:"Me",
|
|
|
components:{
|
|
|
@@ -99,6 +103,9 @@
|
|
|
DorpdownSelect
|
|
|
},
|
|
|
mixins:[selectShop],
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getLoginInfo"])
|
|
|
+ },
|
|
|
data(){
|
|
|
return {
|
|
|
constant: this.$constant,
|
|
|
@@ -114,18 +121,33 @@
|
|
|
|
|
|
}
|
|
|
},
|
|
|
- async selectSussess(val){
|
|
|
+ async selectSussess(shopId){
|
|
|
uni.showLoading({
|
|
|
title: '加载中'
|
|
|
});
|
|
|
try {
|
|
|
- let res = await toggleShop({ shopId: this.shopId});
|
|
|
+ let {data} = await toggleShop({ shopId});
|
|
|
+ this.$store.commit('setLoginInfo', {
|
|
|
+ ...this.getLoginInfo,
|
|
|
+ shopId: data.shopId, // 门店id
|
|
|
+ shopAdminId: data.id //员工id
|
|
|
+ })
|
|
|
getUser(true)
|
|
|
this.init()
|
|
|
} finally {
|
|
|
uni.hideLoading();
|
|
|
}
|
|
|
|
|
|
+ },
|
|
|
+ changeShop(){
|
|
|
+ let idx = this.userShopAll.findIndex(i=>i.id == this.getLoginInfo.shopId)
|
|
|
+ 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 +224,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;
|
|
|
}
|