index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. <!-- 货源 -->
  2. <template>
  3. <view class="content">
  4. <view class="banner">
  5. <image class="banner-img" src="@/static/images/goodSource/banner@2x.png" mode='widthFix'></image>
  6. <view class="head flex s-row paddingr35">
  7. <view class="flex flex-space-between">
  8. <view class="flex s-row item1" @click="goCity(0)">
  9. <view class="fontsize-28 gray">装车</view>
  10. <view class="fontsize-46 fontweight-500 text">{{startPlace.selected}}</view>
  11. </view>
  12. <image class="change-btn item2" src="@/static/images/goodSource/change.png" mode='widthFix'
  13. @click="changeCity"></image>
  14. <view class="flex s-row item3" @click="goCity(1)">
  15. <view class="fontsize-28 gray text-align-right">卸车</view>
  16. <view class="fontsize-46 fontweight-500 text">{{endPlace.selected}}</view>
  17. </view>
  18. </view>
  19. <view>
  20. <u-button type="" class="btn-color fontsize-36 m-top20" @click="upCallback({size:10,num:1})"> 查询
  21. </u-button>
  22. </view>
  23. </view>
  24. </view>
  25. <view :class="scrollTop>1200?'fixed1':''"></view>
  26. <view class="tab-view">
  27. <u-tabs :list="tabList" @click="clickTab" :lineColor="scrollTop>1200?'white':'#303133'" :current='tabIndex'
  28. :inactiveStyle="{color: scrollTop>1200?'white':'',}" :activeStyle="{
  29. color: scrollTop>1200?'white':'',
  30. fontWeight: 'bold',
  31. transform: 'scale(1.05)'
  32. }" :class="scrollTop>1200?'fixed':''"></u-tabs>
  33. <view class="tab-right" @click="selectType">
  34. <view>{{pickerSelect}}</view>
  35. <u-icon name="arrow-down" size="20"></u-icon>
  36. </view>
  37. </view>
  38. <u-picker :show="show" :columns="columns" :closeOnClickOverlay='true' @close='selectTypeClose'
  39. @cancel='selectTypeClose' @confirm='confirmSelectType'></u-picker>
  40. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
  41. <view class="good-list" v-for="(good,index) in goods" :key="index" @click="toDetail(good.id)">
  42. <view style="padding: 0 35rpx 20rpx 35rpx;">
  43. <view class="flex flex-space-between">
  44. <view class="item1">
  45. <view class="ssx">{{$helper.getProvinceAbbreviation(good.sendPrivate)}}</view>
  46. <view class="level2-title">{{good.sendCity}} {{good.sendArea}}</view>
  47. </view>
  48. <image class="jt-icon item2" src="@/static/images/goodSource/jt.png" mode='widthFix'></image>
  49. <view class="item3">
  50. <view class="ssx">{{$helper.getProvinceAbbreviation(good.unloadPrivate)}}</view>
  51. <view class="level2-title">{{good.unloadCity}} {{good.unloadArea}}</view>
  52. </view>
  53. </view>
  54. <view class="right gray">
  55. {{good.updateDate}}
  56. </view>
  57. <view class="flex flex-space-between">
  58. <view class="left">
  59. <view class="flex">
  60. <view class="fontsize-25 gray mr20">货距 {{good.cargoDistance}}km</view>
  61. <view class="fontsize-25 gray ">运距 {{good.distance}}km</view>
  62. </view>
  63. <view class="flex fontsize-25 gray row">
  64. <view>{{good.goodsName}} | </view>
  65. <view>{{carLength(good)}} | {{carType(good)}} | {{carWeight(good)}}</view>
  66. </view>
  67. <view class="flex row">
  68. <view class="row-tips">{{good.taskDescription}}</view>
  69. </view>
  70. </view>
  71. <view class="right flex h-color">
  72. <view class="fontsize-46">
  73. {{good.freightPrice}}
  74. </view>
  75. <view class="flex dw">元/吨</view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="flex flex-space-between item-bottom">
  80. <view class="left flex row">
  81. <u--image :src="good.cargoOwnerPortrait" width='122rpx' height='122rpx' shape="circle">
  82. </u--image>
  83. <view class="name">{{good.cargoOwnerName}}</view>
  84. <!-- <view class="hp flex fontsize-24">
  85. <view class="gray">评分</view>
  86. <view class="number-color">99%</view>
  87. </view>
  88. <view class="sum flex fontsize-24">
  89. <view class="gray">发运次数</view>
  90. <view class="number-color">106</view>
  91. </view> -->
  92. </view>
  93. <view class="right">
  94. <view @click.stop="grabOrders(good)" class="qd">抢单</view>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="">
  99. 周边货源
  100. <view class="good-list" v-for="(good,index) in otherGoods" :key="index" @click="toDetail(good.id)">
  101. <view style="padding: 0 35rpx 20rpx 35rpx;">
  102. <view class="flex flex-space-between">
  103. <view class="item1">
  104. <view class="ssx">{{$helper.getProvinceAbbreviation(good.sendPrivate)}}</view>
  105. <view class="level2-title">{{good.sendCity}} {{good.sendArea}}</view>
  106. </view>
  107. <image class="jt-icon item2" src="@/static/images/goodSource/jt.png" mode='widthFix'>
  108. </image>
  109. <view class="item3">
  110. <view class="ssx">{{$helper.getProvinceAbbreviation(good.unloadPrivate)}}</view>
  111. <view class="level2-title">{{good.unloadCity}} {{good.unloadArea}}</view>
  112. </view>
  113. </view>
  114. <view class="right gray">
  115. {{good.updateDate}}
  116. </view>
  117. <view class="flex flex-space-between">
  118. <view class="left">
  119. <view class="flex">
  120. <view class="fontsize-25 gray mr20">货距 {{good.cargoDistance}}km</view>
  121. <view class="fontsize-25 gray ">运距 {{good.distance}}km</view>
  122. </view>
  123. <view class="flex fontsize-25 gray row">
  124. <view>{{good.goodsName}} | </view>
  125. <view>{{carLength(good)}} | {{carType(good)}} | {{carWeight(good)}}</view>
  126. </view>
  127. <view class="flex row">
  128. <view class="row-tips">{{good.taskDescription}}</view>
  129. </view>
  130. </view>
  131. <view class="right flex h-color">
  132. <view class="fontsize-46">
  133. {{good.freightPrice}}
  134. </view>
  135. <view class="flex dw">元/吨</view>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="flex flex-space-between item-bottom">
  140. <view class="left flex row">
  141. <u--image :src="good.cargoOwnerPortrait" width='122rpx' height='122rpx' shape="circle">
  142. </u--image>
  143. <view class="name">{{good.cargoOwnerName}}</view>
  144. <!-- <view class="hp flex fontsize-24">
  145. <view class="gray">评分</view>
  146. <view class="number-color">99%</view>
  147. </view>
  148. <view class="sum flex fontsize-24">
  149. <view class="gray">发运次数</view>
  150. <view class="number-color">106</view>
  151. </view> -->
  152. </view>
  153. <view class="right">
  154. <view @click.stop="grabOrders(good)" class="qd">抢单</view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. </mescroll-body>
  160. <u-toast ref="uToast"></u-toast>
  161. <u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
  162. confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
  163. </view>
  164. </template>
  165. <script>
  166. var that
  167. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  168. import {
  169. mapState
  170. } from 'vuex';
  171. import {
  172. apiGoods
  173. } from "@/api/mock.js"
  174. export default {
  175. mixins: [MescrollMixin], // 使用mixin
  176. data() {
  177. return {
  178. ObjSelect: {},
  179. isShowAlert: false,
  180. alertTitle: '确定抢单?',
  181. show: false,
  182. columns: [
  183. ['全部类型', '运费先付']
  184. ],
  185. startPlace: {},
  186. endPlace: {},
  187. otherGoods: [], // 数据列表
  188. goods: [], // 数据列表
  189. src: 'https://cdn.uviewui.com/uview/album/1.jpg',
  190. height: "", // 需要固定swiper的高度
  191. tabList: [
  192. // {
  193. // name: '全部'
  194. // },
  195. {
  196. name: '推荐'
  197. }, {
  198. name: '按时间'
  199. }, {
  200. name: '按距离'
  201. },
  202. // {
  203. // name: '运费先付'
  204. // },
  205. ],
  206. pickerSelect: '全部类型',
  207. tabIndex: 0,
  208. scrollTop: 0,
  209. count: 0,
  210. lng: '',
  211. lat: ''
  212. }
  213. },
  214. onTabItemTap(e) {
  215. // tab 点击时执行,此处直接接收单击事件
  216. uni.pageScrollTo({
  217. scrollTop: 0,
  218. duration: 300
  219. });
  220. },
  221. created() {
  222. },
  223. computed: {
  224. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
  225. },
  226. onShow() {debugger
  227. //获取上一次点击起装卸地
  228. if (uni.getStorageSync('fPlaceObj')) {
  229. this.startPlace = uni.getStorageSync('fPlaceObj');
  230. } else {
  231. // #ifdef APP-PLUS
  232. this.getLngLat();
  233. // #endif
  234. }
  235. if (uni.getStorageSync('sPlaceObj')) {
  236. this.endPlace = uni.getStorageSync('sPlaceObj');
  237. } else {
  238. this.endPlace.selected = '全国'
  239. }
  240. // this.mescroll.resetUpScroll()
  241. },
  242. onLoad() {
  243. //#ifdef APP-PLUS
  244. // this.getLngLat();
  245. //#endif
  246. that = this
  247. },
  248. onPageScroll(res) {
  249. this.scrollTop = res.scrollTop
  250. // console.log("页面滚动了", res.scrollTop)
  251. if (this.scrollTop > 1200) {
  252. uni.setTabBarItem({
  253. index: 0,
  254. text: '返回顶部',
  255. iconPath: 'static/images/common/top@2x.png',
  256. selectedIconPath: 'static/images/common/top@2x.png'
  257. })
  258. } else {
  259. uni.setTabBarItem({
  260. index: 0,
  261. text: '货源',
  262. iconPath: 'static/images/common/huoyuan@2x(1).png',
  263. selectedIconPath: 'static/images/common/huoyuan@2x.png'
  264. })
  265. }
  266. },
  267. methods: {
  268. mescrollInit(mescroll) {debugger
  269. this.mescroll = mescroll;
  270. },
  271. confirmClick() {
  272. let item = this.ObjSelect
  273. let _obj = {
  274. driverCommonId: this.firstAuthentication.commonId,
  275. commonId: item.commonId,
  276. cargoOwnerName: item.cargoOwnerName,
  277. cargoOwner: item.cargoOwner,
  278. sendPrivate: item.sendPrivate,
  279. sendCity: item.sendCity,
  280. sendArea: item.sendArea,
  281. sendDetailedAddress: item.sendDetailedAddress,
  282. unloadPrivate: item.unloadPrivate,
  283. unloadCity: item.unloadCity,
  284. unloadArea: item.unloadArea,
  285. unloadDetailedAddress: item.unloadDetailedAddress,
  286. goodsName: item.goodsName,
  287. distance: item.distance,
  288. freightPrice: item.freightPrice,
  289. driverName: this.firstAuthentication.driverName,
  290. driverPhone: this.firstAuthentication.driverPhone,
  291. cargoOwnerPhone: item.cargoOwnerPhone
  292. }
  293. this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
  294. if (res.code == 200) {
  295. this.$refs.uToast.show({
  296. type: 'success',
  297. message: "抢单成功!",
  298. complete() {
  299. uni.switchTab({
  300. url: "/pages/order/index"
  301. })
  302. }
  303. })
  304. }
  305. })
  306. .catch(res => {
  307. uni.$u.toast(res.message);
  308. });
  309. this.isShowAlert = false
  310. },
  311. cancelClick() {
  312. this.isShowAlert = false
  313. },
  314. carLength(good) {
  315. let length = ''
  316. if (good.carLengthSmall && good.carLength) {
  317. length = good.carLengthSmall + '~' + good.carLength + '米'
  318. } else if (good.carLengthSmall) {
  319. length = "大于" + good.carLengthSmall + '米'
  320. } else if (good.carLength) {
  321. length = "小于" + good.carLength + '米'
  322. }
  323. return length
  324. },
  325. carType(good) {
  326. // let _val = '';
  327. // if (good.carModel == 1) {
  328. // _val = '不限'
  329. // } else {
  330. // if (good.carModel.includes(2)) {
  331. // _val += '高栏/'
  332. // }
  333. // if (good.carModel.includes(3)) {
  334. // _val += '集装箱/'
  335. // }
  336. // if (good.carModel.includes(4)) {
  337. // _val += '自卸车'
  338. // }
  339. // }
  340. // return _val
  341. },
  342. carWeight(good) {
  343. good.loadWeightSmall
  344. good.loadWeight
  345. let weight = ''
  346. if (good.loadWeightSmall && good.loadWeight) {
  347. weight = good.loadWeightSmall + '~' + good.loadWeight + '吨'
  348. } else if (good.loadWeightSmall) {
  349. weight = "大于" + good.loadWeightSmall + '吨'
  350. } else if (good.loadWeight) {
  351. weight = "小于" + good.loadWeight + '吨'
  352. }
  353. return weight
  354. },
  355. getdate() {
  356. var date = new Date()
  357. var year = date.getFullYear() //获取完整的年份(4位)
  358. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  359. var datetime = date.getDate() //获取当前日(1-31)
  360. if (mouth < 10) {
  361. mouth = '0' + mouth
  362. }
  363. if (datetime < 10) {
  364. datetime = '0' + datetime
  365. }
  366. return String(year) + String(mouth) + String(datetime)
  367. },
  368. grabOrders(item) {
  369. this.isShowAlert = true
  370. this.ObjSelect = item
  371. },
  372. confirmSelectType(val) {
  373. this.pickerSelect = val.value[0]
  374. this.show = false
  375. },
  376. selectTypeClose() {
  377. this.show = false
  378. },
  379. selectType() {
  380. this.show = true
  381. },
  382. getLngLat() {
  383. uni.getLocation({
  384. type: 'gcj02',
  385. geocode: true,
  386. success: res => {
  387. if (res.latitude) {
  388. that.startPlace.selected = res.address.city
  389. this.lng = res.longitude;
  390. this.lat = res.latitude;
  391. } else {
  392. if (uni.getSystemInfoSync().platform == 'android') {
  393. var context = plus.android.importClass("android.content.Context");
  394. var locationManager = plus.android.importClass(
  395. "android.location.LocationManager");
  396. var main = plus.android.runtimeMainActivity();
  397. var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
  398. this.bool = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)
  399. }
  400. if (this.bool === false) {
  401. uni.showModal({
  402. title: '提示',
  403. content: '请打开定位服务',
  404. success: ({
  405. confirm,
  406. cancel
  407. }) => {
  408. if (confirm) {
  409. if (uni.getSystemInfoSync().platform == 'android') {
  410. var Intent = plus.android.importClass(
  411. 'android.content.Intent');
  412. var Settings = plus.android.importClass(
  413. 'android.provider.Settings');
  414. var intent = new Intent(Settings
  415. .ACTION_LOCATION_SOURCE_SETTINGS);
  416. var main = plus.android.runtimeMainActivity();
  417. main.startActivity(intent); // 打开系统设置GPS服务页面
  418. }
  419. }
  420. }
  421. });
  422. }
  423. }
  424. }
  425. });
  426. },
  427. toDetail(id) {
  428. //司机是否认证身份
  429. if (this.firstAuthentication.authenticationStatus == '已认证') {
  430. uni.$u.route('/pages/goodSource/shippingDetails', {
  431. id: id,
  432. });
  433. } else {
  434. this.$refs.uToast.show({
  435. type: 'error',
  436. message: "请先完成司机认证!",
  437. })
  438. }
  439. },
  440. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  441. upCallback(page) {
  442. debugger
  443. let _pickerSelect;
  444. if (this.pickerSelect == '运费先付') {
  445. _pickerSelect = 1
  446. } else {
  447. _pickerSelect = 0
  448. }
  449. //选择省市区
  450. let _data = {
  451. searchKeyWord: this.tabIndex + 1,
  452. searchType: _pickerSelect,
  453. // loadingPlace: this.startPlace.selected,
  454. // unLoadingPlace: this.endPlace.selected=="全国"?'':this.endPlace.selected,
  455. pageSize: page.size,
  456. currentPage: page.num,
  457. // loadingPlaceCity: this.startPlace.fchoosecity,
  458. // unLoadingPlaceCity: this.endPlace.schoosecity
  459. }
  460. if (this.tabIndex == 2) {
  461. // #ifdef APP-PLUS
  462. this.getLngLat();
  463. // #endif
  464. _data.driverLongitude = this.lng
  465. _data.driverLatitude = this.lat
  466. }
  467. console.log('------')
  468. console.log(_data)
  469. if (uni.getStorageSync('fPlaceObj')) {
  470. if (this.startPlace.fchoosearea && this.startPlace.fchoosearea == '全部' && this.startPlace
  471. .fchoosearea != '请选择区') {
  472. _data.loadingPlaceCity = this.startPlace.fchoosecity
  473. } else if (this.startPlace.fchoosecity == '全部') {
  474. _data.loadingPlace = this.startPlace.selected
  475. } else {
  476. _data.loadingPlaceCity = this.startPlace.fchoosecity
  477. _data.loadingPlace = this.startPlace.fchoosearea
  478. }
  479. } else {
  480. _data.loadingPlaceCity = this.startPlace.fchoosecity
  481. }
  482. if (uni.getStorageSync('sPlaceObj')) {
  483. if (this.endPlace.schoosearea && this.endPlace.schoosearea == '全部' && this.endPlace.schoosearea !=
  484. '请选择区') {
  485. _data.unLoadingPlaceCity = this.endPlace.schoosecity
  486. } else if (this.endPlace.schoosearea) {
  487. _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
  488. } else {
  489. _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
  490. _data.unLoadingPlaceCity = this.endPlace.schoosecity
  491. }
  492. } else {
  493. _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
  494. }
  495. this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
  496. if (res.code == 200) {debugger
  497. this.mescroll.endBySize(res.data.records.length, res.data.total);
  498. if (page.num == 1) {
  499. this.goods = [];
  500. // this.otherGoods = []
  501. }; //如果是第一页需手动制空列表
  502. // if(!res.data.records[0].publishTaskInfoList) res.data.records[0].publishTaskInfoList = []
  503. // if(!res.data.records[0].publishTaskInfoLists) res.data.records[0].publishTaskInfoLists = []
  504. this.goods = this.goods.concat(res.data.records); //追加新数据
  505. // this.otherGoods = this.otherGoods.concat(res.data.records[0].publishTaskInfoLists);
  506. }
  507. })
  508. .catch(res => {
  509. uni.$u.toast(res.message);
  510. this.mescroll.endErr();
  511. });
  512. // 此处可以继续请求其他接口
  513. // if(page.num == 1){
  514. // // 请求其他接口...
  515. // }
  516. // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
  517. // if(!this.isInitxx){
  518. // apiGetxx().then(res=>{
  519. // this.isInitxx = true
  520. // this.mescroll.resetUpScroll() // 重新触发upCallback
  521. // }).catch(()=>{
  522. // this.mescroll.endErr()
  523. // })
  524. // return // 此处return,先获取xx
  525. // }
  526. // //联网加载数据
  527. // apiGoods(page.num, page.size).then(res => {
  528. // //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
  529. // //mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
  530. // //方法一(推荐): 后台接口有返回列表的总页数 totalPage
  531. // //this.mescroll.endByPage(res.list.length, totalPage); //必传参数(当前页的数据个数, 总页数)
  532. // //方法二(推荐): 后台接口有返回列表的总数据量 totalSize
  533. // this.mescroll.endBySize(res.list.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
  534. // //方法三(推荐): 您有其他方式知道是否有下一页 hasNext
  535. // //this.mescroll.endSuccess(res.list.length, hasNext); //必传参数(当前页的数据个数, 是否有下一页true/false)
  536. // //方法四 (不推荐),会存在一个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据当前页的数据个数判断,则需翻到第三页才会知道无更多数据
  537. // // this.mescroll.endSuccess(res.list.length);
  538. // //设置列表数据
  539. // if (page.num == 1) this.goods = []; //如果是第一页需手动制空列表
  540. // this.goods = this.goods.concat(res.list); //追加新数据
  541. // }).catch(() => {
  542. // //联网失败, 结束加载
  543. // this.mescroll.endErr();
  544. // })
  545. },
  546. clickTab(val) {
  547. this.tabIndex = val.index
  548. this.upCallback({
  549. size: 10,
  550. num: 1,
  551. })
  552. },
  553. changeCity() {
  554. debugger
  555. if (this.endPlace == '全国') {
  556. this.$refs.uToast.show({
  557. type: 'error',
  558. message: "卸车地为全国不允许切换!",
  559. })
  560. return
  561. }
  562. [this.startPlace.fchooseprovince, this.endPlace.schooseprovince] = [this.endPlace.schooseprovince, this
  563. .startPlace.fchooseprovince
  564. ];
  565. [this.startPlace.fchoosecity, this.endPlace.schoosecity] = [this.endPlace.schoosecity, this.startPlace
  566. .fchoosecity
  567. ];
  568. [this.startPlace.fchoosearea, this.endPlace.schoosearea] = [this.endPlace.schoosearea, this.startPlace
  569. .fchoosearea
  570. ];
  571. [this.startPlace.selected, this.endPlace.selected] = [this.endPlace.selected, this.startPlace.selected];
  572. // [this.startPlace, this.endPlace] = [this.endPlace, this.startPlace];
  573. },
  574. goCity(type) {
  575. uni.$u.route('/pages/goodSource/selectCity', {
  576. startPlace: JSON.stringify(this.startPlace),
  577. endPlace: JSON.stringify(this.endPlace),
  578. type: type
  579. });
  580. },
  581. swiperChange(e) {
  582. this.tabIndex = e.detail.current
  583. }
  584. }
  585. }
  586. </script>
  587. <style scoped lang="scss">
  588. .banner {
  589. width: 100%;
  590. position: relative;
  591. }
  592. .fixed,
  593. .fixed1 {
  594. background: linear-gradient(97deg, #4FABFD 0%, #2772FB 100%);
  595. position: fixed;
  596. top: var(--status-bar-height);
  597. z-index: 999;
  598. // width: calc(100% - 40rpx);
  599. width: 100%;
  600. // margin:0 20rpx;
  601. }
  602. .fixed1 {
  603. top: 0;
  604. height: var(--status-bar-height);
  605. background: linear-gradient(97deg, #4FABFD 0%, #2772FB 100%);
  606. }
  607. .banner-img {
  608. width: 100%;
  609. }
  610. .head {
  611. position: absolute;
  612. width: calc(100% - 108rpx);
  613. bottom: 0;
  614. background: white;
  615. margin: 0 20rpx;
  616. border-radius: 20rpx;
  617. .item1,
  618. .item3 {
  619. width: 40%;
  620. .text {
  621. text-overflow: ellipsis;
  622. overflow: hidden;
  623. white-space: nowrap;
  624. }
  625. }
  626. .item1 .text {
  627. text-align: left;
  628. }
  629. .item3 .text {
  630. text-align: right;
  631. }
  632. }
  633. .change-btn {
  634. width: 86rpx;
  635. height: 86rpx;
  636. }
  637. .good-list {
  638. background-color: white;
  639. margin: 20rpx;
  640. padding: 20rpx 0rpx 0 0;
  641. border-radius: 20rpx;
  642. .item1,
  643. .item3 {
  644. width: 40%;
  645. display: flex;
  646. .text {
  647. text-overflow: ellipsis;
  648. overflow: hidden;
  649. white-space: nowrap;
  650. }
  651. }
  652. .item1 .text {
  653. text-align: left;
  654. }
  655. .item3 .text {
  656. text-align: right;
  657. }
  658. }
  659. .jt-icon {
  660. position: relative;
  661. top: 6rpx;
  662. width: 60rpx;
  663. margin: 0 20rpx;
  664. }
  665. .row {
  666. margin: 10rpx 0;
  667. align-items: center;
  668. }
  669. .item-bottom {
  670. background: #F0F5FF;
  671. padding: 0 30rpx;
  672. .name {
  673. font-size: 26rpx;
  674. font-weight: 700;
  675. color: #000000;
  676. margin-left: 30rpx;
  677. }
  678. .hp {
  679. margin: 30rpx;
  680. }
  681. .number-color {
  682. margin: 0 10rpx;
  683. }
  684. .qd {
  685. background: linear-gradient(97deg, #4FABFD 0%, #2772FB 100%);
  686. border-radius: 13px;
  687. font-size: 29rpx;
  688. font-weight: 400;
  689. color: #FFFFFF;
  690. padding: 10rpx 35rpx;
  691. }
  692. }
  693. .dw {
  694. align-items: center;
  695. }
  696. .place {
  697. height: var(--status-bar-height);
  698. }
  699. .tab-view {
  700. display: flex;
  701. align-items: center;
  702. justify-content: space-between;
  703. }
  704. .tab-right {
  705. display: flex;
  706. margin-right: 20rpx;
  707. align-items: center;
  708. }
  709. </style>