diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 6f3ded5c..80bb3e9d 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -278,12 +278,16 @@ export const PromotionDiscountTypeEnum = { */ export const BrokerageBindModeEnum = { ANYTIME: { - mode: 0, - name: '没有推广人' + mode: 1, + name: '首次绑定' }, REGISTER: { - mode: 1, - name: '新用户' + mode: 2, + name: '注册绑定' + }, + OVERRIDE: { + mode: 3, + name: '覆盖绑定' } } /** @@ -291,11 +295,11 @@ export const BrokerageBindModeEnum = { */ export const BrokerageEnabledConditionEnum = { ALL: { - condition: 0, + condition: 1, name: '人人分销' }, ADMIN: { - condition: 1, + condition: 2, name: '指定分销' } } diff --git a/src/views/mall/trade/config/index.vue b/src/views/mall/trade/config/index.vue index c43940a8..4c4ff467 100644 --- a/src/views/mall/trade/config/index.vue +++ b/src/views/mall/trade/config/index.vue @@ -10,7 +10,7 @@ - + @@ -22,10 +22,15 @@ v-model="formData.deliveryExpressFreePrice" placeholder="请输入满额包邮" class="!w-xs" + :precision="2" + :min="0" /> - 商城商品满多少金额即可包邮 + + 商城商品满多少金额即可包邮,单位:元 + + @@ -59,16 +64,16 @@ - 没有推广人:只要用户没有推广人,随时都可以绑定推广关系 + 首次绑定:只要用户没有推广人,随时都可以绑定推广关系 - 新用户:只有新用户注册时或首次进入系统时才可以绑定推广关系 + 注册绑定:只有新用户注册时或首次进入系统时才可以绑定推广关系 - 个人中心分销海报图片,建议尺寸600x1000 + 个人中心分销海报图片,建议尺寸 600x1000 @@ -76,6 +81,8 @@ v-model="formData.brokerageFirstPercent" placeholder="请输入一级返佣比例" class="!w-xs" + :min="0" + :max="100" /> 订单交易成功后给推广人返佣的百分比 @@ -86,6 +93,8 @@ v-model="formData.brokerageSecondPercent" placeholder="请输入二级返佣比例" class="!w-xs" + :min="0" + :max="100" /> 订单交易成功后给推广人的推荐人返佣的百分比 @@ -96,6 +105,7 @@ v-model="formData.brokerageFrozenDays" placeholder="请输入佣金冻结天数" class="!w-xs" + :min="0" /> 防止用户退款,佣金被提现了,所以需要设置佣金冻结时间,单位:天 @@ -106,6 +116,8 @@ v-model="formData.brokerageWithdrawMinPrice" placeholder="请输入提现最低金额" class="!w-xs" + :precision="2" + :min="0" /> 用户提现最低金额限制,单位:元 @@ -116,9 +128,12 @@ v-model="formData.brokerageWithdrawFeePercent" placeholder="请输入提现手续费" class="!w-xs" + :min="0" + :max="100" /> - 提现手续费百分比,范围0-100,0为无提现手续费,例:设置10,即收取10%手续费,提现100元,到账90元,10元手续费 + 提现手续费百分比,范围 0-100,0 为无提现手续费。例:设置 10,即收取 10% 手续费,提现 + 10 元,到账 9 元,1 元手续费 @@ -146,7 +161,7 @@ - + 保存 @@ -167,11 +182,11 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加 const formRef = ref() const formData = ref({ id: null, - deliveryExpressFreeEnabled: true, + deliveryExpressFreeEnabled: false, deliveryExpressFreePrice: 0, - brokerageEnabled: true, - brokerageEnabledCondition: BrokerageEnabledConditionEnum.ALL.condition, - brokerageBindMode: BrokerageBindModeEnum.ANYTIME.mode, + brokerageEnabled: false, + brokerageEnabledCondition: undefined, + brokerageBindMode: undefined, brokeragePosterUrls: [], brokerageFirstPercent: 0, brokerageSecondPercent: 0, @@ -211,10 +226,15 @@ const submitForm = async () => { // 提交请求 formLoading.value = true try { - const data = formData.value as unknown as ConfigApi.ConfigVO + const data = { + ...formData.value + } as unknown as ConfigApi.ConfigVO data.brokeragePosterUrls = formData.value.brokeragePosterUrls.map((item: any) => { return item?.url ? item.url : item }) + // 金额放大 + data.deliveryExpressFreePrice = data.deliveryExpressFreePrice * 100 + data.brokerageWithdrawMinPrice = data.brokerageWithdrawMinPrice * 100 await ConfigApi.saveTradeConfig(data) message.success('保存成功') } finally { @@ -230,6 +250,9 @@ const getConfig = async () => { if (data != null) { data.brokeragePosterUrls = data.brokeragePosterUrls.map((url) => ({ url })) formData.value = data + // 金额缩小 + formData.value.deliveryExpressFreePrice = data.deliveryExpressFreePrice / 100 + formData.value.brokerageWithdrawMinPrice = data.brokerageWithdrawMinPrice / 100 } } finally { formLoading.value = false