Commit 5ce60b15 by 张立顺

Merge branch 'dev_v4.16.0' of http://192.168.3.233:8090/saas_plus/dj-car-boutiqu…

…e-work-wechat into dev_v4.16.0
2 parents fe3eb404 f2e242e9
......@@ -27,12 +27,15 @@ Component({
// 校验历史订单二级流量方是否在配置的二级流量方数据中包含 不包含清空二级流量方重新选择
let hasSubShopMerchantId = subShopMerchantList.some(item=> item.subMerchantId == orderObj.subShopMerchantId)
if (!hasSubShopMerchantId && subShopMerchantList.length) {
delete orderObj.subShopMerchantId
delete orderObj.subShopMerchantName
delete orderObj?.subShopMerchantId
delete orderObj?.subShopMerchantName
}
thisPage.setData({
orderObj
})
this.setData({
orderObj: {}
})
}
}
},
......@@ -76,7 +79,7 @@ Component({
if (code == '0') {
// 有二级流量方数据 添加必填二级流量方字段
if (data?.length) {
if (requiredList.indexOf('subShopMerchantId') < 0) requiredList.push('subShopMerchantId')
if (!requiredList.includes('subShopMerchantId')) requiredList.unshift('subShopMerchantId')
data.map(i => {
i.active = false
if (i.subMerchantId == orderObj.subShopMerchantId) {
......@@ -87,8 +90,8 @@ Component({
// 校验历史订单二级流量方是否在配置的二级流量方数据中包含 不包含清空二级流量方重新选择
let hasSubShopMerchantId = data.some(item=> item.subMerchantId == orderObj.subShopMerchantId)
if (!hasSubShopMerchantId) {
delete orderObj.subShopMerchantId
delete orderObj.subShopMerchantName
delete orderObj?.subShopMerchantId
delete orderObj?.subShopMerchantName
}
thisPage.setData({
requiredList,
......@@ -97,12 +100,13 @@ Component({
})
this.setData({
subShopMerchantList: data,
orderObj: {}
})
} else {
// 无二级流量方字段时 清空选择的二级流量方字段
delete orderObj.subShopMerchantId
delete orderObj.subShopMerchantName
requiredList.indexOf('subShopMerchantId') > -1 && requiredList.splice(requiredList.indexOf('subShopMerchantId'), 1)
delete orderObj?.subShopMerchantId
delete orderObj?.subShopMerchantName
if (requiredList.includes('subShopMerchantId')) requiredList.splice(requiredList.indexOf('subShopMerchantId'), 1)
thisPage.setData({
isShowSubShopMerchant: false,
requiredList,
......@@ -121,19 +125,19 @@ Component({
subShopMerchantId: item.subMerchantId,
subShopMerchantName: item.subMerchantName
}
orderObj = Object.assign(orderObj, selectedSubShopMerchantObj)
orderObj = (orderObj || selectedSubShopMerchantObj) ? Object.assign(orderObj, selectedSubShopMerchantObj) : selectedSubShopMerchantObj
subShopMerchantList.map(i => (i.active = false))
subShopMerchantList[index].active = true
this.setData({
subShopMerchantList,
...orderObj
orderObj
})
},
async confirm() {
let data = this.data.orderObj
let thisPage = wx.$router.getPageInstance()
let { orderObj } = thisPage.data
orderObj = Object.assign(orderObj, data)
orderObj = (orderObj || data) ? Object.assign(orderObj, data) : orderObj
thisPage.setData({
orderObj
})
......
......@@ -328,7 +328,7 @@
show="{{subShopMerchantBox}}"
title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedCustomerInfo="{{orderObj.customer.customerName}}"
selectedCustomerInfo="{{orderObj.customer.customerId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}"/>
<car-brands
show="{{carBrandBox}}"
......
......@@ -370,7 +370,7 @@
show="{{subShopMerchantBox}}"
title="选择二级流量方"
selectedSelesMerchantId="{{orderObj.merchantId}}"
selectedCustomerInfo="{{orderObj.customer.customerName}}"
selectedCustomerInfo="{{orderObj.customer.customerId}}"
selectedSubShopMerchantId="{{orderObj.subShopMerchantId}}"/>
<car-brands
show="{{carBrandBox}}"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!