From 9287e9a02f9a9a85b0c4dc49f04d1426af4a0ede Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期六, 25 四月 2026 15:16:51 +0800
Subject: [PATCH] 支付宝支付ddd
---
small-program/shop/pages/store-home/store-home.vue | 259 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 197 insertions(+), 62 deletions(-)
diff --git a/small-program/shop/pages/store-home/store-home.vue b/small-program/shop/pages/store-home/store-home.vue
index 2769fe2..0118cee 100644
--- a/small-program/shop/pages/store-home/store-home.vue
+++ b/small-program/shop/pages/store-home/store-home.vue
@@ -15,11 +15,11 @@
<view class="stats-section" :style="{ backgroundImage: 'url(' + bgImg + ')' }">
<view class="stats-tabs">
<view class="stats-tabs-left">
- <text class="tab-item active">浠婃棩</text>
- <text class="tab-item">鏈湀</text>
- <text class="tab-item">涓婃湀</text>
+ <view :class="'tab-item '+(active ==0?'active':'')" @click="changeActive(0)">浠婃棩</view>
+ <view :class="'tab-item '+(active ==1?'active':'')" @click="changeActive(1)">鏈湀</view>
+ <view :class="'tab-item '+(active ==2?'active':'')" @click="changeActive(2)">涓婃湀</view>
</view>
- <text class="tab-item right">鍦ㄥ簱璁㈠崟: 10</text>
+ <text class="tab-item right">鍦ㄥ簱璁㈠崟: {{countData.storageCount||0}}</text>
</view>
<view class="stats-cards">
@@ -28,19 +28,19 @@
<text>閿�鍞(鍏�)</text>
<image class="stat-icon" src="/static/icon/ic_visible@2x.png"></image>
</view>
- <text class="stat-value">12,000.00</text>
+ <text class="stat-value">{{countData.salesAmount}}</text>
</view>
<view class="stat-card">
<view class="stat-label">
<text>缁撶畻鍒╂鼎(鍏�)</text>
</view>
- <text class="stat-value">1,200.00</text>
+ <text class="stat-value">{{countData.settlementProfit}}</text>
</view>
<view class="stat-card">
<view class="stat-label">
<text>璁㈠崟鏁�</text>
</view>
- <text class="stat-value">23</text>
+ <text class="stat-value">{{countData.orderCount||0}}</text>
</view>
</view>
</view>
@@ -48,16 +48,16 @@
<!-- 鍔熻兘鎸夐挳 -->
<view class="function-buttons">
- <view class="func-btn">
+ <view class="func-btn" @click="jumpHexiaoOrder">
<image class="func-icon" src="/static/icon/ic_zitihexiao@2x.png"></image>
<text class="func-text">闂ㄥ簵鍑哄叆搴�</text>
</view>
- <view class="func-btn">
+ <view class="func-btn" @click="jumpOrders()">
<image class="func-icon" src="/static/icon/ic_dingdanguanli@2x.png"></image>
<text class="func-text">璁㈠崟绠$悊</text>
</view>
<view class="func-btn" @click="goToStoreInfo">
- <image class="func-icon" src="/static/icon/ic_wodezizhi@2x.png"></image>
+ <image class="func-icon" src="/static/icon/ic_zhuanshuhaibao@2x.png"></image>
<text class="func-text">闂ㄥ簵淇℃伅</text>
</view>
<view class="func-btn" @click="goToQualification">
@@ -65,55 +65,54 @@
<text class="func-text">闂ㄥ簵璧勮川</text>
</view>
</view>
-
- <text class="section-title">寰呭鐞嗚鍗�(2)</text>
-
+ <text class="section-title">寰呭鐞嗚鍗�({{total||0}})</text>
<!-- 寰呭鐞嗚鍗� -->
<view class="orders-section">
- <view class="order-item">
- <view class="order-header">
+ <view class="order-item" v-for="(item,index) in dataList" :key="item.id">
+ <view class="order-header" @click="jumpOrderDetails(item.id)">
<view style="display: flex; align-items: center;">
- <view class="order-tag">灏卞湴瀵勫瓨</view>
- <text class="order-user">鏉庢槑 181****1898</text>
+ <view class="order-tag">{{item.type===1?'鍚屽煄閰嶉��':'灏卞湴瀵勫瓨'}}</view>
+ <text class="order-user">{{item.takeUser || ''}} {{item.takePhone||''}}</text>
</view>
- <text class="order-status">寰呮牳楠�</text>
+ <view style="display: flex;flex-direction: column;">
+ <text v-if="item.status ===5 && item.overdueStatus ===1 " class="order-status" style="color: red;">瓒呮椂鏈彇浠�</text>
+ <text v-else-if="item.status ===5 && item.overdueStatus ===3 " class="order-status" style="color: red;">瓒呮椂鍒板簵鍙栦欢</text>
+ <text v-else class="order-status">{{item.statusName || ''}}</text>
+ <text v-if="item.status ===5 && item.overdueStatus ===1 " class="order-status" style="color: red;font-size: 24rpx;">閫炬湡璐圭敤楼{{((item.overdueFee || 0)/100).toFixed(2)}}</text>
+ <text v-if="item.status ===5 && item.overdueStatus ===3 " class="order-status" style="color: red;font-size: 24rpx;">閫炬湡璐圭敤楼{{((item.overdueFee || 0)/100).toFixed(2)}}</text>
+ </view>
</view>
- <view class="order-items">
- <view class="order-product">
- <view class="product-info">
- <text class="product-name">澶т欢琛屾潕绠�</text>
- <text class="product-spec">24-28瀵�</text>
- </view>
- <view class="product-price-count">
- <text class="product-price">楼35</text>
- <text class="product-count">x1</text>
- </view>
- </view>
- <view class="order-product">
- <view class="product-info">
- <text class="product-name">涓欢琛屾潕绠�</text>
- <text class="product-spec">24-28瀵�</text>
- </view>
- <view class="product-price-count">
- <text class="product-price">楼35</text>
- <text class="product-count">x1</text>
- </view>
- </view>
+ <view class="order-items" @click="jumpOrderDetails(item.id)">
+ <view class="order-product" v-for="(item1,index1) in item.detailList" :key="item1.id">
+ <view class="product-info">
+ <text class="product-name">{{item1.luggageName || ''}}</text>
+ <text class="product-spec">{{item1.luggageDetail || ''}}</text>
+ </view>
+ <view class="product-price-count">
+ <text class="product-price">楼{{((item1.subtotal || 0)/100).toFixed(2) }}</text>
+ <text class="product-count">x{{ item1.num || 1}}</text>
+ </view>
+ </view>
</view>
<view class="order-footer">
<text class="total-price">
<text>瀹炰粯娆�: </text>
- <text>楼80.00</text>
+ <text>楼{{((item.estimatedAmount || 0)/100).toFixed(2) }}</text>
</text>
<view class="order-buttons">
- <button class="btn secondary">鑱旂郴瀹㈡埛</button>
- <button class="btn primary">鎵爜鏍搁攢</button>
- </view>
+ <button class="btn secondary" @click="contactPhoneDo(item.takePhone)">鑱旂郴瀹㈡埛</button>
+ <button class="btn secondary" @click="contactPhoneDo(item.driverPhone)" v-if="item.type ===1&&(item.status === 4 || item.status === 3)">鑱旂郴楠戞墜</button>
+ <button class="btn primary" v-if="item.status ===1 " @click="jumpHexiaoOrder(item)">鏀朵欢鏍搁攢</button>
+ <button class="btn primary" v-if="item.status ===5 &&(item.overdueStatus ==0 || item.overdueStatus == 1)" @click="jumpHexiaoOrder(item)">纭鍒板簵</button>
+ <button class="btn primary" v-if="item.status ===5 && (item.overdueStatus == 4 || item.overdueStatus == 2) " @click="jumpHexiaoOrder(item)">鍙栦欢鏍搁攢</button>
+ </view>
</view>
-
- <view class="order-note">璁㈠崟澶囨敞: 13:30鏉ュ瘎瀛�</view>
+ <view class="order-note" v-if="item.remark">璁㈠崟澶囨敞: <text>{{item.remark || '-'}}</text></view>
</view>
+ <view v-if="isLoadingMore" class="loading-text">鍔犺浇涓�...</view>
+ <view v-else-if="!hasNext && dataList.length" class="loading-text">娌℃湁鏇村浜�</view>
+ <view v-else-if="!hasNext && !dataList.length" class="loading-text">鏆傛棤鏁版嵁</view>
</view>
<custom-tabbar></custom-tabbar>
</view>
@@ -131,27 +130,158 @@
},
onReachBottom() {
console.log('store-home onReachBottom')
+ this.getDataList();
},
+ onShow() {
+ this.shop ={}
+ this.checkShopLogin()
+ this.active=0
+ this.shop = this.shopInfo || {}
+ this.getCountData(0)
+ this.total=0
+ this.hasNext=true
+ this.currentPage = 0
+ this.getFirstPageData()
+ },
methods: {
- goToStoreInfo() {
- uni.navigateTo({
- url: '/shop/pages/store-info/store-info'
- })
- },
- goToQualification() {
- uni.navigateTo({
- url: '/shop/pages/qualification/qualification'
- })
- },
- goToStore() {
- uni.switchTab({
- url: '/pages/index/index'
- })
- }
+ changeActive(index){
+ this.getCountData(index)
+ },
+ checkShopLogin(){
+ /* var that =this
+ if( this.shopInfo ==null || this.shopInfo.id==null || this.shopToken==null || this.shopToken==''){
+ this.jumpShopLogin()
+ } */
+ },
+ hexiaoOrder(item){
+ uni.navigateTo({
+ url:'/shop/pages/write-off-a/write-off-a?id='+item.id
+ })
+ },
+ jumpHexiaoOrder(){
+ uni.navigateTo({
+ url:'/shop/pages/write-off/write-off'
+ })
+ },
+ jumpOrders(){
+ uni.navigateTo({
+ url:'/shop/pages/orders/orders'
+ })
+ },
+ jumpOrderDetails(id){
+ uni.navigateTo({
+ url:'/shop/pages/order-details/order-details?id='+id
+ })
+ },
+ async getCountData(index){
+ var that =this
+ let res = await that.$u.api.shopSalesStats({ period: index, endDate: null, startDate: null, tokenType:1 })
+ if (res.code === 200) {
+ this.active = index
+ this.countData = res.data
+ this.countData.salesAmount = (this.countData.salesAmount||0.00 ).toFixed(2)
+ console.log(this.countData.salesAmount,'====================',1)
+ this.countData.settlementProfit = (this.countData.settlementProfit||0.00).toFixed(2)
+ this.countData.salesAmountNum = Math.floor(this.countData.salesAmount)
+
+ console.log(this.countData.salesAmountNum,'====================',2)
+ this.countData.settlementProfitNum = Math.floor( this.countData.settlementProfit)
+ var t1 =(this.countData.salesAmount - this.countData.salesAmountNum).toFixed(2)
+ console.log(t1,'====================',3)
+ var t2 =(this.countData.settlementProfit - this.countData.settlementProfitNum).toFixed(2)
+ this.countData.salesAmountFloat =( t1+'').slice(1, 4)
+
+ console.log(this.countData.salesAmountFloat,'====================',4)
+ this.countData.settlementProfitFloat = ( t2+'').slice(1, 4)
+ }
+ },
+ getFirstPageData(){
+ this.currentPage = 0
+ this.hasNext=true
+ this.total=0
+ this.dataList=[]
+ this.getDataList()
+ },
+ async getDataList(){
+ 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:this.pageSize,
+ model: {
+ combinedStatus: 7
+ },
+ page:this.currentPage
+ });
+ 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
+ },
+ contactPhoneDo(phone){
+ if( phone!=null && phonee!=''){
+ uni.makePhoneCall({
+ phoneNumber: phone
+ })
+ }
+ },
+ goToStoreInfo() {
+ uni.navigateTo({
+ url: '/shop/pages/store-info/store-info'
+ })
+ },
+ goToQualification() {
+ uni.navigateTo({
+ url: '/shop/pages/qualification/qualification'
+ })
+ },
+ goToStore() {
+ uni.switchTab({
+ url: '/pages/index/index'
+ })
+ },
+ jumpShopLogin() {
+ uni.redirectTo({
+ url: '/shop/pages/login/login'
+ })
+ }
},
data() {
return {
bgImg: require('@/static/image/bg_card@2x.png'),
+ show:false,
+ showHaibao:false,
+ showQrcode:false,
+ active:0,
+ loading:false,
+ showMoney:false,
+ showPhone:false,
+ currentPage:1,
+ total:0,
+ hasNext:true,
+ pageSize: 10,
+ isLoadingMore: false,
+
+ dataList:[],
+ shop:{},
+ linkItem:{},
+ countData:{},
orders: [
{
id: 1,
@@ -192,7 +322,12 @@
background-color: $bg-color;
min-height: 100vh;
}
-
+.loading-text {
+ padding: 18rpx 0 8rpx;
+ text-align: center;
+ font-size: 22rpx;
+ color: #a5aab3;
+ }
/* 娓愬彉鑳屾櫙瀹瑰櫒 */
.gradient-background {
padding: 0 30rpx;
@@ -517,7 +652,7 @@
.order-note {
width: 100%;
font-size: 26rpx;
- color: #666666;
+ color: red;
background-color: #F8F9FB;
padding: 20rpx;
box-sizing: border-box;
--
Gitblit v1.9.3