From edeeafd87e7573b8722f72983a412eba17fa6687 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 11 二月 2026 09:11:48 +0800
Subject: [PATCH] 合并
---
mini-program/pages/distributor/distributor.vue | 348 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 301 insertions(+), 47 deletions(-)
diff --git a/mini-program/pages/distributor/distributor.vue b/mini-program/pages/distributor/distributor.vue
index fdf4a88..d23a85f 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>
@@ -44,11 +44,12 @@
<view class="data-c-item">
<view class="data-c-item-top">
<text>閿�鍞(鍏�)</text>
- <image src="/static/icon/ic_visible@2x.png" mode="widthFix"></image>
+ <image :src="showMoney?'/static/icon/ic_visible@2x.png':'/static/icon/ic_invisible@2x.png'" @click="showMoney=!showMoney" mode="widthFix"></image>
</view>
<view class="data-c-item-bottom">
- <text>12,000</text>
- <text>.00</text>
+ <text v-if="showMoney">{{(countData.saleTotalNum||0).toFixed(0)}}</text>
+ <text v-if="showMoney">{{countData.saleTotalFloat || '.00'}}</text>
+ <text v-if="!showMoney">****</text>
</view>
</view>
<view class="data-c-item">
@@ -56,8 +57,9 @@
<text>缁撶畻鍒╂鼎(鍏�)</text>
</view>
<view class="data-c-item-bottom">
- <text>12,00</text>
- <text>.00</text>
+ <text v-if="showMoney">{{(countData.profitTotalNum||0).toFixed(0)}}</text>
+ <text v-if="showMoney">{{countData.profitTotalFloat || '.00'}}</text>
+ <text v-if="!showMoney">****</text>
</view>
</view>
<view class="data-c-item">
@@ -65,80 +67,140 @@
<text>璁㈠崟鏁�</text>
</view>
<view class="data-c-item-bottom">
- <text>13</text>
+ <text v-if="showMoney">{{countData.orderNum||0}}</text>
+ <text v-if="!showMoney">****</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="list-item" v-for="(item, index) in 5" :key="index">
+ <view class="title" v-if="!show">寰呭鐞嗚鍗� ({{total}})</view>
+ <view class="list" v-if="!show">
+ <view class="list-item" v-for="(item, index) in dataList" :key="index">
<view class="a">
<view class="a-left">
- <view class="a-left-tips">鑷彁</view>
- <text>璁㈠崟鍙凤細71379283984239</text>
+ <view class="a-left-tips">{{item.receiveType==1?'鑷彁':'蹇�掗厤閫�'}}</view>
+ <text>璁㈠崟鍙凤細{{item.id}}</text>
</view>
- <view class="a-right">寰呰嚜鎻�</view>
+ <text v-if="item.status ==0" class="a-right">寰呮敮浠�</text>
+ <text v-if="item.status ==1" class="a-right">{{item.receiveType==1?'寰呰嚜鎻�':'寰呭彂璐�'}}</text>
+ <text v-if="item.status ==2" class="a-right">寰呮敹璐�</text>
+ <text v-if="item.status ==3" class="a-right">浜ゆ槗瀹屾垚</text>
+ <text v-if="item.status ==4"class="a-right">宸插彇娑�</text>
+ <text v-if="item.status ==6" class="a-right">宸查��娆�</text>
</view>
<view class="b">
- <view class="b-item">
+ <view class="b-item" v-for="(item1, index1) in (item.goodsorderDetailList||[])">
<view class="b-item-image">
- <image src="/static/logo.png" mode="widthFix"></image>
+ <image :src="item1.imgurl||'/static/logo.png'" mode="widthFix"></image>
</view>
- <view class="b-item-title">涓仈鑹剧瀹介娇 閫傜敤闆锋矁/涓仈/涔呬繚鐢�</view>
+ <view class="b-item-title">{{item1.name||''}}</view>
<view class="b-item-jia">
- <text>楼499.00</text>
- <text>x1</text>
+ <text>楼{{(item1.price||0).toFixed(2)}}</text>
+ <text>x{{item1.goodsNum||0}}</text>
+ </view>
+ </view>
+ <view class="b-item" v-for="(item1, index1) in (item.goodsorderDetailList||[])">
+ <view class="b-item-image">
+ <image :src="item1.imgurl||'/static/logo.png'" mode="widthFix"></image>
+ </view>
+ <view class="b-item-title">{{item1.name||''}}</view>
+ <view class="b-item-jia">
+ <text>楼{{(item1.price||0).toFixed(2)}}</text>
+ <text>x{{item1.goodsNum||0}}</text>
</view>
</view>
</view>
<view class="c">
<view class="c-label">
- <view class="c-label-title">闇�浠樻锛�</view>
+ <view class="c-label-title">瀹炰粯娆撅細</view>
<view class="c-label-price">
- <text>998</text>
- <text>.00</text>
+ <text>{{(item.price||0).toFixed(2)}}</text>
+ <text></text>
</view>
</view>
<view class="c-btns">
- <view class="c-btns-item blue">鑱旂郴瀹㈡埛</view>
+ <view class="c-btns-item blue" @click="contactPhone(item)">鑱旂郴瀹㈡埛</view>
<view class="c-btns-item bg">鑷彁鏍搁攢</view>
</view>
</view>
- <view class="d">
- 璁㈠崟澶囨敞锛�11鏈�22鏃ユ潵鎷�
+ <view class="d" v-if="item.memberInfo">
+ 璁㈠崟澶囨敞锛歿{item.memberInfo||''}}
</view>
</view>
+ <view v-if="!hasNext" class="nomore">宸插姞杞藉叏閮�</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>
+ <u-popup :show="showPhone" round="15" mode="bottom" :safeAreaInsetBottom="true" @close="contactPhone()" :closeable="true" :closeOnClickOverlay="true">
+ <view class="phone">
+ <view class="phone-head">
+ <view></view>
+ <text>鑱旂郴瀹㈡埛</text>
+ </view>
+ <!-- <view class="phone-item">
+ <view>
+ <image style="width: 36rpx;height: 36rpx" src="/static/icon/ic_kefu.png" mode="widthFix"></image>
+ <button open-type="contact" plain="true" bindcontact="handleContact">鍦ㄧ嚎瀹㈡湇</button>
+ </view>
+ <view class="line" v-if="serverPhone && serverPhone.length"></view>
+ </view> -->
+ <view class="phone-item" >
+ <view>
+ <image src="/static/icon/ic_call@2x.png" mode="widthFix" @click="contactPhoneDo()"></image>
+ <text>{{linkItem.linkname}} </text>
+ <text style="margin-left: 10px;"> {{linkItem.linkphone}}</text>
+ </view>
+ </view>
+ <view style="width: 100%; height: 30rpx;"></view>
+ <!-- <view class="phone-botton" @click="contactPhone()" >鍏抽棴</view> -->
+ </view>
+ </u-popup>
</view>
</template>
@@ -146,12 +208,131 @@
import { mapState } from 'vuex'
export default {
computed: {
- ...mapState(['navHeight', 'statusbarHeight'])
+ ...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
},
data() {
- return {
+ return {
+ show:false,
+ active:0,
+ loading:false,
+ showMoney:false,
+ showPhone:false,
+ currentPage:1,
+ total:0,
+ hasNext:true,
+ dataList:[],
+ shop:{},
+ linkItem:{},
+ countData:{},
backgroundImage: require('@/static/images/bg_card@2x.png')
};
+ },
+ onShow() {
+ this.shop ={}
+ this.checkShopLogin()
+ this.active=0
+ this.shop = this.shopInfo || {}
+ this.getCountData()
+ this.currentPage = 0
+ this.getOrderList()
+ },
+ onReachBottom(){
+ this.getOrderList( );
+ },
+ methods:{
+ contactPhone(item){
+ this.showPhone = !this.showPhone
+ this.linkItem = item ||{}
+ console.log("==================================",this.showPhone)
+ },
+ contactPhoneDo(){
+ if(this.linkItem.linkphone !=null && this.linkItem.linkphone!=''){
+ uni.makePhoneCall({
+ phoneNumber: this.linkItem.linkphone
+ })
+ }
+ },
+ changeActive(index){
+ this.getCountData(index)
+ },
+ checkShopLogin(){
+ var that =this
+ if( this.shopInfo ==null || this.shopInfo.id==null || this.shopToken==null || this.shopToken==''){
+ this.jumpShopLogin()
+ }
+ },
+ async getCountData(index){
+ var that =this
+ let res = await that.$u.api.saleReport({ dateType: index, endDate: null, startDate: null, tokenType:1 })
+ if (res.code === 200) {
+ this.active = index
+ this.countData = res.data
+ this.countData.profitTotal = (this.countData.profitTotal||0.00 ).toFixed(2)
+ this.countData.saleTotal = (this.countData.saleTotal||0.00).toFixed(2)
+ this.countData.profitTotalNum = Math.floor(this.countData.profitTotal)
+ this.countData.saleTotalNum = Math.floor( this.countData.saleTotal)
+ var t1 =(this.countData.profitTotal - this.countData.profitTotalNum).toFixed(2)
+ var t2 =(this.countData.saleTotal - this.countData.saleTotalNum).toFixed(2)
+ this.countData.profitTotalFloat =( t1+'').slice(1, 4)
+ this.countData.saleTotalFloat = ( t2+'').slice(1, 4)
+ }
+ },
+ async getOrderList(){
+ if(this.loading || !this.hasNext){
+ return
+ }
+ this.loading=true
+ this.currentPage = this.currentPage+1
+ if(this.currentPage == 1){
+ this.hasNext =true
+ this.dataList=[]
+ }
+ var that =this
+ let res = await that.$u.api.shopOrderPage({
+ capacity:10,
+ model: {
+ receiveType: 1,
+ status: 1
+ },
+ page:this.currentPage
+ });
+ console.log(res)
+ if (res.code === 200 ) {
+ if ( res.data && res.data.page ===this.currentPage) {
+ res.data.records = res.data.records||[]
+ that.dataList.push(...res.data.records)
+ that.total=res.data.total
+ if( this.currentPage >= res.data.pageCount||0){
+ that.hasNext=false
+ }else{
+ that.hasNext=true
+ }
+ }
+ }
+ this.loading=false
+ },
+ 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>
@@ -211,6 +392,13 @@
.list {
width: 100%;
margin-top: 30rpx;
+ padding-bottom: 60rpx;
+ .nomore{
+ width: 100%;
+ text-align: center;
+ font-size: 24rpx;
+ color: #666666;
+ }
.list-item {
width: 100%;
padding: 30rpx;
@@ -253,8 +441,7 @@
}
}
.b {
- width: 100%;
- height: 136rpx;
+ width: 100%;
display: flex;
flex-direction: column;
margin-top: 22rpx;
@@ -286,6 +473,10 @@
font-size: 30rpx;
color: #222222;
margin-right: 30rpx;
+ display: -webkit-box;
+ -webkit-line-clamp: 2; /* 闄愬埗鏂囨湰涓�2琛� */
+ -webkit-box-orient: vertical;
+ overflow: hidden;
}
.b-item-jia {
flex-shrink: 0;
@@ -572,5 +763,68 @@
}
}
}
+ .phone {
+ width: 100%;
+ padding-top: 40rpx;
+ box-sizing: border-box;
+ .phone-botton {
+ width: 100%;
+ height: 88rpx;
+ line-height: 88rpx;
+ text-align: center;
+ font-weight: 500;
+ font-size: 32rpx;
+ color: #FFFFFF;
+ background: #00BC12;
+ border-radius: 44rpx;
+ margin-top: 60rpx;
+ }
+ .phone-head {
+ width: 100%;
+ text-align: center;
+ justify-content: space-between;
+ margin-bottom: 40rpx;
+ text {
+ font-weight: 800;
+ font-size: 32rpx;
+ color: #222222;
+ }
+ }
+
+ .phone-item {
+ width: 100%;
+ text-align: center;
+ display: flex;
+ justify-content: center;
+ flex-direction: column;
+ // border-bottom: 1rpx solid #eeeeee;
+ line-height: 78rpx;
+ button{
+ border: 1rpx white solid;
+ display: inline;
+ width: 300rpx;
+ font-weight: 500;
+ font-size: 32rpx;
+ line-height: 32rpx;
+ color: #222222;
+ }
+ image{
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 30rpx;
+ }
+ .line{
+ width: 100%;
+ height: 1rpx;
+ background-color: #f2f2f2
+ }
+ text {
+ font-weight: 500;
+ font-size: 28rpx;
+ line-height: 28rpx;
+ color: #222222;
+ }
+ }
+ }
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3