nav-bottom.blade.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. @extends('layouts.base')
  2. @section('title', '基础设置')
  3. @section('content')
  4. <link rel="stylesheet" href="{{resource_get('plugins/pc-terminal/views/admin/index.css')}}">
  5. <style>
  6. /* 导航 */
  7. .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;}
  8. .el-radio-button__inner{border:0;}
  9. .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
  10. </style>
  11. <div class="all">
  12. <div id="app" v-cloak>
  13. <el-form ref="form" :model="form" :rules="rules" label-width="15%">
  14. <div class="vue-head">
  15. <el-radio-group v-model="order_type">
  16. <el-radio-button label="1" @click.native="gotoOther(1)">基础设置</el-radio-button>
  17. <el-radio-button label="2" @click.native="gotoOther(2)">SEO设置</el-radio-button>
  18. <el-radio-button label="3" @click.native="gotoOther(3)">顶部导航</el-radio-button>
  19. <el-radio-button label="4" @click.native="gotoOther(4)">底部导航</el-radio-button>
  20. <el-radio-button label="5" @click.native="gotoOther(5)">登录页设置</el-radio-button>
  21. <el-radio-button label="6" @click.native="gotoOther(6)">聚合搜索</el-radio-button>
  22. </el-radio-group>
  23. </div>
  24. <div class="vue-main">
  25. <div class="vue-main-title">
  26. <div class="vue-main-title-left"></div>
  27. <div class="vue-main-title-content" style="flex:0 0 80px">底部导航</div>
  28. {{--<div style="color:red">(只在PC版生效)</div>--}}
  29. </div>
  30. <div class="vue-main-form">
  31. <el-form-item label="" prop="nav_bottom">
  32. <el-input v-model="form.nav_bottom" type="textarea" rows="25" style="width:70%"></el-input>
  33. </el-form-item>
  34. </div>
  35. </div>
  36. </el-form>
  37. <!-- 分页 -->
  38. <div class="vue-page">
  39. <div class="vue-center">
  40. <el-button type="primary" @click="submitForm('form')">提交</el-button>
  41. <el-button @click="goBack">返回</el-button>
  42. </div>
  43. </div>
  44. <upload-img :upload-show="uploadShow" :name="chooseImgName" @replace="changeProp" @sure="sureImg"></upload-img>
  45. </div>
  46. </div>
  47. @include('public.admin.uploadImg')
  48. <script>
  49. var app = new Vue({
  50. el:"#app",
  51. delimiters: ['[[', ']]'],
  52. name: 'test',
  53. data() {
  54. let set = {!! json_encode($set)!!};
  55. let default_nav_bottom = {!! json_encode($default_nav_bottom)!!};
  56. return{
  57. order_type:'4',
  58. id:0,
  59. content:"",
  60. form:{
  61. nav_bottom:set&&set.nav_bottom?set.nav_bottom:default_nav_bottom
  62. },
  63. uploadShow:false,
  64. chooseImgName:'',
  65. submit_url:'',
  66. showVisible:false,
  67. loading: false,
  68. p:{
  69. province:'',
  70. city:'',
  71. district:'',
  72. street:'',
  73. },
  74. province_list:[],
  75. city_list:[],
  76. district_list:[],
  77. street_list:[],
  78. areaLoading:false,
  79. street:1,
  80. template_list:[],
  81. rules:{
  82. },
  83. }
  84. },
  85. created() {
  86. },
  87. mounted() {
  88. // this.getData();
  89. },
  90. methods: {
  91. submitForm(formName) {
  92. console.log(this.form)
  93. let that = this;
  94. let json = {
  95. nav_bottom:this.form.nav_bottom,
  96. };
  97. this.$refs[formName].validate((valid) => {
  98. if (valid) {
  99. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  100. this.$http.post('{!! yzWebFullUrl('plugin.pc-terminal.admin.set.nav-bottom') !!}',{set:json}).then(response => {
  101. if (response.data.result) {
  102. this.$message({type: 'success',message: '操作成功!'});
  103. } else {
  104. this.$message({message: response.data.msg,type: 'error'});
  105. }
  106. loading.close();
  107. },response => {
  108. loading.close();
  109. });
  110. }
  111. else {
  112. console.log('error submit!!');
  113. return false;
  114. }
  115. });
  116. },
  117. goBack() {
  118. history.go(-1)
  119. },
  120. gotoOther(type) {
  121. let url = ""
  122. if(type==1) {
  123. url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.basic') !!}'
  124. }
  125. else if(type==2) {
  126. url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.seo') !!}'
  127. }
  128. else if(type==3) {
  129. url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.nav-top') !!}'
  130. }
  131. else if(type==4) {
  132. // url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.nav-bottom') !!}'
  133. }
  134. else if(type==5) {
  135. url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.login-set') !!}'
  136. }
  137. else if(type==6) {
  138. url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.search-set') !!}'
  139. }
  140. if(url) {
  141. window.location.href=url
  142. }
  143. },
  144. copyLink(type) {
  145. this.$refs[type].select();
  146. document.execCommand("Copy")
  147. this.$message.success("复制成功!");
  148. },
  149. openUpload(str) {
  150. this.chooseImgName = str;
  151. this.uploadShow = true;
  152. },
  153. changeProp(val) {
  154. if(val == true) {
  155. this.uploadShow = false;
  156. }
  157. else {
  158. this.uploadShow = true;
  159. }
  160. },
  161. sureImg(name,image,image_url) {
  162. this.form[name] = image;
  163. this.form[name+'_url'] = image_url;
  164. },
  165. clearImg(str) {
  166. this.form[str] = "";
  167. this.form[str+'_url'] = "";
  168. this.$forceUpdate();
  169. },
  170. },
  171. })
  172. </script>
  173. @endsection