selectCity.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. <template>
  2. <view>
  3. <u-navbar :title="title" @leftClick='back' :placeholder='true'>
  4. </u-navbar>
  5. <view class="row1">
  6. <view class="start-place" :class="type==0?'active1':''" @click="changeCity(0)">选择发货地</view>
  7. <view class="end-place" :class="type==1?'active1':''" @click="changeCity(1)">选择收货地</view>
  8. </view>
  9. <view class="container">
  10. <view class="row2">
  11. <view class="content1" v-if="type==0">
  12. <view class="history-city-title">历史发货地</view>
  13. <view class="city-list">
  14. <view class="city" v-for="(item,index) in historyFcityList" :key='index' @click="historyClick(0,item)">
  15. {{item.selected}}
  16. </view>
  17. </view>
  18. </view>
  19. <view class="content2" v-if="type==1">
  20. <view class="history-city-title">历史收货地</view>
  21. <view class="city-list">
  22. <view class="city" v-for="(item,index) in historyScityList" :key='index' @click="historyClick(1,item)">
  23. {{item.selected}}
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="page">
  30. <view class="title flex flex-space-between">
  31. <view class="flex nav-bag-left">
  32. <!-- 省 -->
  33. <view class="flex" :class="(type==0?fstatus:sstatus)==0?'select-active':''" @click="titleClick(0)">
  34. <view class="tt point">{{type==0?fchooseprovince:schooseprovince}}</view>
  35. <view v-if="type==0?fchooseprovince:schooseprovince" style="margin: 0 10rpx;">></view>
  36. </view>
  37. <!-- 市 -->
  38. <view class="flex"
  39. v-if="(type==0?fchooseprovince:schooseprovince)!='选择'&&(type==0?fchooseprovince:schooseprovince)!='全国'"
  40. :class="(type==0?fstatus:sstatus)==1?'select-active':''" @click="titleClick(1)">
  41. <view class="tt point nav-point">{{type==0?fchoosecity:schoosecity}}</view>
  42. <view v-if="type==0?fchoosecity:schoosecity" style="margin: 0 10rpx;">></view>
  43. </view>
  44. <!-- 区 -->
  45. <view class="tt area"
  46. v-if="(type==0?fchooseprovince:schooseprovince)!='选择'&&(type==0?fchoosecity:schoosecity)!='请选择市'&&(type==0?fchoosecity:schoosecity)!='全部'"
  47. :class="(type==0?fstatus:sstatus)==2?'select-active':''" @click="titleClick(2)">
  48. {{type==0?fchoosearea:schoosearea}}
  49. </view>
  50. </view>
  51. <view class="back-level" v-if="(type==0?fstatus:sstatus)!=0" @click="backLevel">返回上一级</view>
  52. </view>
  53. <view class="link">
  54. <!-- 省 -->
  55. <view class="container" v-if="(type==0?fstatus:sstatus)==0">
  56. <view class="content-item" :class="index ==(type==0?isfprovince:issprovince) ?'active':''"
  57. @click="selectProvince(item, index,(type==0?fstatus:sstatus))"
  58. v-for="(item,index) in (type==0?fprovincelist:sprovincelist)" :key="index">
  59. {{item.label}}
  60. </view>
  61. </view>
  62. <!-- 市 -->
  63. <view class="container" v-if="(type==0?fstatus:sstatus)==1">
  64. <view class="content-item" :class="index == (type==0?isfcity:isscity)?'active':''"
  65. @click="selectCity(item, index,type==0?fstatus:sstatus)"
  66. v-for="(item,index) in (type==0?fcitylist:scitylist)" :key="index">
  67. {{item.label}}
  68. </view>
  69. </view>
  70. <!-- index ==(type==0?isfarea:issarea) -->
  71. <!-- 区 -->
  72. <view class="container" v-if="(type==0?fstatus:sstatus)==2">
  73. <view class="content-item" :class="item.checked?'active':''"
  74. @click="selectaArea(item, index,(type==0?fstatus:sstatus))"
  75. v-for="(item,index) in (type==0?farealist:sarealist)" :key="index">
  76. {{item.label}}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <u-button class="btn" @click="confirmBtn">确定</u-button>
  82. <u-toast ref="uToast"></u-toast>
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. address
  88. } from '@/components/data/data.js'
  89. export default {
  90. data() {
  91. return {
  92. fstatus: 0,
  93. sstatus: 0,
  94. isfprovince: null,
  95. isfcity: null,
  96. isfarea: null,
  97. issprovince: null,
  98. isscity: null,
  99. issarea: null,
  100. fprovincelist: [],
  101. sprovincelist: [],
  102. fcitylist: [],
  103. scitylist: [],
  104. farealist: [],
  105. sarealist: [],
  106. fchooseprovince: '选择',
  107. fchoosecity: '请选择市',
  108. fchoosearea: '请选择区',
  109. schooseprovince: '选择',
  110. schoosecity: '请选择市',
  111. schoosearea: '请选择区',
  112. heightCot: 0,
  113. historyFcityList: [],
  114. historyScityList: [],
  115. title: '',
  116. type: 0,
  117. count: 0,
  118. ftitle: '',
  119. stitle: '',
  120. selectList: [],
  121. }
  122. },
  123. created() {
  124. this.fprovincelist = address
  125. this.sprovincelist = address
  126. console.log('---------------------------------')
  127. console.log(this.type)
  128. },
  129. onLoad(options) {
  130. console.log(options)
  131. this.type = options.type
  132. this.title = JSON.parse(options.startPlace).selected + '→' + JSON.parse(options.endPlace).selected
  133. //获取缓存收发地
  134. if (uni.getStorageSync('fPlaceList')) {
  135. this.historyFcityList = uni.getStorageSync('fPlaceList');
  136. } else {
  137. this.historyFcityList = []
  138. }
  139. if (uni.getStorageSync('sPlaceList')) {
  140. this.historyScityList = uni.getStorageSync('sPlaceList');
  141. } else {
  142. this.historyScityList = []
  143. }
  144. //赋值地区
  145. },
  146. methods: {
  147. historyClick(type,val){
  148. console.log(type)
  149. if(type==0){
  150. this.historyFcityList.unshift(val)
  151. let _newList = this.makeHistoryList(val)
  152. uni.setStorageSync('fPlaceList', _newList);
  153. uni.setStorageSync('fPlaceObj', val);
  154. }else{
  155. this.historyScityList.unshift(val)
  156. let _newList = this.makeHistoryList(val)
  157. uni.setStorageSync('sPlaceList', _newList);
  158. uni.setStorageSync('sPlaceObj',val )
  159. }
  160. uni.switchTab({
  161. url: '/pages/goodSource/index'
  162. });
  163. },
  164. // 历史收发地去重
  165. makeHistoryList(val) {
  166. if (this.type == 0) {
  167. let _obj = {}
  168. // for (let i = 0; i < this.historyScityList.length; i++) {
  169. // // let _data = this.historyScityList[i]
  170. // }
  171. if (val.selected == '全国' || val.fchoosecity == '全部') {
  172. this.historyFcityList = this.historyFcityList.reduce((cur, item) => {
  173. _obj[item.selected] ? "" : _obj[item.selected] = true && cur.push(item);
  174. return cur;
  175. }, [])
  176. } else {
  177. this.historyFcityList = this.historyFcityList.reduce((cur, item) => {
  178. if (item.fchoosecity == val.fchoosecity) {
  179. _obj[item.selected] ? "" : _obj[item.selected] = true && cur.push(item);
  180. return cur;
  181. } else {
  182. _obj[item.selected] ? "" : _obj[item.selected] = true && cur.push(item);
  183. return cur;
  184. }
  185. }, [])
  186. }
  187. return this.historyFcityList
  188. } else {
  189. let _obj = {}
  190. // for (let i = 0; i < this.historyScityList.length; i++) {
  191. // // let _data = this.historyScityList[i]
  192. // }
  193. if (val.selected == '全国' || val.schoosecity == '全部') {
  194. this.historyScityList = this.historyScityList.reduce((cur, item) => {
  195. _obj[item.selected] ? "" : _obj[item.selected] = true && cur.push(item);
  196. return cur;
  197. }, [])
  198. } else {
  199. this.historyScityList = this.historyScityList.reduce((cur, item) => {
  200. if (item.schoosecity == val.schoosecity) {
  201. _obj[item.selected] ? "" : _obj[item.selected] = true && cur.push(item);
  202. return cur;
  203. } else {
  204. _obj[item.selected] ? "" : _obj[item.selected] = true && cur.push(item);
  205. return cur;
  206. }
  207. }, [])
  208. }
  209. return this.historyScityList
  210. }
  211. },
  212. confirmBtn() {
  213. //设置地区 0发货地 1收货地
  214. // if (this.type == 0||this.type == 1) {
  215. if (this.fchooseprovince == '选择' ||(this.fchoosearea == '请选择区'&&this.fchoosecity!='全部')|| (this.fchoosecity == '请选择市' && this.fchooseprovince != '全国')) {
  216. this.$refs.uToast.show({
  217. type: 'error',
  218. message: "请选择区域!",
  219. })
  220. return
  221. // }
  222. console.log("省", this.fchooseprovince)
  223. console.log("市", this.fchoosecity)
  224. console.log("区", this.fchoosearea)
  225. let _obj = {
  226. fchooseprovince: this.fchooseprovince,
  227. fchoosecity: this.fchoosecity,
  228. fchoosearea: this.fchoosearea,
  229. selected: ''
  230. }
  231. //选中全国
  232. if (this.fchoosecity == '请选择市' && this.fchooseprovince == '全国') {
  233. _obj.selected = this.fchooseprovince
  234. this.historyFcityList.unshift(_obj)
  235. let _newList = this.makeHistoryList(_obj)
  236. uni.setStorageSync('fPlaceList', _newList);
  237. }
  238. //选择省
  239. if (this.fchoosearea == '请选择区' && this.fchoosecity == '全部') {
  240. _obj.selected = this.fchooseprovince
  241. this.historyFcityList.unshift(_obj)
  242. let _newList = this.makeHistoryList(_obj)
  243. uni.setStorageSync('fPlaceList', _newList);
  244. }
  245. //选择市
  246. if (this.fchoosearea == '全部') {
  247. if(this.fchoosecity=='市辖区'){
  248. _obj.selected = this.fchooseprovince
  249. }else{
  250. _obj.selected = this.fchoosecity
  251. }
  252. this.historyFcityList.unshift(_obj)
  253. let _newList = this.makeHistoryList(_obj)
  254. uni.setStorageSync('fPlaceList', _newList);
  255. }
  256. uni.setStorageSync('fPlaceObj', _obj);
  257. //选择区
  258. if (this.fchoosearea != '请选择区' && this.fchoosearea != '全部') {
  259. let _list = this.fchoosearea.split(',')
  260. let _newList
  261. //设置历史收发地并去重,区重名判断是否是同一个市在去重
  262. for (let i = 0; i < _list.length; i++) {
  263. let _deepObj = uni.$u.deepClone(_obj)
  264. _deepObj.selected = _list[i]
  265. this.historyFcityList.unshift(_deepObj)
  266. _newList = this.makeHistoryList(_deepObj)
  267. }
  268. console.log(_newList)
  269. uni.setStorageSync('fPlaceList', this.historyFcityList);
  270. uni.setStorageSync('fPlaceObj', {
  271. fchooseprovince: this.fchooseprovince,
  272. fchoosecity: this.fchoosecity,
  273. fchoosearea: this.fchoosearea,
  274. selected: this.fchoosearea
  275. });
  276. }
  277. console.log(this.historyFcityList)
  278. uni.switchTab({
  279. url: '/pages/goodSource/index'
  280. });
  281. } else {
  282. //收货地
  283. if (this.schooseprovince == '选择' ||(this.schoosearea == '请选择区'&&this.schoosecity!='全部')|| (this.schoosecity == '请选择市' && this.schooseprovince != '全国')) {
  284. this.$refs.uToast.show({
  285. type: 'error',
  286. message: "请选择区域!",
  287. })
  288. }
  289. console.log(this.schooseprovince)
  290. console.log(this.schoosecity)
  291. console.log(this.schoosearea)
  292. let _obj = {
  293. schooseprovince: this.schooseprovince,
  294. schoosecity: this.schoosecity,
  295. schoosearea: this.schoosearea,
  296. selected: ''
  297. }
  298. //选中全国
  299. if (this.schoosecity == '请选择市' && this.schooseprovince == '全国') {
  300. _obj.selected = this.schooseprovince
  301. this.historyScityList.unshift(_obj)
  302. let _newList = this.makeHistoryList(_obj)
  303. uni.setStorageSync('sPlaceList', _newList);
  304. }
  305. //选择省
  306. if (this.schoosearea == '请选择区' && this.schoosecity == '全部') {
  307. _obj.selected = this.schooseprovince
  308. this.historyScityList.unshift(_obj)
  309. let _newList = this.makeHistoryList(_obj)
  310. uni.setStorageSync('sPlaceList', _newList);
  311. }
  312. //选择市
  313. if (this.schoosearea == '全部') {
  314. if(this.schoosecity=='市辖区'){
  315. _obj.selected = this.schooseprovince
  316. }else{
  317. _obj.selected = this.schoosecity
  318. }
  319. this.historyScityList.unshift(_obj)
  320. let _newList = this.makeHistoryList(_obj)
  321. uni.setStorageSync('sPlaceList', _newList);
  322. }
  323. uni.setStorageSync('sPlaceObj', _obj);
  324. //选择区
  325. if (this.schoosearea != '请选择区' && this.schoosearea != '全部') {
  326. let _list = this.schoosearea.split(',')
  327. let _newList
  328. for (let i = 0; i < _list.length; i++) {
  329. let _deepObj = uni.$u.deepClone(_obj)
  330. _deepObj.selected = _list[i]
  331. this.historyScityList.unshift(_deepObj)
  332. _newList = this.makeHistoryList(_deepObj)
  333. }
  334. console.log(_newList)
  335. uni.setStorageSync('sPlaceList', this.historyScityList);
  336. uni.setStorageSync('sPlaceObj', {
  337. schooseprovince: this.schooseprovince,
  338. schoosecity: this.schoosecity,
  339. schoosearea: this.schoosearea,
  340. selected: this.schoosearea
  341. });
  342. }
  343. console.log(this.historyScityList)
  344. uni.switchTab({
  345. url: '/pages/goodSource/index'
  346. });
  347. }
  348. },
  349. //返回上一级
  350. backLevel() {
  351. // this.count=0;
  352. if (this.type == 0) {
  353. this.fstatus--
  354. } else {
  355. this.sstatus--
  356. }
  357. if ((this.type == 0 ? this.fstatus : this.sstatus) == 1) {
  358. if (this.type == 0) {
  359. this.fchoosecity = '请选择市'
  360. this.fchoosearea = ''
  361. this.ftitle = ''
  362. this.isfcity = null
  363. } else {
  364. this.schoosecity = '请选择市'
  365. this.schoosearea = ''
  366. this.stitle = ''
  367. this.isscity = null
  368. }
  369. } else if ((this.type == 0 ? this.fstatus : this.sstatus) == 0) {
  370. if (this.type == 0) {
  371. this.fchooseprovince = '选择'
  372. this.isfprovince = null
  373. } else {
  374. this.schooseprovince = '选择'
  375. this.issprovince = null
  376. }
  377. }
  378. },
  379. // 点击面包屑导航
  380. titleClick(status) {
  381. this.ftitle = ''
  382. this.stitle = ''
  383. this.count = 0
  384. if (this.type == 0) {
  385. this.fstatus = status
  386. this.isfprovince = null
  387. this.isfcity = null
  388. this.isfarea = null
  389. if (this.fchoosecity == '全部') return;
  390. } else {
  391. this.sstatus = status
  392. this.issprovince = null
  393. this.isscity = null
  394. this.issarea = null
  395. if (this.fchoosecity == '全部') return;
  396. }
  397. if (status == 0) {
  398. if (this.type == 0) {
  399. this.fchooseprovince = '选择'
  400. this.fchoosecity = '请选择市'
  401. this.fchoosearea = '请选择区'
  402. } else {
  403. this.schooseprovince = '选择'
  404. this.schoosecity = '请选择市'
  405. this.schoosearea = '请选择区'
  406. }
  407. } else if (status == 1) {
  408. if (this.type == 0) {
  409. this.fchoosecity = '请选择市'
  410. this.fchoosearea = '请选择区'
  411. } else {
  412. this.schoosecity = '请选择市'
  413. this.schoosearea = '请选择区'
  414. }
  415. }
  416. },
  417. // 选择省
  418. selectProvince(item, i, statusIndex) {
  419. this.count = 0;
  420. if (this.type == 0) {
  421. if (i == 0) {
  422. this.$refs.uToast.show({
  423. type: 'error',
  424. message: "发货地不可选择全国!",
  425. })
  426. return
  427. }
  428. this.fchoosecity = '请选择市'
  429. this.fchoosearea = '请选择区'
  430. this.isfprovince = i
  431. this.fchooseprovince = item.label
  432. if (item.child) {
  433. this.fcitylist = item.child
  434. }
  435. if (this.fchoosecity != '全部') {
  436. this.fstatus = statusIndex + 1
  437. }
  438. } else {
  439. this.issprovince = i
  440. this.schooseprovince = item.label
  441. if (item.label == '全国') {
  442. item.checked = !item.checked
  443. if (!item.checked) {
  444. this.issprovince = null
  445. }
  446. return
  447. } else {
  448. this.schoosecity = '请选择市'
  449. this.schoosearea = '请选择区'
  450. if (item.child) {
  451. this.scitylist = item.child
  452. }
  453. if (this.schoosecity != '全部') {
  454. this.sstatus = statusIndex + 1
  455. }
  456. }
  457. }
  458. },
  459. // 选择市
  460. selectCity(item, i, statusIndex) {
  461. if(item.label=='全部'){
  462. this.$refs.uToast.show({
  463. type: 'error',
  464. message: "不能选择全部,请重新选择!"
  465. })
  466. return
  467. }
  468. this.count = 0;
  469. if (this.type == 0) {
  470. this.isfcity = i
  471. } else {
  472. this.isscity = i
  473. }
  474. if (item.child) {
  475. for (let i = 0; i < item.child.length; i++) {
  476. item.child[i].checked = false
  477. }
  478. if (this.type == 0) {
  479. this.farealist = item.child
  480. } else {
  481. this.sarealist = item.child
  482. }
  483. }
  484. if (this.type == 0) {
  485. this.fchoosecity = item.label
  486. } else {
  487. this.schoosecity = item.label
  488. }
  489. if ((this.type == 0 ? this.fchoosecity : this.schoosecity) != '全部') {
  490. if (this.type == 0) {
  491. this.fstatus = statusIndex + 1
  492. } else {
  493. this.sstatus = statusIndex + 1
  494. }
  495. }
  496. },
  497. //选择区
  498. selectaArea(item, i) {
  499. if (item.label == '全部') {
  500. if (this.type == 0) {
  501. for (let i = 0; i < this.farealist.length; i++) {
  502. if (i == 0) {
  503. this.farealist[i].checked = true
  504. } else {
  505. this.farealist[i].checked = false
  506. }
  507. }
  508. this.fchoosearea = '全部'
  509. this.$forceUpdate()
  510. return
  511. } else {
  512. for (let i = 0; i < this.sarealist.length; i++) {
  513. if (i == 0) {
  514. this.sarealist[i].checked = true
  515. } else {
  516. this.sarealist[i].checked = false
  517. }
  518. }
  519. this.schoosearea = '全部'
  520. this.$forceUpdate()
  521. return
  522. }
  523. }
  524. if (this.count < 3) {
  525. item.checked = !item.checked
  526. if (item.checked && this.count < 3) {
  527. this.count++;
  528. } else if (!item.checked && this.count < 3) {
  529. this.count--;
  530. }
  531. } else {
  532. if (item.checked) {
  533. item.checked = !item.checked
  534. this.count--;
  535. } else {
  536. this.$refs.uToast.show({
  537. type: 'error',
  538. message: "最多选择3个地区",
  539. })
  540. }
  541. }
  542. this.$forceUpdate()
  543. //设置面包屑 0发货地 1收货地
  544. if (this.type == 0) {
  545. if (item.checked && !this.fchoosearea.includes(item.label)) {
  546. if (this.ftitle) {
  547. this.ftitle += ',' + item.label
  548. } else {
  549. this.ftitle += item.label
  550. }
  551. this.fchoosearea = this.ftitle
  552. console.log(this.fchoosearea)
  553. } else {
  554. if (this.ftitle.includes(',' + item.label)) {
  555. this.ftitle = this.ftitle.replace(',' + item.label, '')
  556. this.fchoosearea = this.fchoosearea.replace(',' + item.label, '')
  557. } else {
  558. let _val = this.ftitle.split(',')
  559. let _len = _val.length;
  560. if (_len == 1) {
  561. this.ftitle = this.ftitle.replace(item.label, '')
  562. this.fchoosearea = '请选择区'
  563. } else if (_len > 1) {
  564. this.ftitle = this.ftitle.replace(item.label + ',', '')
  565. this.fchoosearea = this.fchoosearea.replace(item.label + ',', '')
  566. }
  567. }
  568. }
  569. } else {
  570. if (item.checked && !this.schoosearea.includes(item.label)) {
  571. if (this.stitle) {
  572. this.stitle += ',' + item.label
  573. } else {
  574. this.stitle += item.label
  575. }
  576. this.schoosearea = this.stitle
  577. } else {
  578. if (this.stitle.includes(',' + item.label)) {
  579. this.stitle = this.stitle.replace(',' + item.label, '')
  580. this.schoosearea = this.schoosearea.replace(',' + item.label, '')
  581. } else {
  582. let _val = this.stitle.split(',')
  583. let _len = _val.length;
  584. if (_len == 1) {
  585. this.stitle = this.stitle.replace(item.label, '')
  586. this.schoosearea = '请选择区'
  587. } else if (_len > 1) {
  588. this.stitle = this.stitle.replace(item.label + ',', '')
  589. this.schoosearea = this.schoosearea.replace(item.label + ',', '')
  590. }
  591. }
  592. }
  593. }
  594. },
  595. changeCity(type) {
  596. if (type == 0) {
  597. this.type = 0
  598. } else {
  599. this.type = 1
  600. }
  601. },
  602. back() {
  603. uni.navigateBack({
  604. })
  605. },
  606. }
  607. }
  608. </script>
  609. <style lang="scss" scoped>
  610. .row1 {
  611. display: flex;
  612. justify-content: space-evenly;
  613. margin-top: 10rpx;
  614. border-bottom: 1px solid #E6E6E6;
  615. }
  616. .start-place,
  617. .end-place {
  618. font-size: 28rpx;
  619. color: #B1B5C0;
  620. padding-bottom: 20rpx;
  621. }
  622. .active1 {
  623. position: relative;
  624. color: black;
  625. font-size: 32rpx;
  626. font-weight: 700;
  627. display: flex;
  628. justify-content: center;
  629. }
  630. .active1:after {
  631. content: '';
  632. position: absolute;
  633. bottom: 0rpx;
  634. width: 50%;
  635. left: 25%;
  636. padding: 0 20rpx;
  637. box-sizing: border-box;
  638. height: 6rpx;
  639. background: #2772FB;
  640. border-radius: 3px;
  641. }
  642. .history-city-title {
  643. font-size: 28rpx;
  644. font-weight: 700;
  645. color: #363636;
  646. margin-bottom: 20rpx;
  647. }
  648. .container {
  649. padding: 0 20rpx;
  650. }
  651. .content1 {
  652. margin: 20rpx 0;
  653. }
  654. .city-list {
  655. max-height: 118rpx;
  656. overflow: hidden;
  657. }
  658. .city {
  659. display: inline-block;
  660. font-size: 26rpx;
  661. text-align: center;
  662. padding: 8rpx 16rpx;
  663. margin: 0 20rpx 20rpx 0;
  664. height: 33rpx;
  665. line-height: 33rpx;
  666. border-radius: 4rpx;
  667. background: #F7F8FA;
  668. }
  669. .content2 {
  670. margin: 20rpx 0;
  671. }
  672. .container {
  673. // width: 100%;
  674. width: calc(100% - 40rpx);
  675. display: inline-flex;
  676. flex-flow: row wrap;
  677. align-content: flex-start;
  678. }
  679. .select-active,
  680. .back-level {
  681. color: #2772FB;
  682. font-size: 28rpx;
  683. }
  684. .content-item {
  685. background: #F7F8FA;
  686. margin: 10rpx;
  687. font-size: 30rpx;
  688. color: #333333;
  689. text-align: center;
  690. padding: 10rpx 0;
  691. border-radius: 10rx;
  692. overflow: hidden;
  693. text-overflow: ellipsis;
  694. white-space: nowrap;
  695. padding: 6rpx 8rpx;
  696. box-sizing: border-box;
  697. flex: 0 0 calc(25% - 20rpx);
  698. }
  699. .title {
  700. margin: 0 20rpx;
  701. }
  702. .active {
  703. background: #E5F0FE;
  704. border-radius: 10rpx;
  705. // border: 1px solid #2772FB;
  706. color: #2772FB;
  707. box-sizing: border-box;
  708. }
  709. .area {
  710. width: 55%;
  711. text-overflow: ellipsis;
  712. white-space: nowrap;
  713. overflow: hidden;
  714. }
  715. .nav-bag-left {
  716. width: 70%;
  717. font-size: 30rpx;
  718. }
  719. .btn {
  720. background: #2772FB;
  721. color: white;
  722. width: 80%;
  723. position: absolute;
  724. bottom: 30rpx;
  725. margin-left: 10%;
  726. border-radius: 50rpx;
  727. }
  728. </style>