You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

123 lines
3.6 KiB

<template>
<div>
<div class="title-box">小程序基础设置</div>
<el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="190px">
<el-form-item label="服务老师注册口令" prop="sellerActivityCode">
<el-input v-model="form.sellerActivityCode" style="width: 35%" />
</el-form-item>
<el-form-item label="文章全部解锁金额" prop="articlePrice">
<el-input v-model="form.articlePrice" style="width: 35%" />
</el-form-item>
<el-form-item label="服务人员电话" prop="serviceStaffPhone">
<el-input v-model="form.serviceStaffPhone" style="width: 35%" />
</el-form-item>
<!-- <el-form-item label="能量大师的会员等级" prop="userHighestLevel">
<el-input v-model="form.userHighestLevel" style="width: 35%" />
</el-form-item> -->
<div class="title-box">积分规则设置</div>
<el-form-item :label="'积分签到'+item.day+'所得积分'" prop="userHighestLevel" v-for="(item,index) in form.signInfos" :key="index">
<el-input v-model="item.signNum" style="width: 35%" />
</el-form-item>
<el-form-item label="完善个人信息所得积分" prop="completedNum">
<el-input v-model="form.completedNum" style="width: 35%" />
</el-form-item>
<el-form-item>
<el-button :loading="loading" size="medium" type="primary" @click="doSubmit">保存</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { setConfig, getConfigs } from '@/api/setConfig'
export default {
data() {
return {
loading:false,
form:{
"signInfos": [
{
"day": "第一天",
"signNum": "10"
},
{
"day": "第二天",
"signNum": "20"
},
{
"day": "第三天",
"signNum": "30"
},
{
"day": "第四天",
"signNum": "40"
},
{
"day": "第五天",
"signNum": "50"
},
{
"day": "第六天",
"signNum": "60"
},
{
"day": "第七天",
"signNum": "100"
}
]
},
rules: {
sellerActivityCode: [
{ required: true, message: '服务老师注册口令不能为空', trigger: 'blur' }
],
articlePrice: [
{ required: true, message: '文章全部解锁金额不能为空', trigger: 'blur' }
],
serviceStaffPhone: [
{ required: true, message: '服务人员电话不能为空', trigger: 'blur' }
],
// completedNum: [
// { required: true, message: '请设置积分', trigger: 'blur' }
// ]
}
}
},
mounted(){
this.getConfigs()
},
methods: {
getConfigs(){
getConfigs(["seller_activity_code","unlock_all_article_price","service_staff_phone","completed_num"]).then((res)=>{
this.form = res
})
},
doSubmit() {
this.loading = true;
this.$refs['form'].validate((valid) => {
if (valid) {
setConfig(this.form).then(res => {
console.log(res)
this.$message({
type:'success',
message:'操作成功!'
})
this.getConfigs()
this.loading = false;
}).catch(err => {
console.log(err.response.data.message)
})
} else {
return false
}
})
}
}
}
</script>
<style scoped>
.title-box{
font-size: 24px;
padding: 20px;
}
</style>