| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <?php
- /**
- * @link:http://www.goodmall.com/
- * @copyright: Copyright (c) 2020
- * Author: james
- * Date: 2020-04-20
- * Time: 15:41
- */
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-dialog-select');
- ?>
- <style>
- @media screen and (min-width:1370px) {
- .form-body {
- padding: 20px 0;
- padding-right: 50%;
- min-width: 1400px;
- }
- }
- @media screen and (max-width:1369px) {
- .form-body {
- padding: 20px 0;
- padding-right: 20%;
- }
- }
- .form-body {
- background-color: #fff;
- margin-bottom: 20px;
- }
- .form-button {
- margin: 0 !important;
- }
- .form-button .el-form-item__content {
- margin-left: 0 !important;
- }
- .button-item {
- padding: 9px 25px;
- }
- .agent-item-input {
- display: flex;
- align-items: center;
- margin-top: 16px;
- }
- .agent-item-input .item-lab-title {
- width: 80px;
- margin-right: 20px;
- }
- </style>
- <div id="app" v-cloak>
- <el-card style="border:0;min-width: 800px;" shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" v-loading="loading">
- <div slot="header">基础设置</div>
- <div v-if="load">
- <div class="form-body">
- <el-form ref="form" :model="form" :rules="rules" label-width="120px" size="small">
- <el-form-item label="页面名称" prop="page_name">
- <el-input placeholder="运营笔记" style="width: 400px;" maxlength="200" v-model="form.page_name"></el-input>
- <br/>
- <div class="tips-text" style="line-height: 24px;">
- 功能命名
- </div>
- </el-form-item>
- <el-form-item label="显示搜索" prop="hidden_search">
- <el-switch v-model="form.hidden_search" :active-value="1" :inactive-value="0" active-text="显示" inactive-text="不显示">
- </el-switch>
- <div v-if="form.hidden_search==1">
- <el-input placeholder="请输入搜索标题名称" style="width: 400px;" maxlength="200" v-model="form.search_title"></el-input>
- </div>
- <br/>
- <div class="tips-text" style="line-height: 24px;">
- 前端是否显示搜索功能,通过搜索找到对应笔记
- </div>
- </el-form-item>
- <el-form-item label="允许发布" prop="allow_user_create">
- <el-switch v-model="form.allow_user_create" :active-value="1" :inactive-value="0" active-text="允许" inactive-text="不允许">
- </el-switch>
- <br/>
- <div class="tips-text" style="line-height: 24px;">
- 开启则允许前端用户发布笔记,关闭则只能后台商家发布笔记
- </div>
- </el-form-item>
- <el-form-item label="是否需要审核" prop="need_check">
- <el-switch v-model="form.need_check" :active-value="1" :inactive-value="0" active-text="开启" inactive-text="关闭">
- </el-switch>
- <br/>
- <div class="tips-text" style="line-height: 24px;">
- 前端笔记发布是否需要审核
- </div>
- </el-form-item>
- <el-form-item label="分享者显示" prop="share_user_show">
- <el-switch v-model="form.share_user_show" :active-value="1" :inactive-value="0" active-text="开启" inactive-text="关闭">
- </el-switch>
- <br/>
- <div class="tips-text" style="line-height: 24px;">
- 笔记发布是否显示发布会员
- </div>
- </el-form-item>
- </el-form>
- </div>
- <el-button class="button-item" :loading="btnLoading" type="primary" size="small" @click="store('form')" style="margin-bottom: 15px;">保存</el-button>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- testSelect: '',
- loading: false,
- load: false,
- btnLoading: false,
- selectedGoodList: [],
- checkedCities1: [0], //这个放多选选中的项
- cities: ['消费次数', '消费金额', '消费商品'],
- form: {
- page_name: '',
- hidden_search: '',
- search_title: '',
- allow_user_create: '',
- need_check: '',
- share_user_show: '',
- // is_can_use_sensitive: false, // 是否可以打开敏感词检测
- },
- rules: {
- },
- };
- },
- created() {
- this.loadData();
- },
- methods: {
- // 敏感词检测开关切换
- CheckSwich(val) {
- if (val == 1 && !this.is_can_use_sensitive) {
- this.$alert('系统尚未配置百度敏感词检测功能,请先到 设置->商城设置->敏感词过滤 配置相应数据', '提示', {
- confirmButtonText: '确定',
- });
- this.form.client_status = 0;
- return false;
- }
- },
- // 0.0.1 选中状态的值
- checkBoxArr() {
- console.log(this.checkedCities1);
- },
- // 0.2 拿到设置信息
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'operating-note/config/index'
- }
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- // this.is_can_use_sensitive = e.data.data.is_can_use_sensitive;
- if (e.data.data) {
- this.form = e.data.data;
- }
- this.load = true;
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.btnLoading = false;
- });
- },
- // 提交表单
- store(formName) {
- console.log(this.form);
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.btnLoading = true;
- let postForm = this.form;
- request({
- params: {
- r: 'operating-note/config/index'
- },
- method: 'post',
- data: {
- // form: JSON.stringify(postForm),
- form: postForm
- }
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- this.loadData();
- } else {
- this.$message.error(e.data.msg)
- }
- }).catch(e => {
- // this.$message.error(e);
- this.btnLoading = false;
- });
- } else {
- this.btnLoading = false;
- return false;
- }
- })
- },
- },
- filters: {
- checkedStatus(status) {
- if (this.checkedCities1.indexOf(status) > -1) {
- return true
- } else {
- return false;
- }
- }
- },
- });
- </script>
|