文件
mashangyoujiu/Application/Admin/View/Agent/pay_pattern.html

108 行
4.3 KiB
HTML
可执行文件

<!--[1.9.5]-->
<style>
#payPattern .el-card__header {
padding: 10px;
}
</style>
<div class="layui-fluid" v-cloak style="padding: 10px;background-color:#f2f2f2;" id="payPattern">
<el-row :gutter="10">
<template v-for="(item,index) in pay_list">
<el-col :span="6">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span v-text="item.name"></span>
</div>
<div>
<el-switch :disabled="update_status==1?false:true"
v-model="item.status"
:active-text="item.status?'开启':'关闭'"
@change="changeStatus(item.key,item.status?1:0,index)">
</el-switch>
</div>
</el-card>
</el-col>
</template>
<el-col :span="6">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span>配置自己的服务商</span>
</div>
<div>
<el-switch :disabled="update_status==1?false:true"
v-model="set_server_pay"
:active-text="set_server_pay?'开启':'关闭'"
@change="changeServerStatus()">
</el-switch>
</div>
</el-card>
</el-col>
</el-row>
</div>
<script type="text/javascript">
var payPattern = new Vue({
el: '#payPattern',
data: function () {
return {
update_status: "{$authArr['update_status']}",
pay_list: {$pay_list},
pay_id: {$pay_id},
set_server_pay: "{$set_server_pay}" == 1 ? true : false,
agent_id: "{$agent_id}",
}
},
methods: {
changeStatus: function (key, status, index) {
var that = this;
$.ajax({
url: "{:U('update_status')}",
type: "POST",
data: {
id: this.pay_id,
key: key,
status: status
},
success: function (res) {
if (res.status == 1) {
that.$message({message: res.msg, type: 'success', duration: 1000});
} else {
that.$message({message: res.msg, type: 'error', duration: 1000});
var pay_list = JSON.parse(JSON.stringify(this.pay_list));
pay_list[index].status = status ? false : true;
that.pay_list = [];
that.pay_list = pay_list;
}
}
})
},
changeServerStatus: function () {
var that = this;
that.$confirm("操作该功能需谨慎,请与代理商和商户确认好再做修改,否则该代理商下使用服务商支付模式的商户使用微信支付宝支付时将会受到影响", "确认修改?", {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'info'
}).then(() => {
$.ajax({
url: "{:U('updateServerStatus')}",
type: "POST",
data: {
set_server_pay: that.set_server_pay ? 1 : 0,
agent_id: that.agent_id,
},
success: function (res) {
if (res.status == 1) {
that.$message({message: res.msg, type: 'success', duration: 1000});
} else {
that.$message({message: res.msg, type: 'error', duration: 1000});
that.set_server_pay = !that.set_server_pay;
}
}
})
}).catch(() => {
})
}
}
})
</script>