selectCity.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  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. this.count = 0;
  454. if (this.type == 0) {
  455. this.isfcity = i
  456. } else {
  457. this.isscity = i
  458. }
  459. if (item.child) {
  460. for (let i = 0; i < item.child.length; i++) {
  461. item.child[i].checked = false
  462. }
  463. if (this.type == 0) {
  464. this.farealist = item.child
  465. } else {
  466. this.sarealist = item.child
  467. }
  468. }
  469. if (this.type == 0) {
  470. this.fchoosecity = item.label
  471. } else {
  472. this.schoosecity = item.label
  473. }
  474. if ((this.type == 0 ? this.fchoosecity : this.schoosecity) != '全部') {
  475. if (this.type == 0) {
  476. this.fstatus = statusIndex + 1
  477. } else {
  478. this.sstatus = statusIndex + 1
  479. }
  480. }
  481. },
  482. //选择区
  483. selectaArea(item, i) {
  484. if (item.label == '全部') {
  485. if (this.type == 0) {
  486. for (let i = 0; i < this.farealist.length; i++) {
  487. if (i == 0) {
  488. this.farealist[i].checked = true
  489. } else {
  490. this.farealist[i].checked = false
  491. }
  492. }
  493. this.fchoosearea = '全部'
  494. this.$forceUpdate()
  495. return
  496. } else {
  497. for (let i = 0; i < this.sarealist.length; i++) {
  498. if (i == 0) {
  499. this.sarealist[i].checked = true
  500. } else {
  501. this.sarealist[i].checked = false
  502. }
  503. }
  504. this.schoosearea = '全部'
  505. this.$forceUpdate()
  506. return
  507. }
  508. }
  509. if (this.count < 3) {
  510. item.checked = !item.checked
  511. if (item.checked && this.count < 3) {
  512. this.count++;
  513. } else if (!item.checked && this.count < 3) {
  514. this.count--;
  515. }
  516. } else {
  517. if (item.checked) {
  518. item.checked = !item.checked
  519. this.count--;
  520. } else {
  521. this.$refs.uToast.show({
  522. type: 'error',
  523. message: "最多选择3个地区",
  524. })
  525. }
  526. }
  527. this.$forceUpdate()
  528. //设置面包屑 0发货地 1收货地
  529. if (this.type == 0) {
  530. if (item.checked && !this.fchoosearea.includes(item.label)) {
  531. if (this.ftitle) {
  532. this.ftitle += ',' + item.label
  533. } else {
  534. this.ftitle += item.label
  535. }
  536. this.fchoosearea = this.ftitle
  537. console.log(this.fchoosearea)
  538. } else {
  539. if (this.ftitle.includes(',' + item.label)) {
  540. this.ftitle = this.ftitle.replace(',' + item.label, '')
  541. this.fchoosearea = this.fchoosearea.replace(',' + item.label, '')
  542. } else {
  543. let _val = this.ftitle.split(',')
  544. let _len = _val.length;
  545. if (_len == 1) {
  546. this.ftitle = this.ftitle.replace(item.label, '')
  547. this.fchoosearea = '请选择区'
  548. } else if (_len > 1) {
  549. this.ftitle = this.ftitle.replace(item.label + ',', '')
  550. this.fchoosearea = this.fchoosearea.replace(item.label + ',', '')
  551. }
  552. }
  553. }
  554. } else {
  555. if (item.checked && !this.schoosearea.includes(item.label)) {
  556. if (this.stitle) {
  557. this.stitle += ',' + item.label
  558. } else {
  559. this.stitle += item.label
  560. }
  561. this.schoosearea = this.stitle
  562. } else {
  563. if (this.stitle.includes(',' + item.label)) {
  564. this.stitle = this.stitle.replace(',' + item.label, '')
  565. this.schoosearea = this.schoosearea.replace(',' + item.label, '')
  566. } else {
  567. let _val = this.stitle.split(',')
  568. let _len = _val.length;
  569. if (_len == 1) {
  570. this.stitle = this.stitle.replace(item.label, '')
  571. this.schoosearea = '请选择区'
  572. } else if (_len > 1) {
  573. this.stitle = this.stitle.replace(item.label + ',', '')
  574. this.schoosearea = this.schoosearea.replace(item.label + ',', '')
  575. }
  576. }
  577. }
  578. }
  579. },
  580. changeCity(type) {
  581. if (type == 0) {
  582. this.type = 0
  583. } else {
  584. this.type = 1
  585. }
  586. },
  587. back() {
  588. uni.navigateBack({
  589. })
  590. },
  591. }
  592. }
  593. </script>
  594. <style lang="scss" scoped>
  595. .row1 {
  596. display: flex;
  597. justify-content: space-evenly;
  598. margin-top: 10rpx;
  599. border-bottom: 1px solid #E6E6E6;
  600. }
  601. .start-place,
  602. .end-place {
  603. font-size: 28rpx;
  604. color: #B1B5C0;
  605. padding-bottom: 20rpx;
  606. }
  607. .active1 {
  608. position: relative;
  609. color: black;
  610. font-size: 32rpx;
  611. font-weight: 700;
  612. display: flex;
  613. justify-content: center;
  614. }
  615. .active1:after {
  616. content: '';
  617. position: absolute;
  618. bottom: 0rpx;
  619. width: 50%;
  620. left: 25%;
  621. padding: 0 20rpx;
  622. box-sizing: border-box;
  623. height: 6rpx;
  624. background: #2772FB;
  625. border-radius: 3px;
  626. }
  627. .history-city-title {
  628. font-size: 28rpx;
  629. font-weight: 700;
  630. color: #363636;
  631. margin-bottom: 20rpx;
  632. }
  633. .container {
  634. padding: 0 20rpx;
  635. }
  636. .content1 {
  637. margin: 20rpx 0;
  638. }
  639. .city-list {
  640. max-height: 118rpx;
  641. overflow: hidden;
  642. }
  643. .city {
  644. display: inline-block;
  645. font-size: 26rpx;
  646. text-align: center;
  647. padding: 8rpx 16rpx;
  648. margin: 0 20rpx 20rpx 0;
  649. height: 33rpx;
  650. line-height: 33rpx;
  651. border-radius: 4rpx;
  652. background: #F7F8FA;
  653. }
  654. .content2 {
  655. margin: 20rpx 0;
  656. }
  657. .container {
  658. // width: 100%;
  659. width: calc(100% - 40rpx);
  660. display: inline-flex;
  661. flex-flow: row wrap;
  662. align-content: flex-start;
  663. }
  664. .select-active,
  665. .back-level {
  666. color: #2772FB;
  667. font-size: 28rpx;
  668. }
  669. .content-item {
  670. background: #F7F8FA;
  671. margin: 10rpx;
  672. font-size: 30rpx;
  673. color: #333333;
  674. text-align: center;
  675. padding: 10rpx 0;
  676. border-radius: 10rx;
  677. overflow: hidden;
  678. text-overflow: ellipsis;
  679. white-space: nowrap;
  680. padding: 6rpx 8rpx;
  681. box-sizing: border-box;
  682. flex: 0 0 calc(25% - 20rpx);
  683. }
  684. .title {
  685. margin: 0 20rpx;
  686. }
  687. .active {
  688. background: #E5F0FE;
  689. border-radius: 10rpx;
  690. // border: 1px solid #2772FB;
  691. color: #2772FB;
  692. box-sizing: border-box;
  693. }
  694. .area {
  695. width: 55%;
  696. text-overflow: ellipsis;
  697. white-space: nowrap;
  698. overflow: hidden;
  699. }
  700. .nav-bag-left {
  701. width: 70%;
  702. font-size: 30rpx;
  703. }
  704. .btn {
  705. background: #2772FB;
  706. color: white;
  707. width: 80%;
  708. position: absolute;
  709. bottom: 30rpx;
  710. margin-left: 10%;
  711. border-radius: 50rpx;
  712. }
  713. </style>