info.blade.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. @extends('layouts.base')
  2. @section('content')
  3. <link rel="stylesheet" href="{{static_url('css/public-number.css')}}">
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <style>
  6. .content{
  7. background: #eff3f6;
  8. padding: 10px!important;
  9. padding-top: 20px!important;
  10. }
  11. .con{
  12. padding-bottom:20px;
  13. position:relative;
  14. border-radius: 8px;
  15. background-color:#fff;
  16. min-height:100vh;
  17. }
  18. .con .setting .block{
  19. padding:10px;
  20. background-color:#fff;
  21. border-radius: 8px;
  22. }
  23. .con .setting .block .title{
  24. font-size:18px;
  25. margin-bottom:15px;
  26. display:flex;
  27. align-items:center;
  28. }
  29. .confirm-btn{
  30. width: calc(100% - 266px);
  31. position:fixed;
  32. bottom:0;
  33. right:0;
  34. margin-right:10px;
  35. line-height:63px;
  36. background-color: #ffffff;
  37. box-shadow: 0px 8px 23px 1px
  38. rgba(51, 51, 51, 0.3);
  39. background-color:#fff;
  40. text-align:center;
  41. }
  42. b{
  43. font-size:14px;
  44. }
  45. .vue-crumbs a {
  46. color: #333;
  47. }
  48. .vue-crumbs a:hover {
  49. color: #29ba9c;
  50. }
  51. .vue-crumbs {
  52. margin: 0 20px;
  53. font-size: 14px;
  54. color: #333;
  55. font-weight: 400;
  56. padding-bottom: 10px;
  57. padding-top: 10px;
  58. line-height: 32px;
  59. }
  60. .upload-boxed .el-icon-close {
  61. position: absolute;
  62. top: -5px;
  63. right: -5px;
  64. color: #fff;
  65. background: #333;
  66. border-radius: 50%;
  67. cursor: pointer;
  68. }
  69. </style>
  70. <div id='re_content' >
  71. <div class="vue-crumbs">
  72. <a @click="goBack">分时预约</a> > 幻灯片 > 添加幻灯片
  73. </div>
  74. <div class="con">
  75. <div class="setting">
  76. <el-form ref="form" :model="form" label-width="15%">
  77. <div class="block">
  78. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>基础设置</b></div>
  79. <el-form-item label="排序">
  80. <el-input v-model="form.display_order" style="width:70%;"></el-input>
  81. </el-form-item>
  82. <el-form-item label="幻灯片标题">
  83. <el-input v-model="form.name" style="width:70%;"></el-input>
  84. </el-form-item>
  85. <el-form-item label="幻灯片图片" prop="head_img_url">
  86. <div class="upload-box" @click="openUpload('thumb')" v-if="!form.thumb_url">
  87. <i class="el-icon-plus" style="font-size:32px"></i>
  88. </div>
  89. <div @click="openUpload('thumb')" class="upload-boxed" v-if="form.thumb_url" style="height:75px;">
  90. <img :src="form.thumb_url" alt="" style="width:150px;height:75px;border-radius: 5px;cursor: pointer;">
  91. <div class="upload-boxed-text">点击重新上传</div>
  92. <i class="el-icon-close" @click.stop="clearImg('thumb')" title="点击清除图片"></i>
  93. </div>
  94. <div class="tip">建议尺寸:750 * 300 , 请将所有幻灯片图片尺寸保持一致</div>
  95. </el-form-item>
  96. <upload-img :upload-show="uploadShow" :name="chooseImgName" @replace="changeProp" @sure="sureImg"></upload-img>
  97. <el-form-item label="幻灯片链接">
  98. <el-input v-model="form.link" style="width:70%;"></el-input><el-button @click="show=true">选择链接</el-button>
  99. </el-form-item>
  100. <el-form-item label="幻灯片小程序链接">
  101. <el-input v-model="form.small_link" style="width:70%;"></el-input><el-button @click="pro=true">选择小程序链接</el-button>
  102. </el-form-item>
  103. <el-form-item label="是否显示">
  104. <template>
  105. <el-switch
  106. v-model="form.is_open"
  107. active-value="1"
  108. inactive-value="0"
  109. >
  110. </el-switch>
  111. </template>
  112. </el-form-item>
  113. </div>
  114. </div>
  115. <div class="confirm-btn">
  116. <el-button @click="submit" type="primary">提交</el-button>
  117. </div>
  118. <pop :show="show" @replace="changeProp1" @add="parHref"></pop>
  119. <program :pro="pro" @replacepro="changeprogram" @addpro="parpro"></program>
  120. </el-form>
  121. </div>
  122. </div>
  123. @include('public.admin.pop')
  124. @include('public.admin.program')
  125. @include('public.admin.uploadImg')
  126. <script>
  127. var vm = new Vue({
  128. el: "#re_content",
  129. delimiters: ['[[', ']]'],
  130. data() {
  131. let data = {!! $model ?: '{}'!!}
  132. return {
  133. activeName: 'first',
  134. show:false,//是否开启公众号弹窗
  135. pro:false ,//是否开启小程序弹窗
  136. uploadShow:false,
  137. chooseImgName:'',
  138. uploadListShow:false,
  139. chooseImgListName:'',
  140. form:{
  141. id : data.id,
  142. display_order: data.display_order,
  143. name:data.name,
  144. link:data.link,
  145. thumb:data.thumb,
  146. thumb_url:data.thumb_url,
  147. small_link:data.small_link,
  148. is_open:String(data.is_open)
  149. },
  150. }
  151. },
  152. mounted () {
  153. },
  154. methods: {
  155. clearImg(str,type,index) {
  156. if(!type) {
  157. this.form[str] = "";
  158. this.form[str+'_url'] = "";
  159. }
  160. else {
  161. this.form[str].splice(index,1);
  162. this.form[str+'_url'].splice(index,1);
  163. }
  164. this.$forceUpdate();
  165. },
  166. goBack() {
  167. window.location.href = `{!! yzWebFullUrl('plugin.reserve-simple.admin.carousel.index') !!}`;
  168. },
  169. openUpload(str) {
  170. this.chooseImgName = str;
  171. this.uploadShow = true;
  172. },
  173. changeProp(val) {
  174. if(val == true) {
  175. this.uploadShow = false;
  176. }
  177. else {
  178. this.uploadShow = true;
  179. }
  180. },
  181. sureImg(name,image,image_url) {
  182. this.form[name] = image;
  183. this.form[name+'_url'] = image_url;
  184. },
  185. //弹窗显示与隐藏的控制
  186. changeProp1(item){
  187. this.show=item;
  188. },
  189. //当前链接的增加
  190. parHref(child,confirm){
  191. this.show=confirm;
  192. this.form.link=child;
  193. },
  194. changeprogram(item){
  195. this.pro=item;
  196. },
  197. parpro(child,confirm){
  198. this.pro=confirm;
  199. this.form.small_link=child;
  200. },
  201. submit() {
  202. let id = this.form.id
  203. this.$http.post('{!! yzWebFullUrl("plugin.reserve-simple.admin.carousel.edit",array("id" => "") ) !!}'+ id ,{'slide':this.form}).then(function (response){
  204. if (response.data.result) {
  205. this.$message({message: response.data.msg,type: 'success'});
  206. window.location.href='{!! yzWebFullUrl('plugin.reserve-simple.admin.carousel.index') !!}'
  207. }else{
  208. this.$message({type: 'error',message: response.data.msg});
  209. }
  210. },function (response) {
  211. this.$message({message: response.data.msg,type: 'error'});
  212. })
  213. },
  214. },
  215. });
  216. </script>
  217. @endsection('content')