| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- @extends('layouts.base')
- @section('title', '基础设置')
- @section('content')
- <link rel="stylesheet" href="{{resource_get('plugins/pc-terminal/views/admin/index.css')}}">
- <style>
- .vue-main{background: #eff3f6;}
- /* 导航 */
- .el-radio-button .el-radio-button__inner,.el-radio-button:first-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;border-left: 0px;}
- .el-radio-button__inner{border:0;}
- .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
- .el-radio__label{
- display: none;
- }
- /deep/ .el-radio__inner {
- width: 20px;
- height: 20px;
- background: transparent !important;
- box-sizing: border-box;
- border: 2px solid #4f9efd;
- }
- /deep/.el-radio__inner::after {
- background: #4f9efd;
- width: 10px;
- height: 10px;
- }
- /deep/.el-radio__label {
- font-size: 20px;
- color: #a0b2d3;
- font-weight: bolder;
- }
- /deep/.el-radio__input.is-checked + .el-radio__label {
- color: #4f9efd;
- }
- </style>
- <div class="all">
- <div id="app" v-cloak>
- <el-form ref="form" :model="form" label-width="15%">
- <div class="vue-head">
- <el-radio-group v-model="order_type">
- <el-radio-button label="1" @click.native="gotoOther(1)">基础设置</el-radio-button>
- <el-radio-button label="2" @click.native="gotoOther(2)">SEO设置</el-radio-button>
- <el-radio-button label="3" @click.native="gotoOther(3)">顶部导航</el-radio-button>
- <el-radio-button label="4" @click.native="gotoOther(4)">底部导航</el-radio-button>
- <el-radio-button label="5" @click.native="gotoOther(5)">登录页设置</el-radio-button>
- <el-radio-button label="6" @click.native="gotoOther(6)">聚合搜索</el-radio-button>
- </el-radio-group>
- </div>
- <div class="vue-head" style="margin-top:20px">
- <div class="vue-main-title">
- <div class="vue-main-title-left"></div>
- <div class="vue-main-title-content">聚合搜索</div>
- </div>
- <div class="vue-main-form">
- <el-row type="flex" :gutter="20" style="font-size: 14px;font-weight: bold">
- <el-col :span="4" :offset="2"><span>模块</span></el-col>
- <el-col :span="4"><span>自定义文案</span></el-col>
- <el-col :span="4" :offset="2"><span>默认搜索</span></el-col>
- </el-row>
- <div style="margin-top: 20px;">
- <div v-for="(item, index) in searchModule" class="checkbox-pane" style="display: inline">
- <el-row type="flex" :gutter="20" >
- <el-col :span="4" :offset="2"><span>[[item.name]]</span></el-col>
- <el-col :span="4"><el-input :placeholder="item.diy_text" v-model="item.diy_text" ></el-input></el-col>
- <el-col :span="4" :offset="2"><el-radio v-model="defaultModule" :label="item.key"></el-radio></el-col>
- </el-row>
- </div>
- </div>
- <el-form-item label="关闭原模块搜索" prop="searchModuleClose" style="margin-top: 20px;">
- <el-checkbox-group v-model="searchModuleClose" >
- <el-checkbox v-for="(item, index) in closeOption"
- :label="item.key" :value="item.value" name="type">[[item.name]]
- </el-checkbox>
- </el-checkbox-group>
- <div class="tip">勾选后,原模块中的独立搜索框将不再显示</div>
- </el-form-item>
- </div>
- </div>
- </el-form>
- <!-- 分页 -->
- <div class="vue-page">
- <div class="vue-center">
- <el-button type="primary" @click="submitForm('form')">提交</el-button>
- <el-button @click="goBack">返回</el-button>
- </div>
- </div>
- </div>
- </div>
- <script>
- var app = new Vue({
- el:"#app",
- delimiters: ['[[', ']]'],
- name: 'test',
- data() {
- let moduleSet = [];
- let moduleClose = [];
- let closeOption = [
- {
- "name": "知识库",
- "key":"knowledge",
- "value": false
- },
- {
- "name": "微社区",
- "key":"community",
- "value": false
- }
- ]
- let searchModule=[
- {"name":"商品","key":"goods","diy_text":"商品","is_default":true},
- {"name":"文章","key":"article","diy_text":"文章","is_default":false},
- {"name":"知识库","key":"knowledge","diy_text":"知识库","is_default":false},
- {"name":"微贴","key":"post","diy_text":"微贴","is_default":false},
- {"name":"短视频","key":"video","diy_text":"短视频","is_default":false},
- ]
- let form={}
- let searchModuleClose=[]
- let defaultModule='goods'
- return{
- searchModuleClose,
- form,
- order_type:'6',
- closeOption,
- searchModule,
- defaultModule
- }
- },
- created() {
- },
- mounted() {
- let moduleSet=JSON.parse('{!! $moduleSet?:"[]" !!}')
- let moduleClose=JSON.parse('{!! $moduleClose?:"[]" !!}')
- if(moduleSet.length){
- for (let cItem of moduleSet) {
- if ( cItem.is_default=="true") {
- this.defaultModule = cItem.key
- }
- }
- this.searchModule=moduleSet
- }
- if(moduleClose.length){
- for (let cItem of moduleClose) {
- if ( cItem.value=="true") {
- this.searchModuleClose.push(cItem.key)
- }
- }
- }
- },
- methods: {
- submitForm(formName) {
- for (let cItem of this.searchModule) {
- if (this.defaultModule == cItem.key) {
- cItem.is_default = "true"
- } else {
- cItem.is_default = "false"
- }
- }
- for (let cItem of this.closeOption) {
- if (this.searchModuleClose.indexOf(cItem.key)!=-1) {
- cItem.value = "true"
- } else {
- cItem.value = "false"
- }
- }
- this.$refs[formName].validate((valid) => {
- if (valid) {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.pc-terminal.admin.set.search-set') !!}',{formData:{moduleClose:this.closeOption,moduleSet:this.searchModule}}).then(response => {
- if (response.data.result) {
- this.$message({message: response.data.msg,type: 'success'});
- } else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- loading.close();
- },response => {
- loading.close();
- });
- }
- else {
- console.log('error submit!!');
- return false;
- }
- });
- },
-
- goBack() {
- history.go(-1)
- },
- gotoOther(type) {
- let url = ""
- if(type==1) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.basic') !!}'
- }
- else if(type==2) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.seo') !!}'
- }
- else if(type==3) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.nav-top') !!}'
- }
- else if(type==4) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.nav-bottom') !!}'
- }
- else if(type==5) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.login-set') !!}'
- }
- else if(type==6) {
- //url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.search-set') !!}'
- }
- if(url) {
- window.location.href=url
- }
- },
-
- },
- })
- </script>
- @endsection
|