shish 3 lat temu
rodzic
commit
9209c62764

+ 3 - 22
ghsApp/src/admin/home/me.vue

@@ -28,7 +28,7 @@
               </view>
 
             </view>
-            <button v-if="getLoginInfo.switchShop" @click="showAllShop" class="admin-button-com default chang-shop_btn" > <i class="iconfont iconqiehuan1"></i> 切换门店 </button>
+            <button v-if="getLoginInfo.switchShop" @click="modifyShop" class="admin-button-com default chang-shop_btn" > <i class="iconfont iconqiehuan1"></i> 切换门店 </button>
           </view>
           <view class="image-box" > <view class="dec"></view> <image :src="`${constant.imgUrl}/ghs/me/upgrade2.png`"></image> </view>
         </view>
@@ -169,13 +169,11 @@
 import AppAvatarModule from "@/components/module/app-avatar";
 import TuiListCell from "@/components/plugin/list-cell";
 import { mainMy, applyCash } from "@/api/home";
-import { toggleShop } from "@/api/common";
 import { inMoney,outMoney } from "@/api/shop-money";
 import ShopSelect from "@/components/module/shopSelect";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
 import NotLogin from "@/components/not-login";
-import { getShopInfo } from "@/utils/auth";
 import ModalModule from "@/components/plugin/modal"
 export default {
   name: "me",
@@ -301,8 +299,8 @@ export default {
 			plus.runtime.openURL('http://www.wixhb.com/main/xhb-privacy')
       // #endif
 		},
-    showAllShop () {
-      this.$refs.shopSelectComponent.dropdownShow = true;
+    modifyShop () {
+      this.$util.pageTo({url:'/admin/shop/myShop'})
     },
     async init () {
       const { data } = await mainMy();
@@ -334,23 +332,6 @@ export default {
       })
     },
     // #endif
-    async selectShopFn (val) {
-        uni.showLoading({mask:true})
-        await toggleShop({ shopId: val.id })
-        uni.hideLoading()
-        // #ifdef MP-WEIXIN
-        this.$store.commit("setLoginInfo", {})
-        this.$store.commit("setMyShopInfo", {})
-        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)
-    },
     outCash(){
 
     },

+ 153 - 0
ghsApp/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="selectShopFn(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 } from "@/api/shop";
+import { list } from "@/mixins";
+import { toggleShop } from "@/api/common";
+import { getShopInfo } from "@/utils/auth";
+import {mapGetters} from "vuex";
+export default {
+	components: {AppWrapperEmpty},
+	mixins: [list],
+	computed: {		
+		...mapGetters(["getDictionariesInfo","getLoginInfo"])
+	},
+	data() {
+		return {
+			shopData:{},
+			shopId:0
+		};
+	},
+	methods: {
+		async selectShopFn (shopId) {
+			uni.showLoading({mask:true})
+			await toggleShop({ shopId: shopId })
+			uni.hideLoading()
+			// #ifdef MP-WEIXIN
+			this.$store.commit("setLoginInfo", {})
+			this.$store.commit("setMyShopInfo", {})
+			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)
+		},
+		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
ghsApp/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 updateWl = data => {
 	return https.post('/wl/update', data)
 }

+ 2 - 1
ghsApp/src/pages.json

@@ -186,7 +186,8 @@
 				{"path": "password","style": {"navigationBarTitleText": "密码修改"}},
 				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动记录"}},
 				{"path": "selectShop","style": {"navigationBarTitleText": "选择门店"}},
-				{"path": "wl","style": {"navigationBarTitleText": "物流列表"}}
+				{"path": "wl","style": {"navigationBarTitleText": "物流列表"}},
+				{"path": "myShop","style": {"navigationBarTitleText": "我的门店"}}
 			]
 		},
 		{

+ 2 - 1
hdApp/src/admin/shop/myShop.vue

@@ -28,10 +28,11 @@
 </template>
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { getMyShop,switchGhsShop } from "@/api/shop";
+import { getMyShop } from "@/api/shop";
 import { list } from "@/mixins";
 import { toggleShop } from "@/api/common";
 import {mapGetters} from "vuex";
+import { getShopInfo } from "@/utils/auth";
 export default {
 	components: {AppWrapperEmpty},
 	mixins: [list],