init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,739 @@
|
||||
<!--[1.8.20]-->
|
||||
<style>
|
||||
strong {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
input[type=number] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
input[type=number]::-webkit-inner-spin-button,
|
||||
input[type=number]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.edui-default .edui-toolbar .edui-combox .edui-combox-body {
|
||||
line-height: 14px !important;
|
||||
}
|
||||
|
||||
.edui-default .edui-button-body,
|
||||
.edui-splitbutton-body,
|
||||
.edui-menubutton-body,
|
||||
.edui-combox-body {
|
||||
line-height: 14px !important;
|
||||
}
|
||||
|
||||
.setTips {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.setTips1 {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
margin-left: 212px;
|
||||
}
|
||||
</style>
|
||||
<div id="tabs" style="margin-top:2px;">
|
||||
<el-tabs tab-position="left">
|
||||
<el-tab-pane label="积分赠送规则">
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="常规会员设置">
|
||||
<div class="layui-card-header">积分设置</div>
|
||||
<div class="layui-card-body">
|
||||
<el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-width="160px">
|
||||
<el-form-item label="签到(一天)赠送积分" style="width:400px;">
|
||||
<el-input v-model="ruleForm.signin_give"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="完善资料赠送积分" style="width:400px;">
|
||||
<el-input v-model="ruleForm.infoscore"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="消费获得积分">
|
||||
<el-switch v-model="ruleForm.percent_state"></el-switch>
|
||||
<span class="layui-form-mid layui-word-aux setTips1">开启后会员购买商品则送积分</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="ruleForm.percent_state" label="消费">
|
||||
<div style="display: flex">
|
||||
<el-form-item :prop="ruleForm.percent_state ? 'flower_price':''">
|
||||
<el-input v-model="ruleForm.flower_price" style="width:150px;margin: 0 20px;">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
元获得
|
||||
<el-form-item :prop="ruleForm.percent_state ? 'percent':''">
|
||||
<el-input v-model="ruleForm.percent" style="width:150px;margin: 0 20px;">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
积分
|
||||
|
||||
<span class="layui-form-mid layui-word-aux setTips">积分换算最后结果为整数</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="ruleForm.percent_state" label="余额支付赠送积分">
|
||||
<el-switch v-model="ruleForm.vip_pay_integral_state"></el-switch>
|
||||
<span class="layui-word-aux setTips1">
|
||||
<span>开启后在消费获得积分的前提下会员用余额支付则送积分</span>
|
||||
<el-tooltip class="item" effect="dark" content="Top Left 提示文字"
|
||||
placement="top-start">
|
||||
<template slot="content">
|
||||
<p>当商户后台设置了余额支付不赠积分后,假如消费获得积分设置为:1积分=1元,用户购买了</p>
|
||||
<p><strong>赠送固定积分的商品</strong>(A:单价5元,购买送10积分;B:单价8元,购买送20积分) 各一个</p>
|
||||
<p><strong>不赠送固定积分的商品</strong>(C:单价10元;D:单价15元)各一个(比例积分的金额共<strong>25</strong>元)
|
||||
</p>
|
||||
<p>①支付方式为非组合支付且没有使用余额支付(或组合支付且组合中没有余额支付)时:</p>
|
||||
<p style="text-indent: 30px">用户总花费38元,将获得:30(固定积分)+25(比例积分)= 55积分</p>
|
||||
<p>②支付方式为余额支付时:</p>
|
||||
<p style="text-indent: 30px">用户将花费38元余额,将获得:30(固定积分)+0(比例积分)=30积分</p>
|
||||
<p>③支付方式为组合支付时,且使用了18元现金(或其他非余额支付)+20元余额:</p>
|
||||
<p style="text-indent: 30px">由于:25元(比例积分)>18元(非余额支付),则比例积分对应金额为18元</p>
|
||||
<p style="text-indent: 30px">将获得:30(固定积分)+18(比例积分)= 48积分</p>
|
||||
<p>④支付方式为组合支付,且使用了30元现金(或其他非余额支付)+8元余额:</p>
|
||||
<p style="text-indent: 30px">由于:25元(比例积分)<30元(非余额支付),则比例积分对应金额为25元< /p>
|
||||
<p style="text-indent: 30px">将获得:30(固定积分)+25(比例积分)= 55积分</p>
|
||||
</template>
|
||||
<el-button size="mini" type="text" icon="el-icon-question">规则</el-button>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值获得积分">
|
||||
<el-switch v-model="ruleForm.recharge_state"></el-switch>
|
||||
<span class="layui-form-mid layui-word-aux setTips1">开启后会员余额充值则送积分</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="ruleForm.recharge_state" label="充值">
|
||||
<div style="display: flex">
|
||||
<el-form-item :prop="ruleForm.recharge_state?'recharge_price':''">
|
||||
<el-input v-model="ruleForm.recharge_price" style="width:150px;margin: 0 20px;">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
元获得
|
||||
<el-form-item :prop="ruleForm.recharge_state?'recharge_integral':''">
|
||||
<el-input v-model="ruleForm.recharge_integral"
|
||||
style="width:150px;margin: 0 20px;"></el-input>
|
||||
</el-form-item>
|
||||
积分
|
||||
<span class="layui-form-mid layui-word-aux setTips">积分换算最后结果为整数</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="指定商品送积分">
|
||||
<el-switch v-model="ruleForm.goods_integral_state"></el-switch>
|
||||
<span class="layui-form-mid layui-word-aux setTips1">开启后可对商品设置会员购买送固定积分</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="详情设置">
|
||||
<div>
|
||||
<textarea id="editor" type="text/plain" style="width:600px;height: 400px;"
|
||||
name="details">{$vipset['vip_detail']}</textarea>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<if condition="$authArr['vipconfigset'] eq true">
|
||||
<el-button type="primary" @click="onSubmit('ruleForm')">保存</el-button>
|
||||
</if>
|
||||
<el-button>取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="Plus会员设置">
|
||||
<div class="layui-card-header">积分设置</div>
|
||||
<div class="layui-card-body">
|
||||
<el-form ref="plusForm" :rules="plusRules" :model="plusForm" label-width="160px">
|
||||
<el-form-item label="签到(一天)赠送积分" style="width:400px;">
|
||||
<el-input v-model="plusForm.plus_signin_give"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="完善资料赠送积分" style="width:400px;">
|
||||
<el-input v-model="plusForm.plus_infoscore"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="消费获得积分">
|
||||
<template slot="label">
|
||||
<el-tooltip class="item" effect="dark" content="Top Left 提示文字"
|
||||
placement="top-start">
|
||||
<template slot="content">
|
||||
<p>由于PLUS权益为最高权益,当PLUS余额支付赠送积分设置关闭时,如果常规会员消费获得积分开启,PLUS会员消费将会获得常规会员设置的相同积分
|
||||
</p>
|
||||
</template>
|
||||
<span>消费获得积分<i class="el-icon-question"></i></span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-switch v-model="plusForm.plus_percent_state"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="plusForm.plus_percent_state">
|
||||
<div style="display: flex;align-items: center;margin-bottom: 20px">
|
||||
<el-radio v-model="plusForm.plus_flower_type" label="1">倍数</el-radio>
|
||||
<el-form-item prop="plus_percent"
|
||||
v-if="plusForm.plus_percent_state && plusForm.plus_flower_type == 1">
|
||||
消费常规会员同样金额获得
|
||||
<el-input v-model="plusForm.plus_percent" style="width:80px;margin: 0px 20px;">
|
||||
</el-input>
|
||||
倍常规会员消费积分
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div style="display: flex;align-items: center;margin-bottom: 20px">
|
||||
<el-radio v-model="plusForm.plus_flower_type" label="2">数值</el-radio>
|
||||
<div style="display: flex"
|
||||
v-if="plusForm.plus_percent_state && plusForm.plus_flower_type == 2">
|
||||
消费
|
||||
<el-form-item prop="plus_flower_price">
|
||||
<el-input v-model="plusForm.plus_flower_price"
|
||||
style="width:80px;margin: 0px 20px;"></el-input>
|
||||
</el-form-item>
|
||||
元获得
|
||||
<el-form-item prop="plus_flower_percent">
|
||||
<el-input v-model="plusForm.plus_flower_percent"
|
||||
style="width:100px;margin: 0px 20px;"></el-input>
|
||||
</el-form-item>
|
||||
积分
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="plusForm.plus_percent_state" label="余额支付赠送积分">
|
||||
<el-switch v-model="ruleForm.plus_pay_integral_state"></el-switch>
|
||||
<span class="layui-word-aux setTips1">
|
||||
<span>开启后在消费获得积分的前提下会员用余额支付则送积分</span>
|
||||
<el-tooltip class="item" effect="dark" content="Top Left 提示文字"
|
||||
placement="top-start">
|
||||
<template slot="content">
|
||||
<p>当商户后台设置了余额支付不赠积分后,假如消费获得积分设置为:1积分=1元,用户购买了</p>
|
||||
<p><strong>赠送固定积分的商品</strong>(A:单价5元,购买送10积分;B:单价8元,购买送20积分) 各一个</p>
|
||||
<p><strong>不赠送固定积分的商品</strong>(C:单价10元;D:单价15元)各一个(比例积分的金额共<strong>25</strong>元)
|
||||
</p>
|
||||
<p>①支付方式为非组合支付且没有使用余额支付(或组合支付且组合中没有余额支付)时:</p>
|
||||
<p style="text-indent: 30px">用户总花费38元,将获得:30(固定积分)+25(比例积分)= 55积分</p>
|
||||
<p>②支付方式为余额支付时:</p>
|
||||
<p style="text-indent: 30px">用户将花费38元余额,将获得:30(固定积分)+0(比例积分)=30积分</p>
|
||||
<p>③支付方式为组合支付时,且使用了18元现金(或其他非余额支付)+20元余额:</p>
|
||||
<p style="text-indent: 30px">由于:25元(比例积分)>18元(非余额支付),则比例积分对应金额为18元</p>
|
||||
<p style="text-indent: 30px">将获得:30(固定积分)+18(比例积分)= 48积分</p>
|
||||
<p>④支付方式为组合支付,且使用了30元现金(或其他非余额支付)+8元余额:</p>
|
||||
<p style="text-indent: 30px">由于:25元(比例积分)<30元(非余额支付),则比例积分对应金额为25元< /p>
|
||||
<p style="text-indent: 30px">将获得:30(固定积分)+25(比例积分)= 55积分</p>
|
||||
</template>
|
||||
<el-button size="mini" type="text" icon="el-icon-question">规则</el-button>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值获得积分">
|
||||
<template slot="label">
|
||||
<el-tooltip class="item" effect="dark" content="Top Left 提示文字"
|
||||
placement="top-start">
|
||||
<template slot="content">
|
||||
<p>由于PLUS权益为最高权益,当PLUS充值获得积分设置关闭时,如果常规会员充值获得积分开启,PLUS会员充值将会获得常规会员设置的相同积分</p>
|
||||
</template>
|
||||
<span>充值获得积分<i class="el-icon-question"></i></span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-switch v-model="plusForm.plus_recharge_state"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="plusForm.plus_recharge_state">
|
||||
<div style="display: flex;align-items: center;margin-bottom: 20px">
|
||||
<el-radio style="height: 40px;line-height: 40px"
|
||||
v-model="plusForm.plus_recharge_type" label="1">倍数
|
||||
</el-radio>
|
||||
<el-form-item prop="plus_recharge_integral"
|
||||
v-if="plusForm.plus_recharge_state && plusForm.plus_recharge_type == 1">
|
||||
充值常规会员同样金额获得
|
||||
<el-input v-model="plusForm.plus_recharge_integral"
|
||||
style="width:80px;margin: 0px 20px;"></el-input>
|
||||
倍常规会员充值积分
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div style="display: flex;align-items: center;margin-bottom: 20px">
|
||||
<el-radio v-model="plusForm.plus_recharge_type" label="2"
|
||||
style="height: 40px;line-height: 40px">数值
|
||||
</el-radio>
|
||||
<div style="display: flex;"
|
||||
v-if="plusForm.plus_recharge_state && plusForm.plus_recharge_type == 2">
|
||||
充值
|
||||
<el-form-item prop="plus_recharge_price">
|
||||
<el-input v-model="plusForm.plus_recharge_price"
|
||||
style="width:80px;margin: 0px 20px;"></el-input>
|
||||
</el-form-item>
|
||||
元获得
|
||||
<el-form-item prop="plus_recharge_get_integral">
|
||||
<el-input v-model="plusForm.plus_recharge_get_integral"
|
||||
style="width:100px;margin: 0px 20px;"></el-input>
|
||||
</el-form-item>
|
||||
积分
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品积分" prop="goods_integral_multiple">
|
||||
<el-switch v-model="plusForm.goods_integral_plus_state"></el-switch>
|
||||
<div>
|
||||
<span style="display: inline-block;">指定商品送积分<el-input
|
||||
v-model="plusForm.goods_integral_multiple"
|
||||
style="width:150px;margin: 0px 20px;"></el-input>倍常规会员商品积分</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<if condition="$authArr['plus_vipconfigset'] eq true">
|
||||
<el-button type="primary" @click="plus_dosubmit('plusForm')">保存</el-button>
|
||||
</if>
|
||||
<el-button>取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="积分营销规则">
|
||||
<el-form label-width="120px" :model="integralForm" :rules="integrals" ref="integralForm">
|
||||
<el-form-item label="是否开启" require>
|
||||
<el-switch v-model="integral_arrive_cash" inactive-value="0"
|
||||
:active-text="integral_arrive_cash==1?'开启':'关闭'" active-value="1">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<template v-if="integral_arrive_cash==1">
|
||||
<el-form-item label="积分抵现比例">
|
||||
<div style="display: flex;align-content: center;">
|
||||
<el-form-item prop="integral_arrive_cash_data">
|
||||
<el-input type="text" step="1" size="small"
|
||||
oninput="value=this.value.replace(/^[0]|\D/,'')"
|
||||
v-model="integralForm.integral_arrive_cash_data" placeholder="1~(整数)"
|
||||
style="width: 80px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="integral_arrive_cash_price">
|
||||
积分 =
|
||||
<el-input type="text" step="1" size="small"
|
||||
v-model="integralForm.integral_arrive_cash_price" placeholder="金额"
|
||||
style="width: 80px"></el-input>
|
||||
元
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="营销方式">
|
||||
<el-radio v-model="marketing_methods" label="1">基于订单</el-radio>
|
||||
<el-radio v-model="marketing_methods" label="2">基于商品</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="整单可抵现比例" prop="integral_arrive_cash_rate" v-if="marketing_methods == 1">
|
||||
<el-input type="text" step="0.0001" size="small"
|
||||
v-model="integralForm.integral_arrive_cash_rate" placeholder="1~99" style="width: 160px">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
<p style="color: #999;font-size: 13px">如100元的订单,整单可抵现比例为10%:</p>
|
||||
<p style="color: #999;font-size: 13px">那么此订单中的10元将可使用积分进行抵扣,所需积分根据积分抵现比例进行换算</p>
|
||||
</el-form-item>
|
||||
|
||||
</template>
|
||||
<el-form-item>
|
||||
<if condition="$authArr['saveIntegralSet'] eq true">
|
||||
<el-button type="primary" size="small" @click="saveIntegralSet('integralForm')">
|
||||
保存设置
|
||||
</el-button>
|
||||
</if>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<script>
|
||||
UE.delEditor('editor');
|
||||
var ue = UE.getEditor('editor');
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var integral_arrive_cash_rate = "{$MerchantConfig['integral_arrive_cash_rate']}";
|
||||
var integral_arrive_cash_data = "{$MerchantConfig['integral_arrive_cash_data']}";
|
||||
var integral_arrive_cash_price = "{$MerchantConfig['integral_arrive_cash_price']}";
|
||||
integral_arrive_cash_rate = integral_arrive_cash_rate ? parseFloat(integral_arrive_cash_rate) : '';
|
||||
integral_arrive_cash_data = integral_arrive_cash_data ? parseFloat(integral_arrive_cash_data) : '';
|
||||
integral_arrive_cash_price = integral_arrive_cash_price ? integral_arrive_cash_price : '';
|
||||
var tabs = new Vue({
|
||||
el: '#tabs',
|
||||
data: function () {
|
||||
return {
|
||||
ruleForm: {
|
||||
signin_give: "{$vipset['signin_give']}",
|
||||
infoscore: "{$vipset['infoscore']}",
|
||||
percent_state: '{$vipset["percent_state"]}' == 1 ? true : false,
|
||||
vip_pay_integral_state: '{$vipset["vip_pay_integral_state"]}' == 1 ? true : false,
|
||||
flower_price: '{$vipset["flower_price"]}',
|
||||
percent: "{$vipset['percent']}",
|
||||
recharge_state: '{$vipset["recharge_state"]}' == 1 ? true : false,
|
||||
goods_integral_state: '{$vipset["goods_integral_state"]}' == 1 ? true : false,
|
||||
recharge_price: "{$vipset['recharge_price']}",
|
||||
recharge_integral: "{$vipset['recharge_integral']}",
|
||||
},
|
||||
rules: {
|
||||
signin_give: [{message: '请输入签到积分', required: false, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^\+?[1-9][0-9]*$/;
|
||||
if (!reg.test(value)) {
|
||||
console.log(value);
|
||||
callback(new Error("签到积分必须是整数"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
if (value < 0) {
|
||||
callback(new Error("签到积分不能小于0"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
infoscore: [{message: '请输入完善资料积分', required: true, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^\+?[1-9][0-9]*$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("完善资料积分必须是整数"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
if (value < 0) {
|
||||
callback(new Error("完善资料积分不能小于0"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
flower_price: [{message: '请输入消费金额', required: false, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
if (!value || !reg.test(value)) {
|
||||
callback(new Error("请输入正确消费金额"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
percent: [{message: '请输入赠送积分', required: false, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^\+?[1-9][0-9]*$/;
|
||||
if (!value || !reg.test(value)) {
|
||||
callback(new Error("请输入正确消费赠送积分"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
recharge_integral: [{message: '请输入充值赠送积分', required: false, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var bg = /^\+?[1-9][0-9]*$/;
|
||||
if (!bg.test(value) || !value) {
|
||||
callback(new Error("请输入正确充值赠送积分"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
recharge_price: [{message: '请输入充值金额', required: false, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
if (!value || !reg.test(value)) {
|
||||
callback(new Error("请输入正确充值金额"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
plusForm: {
|
||||
plus_signin_give: "{$vipset['plus_signin_give']}",
|
||||
plus_infoscore: "{$vipset['plus_infoscore']}",
|
||||
plus_percent_state: '{$vipset["plus_percent_state"]}' == 1 ? true : false,
|
||||
plus_pay_integral_state: '{$vipset["plus_pay_integral_state"]}' == 1 ? true : false,
|
||||
plus_percent: "{$vipset['plus_percent']}",
|
||||
plus_recharge_state: '{$vipset["plus_recharge_state"]}' == 1 ? true : false,
|
||||
plus_recharge_integral: "{$vipset['plus_recharge_integral']}",
|
||||
goods_integral_plus_state: '{$vipset["goods_integral_plus_state"]}' == 1 ? true : false,
|
||||
goods_integral_multiple: "{$vipset['goods_integral_multiple']}",
|
||||
plus_flower_type: "{$vipset['plus_flower_type']}",
|
||||
plus_flower_price: "{$vipset['plus_flower_price']}",
|
||||
plus_flower_percent: "{$vipset['plus_flower_percent']}",
|
||||
plus_recharge_type: "{$vipset['plus_recharge_type']}",
|
||||
plus_recharge_price: "{$vipset['plus_recharge_price']}",
|
||||
plus_recharge_get_integral: "{$vipset['plus_recharge_get_integral']}"
|
||||
},
|
||||
plusRules: {
|
||||
plus_signin_give: [{message: '请输入签到积分', required: false, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^\+?[1-9][0-9]*$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("签到积分必须是整数"));
|
||||
} else if (value <= 0) {
|
||||
callback(new Error("签到积分不能小于0"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
plus_infoscore: [{message: '请输入完善资料积分', required: true, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^\+?[1-9][0-9]*$/;
|
||||
if (!reg.test(value)) {
|
||||
console.log(value);
|
||||
callback(new Error("完善资料积分必须是整数"));
|
||||
} else if (value <= 0) {
|
||||
callback(new Error("完善资料积分不能小于0"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
plus_percent: [{message: '请输入消费赠送积分倍数', required: true, trigger: 'blur'}, {
|
||||
trigger: ['blur', 'change'],
|
||||
validator: function (rule, value, callback) {
|
||||
var bg = /^\+?[1-9][0-9]*$/;
|
||||
if (!bg.test(value)) {
|
||||
callback(new Error("请输入正确消费赠送积分倍数"));
|
||||
} else if (value <= 0) {
|
||||
callback(new Error("请输入正确消费赠送积分倍数"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}],
|
||||
plus_flower_price: [{message: '请输入消费金额', required: true, trigger: 'blur'}, {
|
||||
trigger: ['blur', 'change'],
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
if (!value || !reg.test(value)) {
|
||||
callback(new Error("消费金额有误"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}],
|
||||
plus_flower_percent: [{message: '请输入消费获得积分', required: true, trigger: 'blur'}, {
|
||||
trigger: ['blur'],
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^\+?[1-9][0-9]*$/;
|
||||
if (!value || !reg.test(value)) {
|
||||
callback(new Error("消费获得积分有误"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}],
|
||||
plus_recharge_integral: [{message: '请输入充值赠送积分倍数', required: true, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var bg = /^\+?[1-9][0-9]*$/;
|
||||
if (!bg.test(value)) {
|
||||
callback(new Error("请输入正确充值赠送积分倍数"));
|
||||
} else if (value <= 0) {
|
||||
callback(new Error("请输入正确充值赠送积分倍数"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
goods_integral_multiple: [{message: '请输入倍数', required: true, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^\+?[1-9][0-9]*$/;
|
||||
if (tabs.plusForm.goods_integral_plus_state) {
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("倍数必须是整数"));
|
||||
} else if (value <= 0) {
|
||||
callback(new Error("倍数必须不能小于等于0"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
plus_recharge_price: [{message: '请输入充值金额', required: true, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
if (!value || !reg.test(value)) {
|
||||
callback(new Error("消费金额有误"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
plus_recharge_get_integral: [{message: '请输入充值获得积分', required: true, trigger: 'blur'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^\+?[1-9][0-9]*$/;
|
||||
if (!value || !reg.test(value)) {
|
||||
callback(new Error("充值获得积分有误"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
arriveCashLoading: false,//抵现层loading
|
||||
integral_arrive_cash: "{$MerchantConfig['integral_arrive_cash']}",//积分抵现开启关闭状态,
|
||||
pay_to_vip_state: "{$MerchantConfig['pay_to_vip_state']}",//积分抵现开启关闭状态,
|
||||
marketing_methods: "{$MerchantConfig['marketing_methods']}",
|
||||
integralForm: {
|
||||
integral_arrive_cash_rate: integral_arrive_cash_rate,
|
||||
integral_arrive_cash_data: integral_arrive_cash_data,
|
||||
integral_arrive_cash_price: integral_arrive_cash_price,
|
||||
},
|
||||
integrals: {
|
||||
integral_arrive_cash_rate: [{message: '请输入抵现比例', required: false, trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[+]?\d*\.?\d{0,2}$/;
|
||||
if ((!reg.test(value) || value < 1 || value > 99) && tabs.integral_arrive_cash == 1) {
|
||||
callback(new Error("请输入正确的抵现比例"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
integral_arrive_cash_data: [{message: '请输入积分', required: true, trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^([1-9]\d*|[0]{1,1})$/;
|
||||
console.log(value < 1);
|
||||
if ((reg.test(value) == false || value < 1) && tabs.integral_arrive_cash == 1) {
|
||||
callback(new Error("请输入正确的积分"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
integral_arrive_cash_price: [{message: '请输入金额', required: true, trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
if ((!reg.test(value)) && tabs.integral_arrive_cash == 1) {
|
||||
callback(new Error("请输入正确的金额"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit: function (formName) {
|
||||
var that = this;
|
||||
var details = ue.getContent();
|
||||
var percent_state = that.ruleForm.percent_state ? 1 : 2;
|
||||
var vip_pay_integral_state = that.ruleForm.vip_pay_integral_state ? 1 : 2;
|
||||
var recharge_state = that.ruleForm.recharge_state ? 1 : 2;
|
||||
var goods_integral_state = that.ruleForm.goods_integral_state ? 1 : 2;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
that.$confirm("确定提交", {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "{:U('vipconfigset')}",
|
||||
data: {
|
||||
signin_give: that.ruleForm.signin_give,
|
||||
infoscore: that.ruleForm.infoscore,
|
||||
vip_detail: details,
|
||||
percent_state: percent_state,
|
||||
vip_pay_integral_state: vip_pay_integral_state,
|
||||
flower_price: that.ruleForm.flower_price,
|
||||
percent: that.ruleForm.percent,
|
||||
recharge_state: recharge_state,
|
||||
goods_integral_state: goods_integral_state,
|
||||
recharge_price: that.ruleForm.recharge_price,
|
||||
recharge_integral: that.ruleForm.recharge_integral,
|
||||
},
|
||||
type: 'post',
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message({message: res.msg, type: 'success'});
|
||||
} else {
|
||||
this.$message({message: res.msg, type: 'error'});
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
that.$loading().close();
|
||||
})
|
||||
} else {
|
||||
that.$message({message: '请完善必填项', type: 'error'});
|
||||
}
|
||||
});
|
||||
},
|
||||
//plus 会员保存
|
||||
plus_dosubmit: function (formName) {
|
||||
var that = this;
|
||||
var bg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d{0,6})$/;
|
||||
var plus_percent_state = that.plusForm.plus_percent_state ? 1 : 2;
|
||||
var plus_pay_integral_state = that.plusForm.plus_pay_integral_state ? 1 : 2;
|
||||
var plus_recharge_state = that.plusForm.plus_recharge_state ? 1 : 2;
|
||||
var goods_integral_plus_state = that.plusForm.goods_integral_plus_state ? 1 : 2;
|
||||
console.log(that.plusForm);
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
that.$confirm("确定提交", {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "{:U('plus_vipconfigset')}",
|
||||
data: {
|
||||
plus_signin_give: that.plusForm.plus_signin_give,
|
||||
plus_infoscore: that.plusForm.plus_infoscore,
|
||||
plus_percent_state: plus_percent_state,
|
||||
plus_pay_integral_state: plus_pay_integral_state,
|
||||
plus_flower_type: that.plusForm.plus_flower_type,
|
||||
plus_flower_percent: that.plusForm.plus_flower_percent,
|
||||
plus_flower_price: that.plusForm.plus_flower_price,
|
||||
plus_percent: that.plusForm.plus_percent,
|
||||
plus_recharge_state: plus_recharge_state,
|
||||
plus_recharge_integral: that.plusForm.plus_recharge_integral,
|
||||
plus_recharge_type: that.plusForm.plus_recharge_type,
|
||||
plus_recharge_price: that.plusForm.plus_recharge_price,
|
||||
plus_recharge_get_integral: that.plusForm.plus_recharge_get_integral,
|
||||
goods_integral_plus_state: goods_integral_plus_state,
|
||||
goods_integral_multiple: that.plusForm.goods_integral_multiple,
|
||||
},
|
||||
type: 'post',
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message({message: res.msg, type: 'success'});
|
||||
} else {
|
||||
this.$message({message: res.msg, type: 'error'});
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
that.$loading().close();
|
||||
})
|
||||
} else {
|
||||
that.$message({message: '请完善必填项', type: 'error'});
|
||||
}
|
||||
});
|
||||
},
|
||||
//积分抵现设置
|
||||
saveIntegralSet: function (formName) {
|
||||
//提交数据
|
||||
var that = this;
|
||||
var marketing_methods = that.marketing_methods;
|
||||
if (marketing_methods == 2) {
|
||||
var integralForm = that.integralForm;
|
||||
if (((parseFloat(integralForm.integral_arrive_cash_price) / parseInt(integralForm.integral_arrive_cash_data)).toFixed(12)) != (parseFloat(integralForm.integral_arrive_cash_price) / parseInt(integralForm.integral_arrive_cash_data))) {
|
||||
that.$message({
|
||||
type: "error",
|
||||
message: "金额必须除尽积分",
|
||||
duration: 2000
|
||||
})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
that.arriveCashLoading = true;
|
||||
$.post("{:U('saveIntegralSet')}", {
|
||||
integral_arrive_cash: that.integral_arrive_cash,
|
||||
integral_arrive_cash_rate: that.integralForm.integral_arrive_cash_rate,
|
||||
integral_arrive_cash_data: that.integralForm.integral_arrive_cash_data,
|
||||
integral_arrive_cash_price: that.integralForm.integral_arrive_cash_price,
|
||||
marketing_methods: that.marketing_methods
|
||||
}, function (res) {
|
||||
that.arriveCashLoading = false;
|
||||
if (res.status == 1) {
|
||||
that.$message({type: 'success', message: res.msg, duration: 1000});
|
||||
} else {
|
||||
that.$message({type: 'error', message: res.msg, duration: 3000});
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,412 @@
|
||||
<!--[1.8.26]-->
|
||||
<div id="welfare">
|
||||
<el-collapse accordion>
|
||||
<el-collapse-item>
|
||||
<template slot="title">
|
||||
注册赠送优惠券说明>>></i>
|
||||
</template>
|
||||
<p>1.会员能领取设置开启、有库存且没有失效的所有优惠券各一张</p>
|
||||
<p>2.公众号注册包括直接公众号注册和小程序内部的注册</p>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<el-button style="margin: 10px 0" v-if="operate.setWelfare" type="primary" size="small" @click="add">新建</el-button>
|
||||
|
||||
<div style="width: 100%;">
|
||||
<el-table size="small"
|
||||
:data="list"
|
||||
border :header-cell-style="{background:'#F5F7FA',color:'#606266'}"
|
||||
style="width: calc(100vw - 260px);box-sizing: border-box;">
|
||||
<el-table-column align="center" fixed prop="index" label="序号" width="50px"></el-table-column>
|
||||
<el-table-column prop="coupon_name" label="优惠券名称" min-width="100"></el-table-column>
|
||||
<el-table-column prop="coupon_allnum" label="总库存" min-width="60"></el-table-column>
|
||||
<el-table-column prop="coupon_num" label="剩余" min-width="60"></el-table-column>
|
||||
<el-table-column prop="needmoney" label="优惠门槛"></el-table-column>
|
||||
<el-table-column prop="reducemoney" label="优惠金额"></el-table-column>
|
||||
<el-table-column label="可用门店">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="item in scope.row.storelist">{{item.storetag}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="usetime" label="有效期" min-width="120"></el-table-column>
|
||||
<el-table-column label="公众号注册" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.wx_register"
|
||||
active-value="1"
|
||||
inactive-value="2"
|
||||
:disabled="!operate.changeStatus"
|
||||
@change="changeWx(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="店内注册" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.cashier_register"
|
||||
active-value="1"
|
||||
inactive-value="2"
|
||||
:disabled="!operate.changeStatus"
|
||||
@change="changeStore(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.status"
|
||||
active-value="1"
|
||||
inactive-value="2"
|
||||
:disabled="!operate.changeStatus"
|
||||
@change="changeclose(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="operate.changeStatus"
|
||||
label="操作"
|
||||
width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="del(scope.row.id)" type="text" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="currentPage4"
|
||||
:page-sizes="[10,20, 30, 40]"
|
||||
:page-size="limit"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageCount">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
<el-dialog title="新增福利" :append-to-body="true" :visible.sync="showAdd">
|
||||
<el-form ref="form" :model="addForm" label-width="100px" size="small">
|
||||
<el-form-item label-width="100">
|
||||
<el-button type="primary" size="small" @click="choose">选择优惠券</el-button>
|
||||
</el-form-item>
|
||||
<template v-if="addForm.id">
|
||||
<el-form-item label="优惠券名称">{{addForm.coupon_name}}</el-form-item>
|
||||
<el-form-item label="优惠券库存">{{addForm.coupon_num}}</el-form-item>
|
||||
<el-form-item label="优惠券满减">
|
||||
<span>满</span>{{addForm.needmoney}}
|
||||
<span>减</span>{{addForm.reducemoney}}
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="doAddWelfare">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="提示" :append-to-body="true" :visible.sync="dialogVisible"
|
||||
custom-class='calc-left'
|
||||
width="calc(100% - 160px)" height="calc(100% - 65px)">
|
||||
<el-collapse accordion>
|
||||
<el-collapse-item>
|
||||
<template slot="title">
|
||||
规则>>></i>
|
||||
</template>
|
||||
<p>1.赠送优惠券将不再限制会员等级</p>
|
||||
<p>2.建议选择会员领取后生效的优惠券</p>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<el-button type="primary" size="small" @click="getCheckData">确定</el-button>
|
||||
|
||||
<div>
|
||||
<el-table size="small" :header-cell-style="{background:'#F5F7FA',color:'#606266'}"
|
||||
:data="listShow"
|
||||
border
|
||||
ref="multipleTable"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column type="index" label="序号"></el-table-column>
|
||||
<el-table-column prop="coupon_name" label="优惠券名称" width="120"></el-table-column>
|
||||
<el-table-column prop="coupon_allnum" label="总库存" width="120"></el-table-column>
|
||||
<el-table-column prop="coupon_num" label="剩余" width="120"></el-table-column>
|
||||
<el-table-column prop="needmoney" label="满"></el-table-column>
|
||||
<el-table-column prop="reducemoney" label="减"></el-table-column>
|
||||
<el-table-column label="可用门店">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="item in scope.row.storelist">{{item.storetag}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="usetime" label="有效期" min-width="180"></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"
|
||||
:current-page="currentPage41"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="limit1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageCount1">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
var welfare = new Vue({
|
||||
el: '#welfare',
|
||||
data: {
|
||||
pageCount: 0,
|
||||
limit: 10,
|
||||
currentPage4: 1,
|
||||
pageCount1: 0,
|
||||
limit1: 10,
|
||||
currentPage41: 1,
|
||||
list: [],
|
||||
listShow: [],
|
||||
addForm: {
|
||||
name: ''
|
||||
},
|
||||
showAdd: false,
|
||||
dialogVisible: false,
|
||||
checkVal: [],
|
||||
operate: {},
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange: function (val) {
|
||||
this.limit = val;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange: function (val) {
|
||||
this.currentPage4 = val;
|
||||
this.getData();
|
||||
},
|
||||
handleSizeChange1: function (val) {
|
||||
this.limit1 = val;
|
||||
this.getDataShow();
|
||||
},
|
||||
handleCurrentChange1: function (val) {
|
||||
this.currentPage41 = val;
|
||||
this.getDataShow();
|
||||
},
|
||||
getData: function () {
|
||||
var that = this;
|
||||
$.ajax({
|
||||
url: "{:U('getWelfare')}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
page: that.currentPage4,
|
||||
limit: that.limit,
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
that.list = res.data;
|
||||
that.pageCount = res.count;
|
||||
} else {
|
||||
that.$message({
|
||||
type: 'error',
|
||||
message: '获取信息失败',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getDataShow: function () {
|
||||
var that = this;
|
||||
$.ajax({
|
||||
url: "{:U('getCanUseMCoupon')}",
|
||||
type: 'GET',
|
||||
data: {
|
||||
page: that.currentPage41,
|
||||
limit: that.limit1,
|
||||
},
|
||||
success: function (res) {
|
||||
|
||||
if (res.code == 0) {
|
||||
that.listShow = res.data;
|
||||
that.pageCount1 = res.count;
|
||||
} else {
|
||||
that.$message({
|
||||
type: 'error',
|
||||
message: '获取信息失败',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
add: function () {
|
||||
this.showAdd = !this.showAdd;
|
||||
},
|
||||
choose: function () {
|
||||
this.dialogVisible = !this.dialogVisible;
|
||||
this.getDataShow();
|
||||
},
|
||||
handleSelectionChange: function (val) {
|
||||
this.checkVal = val;
|
||||
},
|
||||
getCheckData: function () {
|
||||
if (this.checkVal.length > 0) {
|
||||
this.dialogVisible = false;
|
||||
this.addForm = this.checkVal[0];
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择优惠券',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
doAddWelfare: function () {
|
||||
var that = this;
|
||||
if (!that.addForm.id) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择优惠券',
|
||||
duration: 1000,
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm("确定添加这张优惠券为新会员福利", {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "{:U('setWelfare')}",
|
||||
data: {
|
||||
id: that.addForm.id,
|
||||
},
|
||||
type: 'post',
|
||||
success: function (res) {
|
||||
if (res.status == 1) {
|
||||
that.showAdd = false;
|
||||
that.addForm = {};
|
||||
that.getData();
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '添加失败',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
del: function (id) {
|
||||
var that = this;
|
||||
this.$confirm("确定要删除", {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "{:U('changestatus')}",
|
||||
data: {
|
||||
id: id,
|
||||
status: 3,
|
||||
field: 'status'
|
||||
},
|
||||
type: 'post',
|
||||
success: function (res) {
|
||||
if (res.status == 1) {
|
||||
that.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
duration: 1000,
|
||||
});
|
||||
that.getData();
|
||||
} else {
|
||||
that.$message({
|
||||
type: 'error',
|
||||
message: res.msg,
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
changeWx: function (item) {
|
||||
this.$confirm("确定要修改公众号状态", {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "{:U('changestatus')}",
|
||||
data: {
|
||||
id: item.id,
|
||||
status: item.wx_register == 1 ? 1 : 2,
|
||||
field: 'wx_register'
|
||||
},
|
||||
type: 'post',
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.msg);
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
item.wx_register = item.wx_register == 1 ? '2' : '1'
|
||||
})
|
||||
},
|
||||
changeStore: function (item) {
|
||||
var that = this;
|
||||
this.$confirm("确定要修改店内注册状态", {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "{:U('changestatus')}",
|
||||
data: {
|
||||
id: item.id,
|
||||
status: item.cashier_register == 1 ? 1 : 2,
|
||||
field: 'cashier_register'
|
||||
},
|
||||
type: 'post',
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.msg);
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
item.cashier_register = item.cashier_register == 1 ? '2' : '1'
|
||||
})
|
||||
},
|
||||
changeclose: function (item) {
|
||||
var that = this;
|
||||
this.$confirm("确定要修改状态?", {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
$.ajax({
|
||||
url: "{:U('changestatus')}",
|
||||
data: {
|
||||
id: item.id,
|
||||
status: item.status == 1 ? 1 : 2,
|
||||
field: 'status'
|
||||
},
|
||||
type: 'post',
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.msg);
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
item.status = item.status == 1 ? '2' : '1'
|
||||
})
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.getData();
|
||||
this.checkOperateAuth({
|
||||
setWelfare: '/index.php/Retail/Vipconfig/setWelfare',
|
||||
changeStatus: '/index.php/Retail/Vipconfig/changestatus',
|
||||
}, (data) => {
|
||||
this.operate = data;
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
在新工单中引用
屏蔽一个用户