shish %!s(int64=3) %!d(string=hai) anos
pai
achega
ba5c3626bd

+ 3 - 23
hdApp/src/admin/home/me.vue

@@ -27,7 +27,7 @@
               </view>
 
             </view>
-            <button @click="shopShow" v-if="loginInfo.switchShop" class="admin-button-com default chang-shop_btn" > <i class="iconfont iconqiehuan1"></i>切换门店</button>
+            <button @click="changeShop" v-if="loginInfo.switchShop" class="admin-button-com default chang-shop_btn" > <i class="iconfont iconqiehuan1"></i>切换门店</button>
           </view>
           <view class="image-box" > <image :src="`${constant.imgUrl}/ghs/me/upgrade2.png`"></image> </view>
         </view>
@@ -123,7 +123,6 @@
 
       </view>
     </template>
-    <DorpdownSelect ref="dorpdownSelect" :menuObj.sync="menuObj" top="0upx" :isShowTit="false" :selectItemId.sync="shopId" @selectSussess="changeShop()" ></DorpdownSelect>
     <NotLogin></NotLogin>
   </view>
 </template>
@@ -242,9 +241,8 @@ export default {
 				},
 			})
 		},
-    shopShow () {
-      this.shopId = this.getLoginInfo.shopId;
-      this.$refs.dorpdownSelect.dropdownShow = true;
+    changeShop() {
+      this.$util.pageTo({ url: "/admin/shop/myShop"});
     },
     getMyInfo () {
       mainMy().then(res=>{
@@ -254,24 +252,6 @@ export default {
       })
       uni.stopPullDownRefresh()
     },
-    async changeShop() {
-        uni.showLoading({mask:true})
-        await toggleShop({ shopId: this.shopId })
-        uni.hideLoading()
-        // #ifdef MP-WEIXIN
-        this.$store.commit("setLoginInfo", {})
-        this.$store.commit("setMyShopInfo", {})
-        this.$store.commit("setDictionariesInfo", {})
-        this.$util.pageTo({url: "/admin/home/me",type: 3})
-        // #endif
-        // #ifdef APP-PLUS
-        this.$store.commit("setLoginInfo", {})
-        this.$store.commit("setDictionariesInfo", {})
-        this.$store.commit("setMyShopInfo", {})
-        plus.runtime.restart()
-        // #endif
-        getShopInfo(true)
-    },
     checkToApplyCash () {
       let self = this;
       //没有设置提现账号则提示

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

@@ -133,7 +133,7 @@
 <view class="ghs_list_page flex-col">
 
   <view style="background-color:white;margin-bottom:20upx;">
-    <button class="admin-button-com mini-btn blue" style="margin-left:12upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/pagesPurchase/open'})">我的门店</button>
+    <button class="admin-button-com mini-btn blue" style="margin-left:12upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/admin/shop/myShop'})">我的门店</button>
     <button class="admin-button-com mini-btn blue" style="margin-left:12upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/admin/staff/list'})">添加员工</button>
     <button class="admin-button-com mini-btn blue" style="margin-left:12upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/admin/shop/add?id='+loginInfo.shopId})">修改地址</button>
     <button class="admin-button-com mini-btn blue" style="margin-left:12upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/admin/stat/cgItem'})">采购统计</button>

+ 153 - 0
hdApp/src/admin/shop/myShop.vue

@@ -0,0 +1,153 @@
+<template>
+<view class="app-content">
+	<view class="ex-page">
+		<scroll-view scroll-y scroll-with-animation class="main-view">
+			<view class="space-view ex-table">
+				<block>
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<t-tr header>
+							<t-th><view>门店名称</view></t-th>
+							<t-th>操作</t-th>
+						</t-tr>
+						<t-tr v-for="(item, inIndex) in shopData.list" :key="inIndex">
+							<t-td>
+								<view style="color:black;font-size:30upx;">
+								{{item.merchantName}}
+								<text v-if="item.shopName == '首店'"></text>
+								<text v-else style="margin-left:10upx;">{{item.shopName}}</text>
+								</view>
+							</t-td>
+							<t-td><button class="admin-button-com middle blue" style="margin-left:30upx;" @click="changeShop(item.id)">进入此店</button></t-td>
+						</t-tr>
+					</t-table>
+				</block>
+			</view>
+		</scroll-view>
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { getMyShop,switchGhsShop } from "@/api/shop";
+import { list } from "@/mixins";
+import { toggleShop } from "@/api/common";
+import {mapGetters} from "vuex";
+export default {
+	components: {AppWrapperEmpty},
+	mixins: [list],
+	computed: {		
+		...mapGetters(["getDictionariesInfo","getLoginInfo"])
+	},
+	data() {
+		return {
+			shopData:{},
+			shopId:0
+		};
+	},
+	methods: {
+		async changeShop(shopId) {
+			uni.showLoading({mask:true})
+			await toggleShop({ shopId: shopId })
+			uni.hideLoading()
+			// #ifdef MP-WEIXIN
+			this.$store.commit("setLoginInfo", {})
+			this.$store.commit("setMyShopInfo", {})
+			this.$store.commit("setDictionariesInfo", {})
+			this.$util.pageTo({url: "/admin/home/workbench",type: 3})
+			// #endif
+			// #ifdef APP-PLUS
+			this.$store.commit("setLoginInfo", {})
+			this.$store.commit("setDictionariesInfo", {})
+			this.$store.commit("setMyShopInfo", {})
+			plus.runtime.restart()
+			// #endif
+			getShopInfo(true)
+		},
+		init(){
+			getMyShop().then(res=>{
+				this.shopData = res.data
+			})
+		}
+	},
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	background: white;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.top-bar {
+		position: absolute;
+		left: 0;
+		display: flex;
+		width: 100%;
+		top:20upx;
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+		}
+		.ex-info {
+			padding: 30upx;
+			.info-cell {
+				display: flex;
+				align-items: center;
+				font-size: 28upx;
+				&:not(:first-child) {
+					margin-top: 20upx;
+				}
+				.cell-label {
+					width: 110upx;
+					color: #666666;
+				}
+				.cell-value {
+					margin-left: 40upx;
+					color: #333;
+					&.warning {
+						color: #ffaf1d;
+					}
+					&.success {
+						color: #27c325;
+					}
+				}
+			}
+		}
+		.ex-table {
+			/deep/.icon-info {
+				color: #333333;
+			}
+		}
+	}
+	.bar-view {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			font-size: 26upx;
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+			}
+		}
+	}
+}
+</style>

+ 4 - 0
hdApp/src/api/shop/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const getMyShop = data => {
+	return https.get('/shop/my-shop', data)
+}
+
 export const changeOnlyCg = data => {
 	return https.get('/shop/change-only-cg', data)
 }

+ 2 - 1
hdApp/src/pages.json

@@ -220,7 +220,8 @@
 				{"path": "mtTrumpet","style": {"navigationBarTitleText": "美团云音箱"}},
 				{"path": "addressList","style": {"navigationBarTitleText": "请选择地址"}},
 				{"path": "addressAdd","style": {"navigationBarTitleText": "添加地址"}},
-				{"path": "addressUpdate","style": {"navigationBarTitleText": "修改地址"}}
+				{"path": "addressUpdate","style": {"navigationBarTitleText": "修改地址"}},
+				{"path": "myShop","style": {"navigationBarTitleText": "我的门店"}}
 			]
 		},
 		{