纸板小程序:订单/送货单:列表与详情功能

This commit is contained in:
2026-06-11 11:26:40 +08:00
commit ef9ede1605
2317 changed files with 61642 additions and 0 deletions
@@ -0,0 +1,5 @@
{
"usingComponents": {
"navigation-bar": "/components/navigation-bar/navigation-bar"
}
}
@@ -0,0 +1,129 @@
.flex {
display: flex;
}
.label {
min-width: 170rpx;
max-width: 170rpx;
font-size: 28rpx;
color: #8c8c8c;
}
.value {
font-size: 28rpx;
}
.page-container {
width: 100vw;
height: 100vh;
box-sizing: border-box;
background: #f4f6f9;
// background: linear-gradient( 135deg, #ca7d79 0%, #c5140a 30%, #c5140a 50%, #ca7d79 100%);
.info {
background-color: #ffffff;
padding: 30rpx ;
border-radius: 0 0 20rpx 20rpx;
box-shadow: 0 2px 6px rgba(0,0,0,0.04);
.info_code_status {
display: flex;
justify-content: space-between;
align-items: center;
.code {
font-weight: bold;
}
.status {
font-size: 22rpx;
padding: 10rpx 25rpx;
border-radius: 200px;
}
}
.info_count {
display: flex;
justify-content: space-between;
margin-top: 30rpx;
.count_item {
text-align: center;
.count_item_label {
font-size: 24rpx;
color: #8c8c8c;
}
.count_item_value {
margin-top: 10rpx;
font-size: 34rpx;
color: #000000;
font-weight: bold;
}
}
}
}
.title {
font-weight: bold;
font-size: 26rpx;
width: 95%;
margin: 0 auto;
padding: 25rpx 0 10rpx 0;
}
.details {
width: 95%;
margin: 0 auto;
.detail_item {
background-color: #ffffff;
border-radius: 20rpx;
padding: 25rpx;
margin-top: 15rpx;
box-shadow: 0 2px 6px rgba(0,0,0,0.04);
.item_top {
font-size: 28rpx;
display: flex;
justify-content: space-between;
.paper {
font-size: 26rpx;
padding: 2rpx 16rpx;
background-color: #f0f0f0;
color: #5f6368;
border-radius: 200px;
}
.number {
color: #c5140a;
font-weight: bold;
}
}
.item_mid {
display: flex;
flex-wrap: wrap;
justify-content: flex-start; /* 左对齐 */
.mid_item {
min-width: 23%; max-width: 23%;
display: flex;
font-size: 24rpx;
margin-bottom: 18rpx;
.mid_item_label {
color: #5f6368;
}
}
.long, .wide {
min-width: 23%; max-width: 23%;
}
.squareprice {
min-width: 31%; max-width: 31%;
}
.price {
.mid_item_value {
font-weight: bold;
}
}
.totalPrice {
min-width: 50%; max-width: 50%;
.mid_item_value {
color: #c5140a;
}
}
}
.remark{
background: #f9fafb;
padding: 6px 10px;
border-radius: 4px;
font-size: 12px;
color: #5f6368;
}
}
}
}
@@ -0,0 +1,101 @@
import { getAppInstance } from '../../utils/app';
import { getCardBoardOrderDeliveryDetail } from '../../api/index'
const app = getAppInstance();
Page({
/**
* 页面的初始数据
*/
data: {
info: {},
isCust: true
},
/**
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
const id = options.id;
const res = await getCardBoardOrderDeliveryDetail(id).catch(() => {});
if (res) {
const info = this.formatDetail(res.data.dto);
const userInfo = wx.getStorageSync('userInfo');
this.setData({
isCust: userInfo.custid?true:false,
info: info,
statusColorMap: app.globalData.statusColorMap
})
console.log(res);
}
},
// 格式化详情数据
formatDetail(data) {
let info = data;
// 获取客户名称
if (info.custcode) {
const obj = app.globalData.customerList.find( item => item.code == info.custcode);
info.customName = obj?obj.name:'未查询到客户';
}
// 计算总平方数
if (info.listDetail) {
info.totalSquaNum = info.listDetail.reduce((total,obj) => total + ((obj.wide * obj.long / 10000) * obj.num),0)?.toFixed(2);
console.log(info);
}
// 格式化时间
if (info.delitime) {
info.delitime = info.delitime.split('T').join(' ');
}
return info;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
@@ -0,0 +1,77 @@
<navigation-bar title="纸板送货单详情" back="{{true}}" color="white" background="#c5140a"></navigation-bar>
<view class="page-container">
<view class="info">
<view class="info_code_status">
<view class="code">{{'单号:' + info.code}}</view>
</view>
<view class="info_count">
<view class="count_item">
<view class="count_item_label">总金额</view>
<view class="count_item_value" style="color: #c5140a;">¥{{info.totalmoney}}</view>
</view>
<view class="count_item">
<view class="count_item_label">总数量</view>
<view class="count_item_value">{{info.totalnum}}</view>
</view>
<view class="count_item">
<view class="count_item_label">总平方数</view>
<view class="count_item_value">{{info.totalSquaNum}}</view>
</view>
</view>
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
<view class=" flex" style="margin-top: 30rpx;justify-content: space-between;">
<view class=" label">客户</view>
<view class="value">{{info.customName}}</view>
</view>
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
<view class=" flex" style="justify-content: space-between;">
<view class=" label">送货时间</view>
<view class="value">{{info.delitime}}</view>
</view>
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
<view class=" flex" style="justify-content: space-between;">
<view class=" label">备注</view>
<view class="value">{{info.remark}}</view>
</view>
</view>
<view class="title">商品明细<text style="font-size: 24rpx; color:#8c8c8c;font-weight: normal;">({{info.listDetail.length}}项)</text></view>
<scroll-view class="data_list" style="height: calc(100vh - 750rpx);" scroll-y>
<view class="details">
<view class="detail_item" wx:for="{{info.listDetail}}" wx:key="id">
<view class="item_top">
<view class="code">{{item.ordercode}}</view>
<view class="paper">{{item.paper}}</view>
<view class="number">送货:{{item.num}}</view>
</view>
<t-divider/>
<view class="item_mid">
<view class="mid_item">
<view class="mid_item_label wide">宽:</view>
<view class="mid_item_value">{{item.wide}}</view>
</view>
<view class="mid_item long">
<view class="mid_item_label">长:</view>
<view class="mid_item_value">{{item.long}}</view>
</view>
<view class="mid_item squareprice price">
<view class="mid_item_label">平方单价:</view>
<view class="mid_item_value">{{item.squareprice}}</view>
</view>
<view class="mid_item price">
<view class="mid_item_label">特价:</view>
<view class="mid_item_value">{{item.specialprice}}</view>
</view>
<view class="mid_item price">
<view class="mid_item_label">最终价:</view>
<view class="mid_item_value">{{item.squareprice + item.specialprice}}</view>
</view>
<view class="mid_item price totalPrice">
<view class="mid_item_label">金额:</view>
<view class="mid_item_value">{{item.money}}</view>
</view>
</view>
<view class="remark">备注:{{item.remark}}</view>
</view>
</view>
</scroll-view>
</view>