index.blade.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. @extends('layouts.base')
  2. @section('title', '基础设置')
  3. @section('content')
  4. <link rel="stylesheet" href="{{static_url('css/public-number.css')}}">
  5. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  6. <style>
  7. .main-panel{
  8. margin-top:50px;
  9. }
  10. .panel{
  11. margin-bottom:10px!important;
  12. padding-left: 20px;
  13. border-radius: 10px;
  14. }
  15. .panel .active a {
  16. background-color: #29ba9c!important;
  17. border-radius: 18px!important;
  18. color:#fff;
  19. }
  20. .panel a{
  21. border:none!important;
  22. background-color:#fff!important;
  23. }
  24. .content{
  25. background: #eff3f6;
  26. padding: 10px!important;
  27. }
  28. .con{
  29. padding-bottom:40px;
  30. position:relative;
  31. border-radius: 8px;
  32. min-height:100vh;
  33. background-color:#fff;
  34. }
  35. .con .setting .block{
  36. padding:10px;
  37. background-color:#fff;
  38. border-radius: 8px;
  39. }
  40. .con .setting .block .title{
  41. font-size:18px;
  42. margin-bottom:15px;
  43. display:flex;
  44. align-items:center;
  45. }
  46. .confirm-btn{
  47. width: calc(100% - 266px);
  48. position:fixed;
  49. bottom:0;
  50. right:0;
  51. margin-right:10px;
  52. line-height:63px;
  53. background-color: #ffffff;
  54. box-shadow: 0px 8px 23px 1px
  55. rgba(51, 51, 51, 0.3);
  56. background-color:#fff;
  57. text-align:center;
  58. }
  59. b{
  60. font-size:14px;
  61. }
  62. </style>
  63. <div id='re_content' >
  64. <div class="con">
  65. <div class="setting">
  66. <el-row>
  67. <el-button type="primary" disabled>基础设置</el-button>
  68. <el-button type="success" @click="code()">授权码管理</el-button>
  69. <el-button type="info" @click="codeLog()">使用记录</el-button>
  70. </el-row>
  71. <div style="background: #eff3f6;width:100%;height:15px;margin-top: 1em;"></div>
  72. <el-form ref="form" :model="form" label-width="15%">
  73. <div class="block">
  74. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>基础设置</b></div>
  75. <el-form-item label="开启授权码">
  76. <template>
  77. <el-switch
  78. v-model="form.open_code"
  79. active-value="1"
  80. inactive-value="0"
  81. >
  82. </el-switch>
  83. </template>
  84. </el-form-item>
  85. <el-form-item label="前端显示" >
  86. <template>
  87. <el-switch
  88. v-model="form.front_show"
  89. active-value="1"
  90. inactive-value="0"
  91. >
  92. </el-switch>
  93. </template>
  94. </el-form-item>
  95. <el-form-item label="海报背景" prop="head_img_url">
  96. <div class="upload-box" @click="openUpload('share_img')" v-if="!form.share_img_url">
  97. <i class="el-icon-plus" style="font-size:32px"></i>
  98. </div>
  99. <div @click="openUpload('share_img')" class="upload-boxed" v-if="form.share_img_url">
  100. <img :src="form.share_img_url" alt="" style="width:150px;height:150px;border-radius: 5px;cursor: pointer;">
  101. <div class="upload-boxed-text">点击重新上传</div>
  102. </div>
  103. <div>建议尺寸:640*1008</div>
  104. </el-form-item>
  105. <upload-img :upload-show="uploadShow" :name="chooseImgName" @replace="changeProp" @sure="sureImg"></upload-img>
  106. </div>
  107. <div class="confirm-btn">
  108. <el-button type="primary" @click="submit">提交</el-button>
  109. </div>
  110. </el-form>
  111. </div>
  112. </div>
  113. </div>
  114. @include('public.admin.uploadImg')
  115. <script>
  116. var vm = new Vue({
  117. el: "#re_content",
  118. delimiters: ['[[', ']]'],
  119. data() {
  120. let set={!!$set?:'{}' !!}
  121. return {
  122. uploadShow:false,
  123. chooseImgName:'',
  124. uploadListShow:false,
  125. chooseImgListName:'',
  126. form:{
  127. open_code:set&&set.open_code?set.open_code:'0',
  128. front_show:set&&set.front_show?set.front_show:'0',
  129. share_img:set&&set.share_img?set.share_img:'',
  130. share_img_url:set&&set.share_img_url?set.share_img_url:'',
  131. },
  132. }
  133. },
  134. mounted () {
  135. },
  136. methods: {
  137. openUpload(str) {
  138. this.chooseImgName = str;
  139. this.uploadShow = true;
  140. },
  141. changeProp(val) {
  142. if(val == true) {
  143. this.uploadShow = false;
  144. }
  145. else {
  146. this.uploadShow = true;
  147. }
  148. },
  149. sureImg(name,image,image_url) {
  150. this.form.share_img = image;
  151. this.form.share_img_url = image_url;
  152. },
  153. submit() {
  154. this.$http.post('{!! yzWebFullUrl('plugin.room.admin.anchor-manage.basicCode') !!}',{'data':this.form}).then(function (response){
  155. if (response.data.result) {
  156. this.$message({message: response.data.msg,type: 'success'});
  157. }else {
  158. this.$message({message: response.data.msg,type: 'error'});
  159. }
  160. console.log(response);
  161. //location.reload();
  162. },function (response) {
  163. console.log(response);
  164. this.$message({message: response.data.msg,type: 'error'});
  165. })
  166. },
  167. code() {
  168. window.location.href = "{!! yzWebFullUrl('plugin.room.admin.anchor-manage.codeList') !!}";
  169. },
  170. codeLog() {
  171. window.location.href = "{!! yzWebFullUrl('plugin.room.admin.anchor-manage.usageRecord') !!}";
  172. },
  173. codeBasic() {
  174. window.location.href = "{!! yzWebFullUrl('plugin.room.admin.anchor-manage.basicCode') !!}";
  175. },
  176. },
  177. });
  178. </script>
  179. @endsection