index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  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 v-for="(good,index) in goods" :key="index" @click="toDetail(good.id)">
  42. <view v-if="good.peripheralInfo==1&&isFirstIndex==index" class="other-goods">周边货源</view>
  43. <view class="good-list">
  44. <view style="padding: 0 35rpx 20rpx 35rpx;position: relative;">
  45. <image src="@/static/images/goodSource/xf.png" mode="widthFix" class="xf-iamge"
  46. v-if="good.freightAdvance==1"></image>
  47. <view class="flex align-center">
  48. <view class="item1">
  49. <view class="ssx">{{$helper.getProvinceAbbreviation(good.sendPrivate?good.sendPrivate:good.sendCity)}}</view>
  50. <view class="level2-title">{{$helper.filterUrban(good.sendCity)}}
  51. {{$helper.filterArea(good.sendArea)}}
  52. </view>
  53. </view>
  54. <image class="jt-icon item2" src="@/static/images/goodSource/jt.png" mode='widthFix'>
  55. </image>
  56. <view class="item3">
  57. <view class="ssx">{{$helper.getProvinceAbbreviation(good.unloadPrivate?good.unloadPrivate:good.unloadCity)}}</view>
  58. <view class="level2-title">{{$helper.filterUrban(good.unloadCity)}}
  59. {{$helper.filterArea(good.unloadArea)}}
  60. </view>
  61. </view>
  62. </view>
  63. <view class="right gray">
  64. {{$helper.changeTime(good.updateDate)}}
  65. </view>
  66. <view class="flex flex-space-between yf-style">
  67. <view class="left">
  68. <view class="flex">
  69. <view class="gray mr20" v-if="good.cargoDistance">货距 {{good.cargoDistance}}km</view>
  70. <view class="gray " v-if="good.distance">运距 {{good.distance}}km</view>
  71. </view>
  72. <view class="u-flex-wrap flex gray row ">
  73. <view>{{good.goodsName}} | </view>
  74. <!-- <u-line direction="col"></u-line> -->
  75. <view v-if="carLength(good)"> {{carLength(good)}} | </view>
  76. <view v-if="carType(good)">{{carType(good)}} | </view>
  77. <view v-if="carWeight(good)">{{carWeight(good)}}</view>
  78. </view>
  79. <view class="flex row">
  80. <view class="row-tips">{{good.taskDescription}}</view>
  81. </view>
  82. </view>
  83. <view class="right flex h-color">
  84. <view class="fontsize-46">
  85. {{good.freightPrice}}
  86. </view>
  87. <view class="flex dw">元/吨</view>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="flex flex-space-between item-bottom">
  92. <view class="left flex row" @click.stop="cargoOwner(good)">
  93. <u--image
  94. :src="good.cargoOwnerPortrait?good.cargoOwnerPortrait:'../../static/images/mine/tx.png'"
  95. width='100rpx' height='100rpx' shape="circle" >
  96. </u--image>
  97. <view class="name">{{good.cargoOwnerName}}</view>
  98. <!-- <view class="hp flex fontsize-24">
  99. <view class="gray">评分</view>
  100. <view class="number-color">99%</view>
  101. </view>
  102. <view class="sum flex fontsize-24">
  103. <view class="gray">发运次数</view>
  104. <view class="number-color">106</view>
  105. </view> -->
  106. </view>
  107. <view class="right">
  108. <view @click.stop="grabOrders(good)" class="qd" v-if='hasLogin'>抢单</view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </mescroll-body>
  114. <u-toast ref="uToast"></u-toast>
  115. <u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :confirmText='confirmText'
  116. :showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
  117. @cancel="cancelClick"></u-modal>
  118. </view>
  119. </template>
  120. <script>
  121. var that
  122. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  123. import {
  124. mapState
  125. } from 'vuex';
  126. import {
  127. apiGoods
  128. } from "@/api/mock.js"
  129. export default {
  130. mixins: [MescrollMixin], // 使用mixin
  131. data() {
  132. return {
  133. confirmText: '确定',
  134. showCancelButton: true,
  135. isFirstIndex: null,
  136. ObjSelect: {},
  137. isShowAlert: false,
  138. alertTitle: '确定抢单?',
  139. show: false,
  140. columns: [
  141. ['全部类型', '运费先付']
  142. ],
  143. startPlace: {},
  144. endPlace: {},
  145. otherGoods: [], // 数据列表
  146. goods: [], // 数据列表
  147. src: 'https://cdn.uviewui.com/uview/album/1.jpg',
  148. height: "", // 需要固定swiper的高度
  149. tabList: [
  150. // {
  151. // name: '全部'
  152. // },
  153. {
  154. name: '推荐'
  155. }, {
  156. name: '按时间'
  157. }, {
  158. name: '按距离'
  159. },
  160. // {
  161. // name: '运费先付'
  162. // },
  163. ],
  164. pickerSelect: '全部类型',
  165. tabIndex: 0,
  166. scrollTop: 0,
  167. count: 0,
  168. lng: '',
  169. lat: '',
  170. bool: false,
  171. }
  172. },
  173. onTabItemTap(e) {
  174. // tab 点击时执行,此处直接接收单击事件
  175. uni.pageScrollTo({
  176. scrollTop: 0,
  177. duration: 300
  178. });
  179. },
  180. created() {
  181. },
  182. computed: {
  183. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
  184. },
  185. watch:{
  186. startPlace(){
  187. console.log(this.startPlace)
  188. this.upCallback();
  189. },
  190. },
  191. onShow() {
  192. //获取上一次点击起装卸地
  193. if (uni.getStorageSync('fPlaceObj')) {
  194. this.startPlace = uni.getStorageSync('fPlaceObj');
  195. this.upCallback({size:10,num:1})
  196. } else {
  197. // #ifdef APP-PLUS
  198. var that=this
  199. console.log('good',1111)
  200. // this.$nextTick(function(){
  201. this.getLngLat();
  202. // })
  203. // #endif
  204. }
  205. if (uni.getStorageSync('sPlaceObj')) {
  206. this.endPlace = uni.getStorageSync('sPlaceObj');
  207. this.upCallback({size:10,num:1})
  208. } else {
  209. this.endPlace.selected = '全国'
  210. }
  211. that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
  212. reCommonId: this.userInfo.id,
  213. }).then(res3 => {
  214. if (res3.data||res3.data==0) {
  215. let name = 'myTip';
  216. let value = res3.data
  217. if (value == 0) {
  218. uni.removeTabBarBadge({
  219. index: 3
  220. })
  221. }
  222. that.$store.commit('$uStore', {
  223. name,
  224. value
  225. });
  226. if (value != 0 && value) {
  227. uni.setTabBarBadge({
  228. index: 3,
  229. text: value + ""
  230. })
  231. }
  232. }
  233. })
  234. // this.mescroll.resetUpScroll()
  235. },
  236. async onLoad() {
  237. that = this
  238. // #ifdef APP-PLUS
  239. let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
  240. driverPhone: this.userInfo.phone,
  241. }).then(res => {
  242. return res.data.authenticationStatus
  243. })
  244. // if (_status == '已禁用') {
  245. // this.isShowAlert = true
  246. // this.alertTitle = '账号审核中'
  247. // this.confirmText = '退出APP'
  248. // this.showCancelButton = false
  249. // } else {
  250. // console.log(1231233212332312312213)
  251. // }
  252. // #endif
  253. },
  254. onPageScroll(res) {
  255. this.scrollTop = res.scrollTop
  256. // console.log("页面滚动了", res.scrollTop)
  257. if (this.scrollTop > 1200) {
  258. uni.setTabBarItem({
  259. index: 0,
  260. text: '返回顶部',
  261. iconPath: 'static/images/common/top@2x.png',
  262. selectedIconPath: 'static/images/common/top@2x.png'
  263. })
  264. } else {
  265. uni.setTabBarItem({
  266. index: 0,
  267. text: '货源',
  268. iconPath: 'static/images/common/huoyuan@2x(1).png',
  269. selectedIconPath: 'static/images/common/huoyuan@2x.png'
  270. })
  271. }
  272. },
  273. methods: {
  274. cargoOwner(_obj){
  275. // uni.$u.route('/pages/order/evaluateList');
  276. console.log("查看---------------",_obj)
  277. uni.$u.route('/pages/goodSource/cargoOwnerSee',_obj)
  278. },
  279. mescrollInit(mescroll) {
  280. this.mescroll = mescroll;
  281. },
  282. confirmClick() {
  283. let item = this.ObjSelect
  284. let _obj = {
  285. driverCommonId: this.firstAuthentication.commonId,
  286. commonId: item.commonId,
  287. cargoOwnerName: item.cargoOwnerName,
  288. cargoOwner: item.cargoOwner,
  289. sendPrivate: item.sendPrivate,
  290. sendCity: item.sendCity,
  291. sendArea: item.sendArea,
  292. sendDetailedAddress: item.sendDetailedAddress,
  293. unloadPrivate: item.unloadPrivate,
  294. unloadCity: item.unloadCity,
  295. unloadArea: item.unloadArea,
  296. unloadDetailedAddress: item.unloadDetailedAddress,
  297. goodsName: item.goodsName,
  298. distance: item.distance,
  299. freightPrice: item.freightPrice,
  300. driverName: this.firstAuthentication.driverName,
  301. driverPhone: this.firstAuthentication.driverPhone,
  302. cargoOwnerPhone: item.cargoOwnerPhone,
  303. id:item.id,
  304. billingMethod:item.billingMethod
  305. }
  306. this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
  307. if (res.code == 200) {
  308. this.$refs.uToast.show({
  309. type: 'success',
  310. message: "抢单成功!",
  311. complete() {
  312. uni.switchTab({
  313. url: "/pages/order/index"
  314. })
  315. }
  316. })
  317. } else {
  318. this.$refs.uToast.show({
  319. type: 'error',
  320. message: res.message,
  321. })
  322. }
  323. })
  324. .catch(res => {
  325. uni.$u.toast(res.message);
  326. });
  327. this.isShowAlert = false
  328. },
  329. cancelClick() {
  330. this.isShowAlert = false
  331. },
  332. carLength(good) {
  333. let length = ''
  334. if (good.carLengthSmall && good.carLength) {
  335. length = good.carLengthSmall + '~' + good.carLength + '米'
  336. } else if (good.carLengthSmall && !good.carLength) {
  337. length = "大于" + good.carLengthSmall + '米'
  338. } else if (good.carLength && !good.carLengthSmall) {
  339. length = "小于" + good.carLength + '米'
  340. }
  341. return length
  342. },
  343. carType(good) {
  344. let _val = '';
  345. if (good.carModel == 1) {
  346. _val = ''
  347. } else {
  348. if (good.carModel.includes(2)) {
  349. _val += '高栏 '
  350. }
  351. if (good.carModel.includes(3)) {
  352. _val += '集装箱 '
  353. }
  354. if (good.carModel.includes(4)) {
  355. _val += '自卸车 '
  356. }
  357. }
  358. return _val
  359. },
  360. carWeight(good) {
  361. good.loadWeightSmall
  362. good.loadWeight
  363. let weight = ''
  364. if (good.loadWeightSmall && good.loadWeight) {
  365. weight = good.loadWeightSmall + '~' + good.loadWeight + '吨'
  366. } else if (good.loadWeightSmall) {
  367. weight = "大于" + good.loadWeightSmall + '吨'
  368. } else if (good.loadWeight) {
  369. weight = "小于" + good.loadWeight + '吨'
  370. }
  371. return weight
  372. },
  373. getdate() {
  374. var date = new Date()
  375. var year = date.getFullYear() //获取完整的年份(4位)
  376. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  377. var datetime = date.getDate() //获取当前日(1-31)
  378. if (mouth < 10) {
  379. mouth = '0' + mouth
  380. }
  381. if (datetime < 10) {
  382. datetime = '0' + datetime
  383. }
  384. return String(year) + String(mouth) + String(datetime)
  385. },
  386. grabOrders(item) {
  387. this.isShowAlert = true
  388. this.ObjSelect = item
  389. },
  390. confirmSelectType(val) {
  391. this.pickerSelect = val.value[0]
  392. this.show = false
  393. this.upCallback({size:10,num:1})
  394. },
  395. selectTypeClose() {
  396. this.show = false
  397. },
  398. selectType() {
  399. this.show = true
  400. },
  401. getLngLat() {
  402. var that=this
  403. // uni.showLoading({
  404. // title: '获取定位信息'
  405. // })
  406. uni.getLocation({
  407. type: 'gcj02',
  408. geocode: true,
  409. success: res => {
  410. if (res.latitude) {
  411. if(res.address.city){
  412. if(res.address.city.indexOf('市')!=-1){
  413. res.address.city=res.address.city.substring(0,res.address.city.length-1)
  414. }
  415. }
  416. let _pickerSelect;
  417. if (that.pickerSelect == '运费先付') {
  418. _pickerSelect = 1
  419. } else {
  420. _pickerSelect = 0
  421. }
  422. that.startPlace.selected=res.address.city
  423. that.startPlace.fchoosecity=res.address.city
  424. let _data = {
  425. searchKeyWord: this.tabIndex + 1,
  426. searchType: _pickerSelect,
  427. pageSize: 10,
  428. currentPage: 1,
  429. loadingPlaceCity: that.startPlace.fchoosecity,
  430. // unLoadingPlaceCity: this.endPlace.schoosecity
  431. }
  432. that.$forceUpdate()
  433. // that.$set(that.startPlace,'selected',res.address.city)
  434. that.lng = res.longitude;
  435. that.lat = res.latitude;
  436. that.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
  437. if (res.code == 200) {
  438. uni.hideLoading()
  439. that.mescroll.endBySize(res.data.records.length, res.data.total);
  440. that.goods = res.data.records
  441. for (let i = 0; i < that.goods.length; i++) {
  442. if (that.goods[i].peripheralInfo == 1) {
  443. that.isFirstIndex = i
  444. return
  445. }
  446. }
  447. }
  448. uni.hideLoading()
  449. })
  450. .catch(res => {
  451. uni.$u.toast(res.message);
  452. that.mescroll.endErr();
  453. });
  454. } else {
  455. if (uni.getSystemInfoSync().platform == 'android') {
  456. var context = plus.android.importClass("android.content.Context");
  457. var locationManager = plus.android.importClass(
  458. "android.location.LocationManager");
  459. var main = plus.android.runtimeMainActivity();
  460. var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
  461. that.bool = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)
  462. }
  463. if (that.bool === false) {
  464. uni.showModal({
  465. title: '提示',
  466. content: '请打开定位服务',
  467. success: ({
  468. confirm,
  469. cancel
  470. }) => {
  471. if (confirm) {
  472. if (uni.getSystemInfoSync().platform == 'android') {
  473. var Intent = plus.android.importClass(
  474. 'android.content.Intent');
  475. var Settings = plus.android.importClass(
  476. 'android.provider.Settings');
  477. var intent = new Intent(Settings
  478. .ACTION_LOCATION_SOURCE_SETTINGS);
  479. var main = plus.android.runtimeMainActivity();
  480. main.startActivity(intent); // 打开系统设置GPS服务页面
  481. }
  482. }
  483. }
  484. });
  485. }
  486. uni.hideLoading()
  487. }
  488. }
  489. });
  490. },
  491. toDetail(id) {
  492. var that=this
  493. that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
  494. driverPhone: this.userInfo.phone,
  495. }).then(res2 => {
  496. // console.log('跳转',1111111)
  497. uni.setStorageSync('firstAuthentication', res2.data)
  498. that.firstAuthentication=uni.getStorageSync('firstAuthentication')
  499. // console.log(that.firstAuthentication)
  500. //司机是否认证身份
  501. if (that.firstAuthentication.authenticationStatus == '已认证') {
  502. uni.$u.route('/pages/goodSource/shippingDetails', {
  503. id: id,
  504. });
  505. } else if (that.firstAuthentication.authenticationStatus == '已过期') {
  506. that.$refs.uToast.show({
  507. type: 'error',
  508. message: "证件已过期,请上传新证件!",
  509. })
  510. } else {
  511. that.$refs.uToast.show({
  512. type: 'error',
  513. message: "请先完成司机认证!",
  514. })
  515. }
  516. })
  517. },
  518. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  519. upCallback(page) {
  520. let _pickerSelect;
  521. if (this.pickerSelect == '运费先付') {
  522. _pickerSelect = 1
  523. } else {
  524. _pickerSelect = 0
  525. }
  526. //选择省市区
  527. let _data = {
  528. searchKeyWord: this.tabIndex + 1,
  529. searchType: _pickerSelect,
  530. // loadingPlace: this.startPlace.selected,
  531. // unLoadingPlace: this.endPlace.selected=="全国"?'':this.endPlace.selected,
  532. pageSize: page.size,
  533. currentPage: page.num,
  534. // loadingPlaceCity: this.startPlace.fchoosecity,
  535. // unLoadingPlaceCity: this.endPlace.schoosecity
  536. }
  537. // if (this.tabIndex == 2) {
  538. if(!this.startPlace.selected){
  539. console.log(1)
  540. this.getLngLat();
  541. }else{
  542. _data.driverLongitude = this.lng
  543. _data.driverLatitude = this.lat
  544. // }
  545. console.log('------')
  546. console.log(_data)
  547. if (uni.getStorageSync('fPlaceObj')) {
  548. if (this.startPlace.fchoosearea && this.startPlace.fchoosearea == '全部' && this.startPlace
  549. .fchoosearea != '请选择区') {
  550. // _data.loadingPlaceCity = this.startPlace.fchoosecity
  551. if(this.startPlace.fchoosecity=='市辖区'){
  552. _data.loadingPlaceCity = this.startPlace.fchooseprovince
  553. }else{
  554. _data.loadingPlaceCity = this.startPlace.fchoosecity
  555. }
  556. } else if (this.startPlace.fchoosecity == '全部') {
  557. _data.loadingPlace = this.startPlace.selected
  558. } else {
  559. _data.loadingPlaceCity = this.startPlace.fchoosecity
  560. _data.loadingPlace = this.startPlace.fchoosearea
  561. }
  562. } else {
  563. _data.loadingPlaceCity = this.startPlace.fchoosecity
  564. }
  565. if (uni.getStorageSync('sPlaceObj')) {
  566. if (this.endPlace.schoosearea && this.endPlace.schoosearea == '全部' && this.endPlace.schoosearea !=
  567. '请选择区') {
  568. if(this.endPlace.schoosecity=='市辖区'){
  569. _data.unLoadingPlaceCity = this.endPlace.schooseprovince
  570. }else{
  571. _data.unLoadingPlaceCity = this.endPlace.schoosecity
  572. }
  573. } else if (this.endPlace.schoosearea) {
  574. _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
  575. } else {
  576. _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
  577. _data.unLoadingPlaceCity = this.endPlace.schoosecity
  578. }
  579. } else {
  580. _data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
  581. }
  582. if (this.lng) {
  583. _data.longitude = this.lng
  584. _data.latitude = this.lat
  585. }
  586. uni.showLoading({
  587. mask: true,
  588. title: '加载中'
  589. })
  590. this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
  591. if (res.code == 200) {
  592. uni.hideLoading()
  593. this.mescroll.endBySize(res.data.records.length, res.data.total);
  594. // for (var i = 0; i < res.data.records.length; i++) {
  595. // res.data.records[i].cargoOwnerName1=
  596. // }
  597. if (page.num == 1) {
  598. this.goods = [];
  599. // this.otherGoods = []
  600. }; //如果是第一页需手动制空列表
  601. that.goods = that.goods.concat(res.data.records);
  602. for (let i = 0; i < that.goods.length; i++) {
  603. if (that.goods[i].peripheralInfo == 1) {
  604. that.isFirstIndex = i
  605. return
  606. }
  607. }
  608. }
  609. uni.hideLoading()
  610. })
  611. .catch(res => {
  612. uni.$u.toast(res.message);
  613. this.mescroll.endErr();
  614. });
  615. }
  616. },
  617. clickTab(val) {
  618. this.tabIndex = val.index
  619. this.upCallback({
  620. size: 10,
  621. num: 1,
  622. })
  623. },
  624. changeCity() {
  625. if (this.endPlace.selected == '全国') {
  626. this.$refs.uToast.show({
  627. type: 'error',
  628. message: "装车地不能为全国!",
  629. })
  630. return
  631. }
  632. [this.startPlace.fchooseprovince, this.endPlace.schooseprovince] = [this.endPlace.schooseprovince, this
  633. .startPlace.fchooseprovince
  634. ];
  635. [this.startPlace.fchoosecity, this.endPlace.schoosecity] = [this.endPlace.schoosecity, this.startPlace
  636. .fchoosecity
  637. ];
  638. [this.startPlace.fchoosearea, this.endPlace.schoosearea] = [this.endPlace.schoosearea, this.startPlace
  639. .fchoosearea
  640. ];
  641. [this.startPlace.selected, this.endPlace.selected] = [this.endPlace.selected, this.startPlace.selected];
  642. // [this.startPlace, this.endPlace] = [this.endPlace, this.startPlace];
  643. uni.setStorageSync('fPlaceObj', this.startPlace);
  644. uni.setStorageSync('sPlaceObj', this.endPlace);
  645. },
  646. goCity(type) {
  647. uni.$u.route('/pages/goodSource/selectCity', {
  648. startPlace: JSON.stringify(this.startPlace),
  649. endPlace: JSON.stringify(this.endPlace),
  650. type: type
  651. });
  652. },
  653. swiperChange(e) {
  654. this.tabIndex = e.detail.current
  655. }
  656. }
  657. }
  658. </script>
  659. <style scoped lang="scss">
  660. .content {
  661. background: #F2F4F7;
  662. }
  663. .banner {
  664. width: 100%;
  665. position: relative;
  666. }
  667. .u-flex-wrap{
  668. flex-wrap: wrap;
  669. }
  670. .fixed,
  671. .fixed1 {
  672. background: linear-gradient(97deg, #4FABFD 0%, #2772FB 100%);
  673. position: fixed;
  674. top: var(--status-bar-height);
  675. z-index: 999;
  676. // width: calc(100% - 40rpx);
  677. width: 100%;
  678. // margin:0 20rpx;
  679. }
  680. .fixed1 {
  681. top: 0;
  682. height: var(--status-bar-height);
  683. background: linear-gradient(97deg, #4FABFD 0%, #2772FB 100%);
  684. }
  685. .banner-img {
  686. width: 100%;
  687. }
  688. .head {
  689. position: absolute;
  690. width: calc(100% - 108rpx);
  691. bottom: 0;
  692. background: white;
  693. margin: 0 20rpx;
  694. border-radius: 20rpx;
  695. .item1,
  696. .item3 {
  697. width: 40%;
  698. .text {
  699. text-overflow: ellipsis;
  700. overflow: hidden;
  701. white-space: nowrap;
  702. }
  703. }
  704. .item1 .text {
  705. text-align: left;
  706. }
  707. .item3 .text {
  708. text-align: right;
  709. }
  710. }
  711. .change-btn {
  712. width: 86rpx;
  713. height: 86rpx;
  714. }
  715. .good-list {
  716. background-color: white;
  717. margin: 10px 10px 15px 10px;
  718. padding: 10px 0px 0px 0;
  719. border-radius: 30rpx;
  720. box-shadow: 0px 5rpx 20rpx #E3E3E3;
  721. .item1,
  722. .item3 {
  723. // width: 40%;
  724. display: flex;
  725. .text {
  726. text-overflow: ellipsis;
  727. overflow: hidden;
  728. white-space: nowrap;
  729. }
  730. }
  731. .item1 .text {
  732. text-align: left;
  733. }
  734. .item3 .text {
  735. text-align: right;
  736. }
  737. }
  738. .jt-icon {
  739. position: relative;
  740. top: 6rpx;
  741. width: 60rpx;
  742. margin: 0 20rpx;
  743. }
  744. .row {
  745. margin: 10rpx 0;
  746. align-items: center;
  747. }
  748. .item-bottom {
  749. background: #F0F5FF;
  750. padding: 0 30rpx;
  751. border-radius: 0 0 30rpx 30rpx;
  752. .name {
  753. font-size: 26rpx;
  754. font-weight: 700;
  755. color: #000000;
  756. margin-left: 30rpx;
  757. }
  758. .hp {
  759. margin: 30rpx;
  760. }
  761. .number-color {
  762. margin: 0 10rpx;
  763. }
  764. .qd {
  765. background: linear-gradient(97deg, #4FABFD 0%, #2772FB 100%);
  766. border-radius: 13px;
  767. font-size: 29rpx;
  768. font-weight: 400;
  769. color: #FFFFFF;
  770. padding: 10rpx 35rpx;
  771. }
  772. }
  773. .dw {
  774. align-items: center;
  775. }
  776. .place {
  777. height: var(--status-bar-height);
  778. }
  779. .tab-view {
  780. display: flex;
  781. align-items: center;
  782. justify-content: space-between;
  783. }
  784. .tab-right {
  785. display: flex;
  786. margin-right: 20rpx;
  787. align-items: center;
  788. }
  789. .other-goods {
  790. // background: red;
  791. color:#999999;
  792. margin: 40rpx 0;
  793. display: flex;
  794. justify-content: center;
  795. font-size: 36rpx;
  796. }
  797. .level2-title {
  798. font-size: 28rpx;
  799. }
  800. .yf-style {
  801. position: relative;
  802. .h-color {
  803. position: absolute;
  804. right: 0;
  805. top: -30rpx;
  806. }
  807. }
  808. .xf-iamge {
  809. width: 74rpx;
  810. height: 43rpx;
  811. position: absolute;
  812. top: -20rpx;
  813. right: 0;
  814. }
  815. </style>