Commit f938835f by cen

fix: 折扣

1 parent 8a7d1821
...@@ -161,7 +161,7 @@ const pathEnum = { ...@@ -161,7 +161,7 @@ const pathEnum = {
pad: '/rop-dj-pad/', pad: '/rop-dj-pad/',
clue: '/rop-scrm-clue/', clue: '/rop-scrm-clue/',
evaluation: '/gsc-vcp-pad-facade', evaluation: '/gsc-vcp-pad-facade',
staffMiniprogram: '/rop-dj-staff-miniprogram/', staffMiniprogram: '/rop-dj-staff-miniprogram/'
} }
const CONFIG_ENV_MAP = { const CONFIG_ENV_MAP = {
1: 'develop', 1: 'develop',
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
// 计算最终价格 // 计算最终价格
computedPrice() { computedPrice() {
const basePrice = parseFloat(this.basePrice || 0) const basePrice = parseFloat(this.basePrice || 0)
if (!basePrice) return '-' if (!basePrice) return '¥0.00'
// 打折策略 // 打折策略
if (this.strategyType === 'discount') { if (this.strategyType === 'discount') {
...@@ -291,9 +291,9 @@ export default { ...@@ -291,9 +291,9 @@ export default {
let v = this.localState[key] let v = this.localState[key]
if (key === 'discountAmount' || key === 'deductAmount') { if (key === 'discountAmount' || key === 'deductAmount') {
// 折扣金额/抵扣金额:限制 0.01 到商品原价(直接截断,不四舍五入) // 折扣金额/抵扣金额:限制 0 到商品原价(直接截断,不四舍五入)
if (!v || (typeof v === 'string' && v.trim() === '')) { if (!v || (typeof v === 'string' && v.trim() === '')) {
v = '0.01' v = '0'
} }
// 限制只能输入数字和小数点 // 限制只能输入数字和小数点
v = String(v).replace(/[^\d.]/g, '') v = String(v).replace(/[^\d.]/g, '')
...@@ -393,7 +393,7 @@ export default { ...@@ -393,7 +393,7 @@ export default {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: toRpx(24) toRpx(24) 0 toRpx(24); padding: toRpx(24) toRpx(24) 0 toRpx(24);
border-top: toRpx(3) dashed #E4E7EB; border-top: toRpx(3) dashed #e4e7eb;
box-sizing: border-box; box-sizing: border-box;
} }
......
...@@ -235,6 +235,7 @@ export default { ...@@ -235,6 +235,7 @@ export default {
}) })
const carBrandList = uni.$storage.get('carBrandList') const carBrandList = uni.$storage.get('carBrandList')
const carChildsBrandIds = carBrandList.map(i => i.id) const carChildsBrandIds = carBrandList.map(i => i.id)
const { sceneType } = uni.$storage.get('userInfo')
let params = { let params = {
merchantId: shopMerchantId, merchantId: shopMerchantId,
pageNum, pageNum,
...@@ -242,6 +243,7 @@ export default { ...@@ -242,6 +243,7 @@ export default {
carModel: carModel || '', carModel: carModel || '',
orderStatus: 3, orderStatus: 3,
merchantOrder, merchantOrder,
sceneType: sceneType,
historyOrderGoodsTypes: this.historyOrderGoodsTypes historyOrderGoodsTypes: this.historyOrderGoodsTypes
} }
if (!params.merchantOrder) { if (!params.merchantOrder) {
......
...@@ -197,13 +197,13 @@ export default { ...@@ -197,13 +197,13 @@ export default {
// 回显订单类型(orderType:1 正常订单,2 打折策略,3 买赠策略,4 冲量活动,5 组合付款) // 回显订单类型(orderType:1 正常订单,2 打折策略,3 买赠策略,4 冲量活动,5 组合付款)
const orderTypeMap = { const orderTypeMap = {
'1': '正常订单', 1: '正常订单',
'2': '打折策略', 2: '打折策略',
'3': '买赠策略', 3: '买赠策略',
'4': '冲量活动', 4: '冲量活动',
'5': '组合付款' 5: '组合付款'
} }
const orderTypeCode = data.orderType ? String(data.orderType) : (this.orderObj.orderTypeCode || '1') const orderTypeCode = data.orderType ? String(data.orderType) : this.orderObj.orderTypeCode || '1'
orderObj.orderTypeCode = orderTypeCode orderObj.orderTypeCode = orderTypeCode
orderObj.djOrderType = orderTypeMap[orderTypeCode] || '正常订单' orderObj.djOrderType = orderTypeMap[orderTypeCode] || '正常订单'
// 回显表单中“订单类型”这一行的展示文案 // 回显表单中“订单类型”这一行的展示文案
...@@ -951,7 +951,15 @@ export default { ...@@ -951,7 +951,15 @@ export default {
} }
} }
// '5' 组合付款:没有 discountType 和 discountValue // '5' 组合付款:有抵扣时 discountType=2、discountValue=抵扣金额,无抵扣时 discountType=3
if (orderType === '5') {
if (strategyConfig.mode === 'deduct' && strategyConfig.deductAmount) {
result.discountType = 2
result.discountValue = parseFloat(strategyConfig.deductAmount)
} else {
result.discountType = 3
}
}
return result return result
}, },
......
...@@ -25,26 +25,30 @@ ...@@ -25,26 +25,30 @@
</view> </view>
<view class="order-list align-center flex-1"> <view class="order-list align-center flex-1">
<text>原错误订单总价</text> <text>原错误订单总价</text>
<text class="priceName">¥{{orderCardDetail.oldOrderFinalPrice }}</text> <text class="priceName">¥{{ orderCardDetail.oldOrderFinalPrice }}</text>
</view> </view>
</view> </view>
<view class="order-card-bottom-box"> <view class="order-card-bottom-box">
<view class="info-box"> <view class="info-box">
<view class="order-list align-center"> <view class="order-list align-center">
<view class="order flex align-center"> <view class="order flex align-center">
<view class="order-label">订单类型 </view> <view class="order-label">订单类型</view>
<view class="order-value flex">{{ orderTypeText[orderCardDetail.orderType] }} <view class="order-value flex">
<view class="flex align-center errorTips" v-if="orderCardDetail.abnormalFlag == true"><view class="sprite-icon icon-errortips"></view>异常</view> {{ orderTypeText[orderCardDetail.orderType] }}
<view class="flex align-center errorTips" v-if="orderCardDetail.abnormalFlag == true">
<view class="sprite-icon icon-errortips"></view>
异常
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="order-list align-center"> <view class="order-list align-center">
<view class="order flex align-center"> <view class="order flex align-center">
<view class="order-label">审批状态 </view> <view class="order-label">审批状态</view>
<view class="order-value flex">{{ goodsOrderApplyStatus[orderCardDetail.approveStatus] }}</view> <view class="order-value flex">{{ goodsOrderApplyStatus[orderCardDetail.approveStatus] || '-' }}</view>
</view> </view>
</view> </view>
<view class="order-list align-center" v-for="(item, sindex) in orderCardDetail.deliveryId ? pointsMultiObj : orderObj" :key="sindex"> <view class="order-list align-center" v-for="(item, sindex) in orderCardDetail.deliveryId ? pointsMultiObj : orderObj" :key="sindex" v-if="(item.key !== 'remark' || orderCardDetail.orderStatus === '-1') && (item.key !== 'payTime' || orderCardDetail.orderStatus === '3' || orderCardDetail.orderStatus === '5')">
<view v-if="item.key == 'remark' || item.key == 'payTime' || item.key == 'createdTime'"> <view v-if="item.key == 'remark' || item.key == 'payTime' || item.key == 'createdTime'">
<view class="order flex align-center" v-if="item.key == 'remark' && orderCardDetail.orderStatus == '-1'"> <view class="order flex align-center" v-if="item.key == 'remark' && orderCardDetail.orderStatus == '-1'">
<view class="order-label">{{ item.label }}</view> <view class="order-label">{{ item.label }}</view>
...@@ -58,7 +62,6 @@ ...@@ -58,7 +62,6 @@
<view>{{ orderCardDetail[item.key] || '' }}</view> <view>{{ orderCardDetail[item.key] || '' }}</view>
</view> </view>
</view> </view>
<!-- &&( item.orderStatus == '3'||item.orderStatus =='5') -->
<view class="order flex align-center" v-if="item.key == 'createdTime'"> <view class="order flex align-center" v-if="item.key == 'createdTime'">
<view class="order-label">{{ item.label }}</view> <view class="order-label">{{ item.label }}</view>
<view class="order-value"> <view class="order-value">
...@@ -103,7 +106,7 @@ ...@@ -103,7 +106,7 @@
</view> </view>
<view class="refund-box" v-if="orderCardDetail.refundAmount"> <view class="refund-box" v-if="orderCardDetail.refundAmount">
部分退款 部分退款
<text class="unit">¥</text> <text class="refund-box-unit">¥</text>
{{ orderCardDetail.refundAmount }} {{ orderCardDetail.refundAmount }}
</view> </view>
<!-- 已录单未签名 --> <!-- 已录单未签名 -->
...@@ -1346,4 +1349,18 @@ export default { ...@@ -1346,4 +1349,18 @@ export default {
font-weight: 400; font-weight: 400;
margin-left: toRpx(16); margin-left: toRpx(16);
} }
.refund-box {
margin-left: toRpx(16);
background: #fff2e0;
padding: toRpx(4) toRpx(8);
color: #f7a431;
font-size: toRpx(24);
font-weight: 500;
font-family: 'numberBold';
border-radius: toRpx(4);
}
.refund-box .refund-box-unit {
font-size: toRpx(24);
}
</style> </style>
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
// 计算最终价格 // 计算最终价格
computedPrice() { computedPrice() {
const basePrice = parseFloat(this.basePrice || 0) const basePrice = parseFloat(this.basePrice || 0)
if (!basePrice) return '-' if (!basePrice) return '¥0.00'
// 打折策略 // 打折策略
if (this.strategyType === 'discount') { if (this.strategyType === 'discount') {
...@@ -291,9 +291,9 @@ export default { ...@@ -291,9 +291,9 @@ export default {
let v = this.localState[key] let v = this.localState[key]
if (key === 'discountAmount' || key === 'deductAmount') { if (key === 'discountAmount' || key === 'deductAmount') {
// 折扣金额/抵扣金额:限制 0.01 到商品原价(直接截断,不四舍五入) // 折扣金额/抵扣金额:限制 0 到商品原价(直接截断,不四舍五入)
if (!v || (typeof v === 'string' && v.trim() === '')) { if (!v || (typeof v === 'string' && v.trim() === '')) {
v = '0.01' v = '0'
} }
// 限制只能输入数字和小数点 // 限制只能输入数字和小数点
v = String(v).replace(/[^\d.]/g, '') v = String(v).replace(/[^\d.]/g, '')
...@@ -313,9 +313,9 @@ export default { ...@@ -313,9 +313,9 @@ export default {
const basePrice = parseFloat(this.basePrice || 0) const basePrice = parseFloat(this.basePrice || 0)
let amount = parseFloat(v) let amount = parseFloat(v)
// 限制最小值为 0.01 // 限制最小值为 0
if (isNaN(amount) || amount < 0.01) { if (isNaN(amount) || amount < 0) {
v = '0.01' v = '0'
} }
// 限制最大值为基础价格 // 限制最大值为基础价格
else if (basePrice > 0 && amount > basePrice) { else if (basePrice > 0 && amount > basePrice) {
...@@ -393,7 +393,7 @@ export default { ...@@ -393,7 +393,7 @@ export default {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: toRpx(24) toRpx(24) 0 toRpx(24); padding: toRpx(24) toRpx(24) 0 toRpx(24);
border-top: toRpx(3) dashed #E4E7EB; border-top: toRpx(3) dashed #e4e7eb;
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -490,7 +490,7 @@ export default { ...@@ -490,7 +490,7 @@ export default {
} }
.amount-input-inner { .amount-input-inner {
width: toRpx(140); width: toRpx(250);
padding-left: toRpx(8); padding-left: toRpx(8);
text-align: right; text-align: right;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!