From 5c3c04b9705db216d199053afc278324ed766f14 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 10 二月 2026 16:07:34 +0800
Subject: [PATCH] 经销商管理

---
 mini-program/pages/distributor/distributor.vue |  122 +++++++++++++++++++++++++++++++---------
 1 files changed, 93 insertions(+), 29 deletions(-)

diff --git a/mini-program/pages/distributor/distributor.vue b/mini-program/pages/distributor/distributor.vue
index fdf4a88..efe8f20 100644
--- a/mini-program/pages/distributor/distributor.vue
+++ b/mini-program/pages/distributor/distributor.vue
@@ -1,10 +1,10 @@
 <template>
-	<view class="box">
+	<view class="box" :style="">
 		<view class="head" :style="{ height: 'calc(' + (navHeight + statusbarHeight + 'px + 400rpx)') }">
 			<view class="head-bar" :style="{ height: navHeight + statusbarHeight + 'px' }">
 				<view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view>
 				<view class="head-bar-nav" :style="{ height: navHeight + 'px' }">
-					<view class="loginOut">
+					<view class="loginOut" @click="logoutCom()">
 						<image src="/static/icon/ic_tixing@2x.png" mode="widthFix"></image>
 						<text>鐧诲嚭</text>
 					</view>
@@ -13,13 +13,13 @@
 			<view class="user">
 				<view class="user-left">
 					<view class="user-left-image">
-						<image src="/static/logo.png" mode="widthFix"></image>
+						<image :src="shop.imgurl||'/static/logo.png'" mode="widthFix"></image>
 					</view>
 					<view class="user-left-info">
-						<view class="user-left-info-title">榧庡厓鍐滄満涓�鍙风粡閿�鍟�</view>
+						<view class="user-left-info-title">{{shop.name||''}}</view>
 						<view class="user-left-info-val">
-							<text>闂ㄥ簵ID锛歋001</text>
-							<text>绉垎锛�3000</text>
+							<text>闂ㄥ簵ID锛歿{shop.code}}</text>
+							<text>绉垎锛歿{(shop.integral||0).toFixed(0)}}</text>
 						</view>
 					</view>
 				</view>
@@ -30,9 +30,9 @@
 			<view class="data" :style="{ backgroundImage: 'url(' + backgroundImage + ')' }">
 				<view class="data-a">
 					<view class="data-a-left">
-						<view class="data-a-left-item active">浠婃棩</view>
-						<view class="data-a-left-item">鏈湀</view>
-						<view class="data-a-left-item">涓婃湀</view>
+						<view :class="'data-a-left-item '+(active ==0?'active':'')" @click="changeActive(0)">浠婃棩</view>
+						<view :class="'data-a-left-item '+(active ==1?'active':'')" @click="changeActive(1)">鏈湀</view>
+						<view :class="'data-a-left-item '+(active ==2?'active':'')" @click="changeActive(2)">涓婃湀</view>
 					</view>
 					<view class="data-a-to">
 						<text>閿�鍞槑缁�</text>
@@ -47,8 +47,8 @@
 							<image src="/static/icon/ic_visible@2x.png" mode="widthFix"></image>
 						</view>
 						<view class="data-c-item-bottom">
-							<text>12,000</text>
-							<text>.00</text>
+							<text>{{(countData.saleTotal||0).toFixed(0)}}</text>
+							<text>.{{countData.saleTotalFloat || '00'}}</text>
 						</view>
 					</view>
 					<view class="data-c-item">
@@ -56,8 +56,8 @@
 							<text>缁撶畻鍒╂鼎(鍏�)</text>
 						</view>
 						<view class="data-c-item-bottom">
-							<text>12,00</text>
-							<text>.00</text>
+							<text>{{(countData.profitTotal||0).toFixed(0)}}</text>
+							<text>.{{countData.profitTotalFloat || '00'}}</text>
 						</view>
 					</view>
 					<view class="data-c-item">
@@ -65,41 +65,45 @@
 							<text>璁㈠崟鏁�</text>
 						</view>
 						<view class="data-c-item-bottom">
-							<text>13</text>
+							<text>{{countData.orderNum||0}}</text>
 						</view>
 					</view>
 				</view>
 			</view>
 			<view class="func">
 				<view class="func-item" style="margin-bottom: 30rpx;">
-					<image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
+					<image src="/static/icon/ic_shangpingl@2x.png" mode="widthFix"></image>
 					<text>鍟嗗搧绠$悊</text>
 				</view>
 				<view class="func-item" style="margin-bottom: 30rpx;">
-					<image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
-					<text>鍟嗗搧绠$悊</text>
+					<image src="/static/icon/ic_dingdanguanli@2x.png" mode="widthFix"></image>
+					<text>璁㈠崟绠$悊</text>
 				</view>
 				<view class="func-item" style="margin-bottom: 30rpx;">
-					<image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
-					<text>鍟嗗搧绠$悊</text>
+					<image src="/static/icon/ic_xunizhanghu@2x.png" mode="widthFix"></image>
+					<text>铏氭嫙璐﹀彿</text>
 				</view>
 				<view class="func-item" style="margin-bottom: 30rpx;">
-					<image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
-					<text>鍟嗗搧绠$悊</text>
+					<image src="/static/icon/ic_zitihexiao@2x.png" mode="widthFix"></image>
+					<text>鑷彁鏍搁攢</text>
 				</view>
 				<view class="func-item">
-					<image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
-					<text>鍟嗗搧绠$悊</text>
+					<image src="/static/icon/ic_wodezizhi@2x.png" mode="widthFix"></image>
+					<text>鎴戠殑璧勮川</text>
 				</view>
 				<view class="func-item">
-					<image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
-					<text>鍟嗗搧绠$悊</text>
+					<image src="/static/icon/ic_wodehuiyuan@2x.png" mode="widthFix"></image>
+					<text>鎴戠殑浼氬憳</text>
+				</view>
+				<view class="func-item">
+					<image src="/static/icon/ic_zhuanshuhaibao@2x.png" mode="widthFix"></image>
+					<text>涓撳睘娴锋姤</text>
 				</view>
 				<view style="width: 25%; height: 0;"></view>
 				<view style="width: 25%; height: 0;"></view>
 			</view>
-			<view class="title">寰呭鐞嗚鍗� (2)</view>
-			<view class="list">
+			<view class="title"  v-if="!show">寰呭鐞嗚鍗� (2)</view>
+			<view class="list"  v-if="!show">
 				<view class="list-item" v-for="(item, index) in 5" :key="index">
 					<view class="a">
 						<view class="a-left">
@@ -139,6 +143,21 @@
 				</view>
 			</view>
 		</view>
+		<!-- 纭閫�鍑虹櫥闄� -->
+		<u-popup :show="show" round="15" :safeAreaInsetBottom="false" mode="center"  >
+			<view class="tc">
+				<view class="tc-contemt">
+					<view class="tc-contemt-title">纭閫�鍑虹櫥闄�</view>
+					<view class="tc-contemt-nr">
+						鎮ㄧ‘璁ら��鍑虹櫥闄嗗悧锛�
+					</view>
+				</view>
+				<view class="tc-btn">
+					<view class="tc-btn-item" @click="logoutCom">鍙栨秷</view>
+					<view class="tc-btn-item" @click="logout" style="color: red;">纭閫�鍑�</view>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -146,12 +165,57 @@
 	import { mapState } from 'vuex'
 	export default {
 		computed: {
-			...mapState(['navHeight', 'statusbarHeight'])
+			...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
 		},
 		data() {
-			return {
+			return { 
+				show:false,
+				active:0,
+				shop:{}, 
+				countData:{},
 				backgroundImage: require('@/static/images/bg_card@2x.png')
 			};
+		},
+		onShow() {
+			 this.shop  ={}
+			 this.checkShopLogin()
+			 this.shop = this.shopInfo || {}
+		},
+		onReachBottom(){
+			
+		},
+		methods:{ 
+			changeActive(index){
+				this.active = index
+			},
+		    checkShopLogin(){
+				var that =this
+				if( this.shopInfo ==null || this.shopInfo.id==null ||  this.shopToken==null || this.shopToken==''){
+					 this.jumpShopLogin()
+				} 
+			},
+			logoutCom(){
+				this.show=!this.show
+				if(this.show){
+					
+				}else{
+					
+				}
+			}, 
+			async  logout(){ 
+				var that =this
+				let res = await that.$u.api.shopLogout({tokenType:1  })
+				if (res.code === 200) {
+					await that.$store.commit('setShopInfo',null) 
+					await that.$store.commit('setShopToken',null) 
+					that.jumpShopLogin()
+				} 
+			},
+			jumpShopLogin() {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				})
+			}
 		}
 	}
 </script>

--
Gitblit v1.9.3