canyin-project/ybcy/views/admin/apply/payment_add.php
2024-11-01 16:07:54 +08:00

258 lines
9.8 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<?php if ($this->params['site_image']): ?>
<link rel="shortcut icon" type="image/x-icon" href="<? $this->params['site_image'] ?>"/>
<?php else: ?>
<link rel="shortcut icon" type="image/x-icon" href="<?= Yii::$app->request->baseUrl ?>/web/favicon.ico"/>
<?php endif; ?>
<title>
<?php if ($this->params['site_title']): ?>
<?php echo $this->params['site_title']; ?>
<?php else: ?>
应用管理后台
<?php endif; ?>-添加支付通道
</title>
<link rel="stylesheet" type="text/css" href="<?= Yii::$app->request->baseUrl ?>/web/static/css/globle.css"/>
<script src="<?= Yii::$app->request->baseUrl ?>/web/static/js/config.js" type="text/javascript"
charset="utf-8"></script>
</head>
<style>
.imgbox {
width: 100px;
height: 100px;
}
.checkbox .el-checkbox {
border: 1px solid #F3F6FB;
position: relative;
width: 100px;
height: 100px;
}
.checklabel-zjtd {
left: 0px;
}
.checkbox .el-checkbox .el-checkbox__input {
position: absolute;
bottom: 5px;
left: 42px;
}
.channel-icon img {
width: 32px;
height: 32px;
}
.namelogo {
width: 54px;
height: 54px;
border-radius: 50%;
}
.hed-right .el-button {
height: 38px;
}
.hed-right .btn-jrpt {
width: 130px;
}
.hed-right .btn-ty {
width: 104px;
}
.mar_t3 {
margin-top: 3px;
}
.avatar-uploader .el-upload {
width: 100px;
height: 100px;
line-height: 100px;
}
.el-icon-plus:before {
font-size: 20px;
}
</style>
<body>
<div class="pHead">
<div class="publicHeader">
<?php echo $this->render('@app/views/admin/public/publicHeader.html'); ?>
</div>
</div>
<div class="pLeft">
<div class="publicAside hei">
<?php echo $this->render('@app/views/admin/public/publicAside.html'); ?>
</div>
</div>
<!--<div class="upimg">-->
<!-- <div class="attachment hei">-->
<?php //echo $this->render('@app/views/admin/public/attachment-img.html'); ?>
<!--</div>-->
<!--</div>-->
<div class="yb_body">
<div class="layout" id="paymentList" v-cloak>
<el-container>
<el-container>
<el-main>
<div class="main" style="min-width: 800px">
<div class="ba_f">
<div class="main-tab ba_f bor_rad5 pad_tb_30">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="支付通道信息" name="msg">支付通道信息</el-tab-pane>
</el-tabs>
</div>
<div class="main-con pad_tb_30" id="pay_channel">
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left"><span class="color_red">*</span>支付通道名称
</div>
<div class="flex-grow-1 t_l right-width">
<el-input v-model="formInline.channel_name" placeholder="支付通道名称"
class="elinput"></el-input>
</div>
</div>
<div class="flex-bet wid pad_tb_20">
<div class="flex-grow-0 t_r pad_r_25 right-left"><span class="color_red">*</span>支付通道状态
</div>
<div class="flex-grow-1 t_l right-width">
<el-radio-group v-model="formInline.status">
<el-radio label="1" value='1'>启用
</el-radio>
<el-radio label="2" value='2'>停用
</el-radio>
</el-radio-group>
</div>
</div>
<!-- <div class="flex-bet wid pad_tb_20">-->
<!-- <div class="flex-grow-0 t_r pad_r_25 right-left"></div>-->
<!-- <div class="flex-grow-1 t_l right-width">-->
<!-- <el-button type="primary" class="tijiao" @click="bindStoreAdd">添加绑定店铺-->
<!-- </el-button>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="flex-bet wid pad_tb_20" >-->
<!-- <div class="flex-grow-0 t_r pad_r_25 right-left">绑定店铺</div>-->
<!-- <div class="flex-grow-1 t_l right-width">-->
<!-- <label for="select1">选择店铺:</label>-->
<!-- <select id="select1" v-model="select1" class="elinput el-input el-input__inner" style="width: 80%;">-->
<!-- <option value="">请选择</option>-->
<!-- <option v-for="(item, index) in store_data" :value="item.store_id">-->
<!-- 平台名称:{{item.apply_name}} - 店铺名称:{{ item.store_name }}-->
<!-- </option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="flex-bet wid pad_tb_20" >-->
<!-- <div class="flex-grow-0 t_r pad_r_25 right-left">绑定店铺</div>-->
<!-- <input type="hidden" name="store_id" id="select_store" :value="store_id">-->
<!-- <div class="flex-grow-1 t_l right-width">-->
<!-- <el-select v-model="store_id" multiple placeholder="请选择">-->
<!-- <el-option v-for="item in store_data" :label="item.store_name" :value="item.store_id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="ba_f mar_t20 pad_30 main-button">
<el-button type="primary" class="tijiao" @click="onSubmit">保存</el-button>
</div>
</div>
</el-main>
</el-container>
</el-container>
</div>
</div>
<script>
new Vue({
el: '#paymentList',
created() {
_this = this;
this.init();
},
data: function () {
return {
cardLoading: true,
activeName: 'msg',
id: '',
formInline: {
channel_name: '',
status: '1',
},
store_id: '',
select1: '',
select2: '',
select2Options: [],
apply_data: [],
store_data: [],
}
},
methods: {
async init() {
this.getapplylist()
},
//获取平台、店铺列表
async getapplylist() {
res = await utils.requestPost({
data: {'name': 'channel'},
url: "admin/apply/get-apply-store-info"
}, this)
if (res.code == 1) {
this.apply_data = res.data.apply_data ? res.data.apply_data : [];
this.store_data = res.data.store_data ? res.data.store_data : [];
}
},
handleClick(tab, event) {
if (tab.name == 'msg') {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_add');?>";
}
},
//提交数据
async onSubmit() {
const formdata = new FormData()
if (this.formInline.channel_name == '') {
this.$message.error('请输入支付通道名称')
return
}
formInline = this.formInline;
var requstData = {
channel_name: formInline.channel_name,
status: formInline.status,
// apply_id: $("#select1").val(),
store_id: $("#select_store").val(),
}
res = await utils.requestPost({
data: requstData,
url: "admin/apply/payment_add"
}, this)
if (res.code == 1) {
localStorage.setItem('payment_add', res.data);
this.$message({
type: 'success',
message: '操作成功!',
duration: 1000,
onClose: () => {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_payment');?>";
},
});
}
},
}
})
</script>
</body>
</html>