HM-filterDropdown.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <template>
  2. <view class="HMfilterDropdown" @touchmove.stop.prevent="discard" >
  3. <view class="nav">
  4. <block v-for="(item,index) in menu" :key="index">
  5. <view class="first-menu" :class="{'on':showPage==index}" @tap="togglePage(index)">
  6. <text class="name">{{item.name}}</text>
  7. <text class="iconfont triangle" :style="'transform:rotate('+triangleDeg[index]+'deg);'"></text>
  8. </view>
  9. </block>
  10. </view>
  11. <view class="mask" :class="{'show':isShowMask,'hide':maskVisibility!=true}" @tap="togglePage(showPage)"></view>
  12. <block v-for="(page,page_index) in subData" :key="page_index">
  13. <view class="sub-menu-class" :class="{'show':showPage==page_index,'hide':pageState[page_index]!=true}">
  14. <block v-if="page.type=='hierarchy'&& page.submenu.length>0">
  15. <scroll-view class="sub-menu-list" :class="[activeMenuArr[page_index].length>1?'first':'alone']"
  16. :scroll-y="true" :scroll-into-view="'first_id'+firstScrollInto">
  17. <block v-for="(sub,index) in page.submenu" :key="index">
  18. <view class="sub-menu" :id="'first_id'+index" :class="{'on':activeMenuArr[page_index][0]==index}" @tap="selectHierarchyMenu(page_index,index,null,null)">
  19. <view class="menu-name">
  20. <text>{{sub.name}}</text>
  21. <text class="iconfont selected"></text>
  22. </view>
  23. </view>
  24. </block>
  25. </scroll-view>
  26. <block v-for="(sub,index) in page.submenu" :key="index">
  27. <scroll-view class="sub-menu-list not-first" :scroll-y="true" v-if="activeMenuArr[page_index][0]==index&&sub.submenu.length>0"
  28. :scroll-into-view="'second_id'+secondScrollInto">
  29. <block v-for="(sub_second,second_index) in sub.submenu" :key="second_index">
  30. <view class="sub-menu" :id="'second_id'+second_index" :class="{'on':activeMenuArr[page_index][1]==second_index}">
  31. <view class="menu-name" @tap="selectHierarchyMenu(page_index,activeMenuArr[page_index][0],second_index,null)">
  32. <text>{{sub_second.name}}</text>
  33. <text class="iconfont selected"></text>
  34. </view>
  35. <view class="more-sub-menu" v-if="sub_second.submenu&&sub.submenu.length>0&&sub_second.submenu.length>0">
  36. <block v-for="(sub2,sub2_index) in sub_second.submenu" :key="sub2_index">
  37. <text v-if="sub_second.showAllSub || (sub2_index<8)" :class="{'on':activeMenuArr[page_index][1]==second_index&&activeMenuArr[page_index][2]==sub2_index}"
  38. @tap="selectHierarchyMenu(page_index,activeMenuArr[page_index][0],second_index,sub2_index)">{{sub2.name}}</text>
  39. <text v-if="sub_second.showAllSub!=true && sub2_index==8 && sub_second.submenu.length>9" @tap="showMoreSub(second_index)">更多<text
  40. class="iconfont triangle"></text></text>
  41. </block>
  42. </view>
  43. </view>
  44. </block>
  45. </scroll-view>
  46. </block>
  47. </block>
  48. <block v-if="page.type=='filter'">
  49. <view class="filter">
  50. <scroll-view class="menu-box" :scroll-y="true">
  51. <view class="box" v-for="(box,box_index) in page.submenu" :key="box_index">
  52. <view class="title">{{box.name}}</view>
  53. <view class="labels">
  54. <view v-for="(label,label_index) in box.submenu" :key="label_index" @tap="selectFilterLabel(page_index,box_index,label_index)"
  55. :class="{'on':label.selected}">{{label.name}}</view>
  56. </view>
  57. </view>
  58. </scroll-view>
  59. <view class="btn-box">
  60. <view class="reset" @tap="resetFilterData(page_index)">重置</view>
  61. <view class="submit" @tap="setFilterData(page_index)">确定</view>
  62. </view>
  63. </view>
  64. </block>
  65. </view>
  66. </block>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. data() {
  72. return {
  73. subData: [], //菜单数据
  74. menu: [], //顶部横条数据
  75. showPage: -1, //菜单页面显示/隐藏动画控制
  76. pageState: [], //页面的状态
  77. activeMenuArr: [], //UI状态
  78. shadowActiveMenuArr: [], //记录选中
  79. triangleDeg: [], //小三角形的翻转动画控制
  80. isShowMask: false, //遮罩层显示/隐藏动画控制
  81. maskVisibility: false, //遮罩层显示/隐藏状态
  82. //滚动区域定位
  83. firstScrollInto: 0,
  84. secondScrollInto: 0,
  85. componentTop:0 //组件top
  86. }
  87. },
  88. props: {
  89. filterData: {
  90. value: Array,
  91. default: []
  92. },
  93. defaultSelected:{
  94. value: Array,
  95. default: []
  96. },
  97. updateMenuName:{
  98. value: Boolean,
  99. default: true
  100. }
  101. },
  102. watch: {
  103. filterData: {
  104. handler() {
  105. this.initMenu(); //filterData重新赋值初始化菜单
  106. },
  107. immediate: true
  108. },
  109. defaultSelected(newVal) {
  110. this.activeMenuArr = JSON.parse(JSON.stringify(newVal));
  111. this.shadowActiveMenuArr = JSON.parse(JSON.stringify(newVal));
  112. }
  113. },
  114. methods: {
  115. initMenu() {
  116. let tmpMenuActiveArr=[];
  117. let tmpMenu=[];
  118. for (let i = 0; i < this.filterData.length; i++) {
  119. let tmpitem = this.filterData[i];
  120. tmpMenu.push({
  121. //如果没有设置name,则取第一个菜单作为menu.name,filter类型则将"筛选"作为menu.name
  122. name: tmpitem.name || (tmpitem.type == "filter" ? "筛选" : tmpitem.submenu[0].name),
  123. type: tmpitem.type
  124. });
  125. //初始化选中项数组-ui状态
  126. tmpMenuActiveArr.push(this.processActive(tmpitem));
  127. //初始化角度数组
  128. this.triangleDeg.push(0);
  129. //初始化控制显示状态数组
  130. this.pageState.push(false);
  131. //递归处理子菜单数据
  132. tmpitem = this.processSubMenu(tmpitem);
  133. this.filterData[i] = tmpitem;
  134. }
  135. this.menu = tmpMenu;
  136. //初始化选中项数组
  137. tmpMenuActiveArr = this.defaultSelected.length>0?this.defaultSelected:this.activeMenuArr.length>0?this.activeMenuArr:tmpMenuActiveArr;
  138. this.activeMenuArr = JSON.parse(JSON.stringify(tmpMenuActiveArr));
  139. this.shadowActiveMenuArr = JSON.parse(JSON.stringify(tmpMenuActiveArr));
  140. //加载菜单数据
  141. console.log("this.filterData.length: " + JSON.stringify(this.filterData.length));
  142. this.subData = this.filterData;
  143. },
  144. //展开更多
  145. showMoreSub(index) {
  146. this.subData[this.showPage].submenu[this.activeMenuArr[this.showPage][0]].submenu[index].showAllSub = true;
  147. this.$forceUpdate();
  148. },
  149. //选中
  150. selectHierarchyMenu(page_index, level1_index, level2_index, level3_index) {
  151. //读取记录
  152. if (level1_index != null && level2_index == null && level3_index == null && this.shadowActiveMenuArr[page_index][0] ==
  153. level1_index) {
  154. this.activeMenuArr.splice(page_index, 1, JSON.parse(JSON.stringify(this.shadowActiveMenuArr[page_index])));
  155. } else {
  156. this.activeMenuArr[page_index].splice(0, 1, level1_index);
  157. (level2_index!=null||this.activeMenuArr[page_index].length>=2)&&this.activeMenuArr[page_index].splice(1, 1, level2_index) || this.activeMenuArr[page_index].splice(1, 1);
  158. (level3_index!=null||this.activeMenuArr[page_index].length>=3)&&this.activeMenuArr[page_index].splice(2, 1, level3_index) || this.activeMenuArr[page_index].splice(2, 1);
  159. }
  160. //写入结果
  161. if (level3_index != null || level2_index != null || (level1_index != null && this.subData[page_index].submenu[level1_index].submenu.length == 0)
  162. ) {
  163. let sub = this.subData[page_index].submenu[level1_index].submenu[level2_index];
  164. if(this.updateMenuName){
  165. this.menu[page_index].name = (level3_index != null && sub.submenu[level3_index].name) || (level2_index != null && sub.name) || this.subData[page_index].submenu[level1_index].name;
  166. }
  167. this.shadowActiveMenuArr[page_index] = JSON.parse(JSON.stringify(this.activeMenuArr[page_index]));
  168. this.togglePage(this.showPage);
  169. }
  170. },
  171. //写入结果,筛选
  172. setFilterData(page_index) {
  173. this.shadowActiveMenuArr[page_index] = JSON.parse(JSON.stringify(this.activeMenuArr[page_index]));
  174. this.togglePage(this.showPage);
  175. },
  176. //重置结果和ui,筛选
  177. resetFilterData(page_index) {
  178. let tmpArr = [];
  179. let level = this.shadowActiveMenuArr[page_index].length;
  180. while (level > 0) {
  181. tmpArr.push([]);
  182. let box = this.subData[page_index].submenu[level - 1].submenu;
  183. for (let i = 0; i < box.length; i++) {
  184. this.subData[page_index].submenu[level - 1].submenu[i].selected = false;
  185. }
  186. level--;
  187. }
  188. this.shadowActiveMenuArr[page_index] = JSON.parse(JSON.stringify(tmpArr));
  189. this.activeMenuArr[page_index] = JSON.parse(JSON.stringify(tmpArr));
  190. this.$forceUpdate();
  191. },
  192. //选中筛选类label-UI状态
  193. selectFilterLabel(page_index, box_index, label_index) {
  194. let find_index = this.activeMenuArr[page_index][box_index].indexOf(label_index);
  195. if (find_index > -1) {
  196. this.activeMenuArr[page_index][box_index].splice(find_index, 1);
  197. this.subData[page_index].submenu[box_index].submenu[label_index].selected = false;
  198. } else {
  199. this.activeMenuArr[page_index][box_index].push(label_index);
  200. this.subData[page_index].submenu[box_index].submenu[label_index].selected = true;
  201. }
  202. this.$forceUpdate();
  203. },
  204. //菜单开关
  205. togglePage(index) {
  206. if (index == this.showPage) {
  207. this.hidePageLayer(true);
  208. this.hideMask();
  209. this.showPage = -1;
  210. } else {
  211. if (this.showPage > -1) {
  212. this.hidePageLayer(false);
  213. }
  214. this.showPageLayer(index);
  215. this.showMask();
  216. }
  217. },
  218. //hide遮罩层
  219. hideMask() {
  220. this.isShowMask = false;
  221. setTimeout(() => {
  222. this.maskVisibility = false;
  223. }, 200);
  224. },
  225. //show遮罩层
  226. showMask() {
  227. this.maskVisibility = true;
  228. this.$nextTick(() => {
  229. setTimeout(() => {
  230. this.isShowMask = true;
  231. }, 0);
  232. })
  233. },
  234. //hide菜单页
  235. hidePageLayer(isAnimation) {
  236. this.triangleDeg[this.showPage] = 0;
  237. let tmpIndex = this.showPage;
  238. if (isAnimation) {
  239. setTimeout(() => {
  240. this.pageState.splice(tmpIndex, 1, false);
  241. }, 200);
  242. this.confirm();
  243. } else {
  244. this.pageState.splice(tmpIndex, 1, false)
  245. }
  246. this.firstScrollInto = null;
  247. this.secondScrollInto = null;
  248. },
  249. confirm() {
  250. let index = JSON.parse(JSON.stringify(this.shadowActiveMenuArr));
  251. let value = JSON.parse(JSON.stringify(this.shadowActiveMenuArr));
  252. //对结果做一下处理
  253. index.forEach((item, i) => {
  254. if (typeof(item[0]) == 'object') {
  255. //针对筛选结果过一个排序
  256. item.forEach((s, j) => {
  257. s.sort((val1, val2) => {
  258. return val1 - val2;
  259. });
  260. item[j] = s;
  261. s.forEach((v, k) => {
  262. value[i][j][k] = this.subData[i].submenu[j].submenu[v].value;
  263. });
  264. });
  265. }else{
  266. let submenu = this.subData[i].submenu[item[0]];
  267. value[i][0] = submenu.value;
  268. if(value[i].length>=2 && item[1]!=null){
  269. if(submenu.submenu.length>0){
  270. submenu = submenu.submenu[item[1]];
  271. value[i][1] = submenu.hasOwnProperty('value')?submenu.value:null;
  272. }else{
  273. value[i][1] = null
  274. }
  275. if(value[i].length>=3 && item[2]!=null){
  276. if(submenu.submenu.length>0){
  277. submenu = submenu.submenu[item[2]];
  278. value[i][2] = submenu.hasOwnProperty('value')?submenu.value:null;
  279. }else{
  280. value[i][2] = null;
  281. }
  282. }
  283. }
  284. }
  285. index[i] = item;
  286. });
  287. this.$emit('confirm', {
  288. index: index,
  289. value:value
  290. });
  291. },
  292. //show菜单页
  293. showPageLayer(index) {
  294. this.processPage(index);
  295. this.pageState.splice(index, 1, true);
  296. this.$nextTick(() => {
  297. setTimeout(() => {
  298. this.showPage = index;
  299. }, 0);
  300. })
  301. this.triangleDeg[index] = 180;
  302. },
  303. reloadActiveMenuArr(){
  304. for (let i = 0; i < this.filterData.length; i++) {
  305. let tmpitem = this.filterData[i];
  306. let tmpArr = this.processActive(tmpitem);
  307. tmpitem = this.processSubMenu(tmpitem);
  308. if(this.activeMenuArr[i].length!=tmpArr.length){
  309. this.filterData[i] = tmpitem;
  310. this.activeMenuArr.splice(i, 1, JSON.parse(JSON.stringify(tmpArr)));
  311. this.shadowActiveMenuArr.splice(i, 1, JSON.parse(JSON.stringify(tmpArr)));
  312. }
  313. }
  314. this.subData = this.filterData;
  315. this.$forceUpdate();
  316. },
  317. processPage(index) {
  318. //check UI控制数组,结果数组,防止传入数据层级和UI控制数组不同步
  319. this.reloadActiveMenuArr();
  320. //重置UI控制数组
  321. this.activeMenuArr.splice(index, 1, JSON.parse(JSON.stringify(this.shadowActiveMenuArr[index])));
  322. if (this.menu[index].type == 'filter') {
  323. //重载筛选页选中状态
  324. let level = this.shadowActiveMenuArr[index].length;
  325. for (let i = 0; i < level; i++) {
  326. let box = this.subData[index].submenu[i].submenu;
  327. for (let j = 0; j < box.length; j++) {
  328. if (this.shadowActiveMenuArr[index][i].indexOf(j) > -1) {
  329. this.subData[index].submenu[i].submenu[j].selected = true;
  330. } else {
  331. this.subData[index].submenu[i].submenu[j].selected = false;
  332. }
  333. }
  334. }
  335. } else if (this.menu[index].type == 'hierarchy') {
  336. this.$nextTick(() => {
  337. setTimeout(() => {
  338. //滚动到选中项
  339. this.firstScrollInto = parseInt(this.activeMenuArr[index][0]);
  340. this.secondScrollInto = parseInt(this.activeMenuArr[index][1]);
  341. }, 0);
  342. })
  343. }
  344. },
  345. processActive(tmpitem) {
  346. let tmpArr = []
  347. if (tmpitem.type == 'hierarchy'&&tmpitem.hasOwnProperty('submenu')&&tmpitem.submenu.length>0) {
  348. let level = this.getMaxFloor(tmpitem.submenu);
  349. while (level > 0) {
  350. tmpArr.push(0);
  351. level--;
  352. }
  353. } else if (tmpitem.type == 'filter') {
  354. let level = tmpitem.submenu.length;
  355. while (level > 0) {
  356. tmpArr.push([]);
  357. level--;
  358. }
  359. }
  360. return tmpArr;
  361. },
  362. processSubMenu(menu) {
  363. if (menu.hasOwnProperty('submenu') && menu.submenu.length > 0) {
  364. for (let i = 0; i < menu.submenu.length; i++) {
  365. menu.submenu[i] = this.processSubMenu(menu.submenu[i]);
  366. }
  367. } else {
  368. menu.submenu = [];
  369. }
  370. return menu;
  371. },
  372. //计算菜单层级
  373. getMaxFloor(treeData) {
  374. let floor = 0
  375. let max = 0
  376. function each(data, floor) {
  377. data.forEach(e => {
  378. max = floor > max ? floor : max;
  379. if (e.hasOwnProperty('submenu') && e.submenu.length > 0) {
  380. each(e.submenu, floor + 1)
  381. }
  382. })
  383. }
  384. each(treeData, 1)
  385. return max;
  386. },
  387. discard() {
  388. }
  389. }
  390. }
  391. </script>
  392. <style lang="scss">
  393. .HMfilterDropdown {
  394. flex-shrink: 0;
  395. width: 100%;
  396. height: 44px;
  397. position: fixed;
  398. z-index: 997;
  399. flex-wrap: nowrap;
  400. display: flex;
  401. flex-direction: row;
  402. top: var(--window-top);
  403. left:0;
  404. view {
  405. display: flex;
  406. flex-wrap: nowrap;
  407. }
  408. }
  409. .region {
  410. flex: 1;
  411. height: 44px;
  412. }
  413. .nav {
  414. width: 100%;
  415. height: 44px;
  416. border-bottom: solid 1rpx #eee;
  417. z-index: 12;
  418. background-color: #ffffff;
  419. flex-direction: row;
  420. .first-menu {
  421. width: 100%;
  422. font-size: 13px;
  423. color: #757575;
  424. flex-direction: row;
  425. align-items: center;
  426. justify-content: center;
  427. transition: color .2s linear;
  428. &.on {
  429. color: #ec652b;
  430. .iconfont {
  431. color: #ec652b;
  432. }
  433. }
  434. .name {
  435. height: 20px;
  436. text-align: center;
  437. text-overflow: clip;
  438. overflow: hidden;
  439. }
  440. .iconfont {
  441. width: 13px;
  442. height: 13px;
  443. align-items: center;
  444. justify-content: center;
  445. transition: transform .2s linear, color .2s linear;
  446. }
  447. }
  448. }
  449. .sub-menu-class {
  450. width: 100%;
  451. position: absolute;
  452. left: 0;
  453. transform: translate3d(0, - 100%, 0);
  454. max-height: 345px;
  455. background-color: #ffffff;
  456. z-index: 11;
  457. box-shadow: 0 5px 5px rgba(0, 0, 0, .1);
  458. overflow: hidden;
  459. flex-direction: row;
  460. transition: transform .15s linear;
  461. &.hide {
  462. display: none;
  463. }
  464. &.show {
  465. transform: translate3d(0, calc(44px + 1rpx), 0);
  466. }
  467. }
  468. .sub-menu-list {
  469. width: 100%;
  470. height: 345px;
  471. flex-direction: column;
  472. .sub-menu {
  473. min-height: 44px;
  474. font-size: 13px;
  475. flex-direction: column;
  476. padding-right: 15px;
  477. >.menu-name {
  478. height: 44px;
  479. flex-direction: row;
  480. align-items: center;
  481. justify-content: space-between;
  482. >.iconfont {
  483. display: none;
  484. font-size: 18px;
  485. color: #ec652b;
  486. }
  487. }
  488. }
  489. &.first {
  490. flex-shrink: 0;
  491. width: 236rpx;
  492. background-color: #f0f0f0;
  493. .sub-menu {
  494. padding-left: 15px;
  495. &.on {
  496. background-color: #fff;
  497. }
  498. }
  499. }
  500. &.alone {
  501. max-height: 345px;
  502. min-height: 170px;
  503. height: auto;
  504. .sub-menu {
  505. min-height: calc(44px - 1rpx);
  506. margin-left: 15px;
  507. border-bottom: solid 1rpx #e5e5e5;
  508. &.on {
  509. color: #ec652b;
  510. >.menu-name {
  511. >.iconfont {
  512. display: block;
  513. }
  514. }
  515. }
  516. }
  517. }
  518. &.not-first {
  519. .sub-menu {
  520. min-height: calc(44px - 1rpx);
  521. margin-left: 15px;
  522. border-bottom: solid 1rpx #e5e5e5;
  523. >.menu-name {
  524. height: calc(44px - 1rpx);
  525. >.iconfont {
  526. display: none;
  527. font-size: 18px;
  528. color: #ec652b;
  529. }
  530. }
  531. &.on {
  532. color: #ec652b;
  533. >.menu-name {
  534. >.iconfont {
  535. display: block;
  536. }
  537. }
  538. }
  539. .more-sub-menu {
  540. flex-direction: row;
  541. flex-wrap: wrap;
  542. padding-bottom: 9px;
  543. >text {
  544. height: 30px;
  545. border-radius: 3px;
  546. background-color: #f5f5f5;
  547. color: #9b9b9b;
  548. margin-bottom: 6px;
  549. margin-right: 6px;
  550. text-align: center;
  551. line-height: 30px;
  552. border: solid #f5f5f5 1rpx;
  553. flex: 0 0 calc(33.33% - 6px);
  554. overflow: hidden;
  555. font-size: 12px;
  556. &:nth-child(3n) {
  557. margin-right: 0;
  558. }
  559. &.on {
  560. border-color: #f6c8ac;
  561. color: #ec652b;
  562. }
  563. .iconfont {
  564. color: #9b9b9b;
  565. }
  566. }
  567. }
  568. }
  569. }
  570. }
  571. .filter {
  572. width: 100%;
  573. height: 345px;
  574. display: flex;
  575. flex-direction: column;
  576. justify-content: space-between;
  577. align-items: center;
  578. .menu-box {
  579. width: 698rpx;
  580. height: calc(345px - 75px);
  581. flex-shrink: 1;
  582. .box {
  583. width: 100%;
  584. margin-top: 16px;
  585. flex-direction: column;
  586. .title {
  587. width: 100%;
  588. font-size: 13px;
  589. color: #888;
  590. }
  591. .labels {
  592. flex-direction: row;
  593. flex-wrap: wrap;
  594. .on {
  595. border-color: #ec652b;
  596. background-color: #ec652b;
  597. color: #fff;
  598. }
  599. >view {
  600. width: 148rpx;
  601. height: 30px;
  602. border: solid 1rpx #adadad;
  603. border-radius: 2px;
  604. margin-right: 15px;
  605. margin-top: 8px;
  606. font-size: 12px;
  607. flex-direction: row;
  608. justify-content: center;
  609. align-items: center;
  610. &:nth-child(4n) {
  611. margin-right: 0;
  612. }
  613. }
  614. }
  615. }
  616. }
  617. .btn-box {
  618. flex-shrink: 0;
  619. width: 698rpx;
  620. height: 75px;
  621. flex-direction: row !important;
  622. align-items: center;
  623. justify-content: space-between;
  624. >view {
  625. width: 320rpx;
  626. height: 40px;
  627. border-radius: 40px;
  628. border: solid 1rpx #ec652b;
  629. align-items: center;
  630. justify-content: center;
  631. }
  632. .reset {
  633. color: #ec652b;
  634. }
  635. .submit {
  636. color: #fff;
  637. background-color: #ec652b;
  638. }
  639. }
  640. }
  641. .mask {
  642. z-index: 10;
  643. position: fixed;
  644. top: 0;
  645. left: 0;
  646. right: 0;
  647. bottom: 0;
  648. background-color: rgba(0, 0, 0, 0);
  649. transition: background-color .15s linear;
  650. &.show {
  651. background-color: rgba(0, 0, 0, 0.5);
  652. }
  653. &.hide {
  654. display: none;
  655. }
  656. }
  657. /* 字体图标 */
  658. @font-face {
  659. font-family: "HM-FD-font";
  660. src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAALAAAsAAAAABpQAAAJzAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDBgp4gQIBNgIkAwwLCAAEIAWEbQc5G8sFERWMIbIfCbbzqA4hp7InSBibVsYGb4J42o82b3e/nJlHMw/NHbGOlwKJRCRpwzPtpAECCOZubdqxjYpQLMlVg+70/08edrgQOtx2ukpVyApZn+dyehPoQObHo3O85rYx9vOjXoBxQIHugW2yIkqIW2QXcScu4jwE8CSWbKSmrqUHFwOaJoCsLM5P4haSGIxRcRHshrUGucLCVcfqI3AZfV/+USguKCwNmtsxVztDxU/n55C+3W0Z4QQpEOTNFqCBbMCAjDUWB9CIwWk87aa70cYgqLkyd3dEmm+18R8eKATEBrV7A5CulBT8dKiWOYZk412XNcDdKSEKSGODnyKIDl+dmVt9/Dx4pu/xyeutkMlHISGPTsPCnoTNP9nOT6wTtDdlO6dPr47efvj942lkYuQzrhMKEjq9N6y98P3340gmlJ/RStUD6F31CAEEPtUW94/7rf+7XgaAz57X0ZHXAGsFFwVgw38yALuMb0IBbVyNamFYEw4oKMDTj3AHRQP5Pt4dci9VwSVkRNQh5r7CLskZadhsWHhRDBsXczk8ZYk3ewnCxmQeQKa3BOHvA8XXO2j+vqRhf7CE+sPmn4anvoL29JLa4qqaUQkmoK+QG2osCckq7txi2leK86aIPyJ3eQZ8xytXYmyQ51jQndJAxIJlqiGSLsOqImiZCjTiZCJt6Lq26U2OoXqwUo0hRaAE0K5AziANy/uLVeXzWyjVqyjcoeupjxDr5MMDn8MDkLG9Aenu5ZrOSSoghAUsRmogkkahSoWAtnlUARnCkY3It0Iu7mWhdmd9Z/19BwBP6GidEi0G56opckXTGZVSPxgAAAA=');
  661. }
  662. .iconfont {
  663. font-family: "HM-FD-font" !important;
  664. font-size: 13px;
  665. font-style: normal;
  666. color: #757575;
  667. &.triangle {
  668. &:before {
  669. content: "\e65a";
  670. }
  671. }
  672. &.selected {
  673. &:before {
  674. content: "\e607";
  675. }
  676. }
  677. }
  678. </style>