assets.php 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. use common\helpers\AddonHelper;
  4. ComponentHelper::loadComponentView('coupon-select', AddonHelper::getAddonRootPath('Coupon') . 'backend/views/components');
  5. ComponentHelper::loadComponentView('com-share-pop');
  6. ?>
  7. <style>
  8. .el-card__header {
  9. padding: 8px 15px;
  10. }
  11. .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
  12. margin: 5px;
  13. }
  14. .el-form-item__content, .el-form-item__label{
  15. margin-top: 10px;
  16. }
  17. .width-350 {
  18. max-width: 350px;
  19. }
  20. .width-350 .el-input-group__append,
  21. .width-350 .el-input-group__prepend {
  22. padding: 0 8px;
  23. }
  24. .width-350 .el-radio {
  25. margin-right: 8px;
  26. }
  27. .width-350 .el-radio__label {
  28. font-size: 12px;
  29. }
  30. </style>
  31. <div id="app" v-cloak>
  32. <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  33. <div class="form_box">
  34. <template>
  35. <el-card>
  36. <el-form :model="ruleForm" size="small" :rules="rules" ref="ruleForm" label-width="150px">
  37. <el-tabs v-model="activeName">
  38. <el-tab-pane label="余额提现设置" name="withdraw_balance">
  39. <?=ComponentHelper::loadComponentView('assets/withdraw_balance', __DIR__ . '/',['withdraw_cond' => $withdraw_cond]);?>
  40. </el-tab-pane>
  41. <el-tab-pane label="收益提现设置" name="withdraw_income">
  42. <?=ComponentHelper::loadComponentView('assets/withdraw_income', __DIR__ . '/'); ?>
  43. </el-tab-pane>
  44. <el-tab-pane label="充值设置" name="recharge">
  45. <?=ComponentHelper::loadComponentView('assets/recharge', __DIR__ . '/'); ?>
  46. </el-tab-pane>
  47. <el-tab-pane label="积分设置" name="score">
  48. <?=ComponentHelper::loadComponentView('assets/score', __DIR__ . '/'); ?>
  49. </el-tab-pane>
  50. <el-tab-pane label="余额设置" name="balance">
  51. <?=ComponentHelper::loadComponentView('assets/balance', __DIR__ . '/'); ?>
  52. </el-tab-pane>
  53. <el-tab-pane label="数字币设置" name="digital">
  54. <?=ComponentHelper::loadComponentView('assets/digital', __DIR__ . '/'); ?>
  55. </el-tab-pane>
  56. <el-tab-pane label="其他设置" name="other">
  57. <?=ComponentHelper::loadComponentView('assets/other', __DIR__ . '/'); ?>
  58. </el-tab-pane>
  59. </el-tabs>
  60. <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;" @click="submit('ruleForm')" size="small">保存
  61. </el-button>
  62. </el-form>
  63. </el-card>
  64. </template>
  65. </div>
  66. </el-card>
  67. </div>
  68. <script>
  69. function getDecimalPlaces(num) {
  70. // 将数字转换为字符串
  71. const numStr = num.toString();
  72. // 检查是否有小数点
  73. if (numStr.indexOf('.') === -1) return 0;
  74. // 分割整数和小数部分
  75. const decimalPart = numStr.split('.')[1];
  76. // 返回小数部分的长度
  77. return decimalPart.length;
  78. }
  79. const app = new Vue({
  80. el: '#app',
  81. data() {
  82. return {
  83. loading: false,
  84. btnLoading: false,
  85. params: {},
  86. tabWithdraw:'left',
  87. sharePop: false, //分享弹窗
  88. shareData: {
  89. url: "", //链接
  90. img: "", //二维码
  91. poster: '', // 海报图片
  92. poster_filename: '', // 海报图片文件名
  93. qrcode_filename: '', // 二维码文件名
  94. },
  95. activeName: 'withdraw_balance',
  96. ruleForm: {
  97. // 余额提现设置
  98. withdraw_balance: {
  99. balance_cash_status:{title:'开启余额提现',value:'',remark: ''},
  100. balance_cash_type:{
  101. title:'联系号码',
  102. value:[],
  103. remark: '自动打款支付,需要申请相应小程序的相应功能,例如:微信需要申请企业付款到零钱功能',
  104. extra_type:'checkbox',
  105. extra:{
  106. // auto:'微信自动打款',
  107. // wechat:'微信线下转账',
  108. // alipay:'支付宝线下转账',
  109. // bank:'银行卡线下转账',
  110. // joinpay:'提现到银行卡-汇聚'
  111. }
  112. },
  113. balance_min_money:{title:'最少提现额度',value:0.1,remark: '单位:元'},
  114. balance_day_max_money:{title:'每日提现上限',value:'',remark: '-1元表示不限制每日提现金额,单位:元'},
  115. balance_cash_service_fee:{
  116. title:'提现手续费',
  117. value:'0',
  118. remark: '单位:% (提现手续费额外从提现中扣除,例如:10%的提现手续费:提现100元,扣除手续费10元,实际到手90元)'
  119. },
  120. profit_withdrawal_rule:{
  121. title:'手续费文字定义',
  122. value:'手续费',
  123. remark: '自定义余额提现手续费名称,前端余额提现显示自定义手续费名称,默认:手续费'
  124. },
  125. balance_cash_multiple: {
  126. title: '提现倍数',
  127. value: 0,
  128. remark: '0表示不开启提现倍数',
  129. },
  130. balance_trans_score_rate:{
  131. title:'提现转积分扣除比例',
  132. value:'0',
  133. remark: '单位:% (提现转积分额外从提现中扣除,例如:10%的提现转积分比例:100元余额提现,90%直接提现,10%转成积分)'
  134. },
  135. direct_withdraws_reward:{title:'直推奖励设置',value:'0',remark: '单位:%'},
  136. indirect_withdraws_reward:{title:'间推奖励设置',value:'0',remark: '单位:%'},
  137. // checked_condition_keys:[],
  138. checked_condition_keys:{title:'提现条件选择key集合',value:[],remark: ''},
  139. // checked_condition_values:{
  140. // "Agent1":{
  141. // "key":'Agent1',
  142. // "value":{"personal_agent_commission":0}
  143. // },
  144. // "Agent2":{
  145. // "key":'Agent2',
  146. // "value":{"personal_agent_lt__commission":0}
  147. // },
  148. // "Boss1":{
  149. // "key":'Boss1',
  150. // "value":{"personal_agent_commission":0}
  151. // },
  152. // "Boss2":{
  153. // "key":'Boss2',
  154. // "value":{"personal_agent_lt__commission":0}
  155. // },
  156. // },
  157. //checked_condition_values:<?php //echo $checked_condition_values; ?>//,
  158. checked_condition_values:{title:'提现条件集合',value:<?php echo $checked_condition_values; ?>,remark: ''},
  159. limit_switch: {
  160. title: '提现限制开关',
  161. value: 0,
  162. remark: '',
  163. },
  164. limit_type: {
  165. title: '限制类型',
  166. value: 1,
  167. remark: '',
  168. },
  169. week: {
  170. title: '周限制',
  171. type: 'checkbox',
  172. value: [],
  173. remark: '',
  174. },
  175. month: {
  176. title: '月限制',
  177. type: 'checkbox',
  178. value: [],
  179. remark: '',
  180. },
  181. enable_password:{title:'启用支付密码',value:'0',remark: '开启以后余额进行提现或者转送都需要输入支付密码'},
  182. received_full:{title:'是否全额到账',value:'0',remark: '开启后,提现手续费从余额中扣除;余额小于提现金额加手续费时提现失败;例如:提现100元需要手续费10元,则扣除余额110元,实际到账100元'},
  183. },
  184. // 收益提现设置
  185. withdraw_income: {
  186. is_income_cash:{title:'开启收入提现',value:'0',remark: ''},
  187. cash_type:{
  188. title:'联系号码',
  189. value:[],
  190. remark: '自动打款支付,需要申请相应小程序的相应功能,例如:微信需要申请企业付款到零钱功能',
  191. extra_type:'checkbox',
  192. extra:{
  193. // auto:'微信自动打款',
  194. // wechat:'微信线下转账',
  195. // alipay:'支付宝线下转账',
  196. // bank:'银行卡线下转账',
  197. // balance:'提现到余额',
  198. // joinpay:'提现到银行卡-汇聚',
  199. }
  200. },
  201. is_examine: {
  202. title: '是否需要审核',
  203. value: '1'
  204. },
  205. min_money:{title:'最少提现额度',value:'0.1',remark: '单位:元'},
  206. day_max_money:{title:'每日提现上限',value:'0',remark: '-1元表示不限制每日提现金额,单位:元'},
  207. cash_service_fee:{
  208. title:'提现手续费',
  209. value:'0',
  210. remark: '单位:% (提现手续费额外从提现中扣除,例如:10%的提现手续费:提现100元,扣除手续费10元,实际到手90元)'
  211. },
  212. cash_income_service_fee:{
  213. title:'佣金提现余额手续费',
  214. value:'0',
  215. remark: '单位:% (提现手续费额外从提现中扣除,例如:10%的提现手续费:提现100元,扣除手续费10元,实际到手90元)'
  216. },
  217. profit_withdrawal_rule:{
  218. title:'手续费文字定义',
  219. value:'手续费',
  220. remark: '自定义佣金提现手续费名称,前端余额提现显示自定义手续费名称,默认:手续费'
  221. },
  222. income_cash_multiple: {
  223. title: '提现倍数',
  224. value: 0,
  225. remark: '0表示不开启提现倍数',
  226. },
  227. balance_trans_score_rate:{
  228. title:'提现转积分扣除比例',
  229. value:'0',
  230. remark: '单位:% (提现转积分额外从提现中扣除,例如:10%的提现转积分比例:100元佣金提现,90%直接提现,10%转成积分)'
  231. },
  232. direct_withdraws_reward:{title:'直推奖励设置',value:'0',remark: '单位:%'},
  233. indirect_withdraws_reward:{title:'间推奖励设置',value:'0',remark: '单位:%'},
  234. level_withdrwas_reward:{title:'提现奖励等级权重', value:[], remark:'若未选择任何会员等级,则默认所有会员等级均可享受所配置的奖励;若已选中特定会员等级,则仅选中的会员等级能够获取配置的奖励'},
  235. level_withdrwas_reward_type:{title:'奖励设置', value:1, remark:''},
  236. indep_withdrwas_reward:{title:'独立设置', value:[],},
  237. addons_commission_name_list:{title:"收益命名",value:[],remark:""},
  238. deduct_equal_points:{title:'扣除等额积分',value:0,remark: ''},
  239. deduct_equal_frozen_redpack:{title:'扣除等额冻结红包',value:0,remark: ''},
  240. withdraws_limit_enable: {
  241. title: '开启提现限额',
  242. value: 0,
  243. remark: '开启后,达到提现上限,用户需要购买后台任意产品一次,用户复购完成,则可以再次提现相对应设置的金额',
  244. },
  245. withdraws_limit_money: {
  246. title: '提现上限',
  247. value: '',
  248. remark: '单位:元',
  249. },
  250. limit_switch: {
  251. title: '提现限制开关',
  252. value: 0,
  253. remark: '',
  254. },
  255. limit_type: {
  256. title: '限制类型',
  257. value: 1,
  258. remark: '',
  259. },
  260. week: {
  261. title: '周限制',
  262. type: 'checkbox',
  263. value: [],
  264. remark: '',
  265. },
  266. month: {
  267. title: '月限制',
  268. type: 'checkbox',
  269. value: [],
  270. remark: '',
  271. },
  272. first_withdraw: {
  273. title: '首次提现',
  274. type: 'input',
  275. value: '',
  276. remark: '首次提现最低金额, 后续的提现不影响',
  277. },
  278. enable_repurchase_limit: {
  279. title: '启用提现复购',
  280. value: 0,
  281. remark: '',
  282. },
  283. repurchase_reach_money: {
  284. title: '复购金额',
  285. value: 0,
  286. remark: '',
  287. },
  288. repurchase_user_level_limit: {
  289. title: '复购会员等级',
  290. type: 'checkbox',
  291. value: [],
  292. remark: '',
  293. },
  294. repurchase_redirect_url: {
  295. title: '复购页面链接',
  296. value: '',
  297. remark: '',
  298. },
  299. show_type: {
  300. title: '显示类型',
  301. value: 2,
  302. remark: '',
  303. },
  304. is_show_today_income: {
  305. title: '是否显示今日收益',
  306. value: 1,
  307. },
  308. enable_password:{title:'启用支付密码',value:'0',remark: '开启以后佣金进行提现需要输入支付密码'},
  309. is_hidden_money_unit:{title:'隐藏金额单位',value:'0',remark: '开启以后提现页将不会显示这些"元","金额","¥"文案'},
  310. is_enable_income_increment:{title:'是否开启收益增值',value:'0',remark: ''},
  311. income_increment:{title:'年化率',value:'0',remark: ''},
  312. promotion_center_title:{title:'推广中心聚合页',value:'推广中心',remark: '修改后,仅推广中心聚合页的名称发生变化'},
  313. balance_withdraw_total_weight_limit_switch: {title:'提现到余额总控制',value:'0',remark: ''}, // 提现到余额总权重控制
  314. balance_withdraw_total_weight_limit_selected: {title:'',value: <?= isset($balance_withdraw_total_weight_limit_default_values) ? $balance_withdraw_total_weight_limit_default_values : 0 ?>,remark: '注:未勾选的选项即使设置有内容,也不会生效'},
  315. is_independent_balance_withdraw: {title:'',value: '0',remark: '开启后,达到提现余额上限,用户需要购买后台任意产品一次,用户复购完成,则可以再次提现相对应设置的金额'},
  316. independent_balance_withdraw_max_amount: {title:'',value: '0',remark: '单位元'},
  317. trans_balance_rate: {title:'提现转余额比例',value: '0',remark: '单位:%(例如:佣金提现手续费为10%,并设置20%的提现转余额比例:100元佣金提现,扣除10%手续费剩余90元,90元的20%即18元自动转为余额,到账72元现金)'},
  318. },
  319. // recharge:{
  320. // recharge_money1:{title:'充值金额1',value:'0',remark:'单位:元'},
  321. // give_money1:{title:'赠送金额1',value:'0',remark:'单位:元'},
  322. //
  323. // recharge_money2:{title:'充值金额2',value:'0',remark:'单位:元'},
  324. // give_money2:{title:'赠送金额2',value:'0',remark:'单位:元'},
  325. //
  326. // recharge_money3:{title:'充值金额3',value:'0',remark:'单位:元'},
  327. // give_money3:{title:'赠送金额3',value:'0',remark:'单位:元'},
  328. //
  329. // recharge_money4:{title:'充值金额4',value:'0',remark:'单位:元'},
  330. // give_money4:{title:'赠送金额4',value:'0',remark:'单位:元'},
  331. //
  332. // recharge_money5:{title:'充值金额5',value:'0',remark:'单位:元'},
  333. // give_money5:{title:'赠送金额5',value:'0',remark:'单位:元'},
  334. //
  335. // recharge_money6:{title:'充值金额6',value:'0',remark:'单位:元'},
  336. // give_money6:{title:'赠送金额6',value:'0',remark:'单位:元'}
  337. // },
  338. recharge: {
  339. is_open_recharge: {title: '是否开启余额充值', value: 0, remark: ''},
  340. is_user_recharge_num: {title: '是否开启自定义充值', value: 0, remark: ''},
  341. min_recharge_num: {title: '自定义充值最低金额', value: 0, remark: ''},
  342. is_recharge_give_up: {title: '是否开启充值奖励上级', value: 0, remark: ''},
  343. recharge_give_up_info: {title: '充值奖励上级奖励信息', value: [], remark: ''},
  344. def_recharge_num: {title: '充值金额', value: ['100', '200', '300', '400'], remark: ''},
  345. qrcode_url: {title: '', value: '', remark: ''},
  346. page_link: {title: '', value: '', remark: ''},
  347. poster_url: {title: '', value: '', remark: ''},
  348. poster_filename: {title: '', value: '', remark: ''},
  349. qrcode_filename: {title: '', value: '', remark: ''},
  350. is_open_recharge_offline: {title: '线下充值', value: 0, remark: ''},
  351. recharge_offline_code:{title:'充值二维码',value:'',remark: '建议尺寸:200 * 200',extra_type:'',extra:'/resources/img/mall/app-share-name.png'},
  352. },
  353. /** 积分设置 **/
  354. score:{
  355. score_name:{title:'积分文字定义',value:'',remark:''},
  356. is_score_transfer:{title:'启用积分转送功能',value:'0',remark:''},
  357. source_transfer_permission:{
  358. title:'转送权限',
  359. value: 0,
  360. remark:'',
  361. type:'radio',
  362. extra:{
  363. 0: '不限',
  364. 1: '团队上下级',
  365. }
  366. },
  367. transfer_poundage:{title:'转送手续费',value:'0',remark:'转送手续费额外从转送人积分里扣除,例如:10%的转送手续费:A转送给B积分100元,扣除手续费10元,实际扣除A积分110元,B积分到账100元'},
  368. is_score_balance:{title:'积分转余额',value:0,remark:''},
  369. score_balance_ratio:{title:'比例设置',value:'0',remark:'N积分转换1元'},
  370. score_withdrawal_giving_ratio:{title:'提现赠送积分比例',value:'0',remark:'1元等于N个积分'},
  371. score_deduct_status:{title:'积分抵扣',value:'0',remark:''},
  372. score_deduct_ratio:{title:'积分抵扣比例',value:'0',remark:'N积分抵扣1元'},
  373. score_balance_poundage:{title:'转余额手续费',value:'0',remark:'转送手续费从转送人余额里扣除,例如:10%的手续费:100积分转换成10元,扣除手续费1元,实际到账9元'},
  374. enable_password:{title:'启用支付密码',value:'0',remark: '开启以后积分进行转送需要输入支付密码'},
  375. is_enable_score_giving:{title:'启用积分赠送',value:0,remark: ''},
  376. score_giving_goods_type:{title:'商品类型',value:[],remark: '',type: 'checkbox',},
  377. score_giving_calculation:{title:'计算方式',value:0,remark: ''},
  378. score_giving_settlement_method:{title:'结算方式',value:0,remark: ''},
  379. score_giving_num:{title:'赠送积分数量',value:0,remark: ''},
  380. score_giving_type:{title:'赠送积分类型',value:0,remark: ''},
  381. finish_settlement:{title:'已结算',value:'',remark: ''},
  382. wait_settlement:{title:'待结算',value:'',remark: ''},
  383. level_limit_type:{title:'等级限制',value:0,remark:''},
  384. level_limit_levels:{title:'限制等级',value:[],remark:'指定等级可将积分转余额'},
  385. is_hide_score_details: {title: '前端隐藏结算明细', value: 0, remark: '开启后,前端会隐藏积分结算明细'},
  386. score_cash_status:{title:'开启积分提现',value:0,remark: '开启后,前端展示提现入口'},
  387. score_cash_radio:{title:'积分提现比例',value:0,remark: '消耗N积分,可以提现1元'},
  388. score_cash_service_fee:{title:'积分提现手续费',value:0,remark: '提现手续费从提现中扣除,例如: 10%的手续费,100积分可提现100元,扣除10%的手续费,实际到账90元'},
  389. score_cash_today_limit:{title:'积分提现限制',value:'',remark: '例如:凌晨00:00持有的积分为10000,设置的积分提现限制为50%,则今天只能提现5000积分。'},
  390. score_cash_type:{
  391. title:'提现方式',
  392. value:[],
  393. remark: '自动打款支付,需要申请相应小程序的相应功能,例如:微信需要申请企业付款到零钱功能',
  394. extra_type:'checkbox',
  395. extra:{
  396. // auto:'微信自动打款',
  397. // wechat:'微信线下转账',
  398. // alipay:'支付宝线下转账',
  399. // bank:'银行卡线下转账',
  400. // joinpay:'提现到银行卡-汇聚'
  401. }
  402. },
  403. score_cash_min_money:{title:'最少提现额度',value:0.1,remark: '单位:元'},
  404. score_cash_day_max_money:{title:'每日提现上限',value:'',remark: '-1元表示不限制每日提现金额,单位:元'},
  405. },
  406. /** 余额设置 **/
  407. balance:{
  408. balance_name:{title:'积分文字定义',value:'',remark:''},
  409. is_balance_transfer:{title:'启用积分转送功能',value:'0',remark:''},
  410. balance_transfer_permission:{
  411. title:'转送权限',
  412. value: 0,
  413. remark:'',
  414. extra_type:'radio',
  415. extra:{
  416. 0: '不限',
  417. 1: '团队上下级',
  418. }
  419. },
  420. forwarding_charge:{title:'转送手续费',value:'0',remark:'转送手续费额外从转送人余额里扣除,例如:10%的转送手续费:A转送给B余额100元,扣除手续费10元,实际扣除A余额110元,B余额到账100元'},
  421. is_balance_score:{title:'积分转余额',value:'0',remark:''},
  422. balance_score_ratio:{title:'比例设置',value:'0',remark:'1元转N个积分'},
  423. enable_password:{title:'启用支付密码',value:'0',remark: '开启以后进行提现或者转送都需要输入支付密码'},
  424. },
  425. /** 数字币设置 **/
  426. digital:{
  427. is_enable:{title:'是否启用',value:'0',remark:''},
  428. name:{title:'数字币文字自定义',value:'',remark:''},
  429. is_transfer:{title:'启用转送功能',value:'0',remark:''},
  430. forwarding_charge:{title:'转送手续费',value:'0',remark:'转送手续费额外从转送人数字币里扣除,例如:10%的转送手续费:A转送给B数字币100元,扣除手续费10元,实际扣除A数字币110元,B数字币到账100元'},
  431. enable_to_balance:{title:'数字币转余额',value:'0',remark:''},
  432. to_balance_ratio:{title:'比例设置',value:'0',remark:'1个转N元'},
  433. enable_to_score:{title:'数字币转积分',value:'0',remark:''},
  434. to_score_ratio:{title:'比例设置',value:'0',remark:'1个转N个积分'},
  435. deduct_redpack:{title:'扣除贡献值',value:'0',remark:'用户获得数字币(金豆)需要扣除账户上的冻结红包(贡献值)\n' +
  436. '\n' +
  437. '扣除规则:按照每笔订单去扣除'},
  438. install_devote :{title:'是否启用贡献值',value:'0',remark:''},
  439. deduct_redpack_ratio:{title:'比例设置',value:'0',remark:'扣除N倍贡献值,如:输入3,发放10个数字币(金豆)需要扣除用户30个贡献值'},
  440. },
  441. /* 其他设置 */
  442. other: {
  443. has_bank_idcard: {
  444. title: '启用银行卡身份证',
  445. value: 0,
  446. remark: '',
  447. }
  448. }
  449. },
  450. inputVisible: false,
  451. inputValue: '',
  452. rechargeType: [
  453. {
  454. value: '0',
  455. label: '优惠券'
  456. },
  457. {
  458. value: '1',
  459. label: '余额'
  460. },
  461. {
  462. value: '2',
  463. label: '积分'
  464. },
  465. // {
  466. // value: '3',
  467. // label: '红包'
  468. // },
  469. ],
  470. // typeArr :['coupon','balance','score','res_packet'], //跟rechargeType对应
  471. typeArr :['coupon','balance','score'], //跟rechargeType对应
  472. selRechargeType: [{
  473. key: '0',
  474. type: 'coupon',
  475. data: [],
  476. }],
  477. coupon_arr: [],
  478. is_coupon_more: false,
  479. couponLoading: false,
  480. user_levels: [],
  481. user_level_all: [],
  482. user_levels_normal: [],
  483. is_withdraw_repurchase: 0,
  484. digital_name : '数字币',
  485. rules: {
  486. withdraw_balance: {
  487. balance_cash_type: {
  488. value: [{
  489. required: false,
  490. type: 'array',
  491. validator: (rule, value, callback) => {
  492. if (this.ruleForm.withdraw_balance.balance_cash_status.value == 1) {
  493. if (value.length == 0) callback('请勾选提现方式');
  494. }
  495. callback();
  496. }
  497. }],
  498. },
  499. balance_min_money: {
  500. value: [{
  501. required: true,
  502. type: 'number',
  503. validator: (rule, value, callback) => {
  504. if (value < 0) {
  505. callback('最少提现额度必须大于0');
  506. this.$message.error('最少提现额度必须大于0');
  507. }
  508. callback();
  509. }
  510. }],
  511. },
  512. },
  513. withdraw_income: {
  514. cash_type: {
  515. value: [{
  516. required: false,
  517. type: 'array',
  518. validator: (rule, value, callback) => {
  519. if (this.ruleForm.withdraw_income.is_income_cash.value == 1) {
  520. if (value.length == 0) callback('请勾选提现方式');
  521. }
  522. callback();
  523. }
  524. }],
  525. },
  526. min_money: {
  527. value: [{
  528. required: true,
  529. type: 'number',
  530. validator: (rule, value, callback) => {
  531. if (value < 0) {
  532. callback('最少提现额度必须大于0');
  533. this.$message.error('收益余额最少提现额度必须大于0');
  534. }
  535. callback();
  536. }
  537. }],
  538. },
  539. trans_balance_rate: {
  540. value: [{
  541. required: true,
  542. type: 'number',
  543. validator: (rule, value, callback) => {
  544. if (value < 0) {
  545. callback('提现转余额比例必须大于0');
  546. this.$message.error('提现转余额比例必须大于0');
  547. return
  548. }
  549. if (value >= 100) {
  550. callback('提现转余额比例必须小于100');
  551. this.$message.error('提现转余额比例必须小于100');
  552. return
  553. }
  554. if (getDecimalPlaces(value) > 2) {
  555. callback('提现转余额比例不能超过两位小数');
  556. this.$message.error('提现转余额比例不能超过两位小数');
  557. return
  558. }
  559. callback();
  560. }
  561. }],
  562. },
  563. },
  564. recharge:{
  565. min_recharge_num:{
  566. value: [{
  567. required: false,
  568. type: 'array',
  569. validator: (rule, value, callback) => {
  570. if (this.ruleForm.recharge.is_user_recharge_num.value == 1) {
  571. if (value<0.01) callback('最低金额0.01');
  572. }
  573. callback();
  574. }
  575. }],
  576. }
  577. },
  578. score:{
  579. score_withdrawal_giving_ratio:{
  580. value: [{
  581. required: false,
  582. type: 'number',
  583. validator: (rule, value, callback) => {
  584. if (this.ruleForm.score.score_withdrawal_giving_ratio.value < 1) {
  585. //取消验证,可设置为0
  586. //if (value<0.01) callback('收益提现赠送积分比例最低设置不能小于1');
  587. }
  588. callback();
  589. }
  590. }],
  591. },
  592. score_cash_type: {
  593. value: [{
  594. required: false,
  595. type: 'array',
  596. validator: (rule, value, callback) => {
  597. if (this.ruleForm.score.score_cash_status.value == 1) {
  598. if (value.length == 0) callback('请勾选积分提现方式');
  599. }
  600. callback();
  601. }
  602. }],
  603. },
  604. },
  605. },
  606. value5: [],
  607. activeNameS: 'first',
  608. addons_list: [],
  609. user_wages_index_url:"",
  610. week: [
  611. {
  612. value: '1',
  613. title: '星期一',
  614. },
  615. {
  616. value: '2',
  617. title: '星期二',
  618. },
  619. {
  620. value: '3',
  621. title: '星期三',
  622. },
  623. {
  624. value: '4',
  625. title: '星期四',
  626. },
  627. {
  628. value: '5',
  629. title: '星期五',
  630. },
  631. {
  632. value: '6',
  633. title: '星期六',
  634. },
  635. {
  636. value: '7',
  637. title: '星期日',
  638. },
  639. ],
  640. balance_withdraw_total_weight_limit_option: <?= isset($balance_withdraw_total_weight_limit_option) ? $balance_withdraw_total_weight_limit_option : 0 ?>,
  641. }
  642. },
  643. computed: {
  644. month() {
  645. let arr = []
  646. for (let i = 1; i <= 31; i++) {
  647. arr.push({
  648. value: i,
  649. title: i + '号',
  650. })
  651. }
  652. return arr
  653. },
  654. },
  655. mounted: function() {
  656. this.loadData();
  657. },
  658. methods: {
  659. loadData() {
  660. if(this.loading === true) return;
  661. this.loading = true;
  662. request({
  663. params: {
  664. r: 'mall/setting/edit',
  665. type: 'mall_assets'
  666. },
  667. method: 'get'
  668. }).then(e => {
  669. this.loading = false;
  670. if (e.data.code == 0) {
  671. if(e.data.data) {//有选中的
  672. var data = e.data.data;
  673. this.ruleForm.withdraw_balance.balance_cash_type.extra = data['balance_withdraw_way'];
  674. this.ruleForm.withdraw_income.cash_type.extra = data['income_withdraw_way'];
  675. this.ruleForm.score.score_cash_type.extra = data['balance_withdraw_way'];
  676. Object.keys(this.ruleForm).forEach((key) => {
  677. Object.keys(this.ruleForm[key]).forEach((k) => {
  678. if (!isEmpty(data[key][k]) && !isEmpty(data[key][k].value)) {
  679. var dataValue = data[key][k].value;
  680. if(data[key][k].value!=null){
  681. if (typeof dataValue == 'string' && (dataValue.indexOf("{") !== -1 || dataValue.indexOf("[") !== -1)) {
  682. // 将json字符串转为对象
  683. this.ruleForm[key][k].value = JSON.parse(data[key][k].value);
  684. }else{
  685. this.ruleForm[key][k].value = data[key][k].value;
  686. if(key == 'digital' && k =='name'){
  687. this.digital_name = this.ruleForm[key][k].value;
  688. }
  689. }
  690. }
  691. }
  692. });
  693. });
  694. if(this.ruleForm.recharge.recharge_give_up_info.value.length){
  695. this.selRechargeType = this.ruleForm.recharge.recharge_give_up_info.value;
  696. }
  697. let is_show_today_income = e.data.data.withdraw_income.is_show_today_income;
  698. if (is_show_today_income !== undefined && is_show_today_income !== '' && is_show_today_income != null) {
  699. this.ruleForm.withdraw_income.is_show_today_income = e.data.data.withdraw_income.is_show_today_income;
  700. }
  701. this.addons_list = data.addons_list;
  702. this.user_wages_index_url = data.user_wages_index_url;
  703. this.user_levels = data.user_levels
  704. this.user_level_all = data.user_level_all;
  705. this.user_levels_normal = data.user_levels_normal;
  706. this.is_withdraw_repurchase = data.is_withdraw_repurchase;
  707. console.log(this.user_level_all);
  708. console.log(this.ruleForm.withdraw_income.level_withdrwas_reward);
  709. }
  710. }
  711. }).catch(e => {
  712. this.loading = false;
  713. })
  714. },
  715. submit(formName) {
  716. this.ruleForm.recharge.recharge_give_up_info.value = this.selRechargeType;
  717. if(this.ruleForm.recharge.is_open_recharge.value === 1){
  718. let text = this.fromValidate();
  719. console.log(text,999)
  720. if(text){
  721. this.$message.error(text);
  722. return;
  723. }
  724. }
  725. this.$refs[formName].validate((valid) => {
  726. if (valid) {
  727. this.btnLoading = true;
  728. this.$request({
  729. params: {
  730. r: 'mall/setting/edit',
  731. },
  732. method: 'post',
  733. data: {
  734. setting: this.ruleForm,
  735. },
  736. }).then(e => {
  737. this.btnLoading = false;
  738. if (e.data.code === 0) {
  739. this.$message.success(e.data.msg);
  740. } else {
  741. this.$message.error(e.data.msg);
  742. }
  743. }).catch(e => {
  744. this.btnLoading = false;
  745. });
  746. } else {
  747. return false;
  748. }
  749. });
  750. },
  751. selectLinkUrl(e) {
  752. let self = this;
  753. e.forEach(function (item, index) {
  754. self.ruleForm.link_url = item.new_link_url;
  755. self.ruleForm.link = item;
  756. })
  757. },
  758. picUrl(e) {
  759. if (e.length) {
  760. this.ruleForm.pic_url = e[0].url;
  761. this.$refs.ruleForm.validateField('pic_url');
  762. }
  763. },
  764. imgCase(img) {
  765. this.dialogVisible = true;
  766. this.imgCaseImg = img;
  767. },
  768. handle(type, data = null, data2 = null) {
  769. switch (type) {
  770. case 'showInput':
  771. this.inputVisible = true;
  772. this.$nextTick(_ => {
  773. this.$refs.saveTagInput.$refs.input.focus();
  774. });
  775. break;
  776. case 'delAward':
  777. let index = this.selRechargeType.findIndex(v => v.key == data);
  778. this.selRechargeType.splice(index, 1);
  779. break;
  780. case 'handleClose':
  781. this.ruleForm.recharge.def_recharge_num.value.splice(this.ruleForm.recharge.def_recharge_num.value.indexOf(data), 1);
  782. break;
  783. case 'handleInputConfirm':
  784. if(data < 0){
  785. this.inputVisible = false;
  786. this.inputValue = '';
  787. this.$message.error("充值金额不能小于0");
  788. break;
  789. }
  790. let inputValue = parseFloat(this.inputValue).toString();
  791. if (inputValue && inputValue != 0) {
  792. let endIndex = inputValue.lastIndexOf(".");
  793. console.info(endIndex, inputValue.length);
  794. if (inputValue.length - 1 == endIndex) {
  795. inputValue = inputValue.substr(0, inputValue.length - 1);
  796. }
  797. this.ruleForm.recharge.def_recharge_num.value.push(Number(inputValue) + "");
  798. }
  799. // 对数据进行排序
  800. this.ruleForm.recharge.def_recharge_num.value.sort((a, b) => {
  801. return Number(a) - Number(b);
  802. });
  803. let ary = this.ruleForm.recharge.def_recharge_num.value
  804. if (ary != undefined) {
  805. let nary = ary;
  806. for (var i = 0; i < ary.length; i++) {
  807. if (nary[i] == nary[i + 1]) {
  808. nary.splice(i, 1)
  809. this.ruleForm.recharge.def_recharge_num.value = nary
  810. this.$message.error("充值金额不能重复" + nary[i]);
  811. }
  812. }
  813. }
  814. this.inputVisible = false;
  815. this.inputValue = '';
  816. break;
  817. case 'updateType':
  818. this.selRechargeType[data].type = this.typeArr[data2];
  819. if(data2 == 0){
  820. this.selRechargeType[data].data = [];
  821. } else {
  822. if(Array.isArray(this.selRechargeType[data].data)){
  823. this.selRechargeType[data].data = 0;
  824. }
  825. }
  826. break;
  827. case 'addAward':
  828. let key = 0;
  829. for(let i = 0;i<this.rechargeType.length;i++){
  830. let index = this.selRechargeType.findIndex(v => v.key == this.rechargeType[i].value);
  831. if(index == -1){
  832. key = i + '';
  833. break;
  834. }
  835. }
  836. let obj = {
  837. key,
  838. type: this.typeArr[key],
  839. data: [],
  840. }
  841. if(key != 0){
  842. obj.data = 0;
  843. }
  844. this.selRechargeType.push(obj);
  845. break;
  846. case 'coupon_select':
  847. this.coupon_arr = data ?? [];
  848. this.couponLoading = true;
  849. break;
  850. case 'openPop':
  851. this.sharePop = true;
  852. this.shareData.img = this.ruleForm.recharge.qrcode_url.value;
  853. this.shareData.url = this.ruleForm.recharge.page_link.value;
  854. this.shareData.poster = this.ruleForm.recharge.poster_url.value;
  855. this.shareData.poster_filename = this.ruleForm.recharge.poster_filename.value;
  856. this.shareData.qrcode_filename = this.ruleForm.recharge.qrcode_filename.value;
  857. break;
  858. case 'delCoupon':
  859. let couponIndex = this.selRechargeType.findIndex(v => v.key == 0);
  860. if(couponIndex != -1){
  861. this.selRechargeType[couponIndex].data.splice(data,1);
  862. }
  863. break;
  864. }
  865. },
  866. // 表单验证
  867. fromValidate(){
  868. let arr = ['优惠券','余额','积分','红包'];
  869. if(this.ruleForm.recharge.is_user_recharge_num.value === 1 && this.ruleForm.recharge.min_recharge_num.value <= 0){
  870. return "最低充值金额不能小于等于0"
  871. }
  872. this.ruleForm.recharge.min_recharge_num.value = parseFloat(this.ruleForm.recharge.min_recharge_num.value).toString()
  873. if(this.ruleForm.recharge.min_recharge_num.value === 'NaN'){
  874. this.inputVisible = false;
  875. this.inputValue = '';
  876. return '充值金额为数字类型';
  877. }
  878. if(this.ruleForm.recharge.is_recharge_give_up.value === 1){
  879. for(let i = 0;i<this.selRechargeType.length;i++){
  880. if(this.selRechargeType[i].key == 0){
  881. if(this.selRechargeType[i].data.length == 0) {
  882. return "请选择赠送内容的优惠券";
  883. }
  884. let text = this.validatorCoupon(this.selRechargeType[i].data);
  885. if(text) return text;
  886. } else {
  887. if(!this.selRechargeType[i].data || this.selRechargeType[i].data <= 0){
  888. return "赠送内容的" + arr[this.selRechargeType[i].key] + "值不能为空或小于等于0";
  889. }
  890. }
  891. }
  892. }
  893. return "";
  894. },
  895. // 验证优惠券
  896. validatorCoupon(couponList){
  897. for(let i = 0;i<couponList.length;i++){
  898. if(couponList[i].num <= 0){
  899. return "优惠券赠送数量不能小于等于0";
  900. }
  901. }
  902. return "";
  903. },
  904. handleCoupon(data) {
  905. this.couponLoading = false;
  906. let couponIndex = this.selRechargeType.findIndex(v => v.key == 0);
  907. if(couponIndex != -1){
  908. this.selRechargeType[couponIndex].data = [];
  909. this.selRechargeType[couponIndex].data.push(...data);
  910. }
  911. console.info(this.selRechargeType);
  912. this.couponPop = false;
  913. },
  914. copyLink(link) {
  915. var input = document.getElementById("copy-container");
  916. input.value = link; // 修改文本框的内容
  917. input.select(); // 选中文本
  918. document.execCommand("copy"); // 执行浏览器复制命令
  919. this.$message.success('复制成功');
  920. },
  921. handleClick(tab, event) {
  922. console.log(tab, event);
  923. },
  924. showTypeChange(value){
  925. if(value==2){
  926. //为了规避涉传风险,不建议开启!
  927. this.$message.error('为了规避涉传风险,不建议开启!');
  928. }
  929. },
  930. formatDirectWithdrawsReward(value) {
  931. value = this.formatNumber(value);
  932. if (value > 100) value = 100;
  933. this.ruleForm.withdraw_income.direct_withdraws_reward.value = value;
  934. },
  935. formatIndirectWithdrawsReward(value) {
  936. value = this.formatNumber(value);
  937. if (value > 100) value = 100;
  938. this.ruleForm.withdraw_income.indirect_withdraws_reward.value = value;
  939. },
  940. formatNumber(value) {
  941. let temp = value.toString();
  942. temp = temp.replace(/。/g, ".");
  943. temp = temp.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
  944. temp = temp.replace(/^\./g, ""); //验证第一个字符是数字
  945. temp = temp.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
  946. temp = temp.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  947. temp = temp.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
  948. return temp;
  949. },
  950. validatorSelect(rule, value, callback) {
  951. console.log(value);
  952. callback(new Error('请再次输入密码'));
  953. }
  954. }
  955. });
  956. </script>
  957. <style>
  958. .show-type-radio-group {
  959. display: flex;
  960. }
  961. .radio-group-img {
  962. margin-top: 10px;
  963. width: 150px;
  964. }
  965. .show-type-radio {
  966. display: flex;
  967. flex-direction: column;
  968. align-items: center;
  969. }
  970. .show-type-radio + .show-type-radio {
  971. margin-left: 30px;
  972. }
  973. </style>