From e4233b5c4e123c4b79a38d0a9b0c8b60631e1683 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 30 七月 2024 10:40:24 +0800
Subject: [PATCH] update

---
 pages/home/supplier-home.vue |  107 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 72 insertions(+), 35 deletions(-)

diff --git a/pages/home/supplier-home.vue b/pages/home/supplier-home.vue
index c3ce2fa..5d17578 100644
--- a/pages/home/supplier-home.vue
+++ b/pages/home/supplier-home.vue
@@ -14,14 +14,18 @@
 			</view>
 			<view class="flex user-info" v-if="currentInfo&&(currentInfo.id)">
 				<!-- 头像 -->
-				<image class="user-icon" v-if="!currentInfo.picture" src="../../static/imgs/home/home-shop-top-icon.png"
+				<image class="user-icon" v-if="!currentInfo.picture" src='https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png'
 					mode="aspectFit"></image>
 				<image class="user-icon" v-if="currentInfo.picture" :src="currentInfo.picture" mode="aspectFit"></image>
 
 				<view class="name">
-					<view class="t1">{{ (!!currentInfo.supplierDTO?(currentInfo.supplierDTO.name):"") || currentInfo.nickName || currentInfo.loginName || '-'}}<span
+					<view class="t1">
+						{{ (!!currentInfo.supplierDTO?(currentInfo.supplierDTO.name):"") || currentInfo.nickName || currentInfo.loginName || '-'}}<span
 							v-if="currentInfo.supplierDTO&&currentInfo.supplierDTO.status!=='P'">
 							({{currentInfo.supplierDTO?currentInfo.supplierDTO.statusStr:''}})</span>
+						<span v-if="currentInfo.partnerDTO&&currentInfo.partnerDTO.status!=='P'">
+							({{currentInfo.partnerDTO?currentInfo.partnerDTO.statusStr:''}})</span>
+						<span v-if="!currentInfo.partnerDTO&&currentInfo.type==='partner'">(信息待完善)</span>
 					</view>
 					<view class="t2">{{currentInfo.tel || '暂无电话'}}</view>
 				</view>
@@ -34,7 +38,7 @@
 			<view class="flex tj-container" v-if="selftype==='partner'">.
 				<view class="tj-each">
 					<view class="num total">
-						¥999.80
+						¥{{tj.income||'0.00'}}
 					</view>
 				</view>
 				<view class="tj-each" style="flex: 1;">
@@ -44,7 +48,7 @@
 				</view>
 			</view>
 			<view class="line"></view>
-			
+
 			<view class="flex tj-container" v-if="selftype==='supplier'">
 				<view class="tj-each">
 					<view class="num">
@@ -74,7 +78,7 @@
 			<view class="flex tj-container">
 				<view class="tj-each">
 					<view class="num">
-						0扎
+						{{dto.orderCountToday||0}}扎
 					</view>
 					<view class="name">
 						今日订单数
@@ -82,7 +86,7 @@
 				</view>
 				<view class="tj-each">
 					<view class="num">
-						0扎
+						{{dto.orderCountYesterday||0}}扎
 					</view>
 					<view class="name">
 						昨日订单数
@@ -90,7 +94,7 @@
 				</view>
 				<view class="tj-each">
 					<view class="num">
-						0扎
+						{{dto.orderCountMonth||0}}扎
 					</view>
 					<view class="name">
 						本月订单数
@@ -98,23 +102,23 @@
 				</view>
 			</view>
 		</view>
-		<view class="item-container flex m-t-12" style="padding: 34rpx 44rpx;">
+		<view class="item-container flex m-t-12" style="padding: 34rpx 44rpx;" v-if="selftype=='supplier'">
 			<view class="rate-view flex1" style="max-width: 140rpx;">
 				<view class="title">售后率</view>
-				<view class="title" style="color: red;">0.00%</view>
+				<view class="title" style="color: red;">{{tj.salesRate||0}}%</view>
 			</view>
-			<view class="tj-panel  pink flex1">
+			<view class="tj-panel  pink flex1" @click="goto('/pages/order/order-delivery?status=ARRIVED',true)">
 				<view class="name">今日待配送</view>
-				<view class="title">0扎</view>
+				<view class="title">{{tj.deliverCount||0}}扎</view>
 			</view>
-			<view class="tj-panel green flex1">
+			<view class="tj-panel green flex1" @click="goto('/pages/order/order-delivery?status=',true)">
 				<view class="name green">今日配送汇总</view>
-				<view class="title">0扎</view>
+				<view class="title">{{tj.deliverTotal||0}}扎</view>
 			</view>
 		</view>
 		<view class="m-t-12" @click="getNoticeMore">
 			<uni-notice-bar class="notice-bar" color="#333" background-color="#fff" show-get-more show-icon
-				:scrollable="scrollable" :text="currentNotice.title||'暂无公共'" :key="currentNotice.id" />
+				:scrollable="scrollable" :text="currentNotice.title||'暂无公告'" :key="currentNotice.id" />
 			<span v-if="!currentNotice||!currentNotice.id">&nbsp;</span>
 		</view>
 		<view class="item-container">
@@ -159,13 +163,13 @@
 					</view>
 					<view class="order-desc syst">售后理赔</view>
 				</view>
-				<view class="nav row margin-tb" @click="goto('/sub_pages/supplier/order-records/order-records',true)">
+			<!-- 	<view class="nav row margin-tb" @click="goto('/sub_pages/supplier/order-records/order-records',true)">
 					<view class="img-c">
 						<image class="icon margin-bottom order-icon kkjl"
 							src="/static/images/supplier/user/user-icon-kkjl.png" mode="scaleToFill" />
 					</view>
 					<view class="order-desc wbsp">扣款记录</view>
-				</view>
+				</view> -->
 			</view>
 		</view>
 
@@ -194,6 +198,8 @@
 
 				},
 				scrollable: false,
+				cacheUserId:'',
+				tj:{}
 
 			};
 		},
@@ -204,6 +210,9 @@
 		onLoad(options) {
 			const url = options.q ? decodeURIComponent(options.q) : '';
 			const urlcode = options.url && decodeURIComponent(options.url) || ''
+		},
+		onShow(){
+			this.getTj()
 		},
 		created() {
 			//公告
@@ -224,24 +233,24 @@
 							this.scrollable = false
 						}
 						let that = this
-						if (this.noticeList.length >= 1) {
-							setInterval(() => {
-								console.log('interval,1')
-								that.currentNoticeIndex += 1
-								that.currentNoticeIndex %= that.noticeList.length
-								that.currentNotice = that.noticeList[that.currentNoticeIndex]
-								that.scrollable = false
-								that.$nextTick(() => {
-									if (that.currentNotice.title && that.currentNotice.title
-										.length >= 30) {
-										that.scrollable = true
-									} else {
-										that.scrollable = false
-									}
-								})
+						// if (this.noticeList.length >= 1) {
+						// 	setInterval(() => {
+						// 		console.log('interval,1')
+						// 		that.currentNoticeIndex += 1
+						// 		that.currentNoticeIndex %= that.noticeList.length
+						// 		that.currentNotice = that.noticeList[that.currentNoticeIndex]
+						// 		that.scrollable = false
+						// 		that.$nextTick(() => {
+						// 			if (that.currentNotice.title && that.currentNotice.title
+						// 				.length >= 30) {
+						// 				that.scrollable = true
+						// 			} else {
+						// 				that.scrollable = false
+						// 			}
+						// 		})
 
-							}, 8000)
-						}
+						// 	}, 8000)
+						// }
 
 					}
 				}
@@ -249,9 +258,36 @@
 
 		},
 		methods: {
+			getTj() {
+				// /api/supplier/delivery	
+				
+				if (this.currentInfo.id && this.currentInfo.id !== this.cacheUserId) {
+					this.cacheUserId = this.currentInfo.id
+					let that = this
+					setTimeout(() => {
+						//其他统计
+						// #ifdef PUB_SUPPLIER
+						this.$http.request('get', '/api/supplier/delivery/statistics', {}).then(res => {
+							if (res.code === 0) {
+								that.tj = res.data || {}
+							}
+						})
+						// #endif
+						// #ifdef PUB_PARTNER
+						this.$http.request('get', '/api/partner/order/statistics', {}).then(res => {
+							if (res.code === 0) {
+								that.tj = res.data || {}
+							}
+						})
+						// #endif
+						
+					}, 200)
+				}
+				
+			},
 			async toFlowManage() {
 
-				
+
 				if (!this.currentInfo.supplierDTO) {
 					await this.$message.confirm('尚未入驻店铺信息,是否前往入驻?')
 					this.goto('/sub_pages/supplier/supplier-info/supplier-info', true)
@@ -262,7 +298,7 @@
 					this.$message.showLoading()
 					await this.$store.dispatch('getCurrentInfo')
 					this.$message.hideLoading()
-					
+
 					if (this.currentInfo.supplierDTO.status == 'P') {
 
 					} else {
@@ -277,6 +313,7 @@
 
 					}
 				}
+				console.log('goto')
 				this.goto('/sub_pages/supplier/flower-manage/flower-manage', true)
 			},
 			getNoticeMore() {

--
Gitblit v1.9.3