1、新增旧货市场
2、新增用户等级
This commit is contained in:
+204
-153
@@ -1,169 +1,220 @@
|
||||
<template>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix" style="text-align: center">
|
||||
<span style="font-size: 20px;line-height: 2em;">消息推送设置</span>
|
||||
<div style="color: #999999">我们将针对您的选择,为您精准推送询价信息</div>
|
||||
</div>
|
||||
<el-row class="setting-list" :gutter="50">
|
||||
<el-col span="12" v-for="(item,index) in settingList" :key="index">
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<el-badge is-dot class="badge"></el-badge>
|
||||
{{ item.title }}
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-switch
|
||||
v-model="item.status">
|
||||
</el-switch>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<div class="form">
|
||||
<div class="form-title">
|
||||
* 请选择产品:
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix" style="text-align: center">
|
||||
<span style="font-size: 20px;line-height: 2em;">消息推送设置</span>
|
||||
<div style="color: #999999">我们将针对您的选择,为您精准推送询价信息</div>
|
||||
</div>
|
||||
<el-form ref="form" :model="form" label-position="left" label-width="120px">
|
||||
<el-form-item label="螺纹钢、高线">
|
||||
<el-checkbox-group v-model="group1" size="small">
|
||||
<el-checkbox label="螺纹钢" border></el-checkbox>
|
||||
<el-checkbox label="盘螺" border></el-checkbox>
|
||||
<el-checkbox label="盘圆" border></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="钢材">
|
||||
<el-checkbox-group v-model="group1" size="small">
|
||||
<el-checkbox label="螺纹钢" border></el-checkbox>
|
||||
<el-checkbox label="盘螺" border></el-checkbox>
|
||||
<el-checkbox label="盘圆" border></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="钢版">
|
||||
<el-checkbox-group v-model="group1" size="small">
|
||||
<el-checkbox label="螺纹钢" border></el-checkbox>
|
||||
<el-checkbox label="盘螺" border></el-checkbox>
|
||||
<el-checkbox label="盘圆" border></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="型材">
|
||||
<el-checkbox-group v-model="group1" size="small">
|
||||
<el-checkbox label="螺纹钢" border></el-checkbox>
|
||||
<el-checkbox label="盘螺" border></el-checkbox>
|
||||
<el-checkbox label="盘圆" border></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="配件、耗材">
|
||||
<el-checkbox-group v-model="group1" size="small">
|
||||
<el-checkbox label="螺纹钢" border></el-checkbox>
|
||||
<el-checkbox label="盘螺" border></el-checkbox>
|
||||
<el-checkbox label="盘圆" border></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="二手钢材、设备">
|
||||
<el-checkbox-group v-model="group1" size="small">
|
||||
<el-checkbox label="螺纹钢" border></el-checkbox>
|
||||
<el-checkbox label="盘螺" border></el-checkbox>
|
||||
<el-checkbox label="盘圆" border></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="form">
|
||||
<div class="form-title">
|
||||
* 请选择服务地区:
|
||||
<el-row class="setting-list" :gutter="50">
|
||||
<el-col :span="12" v-for="(item,index) in settingList" :key="index">
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<el-badge is-dot class="badge"></el-badge>
|
||||
{{ item.title }}
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-switch
|
||||
v-model="item.status">
|
||||
</el-switch>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<div class="form">
|
||||
<div class="form-title">
|
||||
* 请选择产品:
|
||||
</div>
|
||||
<el-form ref="form" :model="form" label-position="left" label-width="120px">
|
||||
<el-form-item :label="item.name" v-for="(item, index) in productList" :key="index">
|
||||
<el-checkbox-group v-model="productList[index].idList" size="small">
|
||||
<el-checkbox v-for="(productItem, productIndex) in item.children" :key="productIndex"
|
||||
:label="productItem._id" border
|
||||
:checked="productList[index].idList.includes(item._id)">
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-form ref="form" :model="form" label-position="left" label-width="120px">
|
||||
广西-南宁
|
||||
</el-form>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<el-button type="danger" round>保存设置</el-button>
|
||||
</el-card>
|
||||
<el-divider></el-divider>
|
||||
<div class="form">
|
||||
<div class="form-title">
|
||||
* 请选择服务地区:
|
||||
</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4">
|
||||
<el-select v-model="addressIndex[0]" placeholder="请选择省">
|
||||
<el-option v-for="(item, index) in provinceData" :key="index"
|
||||
:label="item.name"
|
||||
:value="index">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-select v-model="addressIndex[1]" placeholder="请选择市"
|
||||
:disabled="addressIndex.length === 0">
|
||||
<template v-if="addressIndex[0] !== null">
|
||||
<el-option v-for="(item, index) in cityData[addressIndex[0]]"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="index">
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-select v-model="addressIndex[2]" placeholder="请选择区"
|
||||
:disabled="addressIndex.length === 1">
|
||||
<template
|
||||
v-if="addressIndex[0] !== null && addressIndex[1] !== null">
|
||||
<el-option
|
||||
v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="index">
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<el-button type="danger" round @click.native="save">保存设置</el-button>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let that;
|
||||
const originalForms = {sort: 0, enable: true}
|
||||
// import { VueCropper } from 'vue-cropper'
|
||||
export default {
|
||||
components: {
|
||||
// VueCropper
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
settingList: [
|
||||
{
|
||||
id: 1,
|
||||
title: '金融服务',
|
||||
status: true
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '金融服务',
|
||||
status: true
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '找合作信息推送服务',
|
||||
status: true
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: '找加工信息推送服务',
|
||||
status: false
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: '旧货信息交易推送服务',
|
||||
status: true
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
title: '询价单和选项推送服务',
|
||||
status: false
|
||||
}
|
||||
],
|
||||
form: {},
|
||||
group1: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
that = this
|
||||
},
|
||||
methods: {
|
||||
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
|
||||
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
|
||||
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
|
||||
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
provinceData: provinces,
|
||||
cityData: citys,
|
||||
areaData: areas,
|
||||
addressIndex: [null, null, null],
|
||||
settingList: {
|
||||
article: {
|
||||
title: '行情信息推送服务',
|
||||
status: false
|
||||
},
|
||||
process: {
|
||||
title: '找加工信息推送服务',
|
||||
status: false
|
||||
},
|
||||
old: {
|
||||
title: '旧货交易信息推送服务',
|
||||
status: false
|
||||
},
|
||||
enquiry: {
|
||||
title: '询价单和选项推送服务',
|
||||
status: false
|
||||
},
|
||||
},
|
||||
form: {},
|
||||
group1: [],
|
||||
productList: [],
|
||||
addressRegion: {}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getCate()
|
||||
await this.getConfig()
|
||||
},
|
||||
methods: {
|
||||
async getConfig() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/message/config/kh/getConfig'
|
||||
})
|
||||
for (let key in this.settingList) this.settingList[key].status = res[key]
|
||||
this.productList.forEach((item, index) => {
|
||||
item.children.forEach(productItem => {
|
||||
if (res.productList.includes(productItem._id)) {
|
||||
this.productList[index].idList.push(productItem._id)
|
||||
}
|
||||
})
|
||||
})
|
||||
if (res.addressRegion.province) {
|
||||
this.addressIndex[0] = this.provinceData.findIndex(item => item.code === res.addressRegion.province.code)
|
||||
if (this.addressIndex[0] !== -1) {
|
||||
this.addressIndex[1] = this.cityData[this.addressIndex[0]].findIndex(item => item.code === res.addressRegion.city.code)
|
||||
if (this.addressIndex[1] !== -1) {
|
||||
this.addressIndex[2] = this.areaData[this.addressIndex[0]][this.addressIndex[1]].findIndex(item => item.code === res.addressRegion.area.code)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async getCate() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
title: '请求中...',
|
||||
});
|
||||
this.productList = rows.map(item => {
|
||||
item.idList = []
|
||||
return item
|
||||
})
|
||||
},
|
||||
async save() {
|
||||
let productList = []
|
||||
this.productList.forEach(item => {
|
||||
productList = [...productList, ...item.idList]
|
||||
})
|
||||
await vk.callFunction({
|
||||
url: 'client/message/config/kh/update',
|
||||
data: {
|
||||
article: this.settingList.article.status,
|
||||
process: this.settingList.process.status,
|
||||
old: this.settingList.old.status,
|
||||
enquiry: this.settingList.enquiry.status,
|
||||
productList,
|
||||
addressRegion: {
|
||||
province: this.provinceData[this.addressIndex[0]],
|
||||
city: this.cityData[this.addressIndex[0]][this.addressIndex[1]],
|
||||
area: this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]],
|
||||
}
|
||||
}
|
||||
})
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.setting-list{
|
||||
.item{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin: 5px auto;
|
||||
.title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.badge{
|
||||
.setting-list {
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 5px;
|
||||
}
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin: 5px auto;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.form-title{
|
||||
color: #bf2b28;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 2em;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.form-title {
|
||||
color: #bf2b28;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.form{
|
||||
padding: 10px;
|
||||
|
||||
.form {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user