index.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382
  1. <template>
  2. <div class="divBox" style="padding-top: 0">
  3. <el-card
  4. class="box-card"
  5. :body-style="{ paddingLeft: '0px', paddingBottom: '0px' }"
  6. shadow="never"
  7. :bordered="false"
  8. >
  9. <div class="flex">
  10. <!--左侧-->
  11. <div class="tab_view" v-hasPermi="['platform:system:group:list']">
  12. <div
  13. class="cell_item"
  14. :class="{ tab_active: listActive == index }"
  15. v-for="(item, index) in tabList"
  16. :key="index"
  17. @click="ProductNavTab(index)"
  18. >
  19. {{ item }}
  20. </div>
  21. </div>
  22. <!--中间-->
  23. <div class="leftModel">
  24. <div v-show="currentPage == 'home'" class="current_home">
  25. <div class="model_header">
  26. <div class="img">logo区域</div>
  27. <div class="header_search">
  28. <span class="iconfont iconios-search"></span>
  29. </div>
  30. </div>
  31. <div v-hasPermi="['platform:system:group:list']" class="model_banner">
  32. <el-carousel indicator-position="none" height="139px">
  33. <el-carousel-item v-for="(item, index) in dataList[1]" :key="index">
  34. <img
  35. :src="item.pic"
  36. alt=""
  37. :class="{ select_ctive: shows == 1 }"
  38. style="width: 100%; border-radius: 4px"
  39. />
  40. </el-carousel-item>
  41. </el-carousel>
  42. </div>
  43. <div class="model_news" :class="{ select_ctive: shows == 2 }">
  44. <img src="@/assets/imgs/new_header1.png" alt="" style="width: 64px; height: 17px" />
  45. <span style="color: #ccc">|</span>
  46. <p>{{ newsInfo }}</p>
  47. <i class="el-icon-arrow-right"></i>
  48. </div>
  49. <div class="model_nav" :class="{ select_ctive: shows == 3 }">
  50. <div class="model_nav_item" v-for="(item, index) in dataList[0]" :key="index">
  51. <div>
  52. <img :src="item.pic" alt="" />
  53. </div>
  54. <p>{{ item.name }}</p>
  55. </div>
  56. </div>
  57. <!--底部导航-->
  58. <div
  59. v-hasPermi="['platform:system:group:list']"
  60. class="page-foot cur_pointer"
  61. @click="handleMessage('bottomNavigation')"
  62. >
  63. <div class="page-fooot" :class="{ select_ctive: shows == 8 }">
  64. <div class="foot-item" v-for="(item, index) in navigationListTab" :key="index">
  65. <el-image :src="item.checked" alt="" class="el-image" />
  66. <p v-if="index == 0" class="textE93323">{{ item.name }}</p>
  67. <p v-else>{{ item.name }}</p>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div v-show="currentPage == 'cate'">
  73. <img :src="cateImg" alt="" style="width: 100%" />
  74. </div>
  75. <div v-show="currentPage == 'user'">
  76. <div class="user_head">
  77. <div class="user_bg" :style="{ backgroundImage: 'url(' + urlbg + ')' }">
  78. <div class="user_card">
  79. <div class="user_info">
  80. <img :src="menuInfo.userDefaultAvatar" alt="" />
  81. <div class="info">
  82. <p class="nick_name">用户信息</p>
  83. <p class="phone">123456</p>
  84. </div>
  85. </div>
  86. <div class="num_wrapper">
  87. <div class="num_wrap_item">
  88. <p class="num_item_bold">0</p>
  89. <p class="num_title">余额</p>
  90. </div>
  91. <div class="num_wrap_item">
  92. <p class="num_item_bold">0</p>
  93. <p class="num_title">积分</p>
  94. </div>
  95. <div class="num_wrap_item">
  96. <p class="num_item_bold">0</p>
  97. <p class="num_title">优惠券</p>
  98. </div>
  99. <div class="num_wrap_item">
  100. <p class="num_item_bold">0</p>
  101. <p class="num_title">收藏</p>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="order_wrap cur_pointer" :class="{ select_ctive: shows == 9 }" @click="handleMessage('orderMenu')">
  106. <div class="order_wrap_tit">
  107. <span class="weight_600">订单中心</span>
  108. <div>
  109. <span class="font_sm">查看全部</span>
  110. <i class="el-icon-arrow-right"></i>
  111. </div>
  112. </div>
  113. <div class="order_wrap_list">
  114. <div class="order_list_item" v-for="(item, index) in dataList[5]" :key="index">
  115. <img :src="item.pic" alt="" />
  116. <p>{{ item.name }}</p>
  117. </div>
  118. <!-- <div class="order_list_item">
  119. <img src="@/assets/imgs/fukuan.png" alt="" />
  120. <p>待付款</p>
  121. </div>
  122. <div class="order_list_item">
  123. <img src="@/assets/imgs/fahuo.png" alt="" />
  124. <p>待发货</p>
  125. </div>
  126. <div class="order_list_item">
  127. <img src="@/assets/imgs/shouhuo.png" alt="" />
  128. <p>待收货</p>
  129. </div>
  130. <div class="order_list_item">
  131. <img src="@/assets/imgs/pingjia.png" alt="" />
  132. <p>待评价</p>
  133. </div>
  134. <div class="order_list_item">
  135. <img src="@/assets/imgs/tuikuan.png" alt="" />
  136. <p>售后/退款</p>
  137. </div> -->
  138. </div>
  139. </div>
  140. <div
  141. v-hasPermi="['platform:system:group:list']"
  142. class="slider_img cur_pointer"
  143. :class="{ select_ctive: shows == 5 }"
  144. @click="handleMessage('userBanner')"
  145. >
  146. <el-carousel height="69px" :autoplay="true">
  147. <el-carousel-item v-for="(item, index) in dataList[4]" :key="index">
  148. <img :src="item.pic" alt="" style="height: 69px; display: block; margin: auto" />
  149. </el-carousel-item>
  150. </el-carousel>
  151. </div>
  152. <div
  153. class="user_mens cur_pointer"
  154. :class="{ select_ctive: shows == 6 }"
  155. @click="handleMessage('userMenu')"
  156. >
  157. <div class="menu_title">我的服务</div>
  158. <div class="list_box">
  159. <div class="list_box_item" v-for="(item, index) in dataList[2]" :key="index">
  160. <img :src="item.pic" alt="" />
  161. <p>{{ item.name }}</p>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <!--右侧-->
  170. <div class="flex_between">
  171. <div class="right-box" v-if="typeName">
  172. <div class="title-bar-line">模块配置</div>
  173. <div class="mobile-config">
  174. <!--底部菜单-->
  175. <template v-if="typeName === 'bottomNavigation' && checkPermi(['platform:system:group:list'])">
  176. <span class="mr20">是否自定义</span
  177. ><el-switch
  178. :active-value="1"
  179. :inactive-value="0"
  180. active-text="开启"
  181. inactive-text="关闭"
  182. v-model="isCustom"
  183. >
  184. </el-switch>
  185. <div class="box-item" v-for="(item, index) in navigationList" :key="index">
  186. <div class="left-tool">
  187. <div
  188. class="move-icon"
  189. draggable="true"
  190. @dragstart="handleDragStart($event, item)"
  191. @dragover.prevent="handleDragOver($event, item)"
  192. @dragenter="handleDragEnter($event, item, navigationList, 'navigationList')"
  193. @dragend="handleDragEnd($event, item)"
  194. >
  195. <span class="iconfont icon-drag2"></span>
  196. </div>
  197. </div>
  198. <div class="right-wrapper">
  199. <div class="img-wrapper">
  200. <div class="img-item" @click="modalPicTap(true, 'checked', index)">
  201. <img :src="item.checked" alt="" v-if="item.checked" />
  202. <p class="txt" v-if="item.checked">选中</p>
  203. <div class="empty-img" v-else>
  204. <span class="iconfont iconjiahao"></span>
  205. <p>选中</p>
  206. </div>
  207. </div>
  208. <div class="img-item" @click="modalPicTap(true, 'unchecked', index)">
  209. <img :src="item.unchecked" alt="" v-if="item.unchecked" />
  210. <p class="txt" v-if="item.unchecked">未选中</p>
  211. <div class="empty-img" v-else>
  212. <span class="iconfont iconjiahao"></span>
  213. <p>未选中</p>
  214. </div>
  215. </div>
  216. </div>
  217. <div class="info mt20" style="margin-left: 0">
  218. <div class="info-item">
  219. <span>标题</span>
  220. <div class="input-box">
  221. <el-input
  222. v-if="typeName !== 'indexNews'"
  223. v-model.trim="item.name"
  224. :placeholder="'请填写' + item.name"
  225. maxlength="4"
  226. />
  227. <el-input v-else v-model.trim="item.info" :placeholder="'请填写' + item.info" />
  228. </div>
  229. </div>
  230. <div class="info-item">
  231. <span>链接</span>
  232. <div class="input-box" @click="getLink(index)">
  233. <el-input v-model.trim="item.link" placeholder="请填写链接" />
  234. </div>
  235. </div>
  236. <div class="info-item">
  237. <span>状态</span>
  238. <div class="input-box">
  239. <el-switch
  240. v-model="item.status"
  241. :active-value="true"
  242. :inactive-value="false"
  243. active-text="显示"
  244. inactive-text="隐藏"
  245. />
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. <div v-show="index > 0" class="delect-btn" @click.stop="handleDelMenu(item, index)">
  251. <i class="el-icon-circle-close"></i>
  252. </div>
  253. </div>
  254. </template>
  255. <!--其他菜单-->
  256. <template v-if="typeName !== 'bottomNavigation' && checkPermi(['platform:system:group:list'])">
  257. <div v-for="(item, index) in menuList" :key="index" class="item">
  258. <div
  259. class="move-icon"
  260. draggable="true"
  261. @dragstart="handleDragStart($event, item)"
  262. @dragover.prevent="handleDragOver($event, item)"
  263. @dragenter="handleDragEnter($event, item, menuList, 'menuList')"
  264. @dragend="handleDragEnd($event, item)"
  265. >
  266. <span class="iconfont icon-drag2"></span>
  267. </div>
  268. <div class="picBox" v-if="typeName !== 'indexNews'">
  269. <div class="img-box flex justify-center align-center" @click="modalPicTap(false, 'duo', index)">
  270. <img :src="item.pic" alt="" v-if="item.pic" />
  271. <div v-else class="upLoad">
  272. <i class="el-icon-camera cameraIconfont" />
  273. </div>
  274. </div>
  275. </div>
  276. <div
  277. v-if="index > 0 && typeName !== 'indexTabNav'"
  278. class="delect-btn"
  279. @click.stop="bindDelete(item, index)"
  280. >
  281. <i class="el-icon-circle-close"></i>
  282. </div>
  283. <div class="info">
  284. <div v-if="typeName !== 'userBanner'" class="info-item">
  285. <span>标题</span>
  286. <div class="input-box">
  287. <el-input
  288. v-if="typeName !== 'indexNews'"
  289. v-model.trim="item.name"
  290. :placeholder="'请填写' + item.name"
  291. maxlength="4"
  292. />
  293. <el-input v-else v-model.trim="item.info" :placeholder="'请填写' + item.info" />
  294. </div>
  295. </div>
  296. <div class="info-item" v-if="addUrlStatus && typeName !== 'indexTabNav'">
  297. <span>链接</span>
  298. <div class="input-box" @click="getLink(index)">
  299. <el-input v-model.trim="item.url" placeholder="请填写链接" />
  300. </div>
  301. </div>
  302. <div class="info-item" v-if="typeName == 'indexTabNav'">
  303. <span>简介</span>
  304. <div class="input-box">
  305. <el-input v-model.trim="item.info" placeholder="请填写简介" />
  306. </div>
  307. </div>
  308. <div class="info-item">
  309. <span>状态</span>
  310. <div class="input-box">
  311. <el-switch
  312. v-model="item.status"
  313. :active-value="true"
  314. :inactive-value="false"
  315. active-text="显示"
  316. inactive-text="隐藏"
  317. />
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. </template>
  323. <div class="add-btn mb20 mt20">
  324. <el-button @click="addBox" type="primary">添加数据</el-button>
  325. </div>
  326. </div>
  327. </div>
  328. <linkaddress ref="linkaddres" @linkUrl="linkUrl"></linkaddress>
  329. <div class="tip" v-if="!typeName && tip == true && cate == false">请选择左侧可操作可编辑区域</div>
  330. </div>
  331. </div>
  332. <div v-if="!mockGoods" class="footer_btn">
  333. <el-button
  334. type="primary"
  335. @click="saveConfig"
  336. v-hasPermi="[
  337. 'platform:page:layout:index',
  338. 'platform:page:layout:index:menu:save',
  339. 'platform:page:layout:index:banner:save',
  340. 'platform:page:layout:index:banner:save',
  341. 'platform:page:layout:user:menu:save',
  342. 'platform:page:layout:bottom:navigation',
  343. 'platform:page:layout:bottom:navigation:save',
  344. ]"
  345. >保存</el-button
  346. >
  347. </div>
  348. </el-card>
  349. </div>
  350. </template>
  351. <script>
  352. // +---------------------------------------------------------------------
  353. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  354. // +---------------------------------------------------------------------
  355. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  356. // +---------------------------------------------------------------------
  357. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  358. // +---------------------------------------------------------------------
  359. // | Author: CRMEB Team <admin@crmeb.com>
  360. // +---------------------------------------------------------------------
  361. import { designListApi, SaveDataApi, goodDesignList, getDataApi, getBottomNavigationApi } from '@/api/systemGroup';
  362. import ClipboardJS from 'clipboard';
  363. import linkaddress from '@/components/linkaddress';
  364. import { checkPermi } from '@/utils/permission'; // 权限判断函数
  365. import { Debounce } from '@/utils/validate';
  366. export default {
  367. name: 'index',
  368. data() {
  369. return {
  370. iframeUrl: '',
  371. menuList: [],
  372. menuInfo: {},
  373. typeName: 'bottomNavigation',
  374. currentPage: 'home',
  375. modelBanner: [
  376. 'https://image.java.crmeb.net/crmebimage/maintain/2021/07/06/c99ee385e94d4711a0ea4be72169a86euwmzuhxbb2.jpg',
  377. ],
  378. urlbg: require('@/assets/imgs/user_bg.png'),
  379. dataList: [],
  380. addUrlStatus: true,
  381. infoStatus: false,
  382. showStatus: false,
  383. shows: 8,
  384. indextTabMenu: [],
  385. tabActive: 0,
  386. cate: false,
  387. tip: false,
  388. mockGoods: false,
  389. cateArr: [
  390. { img: require('@/assets/imgs/moren.png'), tit: '默认模板' },
  391. { img: require('@/assets/imgs/youxuan.png'), tit: '模板1' },
  392. { img: require('@/assets/imgs/haowu.png'), tit: '模板2' },
  393. { img: require('@/assets/imgs/shengxian.png'), tit: '模板3' },
  394. ],
  395. cateImg: '',
  396. active: 1,
  397. disabled: false,
  398. radio: true,
  399. newsInfo: '',
  400. listActive: 0,
  401. tabList: ['底部导航', '个人中心'],
  402. itemIndex: 0,
  403. navigationList: [], //底部导航
  404. navigationListTab: [], //底部导航左侧展示
  405. isCustom: 0,
  406. };
  407. },
  408. components: {
  409. linkaddress,
  410. },
  411. created() {
  412. this.iframeUrl = `https://app.beta.java.crmeb.net?type=iframeVisualizing`;
  413. },
  414. mounted() {
  415. //监听子页面给当前页面传值
  416. window.addEventListener('message', this.handleMessage, 'bottomNavigation');
  417. if (checkPermi(['platform:page:layout:index'])) this.designList();
  418. if (checkPermi(['platform:page:layout:bottom:navigation'])) this.getBottomNavigation();
  419. this.$set(this, 'tip', true);
  420. this.$nextTick(function () {
  421. const clipboard = new ClipboardJS('.copy-data');
  422. clipboard.on('success', () => {
  423. this.$message.success('复制成功');
  424. });
  425. });
  426. },
  427. methods: {
  428. checkPermi,
  429. //删除底部菜单中的配置项
  430. handleDelMenu(item, index) {
  431. this.navigationList.splice(index, 1);
  432. this.navigationListTab.splice(index, 1);
  433. },
  434. addBox() {
  435. if (this.typeName == 'bottomNavigation') {
  436. const indexMenu = JSON.parse(JSON.stringify(this.navigationList[0]));
  437. indexMenu.id = null;
  438. indexMenu.name = '';
  439. indexMenu.link = '';
  440. indexMenu.checked = '';
  441. indexMenu.unchecked = '';
  442. this.navigationList.push(indexMenu);
  443. } else if (this.menuList.length >= 10 && this.typeName == 'indexMenu') {
  444. this.$message.warning('设置数据不能超过10条');
  445. } else if (this.typeName == 'indexTabNav' && this.menuList.length >= 4) {
  446. this.addUrlStatus = false;
  447. this.infoStatus = true;
  448. this.$message.warning('设置数据不能超过4条');
  449. } else {
  450. const indexMenu ={
  451. id: null,
  452. name: '',
  453. url: '',
  454. info: '',
  455. pic: ''
  456. };
  457. // if(this.menuList.length>0){
  458. // indexMenu=JSON.parse(JSON.stringify(this.menuList[0]));
  459. // }
  460. // indexMenu.id = null;
  461. // indexMenu.name = '';
  462. // indexMenu.url = '';
  463. // indexMenu.info = '';
  464. // indexMenu.pic = '';
  465. this.menuList.push(indexMenu);
  466. }
  467. },
  468. //获取底部导航
  469. getBottomNavigation() {
  470. getBottomNavigationApi().then((res) => {
  471. this.navigationList = res.bottomNavigationList;
  472. let data = res.bottomNavigationList.filter((item) => {
  473. return item.status;
  474. });
  475. this.navigationListTab = data;
  476. this.isCustom = Number(res.isCustom);
  477. });
  478. },
  479. // 获取列表值;
  480. designList() {
  481. designListApi().then((res) => {
  482. this.menuInfo = res;
  483. let newArr = [];
  484. let indexMenu = res.indexMenu.filter((item, index, arr) => {
  485. return item.status == true;
  486. });
  487. let indexBanner = res.indexBanner.filter((item, index, arr) => {
  488. return item.status == true;
  489. });
  490. let userMenu = res.userMenu.filter((item, index, arr) => {
  491. return item.status == true;
  492. });
  493. let indexNews = res.indexNews;
  494. let userBanner = res.userBanner.filter((item, index, arr) => {
  495. return item.status == true;
  496. });
  497. let orderMenu = res.orderMenu.filter((item, index, arr) => {
  498. return item.status == true;
  499. });
  500. newArr.push(indexMenu, indexBanner, userMenu, indexNews, userBanner,orderMenu);
  501. this.dataList = newArr;
  502. this.$set(this, 'newsInfo', indexNews[0] ? indexNews[0].title : '这是一个新闻标题');
  503. });
  504. },
  505. //
  506. handleMessage(event) {
  507. this.typeName = event;
  508. switch (event) {
  509. case 'bottomNavigation':
  510. this.shows = 8;
  511. break;
  512. case 'indexMenu':
  513. this.menuList = this.menuInfo.indexMenu;
  514. this.shows = 3;
  515. this.mockGoods = false;
  516. break;
  517. case 'indexBanner':
  518. this.menuList = this.menuInfo.indexBanner;
  519. this.shows = 1;
  520. this.mockGoods = false;
  521. break;
  522. case 'userMenu':
  523. this.menuList = this.menuInfo.userMenu;
  524. this.shows = 6;
  525. this.mockGoods = false;
  526. break;
  527. case 'indexNews':
  528. this.menuList = this.menuInfo.indexNews;
  529. this.shows = 2;
  530. this.mockGoods = false;
  531. break;
  532. case 'userBanner':
  533. this.menuList = this.menuInfo.userBanner;
  534. this.shows = 5;
  535. this.mockGoods = false;
  536. break;
  537. case 'indexTabNav':
  538. this.menuList = this.indextTabMenu;
  539. this.shows = 4;
  540. this.mockGoods = false;
  541. break;
  542. case 'goodsMock':
  543. this.mockGoods = true;
  544. this.typeName = '';
  545. this.tip = false;
  546. this.shows = 7;
  547. break;
  548. case 'orderMenu':
  549. this.menuList = this.menuInfo.orderMenu;
  550. this.shows = 9;
  551. this.mockGoods = false;
  552. break;
  553. }
  554. },
  555. switchNav(index) {
  556. this.tabActive = index;
  557. },
  558. // 点击商品图
  559. modalPicTap(multiple, num, i) {
  560. const _this = this;
  561. this.$modalUpload(
  562. function (img) {
  563. if (!img) return;
  564. if (num === 'duo') {
  565. _this.menuList[i].pic = img[0].sattDir;
  566. }
  567. if (num === 'checked') {
  568. _this.navigationList[i].checked = img[0].sattDir;
  569. }
  570. if (num === 'unchecked') {
  571. _this.navigationList[i].unchecked = img[0].sattDir;
  572. }
  573. },
  574. multiple,
  575. 'content',
  576. true,
  577. );
  578. },
  579. // 删除
  580. bindDelete(item, index) {
  581. this.menuList.splice(index, 1);
  582. },
  583. saveConfig: Debounce(function () {
  584. switch (this.typeName) {
  585. case 'indexMenu':
  586. this.saveData('indexMenu', '/admin/platform/page/layout/index/menu/save');
  587. break;
  588. case 'indexBanner':
  589. this.saveData('indexBanner', '/admin/platform/page/layout/index/banner/save');
  590. break;
  591. case 'userMenu':
  592. this.saveData('userMenu', '/admin/platform/page/layout/user/menu/save');
  593. break;
  594. case 'indexNews':
  595. this.saveData('indexNews', '/admin/platform/page/layout/index/news/save');
  596. break;
  597. case 'userBanner':
  598. this.saveData('userBanner', '/admin/platform/page/layout/user/banner/save');
  599. break;
  600. case 'indexTabNav':
  601. this.saveData('indexTable', '/admin/platform/page/layout/index/table/save');
  602. break;
  603. case 'bottomNavigation':
  604. this.saveData('bottomNavigation', '/admin/platform/page/layout/bottom/navigation/save');
  605. break;
  606. case 'orderMenu':
  607. this.saveData('orderMenu', '/admin/platform/page/layout/order/menu/save');
  608. break;
  609. }
  610. }),
  611. saveData(param, url) {
  612. let tArr = this.menuList.filter((item, index, arr) => {
  613. return item.status === true;
  614. });
  615. let navigationList = this.navigationList.filter((item, index, arr) => {
  616. return item.status === true;
  617. });
  618. let data = {};
  619. if (param === 'bottomNavigation') {
  620. data = { bottomNavigationList: this.changeIndex(this.navigationList), isCustom: this.isCustom };
  621. if (navigationList.length < 3) return this.$message.warning('设置数据不能小于4条');
  622. } else {
  623. if (param === 'indexMenu' && tArr.length < 5) return this.$message.warning('设置数据不能小于5条');
  624. if (param === 'indexTabNav' && tArr.length < 2) return this.$message.warning('设置数据不能小于2条');
  625. if (param === 'indexNews' && tArr.length < 1) return this.$message.warning('设置数据不能小于1条');
  626. data = { [param]: this.changeIndex(this.menuList) };
  627. }
  628. SaveDataApi(data, url).then((res) => {
  629. this.$message.success('保存成功');
  630. if (param === 'bottomNavigation') {
  631. this.getBottomNavigation();
  632. } else {
  633. this.designList();
  634. }
  635. });
  636. },
  637. changeIndex(array) {
  638. array.map((item, index) => {
  639. item.sort = index + 1;
  640. });
  641. return array;
  642. },
  643. // 移动
  644. handleDragStart(e, item) {
  645. this.dragging = item;
  646. },
  647. handleDragEnd(e, item) {
  648. this.dragging = null;
  649. },
  650. handleDragOver(e) {
  651. e.dataTransfer.dropEffect = 'move';
  652. },
  653. handleDragEnter(e, item, data, name) {
  654. e.dataTransfer.effectAllowed = 'move';
  655. if (item === this.dragging) {
  656. return;
  657. }
  658. const newItems = [...data];
  659. const src = newItems.indexOf(this.dragging);
  660. const dst = newItems.indexOf(item);
  661. newItems.splice(dst, 0, ...newItems.splice(src, 1));
  662. if (name === 'menuList') {
  663. this.menuList = newItems;
  664. } else {
  665. this.navigationList = newItems;
  666. this.navigationListTab = newItems;
  667. }
  668. },
  669. showCurrent(name, type, index) {
  670. this.currentPage = name;
  671. this.shows = index;
  672. this.$set(this, 'typeName', type);
  673. this.$set(this, 'tip', true);
  674. this.$set(this, 'cate', false);
  675. },
  676. showTip() {
  677. this.$message.warning('暂不支持此操作');
  678. },
  679. switchTab(index) {
  680. this.active = index;
  681. switch (index) {
  682. case 1:
  683. this.cateImg = require('@/assets/imgs/moren.png');
  684. break;
  685. case 2:
  686. this.cateImg = require('@/assets/imgs/youxuan.png');
  687. break;
  688. case 3:
  689. this.cateImg = require('@/assets/imgs/haowu.png');
  690. break;
  691. case 4:
  692. this.cateImg = require('@/assets/imgs/shengxian.png');
  693. break;
  694. }
  695. },
  696. save: Debounce(function () {
  697. let data = {
  698. category_page_config: this.active,
  699. is_show_category: this.radio,
  700. };
  701. SaveDataApi(data, '/admin/page/layout/category/config/save').then((res) => {
  702. this.$message.success('保存成功');
  703. });
  704. }),
  705. getConfig() {
  706. getDataApi().then((res) => {
  707. this.$set(this, 'active', res.categoryConfig);
  708. this.$set(this, 'radio', res.isShowCategory === 'true' ? true : false);
  709. this.switchTab(this.active);
  710. });
  711. },
  712. getLink(index) {
  713. this.itemIndex = index;
  714. this.$refs.linkaddres.dialogVisible = true;
  715. },
  716. ProductNavTab(index) {
  717. this.listActive = index;
  718. if (index === 1) {
  719. this.showCurrent('user', 'userMenu', 6);
  720. this.menuList = this.menuInfo.userMenu;
  721. } else {
  722. this.showCurrent('home', 'bottomNavigation', 8);
  723. }
  724. },
  725. linkUrl(e) {
  726. if (this.typeName == 'bottomNavigation') {
  727. this.navigationList[this.itemIndex].link = e;
  728. } else {
  729. this.menuList[this.itemIndex].url = e;
  730. }
  731. },
  732. },
  733. };
  734. </script>
  735. <style scoped lang="scss">
  736. .page-foot {
  737. position: fixed;
  738. bottom: 0;
  739. width: 373px;
  740. }
  741. .box-item {
  742. position: relative;
  743. display: flex;
  744. margin-top: 15px;
  745. padding: 20px 30px 20px 0;
  746. border: 1px solid #dddddd;
  747. border-radius: 3px;
  748. .del-box {
  749. position: absolute;
  750. right: -13px;
  751. top: -18px;
  752. cursor: pointer;
  753. .iconfont {
  754. color: #999;
  755. font-size: 30px;
  756. }
  757. }
  758. .left-tool {
  759. display: flex;
  760. align-items: center;
  761. justify-content: center;
  762. width: 72px;
  763. .iconfont {
  764. color: #999;
  765. font-size: 36px;
  766. cursor: move;
  767. }
  768. }
  769. .right-wrapper {
  770. flex: 1;
  771. .img-wrapper {
  772. display: flex;
  773. .img-item {
  774. position: relative;
  775. width: 80px;
  776. height: 80px;
  777. margin-right: 20px;
  778. cursor: pointer;
  779. }
  780. img {
  781. display: block;
  782. width: 100%;
  783. height: 100%;
  784. }
  785. .empty-img {
  786. display: flex;
  787. align-items: center;
  788. justify-content: center;
  789. flex-direction: column;
  790. width: 100%;
  791. height: 100%;
  792. background: #f7f7f7;
  793. font-size: 12px;
  794. color: #bfbfbf;
  795. .iconfont {
  796. font-size: 16px;
  797. }
  798. }
  799. .txt {
  800. position: absolute;
  801. left: 0;
  802. bottom: 0;
  803. width: 100%;
  804. height: 22px;
  805. line-height: 22px;
  806. text-align: center;
  807. background: rgba(0, 0, 0, 0.4);
  808. color: #fff;
  809. font-size: 12px;
  810. }
  811. }
  812. }
  813. .c_row-item {
  814. margin-top: 10px;
  815. }
  816. }
  817. .page-fooot {
  818. display: flex;
  819. background: #fff;
  820. .foot-item {
  821. flex: 1;
  822. display: flex;
  823. flex-direction: column;
  824. justify-content: center;
  825. align-items: center;
  826. height: 50px;
  827. .el-image {
  828. width: 24px;
  829. height: 24px;
  830. }
  831. p {
  832. padding: 0;
  833. margin: 0;
  834. font-size: 12px;
  835. color: #282828;
  836. margin-top: 3px;
  837. &.on {
  838. color: #00a4f8;
  839. }
  840. }
  841. }
  842. }
  843. ::-webkit-scrollbar {
  844. display: none;
  845. }
  846. .flex {
  847. display: flex;
  848. flex-wrap: nowrap;
  849. }
  850. .justify-center {
  851. justify-content: center;
  852. }
  853. .justify-between {
  854. justify-content: space-between;
  855. }
  856. .align-center {
  857. align-items: center;
  858. }
  859. .iframe-box {
  860. width: 375px;
  861. height: 700px;
  862. border-radius: 4px;
  863. box-shadow: 0 0 7px #cccccc;
  864. margin-right: 50px;
  865. }
  866. .leftModel {
  867. width: 375px;
  868. height: 658px;
  869. border-radius: 4px;
  870. border: 1px solid #cccccc;
  871. margin: 30px 50px 0 0;
  872. background: #f5f5f5;
  873. margin-bottom: 27px;
  874. position: relative;
  875. overflow: auto;
  876. transform: rotate(360deg);
  877. }
  878. .current_home {
  879. width: 100%;
  880. height: 647px;
  881. overflow-y: scroll;
  882. position: relative;
  883. transform: none;
  884. }
  885. .model_header {
  886. width: 375px;
  887. height: 54px;
  888. background: #e93323;
  889. padding: 13px 14px;
  890. box-sizing: border-box;
  891. display: flex;
  892. align-items: center;
  893. }
  894. .model_header .img {
  895. width: 58px;
  896. height: 20px;
  897. line-height: 20px;
  898. text-align: center;
  899. color: #fff;
  900. display: block;
  901. margin-right: 11px;
  902. }
  903. .model_header .header_search {
  904. width: 271px;
  905. height: 28px;
  906. line-height: 28px;
  907. padding: 0 0 0 14px;
  908. background: #f7f7f7;
  909. border: 1px solid #f1f1f1;
  910. border-radius: 14px;
  911. color: #bbb;
  912. font-size: 18px;
  913. }
  914. .model_banner {
  915. width: 375px;
  916. height: 139px;
  917. padding: 0 15px;
  918. box-sizing: border-box;
  919. background: linear-gradient(180deg, #e93323 0%, #f5f5f5 100%);
  920. }
  921. .model_news {
  922. margin: 12px auto 12px;
  923. padding: 0 6px 0;
  924. width: 345px;
  925. height: 36px;
  926. box-sizing: border-box;
  927. border-radius: 4px;
  928. background-color: #fff;
  929. border: 1px solid #fff;
  930. line-height: 34px;
  931. display: flex;
  932. justify-content: space-between;
  933. align-items: center;
  934. }
  935. .model_nav {
  936. width: 345px;
  937. // height: 158px;
  938. box-sizing: border-box;
  939. border-radius: 4px;
  940. background-color: #fff;
  941. border: 1px solid #fff;
  942. margin: 0 auto 12px;
  943. display: flex;
  944. flex-wrap: wrap;
  945. }
  946. .model_nav_item {
  947. width: 20%;
  948. height: 59px;
  949. display: flex;
  950. flex-direction: column;
  951. align-items: center;
  952. justify-content: center;
  953. margin-top: 12px;
  954. }
  955. .model_nav_item img {
  956. width: 40px;
  957. height: 40px;
  958. }
  959. .model_nav_item p {
  960. font-size: 12px;
  961. color: #454545;
  962. padding-top: 3px;
  963. }
  964. .tab_nav_bd {
  965. display: flex;
  966. justify-content: space-between;
  967. align-items: center;
  968. font-size: 14px;
  969. white-space: nowrap;
  970. margin: 15px 0 15px;
  971. padding: 5px 15px 5px;
  972. border: 1px solid #f5f5f5;
  973. cursor: pointer;
  974. }
  975. .nav_bd_item {
  976. display: flex;
  977. flex-direction: column;
  978. align-items: center;
  979. justify-content: center;
  980. }
  981. .item_txt {
  982. color: #282828;
  983. }
  984. .item_label {
  985. width: 62px;
  986. height: 16px;
  987. display: flex;
  988. justify-content: center;
  989. align-items: center;
  990. margin-top: 2px;
  991. font-size: 12px;
  992. border-radius: 8px;
  993. color: #999;
  994. }
  995. .label_active {
  996. .item_txt {
  997. color: #e93323 !important;
  998. }
  999. .item_label {
  1000. color: #fff;
  1001. background: linear-gradient(90deg, #ff7931 0%, #e93323 100%);
  1002. }
  1003. }
  1004. .cate_box_style {
  1005. margin-top: 30px;
  1006. width: 100%;
  1007. font-size: 14px;
  1008. }
  1009. .shop_cart {
  1010. opacity: 0.6;
  1011. }
  1012. .moni_goods {
  1013. width: 100%;
  1014. font-size: 20px;
  1015. img {
  1016. display: block;
  1017. width: 100%;
  1018. }
  1019. }
  1020. .user_head {
  1021. width: 375px;
  1022. height: 262px;
  1023. background: linear-gradient(180deg, #e93323 0%, #f5f5f5 100%);
  1024. cursor: not-allowed;
  1025. }
  1026. .user_card {
  1027. position: relative;
  1028. width: 100%;
  1029. margin: 0 auto;
  1030. padding: 17px 0 14px 0;
  1031. }
  1032. .user_info {
  1033. display: flex;
  1034. }
  1035. .user_info img {
  1036. width: 59px;
  1037. height: 59px;
  1038. border-radius: 50%;
  1039. }
  1040. .user_info .info {
  1041. display: flex;
  1042. flex-direction: column;
  1043. justify-content: space-between;
  1044. margin-left: 9px;
  1045. padding: 7px 0;
  1046. }
  1047. .nick_name {
  1048. color: #fff;
  1049. font-size: 15px;
  1050. }
  1051. .phone {
  1052. font-size: 12px;
  1053. color: rgba(255, 255, 255, 0.6);
  1054. }
  1055. .num_wrapper {
  1056. margin-top: 14px;
  1057. display: flex;
  1058. justify-content: space-between;
  1059. align-items: center;
  1060. color: #fff;
  1061. }
  1062. .num_wrap_item {
  1063. width: 25%;
  1064. text-align: center;
  1065. }
  1066. .num_item_bold {
  1067. font-size: 20px;
  1068. font-weight: bold;
  1069. }
  1070. .num_title {
  1071. margin-top: 4px;
  1072. font-size: 12px;
  1073. color: rgba(255, 255, 255, 0.6);
  1074. }
  1075. .order_wrap {
  1076. background-color: #fff;
  1077. border-radius: 6px;
  1078. padding: 14px 7px;
  1079. width: 345px;
  1080. height: 112px;
  1081. margin: auto;
  1082. }
  1083. .order_wrap_tit {
  1084. display: flex;
  1085. justify-content: space-between;
  1086. font-size: 14px;
  1087. color: #282828;
  1088. margin-bottom: 19px;
  1089. padding: 0 7px;
  1090. }
  1091. .weight_600 {
  1092. font-weight: 600;
  1093. }
  1094. .font_sm {
  1095. font-size: 12px;
  1096. }
  1097. .order_wrap_list {
  1098. display: flex;
  1099. justify-content: space-between;
  1100. }
  1101. .order_list_item {
  1102. width: 20%;
  1103. display: flex;
  1104. flex-direction: column;
  1105. justify-content: center;
  1106. align-items: center;
  1107. }
  1108. .order_list_item img {
  1109. width: 24px;
  1110. display: block;
  1111. margin-bottom: 7px;
  1112. }
  1113. .order_list_item p {
  1114. font-size: 13px;
  1115. color: gray;;
  1116. }
  1117. .slider_img {
  1118. margin: 10px auto;
  1119. background-color: #fff;
  1120. border-radius: 6px;
  1121. border: 1px solid #f5f5f5;
  1122. width: 345px;
  1123. height: 69px;
  1124. }
  1125. .user_mens {
  1126. margin: 0 auto;
  1127. background-color: #fff;
  1128. border: 1px solid #fff;
  1129. border-radius: 6px;
  1130. width: 345px;
  1131. }
  1132. .menu_title {
  1133. padding: 15px 15px 20px;
  1134. font-size: 15px;
  1135. color: #282828;
  1136. font-weight: 600;
  1137. }
  1138. .list_box {
  1139. display: flex;
  1140. flex-wrap: wrap;
  1141. }
  1142. .list_box_item {
  1143. display: flex;
  1144. justify-content: space-between;
  1145. align-items: center;
  1146. flex-direction: column;
  1147. width: 25%;
  1148. margin-bottom: 23px;
  1149. font-size: 13px;
  1150. color: #333;
  1151. }
  1152. .list_box_item img {
  1153. width: 26px;
  1154. height: 26px;
  1155. display: block;
  1156. margin-bottom: 9px;
  1157. }
  1158. .user_bg {
  1159. width: 100%;
  1160. height: 208px;
  1161. background-repeat: no-repeat;
  1162. background-size: cover;
  1163. padding: 0 15px 0;
  1164. }
  1165. .move-icon {
  1166. display: flex;
  1167. align-items: center;
  1168. justify-content: center;
  1169. width: 30px;
  1170. height: 80px;
  1171. cursor: move;
  1172. color: #d8d8d8;
  1173. .icon-drag2 {
  1174. font-size: 25px;
  1175. cursor: move;
  1176. }
  1177. }
  1178. .select_ctive {
  1179. border: 1px dashed #666;
  1180. box-sizing: border-box;
  1181. }
  1182. .upLoad {
  1183. width: 58px;
  1184. height: 58px;
  1185. line-height: 58px;
  1186. border: 1px dotted rgba(0, 0, 0, 0.1);
  1187. border-radius: 4px;
  1188. background: rgba(0, 0, 0, 0.02);
  1189. display: flex;
  1190. justify-content: center;
  1191. align-items: center;
  1192. }
  1193. .flex_between {
  1194. flex: 1;
  1195. display: flex;
  1196. justify-content: space-between;
  1197. position: relative;
  1198. }
  1199. .tip {
  1200. width: 100%;
  1201. text-align: center;
  1202. font-size: 24px;
  1203. text-align: center;
  1204. position: absolute;
  1205. top: 50%;
  1206. left: 50%;
  1207. transform: translate(-50%, -50%);
  1208. }
  1209. .right-box {
  1210. width: 70%;
  1211. min-width: 400px;
  1212. border-radius: 4px;
  1213. height: 700px;
  1214. overflow-y: scroll;
  1215. padding: 0 10px;
  1216. margin-top: 30px;
  1217. &::-webkit-scrollbar {
  1218. /*滚动条整体样式*/
  1219. width: 4px; /*高宽分别对应横竖滚动条的尺寸*/
  1220. height: 1px;
  1221. }
  1222. &::-webkit-scrollbar-thumb {
  1223. /*滚动条里面小方块*/
  1224. border-radius: 4px;
  1225. box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1226. background: #535353;
  1227. }
  1228. &::-webkit-scrollbar-track {
  1229. /*滚动条里面轨道*/
  1230. box-shadow: inset 0 0 5px #fff;
  1231. border-radius: 4px;
  1232. background: #fff;
  1233. }
  1234. }
  1235. .mobile-config {
  1236. padding: 0 15px 20px 0px;
  1237. .item {
  1238. position: relative;
  1239. display: flex;
  1240. margin-top: 20px;
  1241. border: 1px dashed #ddd;
  1242. padding: 15px 15px 0 0;
  1243. }
  1244. .picBox {
  1245. cursor: pointer;
  1246. position: relative;
  1247. }
  1248. .delect-btn {
  1249. position: absolute;
  1250. right: -12px;
  1251. top: -16px;
  1252. color: #999999;
  1253. z-index: 11;
  1254. .el-icon-circle-close {
  1255. font-size: 21px;
  1256. color: #999;
  1257. cursor: pointer;
  1258. }
  1259. }
  1260. .img-box {
  1261. width: 70px;
  1262. height: 70px;
  1263. border-radius: 50%;
  1264. img {
  1265. width: 100%;
  1266. }
  1267. }
  1268. .info {
  1269. flex: 1;
  1270. margin-left: 12px;
  1271. .info-item {
  1272. display: flex;
  1273. align-items: center;
  1274. margin-bottom: 10px;
  1275. }
  1276. span {
  1277. width: 40px;
  1278. font-size: 13px;
  1279. }
  1280. .input-box {
  1281. flex: 1;
  1282. }
  1283. }
  1284. }
  1285. .cur_pointer {
  1286. cursor: pointer;
  1287. }
  1288. .link-item {
  1289. padding: 10px 0;
  1290. border-bottom: 1px solid #f5f5f5;
  1291. .title {
  1292. font-size: 14px;
  1293. color: #2d8cf0;
  1294. }
  1295. .txt {
  1296. margin: 5px 0;
  1297. font-size: 12px;
  1298. span {
  1299. color: #333;
  1300. }
  1301. p {
  1302. display: inline-block;
  1303. color: #19be6b;
  1304. margin-right: 10px;
  1305. span {
  1306. color: #333;
  1307. }
  1308. &.red {
  1309. color: #f00;
  1310. }
  1311. }
  1312. }
  1313. .tips {
  1314. font-size: 12px;
  1315. color: #999;
  1316. .copy {
  1317. padding: 3px 5px;
  1318. border: 1px solid #cccccc;
  1319. border-radius: 5px;
  1320. color: #333;
  1321. cursor: pointer;
  1322. margin-left: 5px;
  1323. &:hover {
  1324. border-color: #2d8cf0;
  1325. color: #2d8cf0;
  1326. }
  1327. }
  1328. }
  1329. }
  1330. .on {
  1331. border: 1px solid #1db0fc;
  1332. }
  1333. .image {
  1334. width: 100%;
  1335. display: block;
  1336. }
  1337. // .card_cate{
  1338. // border:2px solid #e6ebf5;
  1339. // }
  1340. .card_bt {
  1341. padding: 14px;
  1342. background: #f5f5f5;
  1343. display: flex;
  1344. justify-content: center;
  1345. span {
  1346. font-size: 18px;
  1347. font-weight: 600;
  1348. }
  1349. }
  1350. .tab_view {
  1351. width: 200px;
  1352. border-right: 1px solid #eee;
  1353. margin-right: 40px;
  1354. display: flex;
  1355. flex-direction: column;
  1356. .cell_item {
  1357. height: 50px;
  1358. font-size: 14px;
  1359. line-height: 50px;
  1360. text-align: left;
  1361. padding-left: 30px;
  1362. cursor: pointer;
  1363. }
  1364. }
  1365. .tab_active {
  1366. color: var(--prev-color-primary);
  1367. border-right: 1px solid var(--prev-color-primary);
  1368. }
  1369. .footer_btn {
  1370. border-top: 1px solid #eee;
  1371. height: 50px;
  1372. display: flex;
  1373. justify-content: center;
  1374. align-items: center;
  1375. }
  1376. </style>