basic.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. @extends('layouts.base')
  2. @section('title', '基础设置')
  3. @section('content')
  4. <link href="{{static_url('yunshop/css/total.css')}}" media="all" rel="stylesheet" type="text/css" />
  5. <link rel="stylesheet" href="{{static_url('css/public-number.css')}}">
  6. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  7. <style scoped>
  8. .main-panel{
  9. margin-top:50px;
  10. }
  11. .main-panel #re_content {
  12. padding: 10px;
  13. }
  14. .panel{
  15. margin-bottom:10px!important;
  16. border-radius: 10px;
  17. padding-left: 20px;
  18. }
  19. .panel .active a {
  20. background-color: #29ba9c!important;
  21. border-radius: 18px!important;
  22. color:#fff;
  23. }
  24. .panel a{
  25. border:none!important;
  26. background-color:#fff!important;
  27. }
  28. .content{
  29. background: #eff3f6;
  30. padding:10px!important;
  31. }
  32. .con{
  33. padding-bottom:40px;
  34. position:relative;
  35. border-radius: 8px;
  36. }
  37. .con .setting .block{
  38. padding:10px;
  39. background-color:#fff;
  40. border-radius: 8px;
  41. }
  42. .block{
  43. padding:10px;
  44. background-color:#fff;
  45. border-radius: 8px;
  46. }
  47. .con .setting .block .title{
  48. font-size:18px;
  49. margin-bottom:15px;
  50. display:flex;
  51. align-items:center;
  52. }
  53. .confirm-btn{
  54. width: calc(100% - 266px);
  55. position:fixed;
  56. bottom:0;
  57. right:0;
  58. margin-right:10px;
  59. line-height:63px;
  60. background-color: #ffffff;
  61. box-shadow: 0px 8px 23px 1px
  62. rgba(51, 51, 51, 0.3);
  63. background-color:#fff;
  64. text-align:center;
  65. }
  66. b{
  67. font-size:14px;
  68. }
  69. .el-checkbox__inner{
  70. border:solid 1px #56be69!important;
  71. }
  72. .upload-boxed .el-icon-close {
  73. position: absolute;
  74. top: -5px;
  75. right: -5px;
  76. color: #fff;
  77. background: #333;
  78. border-radius: 50%;
  79. cursor: pointer;
  80. }
  81. </style>
  82. <div style="padding: 10px">
  83. @include('layouts.newTabs')
  84. <div>
  85. <div id="app" v-cloak>
  86. <div class="total-head block" style="margin: 0 0 20px 0;padding: 0">
  87. <!-- 基础设置 -->
  88. <div class="block">
  89. <div class="vue-title">
  90. <div class="vue-title-left"></div>
  91. <div class="vue-title-content">基础设置</div>
  92. </div>
  93. <el-form ref="form" :model="form" label-width="15%">
  94. <el-form-item label="Banner">
  95. <div class="upload-box" @click="openUpload('banner','1','one')" v-if="!form.banner_url" style="width:250px;height:150px;">
  96. <i class="el-icon-plus" style="font-size:32px"></i>
  97. </div>
  98. <div @click="openUpload('banner','1','one')" class="upload-boxed" v-if="form.banner_url" style="width:250px;height:150px;">
  99. <img :src="form.banner_url" alt="" style="width:250px;height:150px;border-radius: 5px;cursor: pointer;">
  100. <div class="upload-boxed-text">点击重新上传</div>
  101. <i class="el-icon-close" @click.stop="clearImg('banner')" title="点击清除图片"></i>
  102. </div>
  103. <div class="tip">长方形图片</div>
  104. </el-form-item>
  105. <el-form-item label="会员默认头像">
  106. <div class="upload-box" @click="openUpload('headimg',1,'one')" v-if="!form.headimg_url">
  107. <i class="el-icon-plus" style="font-size:32px"></i>
  108. </div>
  109. <div @click="openUpload('headimg',1,'one')" class="upload-boxed" v-if="form.headimg_url" style="height:150px;">
  110. <img :src="form.headimg_url" alt="" style="width:150px;height:150px;border-radius: 5px;cursor: pointer;">
  111. <div class="upload-boxed-text">点击重新上传</div>
  112. <i class="el-icon-close" @click.stop="clearImg('headimg')" title="点击清除图片"></i>
  113. </div>
  114. <div class="tip">会员默认头像(会员自定义头像>微信头像>商城默认头像)</div>
  115. </el-form-item>
  116. <upload-multimedia-img :upload-show="uploadShow" :type="type" :name="chooseImgName" :sel-Num="selNum" @replace="changeProp" @sure="sureImg"></upload-multimedia-img>
  117. </el-form>
  118. </div>
  119. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  120. <!-- 通知设置 -->
  121. <div class="block">
  122. <div class="vue-title">
  123. <div class="vue-title-left"></div>
  124. <div class="vue-title-content">通知设置</div>
  125. </div>
  126. <el-form ref="form" :model="form" label-width="15%">
  127. <!-- 推广客户 -->
  128. <el-form-item style="margin-left:100px" label="获得推广权限通知">
  129. <el-select clearable style="width:500px;margin-right:10px" v-model="form.member_agent" filterable placeholder="请选择">
  130. <el-option v-for="item in temp_list" :key="item.id" :label="item.title" :value="item.id">
  131. </el-option>
  132. </el-select>
  133. <el-switch v-model="form.member_agent_default" :active-value="1" :inactive-value="0" @change="changeModal('member_agent')"></el-switch>
  134. </el-form-item>
  135. <!-- 新增客户 -->
  136. <el-form-item style="margin-left:100px" label="新增客户通知">
  137. <el-select clearable style="width:500px;margin-right:10px" v-model="form.member_new_lower" filterable placeholder="请选择">
  138. <el-option v-for="item in temp_list" :key="item.id" :label="item.title" :value="item.id">
  139. </el-option>
  140. </el-select>
  141. <el-switch v-model="form.member_new_lower_default" :active-value="1" :inactive-value="0" @change="changeModal('member_new_lower')"></el-switch>
  142. </el-form-item>
  143. </el-form>
  144. </div>
  145. </div>
  146. <div class="confirm-btn">
  147. <el-button type="primary" @click="submit">提交</el-button>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. @include('public.admin.uploadMultimediaImg')
  153. <script>
  154. var vm = new Vue({
  155. el: '#app',
  156. delimiters: ['[[', ']]'],
  157. data() {
  158. let set = {!! json_encode(($set?:[])) !!};
  159. let temp_list = {!! json_encode(($temp_list?:[])) !!};
  160. return {
  161. uploadShow:false,
  162. chooseImgName:'',
  163. uploadListShow:false,
  164. chooseImgListName:'',
  165. type:'',
  166. selNum:'',
  167. form:{
  168. ...set
  169. },
  170. temp_list:temp_list,
  171. }
  172. },
  173. created() {
  174. },
  175. mounted () {
  176. console.log(this.form,111);
  177. },
  178. methods: {
  179. openUpload(str,type,sel) {
  180. this.chooseImgName = str;
  181. this.uploadShow = true;
  182. this.type = type
  183. this.selNum = sel
  184. },
  185. changeProp(val) {
  186. if(val == true) {
  187. this.uploadShow = false;
  188. }
  189. else {
  190. this.uploadShow = true;
  191. }
  192. },
  193. sureImg(name,uploadShow,fileList) {
  194. if(fileList.length <= 0) {
  195. return
  196. }
  197. console.log(name)
  198. console.log(fileList)
  199. this.form[name] =fileList[0].attachment;
  200. this.form[name+'_url'] = fileList[0].url;
  201. console.log(this.form[name],'aaaaa')
  202. console.log( this.form[name+'_url'],'bbbbb')
  203. },
  204. clearImg(str,type,index) {
  205. if(!type) {
  206. this.form[str] = "";
  207. this.form[str+'_url'] = "";
  208. }
  209. else {
  210. this.form[str].splice(index,1);
  211. this.form[str+'_url'].splice(index,1);
  212. }
  213. this.$forceUpdate();
  214. },
  215. // 消息模板开关
  216. changeModal(name) {
  217. let url_open = "{!! yzWebUrl('setting.default-notice.index') !!}"
  218. let url_close = "{!! yzWebUrl('setting.default-notice.cancel') !!}"
  219. let url = "";
  220. if(this.form[name+'_default']==1) {
  221. url = url_open;
  222. } else {
  223. url = url_close;
  224. }
  225. let json = {
  226. notice_name: name,
  227. setting_name: "relation_base",
  228. }
  229. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  230. this.$http.post(url,json).then(response => {
  231. if (response.data.result == 1) {
  232. this.$message({type: 'success',message: '操作成功!'});
  233. if(this.form[name+'_default'] == 0) {
  234. this.form[name+'_default'] = 1;
  235. this.form[name] = response.data.id;
  236. } else {
  237. this.form[name+'_default'] = 0;
  238. this.form[name] = '';
  239. }
  240. } else {
  241. this.$message({message: response.data.msg,type: 'error'});
  242. this.form[name+'_default'] = 0;
  243. }
  244. loading.close();
  245. },response => {
  246. loading.close();
  247. });
  248. },
  249. submit() {
  250. let that = this;
  251. let url = '{!! yzWebFullUrl('member.member-set.basic-store') !!}';
  252. let json = {
  253. set : this.form
  254. };
  255. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  256. this.$http.post(url,json).then(response => {
  257. if (response.data.result) {
  258. this.$message({type: 'success',message: response.data.msg});
  259. } else {
  260. this.$message({message: response.data.msg,type: 'error'});
  261. }
  262. loading.close();
  263. // location.reload();
  264. },response => {
  265. loading.close();
  266. });
  267. },
  268. }
  269. })
  270. </script>
  271. @endsection