Commit 7f8426e2 by cen

fix: 更新订单相关组件以支持新价格逻辑和状态显示

- 修改 env.js 中的 index 值以确保正确的默认环境
- 更新 OrderCard 和 ConfirmOrder 组件,使用 finalPrice 替代 totalPrice 显示价格
- 在 OrderDetail 和 OrderManagement 组件中增强审批状态的显示逻辑
- 添加审批中状态的配置到 order_mixins.js
- 更新 CreateOrder 组件以支持订单类型的回显和策略配置
- 优化 SkuGoods 组件的价格输入逻辑
1 parent bb53d099

2.99 MB | W: | H:

3 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1 const index = 0
/** /**
* *
0本地 0本地
...@@ -49,8 +49,8 @@ const domain = { ...@@ -49,8 +49,8 @@ const domain = {
}[target[index]] }[target[index]]
const djDomain = { const djDomain = {
ip: 'http://dj.dev.glsx.com.cn', // ip: 'http://dj.dev.glsx.com.cn',
// ip: 'http://192.168.1.125:8080', ip: 'http://192.168.1.76:8292',
dev: 'http://dj.dev.glsx.com.cn', dev: 'http://dj.dev.glsx.com.cn',
beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425 beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425
uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</view> </view>
<view class="goods-price"> <view class="goods-price">
¥ ¥
<text>{{ i.totalPrice || 0 }}</text> <text>{{ i.finalPrice || 0 }}</text>
</view> </view>
</view> </view>
...@@ -48,11 +48,10 @@ ...@@ -48,11 +48,10 @@
</view> </view>
</view> </view>
<view class="order-price flex align-center"> <view class="payType flex align-center">
<view class="order-price-label">审批状态</view> <view class="payType-label">审批状态</view>
<view class="price"> <view class="payType-value flex align-center">
<text class="unit">¥</text> {{ goodsOrderApplyStatus[orderCardDetail.goodsOrderApplyStatus] }}
{{ orderCardDetail.totalPrice }}
</view> </view>
</view> </view>
</view> </view>
...@@ -95,7 +94,7 @@ ...@@ -95,7 +94,7 @@
<view class="order-price-label">实付金额</view> <view class="order-price-label">实付金额</view>
<view class="price"> <view class="price">
<text class="unit">¥</text> <text class="unit">¥</text>
{{ orderCardDetail.totalPrice }} {{ orderCardDetail.finalPrice }}
</view> </view>
</view> </view>
</view> </view>
...@@ -168,6 +167,9 @@ export default { ...@@ -168,6 +167,9 @@ export default {
}, },
status() { status() {
return order_mixins.data.status || {} return order_mixins.data.status || {}
},
goodsOrderApplyStatus() {
return order_mixins.data.goodsOrderApplyStatus || {}
} }
}, },
data() { data() {
...@@ -473,7 +475,7 @@ export default { ...@@ -473,7 +475,7 @@ export default {
&:nth-child(2n) { &:nth-child(2n) {
padding-right: 0; padding-right: 0;
padding-left: toRpx(20); // padding-left: toRpx(20);
} }
} }
} }
......
...@@ -102,6 +102,11 @@ module.exports = { ...@@ -102,6 +102,11 @@ module.exports = {
} }
], ],
status: { status: {
14: {
text: '审批中',
color: '#FF9D0A',
background: '#FFF5E6'
},
12: { 12: {
text: '已退款', text: '已退款',
color: '#F7A431', color: '#F7A431',
...@@ -184,6 +189,12 @@ module.exports = { ...@@ -184,6 +189,12 @@ module.exports = {
], ],
grassInfo: {}, grassInfo: {},
orderCode: '', orderCode: '',
userInfo: {} userInfo: {},
goodsOrderApplyStatus: {
1: '审批中', //区域运营待审核
2: '审批中', //线上运营待审核
3: '审核通过',
4: '驳回'
}
} }
} }
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList"> <view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList">
<view class="meal-hd flex justify-between align-center"> <view class="meal-hd flex justify-between align-center">
<view>{{ item.packageAlias || item.packageName }}</view> <view>{{ item.packageAlias || item.packageName }}</view>
<view class="price">¥{{ item.totalPrice }}</view> <view class="price">¥{{ item.finalPrice }}</view>
</view> </view>
<view class="meal-bd"> <view class="meal-bd">
<view class="meal-bd-box" v-for="g in item.packageGoodsOrderList"> <view class="meal-bd-box" v-for="g in item.packageGoodsOrderList">
...@@ -286,8 +286,8 @@ export default { ...@@ -286,8 +286,8 @@ export default {
let warrantyCardList = [] let warrantyCardList = []
for (var i = 0; i < data?.subOrderList?.length; i++) { for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i] let e = data?.subOrderList[i]
total_price += e.totalPrice total_price += e.finalPrice
e.price = Number(utils.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2) e.price = Number(utils.decimal(Number(e.finalPrice / e.number), 2)).toFixed(2)
e.positionStr = this.positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || '' e.positionStr = this.positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) { if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) {
warrantyCardList.push({ warrantyCardList.push({
...@@ -298,19 +298,19 @@ export default { ...@@ -298,19 +298,19 @@ export default {
} }
data.packageGoodsList?.forEach(item => { data.packageGoodsList?.forEach(item => {
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice g.price = g.finalPrice ? Number(g.finalPrice) / Number(g.number) : g.upgradePrice
}) })
item.goodsList = item.packageGoodsOrderList item.goodsList = item.packageGoodsOrderList
item.price = item.goodsList.reduce((prev, cur) => { item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number) return prev + Number(cur.finalPrice) / Number(cur.number)
}, 0) }, 0)
item.count = item.goodsList.length ? item.goodsList[0].number : 1 item.count = item.goodsList.length ? item.goodsList[0].number : 1
let total = item.price * item.count let total = item.price * item.count
item.totalPrice = utils.decimal(total, 2) item.finalPrice = utils.decimal(total, 2)
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.positionStr = this.positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || '' g.positionStr = this.positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || ''
}) })
total_price += item.totalPrice total_price += item.finalPrice
}) })
data = { data = {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList"> <view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList">
<view class="meal-hd flex justify-between align-center"> <view class="meal-hd flex justify-between align-center">
<view>{{ item.packageAlias || item.packageName }}</view> <view>{{ item.packageAlias || item.packageName }}</view>
<view class="price">¥{{ item.totalPrice }}</view> <view class="price">¥{{ item.finalPrice }}</view>
</view> </view>
<view class="meal-bd"> <view class="meal-bd">
<view class="meal-bd-box" v-for="g in item.packageGoodsOrderList"> <view class="meal-bd-box" v-for="g in item.packageGoodsOrderList">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</view> </view>
</view> </view>
<view class="price">¥{{ g.price }}</view> <view class="price">¥{{ g.finalPrice }}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<view class="good" v-for="(item, index) in orderInfo.subOrderList" :key="index"> <view class="good" v-for="(item, index) in orderInfo.subOrderList" :key="index">
<view class="flex justify-between align-center mb-20"> <view class="flex justify-between align-center mb-20">
<text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text> <text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text>
<text class="good-price">¥{{ item.price }}</text> <text class="good-price">¥{{ item.finalPrice }}</text>
</view> </view>
<view class="flex justify-between align-center mb-12" v-if="item.upgradeGoodsAlias"> <view class="flex justify-between align-center mb-12" v-if="item.upgradeGoodsAlias">
<text class="good-alias">商品别名:{{ replaceItemText(item.upgradeGoodsAlias) || '' }}</text> <text class="good-alias">商品别名:{{ replaceItemText(item.upgradeGoodsAlias) || '' }}</text>
...@@ -367,8 +367,8 @@ export default { ...@@ -367,8 +367,8 @@ export default {
let total_price = 0 let total_price = 0
for (var i = 0; i < data?.subOrderList?.length; i++) { for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i] let e = data?.subOrderList[i]
total_price += e.totalPrice total_price += e.finalPrice
e.price = Number(utils.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2) e.price = Number(utils.decimal(Number(e.finalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || '' e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) { if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) {
const warrantyItem = { const warrantyItem = {
...@@ -404,19 +404,19 @@ export default { ...@@ -404,19 +404,19 @@ export default {
if (data.packageGoodsList) { if (data.packageGoodsList) {
data.packageGoodsList.forEach(item => { data.packageGoodsList.forEach(item => {
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice g.price = g.finalPrice ? Number(g.finalPrice) / Number(g.number) : g.upgradePrice
}) })
item.goodsList = item.packageGoodsOrderList item.goodsList = item.packageGoodsOrderList
item.price = item.goodsList.reduce((prev, cur) => { item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number) return prev + Number(cur.finalPrice) / Number(cur.number)
}, 0) }, 0)
item.count = item.goodsList.length ? item.goodsList[0].number : 1 item.count = item.goodsList.length ? item.goodsList[0].number : 1
let total = item.price * item.count let total = item.price * item.count
item.totalPrice = utils.decimal(total, 2) item.finalPrice = utils.decimal(total, 2)
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.positionStr = positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || '' g.positionStr = positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || ''
}) })
total_price += item.totalPrice total_price += item.finalPrice
}) })
} }
......
...@@ -433,11 +433,17 @@ export default { ...@@ -433,11 +433,17 @@ export default {
// e.subOrderList = e.subOrderList.filter(item => item.id) // e.subOrderList = e.subOrderList.filter(item => item.id)
// 处理显示订单右上角文字 // 处理显示订单右上角文字
let text = this.status[e.status].text // 安全检查:如果状态不存在,使用默认值
let color = this.status[e.status].color const statusConfig = this.status[e.status] || {
let background = this.status[e.status].background text: '未知状态',
color: '#8F959E',
background: '#F3F4F5'
}
let text = statusConfig.text
let color = statusConfig.color
let background = statusConfig.background
// 不是订单失效状态优先显示已施工 // 不是订单失效状态优先显示已施工
if (![9, 11, 12].includes(e.status) && e.constructionFlag == 'Y') { if (![9, 11, 12, 14].includes(e.status) && e.constructionFlag == 'Y') {
text = '已施工' text = '已施工'
color = '#347BFF' color = '#347BFF'
background = '#F3F7FC' background = '#F3F7FC'
......
...@@ -73,8 +73,6 @@ export default { ...@@ -73,8 +73,6 @@ export default {
updated() { updated() {
// 当组件数据更新时也检查number属性 // 当组件数据更新时也检查number属性
this.initProductNumbers() this.initProductNumbers()
// 根据订单类型初始化策略配置
this.initStrategyConfig()
}, },
watch: { watch: {
orderTypeCode: { orderTypeCode: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!