10
10
<el-form-item label =" hideId" v-show =" false" >
11
11
<el-input v-model =" formData.id" />
12
12
</el-form-item >
13
-
13
+ <!-- 配送 -->
14
14
<el-tabs >
15
15
<el-tab-pane label =" 配送" >
16
16
<el-form-item label =" 启用包邮" prop =" deliveryExpressFreeEnabled" >
22
22
v-model =" formData.deliveryExpressFreePrice"
23
23
placeholder =" 请输入满额包邮"
24
24
class =" !w-xs"
25
+ :precision =" 2"
26
+ :min =" 0"
25
27
/>
26
- <el-text class =" w-full" size =" small" type =" info" > 商城商品满多少金额即可包邮 </el-text >
28
+ <el-text class =" w-full" size =" small" type =" info" >
29
+ 商城商品满多少金额即可包邮,单位:元
30
+ </el-text >
27
31
</el-form-item >
28
32
</el-tab-pane >
33
+ <!-- 分销 -->
29
34
<el-tab-pane label =" 分销" >
30
35
<el-form-item label =" 分佣启用" prop =" brokerageEnabled" >
31
36
<el-switch v-model =" formData.brokerageEnabled" style =" user-select : none " />
59
64
</el-radio >
60
65
</el-radio-group >
61
66
<el-text class =" w-full" size =" small" type =" info" >
62
- 没有推广人 :只要用户没有推广人,随时都可以绑定推广关系
67
+ 首次绑定 :只要用户没有推广人,随时都可以绑定推广关系
63
68
</el-text >
64
69
<el-text class =" w-full" size =" small" type =" info" >
65
- 新用户 :只有新用户注册时或首次进入系统时才可以绑定推广关系
70
+ 注册绑定 :只有新用户注册时或首次进入系统时才可以绑定推广关系
66
71
</el-text >
67
72
</el-form-item >
68
73
<el-form-item label =" 分销海报图" >
69
74
<UploadImgs v-model =" formData.brokeragePosterUrls" width =" 75px" height =" 125px" />
70
75
<el-text class =" w-full" size =" small" type =" info" >
71
- 个人中心分销海报图片,建议尺寸600x1000
76
+ 个人中心分销海报图片,建议尺寸 600x1000
72
77
</el-text >
73
78
</el-form-item >
74
79
<el-form-item label =" 一级返佣比例" prop =" brokerageFirstPercent" >
75
80
<el-input-number
76
81
v-model =" formData.brokerageFirstPercent"
77
82
placeholder =" 请输入一级返佣比例"
78
83
class =" !w-xs"
84
+ :min =" 0"
85
+ :max =" 100"
79
86
/>
80
87
<el-text class =" w-full" size =" small" type =" info" >
81
88
订单交易成功后给推广人返佣的百分比
86
93
v-model =" formData.brokerageSecondPercent"
87
94
placeholder =" 请输入二级返佣比例"
88
95
class =" !w-xs"
96
+ :min =" 0"
97
+ :max =" 100"
89
98
/>
90
99
<el-text class =" w-full" size =" small" type =" info" >
91
100
订单交易成功后给推广人的推荐人返佣的百分比
96
105
v-model =" formData.brokerageFrozenDays"
97
106
placeholder =" 请输入佣金冻结天数"
98
107
class =" !w-xs"
108
+ :min =" 0"
99
109
/>
100
110
<el-text class =" w-full" size =" small" type =" info" >
101
111
防止用户退款,佣金被提现了,所以需要设置佣金冻结时间,单位:天
106
116
v-model =" formData.brokerageWithdrawMinPrice"
107
117
placeholder =" 请输入提现最低金额"
108
118
class =" !w-xs"
119
+ :precision =" 2"
120
+ :min =" 0"
109
121
/>
110
122
<el-text class =" w-full" size =" small" type =" info" >
111
123
用户提现最低金额限制,单位:元
116
128
v-model =" formData.brokerageWithdrawFeePercent"
117
129
placeholder =" 请输入提现手续费"
118
130
class =" !w-xs"
131
+ :min =" 0"
132
+ :max =" 100"
119
133
/>
120
134
<el-text class =" w-full" size =" small" type =" info" >
121
- 提现手续费百分比,范围0-100,0为无提现手续费,例:设置10,即收取10%手续费,提现100元,到账90元,10元手续费
135
+ 提现手续费百分比,范围 0-100,0 为无提现手续费。例:设置 10,即收取 10% 手续费,提现
136
+ 10 元,到账 9 元,1 元手续费
122
137
</el-text >
123
138
</el-form-item >
124
139
<el-form-item label =" 提现方式" prop =" brokerageWithdrawTypes" >
146
161
</el-form-item >
147
162
</el-tab-pane >
148
163
</el-tabs >
149
-
164
+ <!-- 保存 -->
150
165
<el-form-item >
151
166
<el-button type =" primary" @click =" submitForm" :loading =" formLoading" > 保存 </el-button >
152
167
</el-form-item >
@@ -167,11 +182,11 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
167
182
const formRef = ref ()
168
183
const formData = ref ({
169
184
id: null ,
170
- deliveryExpressFreeEnabled: true ,
185
+ deliveryExpressFreeEnabled: false ,
171
186
deliveryExpressFreePrice: 0 ,
172
- brokerageEnabled: true ,
173
- brokerageEnabledCondition: BrokerageEnabledConditionEnum . ALL . condition ,
174
- brokerageBindMode: BrokerageBindModeEnum . ANYTIME . mode ,
187
+ brokerageEnabled: false ,
188
+ brokerageEnabledCondition: undefined ,
189
+ brokerageBindMode: undefined ,
175
190
brokeragePosterUrls: [],
176
191
brokerageFirstPercent: 0 ,
177
192
brokerageSecondPercent: 0 ,
@@ -211,10 +226,15 @@ const submitForm = async () => {
211
226
// 提交请求
212
227
formLoading .value = true
213
228
try {
214
- const data = formData .value as unknown as ConfigApi .ConfigVO
229
+ const data = {
230
+ ... formData .value
231
+ } as unknown as ConfigApi .ConfigVO
215
232
data .brokeragePosterUrls = formData .value .brokeragePosterUrls .map ((item : any ) => {
216
233
return item ?.url ? item .url : item
217
234
})
235
+ // 金额放大
236
+ data .deliveryExpressFreePrice = data .deliveryExpressFreePrice * 100
237
+ data .brokerageWithdrawMinPrice = data .brokerageWithdrawMinPrice * 100
218
238
await ConfigApi .saveTradeConfig (data )
219
239
message .success (' 保存成功' )
220
240
} finally {
@@ -230,6 +250,9 @@ const getConfig = async () => {
230
250
if (data != null ) {
231
251
data .brokeragePosterUrls = data .brokeragePosterUrls .map ((url ) => ({ url }))
232
252
formData .value = data
253
+ // 金额缩小
254
+ formData .value .deliveryExpressFreePrice = data .deliveryExpressFreePrice / 100
255
+ formData .value .brokerageWithdrawMinPrice = data .brokerageWithdrawMinPrice / 100
233
256
}
234
257
} finally {
235
258
formLoading .value = false
0 commit comments