diyIndex.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463
  1. <template>
  2. <div class="diy-page">
  3. <div class="i-layout-page-header header-title">
  4. <div class="fl_header">
  5. <!-- <router-link :to="{ path: $routeProStr + '/setting/pages/devise' }"
  6. ><Button icon="ios-arrow-back" size="small" type="text">返回</Button></router-link
  7. > -->
  8. <!-- <Divider type="vertical" /> -->
  9. <span class="ivu-page-header-title mr20" style="padding: 0" v-text="$route.meta.title"></span>
  10. <div class="rbtn">
  11. <!-- <Button v-if="pageId !== 0" class="bnt" @click="setmoren" :loading="loading">保存默认</Button>
  12. <Button v-if="pageId !== 0" class="bnt ml20" @click="getmoren" :loading="loading">恢复默认</Button> -->
  13. <!-- <div class="data" @click="setmoren">设置默认</div>
  14. <div class="data" @click="getmoren">恢复默认</div> -->
  15. <Button class="bnt ml20" type="info" @click="preview" :loading="loading">预览</Button>
  16. <Button class="bnt ml20" type="primary" @click="saveConfig" :loading="loading">保存</Button>
  17. <Button class="ml20" type="error" @click="closeWindow" :loading="loading">关闭</Button>
  18. </div>
  19. </div>
  20. </div>
  21. <Card :bordered="false" dis-hover class="ivu-mt" style="margin: 0 10px">
  22. <div class="diy-wrapper">
  23. <!-- 左侧 -->
  24. <div class="left">
  25. <div class="title-bar">
  26. <div
  27. class="title-item"
  28. :class="{ on: tabCur == index }"
  29. v-for="(item, index) in tabList"
  30. :key="index"
  31. @click="bindTab(index)"
  32. >
  33. {{ item.title }}
  34. </div>
  35. </div>
  36. <div class="wrapper" v-if="tabCur == 0">
  37. <div v-for="(item, index) in leftMenu" :key="index">
  38. <div class="tips" @click="item.isOpen = !item.isOpen">
  39. {{ item.title }}
  40. <Icon type="ios-arrow-forward" size="16" v-if="!item.isOpen" />
  41. <Icon type="ios-arrow-down" size="16" v-else />
  42. </div>
  43. <draggable
  44. class="dragArea list-group"
  45. :list="item.list"
  46. :group="{ name: 'people', pull: 'clone', put: false }"
  47. :clone="cloneDog"
  48. dragClass="dragClass"
  49. filter=".search , .navbar"
  50. >
  51. <!--filter=".search , .navbar"-->
  52. <!--:class="{ search: element.cname == '搜索框' , navbar: element.cname == '商品分类' }"-->
  53. <div
  54. class="list-group-item"
  55. :class="{
  56. search: element.cname == '搜索框',
  57. navbar: element.cname == '商品分类',
  58. }"
  59. v-for="(element, index) in item.list"
  60. :key="element.id"
  61. @click="addDom(element, 1)"
  62. v-show="item.isOpen"
  63. >
  64. <div>
  65. <div class="position" style="display: none">释放鼠标将组建添加到此处</div>
  66. <span class="conter iconfont-diy" :class="element.icon"></span>
  67. <p class="conter">{{ element.cname }}</p>
  68. </div>
  69. </div>
  70. </draggable>
  71. </div>
  72. </div>
  73. <!-- <div style="padding: 0 20px"><Button type="primary" style="width: 100%" @click="saveConfig">保存</Button></div>-->
  74. <div class="wrapper" v-else :style="'height:' + (clientHeight - 200) + 'px;'">
  75. <div class="link-item" v-for="(item, index) in urlList" :key="index">
  76. <div class="name">{{ item.name }}</div>
  77. <div class="link-txt">地址:{{ item.url }}</div>
  78. <div class="params">
  79. <span class="txt">参数:</span>
  80. <span>{{ item.parameter }}</span>
  81. </div>
  82. <div class="lable">
  83. <p class="txt">例如:{{ item.example }}</p>
  84. <Button size="small" @click="onCopy(item.example)">复制 </Button>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- 中间 -->
  90. <div
  91. class="wrapper-con"
  92. style="flex: 1; background: #f0f2f5; display: flex; justify-content: center; padding-top: 20px; height: 100%"
  93. >
  94. <div class="acticon">
  95. <Button class="bnt mb10" @click="showTitle">页面设置</Button>
  96. <Button class="bnt mb10" @click="nameModal = true">另存模板</Button>
  97. <Button class="bnt" @click="reast">重置</Button>
  98. </div>
  99. <div class="content">
  100. <div class="contxt" style="display: flex; flex-direction: column; overflow: hidden; height: 100%">
  101. <div class="overflowy">
  102. <div class="picture">
  103. <img src="@/assets/images/electric.png" />
  104. </div>
  105. <div class="page-title" :class="{ on: activeIndex == -100 }" @click="showTitle">
  106. {{ titleTxt }}
  107. <div class="delete-box"></div>
  108. <div class="handle"></div>
  109. </div>
  110. </div>
  111. <div class="scrollCon">
  112. <div style="width: 460px; margin: 0 auto">
  113. <div
  114. class="scroll-box"
  115. :class="
  116. picTxt && tabValTxt == 2
  117. ? 'fullsize noRepeat'
  118. : picTxt && tabValTxt == 1
  119. ? 'repeat ysize'
  120. : 'noRepeat ysize'
  121. "
  122. :style="
  123. 'background-color:' +
  124. (colorTxt ? colorPickerTxt : '') +
  125. ';background-image: url(' +
  126. (picTxt ? picUrlTxt : '') +
  127. ');height:calc(100vh - 200px)'
  128. "
  129. ref="imgContainer"
  130. >
  131. <draggable
  132. class="dragArea list-group"
  133. :list="mConfig"
  134. group="people"
  135. @change="log"
  136. filter=".top"
  137. :move="onMove"
  138. animation="300"
  139. >
  140. <div
  141. class="mConfig-item"
  142. :class="{
  143. on: activeIndex == key,
  144. top: item.name == 'search_box' || item.name == 'nav_bar',
  145. }"
  146. v-for="(item, key) in mConfig"
  147. :key="key"
  148. @click.stop="bindconfig(item, key)"
  149. :style="colorTxt ? 'background-color:' + colorPickerTxt + ';' : 'background-color:#fff;'"
  150. >
  151. <component
  152. :is="item.name"
  153. ref="getComponentData"
  154. :configData="propsObj"
  155. :index="key"
  156. :num="item.num"
  157. ></component>
  158. <div class="delete-box">
  159. <div class="handleType">
  160. <Tooltip content="删除当前模块" placement="top">
  161. <div class="iconfont iconshanchu2" @click.stop="bindDelete(item, key)"></div>
  162. </Tooltip>
  163. <div class="iconfont iconfuzhi" @click.stop="bindAddDom(item, 0, key)"></div>
  164. <div
  165. class="iconfont iconshangyi"
  166. :class="key === 0 ? 'on' : ''"
  167. @click.stop="movePage(item, key, 1)"
  168. ></div>
  169. <div
  170. class="iconfont iconxiayi"
  171. :class="key === mConfig.length - 1 ? 'on' : ''"
  172. @click.stop="movePage(item, key, 0)"
  173. ></div>
  174. </div>
  175. </div>
  176. <div class="handle"></div>
  177. </div>
  178. </draggable>
  179. </div>
  180. </div>
  181. </div>
  182. <div class="overflowy">
  183. <div class="page-foot" @click="showFoot" :class="{ on: activeIndex == -101 }">
  184. <footPage></footPage>
  185. <div class="delete-box"></div>
  186. <div class="handle"></div>
  187. </div>
  188. </div>
  189. <!-- <div class="defaultData" v-if="pageId !== 0">
  190. <div class="data" @click="setmoren">设置默认</div>
  191. <div class="data" @click="getmoren">恢复默认</div>
  192. </div> -->
  193. </div>
  194. </div>
  195. </div>
  196. <!-- 右侧 -->
  197. <div class="right-box">
  198. <div class="mConfig-item" style="background-color: #fff" v-for="(item, key) in rConfig" :key="key">
  199. <div class="title-bar">{{ item.cname }}</div>
  200. <component
  201. :is="item.configName"
  202. @config="config"
  203. :activeIndex="activeIndex"
  204. :num="item.num"
  205. :index="key"
  206. ></component>
  207. </div>
  208. </div>
  209. </div>
  210. </Card>
  211. <!--<div class="foot-box">-->
  212. <!--<Button @click="reast">重置</Button>-->
  213. <!--<Button type="primary" @click="saveConfig" :loading="loading"-->
  214. <!--&gt;保存-->
  215. <!--</Button-->
  216. <!--&gt;-->
  217. <!--</div>-->
  218. <Modal v-model="modal" title="预览" footer-hide>
  219. <div>
  220. <div v-viewer class="acea-row row-around code">
  221. <div class="acea-row row-column-around row-between-wrapper">
  222. <div class="QRpic" ref="qrCodeUrl"></div>
  223. <span class="mt10">公众号二维码</span>
  224. </div>
  225. <div class="acea-row row-column-around row-between-wrapper">
  226. <div class="QRpic">
  227. <img v-lazy="qrcodeImg" />
  228. </div>
  229. <span class="mt10">小程序二维码</span>
  230. </div>
  231. </div>
  232. </div>
  233. </Modal>
  234. <Modal v-model="nameModal" title="设置模版名称" :closable="false" @on-ok="saveModal" @on-cancel="nameModal = false">
  235. <Input v-model="saveName" placeholder="请输入模版名称"></Input>
  236. </Modal>
  237. </div>
  238. </template>
  239. <script crossorigin="anonymous">
  240. import { categoryList, getDiyInfo, saveDiy, getUrl, setDefault, recovery, getRoutineCode } from '@/api/diy';
  241. import vuedraggable from 'vuedraggable';
  242. import mPage from '@/components/mobilePageDiy/index.js';
  243. import mConfig from '@/components/mobileConfigDiy/index.js';
  244. import footPage from '@/components/pagesFoot';
  245. import { mapState } from 'vuex';
  246. import html2canvas from 'html2canvas';
  247. import QRCode from 'qrcodejs2';
  248. let idGlobal = 0;
  249. export default {
  250. inject: ['reload'],
  251. name: 'index.vue',
  252. components: {
  253. footPage,
  254. html2canvas,
  255. draggable: vuedraggable,
  256. ...mPage,
  257. ...mConfig,
  258. },
  259. filters: {
  260. filterTxt(val) {
  261. if (val) {
  262. return (val = val.substr(0, val.length - 1));
  263. }
  264. },
  265. },
  266. computed: {
  267. ...mapState({
  268. titleTxt: (state) => state.mobildConfig.pageTitle || '首页',
  269. nameTxt: (state) => state.mobildConfig.pageName || '模板',
  270. showTxt: (state) => state.mobildConfig.pageShow,
  271. colorTxt: (state) => state.mobildConfig.pageColor,
  272. picTxt: (state) => state.mobildConfig.pagePic,
  273. colorPickerTxt: (state) => state.mobildConfig.pageColorPicker,
  274. tabValTxt: (state) => state.mobildConfig.pageTabVal,
  275. picUrlTxt: (state) => state.mobildConfig.pagePicUrl,
  276. }),
  277. },
  278. data() {
  279. return {
  280. clientHeight: '', //页面动态高度
  281. rollHeight: '',
  282. leftMenu: [], // 左侧菜单
  283. lConfig: [], // 左侧组件
  284. mConfig: [], // 中间组件渲染
  285. rConfig: [], // 右侧组件配置
  286. activeConfigName: '',
  287. propsObj: {}, // 组件传递的数据,
  288. activeIndex: -100, // 选中的下标
  289. number: 0,
  290. pageId: '',
  291. pageName: '',
  292. pageType: '',
  293. category: [],
  294. tabList: [
  295. {
  296. title: '组件库',
  297. key: 0,
  298. },
  299. {
  300. title: '页面链接',
  301. key: 1,
  302. },
  303. ],
  304. tabCur: 0,
  305. urlList: [],
  306. footActive: false,
  307. loading: false,
  308. isSearch: false,
  309. isTab: false,
  310. isFllow: false,
  311. qrcodeImg: '',
  312. modal: false,
  313. nameModal: false,
  314. saveName: '',
  315. };
  316. },
  317. beforeRouteLeave(to, from, next) {
  318. // 导航离开该组件的对应路由时调用
  319. },
  320. beforeCreate() {
  321. this.$store.commit('mobildConfig/titleUpdata', '');
  322. this.$store.commit('mobildConfig/nameUpdata', '');
  323. this.$store.commit('mobildConfig/showUpdata', 1);
  324. this.$store.commit('mobildConfig/colorUpdata', 0);
  325. this.$store.commit('mobildConfig/picUpdata', 0);
  326. this.$store.commit('mobildConfig/pickerUpdata', '#f5f5f5');
  327. this.$store.commit('mobildConfig/radioUpdata', 0);
  328. this.$store.commit('mobildConfig/picurlUpdata', '');
  329. this.$store.commit('mobildConfig/SETEMPTY');
  330. },
  331. created() {
  332. this.categoryList();
  333. this.getUrlList();
  334. this.pageId = this.$route.query.id;
  335. this.pageName = this.$route.query.name;
  336. this.pageType = this.$route.query.type;
  337. this.lConfig = this.objToArr(mPage);
  338. },
  339. mounted() {
  340. // window.addEventListener('onbeforeunload', this.beforeUnload);
  341. let imgList = {
  342. imgList: [require('@/assets/images/foot-005.png'), require('@/assets/images/foot-006.png')],
  343. name: '购物车',
  344. link: '/pages/order_addcart/order_addcart',
  345. };
  346. this.$nextTick(() => {
  347. this.$store.commit('mobildConfig/FOOTER', {
  348. title: '专题页是否显示',
  349. name: imgList,
  350. });
  351. this.arraySort();
  352. if (this.pageId != 0) {
  353. this.getDefaultConfig();
  354. } else {
  355. this.showTitle();
  356. }
  357. this.clientHeight = `${document.documentElement.clientHeight}`; //获取浏览器可视区域高度
  358. let H = `${document.documentElement.clientHeight}` - 180;
  359. this.rollHeight = H > 650 ? 650 : H;
  360. let that = this;
  361. window.onresize = function () {
  362. that.clientHeight = `${document.documentElement.clientHeight}`;
  363. let H = `${document.documentElement.clientHeight}` - 180;
  364. that.rollHeight = H > 650 ? 650 : H;
  365. };
  366. });
  367. },
  368. methods: {
  369. beforeUnload() {
  370. return '确认是否保存?';
  371. },
  372. saveModal() {
  373. if (!this.saveName) return this.$Message.warning('请先输入模板名称');
  374. this.saveConfig(1, this.saveName);
  375. },
  376. //小程序二维码
  377. routineCode(id) {
  378. getRoutineCode(id)
  379. .then((res) => {
  380. this.qrcodeImg = res.data.image;
  381. })
  382. .catch((err) => {
  383. this.$Message.error(err);
  384. });
  385. },
  386. preview(row) {
  387. this.modal = true;
  388. this.creatQrCode(row.id);
  389. this.routineCode(this.$route.query.id);
  390. },
  391. //生成二维码
  392. creatQrCode(id) {
  393. this.$refs.qrCodeUrl.innerHTML = '';
  394. let url = `${this.BaseURL}pages/annex/special/index?id=${id}`;
  395. var qrcode = new QRCode(this.$refs.qrCodeUrl, {
  396. text: url, // 需要转换为二维码的内容
  397. width: 160,
  398. height: 160,
  399. colorDark: '#000000',
  400. colorLight: '#ffffff',
  401. correctLevel: QRCode.CorrectLevel.H,
  402. });
  403. },
  404. closeWindow() {
  405. this.$Modal.confirm({
  406. title: '确定关闭当前页吗?',
  407. content: '离开前请确认保存您的设计',
  408. okText: '确定',
  409. cancelText: '取消',
  410. loading: true,
  411. onOk: () => {
  412. setTimeout(() => {
  413. // this.saveConfig();
  414. this.$Modal.remove();
  415. window.close();
  416. }, 1500);
  417. },
  418. onCancel: () => {
  419. this.$Modal.remove();
  420. },
  421. });
  422. },
  423. leftRemove({ to, from, item, clone, oldIndex, newIndex }) {
  424. if (this.isSearch && newIndex == 0) {
  425. if (item._underlying_vm_.name == 'z_wechat_attention') {
  426. this.isFllow = true;
  427. } else {
  428. this.$store.commit('mobildConfig/ARRAYREAST', this.mConfig[0].num);
  429. this.mConfig.splice(0, 1);
  430. }
  431. }
  432. if ((this.isFllow = true && newIndex >= 1)) {
  433. this.$store.commit('mobildConfig/ARRAYREAST', this.mConfig[0].num);
  434. }
  435. },
  436. onMove(e) {
  437. if (e.relatedContext.element.name == 'search_box') return false;
  438. if (e.relatedContext.element.name == 'nav_bar') return false;
  439. return true;
  440. },
  441. onCopy(copyData) {
  442. this.$copyText(copyData)
  443. .then((message) => {
  444. this.$Message.success('复制成功');
  445. })
  446. .catch((err) => {
  447. this.$Message.error('复制失败');
  448. });
  449. },
  450. onError() {
  451. this.$Message.error('复制失败');
  452. },
  453. //设置默认数据
  454. setmoren() {
  455. this.$Modal.confirm({
  456. title: '保存为默认数据',
  457. content: '您确定将当前设计设为默认数据吗?',
  458. onOk: () => {
  459. setDefault(this.pageId)
  460. .then((res) => {
  461. this.$Message.success(res.msg);
  462. })
  463. .catch((err) => {
  464. this.$Message.error(err.msg);
  465. });
  466. },
  467. onCancel: () => {},
  468. });
  469. },
  470. //恢复默认
  471. getmoren() {
  472. this.$Modal.confirm({
  473. title: '恢复默认数据',
  474. content: '您确定恢复为之前保存的默认数据吗?',
  475. onOk: () => {
  476. recovery(this.pageId)
  477. .then((res) => {
  478. this.$Message.success(res.msg);
  479. this.reload();
  480. })
  481. .catch((err) => {
  482. this.$Message.error(err.msg);
  483. });
  484. },
  485. onCancel: () => {},
  486. });
  487. },
  488. // 获取url
  489. getUrlList() {
  490. getUrl().then((res) => {
  491. this.urlList = res.data.url;
  492. });
  493. },
  494. // 左侧tab
  495. bindTab(index) {
  496. this.tabCur = index;
  497. },
  498. // 页面标题点击
  499. showTitle() {
  500. this.activeIndex = -100;
  501. let obj = {};
  502. for (var i in mConfig) {
  503. if (i == 'pageTitle') {
  504. // this.rConfig = obj
  505. obj = mConfig[i];
  506. obj.configName = mConfig[i].name;
  507. obj.cname = '页面设置';
  508. }
  509. }
  510. let abc = obj;
  511. this.rConfig = [];
  512. this.rConfig[0] = JSON.parse(JSON.stringify(obj));
  513. },
  514. // 页面底部点击
  515. showFoot() {
  516. this.activeIndex = -101;
  517. let obj = {};
  518. for (var i in mConfig) {
  519. if (i == 'pageFoot') {
  520. // this.rConfig = obj
  521. obj = mConfig[i];
  522. obj.configName = mConfig[i].name;
  523. obj.cname = '底部菜单';
  524. }
  525. }
  526. let abc = obj;
  527. this.rConfig = [];
  528. this.rConfig[0] = JSON.parse(JSON.stringify(obj));
  529. },
  530. // 对象转数组
  531. objToArr(data) {
  532. let obj = Object.keys(data);
  533. let m = obj.map((key) => data[key]);
  534. return m;
  535. },
  536. log(evt) {
  537. // 中间拖拽排序
  538. if (evt.moved) {
  539. if (evt.moved.element.name == 'search_box' || evt.moved.element.name == 'nav_bar') {
  540. return this.$Message.warning('该组件禁止拖拽');
  541. }
  542. // if (evt.moved.element.name == "nav_bar") {
  543. // return this.$Message.warning("该组件禁止拖拽");
  544. // }
  545. evt.moved.oldNum = this.mConfig[evt.moved.oldIndex].num;
  546. evt.moved.newNum = this.mConfig[evt.moved.newIndex].num;
  547. evt.moved.status = evt.moved.oldIndex > evt.moved.newIndex;
  548. this.mConfig.forEach((el, index) => {
  549. el.num = new Date().getTime() * 1000 + index;
  550. });
  551. evt.moved.list = this.mConfig;
  552. this.rConfig = [];
  553. let item = evt.moved.element;
  554. let tempItem = JSON.parse(JSON.stringify(item));
  555. this.rConfig.push(tempItem);
  556. this.activeIndex = evt.moved.newIndex;
  557. this.$store.commit('mobildConfig/SETCONFIGNAME', item.name);
  558. this.$store.commit('mobildConfig/defaultArraySort', evt.moved);
  559. }
  560. // 从左向右拖拽排序
  561. if (evt.added) {
  562. let data = evt.added.element;
  563. let obj = {};
  564. let timestamp = new Date().getTime() * 1000;
  565. data.num = timestamp;
  566. this.activeConfigName = data.name;
  567. let tempItem = JSON.parse(JSON.stringify(data));
  568. tempItem.id = 'id' + tempItem.num;
  569. this.mConfig[evt.added.newIndex] = tempItem;
  570. this.rConfig = [];
  571. this.rConfig.push(tempItem);
  572. this.mConfig.forEach((el, index) => {
  573. el.num = new Date().getTime() * 1000 + index;
  574. });
  575. evt.added.list = this.mConfig;
  576. this.activeIndex = evt.added.newIndex;
  577. // 保存组件名称
  578. this.$store.commit('mobildConfig/SETCONFIGNAME', data.name);
  579. this.$store.commit('mobildConfig/defaultArraySort', evt.added);
  580. }
  581. },
  582. cloneDog(data) {
  583. // this.mConfig.push(tempItem)
  584. return {
  585. ...data,
  586. };
  587. },
  588. //数组元素互换位置
  589. swapArray(arr, index1, index2) {
  590. arr[index1] = arr.splice(index2, 1, arr[index1])[0];
  591. return arr;
  592. },
  593. //点击上下移动;
  594. movePage(item, index, type) {
  595. if (type) {
  596. if (index == 0) {
  597. return;
  598. }
  599. } else {
  600. if (index == this.mConfig.length - 1) {
  601. return;
  602. }
  603. }
  604. if (item.name == 'search_box' || item.name == 'nav_bar') {
  605. return this.$Message.warning('该组件禁止移动');
  606. }
  607. // if (item.name == "nav_bar") {
  608. // return this.$Message.warning("该组件禁止移动");
  609. // }
  610. if (type) {
  611. // if(this.mConfig[index-1].name == "search_box" || this.mConfig[index-1].name == "nav_bar"){
  612. if (this.mConfig[index - 1].name == 'search_box') {
  613. return this.$Message.warning('搜索框必须为顶部');
  614. }
  615. this.swapArray(this.mConfig, index - 1, index);
  616. } else {
  617. this.swapArray(this.mConfig, index, index + 1);
  618. }
  619. let obj = {};
  620. this.rConfig = [];
  621. obj.oldIndex = index;
  622. if (type) {
  623. obj.newIndex = index - 1;
  624. } else {
  625. obj.newIndex = index + 1;
  626. }
  627. this.mConfig.forEach((el, index) => {
  628. el.num = new Date().getTime() * 1000 + index;
  629. });
  630. let tempItem = JSON.parse(JSON.stringify(item));
  631. this.rConfig.push(tempItem);
  632. obj.element = item;
  633. obj.list = this.mConfig;
  634. if (type) {
  635. this.activeIndex = index - 1;
  636. } else {
  637. this.activeIndex = index + 1;
  638. }
  639. this.$store.commit('mobildConfig/SETCONFIGNAME', item.name);
  640. this.$store.commit('mobildConfig/defaultArraySort', obj);
  641. },
  642. // 组件添加
  643. addDomCon(item, type, index) {
  644. if (item.name == 'search_box') {
  645. if (this.isSearch) return this.$Message.error('该组件只能添加一次');
  646. this.isSearch = true;
  647. }
  648. if (item.name == 'nav_bar') {
  649. if (this.isTab) return this.$Message.error('该组件只能添加一次');
  650. this.isTab = true;
  651. }
  652. idGlobal += 1;
  653. let obj = {};
  654. let timestamp = new Date().getTime() * 1000;
  655. item.num = `${timestamp}`;
  656. item.id = `id${timestamp}`;
  657. this.activeConfigName = item.name;
  658. let tempItem = JSON.parse(JSON.stringify(item));
  659. if (item.name == 'search_box') {
  660. this.rConfig = [];
  661. this.mConfig.unshift(tempItem);
  662. this.activeIndex = 0;
  663. this.rConfig.push(tempItem);
  664. }
  665. // 动态拖动可上传此部分代码
  666. else if (item.name == 'nav_bar') {
  667. this.rConfig = [];
  668. if (this.mConfig[0] && this.mConfig[0].name === 'search_box') {
  669. this.mConfig.splice(1, 0, tempItem);
  670. this.activeIndex = 1;
  671. } else {
  672. this.mConfig.splice(0, 0, tempItem);
  673. this.activeIndex = 0;
  674. }
  675. this.rConfig.push(tempItem);
  676. } else {
  677. if (type) {
  678. this.rConfig = [];
  679. this.mConfig.push(tempItem);
  680. this.activeIndex = this.mConfig.length - 1;
  681. this.rConfig.push(tempItem);
  682. } else {
  683. this.mConfig.splice(index + 1, 0, tempItem);
  684. this.activeIndex = index;
  685. }
  686. }
  687. this.mConfig.forEach((el, index) => {
  688. el.num = new Date().getTime() * 1000 + index;
  689. });
  690. // 保存组件名称
  691. obj.element = item;
  692. obj.list = this.mConfig;
  693. this.$store.commit('mobildConfig/SETCONFIGNAME', item.name);
  694. this.$store.commit('mobildConfig/defaultArraySort', obj);
  695. },
  696. //中间页点击添加模块;
  697. bindAddDom(item, type, index) {
  698. let i = item;
  699. this.lConfig.forEach((j) => {
  700. if (item.name == j.name) {
  701. i = j;
  702. }
  703. });
  704. this.addDomCon(i, type, index);
  705. },
  706. //左边配置模块点击添加;
  707. addDom(item, type) {
  708. this.addDomCon(item, type);
  709. },
  710. // 点击显示相应的配置
  711. bindconfig(item, index) {
  712. console.log(item, index);
  713. this.rConfig = [];
  714. let tempItem = JSON.parse(JSON.stringify(item));
  715. this.rConfig.push(tempItem);
  716. this.activeIndex = index;
  717. this.$store.commit('mobildConfig/SETCONFIGNAME', item.name);
  718. },
  719. // 组件删除
  720. bindDelete(item, key) {
  721. if (item.name == 'search_box') {
  722. this.isSearch = false;
  723. }
  724. if (item.name == 'nav_bar') {
  725. this.isTab = false;
  726. }
  727. this.mConfig.splice(key, 1);
  728. this.rConfig.splice(0, 1);
  729. if (this.mConfig.length != key) {
  730. this.rConfig.push(this.mConfig[key]);
  731. } else {
  732. if (this.mConfig.length) {
  733. this.activeIndex = key - 1;
  734. this.rConfig.push(this.mConfig[key - 1]);
  735. } else {
  736. this.showTitle();
  737. }
  738. }
  739. // 删除第几个配置
  740. this.$store.commit('mobildConfig/DELETEARRAY', item);
  741. },
  742. // 组件返回
  743. config(data) {
  744. let propsObj = this.propsObj;
  745. propsObj.data = data;
  746. propsObj.name = this.activeConfigName;
  747. },
  748. addSort(arr, index1, index2) {
  749. arr[index1] = arr.splice(index2, 1, arr[index1])[0];
  750. return arr;
  751. },
  752. // 数组排序
  753. arraySort() {
  754. let tempArr = [];
  755. let basis = {
  756. title: '基础组件',
  757. list: [],
  758. isOpen: true,
  759. };
  760. let marketing = {
  761. title: '营销组件',
  762. list: [],
  763. isOpen: true,
  764. };
  765. let tool = {
  766. title: '工具组件',
  767. list: [],
  768. isOpen: true,
  769. };
  770. this.lConfig.map((el, index) => {
  771. if (el.type == 0) {
  772. basis.list.push(el);
  773. }
  774. if (el.type == 1) {
  775. marketing.list.push(el);
  776. }
  777. if (el.type == 2) {
  778. tool.list.push(el);
  779. }
  780. });
  781. tempArr.push(basis, marketing, tool);
  782. this.leftMenu = tempArr;
  783. },
  784. // toImage(val){
  785. // html2canvas(this.$refs.imgContainer,{
  786. // useCORS:true,
  787. // logging:true,
  788. // taintTest: false,
  789. // backgroundColor: null
  790. // }).then((canvas) => {
  791. // let imgUrl = canvas.toDataURL('image/jpeg');
  792. // this.diySaveDate(val,imgUrl)
  793. // });
  794. // },
  795. diySaveDate(val, init, name) {
  796. saveDiy(init ? 0 : this.pageId, {
  797. type: this.pageType,
  798. value: val,
  799. title: this.titleTxt,
  800. name: name || this.nameTxt,
  801. is_show: this.showTxt ? 1 : 0,
  802. is_bg_color: this.colorTxt ? 1 : 0,
  803. color_picker: this.colorPickerTxt,
  804. bg_pic: this.picUrlTxt,
  805. bg_tab_val: this.tabValTxt,
  806. is_bg_pic: this.picTxt ? 1 : 0,
  807. })
  808. .then((res) => {
  809. this.loading = false;
  810. this.pageId = res.data.id;
  811. this.$Message.success(res.msg);
  812. })
  813. .catch((res) => {
  814. this.loading = false;
  815. this.$Message.error(res.msg);
  816. });
  817. },
  818. // 保存配置
  819. saveConfig(init, name) {
  820. if (this.mConfig.length == 0) {
  821. return this.$Message.error('暂未添加任何组件,保存失败!');
  822. }
  823. this.loading = true;
  824. let val = this.$store.state.mobildConfig.defaultArray;
  825. if (!this.footActive) {
  826. let timestamp = new Date().getTime() * 1000;
  827. val[timestamp] = this.$store.state.mobildConfig.pageFooter;
  828. this.footActive = true;
  829. }
  830. this.$nextTick(() => {
  831. this.diySaveDate(val, init, name);
  832. });
  833. },
  834. // 获取默认配置
  835. getDefaultConfig() {
  836. getDiyInfo(this.pageId).then(({ data }) => {
  837. let obj = {};
  838. let tempARR = [];
  839. this.$store.commit('mobildConfig/titleUpdata', data.info.title);
  840. this.$store.commit('mobildConfig/nameUpdata', data.info.name);
  841. this.$store.commit('mobildConfig/showUpdata', data.info.is_show);
  842. this.$store.commit('mobildConfig/colorUpdata', data.info.is_bg_color || 0);
  843. this.$store.commit('mobildConfig/picUpdata', data.info.is_bg_pic || 0);
  844. this.$store.commit('mobildConfig/pickerUpdata', data.info.color_picker || '#f5f5f5');
  845. this.$store.commit('mobildConfig/radioUpdata', data.info.bg_tab_val || 0);
  846. this.$store.commit('mobildConfig/picurlUpdata', data.info.bg_pic || '');
  847. let newArr = this.objToArr(data.info.value);
  848. function sortNumber(a, b) {
  849. return a.timestamp - b.timestamp;
  850. }
  851. newArr.sort(sortNumber);
  852. newArr.map((el, index) => {
  853. if (el.name == 'headerSerch') {
  854. this.isSearch = true;
  855. }
  856. if (el.name == 'tabNav') {
  857. this.isTab = true;
  858. }
  859. if (el.name == 'goodList') {
  860. let storage = window.localStorage;
  861. storage.setItem(el.timestamp, el.selectConfig.activeValue);
  862. }
  863. el.id = 'id' + el.timestamp;
  864. this.lConfig.map((item, j) => {
  865. if (el.name == item.defaultName) {
  866. item.num = el.timestamp;
  867. item.id = 'id' + el.timestamp;
  868. let tempItem = JSON.parse(JSON.stringify(item));
  869. tempARR.push(tempItem);
  870. obj[el.timestamp] = el;
  871. this.mConfig.push(tempItem);
  872. // 保存默认组件配置
  873. this.$store.commit('mobildConfig/ADDARRAY', {
  874. num: el.timestamp,
  875. val: el,
  876. });
  877. }
  878. });
  879. });
  880. let objs = newArr[newArr.length - 1];
  881. if (objs.name == 'pageFoot') {
  882. this.$store.commit('mobildConfig/footPageUpdata', objs);
  883. }
  884. this.showTitle();
  885. // this.rConfig = [];
  886. // this.activeIndex = 0;
  887. // this.rConfig.push(this.mConfig[0]);
  888. });
  889. },
  890. categoryList() {
  891. categoryList((res) => {
  892. this.category = res.data;
  893. });
  894. },
  895. // 重置
  896. reast() {
  897. if (this.pageId == 0) {
  898. this.$Message.error('新增页面,无法重置');
  899. } else {
  900. this.$Modal.confirm({
  901. title: '提示',
  902. content: '<p>是否重置当前页面数据</p>',
  903. onOk: () => {
  904. this.mConfig = [];
  905. this.rConfig = [];
  906. this.activeIndex = -99;
  907. this.getDefaultConfig();
  908. },
  909. onCancel: () => {},
  910. });
  911. }
  912. },
  913. },
  914. beforeDestroy() {
  915. this.$store.commit('mobildConfig/titleUpdata', '');
  916. this.$store.commit('mobildConfig/nameUpdata', '');
  917. this.$store.commit('mobildConfig/showUpdata', 1);
  918. this.$store.commit('mobildConfig/colorUpdata', 0);
  919. this.$store.commit('mobildConfig/picUpdata', 0);
  920. this.$store.commit('mobildConfig/pickerUpdata', '#f5f5f5');
  921. this.$store.commit('mobildConfig/radioUpdata', 0);
  922. this.$store.commit('mobildConfig/picurlUpdata', '');
  923. this.$store.commit('mobildConfig/SETEMPTY');
  924. },
  925. destroyed() {
  926. this.$store.commit('mobildConfig/titleUpdata', '');
  927. this.$store.commit('mobildConfig/nameUpdata', '');
  928. this.$store.commit('mobildConfig/showUpdata', 1);
  929. this.$store.commit('mobildConfig/colorUpdata', 0);
  930. this.$store.commit('mobildConfig/picUpdata', 0);
  931. this.$store.commit('mobildConfig/pickerUpdata', '#f5f5f5');
  932. this.$store.commit('mobildConfig/radioUpdata', 0);
  933. this.$store.commit('mobildConfig/picurlUpdata', '');
  934. this.$store.commit('mobildConfig/SETEMPTY');
  935. },
  936. };
  937. </script>
  938. <style scoped lang="stylus">
  939. .ysize {
  940. background-size: 100%;
  941. }
  942. .fullsize {
  943. background-size: 100% 100%;
  944. }
  945. .repeat {
  946. background-repeat: repeat;
  947. }
  948. .noRepeat {
  949. background-repeat: no-repeat;
  950. }
  951. .wrapper-con {
  952. position relative
  953. .acticon{
  954. position absolute
  955. right: 20px
  956. top 20px
  957. display: flex;
  958. flex-direction: column;
  959. z-index: 1000;
  960. }
  961. /* min-width 700px; */
  962. }
  963. .main .content-wrapper{
  964. padding: 0 !important;
  965. }
  966. .defaultData {
  967. /* margin-left 20px; */
  968. cursor: pointer;
  969. position: absolute;
  970. left: 50%;
  971. margin-left: 245px;
  972. .data {
  973. margin-top: 20px;
  974. color: #282828;
  975. background-color: #fff;
  976. width: 94px;
  977. text-align: center;
  978. height: 32px;
  979. line-height: 32px;
  980. border-radius: 3px;
  981. font-size: 12px;
  982. }
  983. .data:hover {
  984. background-color: #2d8cf0;
  985. color: #fff;
  986. border: 0;
  987. }
  988. }
  989. .overflowy {
  990. overflow-y: scroll;
  991. .picture {
  992. width: 379px;
  993. height: 20px;
  994. margin: 0 auto;
  995. background-color: #fff;
  996. }
  997. }
  998. .bnt {
  999. width: 80px !important;
  1000. }
  1001. /* 定义滑块 内阴影+圆角 */
  1002. ::-webkit-scrollbar-thumb {
  1003. -webkit-box-shadow: inset 0 0 6px #fff;
  1004. display: none;
  1005. }
  1006. .left:hover::-webkit-scrollbar-thumb, .right-box:hover::-webkit-scrollbar-thumb {
  1007. display: block;
  1008. }
  1009. .contxt:hover ::-webkit-scrollbar-thumb {
  1010. display: block;
  1011. }
  1012. ::-webkit-scrollbar {
  1013. width: 4px !important; /* 对垂直流动条有效 */
  1014. }
  1015. .scrollCon {
  1016. overflow-y: scroll;
  1017. overflow-x: hidden;
  1018. }
  1019. .scroll-box .position {
  1020. display: block !important;
  1021. height: 40px;
  1022. text-align: center;
  1023. line-height: 40px;
  1024. border: 1px dashed #1890ff;
  1025. color: #1890ff;
  1026. background-color: #edf4fb;
  1027. }
  1028. .scroll-box .conter {
  1029. display: none !important;
  1030. }
  1031. .dragClass {
  1032. background-color: #fff;
  1033. }
  1034. .ivu-mt {
  1035. display: flex;
  1036. justify-content: space-between;
  1037. margin-bottom: 10px;
  1038. }
  1039. .iconfont-diy {
  1040. font-size: 24px;
  1041. color: var(--prev-color-primary);
  1042. }
  1043. .diy-wrapper {
  1044. max-width: 100%;
  1045. min-width: 1100px;
  1046. display: flex;
  1047. justify-content: space-between;
  1048. height: 100%;
  1049. .left {
  1050. min-width: 300px;
  1051. max-width: 300px;
  1052. /* border 1px solid #DDDDDD */
  1053. border-radius: 4px;
  1054. height: 100%;
  1055. .title-bar {
  1056. display: flex;
  1057. color: #333;
  1058. border-bottom: 1px solid #eee;
  1059. border-radius: 4px;
  1060. cursor: pointer;
  1061. .title-item {
  1062. display: flex;
  1063. align-items: center;
  1064. justify-content: center;
  1065. flex: 1;
  1066. height: 45px;
  1067. &.on {
  1068. color: var(--prev-color-primary);
  1069. font-size: 14px;
  1070. border-bottom: 1px solid var(--prev-color-primary);
  1071. }
  1072. }
  1073. }
  1074. .wrapper {
  1075. padding: 15px;
  1076. overflow-y: scroll;
  1077. -webkit-overflow-scrolling: touch;
  1078. .tips {
  1079. display: flex;
  1080. justify-content: space-between;
  1081. padding-bottom: 15px;
  1082. font-size: 13px;
  1083. color: #000;
  1084. cursor: pointer;
  1085. .ivu-icon {
  1086. color: #000;
  1087. }
  1088. }
  1089. }
  1090. .link-item {
  1091. padding: 10px;
  1092. border-bottom: 1px solid #F5F5F5;
  1093. font-size: 12px;
  1094. color: #323232;
  1095. .name {
  1096. font-size: 14px;
  1097. color: #1890FF;
  1098. }
  1099. .link-txt {
  1100. margin-top: 2px;
  1101. word-break: break-all;
  1102. }
  1103. .params {
  1104. margin-top: 5px;
  1105. color: #1CBE6B;
  1106. word-break: break-all;
  1107. .txt {
  1108. color: #323232;
  1109. }
  1110. span {
  1111. &:last-child i {
  1112. display: none;
  1113. color: red;
  1114. }
  1115. }
  1116. }
  1117. .lable {
  1118. display: flex;
  1119. margin-top: 5px;
  1120. color: #999;
  1121. p {
  1122. flex: 1;
  1123. word-break: break-all;
  1124. }
  1125. button {
  1126. margin-left: 30px;
  1127. width: 38px;
  1128. }
  1129. }
  1130. }
  1131. .dragArea.list-group {
  1132. display: flex;
  1133. flex-wrap: wrap;
  1134. .list-group-item {
  1135. display: flex;
  1136. flex-direction: column;
  1137. align-items: center;
  1138. justify-content: center;
  1139. width: 74px;
  1140. height: 66px;
  1141. margin-right: 17px;
  1142. margin-bottom: 10px;
  1143. font-size: 12px;
  1144. color: #666;
  1145. cursor: pointer;
  1146. border-radius: 5px;
  1147. text-align: center;
  1148. &:hover {
  1149. box-shadow: 0 0 5px 0 rgba(24, 144, 255, 0.3);
  1150. border-right: 5px;
  1151. transform: scale(1.1);
  1152. transition: all 0.2s;
  1153. }
  1154. &:nth-child(3n) {
  1155. margin-right: 0;
  1156. }
  1157. }
  1158. }
  1159. }
  1160. .content {
  1161. position: relative;
  1162. height: 100%;
  1163. width: 100%;
  1164. .page-foot {
  1165. position: relative;
  1166. width: 379px;
  1167. margin: 0 auto 20px auto;
  1168. .delete-box {
  1169. display: none;
  1170. position: absolute;
  1171. left: -2px;
  1172. top: 0;
  1173. width: 383px;
  1174. height: 100%;
  1175. border: 2px dashed var(--prev-color-primary);
  1176. padding: 10px 0;
  1177. }
  1178. &:hover, &.on {
  1179. /* cursor: move; */
  1180. .delete-box {
  1181. /* display: block; */
  1182. }
  1183. }
  1184. &.on {
  1185. cursor: move;
  1186. .delete-box {
  1187. display: block;
  1188. border: 2px solid var(--prev-color-primary);
  1189. box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
  1190. }
  1191. }
  1192. }
  1193. .page-title {
  1194. position: relative;
  1195. height: 35px;
  1196. line-height: 35px;
  1197. background: #fff;
  1198. font-size: 15px;
  1199. color: #333333;
  1200. text-align: center;
  1201. width: 379px;
  1202. margin: 0 auto;
  1203. .delete-box {
  1204. display: none;
  1205. position: absolute;
  1206. left: -2px;
  1207. top: 0;
  1208. width: 383px;
  1209. height: 100%;
  1210. border: 2px dashed var(--prev-color-primary);
  1211. padding: 10px 0;
  1212. span {
  1213. position: absolute;
  1214. right: 0;
  1215. bottom: 0;
  1216. width: 32px;
  1217. height: 16px;
  1218. line-height: 16px;
  1219. display: inline-block;
  1220. text-align: center;
  1221. font-size: 10px;
  1222. color: #fff;
  1223. background: rgba(0, 0, 0, 0.4);
  1224. margin-left: 2px;
  1225. cursor: pointer;
  1226. z-index: 11;
  1227. }
  1228. }
  1229. &:hover, &.on {
  1230. /* cursor: move; */
  1231. .delete-box {
  1232. /* display: block; */
  1233. }
  1234. }
  1235. &.on {
  1236. cursor: move;
  1237. .delete-box {
  1238. display: block;
  1239. border: 2px solid var(--prev-color-primary);
  1240. box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
  1241. }
  1242. }
  1243. }
  1244. .scroll-box {
  1245. flex: 1;
  1246. background-color: #fff;
  1247. width: 379px;
  1248. margin: 0 auto;
  1249. padding-top: 1px;
  1250. }
  1251. .dragArea.list-group {
  1252. width: 100%;
  1253. height: 100%;
  1254. .mConfig-item {
  1255. position: relative;
  1256. cursor: move;
  1257. .delete-box {
  1258. display: none;
  1259. position: absolute;
  1260. left: -2px;
  1261. top: 0;
  1262. width: 383px;
  1263. height: 100%;
  1264. border: 2px dashed var(--prev-color-primary);
  1265. /* padding: 10px 0; */
  1266. .handleType {
  1267. position: absolute;
  1268. right: -43px;
  1269. top: 0;
  1270. width: 36px;
  1271. height: 143px;
  1272. border-radius: 4px;
  1273. background-color: #1890ff;
  1274. cursor: pointer;
  1275. color: #fff;
  1276. font-weight: bold;
  1277. text-align: center;
  1278. padding: 4px 0;
  1279. .iconfont {
  1280. padding: 5px 0;
  1281. &.on {
  1282. opacity: 0.4;
  1283. }
  1284. }
  1285. }
  1286. }
  1287. &.on {
  1288. cursor: move;
  1289. .delete-box {
  1290. display: block;
  1291. border: 2px solid var(--prev-color-primary);
  1292. box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
  1293. }
  1294. }
  1295. }
  1296. .mConfig-item:hover {
  1297. transform: scale(1.01);
  1298. box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
  1299. transition: all 0.2s;
  1300. }
  1301. }
  1302. }
  1303. .right-box {
  1304. max-width: 400px;
  1305. min-width: 400px;
  1306. height: 100%;
  1307. border-radius: 4px;
  1308. overflow: scroll;
  1309. -webkit-overflow-scrolling: touch;
  1310. /deep/ .ivu-tabs-bar {
  1311. margin-bottom: 16px;
  1312. }
  1313. .title-bar {
  1314. width: 100%;
  1315. height: 45px;
  1316. line-height: 45px;
  1317. padding-left: 24px;
  1318. color: #000;
  1319. border-radius: 4px;
  1320. border-bottom: 1px solid #eee;
  1321. font-size: 14px;
  1322. }
  1323. }
  1324. ::-webkit-scrollbar {
  1325. width: 6px;
  1326. background-color: transparent;
  1327. }
  1328. ::-webkit-scrollbar-track {
  1329. border-radius: 10px;
  1330. }
  1331. ::-webkit-scrollbar-thumb {
  1332. background-color: #bfc1c4;
  1333. }
  1334. }
  1335. .foot-box {
  1336. position: relative;
  1337. display: flex;
  1338. align-items: center;
  1339. justify-content: center;
  1340. height: 80px;
  1341. background: #fff;
  1342. box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.03);
  1343. button {
  1344. width: 100px;
  1345. height: 32px;
  1346. font-size: 13px;
  1347. &:first-child {
  1348. margin-right: 20px;
  1349. }
  1350. }
  1351. }
  1352. /deep/ .ivu-scroll-loader {
  1353. display: none;
  1354. }
  1355. /deep/ .ivu-card-body {
  1356. width: 100%;
  1357. padding:0;
  1358. height: calc(100vh - 73px);
  1359. }
  1360. .rbtn {
  1361. position: absolute;
  1362. right: 20px;
  1363. }
  1364. .code {
  1365. position: relative;
  1366. }
  1367. .QRpic {
  1368. width: 160px;
  1369. height: 160px;
  1370. img {
  1371. width: 100%;
  1372. height: 100%;
  1373. }
  1374. }
  1375. </style>