member-center.blade.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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. <style scoped>
  83. /*上传图片 */
  84. .addImg-box {
  85. width: 700px;
  86. display: flex;
  87. flex-wrap: wrap;
  88. /* border: 1px solid red; */
  89. cursor: pointer;
  90. }
  91. /* 点击事件添加 */
  92. .addLevel {
  93. margin-left: 65px;
  94. }
  95. .el-icon-plus {
  96. margin-top: 28px;
  97. }
  98. .addImg-list {
  99. width: 250px;
  100. height: 130px;
  101. margin-right: 20px;
  102. margin-bottom: 20px;
  103. position: relative;
  104. }
  105. .select-price {
  106. margin-top: 20px;
  107. }
  108. /* 商品图片添加 */
  109. .add-price-img {
  110. width: 250px;
  111. height: 130px;
  112. text-align: center;
  113. line-height: 20px;
  114. cursor: pointer;
  115. position: relative;
  116. border: 1px solid #ccc;
  117. }
  118. .anew {
  119. width: 100%;
  120. color: whitesmoke;
  121. text-align: center;
  122. background: rgba(0, 0, 0, .5) !important;
  123. padding: 5px 0 5px 0;
  124. position: absolute;
  125. bottom: 0;
  126. }
  127. .cancel-box {
  128. width: 16px;
  129. height: 16px;
  130. background: black;
  131. position: absolute;
  132. top: -9px;
  133. right: -9px;
  134. border-radius: 50%;
  135. }
  136. .cancel {
  137. color: white;
  138. font-size: 17px;
  139. line-height: 19px;
  140. text-indent: 0px;
  141. position: relative;
  142. left: 2px;
  143. top: -10px;
  144. }
  145. .el-icon-plus:before {
  146. font-size: 35px;
  147. }
  148. .select-img {
  149. margin-left: 135px;
  150. }
  151. .el-form-item__label {
  152. /*font-weight: 600;*/
  153. }
  154. /* 多选框 */
  155. .checkLis_text {
  156. font-weight: 600;
  157. margin-right: 10px;
  158. }
  159. /* 文本 */
  160. .p_text {
  161. color: black;
  162. font-size: 12px;
  163. font-family: "微软雅黑";
  164. opacity: .9;
  165. }
  166. .select_text_box {
  167. width: 65%;
  168. color: black;
  169. text-align: left;
  170. opacity: .9;
  171. font-size: 12px;
  172. line-height: 20px;
  173. font-family: "微软雅黑";
  174. margin-left: 68px;
  175. margin-top: 20px;
  176. }
  177. .select_text_box>p:nth-child(1) {
  178. margin-bottom: 5px;
  179. }
  180. /* 提示文字居中 */
  181. .el-popper[x-placement^=top] {
  182. text-align: center;
  183. }
  184. .el-popover--plain {
  185. font-size: 10px;
  186. }
  187. .el-popper[x-placement^=top] {
  188. /* display: none; */
  189. }
  190. [v-cloak] {
  191. display: none;
  192. }
  193. .rectangle-txt {
  194. margin-top: 100px;
  195. color: black;
  196. font-weight: 600;
  197. opacity: .6;
  198. user-select: none;
  199. margin-left:15px;
  200. }
  201. .add-goods-box{display: flex;margin-left: 68px;align-items: center;justify-content: center;width: 120px;height: 120px;border: 1px dashed #ccc;}
  202. .img-box{width: 120px;height: 120px;position: relative;}
  203. .delete{position: absolute;right: 0;top: 0;width: 100%;height: 100%;background-color: rgba(0, 0, 0, .7);display: none;justify-content: center;align-items: center;}
  204. .img-box:hover .delete{display: flex;}
  205. .goods-info>img{width: 40px;height: 40px;}
  206. .el-table{height: 70vh;max-height: 700px;overflow-y: auto;}
  207. .goods-list .el-dialog {display: flex;flex-direction: column;margin: 0 !important;position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);}
  208. .goods-list .el-dialog .el-dialog__body {flex: 1;overflow: auto;}
  209. </style>
  210. <div style="padding: 10px">
  211. @include('layouts.newTabs')
  212. <div>
  213. <div id="app" v-cloak>
  214. <div class="total-head block" style="margin: 0 0 20px 0;padding: 0">
  215. <!-- 基本信息 -->
  216. <div class="block">
  217. <div class="vue-title">
  218. <div class="vue-title-left"></div>
  219. <div class="vue-title-content">基本信息</div>
  220. </div>
  221. <el-form ref="form" :model="form" label-width="15%">
  222. <el-form-item label="会员中心显示余额">
  223. <template>
  224. <el-switch
  225. v-model="form.show_balance"
  226. active-value="0"
  227. inactive-value="1"
  228. >
  229. </el-switch>
  230. </template>
  231. <div style="font-size:12px;">提示:会员中心是否显示会员余额字样</div>
  232. </el-form-item>
  233. <el-form-item label="会员中心显示积分">
  234. <template>
  235. <el-switch
  236. v-model="form.show_point"
  237. active-value="0"
  238. inactive-value="1"
  239. >
  240. </el-switch>
  241. </template>
  242. <div style="font-size:12px;">提示:会员中心是否显示会员积分!</div>
  243. </el-form-item>
  244. <el-form-item label="会员中心显示会员ID">
  245. <template>
  246. <el-switch
  247. v-model="form.show_member_id"
  248. active-value="0"
  249. inactive-value="1"
  250. >
  251. </el-switch>
  252. </template>
  253. <div style="font-size:12px;">提示:会员中心是否显示会员ID!</div>
  254. </el-form-item>
  255. </el-form>
  256. </div>
  257. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  258. <!-- 会员关系 -->
  259. <div class="block">
  260. <div class="vue-title">
  261. <div class="vue-title-left"></div>
  262. <div class="vue-title-content">会员关系</div>
  263. </div>
  264. <el-form ref="form" :model="form" label-width="15%">
  265. <el-form-item label="会员关系页面显示推荐人">
  266. <el-switch active-value="1" inactive-value="0" v-model="form.is_referrer" active-color="#29BA9C" inactive-color="#ccc"></el-switch>
  267. </el-form-item>
  268. <el-form-item label="会员关系页面显示推荐人上级">
  269. <el-switch active-value="1" inactive-value="0" v-model="form.parent_is_referrer" active-color="#29BA9C" inactive-color="#ccc"></el-switch>
  270. </el-form-item>
  271. <el-form-item label="推荐人电话微信号">
  272. <el-switch active-value="1" inactive-value="0" v-model="form.is_recommend_wechat" active-color="#29BA9C" inactive-color="#ccc"></el-switch>
  273. </el-form-item>
  274. <el-form-item label="显示关系等级">
  275. <el-checkbox-group v-model="form.relation_level">
  276. <el-checkbox label="1">
  277. <span class="checkLis_text">1级</span>
  278. <el-input clearable style="width:300px" v-model="form.name1" placeholder="一级关系等级"></el-input>
  279. </el-checkbox><br>
  280. <el-checkbox label="2" style="margin-top:10px">
  281. <span class="checkLis_text">2级</span>
  282. <el-input clearable v-model="form.name2" style="width:300px" placeholder="二级关系等级"></el-input>
  283. </el-checkbox>
  284. </el-checkbox-group>
  285. </el-form-item>
  286. <el-form-item label="显示按钮">
  287. <el-checkbox-group style="line-height: 0; margin-top:10px" v-model="form.nameInfo">
  288. <el-checkbox :label="'wechat'">微信</el-checkbox>
  289. <el-checkbox :label="'phone'">手机</el-checkbox>
  290. <el-checkbox :label="'realname'">姓名</el-checkbox>
  291. </el-checkbox-group>
  292. <div class="select_text_box" style="margin: 0 0 10px;line-height: 1;">
  293. 勾选后,页面将显示下级微信、手机号,如果个人资料中没有填写微信和绑定手机号,将不显示图标 !
  294. </div>
  295. </el-form-item>
  296. <el-form-item label="统计商品">
  297. <el-radio-group v-model="form.is_statistical_goods">
  298. <el-radio label="1">开启</el-radio>
  299. <el-radio label="0">关闭</el-radio>
  300. </el-radio-group>
  301. <div class="select_text_box" style="margin: 0 0 10px;line-height: 1;">开启后,前端会员中心-客户显示商品的购买数量(统计团队已完成订单的商品数量,包含自购)</div>
  302. <div style="display: flex;" v-if="form.is_statistical_goods == 1">
  303. <div class="add-goods-box" @click="showGoodsList">
  304. <div style="text-align: center;line-height: 2;">
  305. <i class="el-icon-plus" style="font-size: 30px;color: #ccc;"></i>
  306. <div>添加商品</div>
  307. </div>
  308. </div>
  309. <div style="margin: 0 10px;display: flex;" v-for="(item,i) in form.statistical_goods" :key="i">
  310. <div>
  311. <div class="img-box">
  312. <img :src="item.thumb_url" style="width: 100%;height: 100%;">
  313. <div class="delete">
  314. <i class="el-icon-delete" style="color: red;font-size: 20px;" @click="form.statistical_goods.splice(i,1)"></i>
  315. </div>
  316. </div>
  317. <div class="select_text_box" style="margin: 0;width: 120px;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;">
  318. [[item.title]]</div>
  319. </div>
  320. <div style="width: 260px;margin-left: 10px;">
  321. <el-input v-model="item.custom_name" placeholder="自定义名称"></el-input>
  322. <div style="line-height: 1.5;color: #8c8c8c;font-size: 12px;">自定义名称前端显示,默认为商品原来的名称</div>
  323. </div>
  324. </div>
  325. </div>
  326. </el-form-item>
  327. </el-form>
  328. </div>
  329. </div>
  330. <div class="goods-list">
  331. <el-dialog title="提示" :visible.sync="show" width="800px" class="aaa">
  332. <div style="display: flex;">
  333. <el-input v-model="keyword" placeholder="请输入关键字搜索" style="margin-right: 20px;"></el-input>
  334. <el-button type="primary" @click="getGoods">搜 索</el-button>
  335. </div>
  336. <el-table :data="tableData" style="width: 100%">
  337. <el-table-column prop="id" label="ID" width="180"></el-table-column>
  338. <el-table-column label="商品">
  339. <template slot-scope="scope">
  340. <div class="goods-info">
  341. <img :src="scope.row.thumb_url" alt="">
  342. <div class="tips goods-title">[[scope.row.title]]</div>
  343. </div>
  344. </template>
  345. </el-table-column>
  346. <el-table-column label="操作" width="100">
  347. <template slot-scope="scope">
  348. <el-button @click="handleClick(scope.row)" type="text" size="small">[[queryGoods(scope.row)?"已":""]]选择</el-button>
  349. </template>
  350. </el-table-column>
  351. </el-table>
  352. <el-pagination @current-change="getGoods" :current-page.sync="page" :page-size="per_page" layout="total, prev, pager, next" :total="total" bachground></el-pagination>
  353. </el-dialog>
  354. </div>
  355. <div class="confirm-btn">
  356. <el-button type="primary" @click="submit">提交</el-button>
  357. </div>
  358. </div>
  359. </div>
  360. </div>
  361. <script>
  362. var vm = new Vue({
  363. el: '#app',
  364. delimiters: ['[[', ']]'],
  365. data() {
  366. let set = {!! json_encode(($set?:[])) !!};
  367. return {
  368. type:'',
  369. selNum:'',
  370. form:{
  371. ...set
  372. },
  373. tableData:[],
  374. show:false,
  375. keyword:"",
  376. total:0,
  377. page:0,
  378. per_page:0,
  379. }
  380. },
  381. created() {
  382. },
  383. mounted () {
  384. console.log(this.form,111);
  385. },
  386. methods: {
  387. loading(text) {
  388. return this.$loading({
  389. lock: true,
  390. text: text,
  391. spinner: 'el-icon-loading',
  392. background: 'rgba(0, 0, 0, 0.7)'
  393. });
  394. },
  395. submit() {
  396. let that = this;
  397. let url = '{!! yzWebFullUrl('member.member-set.member-center-store') !!}';
  398. let json = {
  399. set : this.form
  400. };
  401. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  402. this.$http.post(url,json).then(response => {
  403. if (response.data.result) {
  404. this.$message({type: 'success',message: response.data.msg});
  405. } else {
  406. this.$message({message: response.data.msg,type: 'error'});
  407. }
  408. loading.close();
  409. // location.reload();
  410. },response => {
  411. loading.close();
  412. });
  413. },
  414. showGoodsList() {
  415. if (!this.tableData || this.tableData.length <= 0) this.getGoods();
  416. this.show = true;
  417. },
  418. getGoods() {
  419. let loading = this.loading("正在获取数据中...");
  420. this.$http.post("{!! yzWebFullUrl('goods.goods.get-search-goods-json') !!}", {keyword: this.keyword, page: this.page}).then(({data: {result,msg,data: {goods}}}) => {
  421. loading.close();
  422. if (result == 1) {
  423. this.tableData = goods.data;
  424. this.total = goods.total;
  425. this.per_page = goods.per_page;
  426. } else this.$message.error(msg);
  427. })
  428. },
  429. queryGoods(row){
  430. let statistical_goods = this.form.statistical_goods;
  431. if(!statistical_goods) return false;
  432. for(let i = 0;i<statistical_goods.length;i++){
  433. if(statistical_goods[i].id == row.id) return true;
  434. }
  435. return false;
  436. },
  437. handleClick(row){
  438. if(this.queryGoods(row)) return this.$message.error("已经选择此商品");
  439. if(!this.form.statistical_goods) this.form.statistical_goods = [];
  440. if ( this.form.statistical_goods.length >=2) return this.$message.error("最多只能选择两件商品");
  441. this.form.statistical_goods.push(row);
  442. },
  443. }
  444. })
  445. </script>
  446. @endsection