diyIndex.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467
  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(0)" :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. window.onbeforeunload = () => {
  333. return '刷新页面将丢失内容,是否继续?';
  334. };
  335. this.categoryList();
  336. this.getUrlList();
  337. this.pageId = this.$route.query.id;
  338. this.pageName = this.$route.query.name;
  339. this.pageType = this.$route.query.type;
  340. this.lConfig = this.objToArr(mPage);
  341. },
  342. mounted() {
  343. // window.addEventListener('onbeforeunload', this.beforeUnload);
  344. let imgList = {
  345. imgList: [require('@/assets/images/foot-005.png'), require('@/assets/images/foot-006.png')],
  346. name: '购物车',
  347. link: '/pages/order_addcart/order_addcart',
  348. };
  349. this.$nextTick(() => {
  350. this.$store.commit('mobildConfig/FOOTER', {
  351. title: '专题页是否显示',
  352. name: imgList,
  353. });
  354. this.arraySort();
  355. if (this.pageId != 0) {
  356. this.getDefaultConfig();
  357. } else {
  358. this.showTitle();
  359. }
  360. this.clientHeight = `${document.documentElement.clientHeight}`; //获取浏览器可视区域高度
  361. let H = `${document.documentElement.clientHeight}` - 180;
  362. this.rollHeight = H > 650 ? 650 : H;
  363. let that = this;
  364. window.onresize = function () {
  365. that.clientHeight = `${document.documentElement.clientHeight}`;
  366. let H = `${document.documentElement.clientHeight}` - 180;
  367. that.rollHeight = H > 650 ? 650 : H;
  368. };
  369. });
  370. },
  371. methods: {
  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. }, 1000);
  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. console.log(init, name);
  797. saveDiy(init ? 0 : this.pageId, {
  798. type: this.pageType,
  799. value: val,
  800. title: this.titleTxt,
  801. name: name || this.nameTxt,
  802. is_show: this.showTxt ? 1 : 0,
  803. is_bg_color: this.colorTxt ? 1 : 0,
  804. color_picker: this.colorPickerTxt,
  805. bg_pic: this.picUrlTxt,
  806. bg_tab_val: this.tabValTxt,
  807. is_bg_pic: this.picTxt ? 1 : 0,
  808. })
  809. .then((res) => {
  810. this.loading = false;
  811. if (!init) {
  812. this.pageId = res.data.id;
  813. }
  814. this.saveName = '';
  815. this.$Message.success(res.msg);
  816. })
  817. .catch((res) => {
  818. this.loading = false;
  819. this.$Message.error(res.msg);
  820. });
  821. },
  822. // 保存配置
  823. saveConfig(init, name) {
  824. if (this.mConfig.length == 0) {
  825. return this.$Message.error('暂未添加任何组件,保存失败!');
  826. }
  827. this.loading = true;
  828. let val = this.$store.state.mobildConfig.defaultArray;
  829. if (!this.footActive) {
  830. let timestamp = new Date().getTime() * 1000;
  831. val[timestamp] = this.$store.state.mobildConfig.pageFooter;
  832. this.footActive = true;
  833. }
  834. this.$nextTick(() => {
  835. this.diySaveDate(val, init, name);
  836. });
  837. },
  838. // 获取默认配置
  839. getDefaultConfig() {
  840. getDiyInfo(this.pageId).then(({ data }) => {
  841. let obj = {};
  842. let tempARR = [];
  843. this.$store.commit('mobildConfig/titleUpdata', data.info.title);
  844. this.$store.commit('mobildConfig/nameUpdata', data.info.name);
  845. this.$store.commit('mobildConfig/showUpdata', data.info.is_show);
  846. this.$store.commit('mobildConfig/colorUpdata', data.info.is_bg_color || 0);
  847. this.$store.commit('mobildConfig/picUpdata', data.info.is_bg_pic || 0);
  848. this.$store.commit('mobildConfig/pickerUpdata', data.info.color_picker || '#f5f5f5');
  849. this.$store.commit('mobildConfig/radioUpdata', data.info.bg_tab_val || 0);
  850. this.$store.commit('mobildConfig/picurlUpdata', data.info.bg_pic || '');
  851. let newArr = this.objToArr(data.info.value);
  852. function sortNumber(a, b) {
  853. return a.timestamp - b.timestamp;
  854. }
  855. newArr.sort(sortNumber);
  856. newArr.map((el, index) => {
  857. if (el.name == 'headerSerch') {
  858. this.isSearch = true;
  859. }
  860. if (el.name == 'tabNav') {
  861. this.isTab = true;
  862. }
  863. if (el.name == 'goodList') {
  864. let storage = window.localStorage;
  865. storage.setItem(el.timestamp, el.selectConfig.activeValue);
  866. }
  867. el.id = 'id' + el.timestamp;
  868. this.lConfig.map((item, j) => {
  869. if (el.name == item.defaultName) {
  870. item.num = el.timestamp;
  871. item.id = 'id' + el.timestamp;
  872. let tempItem = JSON.parse(JSON.stringify(item));
  873. tempARR.push(tempItem);
  874. obj[el.timestamp] = el;
  875. this.mConfig.push(tempItem);
  876. // 保存默认组件配置
  877. this.$store.commit('mobildConfig/ADDARRAY', {
  878. num: el.timestamp,
  879. val: el,
  880. });
  881. }
  882. });
  883. });
  884. let objs = newArr[newArr.length - 1];
  885. if (objs.name == 'pageFoot') {
  886. this.$store.commit('mobildConfig/footPageUpdata', objs);
  887. }
  888. this.showTitle();
  889. // this.rConfig = [];
  890. // this.activeIndex = 0;
  891. // this.rConfig.push(this.mConfig[0]);
  892. });
  893. },
  894. categoryList() {
  895. categoryList((res) => {
  896. this.category = res.data;
  897. });
  898. },
  899. // 重置
  900. reast() {
  901. if (this.pageId == 0) {
  902. this.$Message.error('新增页面,无法重置');
  903. } else {
  904. this.$Modal.confirm({
  905. title: '提示',
  906. content: '<p>重置会恢复到上次保存的数据,确定不保存当前操作吗?</p>',
  907. onOk: () => {
  908. this.mConfig = [];
  909. this.rConfig = [];
  910. this.activeIndex = -99;
  911. this.getDefaultConfig();
  912. },
  913. onCancel: () => {},
  914. });
  915. }
  916. },
  917. },
  918. beforeDestroy() {
  919. this.$store.commit('mobildConfig/titleUpdata', '');
  920. this.$store.commit('mobildConfig/nameUpdata', '');
  921. this.$store.commit('mobildConfig/showUpdata', 1);
  922. this.$store.commit('mobildConfig/colorUpdata', 0);
  923. this.$store.commit('mobildConfig/picUpdata', 0);
  924. this.$store.commit('mobildConfig/pickerUpdata', '#f5f5f5');
  925. this.$store.commit('mobildConfig/radioUpdata', 0);
  926. this.$store.commit('mobildConfig/picurlUpdata', '');
  927. this.$store.commit('mobildConfig/SETEMPTY');
  928. },
  929. destroyed() {
  930. this.$store.commit('mobildConfig/titleUpdata', '');
  931. this.$store.commit('mobildConfig/nameUpdata', '');
  932. this.$store.commit('mobildConfig/showUpdata', 1);
  933. this.$store.commit('mobildConfig/colorUpdata', 0);
  934. this.$store.commit('mobildConfig/picUpdata', 0);
  935. this.$store.commit('mobildConfig/pickerUpdata', '#f5f5f5');
  936. this.$store.commit('mobildConfig/radioUpdata', 0);
  937. this.$store.commit('mobildConfig/picurlUpdata', '');
  938. this.$store.commit('mobildConfig/SETEMPTY');
  939. },
  940. };
  941. </script>
  942. <style scoped lang="stylus">
  943. .ysize {
  944. background-size: 100%;
  945. }
  946. .fullsize {
  947. background-size: 100% 100%;
  948. }
  949. .repeat {
  950. background-repeat: repeat;
  951. }
  952. .noRepeat {
  953. background-repeat: no-repeat;
  954. }
  955. .wrapper-con {
  956. position relative
  957. .acticon{
  958. position absolute
  959. right: 20px
  960. top 20px
  961. display: flex;
  962. flex-direction: column;
  963. z-index: 9;
  964. }
  965. /* min-width 700px; */
  966. }
  967. .main .content-wrapper{
  968. padding: 0 !important;
  969. }
  970. .defaultData {
  971. /* margin-left 20px; */
  972. cursor: pointer;
  973. position: absolute;
  974. left: 50%;
  975. margin-left: 245px;
  976. .data {
  977. margin-top: 20px;
  978. color: #282828;
  979. background-color: #fff;
  980. width: 94px;
  981. text-align: center;
  982. height: 32px;
  983. line-height: 32px;
  984. border-radius: 3px;
  985. font-size: 12px;
  986. }
  987. .data:hover {
  988. background-color: #2d8cf0;
  989. color: #fff;
  990. border: 0;
  991. }
  992. }
  993. .overflowy {
  994. overflow-y: scroll;
  995. .picture {
  996. width: 379px;
  997. height: 20px;
  998. margin: 0 auto;
  999. background-color: #fff;
  1000. }
  1001. }
  1002. .bnt {
  1003. width: 80px !important;
  1004. }
  1005. /* 定义滑块 内阴影+圆角 */
  1006. ::-webkit-scrollbar-thumb {
  1007. -webkit-box-shadow: inset 0 0 6px #fff;
  1008. display: none;
  1009. }
  1010. .left:hover::-webkit-scrollbar-thumb, .right-box:hover::-webkit-scrollbar-thumb {
  1011. display: block;
  1012. }
  1013. .contxt:hover ::-webkit-scrollbar-thumb {
  1014. display: block;
  1015. }
  1016. ::-webkit-scrollbar {
  1017. width: 4px !important; /* 对垂直流动条有效 */
  1018. }
  1019. .scrollCon {
  1020. overflow-y: scroll;
  1021. overflow-x: hidden;
  1022. }
  1023. .scroll-box .position {
  1024. display: block !important;
  1025. height: 40px;
  1026. text-align: center;
  1027. line-height: 40px;
  1028. border: 1px dashed #1890ff;
  1029. color: #1890ff;
  1030. background-color: #edf4fb;
  1031. }
  1032. .scroll-box .conter {
  1033. display: none !important;
  1034. }
  1035. .dragClass {
  1036. background-color: #fff;
  1037. }
  1038. .ivu-mt {
  1039. display: flex;
  1040. justify-content: space-between;
  1041. margin-bottom: 10px;
  1042. }
  1043. .iconfont-diy {
  1044. font-size: 24px;
  1045. color: var(--prev-color-primary);
  1046. }
  1047. .diy-wrapper {
  1048. max-width: 100%;
  1049. min-width: 1100px;
  1050. display: flex;
  1051. justify-content: space-between;
  1052. height: 100%;
  1053. .left {
  1054. min-width: 300px;
  1055. max-width: 300px;
  1056. /* border 1px solid #DDDDDD */
  1057. border-radius: 4px;
  1058. height: 100%;
  1059. .title-bar {
  1060. display: flex;
  1061. color: #333;
  1062. border-bottom: 1px solid #eee;
  1063. border-radius: 4px;
  1064. cursor: pointer;
  1065. .title-item {
  1066. display: flex;
  1067. align-items: center;
  1068. justify-content: center;
  1069. flex: 1;
  1070. height: 45px;
  1071. &.on {
  1072. color: var(--prev-color-primary);
  1073. font-size: 14px;
  1074. border-bottom: 1px solid var(--prev-color-primary);
  1075. }
  1076. }
  1077. }
  1078. .wrapper {
  1079. padding: 15px;
  1080. overflow-y: scroll;
  1081. -webkit-overflow-scrolling: touch;
  1082. .tips {
  1083. display: flex;
  1084. justify-content: space-between;
  1085. padding-bottom: 15px;
  1086. font-size: 13px;
  1087. color: #000;
  1088. cursor: pointer;
  1089. .ivu-icon {
  1090. color: #000;
  1091. }
  1092. }
  1093. }
  1094. .link-item {
  1095. padding: 10px;
  1096. border-bottom: 1px solid #F5F5F5;
  1097. font-size: 12px;
  1098. color: #323232;
  1099. .name {
  1100. font-size: 14px;
  1101. color: #1890FF;
  1102. }
  1103. .link-txt {
  1104. margin-top: 2px;
  1105. word-break: break-all;
  1106. }
  1107. .params {
  1108. margin-top: 5px;
  1109. color: #1CBE6B;
  1110. word-break: break-all;
  1111. .txt {
  1112. color: #323232;
  1113. }
  1114. span {
  1115. &:last-child i {
  1116. display: none;
  1117. color: red;
  1118. }
  1119. }
  1120. }
  1121. .lable {
  1122. display: flex;
  1123. margin-top: 5px;
  1124. color: #999;
  1125. p {
  1126. flex: 1;
  1127. word-break: break-all;
  1128. }
  1129. button {
  1130. margin-left: 30px;
  1131. width: 38px;
  1132. }
  1133. }
  1134. }
  1135. .dragArea.list-group {
  1136. display: flex;
  1137. flex-wrap: wrap;
  1138. .list-group-item {
  1139. display: flex;
  1140. flex-direction: column;
  1141. align-items: center;
  1142. justify-content: center;
  1143. width: 74px;
  1144. height: 66px;
  1145. margin-right: 17px;
  1146. margin-bottom: 10px;
  1147. font-size: 12px;
  1148. color: #666;
  1149. cursor: pointer;
  1150. border-radius: 5px;
  1151. text-align: center;
  1152. &:hover {
  1153. box-shadow: 0 0 5px 0 rgba(24, 144, 255, 0.3);
  1154. border-right: 5px;
  1155. transform: scale(1.1);
  1156. transition: all 0.2s;
  1157. }
  1158. &:nth-child(3n) {
  1159. margin-right: 0;
  1160. }
  1161. }
  1162. }
  1163. }
  1164. .content {
  1165. position: relative;
  1166. height: 100%;
  1167. width: 100%;
  1168. .page-foot {
  1169. position: relative;
  1170. width: 379px;
  1171. margin: 0 auto 20px auto;
  1172. .delete-box {
  1173. display: none;
  1174. position: absolute;
  1175. left: -2px;
  1176. top: 0;
  1177. width: 383px;
  1178. height: 100%;
  1179. border: 2px dashed var(--prev-color-primary);
  1180. padding: 10px 0;
  1181. }
  1182. &:hover, &.on {
  1183. /* cursor: move; */
  1184. .delete-box {
  1185. /* display: block; */
  1186. }
  1187. }
  1188. &.on {
  1189. cursor: move;
  1190. .delete-box {
  1191. display: block;
  1192. border: 2px solid var(--prev-color-primary);
  1193. box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
  1194. }
  1195. }
  1196. }
  1197. .page-title {
  1198. position: relative;
  1199. height: 35px;
  1200. line-height: 35px;
  1201. background: #fff;
  1202. font-size: 15px;
  1203. color: #333333;
  1204. text-align: center;
  1205. width: 379px;
  1206. margin: 0 auto;
  1207. .delete-box {
  1208. display: none;
  1209. position: absolute;
  1210. left: -2px;
  1211. top: 0;
  1212. width: 383px;
  1213. height: 100%;
  1214. border: 2px dashed var(--prev-color-primary);
  1215. padding: 10px 0;
  1216. span {
  1217. position: absolute;
  1218. right: 0;
  1219. bottom: 0;
  1220. width: 32px;
  1221. height: 16px;
  1222. line-height: 16px;
  1223. display: inline-block;
  1224. text-align: center;
  1225. font-size: 10px;
  1226. color: #fff;
  1227. background: rgba(0, 0, 0, 0.4);
  1228. margin-left: 2px;
  1229. cursor: pointer;
  1230. z-index: 11;
  1231. }
  1232. }
  1233. &:hover, &.on {
  1234. /* cursor: move; */
  1235. .delete-box {
  1236. /* display: block; */
  1237. }
  1238. }
  1239. &.on {
  1240. cursor: move;
  1241. .delete-box {
  1242. display: block;
  1243. border: 2px solid var(--prev-color-primary);
  1244. box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
  1245. }
  1246. }
  1247. }
  1248. .scroll-box {
  1249. flex: 1;
  1250. background-color: #fff;
  1251. width: 379px;
  1252. margin: 0 auto;
  1253. padding-top: 1px;
  1254. }
  1255. .dragArea.list-group {
  1256. width: 100%;
  1257. height: 100%;
  1258. .mConfig-item {
  1259. position: relative;
  1260. cursor: move;
  1261. .delete-box {
  1262. display: none;
  1263. position: absolute;
  1264. left: -2px;
  1265. top: 0;
  1266. width: 383px;
  1267. height: 100%;
  1268. border: 2px dashed var(--prev-color-primary);
  1269. /* padding: 10px 0; */
  1270. .handleType {
  1271. position: absolute;
  1272. right: -43px;
  1273. top: 0;
  1274. width: 36px;
  1275. height: 143px;
  1276. border-radius: 4px;
  1277. background-color: #1890ff;
  1278. cursor: pointer;
  1279. color: #fff;
  1280. font-weight: bold;
  1281. text-align: center;
  1282. padding: 4px 0;
  1283. .iconfont {
  1284. padding: 5px 0;
  1285. &.on {
  1286. opacity: 0.4;
  1287. }
  1288. }
  1289. }
  1290. }
  1291. &.on {
  1292. cursor: move;
  1293. .delete-box {
  1294. display: block;
  1295. border: 2px solid var(--prev-color-primary);
  1296. box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
  1297. }
  1298. }
  1299. }
  1300. .mConfig-item:hover {
  1301. transform: scale(1.01);
  1302. box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
  1303. transition: all 0.2s;
  1304. }
  1305. }
  1306. }
  1307. .right-box {
  1308. max-width: 400px;
  1309. min-width: 400px;
  1310. height: 100%;
  1311. border-radius: 4px;
  1312. overflow: scroll;
  1313. -webkit-overflow-scrolling: touch;
  1314. /deep/ .ivu-tabs-bar {
  1315. margin-bottom: 16px;
  1316. }
  1317. .title-bar {
  1318. width: 100%;
  1319. height: 45px;
  1320. line-height: 45px;
  1321. padding-left: 24px;
  1322. color: #000;
  1323. border-radius: 4px;
  1324. border-bottom: 1px solid #eee;
  1325. font-size: 14px;
  1326. }
  1327. }
  1328. ::-webkit-scrollbar {
  1329. width: 6px;
  1330. background-color: transparent;
  1331. }
  1332. ::-webkit-scrollbar-track {
  1333. border-radius: 10px;
  1334. }
  1335. ::-webkit-scrollbar-thumb {
  1336. background-color: #bfc1c4;
  1337. }
  1338. }
  1339. .foot-box {
  1340. position: relative;
  1341. display: flex;
  1342. align-items: center;
  1343. justify-content: center;
  1344. height: 80px;
  1345. background: #fff;
  1346. box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.03);
  1347. button {
  1348. width: 100px;
  1349. height: 32px;
  1350. font-size: 13px;
  1351. &:first-child {
  1352. margin-right: 20px;
  1353. }
  1354. }
  1355. }
  1356. /deep/ .ivu-scroll-loader {
  1357. display: none;
  1358. }
  1359. /deep/ .ivu-card-body {
  1360. width: 100%;
  1361. padding:0;
  1362. height: calc(100vh - 73px);
  1363. }
  1364. .rbtn {
  1365. position: absolute;
  1366. right: 20px;
  1367. }
  1368. .code {
  1369. position: relative;
  1370. }
  1371. .QRpic {
  1372. width: 160px;
  1373. height: 160px;
  1374. img {
  1375. width: 100%;
  1376. height: 100%;
  1377. }
  1378. }
  1379. </style>