fix(小程序): 商城面板与商品溯源模块顺序对齐配送系统
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s

This commit is contained in:
Ubuntu
2026-10-28 21:38:19 +08:00
parent 41d66aca6f
commit 4e0cf2e217
4 changed files with 63 additions and 18 deletions
+23 -6
View File
@@ -267,11 +267,8 @@ Component({
}
},
/** 逐行加工方式(只改方式;仓内/供应商加工由管理员配置) */
onItemMethodChange(e) {
const index = Number(e.currentTarget.dataset.index);
const pickIndex = Number(e.detail && e.detail.value) || 0;
const method = this.data.processingMethods[pickIndex] || '原材料';
/** 写入加工方式:列表点选或手输自定义均可。 */
writeItemMethod(index, method) {
const checkoutItem = this.data.checkoutItems[index];
if (!checkoutItem) return;
const cart = { ...(this.data.cart || {}) };
@@ -284,10 +281,30 @@ Component({
this.setData({
cart,
[`checkoutItems[${index}].processing_method`]: method,
[`checkoutItems[${index}].methodIndex`]: pickIndex,
[`checkoutItems[${index}].methodIndex`]: Math.max(
0,
this.data.processingMethods.indexOf(method)
),
});
},
onItemMethodInput(e) {
const index = Number(e.currentTarget.dataset.index);
this.writeItemMethod(index, String((e.detail && e.detail.value) || '').slice(0, 50));
},
onItemMethodBlur(e) {
const index = Number(e.currentTarget.dataset.index);
const method = String((e.detail && e.detail.value) || '').trim().slice(0, 50) || '原材料';
this.writeItemMethod(index, method);
},
onItemMethodChange(e) {
const index = Number(e.currentTarget.dataset.index);
const pickIndex = Number(e.detail && e.detail.value) || 0;
this.writeItemMethod(index, this.data.processingMethods[pickIndex] || '原材料');
},
/** 逐行备注 */
onItemRemarkInput(e) {
const index = Number(e.currentTarget.dataset.index);
+12 -3
View File
@@ -81,19 +81,28 @@
<view class="mall-sheet-items">
<view wx:for="{{checkoutItems}}" wx:key="sku_code" class="mall-sheet-item">
<text class="mall-sheet-item-name">{{item.name}}</text>
<text class="mall-sheet-item-qty">×{{item.quantity}}</text>
<text class="mall-sheet-item-qty">×{{item.quantity}}{{item.unit}}</text>
<text class="mall-sheet-item-amount">¥{{item.amount}}</text>
<view class="mall-item-method">
<input
class="mall-item-field mall-item-method-input"
value="{{item.processing_method}}"
data-index="{{index}}"
maxlength="50"
bindinput="onItemMethodInput"
bindblur="onItemMethodBlur"
/>
<picker
class="mall-item-method-pick"
mode="selector"
range="{{processingMethods}}"
value="{{item.methodIndex}}"
data-index="{{index}}"
bindchange="onItemMethodChange"
>
<view class="mall-item-field">{{item.processing_method}}</view>
<view class="mall-item-method-arrow">▾</view>
</picker>
</view>
<text class="mall-sheet-item-amount">¥{{item.amount}}</text>
<input
class="mall-item-field mall-item-remark"
value="{{item.remark}}"
+26 -9
View File
@@ -355,7 +355,8 @@
}
.mall-sheet-item-name {
flex: 1 1 120rpx;
flex: 0 1 auto;
max-width: 200rpx;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
@@ -379,15 +380,30 @@
}
.mall-item-method {
position: relative;
flex: none;
width: 140rpx;
width: 148rpx;
}
.mall-item-method .mall-item-field {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 46rpx;
.mall-item-method-input {
width: 100%;
padding-right: 28rpx;
}
.mall-item-method-pick {
position: absolute;
top: 0;
right: 0;
bottom: 0;
}
.mall-item-method-arrow {
width: 28rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
font-size: 18rpx;
color: #94a3b8;
}
.mall-sheet-item-amount {
@@ -399,8 +415,9 @@
}
.mall-item-remark {
flex: none;
width: 132rpx;
flex: 1 1 200rpx;
min-width: 160rpx;
width: auto;
}
.mall-field {
+2
View File
@@ -257,6 +257,8 @@ const MODULE_SORT_ORDER = [
'bid',
'quality-reports',
'product-trace',
'mall',
'customer-trace',
];
function isModuleVisible(mod, pageData) {