information.blade.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  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. .con .setting .block .title{
  43. font-size:18px;
  44. margin-bottom:15px;
  45. display:flex;
  46. align-items:center;
  47. }
  48. .confirm-btn{
  49. width: calc(100% - 266px);
  50. position:fixed;
  51. bottom:0;
  52. right:0;
  53. margin-right:10px;
  54. line-height:63px;
  55. background-color: #ffffff;
  56. box-shadow: 0px 8px 23px 1px
  57. rgba(51, 51, 51, 0.3);
  58. background-color:#fff;
  59. text-align:center;
  60. }
  61. b{
  62. font-size:14px;
  63. }
  64. .el-checkbox__inner{
  65. border:solid 1px #56be69!important;
  66. }
  67. .upload-boxed .el-icon-close {
  68. position: absolute;
  69. top: -5px;
  70. right: -5px;
  71. color: #fff;
  72. background: #333;
  73. border-radius: 50%;
  74. cursor: pointer;
  75. }
  76. </style>
  77. <style>
  78. .panel{
  79. margin-bottom:10px!important;
  80. padding-left: 20px;
  81. border-radius: 10px;
  82. }
  83. .panel .active a {
  84. background-color: #29ba9c!important;
  85. border-radius: 18px!important;
  86. color:#fff;
  87. }
  88. .panel a{
  89. border:none!important;
  90. background-color:#fff!important;
  91. }
  92. .content{
  93. background: #eff3f6;
  94. padding:10px!important;
  95. }
  96. .con{
  97. padding-bottom:40px;
  98. position:relative;
  99. border-radius: 8px;
  100. min-height:100vh;
  101. background-color:#fff;
  102. }
  103. .con .setting .block{
  104. padding:10px;
  105. background-color:#fff;
  106. border-radius: 8px;
  107. margin-bottom:10px;
  108. }
  109. .block{
  110. padding:10px;
  111. background-color:#fff;
  112. border-radius: 8px;
  113. }
  114. .con .setting .block .title{
  115. font-size:18px;
  116. margin-bottom:15px;
  117. display:flex;
  118. align-items:center;
  119. justify-content:space-between;
  120. }
  121. .confirm-btn{
  122. width: calc(100% - 266px);
  123. position:fixed;
  124. bottom:0;
  125. right:0;
  126. margin-right:10px;
  127. line-height:63px;
  128. background-color: #ffffff;
  129. box-shadow: 0px 8px 23px 1px
  130. rgba(51, 51, 51, 0.3);
  131. background-color:#fff;
  132. text-align:center;
  133. }
  134. .el-form-item__label{
  135. margin-right:30px;
  136. }
  137. .add{
  138. width: 100px;
  139. height: 36px;
  140. border-radius: 4px;
  141. border: solid 1px #29ba9c;
  142. color:#29ba9c;
  143. display:flex;
  144. align-items:center;
  145. justify-content:center;
  146. }
  147. .list-wrap{
  148. padding-left:10%;
  149. }
  150. .list{
  151. width: 911px;
  152. height: 159px;
  153. background-color: #f5f5f5;
  154. border-radius: 4px;
  155. margin-bottom:20px;
  156. box-sizing:border-box;
  157. padding:40px 0;
  158. position:relative;
  159. }
  160. .list .delete{
  161. width: 26px;
  162. height: 26px;
  163. background-color: #dee2ee;
  164. border-radius:50%;
  165. display:flex;
  166. align-items:center;
  167. justify-content:center;
  168. position:absolute;
  169. right:0;
  170. top:0;
  171. font-size:16px;
  172. }
  173. b{
  174. font-size:14px;
  175. }
  176. </style>
  177. <div style="padding: 10px">
  178. @include('layouts.newTabs')
  179. <div>
  180. <div id="app" v-cloak>
  181. <div class="total-head block" style="margin: 0 0 20px 0;padding: 0">
  182. <!-- 基础信息 -->
  183. <div class="block">
  184. <div class="vue-title">
  185. <div class="vue-title-left"></div>
  186. <div class="vue-title-content">基本信息</div>
  187. </div>
  188. <el-form ref="form" :model="form" label-width="15%">
  189. <el-form-item label="注册填写">
  190. <template>
  191. <el-switch
  192. v-model="form.basic_register"
  193. active-value="1"
  194. inactive-value="0"
  195. >
  196. </el-switch>
  197. </template>
  198. <div class="tip">默认开启,开启后用户在注册会员、绑定手机号时需要填写自定义字段信息,开启手机验证码快速登录不显示该信息!关闭则仅在设置-会员资料中显示!</div>
  199. </el-form-item>
  200. <el-form-item label="基本信息">
  201. <span style="margin: 0 30px 0 20px; font-size: 14px; color: #666;font-weight: 400;">名称</span>
  202. <span style="margin: 0 30px 0 50px; font-size: 14px; color: #666;font-weight: 400;">是否必填</span>
  203. </el-form-item>
  204. <el-form-item label="">
  205. <el-checkbox v-model="form.name" style="margin: 0 30px 0 20px; font-size: 14px; color: #666;font-weight: 400;">姓名</el-checkbox>
  206. <el-switch
  207. v-model="form.name_must"
  208. active-value="1"
  209. inactive-value="0"
  210. style="margin: 0 30px 0 50px; font-size: 14px; color: #666;font-weight: 400;"
  211. >
  212. </el-switch>
  213. </el-form-item>
  214. <el-form-item label="">
  215. <el-checkbox v-model="form.sex" style="margin: 0 30px 0 20px; font-size: 14px; color: #666;font-weight: 400;">性别</el-checkbox>
  216. <el-switch
  217. v-model="form.sex_must"
  218. active-value="1"
  219. inactive-value="0"
  220. style="margin: 0 30px 0 50px; font-size: 14px; color: #666;font-weight: 400;"
  221. >
  222. </el-switch>
  223. </el-form-item>
  224. <el-form-item label="">
  225. <el-checkbox v-model="form.address" style="margin: 0 0 0 20px; font-size: 14px; color: #666;font-weight: 400;">详细地址</el-checkbox>
  226. <el-switch
  227. v-model="form.address_must"
  228. active-value="1"
  229. inactive-value="0"
  230. style="margin: 0 30px 0 50px; font-size: 14px; color: #666;font-weight: 400;"
  231. >
  232. </el-switch>
  233. </el-form-item>
  234. <el-form-item label="">
  235. <el-checkbox v-model="form.birthday" style="margin: 0 30px 0 20px; font-size: 14px; color: #666;font-weight: 400;">生日</el-checkbox>
  236. <el-switch
  237. v-model="form.birthday_must"
  238. active-value="1"
  239. inactive-value="0"
  240. style="margin: 0 30px 0 50px; font-size: 14px; color: #666;font-weight: 400;"
  241. >
  242. </el-switch>
  243. </el-form-item>
  244. </el-form>
  245. </div>
  246. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  247. <!-- 头像昵称 -->
  248. <div class="block">
  249. <div class="vue-title">
  250. <div class="vue-title-left"></div>
  251. <div class="vue-title-content">头像昵称</div>
  252. </div>
  253. <el-form ref="form" :model="form" label-width="15%">
  254. <el-form-item label="修改昵称头像">
  255. <template>
  256. <el-switch
  257. v-model="form.change_info"
  258. active-value="1"
  259. inactive-value="0"
  260. >
  261. </el-switch>
  262. </template>
  263. <div class="tip">默认开启,用户可以在会员中心-设置中修改头像昵称</div>
  264. </el-form-item>
  265. </el-form>
  266. </div>
  267. <!-- 自定义字段-固定 -->
  268. <div class="block">
  269. <div class="vue-title">
  270. <div class="vue-title-left"></div>
  271. <div class="vue-title-content">自定义字段-固定</div>
  272. </div>
  273. <el-form ref="form" :model="form" label-width="15%">
  274. <el-form-item label="自定义字段-固定">
  275. <template>
  276. <el-switch
  277. v-model="form.is_custom"
  278. active-value="1"
  279. inactive-value="0"
  280. >
  281. </el-switch>
  282. </template>
  283. <div class="tip">提示:开启后,在会员中心--设置中显示字段,用户编辑资料填写!会员列表可搜索!</div>
  284. </el-form-item>
  285. <el-form-item label="注册填写">
  286. <template>
  287. <el-switch
  288. v-model="form.is_custom_register"
  289. active-value="1"
  290. inactive-value="0"
  291. >
  292. </el-switch>
  293. </template>
  294. <div class="tip">默认开启,开启后用户在注册会员、绑定手机号时需要填写自定义字段信息,开启手机验证码快速登录不显示该信息!关闭则仅在设置-会员资料中显示!</div>
  295. </el-form-item>
  296. <el-form-item label="自定义字段显示名称">
  297. <el-input v-model="form.custom_title" style="width:70%;" placeholder=""></el-input>
  298. </el-form-item>
  299. </el-form>
  300. </div>
  301. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  302. <!-- 自定义 -->
  303. <div class="block">
  304. <div class="vue-title">
  305. <div class="vue-title-left"></div>
  306. <div class="vue-title-content">自定义</div>
  307. </div>
  308. <el-form ref="form" :model="form" label-width="15%">
  309. <el-form-item label="自定义必填开启">
  310. <template>
  311. <el-switch
  312. v-model="form.form_open"
  313. active-value="1"
  314. inactive-value="0"
  315. >
  316. </el-switch>
  317. </template>
  318. <div class="tip">开启后,自定义字段必填</div>
  319. </el-form-item>
  320. <el-form-item label="注册填写">
  321. <template>
  322. <el-switch
  323. v-model="form.form_register"
  324. active-value="1"
  325. inactive-value="0"
  326. >
  327. </el-switch>
  328. </template>
  329. <div class="tip">默认开启,开启后用户在注册会员、绑定手机号时需要填写自定义字段信息,开启手机验证码快速登录不显示该信息!关闭则仅在设置-会员资料中显示!</div>
  330. </el-form-item>
  331. <el-form-item label="前端禁止编辑">
  332. <template>
  333. <el-switch
  334. v-model="form.form_edit"
  335. active-value="1"
  336. inactive-value="0"
  337. >
  338. </el-switch>
  339. </template>
  340. <div class="tip">开启后,前端会员设置不可编辑</div>
  341. </el-form-item>
  342. <el-form-item label="自定义字段">
  343. <el-button type="primary" @click="addBlock">添加</el-button>
  344. </el-form-item>
  345. <div class="list-wrap">
  346. <div class="list" v-for="(item,index) in form.form">
  347. <div>
  348. <span style="display:inline-block;margin-right:30px;width:150px;text-align:right;">排序</span>
  349. <el-input v-model="item.sort" style="width:60%;"></el-input>
  350. </div>
  351. <div style="margin-top:20px;">
  352. <span style="display:inline-block;margin-right:30px;width:150px;text-align:right;">自定义字段名称</span>
  353. <el-input v-model="item.name" style="width:60%;"></el-input>
  354. </div>
  355. <a style="color:#666;"><div class="delete" @click="deleteBlock(index)">x</div></a>
  356. </div>
  357. </div>
  358. </el-form>
  359. </div>
  360. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  361. <!-- 自定义表单 -->
  362. <div class="block">
  363. <div class="vue-title" v-show="{!! app('plugins')->isEnabled('diyform') !!}">
  364. <div class="vue-title-left"></div>
  365. <div class="vue-title-content">自定义表单</div>
  366. </div>
  367. <el-form ref="form" :model="form" label-width="15%" v-show="{!! app('plugins')->isEnabled('diyform') !!}">
  368. <el-form-item label="自定义表单">
  369. <template>
  370. <el-select v-model="form.form_id" name="form_id" clearable>
  371. <el-option
  372. v-for="item in diyForm"
  373. :label="item.title"
  374. :value="item.id">
  375. </el-option>
  376. </el-select>
  377. </template>
  378. </el-form-item>
  379. <el-form-item label="注册填写">
  380. <template>
  381. <el-switch
  382. v-model="form.form_id_register"
  383. active-value="1"
  384. inactive-value="0"
  385. >
  386. </el-switch>
  387. </template>
  388. <div class="tip">默认开启,开启后用户在注册会员、绑定手机号时需要填写自定义字段信息,开启手机验证码快速登录不显示该信息!关闭则仅在设置-会员资料中显示!</div>
  389. </el-form-item>
  390. </el-form>
  391. </div>
  392. </div>
  393. <div class="confirm-btn">
  394. <el-button type="primary" @click="submit">提交</el-button>
  395. </div>
  396. </div>
  397. </div>
  398. </div>
  399. @include('public.admin.uploadMultimediaImg')
  400. <script>
  401. var vm = new Vue({
  402. el: '#app',
  403. delimiters: ['[[', ']]'],
  404. data() {
  405. let set = {!! json_encode(($set?:[])) !!};
  406. let diyForm = {!! json_encode(($diyForm?:[])) !!};
  407. return {
  408. uploadShow:false,
  409. chooseImgName:'',
  410. uploadListShow:false,
  411. chooseImgListName:'',
  412. type:'',
  413. selNum:'',
  414. form:{
  415. ...set
  416. },
  417. diyForm:diyForm,
  418. }
  419. },
  420. created() {
  421. },
  422. mounted () {
  423. console.log(this.form,111);
  424. },
  425. methods: {
  426. openUpload(str,type,sel) {
  427. this.chooseImgName = str;
  428. this.uploadShow = true;
  429. this.type = type
  430. this.selNum = sel
  431. },
  432. changeProp(val) {
  433. if(val == true) {
  434. this.uploadShow = false;
  435. }
  436. else {
  437. this.uploadShow = true;
  438. }
  439. },
  440. sureImg(name,uploadShow,fileList) {
  441. if(fileList.length <= 0) {
  442. return
  443. }
  444. console.log(name)
  445. console.log(fileList)
  446. this.form[name] =fileList[0].attachment;
  447. this.form[name+'_url'] = fileList[0].url;
  448. console.log(this.form[name],'aaaaa')
  449. console.log( this.form[name+'_url'],'bbbbb')
  450. },
  451. clearImg(str,type,index) {
  452. if(!type) {
  453. this.form[str] = "";
  454. this.form[str+'_url'] = "";
  455. }
  456. else {
  457. this.form[str].splice(index,1);
  458. this.form[str+'_url'].splice(index,1);
  459. }
  460. this.$forceUpdate();
  461. },
  462. // 消息模板开关
  463. changeModal(name) {
  464. let url_open = "{!! yzWebUrl('setting.default-notice.index') !!}"
  465. let url_close = "{!! yzWebUrl('setting.default-notice.cancel') !!}"
  466. let url = "";
  467. if(this.form[name+'_default']==1) {
  468. url = url_close;
  469. } else {
  470. url = url_open;
  471. }
  472. let json = {
  473. notice_name: name,
  474. setting_name: "relation_base",
  475. }
  476. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  477. this.$http.post(url,json).then(response => {
  478. if (response.data.result == 1) {
  479. this.$message({type: 'success',message: '操作成功!'});
  480. if(this.form[name+'_default'] == 0) {
  481. this.form[name+'_default'] = 1;
  482. this.form[name] = response.data.id;
  483. } else {
  484. this.form[name+'_default'] = 0;
  485. this.form[name] = '';
  486. }
  487. } else {
  488. this.$message({message: response.data.msg,type: 'error'});
  489. this.form[name+'_default'] = 0;
  490. }
  491. loading.close();
  492. },response => {
  493. loading.close();
  494. });
  495. },
  496. submit() {
  497. let that = this;
  498. let url = '{!! yzWebFullUrl('member.member-set.information-store') !!}';
  499. let json = {
  500. set : this.form
  501. };
  502. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  503. this.$http.post(url,json).then(response => {
  504. if (response.data.result) {
  505. this.$message({type: 'success',message: response.data.msg});
  506. } else {
  507. this.$message({message: response.data.msg,type: 'error'});
  508. }
  509. loading.close();
  510. // location.reload();
  511. },response => {
  512. loading.close();
  513. });
  514. },
  515. addBlock(){
  516. this.form.form.push({name:"",sort:""});
  517. },
  518. deleteBlock(index){
  519. this.form.form.splice(index,1)
  520. },
  521. }
  522. })
  523. </script>
  524. @endsection