commit message

This commit is contained in:
Chopper
2021-05-13 10:56:04 +08:00
commit ec3e958037
728 changed files with 132685 additions and 0 deletions

View File

@@ -0,0 +1,180 @@
<template>
<div class="layout">
<div class="row" v-if="client ==item.client" v-for="(item,index) in formValidate" :key="index">
<div class="col">
<Card :padding="0">
<!-- app -->
<div class="icon-item" v-if="item.clientType== 'APP'">
<img class="icon" src="../../../../assets/setting/app.svg" alt="" srcset="">
</div>
<div class="icon-item" v-if="item.clientType== 'PC'">
<!-- pc -->
<img class="icon" src="../../../../assets/setting/pc.svg" alt="" srcset="">
</div>
<div class="icon-item" v-if="item.clientType== 'WECHAT_MP'">
<!-- 小程序 -->
<img class="icon" src="../../../../assets/setting/wechat_mp.svg" alt="" srcset="">
</div>
<div class="icon-item" v-if=" item.clientType== 'H5'">
<!-- h5 -->
<img class="icon" src="../../../../assets/setting/h5.svg" alt="" srcset="">
</div>
<div class='pay-title'> {{way[item.clientType]}}</div>
<div>
<Divider orientation="left">登录设置</Divider>
<div class="pay-list">
<Form style="width:100%;" ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="appId" prop="appId">
<Input @on-enter="setupSetting" class="label-appkey" v-model="item.appId" />
</FormItem>
<FormItem label="appKey" prop="appKey">
<Input @on-enter="setupSetting" v-model="item.appKey" />
</FormItem>
</Form>
<Button @click="setupSetting">保存设置</Button>
</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: "",
};
},
props: ["res", "type"],
created() {
this.init();
},
methods: {
submit(name) {
let that = this;
if (handleSubmit(that, name)) {
this.setupSetting();
}
},
setupSetting() {
this.$Spin.show();
setTimeout(() => {
this.$Spin.hide();
setSetting(this.type, {
qqConnectSettingItemList: this.formValidate,
}).then((res) => {
if (res.code == 200) {
this.$Message.success("保存成功!");
this.$Modal.remove();
} else {
this.$Message.error("保存失败!");
this.$Modal.remove();
}
});
}, 3000);
},
// 实例化数据
async init() {
this.formValidate = JSON.parse(this.res).qqConnectSettingItemList;
Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [
{
required: true,
message: "请填写必填项",
trigger: "blur",
},
];
});
},
},
};
</script>
<style lang="scss" scoped>
@import "../setting/style.scss";
.pay-title {
text-align: center;
margin: 10px 0;
}
.col {
width: 100%;
}
.layout {
padding: 20px;
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: flex-start;
}
.row {
width: 350px;
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;
flex-direction: column;
align-items: center;
/deep/ .ivu-btn {
width: 100px;
}
}
.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>

View File

@@ -0,0 +1,178 @@
<template>
<div class="layout">
<div class="row" v-if="client ==item.client" v-for="(item,index) in formValidate" :key="index">
<div class="col">
<Card :padding="0">
<!-- app -->
<div class="icon-item" v-if="item.clientType== 'APP'">
<img class="icon" src="../../../../assets/setting/app.svg" alt="" srcset="">
</div>
<div class="icon-item" v-if="item.clientType== 'PC'">
<!-- pc -->
<img class="icon" src="../../../../assets/setting/pc.svg" alt="" srcset="">
</div>
<div class="icon-item" v-if="item.clientType== 'WECHAT_MP'">
<!-- 小程序 -->
<img class="icon" src="../../../../assets/setting/wechat_mp.svg" alt="" srcset="">
</div>
<div class="icon-item" v-if=" item.clientType== 'H5'">
<!-- h5 -->
<img class="icon" src="../../../../assets/setting/h5.svg" alt="" srcset="">
</div>
<div class='pay-title'> {{way[item.clientType]}}</div>
<div>
<Divider orientation="left">登录设置</Divider>
<div class="pay-list">
<Form style="width:100%;" ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="appId" prop="appId">
<Input @on-enter="setupSetting" class="label-appkey" v-model="item.appId" />
</FormItem>
<FormItem label="appSecret" prop="appSecret">
<Input @on-enter="setupSetting" v-model="item.appSecret" />
</FormItem>
</Form>
<Button @click="setupSetting">保存设置</Button>
</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: "",
};
},
props: ["res", "type"],
created() {
this.init();
},
methods: {
submit(name) {
let that = this;
if (handleSubmit(that, name)) {
this.setupSetting();
}
},
setupSetting() {
this.$Spin.show();
setTimeout(() => {
this.$Spin.hide();
setSetting(this.type, {
wechatConnectSettingItems: this.formValidate,
}).then((res) => {
if (res.code == 200) {
this.$Message.success("保存成功!");
this.$Modal.remove();
} else {
this.$Message.error("保存失败!");
this.$Modal.remove();
}
});
}, 3000);
},
// 实例化数据
async init() {
this.formValidate = JSON.parse(this.res).wechatConnectSettingItems;
Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [
{
required: true,
message: "请填写必填项",
trigger: "blur",
},
];
});
},
},
};
</script>
<style lang="scss" scoped>
@import "../setting/style.scss";
.pay-title {
text-align: center;
margin: 10px 0;
}
.col {
width: 100%;
}
.layout {
padding: 20px;
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: flex-start;
}
.row {
width: 350px;
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;
flex-direction: column;
align-items: center;
/deep/ .ivu-btn {
width: 100px;
}
}
.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>

View 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>

View 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>

View 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>

View File

@@ -0,0 +1,766 @@
<template>
<div>
<Card>
<Tabs v-model="tabName" :animated="false" style="overflow: visible">
<TabPane label="基础设置" name="base">
<div style="display:flex;position:relative">
<Form
ref="baseForm"
:model="base"
:label-width="140"
label-position="right"
:rules="baseValidate"
>
<FormItem label="网站名称" prop="siteName">
<Input type="text" v-model="base.siteName" placeholder="请输入网站名称" style="width: 350px"/>
</FormItem>
<FormItem label="ICP证书号" prop="icp">
<Input type="text" v-model="base.icp" placeholder="请输入ICP证书号"
style="width: 350px"/>
</FormItem>
<FormItem label="Logo" prop="logo">
<upload-pic-input v-model="base.logo" style="width: 350px"></upload-pic-input>
</FormItem>
<FormItem label="商家中心Logo" prop="sellerLogo">
<upload-pic-input v-model="base.sellerLogo" style="width: 350px"></upload-pic-input>
</FormItem>
<FormItem>
<Button type="primary" style="width: 100px;margin-right:5px" :loading="saveLoading"
@click="saveBase">保存
</Button>
</FormItem>
</Form>
<Spin fix v-if="loading"></Spin>
</div>
</TabPane>
<TabPane label="积分设置" name="point">
<div style="display:flex;position:relative">
<Form
ref="pointForm"
:model="point"
:label-width="140"
label-position="right"
:rules="pointValidate"
>
<FormItem label="注册" prop="register">
<Input type="text" v-model="point.register" placeholder="请输入注册赠送积分"
style="width: 350px"/>
</FormItem>
<FormItem label="登陆" prop="login">
<Input type="text" v-model="point.login" placeholder="请输入登陆赠送积分"
style="width: 350px"/>
</FormItem>
<FormItem label="消费一元" prop="money">
<Input type="text" v-model="point.money" placeholder="请输入积分"
style="width: 350px"/>
</FormItem>
<FormItem>
<Button type="primary" style="width: 100px;margin-right:5px" :loading="saveLoading"
@click="savePoint">保存
</Button>
</FormItem>
</Form>
<Spin fix v-if="loading"></Spin>
</div>
</TabPane>
<TabPane label="订单设置" name="order">
<div style="display:flex;position:relative">
<Form
ref="orderForm"
:model="order"
:label-width="140"
label-position="right"
:rules="orderValidate"
>
<FormItem label="自动取消 分钟" prop="autoCancel">
<Input type="text" v-model="order.autoCancel" placeholder="请输入自动取消分钟"
style="width: 350px"/>
</FormItem>
<FormItem label="自动收货 天" prop="autoReceive">
<Input type="text" v-model="order.autoReceive" placeholder="请输入自动收货天数"
style="width: 350px"/>
</FormItem>
<FormItem label="自动收货 天" prop="autoComplete">
<Input type="text" v-model="order.autoComplete" placeholder="请输入自动完成天数"
style="width: 350px"/>
</FormItem>
<FormItem>
<Button type="primary" style="width: 100px;margin-right:5px" :loading="saveLoading"
@click="saveOrder">保存
</Button>
</FormItem>
</Form>
<Spin fix v-if="loading"></Spin>
</div>
</TabPane>
<TabPane label="商品设置" name="goods">
<div style="display:flex;position:relative">
<Form
ref="goodsForm"
:model="goods"
:label-width="140"
label-position="right"
:rules="goodsValidate"
>
<FormItem label="是否开启商品审核" prop="goodsCheck">
<RadioGroup v-model="goods.goodsCheck">
<Radio label="OPEN">开启</Radio>
<Radio label="CLOSE">关闭</Radio>
</RadioGroup>
</FormItem>
<FormItem label="商品页面小图宽度" prop="smallPictureWidth">
<Input type="text" v-model="goods.smallPictureWidth" placeholder="商品页面小图宽度"
style="width: 350px"/>
</FormItem>
<FormItem label="商品页面小图高度" prop="smallPictureHeight">
<Input type="text" v-model="goods.smallPictureHeight" placeholder="商品页面小图高度"
style="width: 350px"/>
</FormItem>
<FormItem label="缩略图宽度" prop="abbreviationPictureWidth">
<Input type="text" v-model="goods.abbreviationPictureWidth" placeholder="缩略图宽度"
style="width: 350px"/>
</FormItem>
<FormItem label="缩略图高度" prop="abbreviationPictureHeight">
<Input type="text" v-model="goods.abbreviationPictureHeight" placeholder="缩略图高度"
style="width: 350px"/>
</FormItem>
<FormItem label="原图宽" prop="originalPictureWidth">
<Input type="text" v-model="goods.originalPictureWidth" placeholder="原图宽"
style="width: 350px"/>
</FormItem>
<FormItem label="原图高" prop="originalPictureHeight">
<Input type="text" v-model="goods.originalPictureHeight" placeholder="原图高"
style="width: 350px"/>
</FormItem>
<FormItem>
<Button type="primary" style="width: 100px;margin-right:5px" :loading="saveLoading"
@click="saveGoods">保存
</Button>
</FormItem>
</Form>
<Spin fix v-if="loading"></Spin>
</div>
</TabPane>
<TabPane label="信任登陆" name="trust">
<div>
<Row style="background:#eee;padding:10px;" :gutter="16">
<Col span="12">
<Card>
<p slot="title">微信信任登陆</p>
<Form
ref="wechatForm"
:model="wechat"
:label-width="140"
label-position="right"
>
<FormItem label="appId" prop="appId">
<Input type="text" v-model="wechat.appId" placeholder="appId"
style="width: 350px"/>
</FormItem>
<FormItem label="appSecret" prop="appSecret">
<Input type="text" v-model="wechat.appSecret" placeholder="appSecret"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackUrl" prop="callbackUrl">
<Input type="text" v-model="wechat.callbackUrl" placeholder="callbackUrl"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackLoginUrl" prop="callbackLoginUrl">
<Input type="text" v-model="wechat.callbackLoginUrl"
placeholder="callbackLoginUrl"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackBindUrl" prop="callbackBindUrl">
<Input type="text" v-model="wechat.callbackBindUrl"
placeholder="callbackBindUrl"
style="width: 350px"/>
</FormItem>
<FormItem>
<Button type="primary" style="width: 100px;margin-right:5px"
:loading="saveLoading"
@click="saveWechat">保存
</Button>
</FormItem>
</Form>
<Spin fix v-if="loading"></Spin>
</Card>
</Col>
<Col span="12">
<Card>
<p slot="title">QQ信任登陆</p>
<Form
ref="qqForm"
:model="qq"
:label-width="140"
label-position="right"
>
<FormItem label="appId" prop="appId">
<Input type="text" v-model="qq.appId" placeholder="appId"
style="width: 350px"/>
</FormItem>
<FormItem label="appKey" prop="appKey">
<Input type="text" v-model="qq.appKey" placeholder="appKey"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackUrl" prop="callbackUrl">
<Input type="text" v-model="qq.callbackUrl" placeholder="callbackUrl"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackLoginUrl" prop="callbackLoginUrl">
<Input type="text" v-model="qq.callbackLoginUrl"
placeholder="callbackLoginUrl"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackBindUrl" prop="callbackBindUrl">
<Input type="text" v-model="qq.callbackBindUrl"
placeholder="callbackBindUrl"
style="width: 350px"/>
</FormItem>
<FormItem>
<Button type="primary" style="width: 100px;margin-right:5px"
:loading="saveLoading"
@click="saveQQ">保存
</Button>
</FormItem>
</Form>
<Spin fix v-if="loading"></Spin>
</Card>
</Col>
</Row>
<Row style="background:#eee;padding:10px;" :gutter="16">
<Col span="12">
<Card>
<p slot="title">微博信任登陆</p>
<Form
ref="weiboForm"
:model="weibo"
:label-width="140"
label-position="right"
>
<FormItem label="appKey" prop="appKey">
<Input type="text" v-model="weibo.appKey" placeholder="appKey"
style="width: 350px"/>
</FormItem>
<FormItem label="appSecret" prop="appSecret">
<Input type="text" v-model="weibo.appSecret" placeholder="appSecret"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackUrl" prop="callbackUrl">
<Input type="text" v-model="weibo.callbackUrl" placeholder="callbackUrl"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackLoginUrl" prop="callbackLoginUrl">
<Input type="text" v-model="weibo.callbackLoginUrl"
placeholder="callbackLoginUrl"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackBindUrl" prop="callbackBindUrl">
<Input type="text" v-model="weibo.callbackBindUrl"
placeholder="callbackBindUrl"
style="width: 350px"/>
</FormItem>
<FormItem>
<Button type="primary" style="width: 100px;margin-right:5px"
:loading="saveLoading"
@click="saveWeibo">保存
</Button>
</FormItem>
</Form>
<Spin fix v-if="loading"></Spin>
</Card>
</Col>
<Col span="12">
<Card>
<p slot="title">支付宝信任登陆</p>
<Form
ref="alipayForm"
:model="alipay"
:label-width="140"
label-position="right"
>
<FormItem label="appId" prop="appId">
<Input type="text" v-model="alipay.appId" placeholder="appId"
style="width: 350px"/>
</FormItem>
<FormItem label="appSecret" prop="appSecret">
<Input type="text" v-model="alipay.appSecret" placeholder="appSecret"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackUrl" prop="callbackUrl">
<Input type="text" v-model="alipay.callbackUrl" placeholder="callbackUrl"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackLoginUrl" prop="callbackLoginUrl">
<Input type="text" v-model="alipay.callbackLoginUrl"
placeholder="callbackLoginUrl"
style="width: 350px"/>
</FormItem>
<FormItem label="callbackBindUrl" prop="callbackBindUrl">
<Input type="text" v-model="alipay.callbackBindUrl"
placeholder="callbackBindUrl"
style="width: 350px"/>
</FormItem>
<FormItem>
<Button type="primary" style="width: 100px;margin-right:5px"
:loading="saveLoading"
@click="saveAlipay">保存
</Button>
</FormItem>
</Form>
<Spin fix v-if="loading"></Spin>
</Card>
</Col>
</Row>
<Spin fix v-if="loading"></Spin>
</div>
</TabPane>
</Tabs>
</Card>
</div>
</template>
<script>
import {
getParams,
editParams
} from "@/api/platform.js";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
import {regular} from '@/utils'
export default {
name: "setting-manage",
components: {
uploadPicInput
},
data() {
return {
tabName: "base",
loading: false, // 表单加载状态
saveLoading: false,
base: {
siteName: "",
icp: "",
logo: "",
sellerLogo: "",
},
point: {
register: "",
login: "",
money: ""
},
order: {
autoCancel: "",
autoReceive: "",
autoComplete: ""
},
goods: {
goodsCheck: "OPEN",
smallPictureWidth: "",
smallPictureHeight: "",
abbreviationPictureWidth: "",
abbreviationPictureHeight: "",
originalPictureWidth: "",
originalPictureHeight: ""
},
wechat: {
appId: "",
appSecret: "",
callbackUrl: "",
callbackLoginUrl: "",
callbackBindUrl: ""
},
qq: {
appId: "",
appKey: "",
callbackUrl: "",
callbackLoginUrl: "",
callbackBindUrl: ""
},
weibo: {
appKey: "",
appSecret: "",
callbackUrl: "",
callbackLoginUrl: "",
callbackBindUrl: ""
},
alipay: {
appId: "",
appSecret: "",
callbackUrl: "",
callbackLoginUrl: "",
callbackBindUrl: ""
},
baseValidate: {
// 表单验证规则
siteName: [{required: true, message: "不能为空", trigger: "blur"}],
icp: [{required: true, message: "不能为空", trigger: "blur"}],
logo: [{required: true, message: "不能为空", trigger: "blur"}],
sellerLogo: [{required: true, message: "不能为空", trigger: "blur"}]
},
pointValidate: {
// 表单验证规则
register: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
login: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
money: [
{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}]
},
orderValidate: {
// 表单验证规则
autoCancel: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
autoReceive: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
autoComplete: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}]
},
goodsValidate: {
smallPictureWidth: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
smallPictureHeight: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
abbreviationPictureWidth: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
abbreviationPictureHeight: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
originalPictureWidth: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}],
originalPictureHeight: [{
required: true,
validator: (rule, value, callback) => {
if (!regular.integer.test(value)) {
callback(new Error('请输入正整数,且不为零!'))
} else {
callback()
}
},
trigger: 'blur'
}]
}
};
},
methods: {
init() {
this.initBase();
this.initPoint();
this.initOrder();
this.initGoods();
this.initWechat();
this.initQQ();
this.initWeibo();
this.initAlipay();
},
initBase() {
this.loading = true;
getParams('base').then(res => {
if (res.success) {
this.loading = false;
if (res.result) {
this.base = res.result
}
}
});
},
initPoint() {
this.loading = true;
getParams('point').then(res => {
if (res.success) {
this.loading = false;
if (res.result) {
this.point = res.result
}
}
});
},
initOrder() {
this.loading = true;
getParams('order').then(res => {
if (res.success) {
this.loading = false;
if (res.result) {
this.order = res.result
}
}
});
},
initGoods() {
this.loading = true;
getParams('goods').then(res => {
if (res.success) {
this.loading = false;
if (res.result) {
this.goods = res.result
}
}
});
},
initWeibo() {
this.loading = true;
getParams('weibo').then(res => {
if (res.success) {
this.loading = false;
if (res.result) {
this.weibo = res.result
}
}
});
},
initWechat() {
this.loading = true;
getParams('wechat').then(res => {
if (res.success) {
this.loading = false;
if (res.result) {
this.wechat = res.result
}
}
});
},
initQQ() {
this.loading = true;
getParams('qq').then(res => {
if (res.success) {
this.loading = false;
if (res.result) {
this.qq = res.result
}
}
});
},
initAlipay() {
this.loading = true;
getParams('alipay').then(res => {
if (res.success) {
this.loading = false;
if (res.result) {
this.alipay = res.result
}
}
});
},
saveBase() {
this.$refs.baseForm.validate(valid => {
if (valid) {
this.saveLoading = true;
this.base.id = 'base'
editParams(this.base, 'base').then(res => {
this.saveLoading = false;
if (res.success) {
this.$Message.success("保存成功");
}
});
}
});
},
savePoint() {
this.$refs.pointForm.validate(valid => {
if (valid) {
this.saveLoading = true;
this.point.id = 'point'
editParams(this.point, 'point').then(res => {
this.saveLoading = false;
if (res.success) {
this.$Message.success("保存成功");
}
});
}
});
},
saveOrder() {
this.$refs.orderForm.validate(valid => {
if (valid) {
this.saveLoading = true;
this.order.id = 'order'
editParams(this.order, 'order').then(res => {
this.saveLoading = false;
if (res.success) {
this.$Message.success("保存成功");
}
});
}
});
},
saveGoods() {
this.$refs.goodsForm.validate(valid => {
if (valid) {
this.saveLoading = true;
this.goods.id = 'goods'
editParams(this.goods, 'goods').then(res => {
this.saveLoading = false;
if (res.success) {
this.$Message.success("保存成功");
}
});
}
});
},
saveWechat() {
this.$refs.wechatForm.validate(valid => {
if (valid) {
this.saveLoading = true;
this.wechat.id = 'wechat'
editParams(this.wechat, 'wechat').then(res => {
this.saveLoading = false;
if (res.success) {
this.$Message.success("保存成功");
}
});
}
});
},
saveQQ() {
this.$refs.qqForm.validate(valid => {
if (valid) {
this.saveLoading = true;
this.qq.id = 'qq'
editParams(this.qq, 'qq').then(res => {
this.saveLoading = false;
if (res.success) {
this.$Message.success("保存成功");
}
});
}
});
},
saveWeibo() {
this.$refs.wechatForm.validate(valid => {
if (valid) {
this.saveLoading = true;
this.weibo.id = 'weibo'
editParams(this.weibo, 'weibo').then(res => {
this.saveLoading = false;
if (res.success) {
this.$Message.success("保存成功");
}
});
}
});
},
saveAlipay() {
this.$refs.alipayForm.validate(valid => {
if (valid) {
this.saveLoading = true;
this.alipay.id = 'alipay'
editParams(this.alipay, 'alipay').then(res => {
this.saveLoading = false;
if (res.success) {
this.$Message.success("保存成功");
}
});
}
});
}
},
mounted() {
let name = this.$route.query.name;
if (name) {
this.tabName = name;
}
this.init();
}
};
</script>

View File

@@ -0,0 +1,151 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="站点名称" prop="siteName">
<Input v-model="formValidate.siteName" />
</FormItem>
<FormItem label="icp" prop="icp">
<Input v-model="formValidate.icp" />
</FormItem>
<FormItem label="后台Logo" prop="domainLogo">
<div class="label-item-upload">
<img v-if="formValidate.domainLogo" class="img" :src="formValidate.domainLogo" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('domainLogo')">选择图片</Button>
</div>
</FormItem>
<FormItem label="买家端Logo" prop="buyerSideLogo">
<div class="label-item-upload">
<img v-if="formValidate.buyerSideLogo" class="img" :src="formValidate.buyerSideLogo" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('buyerSideLogo')">选择图片</Button>
</div>
</FormItem>
<FormItem label="商家端Logo" prop="sellerSideLogo">
<div class="label-item-upload">
<img v-if="formValidate.sellerSideLogo" class="img" :src="formValidate.sellerSideLogo" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('sellerSideLogo')">选择图片</Button>
</div>
</FormItem>
<FormItem label="站点地址" prop="staticPageAddress">
<Input v-model="formValidate.staticPageAddress" />
</FormItem>
<FormItem label="wap站点地址" prop="staticPageWapAddress">
<Input v-model="formValidate.staticPageWapAddress" />
</FormItem>
<div class="label-btns">
<Button type="primary" @click="submit('formValidate')">保存</Button>
</div>
</Form>
<Modal width="1200px" v-model="picModelFlag">
<ossManage @callback="callbackSelected" ref="ossManage" />
</Modal>
</div>
</template>
<script>
import { setSetting } from "@/api/index";
import { handleSubmit } from "./validate";
import ossManage from "@/views/sys/oss-manage/ossManage";
export default {
title: "基础设置",
props: ["res", "type"],
components: {
ossManage,
},
data() {
return {
handleSubmit,
picModelFlag: false,
formValidate: {
buyerSideLogo: "",
domainLogo: "",
icp: "",
sellerSideLogo: "",
siteName: "",
staticPageAddress: "",
staticPageWapAddress: "",
},
selected: "",
ruleValidate: {},
};
},
created() {
console.log(this.type);
this.init();
},
methods: {
// 点击图片
onClickImg(item) {
this.selected = item;
this.$refs.ossManage.selectImage = true;
this.picModelFlag = true;
},
submit(name) {
let that = this;
if (handleSubmit(that, name)) {
this.setupSetting();
}
},
callbackSelected(val) {
this.picModelFlag = false;
this.formValidate[this.selected] = val.url;
console.log(val);
},
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.res).forEach((item) => {
this.ruleValidate[item] = [
{
required: true,
message: "请填写必填项",
trigger: "blur",
},
];
});
},
},
};
</script>
<style scoped lang="scss">
@import "./style.scss";
.label-item {
display: flex;
> .ivu-input {
width: 200px;
margin: 0 10px;
}
}
.label-item-upload {
display: flex;
align-items: flex-end;
img {
margin-right: 10px;
width: 100px;
height: 100px;
}
}
</style>

View File

@@ -0,0 +1,151 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="商品审核" prop="goodsCheck">
<RadioGroup v-model="formValidate.goodsCheck">
<Radio label="true">开启</Radio>
<Radio label="false">关闭</Radio>
</RadioGroup>
</FormItem>
<div class="label-item">
<FormItem label="小图宽" prop="smallPictureWidth">
<Input type="number" v-model="formValidate.smallPictureWidth">
<span slot="prepend"></span>
<span slot="append">px</span>
</Input>
</FormItem>
<FormItem label="小图高" class="label-item" prop="smallPictureHeight">
<Input type="number" v-model="formValidate.smallPictureHeight">
<span slot="prepend"></span>
<span slot="append">px</span>
</Input>
</FormItem>
</div>
<div class="label-item">
<FormItem class="label-item" label="缩略图宽" prop="abbreviationPictureWidth">
<Input type="number" v-model="formValidate.abbreviationPictureWidth">
<span slot="prepend"></span>
<span slot="append">px</span>
</Input>
</FormItem>
<FormItem class="label-item" label="缩略图高" prop="abbreviationPictureHeight">
<Input type="number" v-model="formValidate.abbreviationPictureHeight">
<span slot="prepend"></span>
<span slot="append">px</span>
</Input>
</FormItem>
</div>
<div class="label-item">
<FormItem class="label-item" label="原图宽高" prop="originalPictureWidth">
<Input type="number" v-model="formValidate.originalPictureWidth">
<span slot="prepend"></span>
<span slot="append">px</span>
</Input>
</FormItem>
<FormItem class="label-item" label="原图宽高" prop="originalPictureHeight">
<Input type="number" v-model="formValidate.originalPictureHeight">
<span slot="prepend"></span>
<span slot="append">px</span>
</Input>
</FormItem>
</div>
<div class="label-btns">
<Button type="primary" @click="submit('formValidate')">保存</Button>
</div>
</Form>
</div>
</template>
<script>
import { setSetting } from "@/api/index";
import { handleSubmit } from "./validate";
export default {
props: ["res", "type"],
data() {
return {
formValidate: {
goodsCheck: 1,
smallPictureHeight: "0",
smallPictureWidth: "0",
abbreviationPictureWidth: "0",
abbreviationPictureHeight: "0",
originalPictureWidth: "0",
originalPictureHeight: "0",
},
ruleValidate: {},
};
},
watch: {
res: {
handler() {},
immediate: true,
},
},
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);
Object.keys(this.res).map((item) => {
this.res[item] += "";
});
this.$set(this, "formValidate", { ...this.res });
Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [
{
required: true,
message: "请填写必填项",
trigger: "blur",
},
{
validator: (rule, value, callback) => {
if (value < 0) {
callback(new Error("不能输入负数!"));
} else {
callback();
}
},
trigger: "change",
},
];
});
},
},
};
</script>
<style lang="scss" scoped>
@import "./style.scss";
.label-item {
display: flex;
}
/deep/ .ivu-input {
width: 100px !important;
}
</style>

View File

@@ -0,0 +1,92 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="企业id" prop="ebusinessID">
<Input v-model="formValidate.ebusinessID" />
</FormItem>
<FormItem label="密钥" prop="appKey">
<Input class="label-appkey" v-model="formValidate.appKey" />
</FormItem>
<FormItem label="api地址" prop="reqURL">
<Input v-model="formValidate.reqURL" />
</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 "./validate";
export default {
data() {
return {
ruleValidate: {},
formValidate: { ebusinessID: "", reqURL: "", appKey: "" },
};
},
props: ["res",'type'],
watch: {
res: {
handler() {},
immediate: true,
},
},
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 "./style.scss";
.label-item {
display: flex;
> .ivu-input {
width: 200px;
margin: 0 10px;
}
}
.label-appkey {
width: 300px !important;
/deep/ input {
width: 300px !important;
}
}
</style>

View File

@@ -0,0 +1,124 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="订单自动取消" prop="autoCancel">
<Input type='number' v-model="formValidate.autoCancel">
<span slot="append"></span>
</Input>
</FormItem>
<FormItem label="订单自动收货" class="label-item" prop="autoReceive">
<Input type='number' v-model="formValidate.autoReceive">
<span slot="append"></span>
</Input>
</FormItem>
<FormItem label="订单自动完成" prop="autoComplete">
<Input type='number' v-model="formValidate.autoComplete">
<span slot="append"></span>
</Input>
</FormItem>
<FormItem label="自动评价" prop="autoEvaluation">
<Input type='number' v-model="formValidate.autoEvaluation">
<span slot="append"></span>
</Input>
</FormItem>
<FormItem label="售后自动取消" prop="autoCancelAfterSale">
<Input type='number' v-model="formValidate.autoCancelAfterSale">
<span slot="append"></span>
</Input>
</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 "./validate";
export default {
data() {
return {
ruleValidate: {},
formValidate: {
autoCancel: "",
autoComplete: "",
autoEvaluation: "",
autoReceive: "",
autoCancelAfterSale: "",
},
};
},
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);
Object.keys(this.res).map((item) => {
this.res[item] += "";
});
this.$set(this, "formValidate", { ...this.res });
Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [
{
required: true,
message: "请填写必填项",
trigger: "blur",
},
{
validator: (rule, value, callback) => {
if (value < 0) {
callback(new Error("不能输入负数!"));
} else {
callback();
}
},
trigger: "change",
},
];
});
},
},
};
</script>
<style lang="scss" scoped>
@import "./style.scss";
.label-item {
display: flex;
}
.ivu-input-wrapper {
width: 100px;
margin-right: 10px;
}
/deep/ .ivu-input {
width: 100px !important;
}
</style>

View File

@@ -0,0 +1,95 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="endPoint" prop="endPoint">
<Input v-model="formValidate.endPoint" />
</FormItem>
<FormItem label="bucketName" class="label-item" prop="bucketName">
<Input v-model="formValidate.bucketName" />
</FormItem>
<FormItem label="picLocation" prop="bucketName">
<Input v-model="formValidate.picLocation" />
</FormItem>
<FormItem label="accessKeyId" prop="accessKeyId">
<Input v-model="formValidate.accessKeyId" />
</FormItem>
<FormItem label="accessKeySecret" prop="accessKeySecret">
<Input v-model="formValidate.accessKeySecret" />
</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 "./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 "./style.scss";
.label-item {
display: flex;
}
/deep/ .ivu-input {
width: 300px !important;
margin: 0 10px;
}
.ivu-input-wrapper {
width: 300px;
margin-right: 10px;
}
</style>

View File

@@ -0,0 +1,175 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="积分比例" prop="money">
<Input type="number" v-model="formValidate.money">
<span slot="prepend">1积分=</span>
<span slot="append">人民币</span>
</Input>
</FormItem>
<FormItem label="注册账号" prop="register">
<Input type="number" v-model="formValidate.register">
<span slot="append">积分</span>
</Input>
</FormItem>
<FormItem label="登录" class="label-item" prop="login">
<Input type="number" v-model="formValidate.login">
<span slot="append">积分</span>
</Input>
</FormItem>
<FormItem label="每日签到积分" prop="signIn">
<Input type="number" v-model="formValidate.signIn">
<span slot="append">积分</span>
</Input>
</FormItem>
<FormItem label="订单评价赠送积分" prop="comment">
<Input type="number" v-model="formValidate.comment">
<span slot="append">积分</span>
</Input>
</FormItem>
<FormItem class="label-item" v-for="(point,index) in formValidate.pointSettingItems" :key="index" :label="'签到设置'+(index+1)">
<div class="label-item">
<InputNumber :min="1" v-model="point.day" :formatter="value => `签到${value}天`" :parser="value => value.replace('天', '') && value.replace('签到', '')"></InputNumber>
<InputNumber :min="0" :formatter="value => `赠送${value}积分`" :parser="value => value.replace('积分', '') && value.replace('赠送', '')" v-model="point.point"></InputNumber>
<Button ghost type="error" @click="delSign(point,index)">删除</Button>
</div>
</FormItem>
<FormItem label="操作:">
<Button @click="addSign">新增签到</Button>
</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 "./validate";
export default {
data() {
return {
ruleValidate: {},
formValidate: {},
};
},
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("保存失败!");
}
});
},
delSign(item, index) {
this.formValidate.pointSettingItems.splice(index, 1);
},
addSign() {
if (this.formValidate.pointSettingItems.length >= 4) {
this.$Message.error({
content: "最多设置4项签到设置",
});
return false;
}
this.formValidate.pointSettingItems.push({
point: "0",
day:
this.formValidate.pointSettingItems[
this.formValidate.pointSettingItems.length - 1
].day + 1,
});
},
// 实例化数据
init() {
this.res = JSON.parse(this.res);
Object.keys(this.res).map((item) => {
if (item == "pointSettingItems") {
return false;
}
this.res[item] += "";
});
this.$set(this, "formValidate", { ...this.res });
Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [
{
required: true,
message: "请填写必填项",
trigger: "blur",
},
{
validator: (rule, value, callback) => {
if (value < 0) {
callback(new Error("不能输入负数!"));
} else {
callback();
}
},
trigger: "change",
},
];
});
},
},
};
</script>
<style lang="scss" scoped>
@import "./style.scss";
.label-item {
display: flex;
> .ivu-input-number {
width: 100px;
margin-right: 5px;
}
> .ivu-input-number:nth-last-of-type(1) {
width: 150px;
margin-right: 5px;
}
> .ivu-input {
width: 100px;
margin: 0 10px;
}
}
/deep/ .ivu-input {
width: 70px !important;
}
.ivu-input-wrapper {
width: 70px;
margin-right: 10px;
}
.label-btns {
/deep/ .ivu-btn {
margin-right: 10px;
}
}
</style>

View File

@@ -0,0 +1,92 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="accessKeyId" prop="accessKeyId">
<Input v-model="formValidate.accessKeyId" />
</FormItem>
<FormItem label="accessSecret" prop="accessSecret">
<Input v-model="formValidate.accessSecret" />
</FormItem>
<FormItem label="regionId" prop="regionId">
<Input v-model="formValidate.regionId" />
</FormItem>
<FormItem label="signName" prop="signName">
<Input v-model="formValidate.signName" />
</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 "./validate";
export default {
data() {
return {
ruleValidate: {},
formValidate: {
accessKeyId: "",
regionId: "",
picLocation: "",
accessSecret: "",
},
};
},
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 "./style.scss";
.label-item {
display: flex;
}
/deep/ .ivu-input {
width: 300px !important;
margin: 0 10px;
}
.ivu-input-wrapper {
width: 300px;
margin-right: 10px;
}
</style>

View File

@@ -0,0 +1,67 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="提现审核是否开启">
<i-switch v-model="formValidate.apply" style="margin-top:7px;"><span slot="open"></span>
<span slot="close"></span>
</i-switch>
</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 "./validate";
export default {
data() {
return {
formValidate: {
apply: true,
},
switchTitle: "提现审核是否开启",
};
},
created() {
this.init();
},
props: ["res", "type"],
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 });
},
},
};
</script>
<style lang="scss" scoped>
@import "./style.scss";
/deep/ .ivu-form-item-content{
align-items: center;
paddinig-bottom: 5px;
}
</style>

View File

@@ -0,0 +1,22 @@
/deep/ .ivu-input{
width: 200px !important;
}
.label-btns{
margin-left: 150px;
}
.ivu-form-item{
padding: 10px 0;
}
.ivu-input-wrapper {
width: 150px;
margin-right: 10px;
}
/deep/ .ivu-form-item-content {
margin-left: 0 !important;
display: flex;
}

View File

@@ -0,0 +1,23 @@
//表单中必填
export function validateRequired(rule, value, callback) {
if (value != void 0 || value != null) {
callback();
} else {
return callback(new Error("必填项不能为空"));
}
}
// 验证必填项
export function handleSubmit(that, name) {
let flag = false;
that.$refs[name].validate(valid => {
if (valid) {
flag = true;
return flag;
} else {
that.$Message.error("请正确填写内容!");
return flag;
}
});
return flag
}

View File

@@ -0,0 +1,126 @@
<template>
<Card v-if="show">
<Tabs v-model="selected" @on-click="clickTab">
<TabPane :label="tabItem.name" :name="tabItem.type" v-for="(tabItem, tabIndex) in tabWay" :key="tabIndex">
<component v-if="settingData" :res="settingData" :type="selected"
:is="templateSetting[tabItem.type]"></component>
</TabPane>
</Tabs>
</Card>
</template>
<script>
import {getSetting} from "@/api/index.js";
import templateSetting from "./template";
export default {
data() {
return {
templateSetting,
selected: "",
settingData: "",
show: true,
setting: [
//基础配置
{
type: "BASE_SETTING",
name: "基础配置",
},
//商品设置
{
type: "GOODS_SETTING",
name: "商品设置",
},
// 快递鸟设置
{
type: "KUAIDI_SETTING",
name: "快递鸟设置",
},
//订单配置
{
type: "ORDER_SETTING",
name: "订单配置",
},
//阿里OSS配置
{
type: "OSS_SETTING",
name: "阿里OSS配置",
},
//阿里短信配置
{
type: "SMS_SETTING",
name: "阿里短信配置",
},
//积分设置
{type: "POINT_SETTING", name: "积分设置"},
{
type: "WITHDRAWAL_SETTING",
name: "提现设置",
},
],
authLogin: [
// 微信设置
{type: "WECHAT_CONNECT", name: "微信设置"},
// QQ设置
{type: "QQ_CONNECT", name: "QQ设置"},
//微博联合登陆
// {type: "WEIBO_CONNECT", name: "微博联合登陆"},
// //支付宝配置
// {type: "ALIPAY_CONNECT", name: "支付宝配置"},
],
pay: [
//支付宝支付设置
{type: "PAYMENT_SUPPORT", name: "支付开启/关闭"},
//支付宝支付设置
{type: "ALIPAY_PAYMENT", name: "支付宝支付设置"},
//微信支付设置
{type: "WECHAT_PAYMENT", name: "微信支付设置"},
],
tabWay: [],
};
},
watch: {
$route(to, from) {
this.selected = "";
this.show = false;
this.getSettingData(this.selected);
this.$nextTick(() => {
this.show = true;
});
// this.$router.go(0)
},
},
mounted() {
this.clickTab(this.selected);
},
methods: {
clickTab(name) {
this.selected = name;
this.getSettingData(name);
},
/**
* 进入页面请求第一个配置
*/
getSettingData(name) {
this.settingData = "";
Object.keys(this).forEach((item) => {
if (this.$route.name == item) {
this.tabWay = this[item];
}
});
// 点击页面给每项第一个数据赋值
if (!name) {
name = this.tabWay[0].type;
this.selected = name;
}
getSetting(name).then((res) => {
if (res.result) {
this.settingData = JSON.stringify(res.result);
}
});
},
},
};
</script>

View File

@@ -0,0 +1,160 @@
<template>
<Card class="card">
<div class="cardBox">
<div class="methodItem">
<img src="../../../assets/aliyun.png" height="172" width="440"/>
<h4>阿里云短信</h4></div>
<div class="bar">
<div class="status" style="color: rgb(53, 189, 129);">已启用</div>
<div><a class="links">编辑</a></div>
</div>
</div>
<!-- 阿里云的短信参数 -->
<Modal
:title="modalTitle"
v-model="modalVisible"
:mask-closable="false"
:width="500"
>
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
<FormItem label="accessKeyId" prop="addressName">
<Input v-model="form.accessKeyId" clearable style="width: 100%"/>
</FormItem>
<FormItem label="accessSecret" prop="accessSecret">
<Input v-model="form.accessSecret" clearable style="width: 100%"/>
</FormItem>
<FormItem label="regionId" prop="regionId">
<Input v-model="form.regionId" clearable style="width: 100%"/>
</FormItem>
<FormItem label="signName" prop="signName">
<Input v-model="form.signName" clearable style="width: 100%"/>
</FormItem>
</Form>
<div slot="footer">
<Button type="text" @click="modalVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="saveSetting"
>提交
</Button
>
</div>
</Modal>
</Card>
</template>
<script>
import {getSetting, setSetting} from "@/api/index.js";
import template from "./template";
export default {
name: "smsSettingManage",
components: {
template
},
data() {
return {
submitLoading: false,
template,
selected: "",
settingData: "",
modalTitle: '设置',
modalVisible: false,
form: {},
}
},
filters: {},
methods: {
init() {
settingInfo("SMS_SETTING")
},
setting() {
this.modalVisible = true
},
saveSetting() {
setSetting("SMS_SETTING", this.form).then((res) => {
if (res.code == 200) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");
}
this.modalVisible = false
});
},
settingInfo(v) {
alert()
this.selected = v
getSetting(v).then((res) => {
if (res.result) {
console.log(res)
this.modalVisible = true
this.form = res
}
});
}
},
mounted() {
this.init();
},
};
</script>
<style lang="scss">
.card {
width: 100%;
height: 100%;
position: fixed;
}
.cardBox {
display: inline-block;
border-radius: 2px;
line-height: 1.5;
margin-right: 20px;
width: 300px;
border: 1px solid #eee;
padding: 10px;
}
.methodItem {
width: 100%;
border: 1px solid #f5f5f5;
text-align: center;
padding: 20px 0;
}
methodItem img {
width: 220px;
height: 86px;
}
methodItem h4 {
font-size: 14px;
color: #333;
margin-top: 5px;
}
.methodItem img {
width: 220px;
height: 86px;
}
.bar {
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
padding: 10px 8px 0;
}
</style>

View File

@@ -0,0 +1,29 @@
import BASE_SETTING from "./setting/BASE_SETTING";
import GOODS_SETTING from "./setting/GOODS_SETTING";
import ORDER_SETTING from "./setting/ORDER_SETTING";
import POINT_SETTING from "./setting/POINT_SETTING";
import KUAIDI_SETTING from "./setting/KUAIDI_SETTING";
import OSS_SETTING from "./setting/OSS_SETTING";
import SMS_SETTING from "./setting/SMS_SETTING";
import WITHDRAWAL_SETTING from "./setting/WITHDRAWAL_SETTING";
import ALIPAY_PAYMENT from "./pay/ALIPAY_PAYMENT";
import WECHAT_PAYMENT from "./pay/WECHAT_PAYMENT";
import PAYMENT_SUPPORT from "./pay/PAYMENT_SUPPORT";
import WECHAT_CONNECT from "./authLogin/WECHAT_CONNECT";
import QQ_CONNECT from "./authLogin/QQ_CONNECT";
export default {
BASE_SETTING,
GOODS_SETTING,
ORDER_SETTING,
POINT_SETTING,
KUAIDI_SETTING,
OSS_SETTING,
SMS_SETTING,
WITHDRAWAL_SETTING,
PAYMENT_SUPPORT,
WECHAT_PAYMENT,
ALIPAY_PAYMENT,
WECHAT_CONNECT,
QQ_CONNECT
};