| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012 |
- <?php
- use common\helpers\ComponentHelper;
- use common\helpers\AddonHelper;
- ComponentHelper::loadComponentView('coupon-select', AddonHelper::getAddonRootPath('Coupon') . 'backend/views/components');
- ComponentHelper::loadComponentView('com-share-pop');
- ?>
- <style>
- .el-card__header {
- padding: 8px 15px;
- }
- .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
- margin: 5px;
- }
- .el-form-item__content, .el-form-item__label{
- margin-top: 10px;
- }
- .width-350 {
- max-width: 350px;
- }
- .width-350 .el-input-group__append,
- .width-350 .el-input-group__prepend {
- padding: 0 8px;
- }
- .width-350 .el-radio {
- margin-right: 8px;
- }
- .width-350 .el-radio__label {
- font-size: 12px;
- }
- </style>
- <div id="app" v-cloak>
- <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;">
- <div class="form_box">
- <template>
- <el-card>
- <el-form :model="ruleForm" size="small" :rules="rules" ref="ruleForm" label-width="150px">
- <el-tabs v-model="activeName">
- <el-tab-pane label="余额提现设置" name="withdraw_balance">
- <?=ComponentHelper::loadComponentView('assets/withdraw_balance', __DIR__ . '/',['withdraw_cond' => $withdraw_cond]);?>
- </el-tab-pane>
- <el-tab-pane label="收益提现设置" name="withdraw_income">
- <?=ComponentHelper::loadComponentView('assets/withdraw_income', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="充值设置" name="recharge">
- <?=ComponentHelper::loadComponentView('assets/recharge', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="积分设置" name="score">
- <?=ComponentHelper::loadComponentView('assets/score', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="余额设置" name="balance">
- <?=ComponentHelper::loadComponentView('assets/balance', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="数字币设置" name="digital">
- <?=ComponentHelper::loadComponentView('assets/digital', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="其他设置" name="other">
- <?=ComponentHelper::loadComponentView('assets/other', __DIR__ . '/'); ?>
- </el-tab-pane>
- </el-tabs>
- <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;" @click="submit('ruleForm')" size="small">保存
- </el-button>
- </el-form>
- </el-card>
- </template>
- </div>
- </el-card>
- </div>
- <script>
- function getDecimalPlaces(num) {
- // 将数字转换为字符串
- const numStr = num.toString();
- // 检查是否有小数点
- if (numStr.indexOf('.') === -1) return 0;
- // 分割整数和小数部分
- const decimalPart = numStr.split('.')[1];
- // 返回小数部分的长度
- return decimalPart.length;
- }
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- btnLoading: false,
- params: {},
- tabWithdraw:'left',
- sharePop: false, //分享弹窗
- shareData: {
- url: "", //链接
- img: "", //二维码
- poster: '', // 海报图片
- poster_filename: '', // 海报图片文件名
- qrcode_filename: '', // 二维码文件名
- },
- activeName: 'withdraw_balance',
- ruleForm: {
- // 余额提现设置
- withdraw_balance: {
- balance_cash_status:{title:'开启余额提现',value:'',remark: ''},
- balance_cash_type:{
- title:'联系号码',
- value:[],
- remark: '自动打款支付,需要申请相应小程序的相应功能,例如:微信需要申请企业付款到零钱功能',
- extra_type:'checkbox',
- extra:{
- // auto:'微信自动打款',
- // wechat:'微信线下转账',
- // alipay:'支付宝线下转账',
- // bank:'银行卡线下转账',
- // joinpay:'提现到银行卡-汇聚'
- }
- },
- balance_min_money:{title:'最少提现额度',value:0.1,remark: '单位:元'},
- balance_day_max_money:{title:'每日提现上限',value:'',remark: '-1元表示不限制每日提现金额,单位:元'},
- balance_cash_service_fee:{
- title:'提现手续费',
- value:'0',
- remark: '单位:% (提现手续费额外从提现中扣除,例如:10%的提现手续费:提现100元,扣除手续费10元,实际到手90元)'
- },
- profit_withdrawal_rule:{
- title:'手续费文字定义',
- value:'手续费',
- remark: '自定义余额提现手续费名称,前端余额提现显示自定义手续费名称,默认:手续费'
- },
- balance_cash_multiple: {
- title: '提现倍数',
- value: 0,
- remark: '0表示不开启提现倍数',
- },
- balance_trans_score_rate:{
- title:'提现转积分扣除比例',
- value:'0',
- remark: '单位:% (提现转积分额外从提现中扣除,例如:10%的提现转积分比例:100元余额提现,90%直接提现,10%转成积分)'
- },
- direct_withdraws_reward:{title:'直推奖励设置',value:'0',remark: '单位:%'},
- indirect_withdraws_reward:{title:'间推奖励设置',value:'0',remark: '单位:%'},
- // checked_condition_keys:[],
- checked_condition_keys:{title:'提现条件选择key集合',value:[],remark: ''},
- // checked_condition_values:{
- // "Agent1":{
- // "key":'Agent1',
- // "value":{"personal_agent_commission":0}
- // },
- // "Agent2":{
- // "key":'Agent2',
- // "value":{"personal_agent_lt__commission":0}
- // },
- // "Boss1":{
- // "key":'Boss1',
- // "value":{"personal_agent_commission":0}
- // },
- // "Boss2":{
- // "key":'Boss2',
- // "value":{"personal_agent_lt__commission":0}
- // },
- // },
- //checked_condition_values:<?php //echo $checked_condition_values; ?>//,
- checked_condition_values:{title:'提现条件集合',value:<?php echo $checked_condition_values; ?>,remark: ''},
- limit_switch: {
- title: '提现限制开关',
- value: 0,
- remark: '',
- },
- limit_type: {
- title: '限制类型',
- value: 1,
- remark: '',
- },
- week: {
- title: '周限制',
- type: 'checkbox',
- value: [],
- remark: '',
- },
- month: {
- title: '月限制',
- type: 'checkbox',
- value: [],
- remark: '',
- },
- enable_password:{title:'启用支付密码',value:'0',remark: '开启以后余额进行提现或者转送都需要输入支付密码'},
- received_full:{title:'是否全额到账',value:'0',remark: '开启后,提现手续费从余额中扣除;余额小于提现金额加手续费时提现失败;例如:提现100元需要手续费10元,则扣除余额110元,实际到账100元'},
- },
- // 收益提现设置
- withdraw_income: {
- is_income_cash:{title:'开启收入提现',value:'0',remark: ''},
- cash_type:{
- title:'联系号码',
- value:[],
- remark: '自动打款支付,需要申请相应小程序的相应功能,例如:微信需要申请企业付款到零钱功能',
- extra_type:'checkbox',
- extra:{
- // auto:'微信自动打款',
- // wechat:'微信线下转账',
- // alipay:'支付宝线下转账',
- // bank:'银行卡线下转账',
- // balance:'提现到余额',
- // joinpay:'提现到银行卡-汇聚',
- }
- },
- is_examine: {
- title: '是否需要审核',
- value: '1'
- },
- min_money:{title:'最少提现额度',value:'0.1',remark: '单位:元'},
- day_max_money:{title:'每日提现上限',value:'0',remark: '-1元表示不限制每日提现金额,单位:元'},
- cash_service_fee:{
- title:'提现手续费',
- value:'0',
- remark: '单位:% (提现手续费额外从提现中扣除,例如:10%的提现手续费:提现100元,扣除手续费10元,实际到手90元)'
- },
- cash_income_service_fee:{
- title:'佣金提现余额手续费',
- value:'0',
- remark: '单位:% (提现手续费额外从提现中扣除,例如:10%的提现手续费:提现100元,扣除手续费10元,实际到手90元)'
- },
- profit_withdrawal_rule:{
- title:'手续费文字定义',
- value:'手续费',
- remark: '自定义佣金提现手续费名称,前端余额提现显示自定义手续费名称,默认:手续费'
- },
- income_cash_multiple: {
- title: '提现倍数',
- value: 0,
- remark: '0表示不开启提现倍数',
- },
- balance_trans_score_rate:{
- title:'提现转积分扣除比例',
- value:'0',
- remark: '单位:% (提现转积分额外从提现中扣除,例如:10%的提现转积分比例:100元佣金提现,90%直接提现,10%转成积分)'
- },
- direct_withdraws_reward:{title:'直推奖励设置',value:'0',remark: '单位:%'},
- indirect_withdraws_reward:{title:'间推奖励设置',value:'0',remark: '单位:%'},
- level_withdrwas_reward:{title:'提现奖励等级权重', value:[], remark:'若未选择任何会员等级,则默认所有会员等级均可享受所配置的奖励;若已选中特定会员等级,则仅选中的会员等级能够获取配置的奖励'},
- level_withdrwas_reward_type:{title:'奖励设置', value:1, remark:''},
- indep_withdrwas_reward:{title:'独立设置', value:[],},
- addons_commission_name_list:{title:"收益命名",value:[],remark:""},
- deduct_equal_points:{title:'扣除等额积分',value:0,remark: ''},
- deduct_equal_frozen_redpack:{title:'扣除等额冻结红包',value:0,remark: ''},
- withdraws_limit_enable: {
- title: '开启提现限额',
- value: 0,
- remark: '开启后,达到提现上限,用户需要购买后台任意产品一次,用户复购完成,则可以再次提现相对应设置的金额',
- },
- withdraws_limit_money: {
- title: '提现上限',
- value: '',
- remark: '单位:元',
- },
- limit_switch: {
- title: '提现限制开关',
- value: 0,
- remark: '',
- },
- limit_type: {
- title: '限制类型',
- value: 1,
- remark: '',
- },
- week: {
- title: '周限制',
- type: 'checkbox',
- value: [],
- remark: '',
- },
- month: {
- title: '月限制',
- type: 'checkbox',
- value: [],
- remark: '',
- },
- first_withdraw: {
- title: '首次提现',
- type: 'input',
- value: '',
- remark: '首次提现最低金额, 后续的提现不影响',
- },
- enable_repurchase_limit: {
- title: '启用提现复购',
- value: 0,
- remark: '',
- },
- repurchase_reach_money: {
- title: '复购金额',
- value: 0,
- remark: '',
- },
- repurchase_user_level_limit: {
- title: '复购会员等级',
- type: 'checkbox',
- value: [],
- remark: '',
- },
- repurchase_redirect_url: {
- title: '复购页面链接',
- value: '',
- remark: '',
- },
- show_type: {
- title: '显示类型',
- value: 2,
- remark: '',
- },
- is_show_today_income: {
- title: '是否显示今日收益',
- value: 1,
- },
- enable_password:{title:'启用支付密码',value:'0',remark: '开启以后佣金进行提现需要输入支付密码'},
- is_hidden_money_unit:{title:'隐藏金额单位',value:'0',remark: '开启以后提现页将不会显示这些"元","金额","¥"文案'},
- is_enable_income_increment:{title:'是否开启收益增值',value:'0',remark: ''},
- income_increment:{title:'年化率',value:'0',remark: ''},
- promotion_center_title:{title:'推广中心聚合页',value:'推广中心',remark: '修改后,仅推广中心聚合页的名称发生变化'},
- balance_withdraw_total_weight_limit_switch: {title:'提现到余额总控制',value:'0',remark: ''}, // 提现到余额总权重控制
- 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: '注:未勾选的选项即使设置有内容,也不会生效'},
- is_independent_balance_withdraw: {title:'',value: '0',remark: '开启后,达到提现余额上限,用户需要购买后台任意产品一次,用户复购完成,则可以再次提现相对应设置的金额'},
- independent_balance_withdraw_max_amount: {title:'',value: '0',remark: '单位元'},
- trans_balance_rate: {title:'提现转余额比例',value: '0',remark: '单位:%(例如:佣金提现手续费为10%,并设置20%的提现转余额比例:100元佣金提现,扣除10%手续费剩余90元,90元的20%即18元自动转为余额,到账72元现金)'},
- },
- // recharge:{
- // recharge_money1:{title:'充值金额1',value:'0',remark:'单位:元'},
- // give_money1:{title:'赠送金额1',value:'0',remark:'单位:元'},
- //
- // recharge_money2:{title:'充值金额2',value:'0',remark:'单位:元'},
- // give_money2:{title:'赠送金额2',value:'0',remark:'单位:元'},
- //
- // recharge_money3:{title:'充值金额3',value:'0',remark:'单位:元'},
- // give_money3:{title:'赠送金额3',value:'0',remark:'单位:元'},
- //
- // recharge_money4:{title:'充值金额4',value:'0',remark:'单位:元'},
- // give_money4:{title:'赠送金额4',value:'0',remark:'单位:元'},
- //
- // recharge_money5:{title:'充值金额5',value:'0',remark:'单位:元'},
- // give_money5:{title:'赠送金额5',value:'0',remark:'单位:元'},
- //
- // recharge_money6:{title:'充值金额6',value:'0',remark:'单位:元'},
- // give_money6:{title:'赠送金额6',value:'0',remark:'单位:元'}
- // },
- recharge: {
- is_open_recharge: {title: '是否开启余额充值', value: 0, remark: ''},
- is_user_recharge_num: {title: '是否开启自定义充值', value: 0, remark: ''},
- min_recharge_num: {title: '自定义充值最低金额', value: 0, remark: ''},
- is_recharge_give_up: {title: '是否开启充值奖励上级', value: 0, remark: ''},
- recharge_give_up_info: {title: '充值奖励上级奖励信息', value: [], remark: ''},
- def_recharge_num: {title: '充值金额', value: ['100', '200', '300', '400'], remark: ''},
- qrcode_url: {title: '', value: '', remark: ''},
- page_link: {title: '', value: '', remark: ''},
- poster_url: {title: '', value: '', remark: ''},
- poster_filename: {title: '', value: '', remark: ''},
- qrcode_filename: {title: '', value: '', remark: ''},
- is_open_recharge_offline: {title: '线下充值', value: 0, remark: ''},
- recharge_offline_code:{title:'充值二维码',value:'',remark: '建议尺寸:200 * 200',extra_type:'',extra:'/resources/img/mall/app-share-name.png'},
- },
- /** 积分设置 **/
- score:{
- score_name:{title:'积分文字定义',value:'',remark:''},
- is_score_transfer:{title:'启用积分转送功能',value:'0',remark:''},
- source_transfer_permission:{
- title:'转送权限',
- value: 0,
- remark:'',
- type:'radio',
- extra:{
- 0: '不限',
- 1: '团队上下级',
- }
- },
- transfer_poundage:{title:'转送手续费',value:'0',remark:'转送手续费额外从转送人积分里扣除,例如:10%的转送手续费:A转送给B积分100元,扣除手续费10元,实际扣除A积分110元,B积分到账100元'},
- is_score_balance:{title:'积分转余额',value:0,remark:''},
- score_balance_ratio:{title:'比例设置',value:'0',remark:'N积分转换1元'},
- score_withdrawal_giving_ratio:{title:'提现赠送积分比例',value:'0',remark:'1元等于N个积分'},
- score_deduct_status:{title:'积分抵扣',value:'0',remark:''},
- score_deduct_ratio:{title:'积分抵扣比例',value:'0',remark:'N积分抵扣1元'},
- score_balance_poundage:{title:'转余额手续费',value:'0',remark:'转送手续费从转送人余额里扣除,例如:10%的手续费:100积分转换成10元,扣除手续费1元,实际到账9元'},
- enable_password:{title:'启用支付密码',value:'0',remark: '开启以后积分进行转送需要输入支付密码'},
- is_enable_score_giving:{title:'启用积分赠送',value:0,remark: ''},
- score_giving_goods_type:{title:'商品类型',value:[],remark: '',type: 'checkbox',},
- score_giving_calculation:{title:'计算方式',value:0,remark: ''},
- score_giving_settlement_method:{title:'结算方式',value:0,remark: ''},
- score_giving_num:{title:'赠送积分数量',value:0,remark: ''},
- score_giving_type:{title:'赠送积分类型',value:0,remark: ''},
- finish_settlement:{title:'已结算',value:'',remark: ''},
- wait_settlement:{title:'待结算',value:'',remark: ''},
- level_limit_type:{title:'等级限制',value:0,remark:''},
- level_limit_levels:{title:'限制等级',value:[],remark:'指定等级可将积分转余额'},
- is_hide_score_details: {title: '前端隐藏结算明细', value: 0, remark: '开启后,前端会隐藏积分结算明细'},
- score_cash_status:{title:'开启积分提现',value:0,remark: '开启后,前端展示提现入口'},
- score_cash_radio:{title:'积分提现比例',value:0,remark: '消耗N积分,可以提现1元'},
- score_cash_service_fee:{title:'积分提现手续费',value:0,remark: '提现手续费从提现中扣除,例如: 10%的手续费,100积分可提现100元,扣除10%的手续费,实际到账90元'},
- score_cash_today_limit:{title:'积分提现限制',value:'',remark: '例如:凌晨00:00持有的积分为10000,设置的积分提现限制为50%,则今天只能提现5000积分。'},
- score_cash_type:{
- title:'提现方式',
- value:[],
- remark: '自动打款支付,需要申请相应小程序的相应功能,例如:微信需要申请企业付款到零钱功能',
- extra_type:'checkbox',
- extra:{
- // auto:'微信自动打款',
- // wechat:'微信线下转账',
- // alipay:'支付宝线下转账',
- // bank:'银行卡线下转账',
- // joinpay:'提现到银行卡-汇聚'
- }
- },
- score_cash_min_money:{title:'最少提现额度',value:0.1,remark: '单位:元'},
- score_cash_day_max_money:{title:'每日提现上限',value:'',remark: '-1元表示不限制每日提现金额,单位:元'},
- },
- /** 余额设置 **/
- balance:{
- balance_name:{title:'积分文字定义',value:'',remark:''},
- is_balance_transfer:{title:'启用积分转送功能',value:'0',remark:''},
- balance_transfer_permission:{
- title:'转送权限',
- value: 0,
- remark:'',
- extra_type:'radio',
- extra:{
- 0: '不限',
- 1: '团队上下级',
- }
- },
- forwarding_charge:{title:'转送手续费',value:'0',remark:'转送手续费额外从转送人余额里扣除,例如:10%的转送手续费:A转送给B余额100元,扣除手续费10元,实际扣除A余额110元,B余额到账100元'},
- is_balance_score:{title:'积分转余额',value:'0',remark:''},
- balance_score_ratio:{title:'比例设置',value:'0',remark:'1元转N个积分'},
- enable_password:{title:'启用支付密码',value:'0',remark: '开启以后进行提现或者转送都需要输入支付密码'},
- },
- /** 数字币设置 **/
- digital:{
- is_enable:{title:'是否启用',value:'0',remark:''},
- name:{title:'数字币文字自定义',value:'',remark:''},
- is_transfer:{title:'启用转送功能',value:'0',remark:''},
- forwarding_charge:{title:'转送手续费',value:'0',remark:'转送手续费额外从转送人数字币里扣除,例如:10%的转送手续费:A转送给B数字币100元,扣除手续费10元,实际扣除A数字币110元,B数字币到账100元'},
- enable_to_balance:{title:'数字币转余额',value:'0',remark:''},
- to_balance_ratio:{title:'比例设置',value:'0',remark:'1个转N元'},
- enable_to_score:{title:'数字币转积分',value:'0',remark:''},
- to_score_ratio:{title:'比例设置',value:'0',remark:'1个转N个积分'},
- deduct_redpack:{title:'扣除贡献值',value:'0',remark:'用户获得数字币(金豆)需要扣除账户上的冻结红包(贡献值)\n' +
- '\n' +
- '扣除规则:按照每笔订单去扣除'},
- install_devote :{title:'是否启用贡献值',value:'0',remark:''},
- deduct_redpack_ratio:{title:'比例设置',value:'0',remark:'扣除N倍贡献值,如:输入3,发放10个数字币(金豆)需要扣除用户30个贡献值'},
- },
- /* 其他设置 */
- other: {
- has_bank_idcard: {
- title: '启用银行卡身份证',
- value: 0,
- remark: '',
- }
- }
- },
- inputVisible: false,
- inputValue: '',
- rechargeType: [
- {
- value: '0',
- label: '优惠券'
- },
- {
- value: '1',
- label: '余额'
- },
- {
- value: '2',
- label: '积分'
- },
- // {
- // value: '3',
- // label: '红包'
- // },
- ],
- // typeArr :['coupon','balance','score','res_packet'], //跟rechargeType对应
- typeArr :['coupon','balance','score'], //跟rechargeType对应
- selRechargeType: [{
- key: '0',
- type: 'coupon',
- data: [],
- }],
- coupon_arr: [],
- is_coupon_more: false,
- couponLoading: false,
- user_levels: [],
- user_level_all: [],
- user_levels_normal: [],
- is_withdraw_repurchase: 0,
- digital_name : '数字币',
- rules: {
- withdraw_balance: {
- balance_cash_type: {
- value: [{
- required: false,
- type: 'array',
- validator: (rule, value, callback) => {
- if (this.ruleForm.withdraw_balance.balance_cash_status.value == 1) {
- if (value.length == 0) callback('请勾选提现方式');
- }
- callback();
- }
- }],
- },
- balance_min_money: {
- value: [{
- required: true,
- type: 'number',
- validator: (rule, value, callback) => {
- if (value < 0) {
- callback('最少提现额度必须大于0');
- this.$message.error('最少提现额度必须大于0');
- }
- callback();
- }
- }],
- },
- },
- withdraw_income: {
- cash_type: {
- value: [{
- required: false,
- type: 'array',
- validator: (rule, value, callback) => {
- if (this.ruleForm.withdraw_income.is_income_cash.value == 1) {
- if (value.length == 0) callback('请勾选提现方式');
- }
- callback();
- }
- }],
- },
- min_money: {
- value: [{
- required: true,
- type: 'number',
- validator: (rule, value, callback) => {
- if (value < 0) {
- callback('最少提现额度必须大于0');
- this.$message.error('收益余额最少提现额度必须大于0');
- }
- callback();
- }
- }],
- },
- trans_balance_rate: {
- value: [{
- required: true,
- type: 'number',
- validator: (rule, value, callback) => {
- if (value < 0) {
- callback('提现转余额比例必须大于0');
- this.$message.error('提现转余额比例必须大于0');
- return
- }
- if (value >= 100) {
- callback('提现转余额比例必须小于100');
- this.$message.error('提现转余额比例必须小于100');
- return
- }
- if (getDecimalPlaces(value) > 2) {
- callback('提现转余额比例不能超过两位小数');
- this.$message.error('提现转余额比例不能超过两位小数');
- return
- }
- callback();
- }
- }],
- },
- },
- recharge:{
- min_recharge_num:{
- value: [{
- required: false,
- type: 'array',
- validator: (rule, value, callback) => {
- if (this.ruleForm.recharge.is_user_recharge_num.value == 1) {
- if (value<0.01) callback('最低金额0.01');
- }
- callback();
- }
- }],
- }
- },
- score:{
- score_withdrawal_giving_ratio:{
- value: [{
- required: false,
- type: 'number',
- validator: (rule, value, callback) => {
- if (this.ruleForm.score.score_withdrawal_giving_ratio.value < 1) {
- //取消验证,可设置为0
- //if (value<0.01) callback('收益提现赠送积分比例最低设置不能小于1');
- }
- callback();
- }
- }],
- },
- score_cash_type: {
- value: [{
- required: false,
- type: 'array',
- validator: (rule, value, callback) => {
- if (this.ruleForm.score.score_cash_status.value == 1) {
- if (value.length == 0) callback('请勾选积分提现方式');
- }
- callback();
- }
- }],
- },
- },
- },
- value5: [],
- activeNameS: 'first',
- addons_list: [],
- user_wages_index_url:"",
- week: [
- {
- value: '1',
- title: '星期一',
- },
- {
- value: '2',
- title: '星期二',
- },
- {
- value: '3',
- title: '星期三',
- },
- {
- value: '4',
- title: '星期四',
- },
- {
- value: '5',
- title: '星期五',
- },
- {
- value: '6',
- title: '星期六',
- },
- {
- value: '7',
- title: '星期日',
- },
- ],
- balance_withdraw_total_weight_limit_option: <?= isset($balance_withdraw_total_weight_limit_option) ? $balance_withdraw_total_weight_limit_option : 0 ?>,
- }
- },
- computed: {
- month() {
- let arr = []
- for (let i = 1; i <= 31; i++) {
- arr.push({
- value: i,
- title: i + '号',
- })
- }
- return arr
- },
- },
- mounted: function() {
- this.loadData();
- },
- methods: {
- loadData() {
- if(this.loading === true) return;
- this.loading = true;
- request({
- params: {
- r: 'mall/setting/edit',
- type: 'mall_assets'
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- if(e.data.data) {//有选中的
- var data = e.data.data;
- this.ruleForm.withdraw_balance.balance_cash_type.extra = data['balance_withdraw_way'];
- this.ruleForm.withdraw_income.cash_type.extra = data['income_withdraw_way'];
- this.ruleForm.score.score_cash_type.extra = data['balance_withdraw_way'];
- Object.keys(this.ruleForm).forEach((key) => {
- Object.keys(this.ruleForm[key]).forEach((k) => {
- if (!isEmpty(data[key][k]) && !isEmpty(data[key][k].value)) {
- var dataValue = data[key][k].value;
- if(data[key][k].value!=null){
- if (typeof dataValue == 'string' && (dataValue.indexOf("{") !== -1 || dataValue.indexOf("[") !== -1)) {
- // 将json字符串转为对象
- this.ruleForm[key][k].value = JSON.parse(data[key][k].value);
- }else{
- this.ruleForm[key][k].value = data[key][k].value;
- if(key == 'digital' && k =='name'){
- this.digital_name = this.ruleForm[key][k].value;
- }
- }
- }
- }
- });
- });
- if(this.ruleForm.recharge.recharge_give_up_info.value.length){
- this.selRechargeType = this.ruleForm.recharge.recharge_give_up_info.value;
- }
- let is_show_today_income = e.data.data.withdraw_income.is_show_today_income;
- if (is_show_today_income !== undefined && is_show_today_income !== '' && is_show_today_income != null) {
- this.ruleForm.withdraw_income.is_show_today_income = e.data.data.withdraw_income.is_show_today_income;
- }
- this.addons_list = data.addons_list;
- this.user_wages_index_url = data.user_wages_index_url;
- this.user_levels = data.user_levels
- this.user_level_all = data.user_level_all;
- this.user_levels_normal = data.user_levels_normal;
- this.is_withdraw_repurchase = data.is_withdraw_repurchase;
- console.log(this.user_level_all);
- console.log(this.ruleForm.withdraw_income.level_withdrwas_reward);
- }
- }
- }).catch(e => {
- this.loading = false;
- })
- },
- submit(formName) {
- this.ruleForm.recharge.recharge_give_up_info.value = this.selRechargeType;
- if(this.ruleForm.recharge.is_open_recharge.value === 1){
- let text = this.fromValidate();
- console.log(text,999)
- if(text){
- this.$message.error(text);
- return;
- }
- }
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.btnLoading = true;
- this.$request({
- params: {
- r: 'mall/setting/edit',
- },
- method: 'post',
- data: {
- setting: this.ruleForm,
- },
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.btnLoading = false;
- });
- } else {
- return false;
- }
- });
- },
- selectLinkUrl(e) {
- let self = this;
- e.forEach(function (item, index) {
- self.ruleForm.link_url = item.new_link_url;
- self.ruleForm.link = item;
- })
- },
- picUrl(e) {
- if (e.length) {
- this.ruleForm.pic_url = e[0].url;
- this.$refs.ruleForm.validateField('pic_url');
- }
- },
- imgCase(img) {
- this.dialogVisible = true;
- this.imgCaseImg = img;
- },
- handle(type, data = null, data2 = null) {
- switch (type) {
- case 'showInput':
- this.inputVisible = true;
- this.$nextTick(_ => {
- this.$refs.saveTagInput.$refs.input.focus();
- });
- break;
- case 'delAward':
- let index = this.selRechargeType.findIndex(v => v.key == data);
- this.selRechargeType.splice(index, 1);
- break;
- case 'handleClose':
- this.ruleForm.recharge.def_recharge_num.value.splice(this.ruleForm.recharge.def_recharge_num.value.indexOf(data), 1);
- break;
- case 'handleInputConfirm':
- if(data < 0){
- this.inputVisible = false;
- this.inputValue = '';
- this.$message.error("充值金额不能小于0");
- break;
- }
- let inputValue = parseFloat(this.inputValue).toString();
- if (inputValue && inputValue != 0) {
- let endIndex = inputValue.lastIndexOf(".");
- console.info(endIndex, inputValue.length);
- if (inputValue.length - 1 == endIndex) {
- inputValue = inputValue.substr(0, inputValue.length - 1);
- }
- this.ruleForm.recharge.def_recharge_num.value.push(Number(inputValue) + "");
- }
- // 对数据进行排序
- this.ruleForm.recharge.def_recharge_num.value.sort((a, b) => {
- return Number(a) - Number(b);
- });
- let ary = this.ruleForm.recharge.def_recharge_num.value
- if (ary != undefined) {
- let nary = ary;
- for (var i = 0; i < ary.length; i++) {
- if (nary[i] == nary[i + 1]) {
- nary.splice(i, 1)
- this.ruleForm.recharge.def_recharge_num.value = nary
- this.$message.error("充值金额不能重复" + nary[i]);
- }
- }
- }
- this.inputVisible = false;
- this.inputValue = '';
- break;
- case 'updateType':
- this.selRechargeType[data].type = this.typeArr[data2];
- if(data2 == 0){
- this.selRechargeType[data].data = [];
- } else {
- if(Array.isArray(this.selRechargeType[data].data)){
- this.selRechargeType[data].data = 0;
- }
- }
- break;
- case 'addAward':
- let key = 0;
- for(let i = 0;i<this.rechargeType.length;i++){
- let index = this.selRechargeType.findIndex(v => v.key == this.rechargeType[i].value);
- if(index == -1){
- key = i + '';
- break;
- }
- }
- let obj = {
- key,
- type: this.typeArr[key],
- data: [],
- }
- if(key != 0){
- obj.data = 0;
- }
- this.selRechargeType.push(obj);
- break;
- case 'coupon_select':
- this.coupon_arr = data ?? [];
- this.couponLoading = true;
- break;
- case 'openPop':
- this.sharePop = true;
- this.shareData.img = this.ruleForm.recharge.qrcode_url.value;
- this.shareData.url = this.ruleForm.recharge.page_link.value;
- this.shareData.poster = this.ruleForm.recharge.poster_url.value;
- this.shareData.poster_filename = this.ruleForm.recharge.poster_filename.value;
- this.shareData.qrcode_filename = this.ruleForm.recharge.qrcode_filename.value;
- break;
- case 'delCoupon':
- let couponIndex = this.selRechargeType.findIndex(v => v.key == 0);
- if(couponIndex != -1){
- this.selRechargeType[couponIndex].data.splice(data,1);
- }
- break;
- }
- },
- // 表单验证
- fromValidate(){
- let arr = ['优惠券','余额','积分','红包'];
- if(this.ruleForm.recharge.is_user_recharge_num.value === 1 && this.ruleForm.recharge.min_recharge_num.value <= 0){
- return "最低充值金额不能小于等于0"
- }
- this.ruleForm.recharge.min_recharge_num.value = parseFloat(this.ruleForm.recharge.min_recharge_num.value).toString()
- if(this.ruleForm.recharge.min_recharge_num.value === 'NaN'){
- this.inputVisible = false;
- this.inputValue = '';
- return '充值金额为数字类型';
- }
- if(this.ruleForm.recharge.is_recharge_give_up.value === 1){
- for(let i = 0;i<this.selRechargeType.length;i++){
- if(this.selRechargeType[i].key == 0){
- if(this.selRechargeType[i].data.length == 0) {
- return "请选择赠送内容的优惠券";
- }
- let text = this.validatorCoupon(this.selRechargeType[i].data);
- if(text) return text;
- } else {
- if(!this.selRechargeType[i].data || this.selRechargeType[i].data <= 0){
- return "赠送内容的" + arr[this.selRechargeType[i].key] + "值不能为空或小于等于0";
- }
- }
- }
- }
- return "";
- },
- // 验证优惠券
- validatorCoupon(couponList){
- for(let i = 0;i<couponList.length;i++){
- if(couponList[i].num <= 0){
- return "优惠券赠送数量不能小于等于0";
- }
- }
- return "";
- },
- handleCoupon(data) {
- this.couponLoading = false;
- let couponIndex = this.selRechargeType.findIndex(v => v.key == 0);
- if(couponIndex != -1){
- this.selRechargeType[couponIndex].data = [];
- this.selRechargeType[couponIndex].data.push(...data);
- }
- console.info(this.selRechargeType);
- this.couponPop = false;
- },
- copyLink(link) {
- var input = document.getElementById("copy-container");
- input.value = link; // 修改文本框的内容
- input.select(); // 选中文本
- document.execCommand("copy"); // 执行浏览器复制命令
- this.$message.success('复制成功');
- },
- handleClick(tab, event) {
- console.log(tab, event);
- },
- showTypeChange(value){
- if(value==2){
- //为了规避涉传风险,不建议开启!
- this.$message.error('为了规避涉传风险,不建议开启!');
- }
- },
- formatDirectWithdrawsReward(value) {
- value = this.formatNumber(value);
- if (value > 100) value = 100;
- this.ruleForm.withdraw_income.direct_withdraws_reward.value = value;
- },
- formatIndirectWithdrawsReward(value) {
- value = this.formatNumber(value);
- if (value > 100) value = 100;
- this.ruleForm.withdraw_income.indirect_withdraws_reward.value = value;
- },
- formatNumber(value) {
- let temp = value.toString();
- temp = temp.replace(/。/g, ".");
- temp = temp.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
- temp = temp.replace(/^\./g, ""); //验证第一个字符是数字
- temp = temp.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
- temp = temp.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
- temp = temp.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
- return temp;
- },
- validatorSelect(rule, value, callback) {
- console.log(value);
- callback(new Error('请再次输入密码'));
- }
- }
- });
- </script>
- <style>
- .show-type-radio-group {
- display: flex;
- }
- .radio-group-img {
- margin-top: 10px;
- width: 150px;
- }
- .show-type-radio {
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .show-type-radio + .show-type-radio {
- margin-left: 30px;
- }
- </style>
|