selectCity.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  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) {
  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. _obj.selected = this.fchoosecity
  248. this.historyFcityList.unshift(_obj)
  249. let _newList = this.makeHistoryList(_obj)
  250. uni.setStorageSync('fPlaceList', _newList);
  251. }
  252. uni.setStorageSync('fPlaceObj', _obj);
  253. //选择区
  254. if (this.fchoosearea != '请选择区' && this.fchoosearea != '全部') {
  255. let _list = this.fchoosearea.split(',')
  256. let _newList
  257. //设置历史收发地并去重,区重名判断是否是同一个市在去重
  258. for (let i = 0; i < _list.length; i++) {
  259. let _deepObj = uni.$u.deepClone(_obj)
  260. _deepObj.selected = _list[i]
  261. this.historyFcityList.unshift(_deepObj)
  262. _newList = this.makeHistoryList(_deepObj)
  263. }
  264. console.log(_newList)
  265. uni.setStorageSync('fPlaceList', this.historyFcityList);
  266. uni.setStorageSync('fPlaceObj', {
  267. fchooseprovince: this.fchooseprovince,
  268. fchoosecity: this.fchoosecity,
  269. fchoosearea: this.fchoosearea,
  270. selected: this.fchoosearea
  271. });
  272. }
  273. console.log(this.historyFcityList)
  274. uni.switchTab({
  275. url: '/pages/goodSource/index'
  276. });
  277. } else {
  278. //收货地
  279. if (this.schooseprovince == '选择' ||(this.schoosearea == '请选择区'&&this.schoosecity!='全部')|| (this.schoosecity == '请选择市' && this.schooseprovince != '全国')) {
  280. this.$refs.uToast.show({
  281. type: 'error',
  282. message: "请选择区域!",
  283. })
  284. }
  285. console.log(this.schooseprovince)
  286. console.log(this.schoosecity)
  287. console.log(this.schoosearea)
  288. let _obj = {
  289. schooseprovince: this.schooseprovince,
  290. schoosecity: this.schoosecity,
  291. schoosearea: this.schoosearea,
  292. selected: ''
  293. }
  294. //选中全国
  295. if (this.schoosecity == '请选择市' && this.schooseprovince == '全国') {
  296. _obj.selected = this.schooseprovince
  297. this.historyScityList.unshift(_obj)
  298. let _newList = this.makeHistoryList(_obj)
  299. uni.setStorageSync('sPlaceList', _newList);
  300. }
  301. //选择省
  302. if (this.schoosearea == '请选择区' && this.schoosecity == '全部') {
  303. _obj.selected = this.schooseprovince
  304. this.historyScityList.unshift(_obj)
  305. let _newList = this.makeHistoryList(_obj)
  306. uni.setStorageSync('sPlaceList', _newList);
  307. }
  308. //选择市
  309. if (this.schoosearea == '全部') {
  310. _obj.selected = this.schoosecity
  311. this.historyScityList.unshift(_obj)
  312. let _newList = this.makeHistoryList(_obj)
  313. uni.setStorageSync('sPlaceList', _newList);
  314. }
  315. uni.setStorageSync('sPlaceObj', _obj);
  316. //选择区
  317. if (this.schoosearea != '请选择区' && this.schoosearea != '全部') {
  318. let _list = this.schoosearea.split(',')
  319. let _newList
  320. for (let i = 0; i < _list.length; i++) {
  321. let _deepObj = uni.$u.deepClone(_obj)
  322. _deepObj.selected = _list[i]
  323. this.historyScityList.unshift(_deepObj)
  324. _newList = this.makeHistoryList(_deepObj)
  325. }
  326. console.log(_newList)
  327. uni.setStorageSync('sPlaceList', this.historyScityList);
  328. uni.setStorageSync('sPlaceObj', {
  329. schooseprovince: this.schooseprovince,
  330. schoosecity: this.schoosecity,
  331. schoosearea: this.schoosearea,
  332. selected: this.schoosearea
  333. });
  334. }
  335. console.log(this.historyScityList)
  336. uni.switchTab({
  337. url: '/pages/goodSource/index'
  338. });
  339. }
  340. },
  341. //返回上一级
  342. backLevel() {
  343. // this.count=0;
  344. if (this.type == 0) {
  345. this.fstatus--
  346. } else {
  347. this.sstatus--
  348. }
  349. if ((this.type == 0 ? this.fstatus : this.sstatus) == 1) {
  350. if (this.type == 0) {
  351. this.fchoosecity = '请选择市'
  352. this.fchoosearea = ''
  353. this.ftitle = ''
  354. this.isfcity = null
  355. } else {
  356. this.schoosecity = '请选择市'
  357. this.schoosearea = ''
  358. this.stitle = ''
  359. this.isscity = null
  360. }
  361. } else if ((this.type == 0 ? this.fstatus : this.sstatus) == 0) {
  362. if (this.type == 0) {
  363. this.fchooseprovince = '选择'
  364. this.isfprovince = null
  365. } else {
  366. this.schooseprovince = '选择'
  367. this.issprovince = null
  368. }
  369. }
  370. },
  371. // 点击面包屑导航
  372. titleClick(status) {
  373. this.ftitle = ''
  374. this.stitle = ''
  375. this.count = 0
  376. if (this.type == 0) {
  377. this.fstatus = status
  378. this.isfprovince = null
  379. this.isfcity = null
  380. this.isfarea = null
  381. if (this.fchoosecity == '全部') return;
  382. } else {
  383. this.sstatus = status
  384. this.issprovince = null
  385. this.isscity = null
  386. this.issarea = null
  387. if (this.fchoosecity == '全部') return;
  388. }
  389. if (status == 0) {
  390. if (this.type == 0) {
  391. this.fchooseprovince = '选择'
  392. this.fchoosecity = '请选择市'
  393. this.fchoosearea = '请选择区'
  394. } else {
  395. this.schooseprovince = '选择'
  396. this.schoosecity = '请选择市'
  397. this.schoosearea = '请选择区'
  398. }
  399. } else if (status == 1) {
  400. if (this.type == 0) {
  401. this.fchoosecity = '请选择市'
  402. this.fchoosearea = '请选择区'
  403. } else {
  404. this.schoosecity = '请选择市'
  405. this.schoosearea = '请选择区'
  406. }
  407. }
  408. },
  409. // 选择省
  410. selectProvince(item, i, statusIndex) {
  411. this.count = 0;
  412. if (this.type == 0) {
  413. if (i == 0) {
  414. this.$refs.uToast.show({
  415. type: 'error',
  416. message: "发货地不可选择全国!",
  417. })
  418. return
  419. }
  420. this.fchoosecity = '请选择市'
  421. this.fchoosearea = '请选择区'
  422. this.isfprovince = i
  423. this.fchooseprovince = item.label
  424. if (item.child) {
  425. this.fcitylist = item.child
  426. }
  427. if (this.fchoosecity != '全部') {
  428. this.fstatus = statusIndex + 1
  429. }
  430. } else {
  431. this.issprovince = i
  432. this.schooseprovince = item.label
  433. if (item.label == '全国') {
  434. item.checked = !item.checked
  435. if (!item.checked) {
  436. this.issprovince = null
  437. }
  438. return
  439. } else {
  440. this.schoosecity = '请选择市'
  441. this.schoosearea = '请选择区'
  442. if (item.child) {
  443. this.scitylist = item.child
  444. }
  445. if (this.schoosecity != '全部') {
  446. this.sstatus = statusIndex + 1
  447. }
  448. }
  449. }
  450. },
  451. // 选择市
  452. selectCity(item, i, statusIndex) {
  453. if(item.label=='全部'){
  454. this.$refs.uToast.show({
  455. type: 'error',
  456. message: "不能选择全部,请重新选择!"
  457. })
  458. return
  459. }
  460. this.count = 0;
  461. if (this.type == 0) {
  462. this.isfcity = i
  463. } else {
  464. this.isscity = i
  465. }
  466. if (item.child) {
  467. for (let i = 0; i < item.child.length; i++) {
  468. item.child[i].checked = false
  469. }
  470. if (this.type == 0) {
  471. this.farealist = item.child
  472. } else {
  473. this.sarealist = item.child
  474. }
  475. }
  476. if (this.type == 0) {
  477. this.fchoosecity = item.label
  478. } else {
  479. this.schoosecity = item.label
  480. }
  481. if ((this.type == 0 ? this.fchoosecity : this.schoosecity) != '全部') {
  482. if (this.type == 0) {
  483. this.fstatus = statusIndex + 1
  484. } else {
  485. this.sstatus = statusIndex + 1
  486. }
  487. }
  488. },
  489. //选择区
  490. selectaArea(item, i) {
  491. if (item.label == '全部') {
  492. if (this.type == 0) {
  493. for (let i = 0; i < this.farealist.length; i++) {
  494. if (i == 0) {
  495. this.farealist[i].checked = true
  496. } else {
  497. this.farealist[i].checked = false
  498. }
  499. }
  500. this.fchoosearea = '全部'
  501. this.$forceUpdate()
  502. return
  503. } else {
  504. for (let i = 0; i < this.sarealist.length; i++) {
  505. if (i == 0) {
  506. this.sarealist[i].checked = true
  507. } else {
  508. this.sarealist[i].checked = false
  509. }
  510. }
  511. this.schoosearea = '全部'
  512. this.$forceUpdate()
  513. return
  514. }
  515. }
  516. if (this.count < 3) {
  517. item.checked = !item.checked
  518. if (item.checked && this.count < 3) {
  519. this.count++;
  520. } else if (!item.checked && this.count < 3) {
  521. this.count--;
  522. }
  523. } else {
  524. if (item.checked) {
  525. item.checked = !item.checked
  526. this.count--;
  527. } else {
  528. this.$refs.uToast.show({
  529. type: 'error',
  530. message: "最多选择3个地区",
  531. })
  532. }
  533. }
  534. this.$forceUpdate()
  535. //设置面包屑 0发货地 1收货地
  536. if (this.type == 0) {
  537. if (item.checked && !this.fchoosearea.includes(item.label)) {
  538. if (this.ftitle) {
  539. this.ftitle += ',' + item.label
  540. } else {
  541. this.ftitle += item.label
  542. }
  543. this.fchoosearea = this.ftitle
  544. console.log(this.fchoosearea)
  545. } else {
  546. if (this.ftitle.includes(',' + item.label)) {
  547. this.ftitle = this.ftitle.replace(',' + item.label, '')
  548. this.fchoosearea = this.fchoosearea.replace(',' + item.label, '')
  549. } else {
  550. let _val = this.ftitle.split(',')
  551. let _len = _val.length;
  552. if (_len == 1) {
  553. this.ftitle = this.ftitle.replace(item.label, '')
  554. this.fchoosearea = '请选择区'
  555. } else if (_len > 1) {
  556. this.ftitle = this.ftitle.replace(item.label + ',', '')
  557. this.fchoosearea = this.fchoosearea.replace(item.label + ',', '')
  558. }
  559. }
  560. }
  561. } else {
  562. if (item.checked && !this.schoosearea.includes(item.label)) {
  563. if (this.stitle) {
  564. this.stitle += ',' + item.label
  565. } else {
  566. this.stitle += item.label
  567. }
  568. this.schoosearea = this.stitle
  569. } else {
  570. if (this.stitle.includes(',' + item.label)) {
  571. this.stitle = this.stitle.replace(',' + item.label, '')
  572. this.schoosearea = this.schoosearea.replace(',' + item.label, '')
  573. } else {
  574. let _val = this.stitle.split(',')
  575. let _len = _val.length;
  576. if (_len == 1) {
  577. this.stitle = this.stitle.replace(item.label, '')
  578. this.schoosearea = '请选择区'
  579. } else if (_len > 1) {
  580. this.stitle = this.stitle.replace(item.label + ',', '')
  581. this.schoosearea = this.schoosearea.replace(item.label + ',', '')
  582. }
  583. }
  584. }
  585. }
  586. },
  587. changeCity(type) {
  588. if (type == 0) {
  589. this.type = 0
  590. } else {
  591. this.type = 1
  592. }
  593. },
  594. back() {
  595. uni.navigateBack({
  596. })
  597. },
  598. }
  599. }
  600. </script>
  601. <style lang="scss" scoped>
  602. .row1 {
  603. display: flex;
  604. justify-content: space-evenly;
  605. margin-top: 10rpx;
  606. border-bottom: 1px solid #E6E6E6;
  607. }
  608. .start-place,
  609. .end-place {
  610. font-size: 28rpx;
  611. color: #B1B5C0;
  612. padding-bottom: 20rpx;
  613. }
  614. .active1 {
  615. position: relative;
  616. color: black;
  617. font-size: 32rpx;
  618. font-weight: 700;
  619. display: flex;
  620. justify-content: center;
  621. }
  622. .active1:after {
  623. content: '';
  624. position: absolute;
  625. bottom: 0rpx;
  626. width: 50%;
  627. left: 25%;
  628. padding: 0 20rpx;
  629. box-sizing: border-box;
  630. height: 6rpx;
  631. background: #2772FB;
  632. border-radius: 3px;
  633. }
  634. .history-city-title {
  635. font-size: 28rpx;
  636. font-weight: 700;
  637. color: #363636;
  638. margin-bottom: 20rpx;
  639. }
  640. .container {
  641. padding: 0 20rpx;
  642. }
  643. .content1 {
  644. margin: 20rpx 0;
  645. }
  646. .city-list {
  647. max-height: 118rpx;
  648. overflow: hidden;
  649. }
  650. .city {
  651. display: inline-block;
  652. font-size: 26rpx;
  653. text-align: center;
  654. padding: 8rpx 16rpx;
  655. margin: 0 20rpx 20rpx 0;
  656. height: 33rpx;
  657. line-height: 33rpx;
  658. border-radius: 4rpx;
  659. background: #F7F8FA;
  660. }
  661. .content2 {
  662. margin: 20rpx 0;
  663. }
  664. .container {
  665. // width: 100%;
  666. width: calc(100% - 40rpx);
  667. display: inline-flex;
  668. flex-flow: row wrap;
  669. align-content: flex-start;
  670. }
  671. .select-active,
  672. .back-level {
  673. color: #2772FB;
  674. font-size: 28rpx;
  675. }
  676. .content-item {
  677. background: #F7F8FA;
  678. margin: 10rpx;
  679. font-size: 30rpx;
  680. color: #333333;
  681. text-align: center;
  682. padding: 10rpx 0;
  683. border-radius: 10rx;
  684. overflow: hidden;
  685. text-overflow: ellipsis;
  686. white-space: nowrap;
  687. padding: 6rpx 8rpx;
  688. box-sizing: border-box;
  689. flex: 0 0 calc(25% - 20rpx);
  690. }
  691. .title {
  692. margin: 0 20rpx;
  693. }
  694. .active {
  695. background: #E5F0FE;
  696. border-radius: 10rpx;
  697. // border: 1px solid #2772FB;
  698. color: #2772FB;
  699. box-sizing: border-box;
  700. }
  701. .area {
  702. width: 55%;
  703. text-overflow: ellipsis;
  704. white-space: nowrap;
  705. overflow: hidden;
  706. }
  707. .nav-bag-left {
  708. width: 70%;
  709. font-size: 30rpx;
  710. }
  711. .btn {
  712. background: #2772FB;
  713. color: white;
  714. width: 80%;
  715. position: absolute;
  716. bottom: 30rpx;
  717. margin-left: 10%;
  718. border-radius: 50rpx;
  719. }
  720. </style>