Commit 244db565 by 岑成威

fix: 手机号码取值

1 parent a53adc74
...@@ -392,11 +392,15 @@ export default { ...@@ -392,11 +392,15 @@ export default {
total_price += Number(item.finalPrice) || 0 total_price += Number(item.finalPrice) || 0
}) })
const raw = data
const customer = raw.customer || {}
data = { data = {
...data.customer, ...customer,
...data.payOrder, ...raw.payOrder,
...data, ...raw,
packageGoodsList: data.packageGoodsList, customerPhone: customer.customerPhone || raw.customerPhone,
customerName: customer.customerName || raw.customerName,
packageGoodsList: raw.packageGoodsList,
couponName, couponName,
total_price: Number(utils.decimal(total_price, 2)).toFixed(2) total_price: Number(utils.decimal(total_price, 2)).toFixed(2)
} }
......
...@@ -491,13 +491,18 @@ export default { ...@@ -491,13 +491,18 @@ export default {
}) })
} }
const raw = data
const customer = raw.customer || {}
data = { data = {
...data.customer, ...customer,
...data.payOrder, ...raw.payOrder,
...data, ...raw,
packageGoodsList: data.packageGoodsList, // 根级 customerPhone 常为 null,会覆盖 customer 内真实手机号
customerPhone: customer.customerPhone || raw.customerPhone,
customerName: customer.customerName || raw.customerName,
packageGoodsList: raw.packageGoodsList,
couponName, couponName,
total_price: data.selectPayType == 0 ? 0 : Number(utils.decimal(total_price, 2)).toFixed(2) total_price: raw.selectPayType == 0 ? 0 : Number(utils.decimal(total_price, 2)).toFixed(2)
} }
if (data.customerCoupon) { if (data.customerCoupon) {
data.customerCoupon.customerCouponCode = data.customerCoupon.customerCouponCode.split('-')[0] data.customerCoupon.customerCouponCode = data.customerCoupon.customerCouponCode.split('-')[0]
...@@ -584,11 +589,15 @@ export default { ...@@ -584,11 +589,15 @@ export default {
}, },
getWorkWechatLiveQRCode() { getWorkWechatLiveQRCode() {
this.customerService = '' this.customerService = ''
let { failCustomerService, defaultCustomerService } = this const { failCustomerService, defaultCustomerService, orderInfo } = this
let { orderCode, customerPhone: phoneNumber, selectPayType } = this.orderInfo const { orderCode, selectPayType } = orderInfo
// console.log(orderCode, phoneNumber, selectPayType) const phoneNumber = orderInfo.customerPhone || orderInfo.customer?.customerPhone
// 订单状态 1-升级订单 2-战败订单 // 订单状态 1-升级订单 2-战败订单
let orderType = selectPayType == 0 ? 2 : 1 const orderType = selectPayType == 0 ? 2 : 1
if (!phoneNumber) {
this.customerService = defaultCustomerService
return
}
uni.$api.boutiqueApi uni.$api.boutiqueApi
.getWorkWechatLiveQRCode({ .getWorkWechatLiveQRCode({
orderCode, orderCode,
...@@ -602,7 +611,9 @@ export default { ...@@ -602,7 +611,9 @@ export default {
this.customerService = defaultCustomerService this.customerService = defaultCustomerService
} }
}) })
// }, 3000) .catch(() => {
this.customerService = failCustomerService
})
}, },
/** 获取服务商是否使用膜卷号 */ /** 获取服务商是否使用膜卷号 */
getServiceFilmRollSetting(yqMerchantId) { getServiceFilmRollSetting(yqMerchantId) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!