Commit 8887103c by Lin

优化 buildSubmitData 方法,简化 merchantId 的赋值逻辑,并在 bySystemMerchant 为 true 时动态添加 potentialCustomerId 字段。

1 parent 61fa62a7
......@@ -646,8 +646,10 @@ Page({
// 构建提交数据
buildSubmitData() {
const { formList, bySystemMerchant } = this.data
const merchantId = formList[FORM_FIELDS.MERCHANT].value || null
return {
merchantId: formList[FORM_FIELDS.MERCHANT].value || null,
merchantId,
...(bySystemMerchant ? { potentialCustomerId: merchantId } : {}),
merchantName: formList[FORM_FIELDS.MERCHANT].displayValue,
// salesVolume: bySystemMerchant ? formList[FORM_FIELDS.SALES].value : null,
// brand: bySystemMerchant ? formList[FORM_FIELDS.BRANDS].displayValue : null,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!