mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-20 01:45:53 +08:00
commit message
This commit is contained in:
103
manager/src/views/sys/setting-manage/pay/ALIPAY_PAYMENT.vue
Normal file
103
manager/src/views/sys/setting-manage/pay/ALIPAY_PAYMENT.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="160" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<FormItem label="appId" prop="appId">
|
||||
<Input class="w200" v-model="formValidate.appId" />
|
||||
</FormItem>
|
||||
<FormItem label="certPath" prop="certPath">
|
||||
<Input v-model="formValidate.certPath" />
|
||||
</FormItem>
|
||||
<FormItem label="alipayPublicCertPath" prop="alipayPublicCertPath">
|
||||
<Input v-model="formValidate.alipayPublicCertPath" />
|
||||
</FormItem>
|
||||
<FormItem label="privateKey" class="label-item" prop="privateKey">
|
||||
<Input v-model="formValidate.privateKey" />
|
||||
</FormItem>
|
||||
<FormItem label="rootCertPath" prop="rootCertPath">
|
||||
<Input v-model="formValidate.rootCertPath" />
|
||||
</FormItem>
|
||||
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "../setting/validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleValidate: {},
|
||||
formValidate: {
|
||||
accessKeyId: "",
|
||||
accessKeySecret: "",
|
||||
bucketName: "",
|
||||
picLocation: "",
|
||||
endPoint: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
props: ["res", "type"],
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if (handleSubmit(that, name)) {
|
||||
this.setupSetting();
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
Object.keys(this.formValidate).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
];
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../setting/style.scss";
|
||||
|
||||
.label-item {
|
||||
display: flex;
|
||||
}
|
||||
.w200 {
|
||||
/deep/ .ivu-input {
|
||||
width: 250px !important;
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
/deep/ .ivu-input {
|
||||
width: 450px !important;
|
||||
margin: 0 10px;
|
||||
}
|
||||
.ivu-input-wrapper {
|
||||
width: 450px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
189
manager/src/views/sys/setting-manage/pay/PAYMENT_SUPPORT.vue
Normal file
189
manager/src/views/sys/setting-manage/pay/PAYMENT_SUPPORT.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div class="row" v-for="(client,clientIndex) in supportForm.clients" :key="clientIndex">
|
||||
|
||||
<div class="col" v-if="client ==item.client" v-for="(item,index) in formValidate" :key="index">
|
||||
<Card :padding="0">
|
||||
<div>
|
||||
|
||||
<!-- app -->
|
||||
<div class="icon-item" v-if="client ==item.client &&item.client== 'APP'">
|
||||
<img class="icon" src="../../../../assets/setting/app.svg" alt="" srcset="">
|
||||
</div>
|
||||
<div class="icon-item" v-if=" client ==item.client && item.client== 'PC'">
|
||||
<!-- pc -->
|
||||
<img class="icon" src="../../../../assets/setting/pc.svg" alt="" srcset="">
|
||||
|
||||
</div>
|
||||
<div class="icon-item" v-if=" client ==item.client && item.client== 'WECHAT_MP'">
|
||||
<!-- 小程序 -->
|
||||
|
||||
<img class="icon" src="../../../../assets/setting/wechat_mp.svg" alt="" srcset="">
|
||||
</div>
|
||||
|
||||
<div class="icon-item" v-if=" client ==item.client && item.client== 'H5'">
|
||||
<!-- h5 -->
|
||||
|
||||
<img class="icon" src="../../../../assets/setting/h5.svg" alt="" srcset="">
|
||||
</div>
|
||||
<div class='pay-title' v-if=" client ==item.client "> {{way[item.client]}}</div>
|
||||
|
||||
<div v-if=" client ==item.client ">
|
||||
<Divider orientation="left">支付设置</Divider>
|
||||
|
||||
<div class="pay-list">
|
||||
<CheckboxGroup @on-change="handleChangePayType" v-model="item.supports">
|
||||
|
||||
<Checkbox v-for="(support,i) in supportForm.payments" :key="i" :label="support">
|
||||
|
||||
{{payWay[support] || support}}
|
||||
|
||||
</Checkbox>
|
||||
</CheckboxGroup>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "../setting/validate";
|
||||
import { getPaymentSupportForm } from "@/api/setting";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleValidate: {},
|
||||
way: {
|
||||
APP: "移动应用端",
|
||||
H5: "移动端",
|
||||
WECHAT_MP: "小程序端",
|
||||
PC: "PC端",
|
||||
},
|
||||
formValidate: {},
|
||||
pay: "",
|
||||
// key obj
|
||||
payWay: {
|
||||
ALIPAY: "支付宝支付",
|
||||
WECHAT: "微信支付",
|
||||
WALLET: "余额支付",
|
||||
},
|
||||
supportForm: "",
|
||||
};
|
||||
},
|
||||
props: ["res", "type"],
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if (handleSubmit(that, name)) {
|
||||
this.setupSetting();
|
||||
}
|
||||
},
|
||||
|
||||
handleChangePayType(val) {
|
||||
this.$Modal.confirm({
|
||||
title: "修改支付设置",
|
||||
content: "您是否修改此项?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
this.setupSetting();
|
||||
},
|
||||
onCancel: () => {
|
||||
val.splice(val.length - 1, 1);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, { paymentSupportItems: this.formValidate }).then(
|
||||
(res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
this.$Modal.remove();
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
this.$Modal.remove();
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
// 实例化数据
|
||||
async init() {
|
||||
this.formValidate = JSON.parse(this.res).paymentSupportItems;
|
||||
|
||||
console.log(this.formValidate);
|
||||
|
||||
await getPaymentSupportForm().then((res) => {
|
||||
// res.result.payments = ["H5", "PC"];
|
||||
this.supportForm = res.result;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../setting/style.scss";
|
||||
.pay-title {
|
||||
text-align: center;
|
||||
margin: 10px 0;
|
||||
}
|
||||
.layout {
|
||||
padding: 20px;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.row {
|
||||
width: 300px;
|
||||
margin-right: 20px;
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
/deep/ .ivu-card-body {
|
||||
padding: 0 16px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.label-item {
|
||||
display: flex;
|
||||
}
|
||||
.label-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.pay-list {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.icon-item {
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.ivu-form-item {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
.ivu-row {
|
||||
width: 100%;
|
||||
}
|
||||
.icon {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
109
manager/src/views/sys/setting-manage/pay/WECHAT_PAYMENT.vue
Normal file
109
manager/src/views/sys/setting-manage/pay/WECHAT_PAYMENT.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<FormItem label="appId" prop="appId">
|
||||
<Input class="w200" v-model="formValidate.appId" />
|
||||
</FormItem>
|
||||
<FormItem label="mchId" prop="mchId">
|
||||
<Input class="w200" v-model="formValidate.mchId" />
|
||||
</FormItem>
|
||||
<FormItem label="apiKey3" prop="apiKey3">
|
||||
<Input v-model="formValidate.apiKey3" />
|
||||
</FormItem>
|
||||
<FormItem label="apiclient_cert_p12" class="label-item" prop="apiclient_cert_p12">
|
||||
<Input v-model="formValidate.apiclient_cert_p12" />
|
||||
</FormItem>
|
||||
<FormItem label="apiclient_cert_pem" prop="apiclient_cert_pem">
|
||||
<Input v-model="formValidate.apiclient_cert_pem" />
|
||||
</FormItem>
|
||||
<FormItem label="apiclient_key" prop="apiclient_key">
|
||||
<Input v-model="formValidate.apiclient_key" />
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="serialNumber" prop="serialNumber">
|
||||
<Input v-model="formValidate.serialNumber" />
|
||||
</FormItem>
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "../setting/validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleValidate: {},
|
||||
formValidate: {
|
||||
accessKeyId: "",
|
||||
accessKeySecret: "",
|
||||
bucketName: "",
|
||||
picLocation: "",
|
||||
endPoint: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
props: ["res", "type"],
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if (handleSubmit(that, name)) {
|
||||
this.setupSetting();
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
Object.keys(this.formValidate).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
];
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../setting/style.scss";
|
||||
|
||||
.label-item {
|
||||
display: flex;
|
||||
}
|
||||
.w200 {
|
||||
/deep/ .ivu-input {
|
||||
width: 250px !important;
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
/deep/ .ivu-input {
|
||||
width: 450px !important;
|
||||
margin: 0 10px;
|
||||
}
|
||||
.ivu-input-wrapper {
|
||||
width: 450px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user