|
@@ -453,9 +453,13 @@ export default {
|
|
} else {
|
|
} else {
|
|
// 修改某些字段时候才会更新schema
|
|
// 修改某些字段时候才会更新schema
|
|
const { needChange, changedFieldsArr } = this.needChangeSchema(value)
|
|
const { needChange, changedFieldsArr } = this.needChangeSchema(value)
|
|
- this.onChangedFields(changedFieldsArr)
|
|
|
|
- if (!needChange) return
|
|
|
|
- this.dynamicChangeSchema(value)
|
|
|
|
|
|
+ this.onChangedFieldsBeforeRefresh(changedFieldsArr)
|
|
|
|
+ if (needChange) {
|
|
|
|
+ this.dynamicChangeSchema(value)
|
|
|
|
+ sleep(10).then(() => {
|
|
|
|
+ this.onChangedFieldsAfterSchemaRefresh(changedFieldsArr)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}, 100),
|
|
}, 100),
|
|
async getPrice(p) {
|
|
async getPrice(p) {
|
|
@@ -1387,7 +1391,7 @@ export default {
|
|
},
|
|
},
|
|
// 当form.value数据变更, 对form.value自己其他属性有影响的方法写在此处
|
|
// 当form.value数据变更, 对form.value自己其他属性有影响的方法写在此处
|
|
// 比如, 一些数据变更需要清空某些数据
|
|
// 比如, 一些数据变更需要清空某些数据
|
|
- onChangedFields(changedArr) {
|
|
|
|
|
|
+ onChangedFieldsBeforeRefresh(changedArr) {
|
|
if (this.readonly) return
|
|
if (this.readonly) return
|
|
|
|
|
|
if (this.checkNeedRefreshPrice(changedArr)) {
|
|
if (this.checkNeedRefreshPrice(changedArr)) {
|
|
@@ -1442,18 +1446,45 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
if (changedArr.includes(schemaKeyMap.payment)) {
|
|
if (changedArr.includes(schemaKeyMap.payment)) {
|
|
|
|
+ const objPayment = {}
|
|
|
|
+ // 大会员购买续费服务列表重置
|
|
if (this.utilsCheckBuyAndTrail() && this.value[schemaKeyMap.serviceList]) {
|
|
if (this.utilsCheckBuyAndTrail() && this.value[schemaKeyMap.serviceList]) {
|
|
const ma = this.getSchemaItemWithKey(schemaKeyMap.serviceList)
|
|
const ma = this.getSchemaItemWithKey(schemaKeyMap.serviceList)
|
|
if (ma) {
|
|
if (ma) {
|
|
- this.refreshValue({
|
|
|
|
- serviceList: ma.defaultValue
|
|
|
|
- })
|
|
|
|
|
|
+ objPayment.serviceList = ma.defaultValue
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.refreshValue(objPayment)
|
|
}
|
|
}
|
|
|
|
|
|
console.log(`以下字段变更了:${this.productType}`, changedArr)
|
|
console.log(`以下字段变更了:${this.productType}`, changedArr)
|
|
},
|
|
},
|
|
|
|
+ onChangedFieldsAfterSchemaRefresh(changedArr) {
|
|
|
|
+ if (this.readonly) return
|
|
|
|
+
|
|
|
|
+ if (this.activityCard) return
|
|
|
|
+
|
|
|
|
+ const { isUpgrade } = this.utilsGetPaymentType()
|
|
|
|
+
|
|
|
|
+ if (changedArr.includes(schemaKeyMap.payment)) {
|
|
|
|
+ const objPayment = {}
|
|
|
|
+ // 升级内容
|
|
|
|
+ if (isUpgrade) {
|
|
|
|
+ const uc = this.getSchemaItemWithKey(schemaKeyMap.upgradeContent)
|
|
|
|
+ if (uc) {
|
|
|
|
+ // 如果可选项大于1个,则默认值为空
|
|
|
|
+ // 如果可选项小于等于1个,则默认值为第一个可选
|
|
|
|
+ const enableValue = uc.props.options.filter(c => !c.disabled)
|
|
|
|
+ if (enableValue.length <= 1) {
|
|
|
|
+ objPayment[schemaKeyMap.upgradeContent] = [enableValue[0].value]
|
|
|
|
+ } else {
|
|
|
|
+ objPayment[schemaKeyMap.upgradeContent] = []
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.refreshValue(objPayment)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
checkNeedRefreshPrice(changedArr) {
|
|
checkNeedRefreshPrice(changedArr) {
|
|
const commonPassField = [
|
|
const commonPassField = [
|
|
'saleGifts',
|
|
'saleGifts',
|