|
@@ -1,31 +1,30 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
- <data-form :span="24" :fields="fields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
|
|
|
- <template #buyPoint>
|
|
|
- <el-input v-model="form.buyPoint" type="number" placeholder="请输入购物赠送积分"></el-input>
|
|
|
- <p style="color: #999">金额:积分=10:1</p>
|
|
|
- </template>
|
|
|
- <template #autoCloseOrder>
|
|
|
- <el-input v-model="form.autoCloseOrder" type="number" placeholder="请输入自动关闭订单时间"></el-input>
|
|
|
- <p style="color: #999">关闭订单时间小于等于0时不自动关闭</p>
|
|
|
- </template>
|
|
|
- <template #agree>
|
|
|
- <editor v-model="form.agree" url="/files/point/config/upload" />
|
|
|
- </template>
|
|
|
- <template #bottom_menu>
|
|
|
- <data-form :span="24" :fields="testfields" v-model="form.bottom_menu" labelWidth="auto" :isSave="false">
|
|
|
- <!-- <template #is_use>
|
|
|
- <el-option v-for="i in useList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
|
- </template> -->
|
|
|
- <template #list>
|
|
|
- <el-col :span="24" style="margin: 0 0 10px 0">
|
|
|
- <el-button type="primary" size="mini" @click="toAdd()">添加</el-button>
|
|
|
- </el-col>
|
|
|
- <data-table :usePage="false" :fields="fieldsList" :opera="opera" :data="list" @edit="toEdit" @del="toDel"> </data-table>
|
|
|
- </template>
|
|
|
- </data-form>
|
|
|
- </template>
|
|
|
- </data-form>
|
|
|
+ <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
|
|
|
+ <data-form :span="24" :fields="fields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
|
|
|
+ <template #buyPoint>
|
|
|
+ <el-input v-model="form.buyPoint" type="number" placeholder="请输入购物赠送积分"></el-input>
|
|
|
+ <p style="color: #999">金额:积分=10:1</p>
|
|
|
+ </template>
|
|
|
+ <template #autoCloseOrder>
|
|
|
+ <el-input v-model="form.autoCloseOrder" type="number" placeholder="请输入自动关闭订单时间"></el-input>
|
|
|
+ <p style="color: #999">关闭订单时间小于等于0时不自动关闭</p>
|
|
|
+ </template>
|
|
|
+ <template #agree>
|
|
|
+ <editor v-model="form.agree" url="/files/point/config/upload" />
|
|
|
+ </template>
|
|
|
+ <template #bottom_menu>
|
|
|
+ <data-form :span="24" :fields="testfields" v-model="form.bottom_menu" labelWidth="auto" :isSave="false">
|
|
|
+ <template #list>
|
|
|
+ <el-col :span="24" style="margin: 0 0 10px 0">
|
|
|
+ <el-button type="primary" size="mini" @click="toAdd()">添加</el-button>
|
|
|
+ </el-col>
|
|
|
+ <data-table :usePage="false" :fields="fieldsList" :opera="opera" :data="list" @edit="toEdit" @del="toDel"> </data-table>
|
|
|
+ </template>
|
|
|
+ </data-form>
|
|
|
+ </template>
|
|
|
+ </data-form>
|
|
|
+ </el-col>
|
|
|
<e-dialog :dialog="dialog" @toClose="toClose">
|
|
|
<template v-slot:info>
|
|
|
<data-form :span="24" :fields="fieldsForm" :rules="fieldRules" v-model="fieldform" labelWidth="150px" @save="onSubmit">
|
|
@@ -51,12 +50,12 @@ export default {
|
|
|
components: { editor: () => import('@/components/editor.vue') },
|
|
|
data: function () {
|
|
|
return {
|
|
|
+ loadings: true,
|
|
|
fields: [
|
|
|
{ label: '系统名称', model: 'title' },
|
|
|
{ label: 'logo', model: 'logo', type: 'upload', limit: 1, url: '/files/point/config/upload' },
|
|
|
{ label: '购物赠送积分', model: 'buyPoint', custom: true },
|
|
|
{ label: '自动关闭订单时间', model: 'autoCloseOrder', custom: true },
|
|
|
- // { label: '积分计划', model: 'pointPlan' },
|
|
|
{ label: '底部文字', model: 'bottom_title' },
|
|
|
{ label: '底部菜单', model: 'bottom_menu', custom: true },
|
|
|
{ label: '分享图片', model: 'share', type: 'upload', limit: 1, url: '/files/point/config/upload' },
|
|
@@ -64,10 +63,7 @@ export default {
|
|
|
],
|
|
|
rules: {},
|
|
|
form: { bottom_menu: {} },
|
|
|
- testfields: [
|
|
|
- // { label: '是否使用', model: 'is_use', type: 'select' },
|
|
|
- { label: '菜单列表', model: 'list', custom: true },
|
|
|
- ],
|
|
|
+ testfields: [{ label: '菜单列表', model: 'list', custom: true }],
|
|
|
// 底部菜单
|
|
|
opera: [
|
|
|
{ label: '修改', method: 'edit' },
|
|
@@ -155,9 +151,8 @@ export default {
|
|
|
autoCloseOrder: data.config.autoCloseOrder,
|
|
|
};
|
|
|
}
|
|
|
- if (!data.bottom_menu) {
|
|
|
- data.bottom_menu = {};
|
|
|
- } else {
|
|
|
+ if (!data.bottom_menu) data.bottom_menu = {};
|
|
|
+ else {
|
|
|
let list = _.sortBy(data.bottom_menu.list, function (item) {
|
|
|
return item.sort;
|
|
|
});
|
|
@@ -165,6 +160,7 @@ export default {
|
|
|
}
|
|
|
this.$set(this, `form`, data);
|
|
|
}
|
|
|
+ this.loadings = false;
|
|
|
},
|
|
|
async toAdd() {
|
|
|
this.dialog = { title: '信息管理', show: true, type: '1' };
|
|
@@ -188,9 +184,7 @@ export default {
|
|
|
// 底部菜单提交
|
|
|
onSubmit({ data }) {
|
|
|
let info = this.list.find((f) => f.route == data.route);
|
|
|
- if (info == '' || info == undefined) {
|
|
|
- this.list.push(data);
|
|
|
- }
|
|
|
+ if (info == '' || info == undefined) this.list.push(data);
|
|
|
this.toClose();
|
|
|
},
|
|
|
// 保存
|
|
@@ -206,9 +200,7 @@ export default {
|
|
|
let res;
|
|
|
// 是否使用
|
|
|
res = await this.dictQuery({ code: 'use' });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `useList`, res.data);
|
|
|
- }
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `useList`, res.data);
|
|
|
},
|
|
|
},
|
|
|
metaInfo() {
|