wangfukang 7 days ago
parent
commit
1c5a664049
  1. 448
      package2/shop/shopBill.vue
  2. 337
      package2/shop/shopSettlementDetail.vue

448
package2/shop/shopBill.vue

@ -11,83 +11,74 @@
</view>
</view>
</view>
<view style="margin: -120rpx auto 0;">
<view class="">
<view class="content11">
2026
<view class="bill-content">
<view class="filter-card">
<view class="status-tabs">
<view class="status-tab" :class="{'active': searchForm.status === 0}" @tap="switchStatus(0)">待结算</view>
<view class="status-tab" :class="{'active': searchForm.status === 1}" @tap="switchStatus(1)">已结算</view>
</view>
<view class="date-filter">
<picker mode="date" :value="searchForm.startDate" @change="onStartDateChange">
<view class="date-box" :class="{'placeholder': !searchForm.startDate}">{{searchForm.startDate || '开始日期'}}</view>
</picker>
<text class="date-split"></text>
<picker mode="date" :value="searchForm.endDate" @change="onEndDateChange">
<view class="date-box" :class="{'placeholder': !searchForm.endDate}">{{searchForm.endDate || '结束日期'}}</view>
</picker>
<view class="filter-btn" @tap="reload">筛选</view>
<view class="clear-btn" v-if="searchForm.startDate || searchForm.endDate" @tap="clearDate">重置</view>
</view>
<view class="box1" @tap="goDetail">
<view class="content22">
<view class="">
10/25-10/25账单
</view>
<view class="">
<text>0</text>
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
<view style="border-bottom: 1px solid #eee;">
<view class="content33">
<view class="content44">
商品金额
</view>
<view class="">
0.00
</view>
</view>
<view class="content33">
<view class="content44">
餐盒费
</view>
<view class="">
0.00
</view>
</view>
<view class="content33">
<view class="content44">
活动成本
</view>
<view class="">
0.00
</view>
</view>
<view class="content33">
<view class="content44">
平台服务费
</view>
<view class="">
0.00
</view>
<view class="summary-card">
<view class="summary-title">{{searchForm.status === 0 ? '待结算金额' : '已结算金额'}}</view>
<view class="summary-amount">{{formatMoney(pageTotalAmount)}}</view>
<view class="summary-desc">当前列表共 {{total}} 个账单日</view>
</view>
<view class="bill-list">
<view class="bill-card" v-for="item in dataList" :key="item.billTime" @tap="goDetail(item)">
<view class="bill-head">
<view>
<view class="bill-date">{{item.billTime}}</view>
<view class="bill-sub"> {{item.recordCount || 0}} 笔记录</view>
</view>
<view class="">
<view class="content33">
<view class="content44">
结算金额
<view class="bill-status" :class="{'done': item.status === 1}">
{{item.status === 1 ? '已结算' : '待结算'}}
</view>
<view class="">
0.00
</view>
<view class="bill-grid">
<view class="bill-metric">
<text>结算基数</text>
<view>{{formatMoney(item.totalBaseAmount)}}</view>
</view>
<view class="content33">
<view class="content44">
本期期初
<view class="bill-metric">
<text>平台服务费</text>
<view>{{formatMoney(item.totalCommissionAmount)}}</view>
</view>
<view class="">
0.00
</view>
<view class="bill-extra">
<view>
<text>正常结算</text>
<text>{{formatMoney(item.positiveSettlementAmount)}}</text>
</view>
<view class="content33">
<view class="content44">
实际打款金额
<view>
<text>退款/售后扣款</text>
<text class="negative">{{formatMoney(item.negativeSettlementAmount)}}</text>
</view>
<view class="">
0.00
</view>
<view class="bill-footer">
<view>
<text>应结算金额</text>
<text class="settle-amount">{{formatMoney(item.totalSettlementAmount)}}</text>
</view>
<uni-icons type="right" size="16" color="#9aa6a2"></uni-icons>
</view>
</view>
</view>
<view class="empty-state" v-if="!loading && dataList.length === 0">暂无账单记录</view>
<view class="load-state" v-if="dataList.length > 0">{{loadStatus === 'loading' ? '加载中...' : loadStatus === 'nomore' ? '没有更多了' : '上拉加载更多'}}</view>
</view>
</view>
</template>
@ -96,19 +87,120 @@
export default {
data() {
return {
menuButtonInfo: {}
menuButtonInfo: {},
loading: false,
loadStatus: 'more',
total: 0,
pages: 1,
dataList: [],
searchForm: {
shopId: '',
regionId: '',
status: 0,
startDate: '',
endDate: '',
pageNumber: 1,
pageSize: 10
}
}
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
},
onLoad(option) {
this.searchForm.shopId = option.shopId || uni.getStorageSync('shopId') || ''
this.searchForm.regionId = this.getRegionId()
this.reload()
},
onReachBottom() {
if (this.loading || this.searchForm.pageNumber >= this.pages) return
this.searchForm.pageNumber++
this.getDataList()
},
computed: {
pageTotalAmount() {
return this.dataList.reduce((total, item) => total + this.toAmount(item.totalSettlementAmount), 0)
}
},
methods: {
goDetail(){
getRegionId() {
const area = uni.getStorageSync('area')
if (!area) return ''
if (typeof area === 'object') return area.id || ''
try {
return JSON.parse(area).id || ''
} catch (e) {
return ''
}
},
switchStatus(status) {
if (this.searchForm.status === status) return
this.searchForm.status = status
this.reload()
},
onStartDateChange(e) {
this.searchForm.startDate = e.detail.value
},
onEndDateChange(e) {
this.searchForm.endDate = e.detail.value
},
clearDate() {
this.searchForm.startDate = ''
this.searchForm.endDate = ''
this.reload()
},
reload() {
this.searchForm.pageNumber = 1
this.pages = 1
this.dataList = []
this.getDataList()
},
getDataList() {
if (!this.searchForm.shopId) {
this.tui.toast('未获取到商家信息')
return
}
this.loading = true
this.loadStatus = 'loading'
this.tui.request('/mall/admin/settlement/dateSummaryList', 'POST', this.searchForm, false, false).then((res) => {
this.loading = false
if (res.code == 200) {
const result = res.result || {}
const records = Array.isArray(result.records) ? result.records : []
this.total = result.total || records.length
this.pages = result.pages || 1
if (this.searchForm.pageNumber == 1) {
this.dataList = records
} else {
this.dataList = this.dataList.concat(records)
}
this.loadStatus = this.searchForm.pageNumber >= this.pages ? 'nomore' : 'more'
} else {
this.loadStatus = 'more'
this.tui.toast(res.message || '获取账单失败')
}
}).catch(() => {
this.loading = false
this.loadStatus = 'more'
})
},
toAmount(value) {
const amount = parseFloat(value)
return isNaN(amount) ? 0 : amount
},
formatMoney(value) {
return this.toAmount(value).toFixed(2)
},
goDetail(item){
uni.navigateTo({
url:'/package2/shop/shopSettlementDetail'
url:'/package2/shop/shopSettlementDetail?shopId=' + encodeURIComponent(this.searchForm.shopId) +
'&regionId=' + encodeURIComponent(this.searchForm.regionId) +
'&billTime=' + encodeURIComponent(item.billTime) +
'&status=' + this.searchForm.status +
'&recordCount=' + (item.recordCount || 0) +
'&totalSettlementAmount=' + encodeURIComponent(item.totalSettlementAmount || 0) +
'&totalBaseAmount=' + encodeURIComponent(item.totalBaseAmount || 0) +
'&totalCommissionAmount=' + encodeURIComponent(item.totalCommissionAmount || 0)
})
},
back() {
@ -129,15 +221,17 @@
.page1 {
width: 100%;
height: 100%;
min-height: 100%;
font-size: 24rpx;
position: relative;
padding-bottom: 40rpx;
}
.title {
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;
width: 100%;
height: 20%;
height: 300rpx;
background-size: 100% 100%;
}
.title-sreach {
@ -160,34 +254,214 @@
flex: 1;
text-align: center;
}
.box1 {
width: 95%;
margin: 0 auto 20rpx;
.bill-content {
width: 92%;
margin: -90rpx auto 0;
position: relative;
z-index: 2;
}
.filter-card,
.summary-card,
.bill-card {
background: #fff;
border-radius: 20rpx;
border-radius: 28rpx;
box-shadow: 0 14rpx 34rpx rgba(0, 35, 28, 0.08);
}
.filter-card {
padding: 20rpx;
margin-bottom: 20rpx;
}
.content11{
height: 70rpx;
line-height: 70rpx;
padding-left: 40rpx;
font-size: 28rpx;
.status-tabs {
display: flex;
padding: 8rpx;
border-radius: 999rpx;
background: #f3f8f6;
}
.status-tab {
flex: 1;
height: 64rpx;
line-height: 64rpx;
border-radius: 999rpx;
text-align: center;
color: #6f7f79;
font-size: 26rpx;
font-weight: 800;
}
.status-tab.active {
background: linear-gradient(90deg, #e3ff96, #a6ffea);
color: #00231C;
}
.date-filter {
margin-top: 18rpx;
display: flex;
align-items: center;
}
.date-box {
width: 168rpx;
height: 58rpx;
line-height: 58rpx;
border-radius: 16rpx;
background: #f6faf8;
text-align: center;
font-size: 23rpx;
font-weight: 700;
color: #00231C;
}
.date-box.placeholder {
color: #9aa6a2;
}
.date-split {
margin: 0 10rpx;
color: #9aa6a2;
}
.content22{
.filter-btn,
.clear-btn {
height: 58rpx;
line-height: 58rpx;
padding: 0 20rpx;
margin-left: 12rpx;
border-radius: 16rpx;
font-weight: 800;
}
.filter-btn {
background: #00231C;
color: #a6ffea;
}
.clear-btn {
background: #f3f6f4;
color: #6f7f79;
}
.summary-card {
padding: 28rpx;
margin-bottom: 20rpx;
background: linear-gradient(135deg, #00231C 0%, #14564a 100%);
color: #fff;
}
.summary-title {
font-size: 24rpx;
opacity: 0.8;
}
.summary-amount {
margin-top: 10rpx;
font-size: 54rpx;
font-weight: 900;
color: #e3ff96;
}
.summary-desc {
margin-top: 8rpx;
color: rgba(255,255,255,0.72);
}
.bill-card {
padding: 24rpx;
margin-bottom: 20rpx;
}
.bill-head,
.bill-footer,
.bill-extra view {
display: flex;
height: 60rpx;
line-height: 44rpx;
border-bottom: 1px solid #eee;
align-items: center;
justify-content: space-between;
}
.bill-date {
font-size: 32rpx;
font-weight: 900;
}
.bill-sub {
margin-top: 8rpx;
color: #7a8582;
font-size: 23rpx;
}
.bill-status {
padding: 8rpx 16rpx;
border-radius: 999rpx;
background: #fff2df;
color: #f08a24;
font-weight: 900;
}
.bill-status.done {
background: #e8fff7;
color: #0b9b73;
}
.bill-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16rpx;
margin-top: 22rpx;
}
.bill-metric {
padding: 18rpx;
border-radius: 20rpx;
background: #f7faf8;
}
.bill-metric text,
.bill-extra text:first-child,
.bill-footer text:first-child {
color: #7a8582;
}
.bill-metric view {
margin-top: 8rpx;
font-size: 28rpx;
font-weight: 900;
}
.bill-extra {
margin-top: 18rpx;
padding: 16rpx 0;
border-top: 1rpx solid #eef2ef;
border-bottom: 1rpx solid #eef2ef;
}
.bill-extra view + view {
margin-top: 12rpx;
}
.negative {
color: #f0441f;
}
.bill-footer {
min-height: 72rpx;
font-size: 26rpx;
font-weight: 600;
}
.content33{
height: 50rpx;
line-height: 50rpx;
display: flex;
.settle-amount {
margin-left: 18rpx;
color: #ff5722;
font-size: 34rpx;
font-weight: 900;
}
.content44{
flex: 1;
.empty-state,
.load-state {
padding: 60rpx 0;
text-align: center;
color: #9aa6a2;
}
</style>

337
package2/shop/shopSettlementDetail.vue

@ -1,5 +1,5 @@
<template>
<!-- 商家单详情 -->
<!-- 商家单详情 -->
<view class="page1">
<view class="title">
<view class="title-sreach">
@ -11,61 +11,63 @@
</view>
</view>
</view>
<view class="content">
<view class="box1">
<view style="font-size: 28rpx;font-weight: 700;margin-bottom: 20rpx;">
2026-04-09
</view>
<view style="display: flex;font-weight: 700;">
<view style="flex: 1;">
结算金额100.00
</view>
<view style="flex: 1;">
实际打款金额100.00
</view>
</view>
</view>
<view class="box1">
<uni-table border stripe emptyText="暂无更多数据" >
<!-- 表头行 -->
<uni-tr>
<uni-th width="100" align="center">订单编号</uni-th>
<uni-th width="100" align="center">商品金额</uni-th>
<uni-th width="100" align="center">餐盒费</uni-th>
<uni-th width="100" align="center">平台抽佣</uni-th>
<uni-th width="100" align="center">结算金额</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr>
<uni-td align="center">5154564164654</uni-td>
<uni-td align="center">24</uni-td>
<uni-td align="center">1</uni-td>
<uni-td align="center">1</uni-td>
<uni-td align="center">22</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">5154564164654</uni-td>
<uni-td align="center">24</uni-td>
<uni-td align="center">1</uni-td>
<uni-td align="center">1</uni-td>
<uni-td align="center">22</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">5154564164654</uni-td>
<uni-td align="center">24</uni-td>
<uni-td align="center">1</uni-td>
<uni-td align="center">1</uni-td>
<uni-td align="center">22</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">5154564164654</uni-td>
<uni-td align="center">24</uni-td>
<uni-td align="center">1</uni-td>
<uni-td align="center">1</uni-td>
<uni-td align="center">22</uni-td>
</uni-tr>
</uni-table>
<view class="summary-card">
<view class="summary-date">{{query.billTime || '-'}}</view>
<view class="summary-row">
<view>
<text>结算金额</text>
<view>{{formatMoney(query.totalSettlementAmount)}}</view>
</view>
<view>
<text>记录数</text>
<view>{{query.recordCount || 0}} </view>
</view>
</view>
<view class="summary-mini">
<view>结算基数{{formatMoney(query.totalBaseAmount)}}</view>
<view>平台服务费{{formatMoney(query.totalCommissionAmount)}}</view>
</view>
</view>
<view class="record-list">
<view class="record-card" v-for="item in detailList" :key="item.id" @tap="goOrderDetail(item)">
<view class="record-head">
<view>
<view class="record-title">{{item.type == 2 ? '退款/售后扣款' : '正常结算'}}</view>
<view class="record-sub">订单号{{item.orderNumber || item.orderId || '-'}}</view>
</view>
<view class="record-amount" :class="{'negative': item.type == 2}">
{{item.type == 2 ? '-' : ''}}{{formatMoney(absAmount(item.settlementAmount))}}
</view>
</view>
<view class="record-grid">
<view>
<text>结算基数</text>
<view>{{formatMoney(item.baseAmount)}}</view>
</view>
<view>
<text>平台抽佣</text>
<view>{{formatMoney(item.commissionAmount)}}</view>
</view>
<view>
<text>抽佣比例</text>
<view>{{formatMoney(item.commissionRate)}}%</view>
</view>
<view>
<text>生成时间</text>
<view>{{formatDateTime(item.createTime)}}</view>
</view>
</view>
<view class="record-footer">
<text>查看订单详情</text>
<uni-icons type="right" size="15" color="#9aa6a2"></uni-icons>
</view>
</view>
</view>
<view class="empty-state" v-if="!loading && detailList.length === 0">暂无账单明细</view>
</view>
</view>
</template>
@ -75,26 +77,96 @@
data() {
return {
menuButtonInfo: {},
}
loading: false,
query: {
shopId: '',
regionId: '',
billTime: '',
status: 0,
recordCount: 0,
totalSettlementAmount: 0,
totalBaseAmount: 0,
totalCommissionAmount: 0
},
filters:{
formatISOTime(isoString) {
const date = new Date(isoString);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
const seconds = date.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
detailList: []
}
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
},
onLoad() {
onLoad(option) {
this.query = {
shopId: option.shopId || uni.getStorageSync('shopId') || '',
regionId: option.regionId || this.getRegionId(),
billTime: option.billTime || '',
status: Number(option.status || 0),
recordCount: Number(option.recordCount || 0),
totalSettlementAmount: option.totalSettlementAmount || 0,
totalBaseAmount: option.totalBaseAmount || 0,
totalCommissionAmount: option.totalCommissionAmount || 0
}
this.getDetailList()
},
methods: {
getRegionId() {
const area = uni.getStorageSync('area')
if (!area) return ''
if (typeof area === 'object') return area.id || ''
try {
return JSON.parse(area).id || ''
} catch (e) {
return ''
}
},
getDetailList() {
if (!this.query.shopId || !this.query.billTime) return
this.loading = true
this.tui.request('/mall/admin/settlement/detailList', 'POST', {
regionId: this.query.regionId,
shopId: this.query.shopId,
settlementDate: this.query.billTime,
status: this.query.status
}, false, false).then((res) => {
this.loading = false
if (res.code == 200) {
this.detailList = Array.isArray(res.result) ? res.result : []
} else {
this.tui.toast(res.message || '获取账单明细失败')
}
}).catch(() => {
this.loading = false
})
},
toAmount(value) {
const amount = parseFloat(value)
return isNaN(amount) ? 0 : amount
},
absAmount(value) {
return Math.abs(this.toAmount(value))
},
formatMoney(value) {
return this.toAmount(value).toFixed(2)
},
formatDateTime(value) {
if (!value) return '-'
const date = new Date(value)
if (isNaN(date.getTime())) return value
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}`
},
goOrderDetail(item) {
if (!item || !item.orderId) {
this.tui.toast('未找到订单信息')
return
}
uni.navigateTo({
url: '/package2/shop/orderDetail?id=' + item.orderId
})
},
back() {
uni.navigateBack()
}
@ -105,7 +177,7 @@
<style>
page {
width: 100%;
height: 100%;
min-height: 100%;
font-size: 24rpx;
background: #F5F8F5;
color: #00231C;
@ -113,15 +185,17 @@
.page1 {
width: 100%;
height: 100%;
min-height: 100%;
font-size: 24rpx;
position: relative;
padding-bottom: 40rpx;
}
.title {
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;
width: 100%;
height: 20%;
height: 300rpx;
background-size: 100% 100%;
}
.title-sreach {
@ -144,14 +218,127 @@
flex: 1;
text-align: center;
}
.content {
margin: -140rpx auto;
width: 92%;
margin: -90rpx auto 0;
position: relative;
z-index: 2;
}
.box1 {
width: 95%;
margin: 20rpx auto;
.summary-card,
.record-card {
background: #fff;
border-radius: 20rpx;
padding: 20rpx;
border-radius: 28rpx;
box-shadow: 0 14rpx 34rpx rgba(0, 35, 28, 0.08);
}
.summary-card {
padding: 28rpx;
margin-bottom: 22rpx;
background: linear-gradient(135deg, #00231C 0%, #14564a 100%);
color: #fff;
}
.summary-date {
font-size: 34rpx;
font-weight: 900;
}
.summary-row {
display: flex;
margin-top: 24rpx;
}
.summary-row > view {
flex: 1;
}
.summary-row text {
color: rgba(255,255,255,0.72);
font-size: 23rpx;
}
.summary-row view view {
margin-top: 8rpx;
color: #e3ff96;
font-size: 40rpx;
font-weight: 900;
}
.summary-mini {
margin-top: 20rpx;
color: rgba(255,255,255,0.76);
line-height: 40rpx;
}
.record-card {
padding: 24rpx;
margin-bottom: 20rpx;
}
.record-head,
.record-footer {
display: flex;
align-items: center;
justify-content: space-between;
}
.record-title {
font-size: 30rpx;
font-weight: 900;
}
.record-sub {
margin-top: 8rpx;
color: #7a8582;
font-size: 23rpx;
max-width: 420rpx;
word-break: break-all;
}
.record-amount {
color: #0b9b73;
font-size: 32rpx;
font-weight: 900;
}
.record-amount.negative {
color: #f0441f;
}
.record-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16rpx;
margin-top: 20rpx;
padding: 18rpx;
border-radius: 22rpx;
background: #f7faf8;
}
.record-grid text {
color: #7a8582;
font-size: 22rpx;
}
.record-grid view view {
margin-top: 6rpx;
font-weight: 800;
word-break: break-all;
}
.record-footer {
margin-top: 18rpx;
padding-top: 18rpx;
border-top: 1rpx solid #eef2ef;
color: #0b9b73;
font-weight: 900;
}
.empty-state {
padding: 80rpx 0;
text-align: center;
color: #9aa6a2;
}
</style>
Loading…
Cancel
Save