| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <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="basic" size="small" ref="ruleForm" label-width="135px">
- <!-- :rules="rules" -->
- <el-tabs v-model="activeName" type="card">
- <el-tab-pane label="快捷支付设置" name="basic">
- <el-row>
- <el-col :span="24">
- <div class="title"> </div>
- <div class="form-body">
- <el-form-item label="启用快捷支付" prop="joinpay_fast_pay_status">
- <el-switch v-model="basic.joinpay_fast_pay_status" :active-value="1" :inactive-value="0"></el-switch>
- </el-form-item>
- <el-form-item label="汇聚快捷支付私钥" prop="joinpay_fast_pay_private_key">
- <el-input v-model="basic.joinpay_fast_pay_private_key" type="textarea" :rows="5"></el-input>
- </el-form-item>
- <el-form-item label="汇聚快捷支付公钥" prop="joinpay_fast_pay_public_key">
- <el-input v-model="basic.joinpay_fast_pay_public_key" type="textarea" :rows="5"></el-input>
- </el-form-item>
- </div>
- </el-col>
- </el-row>
- </el-tab-pane>
- </el-tabs>
- <div style="border-top: 1px solid #dad9d9;">
- <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 10px;" @click="store('ruleForm')" size="small">保存
- </el-button>
- </div>
- </el-form>
- </el-card>
- </template>
- </div>
- <!-- 这个是复制用的容器,已隐藏 -->
- <textarea id="inputs" style="opacity: 0;width: 0;height: 0;">复制内容</textarea>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- activeName: 'basic',
- loading: false,
- btnLoading: false,
- basic: {
- joinpay_fast_pay_status: 0,
- joinpay_fast_pay_private_key: '',
- joinpay_fast_pay_public_key: '',
- },
- }
- },
- mounted: function() {
- this.loadData();
- },
- methods: {
- // 获取基础设置详情
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'join-pay/default/basic-setting',
- group: 'fastpay',
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- if (e.data.data.settings) {
- this.basic = e.data.data.settings;
- }
- } else {
- this.$message.error(e.data.msg)
- }
- }).catch(e => {
- this.loading = false;
- this.$message.error(e);
- })
- },
- store(formName) {
- if (this.basic.joinpay_fast_pay_status == 1) {
- if (!this.basic.joinpay_fast_pay_private_key || !this.basic.joinpay_fast_pay_public_key) {
- return this.$message.error('请完善汇聚快捷支付配置');
- }
- }
- this.btnLoading = true;
- request({
- params: {
- r: 'join-pay/default/basic-setting',
- },
- method: 'post',
- data: {
- group: 'fastpay',
- fastpay: this.basic,
- }
- }).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;
- this.$message.error(e);
- })
- },
- }
- });
- </script>
- <style>
- .form_box {
- background-color: #f3f3f3;
- padding: 0 0 20px;
- }
- .button-item {
- margin-top: 12px;
- padding: 9px 25px;
- }
- .el-input-group__append {
- background-color: #fff;
- color: #353535;
- }
- .el-form-item {
- margin-bottom: 25px !important;
- }
- </style>
|