myOrderDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. <template>
  2. <view>
  3. <view class="top_view">
  4. <view class="flex justify-between align-center margin-lr-lg">
  5. <view class="top_title">正在寻找乘客</view>
  6. <view class="top_rightview" @click="bjShow = !bjShow">
  7. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/more.png'">
  8. </image>
  9. <view class="top_popuView" v-if="bjShow">
  10. <view style="padding: 40rpx 50rpx 20rpx;" @click.stop="closeSave">取消行程</view>
  11. <view style="padding: 0rpx 50rpx 40rpx;" @click.stop="editSave" class="margin-top">编辑行程</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view v-if="order.shipAddress" class="margin-lr-lg"
  16. style="background: #FFFFFF;background: #FFFFFF;border-radius: 24rpx;padding: 30rpx;margin-top: 40rpx;">
  17. <view class="flex justify-end align-center" @tap="goXC">
  18. <view style="font-size: 26rpx;font-weight: bold;margin-right: 10rpx;">查看行程</view>
  19. <view>
  20. <image v-if="globalImages" :src="globalImages + 'imgs/static/image/right.png'" style="width: 12rpx;height: 22rpx;">
  21. </image>
  22. </view>
  23. </view>
  24. <view class="topbox_addview justify-between" style="margin-top: 20rpx;">
  25. <view class="flex align-center" style="margin-bottom: 4rpx;">
  26. <view class="green"></view>
  27. <view class="topbox_addName">{{order.shipAddress}}</view>
  28. </view>
  29. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/up.png'"></image>
  30. <view class="flex align-center">
  31. <view class="orgin"></view>
  32. <view class="topbox_addName">{{order.deliveryAddress}}</view>
  33. </view>
  34. </view>
  35. <view class="flex justify-between margin-tb-sm">
  36. <view class="flex">
  37. <view class="topbox_title" v-if="order.seatNum">{{order.seatNum}}人乘车</view>
  38. <view class="topbox_title" v-if="order.isHighSpeedPrice && order.isHighSpeedPrice == 1">
  39. ·司机承担</view>
  40. <view class="topbox_title" v-if="order.isHighSpeedPrice && order.isHighSpeedPrice == 2">
  41. ·乘客承担</view>
  42. <view class="topbox_title" v-if="order.isHighSpeedPrice && order.isHighSpeedPrice == 3">
  43. ·费用AA</view>
  44. </view>
  45. <view class="topbox_title">{{order.startTime}}出发</view>
  46. </view>
  47. </view>
  48. <u-sticky @fixed="xdCheck" @unfixed="noXDCheck" bgColor="none" bgColors="#FFFFFF">
  49. <view class="flex justify-between margin-top margin-lr-lg" :class="scrollTop == 1 ? 'showTopView' : ''">
  50. <view :class="typeSel == 0 ? 'type_item_sel' : 'type_item'" @tap="typeCheck(0)">智能排序</view>
  51. <view :class="typeSel == 1 ? 'type_item_sel' : 'type_item'" @tap="typeCheck(1)">最新发布</view>
  52. <view :class="typeSel == 2 ? 'type_item_sel' : 'type_item'" @tap="typeCheck(2)">价格最高</view>
  53. <view :class="typeSel == 3 ? 'type_item_sel' : 'type_item'" @tap="typeCheck(3)">起点最近</view>
  54. </view>
  55. </u-sticky>
  56. <view class="boxa margin-lr-lg" @click="goOrder(item)" v-for="(item,index) in list" :key="index">
  57. <view class="flex align-center justify-between" style="padding: 0rpx 0rpx 0rpx 30rpx;">
  58. <view class="flex align-center">
  59. <view class="item_time">{{item.appointmentStartTime}}</view>
  60. <view class="item_chakan" v-if="item.browCount && item.browCount == 1">查看过</view>
  61. </view>
  62. <view class="item_shunlu">{{item.similarity ? item.similarity : '0'}}% <text
  63. style="font-size: 24rpx;">顺路</text> </view>
  64. </view>
  65. <view class="padding margin-top-xs">
  66. <view class="flex align-center justify-between" style="margin-bottom: 4rpx;">
  67. <view class="flex align-center">
  68. <view class="green"></view>
  69. <view class="item_addName">{{item.shipAddress}}</view>
  70. </view>
  71. <view class="item_juli">{{item.startDistance}}km</view>
  72. </view>
  73. <view class="flex align-center margin-top justify-between">
  74. <view class="flex align-center">
  75. <view class="orgin"></view>
  76. <view class="item_addName">{{item.deliveryAddress}}</view>
  77. </view>
  78. <view class="item_juli">{{item.endDistance}}km</view>
  79. </view>
  80. <view class="margin-top flex align-center justify-between">
  81. <view class="flex align-center">
  82. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/person.png'" style="width: 30rpx;height: 31rpx;"></image>
  83. <view style="margin-left: 16rpx;width: fit-content;" class="item_addName">
  84. {{item.appointmentNum}}人乘坐·{{item.appointmentType == 1 ? '独享' : '拼车'}}
  85. </view>
  86. </view>
  87. <view class="item_juli">订单里程{{item.kmDistance}}km</view>
  88. </view>
  89. </view>
  90. <view class="margin-tb-sm" style="width: 100%;height:1rpx;background: #F2F2F2;"></view>
  91. <view class="flex align-center justify-between padding-lr padding-bottom-sm">
  92. <view style="color: #FF2020;font-size: 32rpx;font-weight: bold;">
  93. <text>¥</text><text style="font-size: 42rpx;">{{item.driveMoney}}</text>
  94. </view>
  95. <view class="item_btn" @tap.stop="jiedan(item)">立即同行</view>
  96. </view>
  97. </view>
  98. <empty v-if="list.length == 0"></empty>
  99. </view>
  100. <view class="sos" @click="goTop()">
  101. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/goTop.png'" mode=""></image>
  102. </view>
  103. <view class="sos" @click="goRefers()" style="bottom: 160rpx;">
  104. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/refers.png'" mode=""></image>
  105. </view>
  106. </view>
  107. </template>
  108. <script>
  109. import empty from '@/components/empty'
  110. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  111. export default {
  112. components: {
  113. empty
  114. },
  115. data() {
  116. return {
  117. bjShow: false,
  118. typeSel: 0,
  119. page: 1,
  120. limit: 10,
  121. orderList: [],
  122. order: {
  123. shipAddress: ""
  124. },
  125. list: [],
  126. scrollTop: 0,
  127. driverRouteId: '',
  128. globalImages: '',
  129. }
  130. },
  131. onLoad(d) {
  132. if (d.driverRouteId) {
  133. this.driverRouteId = d.driverRouteId;
  134. }
  135. waitForGlobalImages().then((path) => {
  136. console.log('✅ 全局图片路径:', path)
  137. this.globalImages = path
  138. })
  139. },
  140. onShow() {
  141. if (this.driverRouteId) {
  142. this.getDetail();
  143. }
  144. },
  145. methods: {
  146. goXC(){
  147. uni.navigateTo({
  148. url: '/my/order/xcDetail?driverRouteId=' + this
  149. .driverRouteId
  150. })
  151. },
  152. goTop() {
  153. uni.pageScrollTo({
  154. scrollTop: 0,
  155. duration: 300
  156. });
  157. },
  158. goRefers() {
  159. if (this.driverRouteId) {
  160. this.$queue.showLoading('刷新中...')
  161. this.page = 1;
  162. this.getDetail();
  163. }
  164. },
  165. xdCheck(e) {
  166. this.scrollTop = 1;
  167. console.log('吸顶')
  168. },
  169. noXDCheck(e) {
  170. this.scrollTop = 0;
  171. console.log('no吸顶')
  172. },
  173. goOrder(e) {
  174. uni.navigateTo({
  175. url: '/pages/index/orderDet?indentNumber=' + e.ordersId + '&driverRouteId=' + this
  176. .driverRouteId
  177. })
  178. },
  179. jiedan(item) {
  180. let userId = this.$queue.getData('userId');
  181. let that = this;
  182. uni.showModal({
  183. title: '提示',
  184. content: '确定抢单吗?',
  185. success: function(res) {
  186. if (res.confirm) {
  187. // console.log('用户点击确定');
  188. that.$Request.postT(
  189. '/app/orders/takingOrders?ordersId=' +
  190. item.ordersId + '&userId=' + userId + '&driverRouteId=' + that
  191. .driverRouteId)
  192. .then(res => {
  193. if (res.code == 0) {
  194. uni.showToast({
  195. title: '接单成功',
  196. icon: 'none'
  197. })
  198. setTimeout(function() {
  199. uni.switchTab({
  200. url: '/pages/order/order'
  201. })
  202. }, 1000)
  203. } else {
  204. uni.showToast({
  205. title: res.msg,
  206. icon: 'none',
  207. duration: 1500
  208. })
  209. }
  210. });
  211. } else if (res.cancel) {
  212. // console.log('用户点击取消');
  213. }
  214. }
  215. });
  216. },
  217. closeSave() {
  218. this.bjShow = false;
  219. let that = this;
  220. uni.showModal({
  221. title: '提示',
  222. content: '确认取消发布行程吗?',
  223. cancelText: '取消',
  224. confirmText: '确认',
  225. complete: function(ret) {
  226. if (ret.confirm) {
  227. let data = {
  228. driverRouteId: that.driverRouteId
  229. }
  230. that.$Request.postT('/app/driverRoute/deleteDriverRoute', data).then(res => {
  231. if (res.code == 0) {
  232. that.$queue.showToast('取消成功!');
  233. setTimeout(d => {
  234. uni.navigateBack();
  235. }, 1500)
  236. } else {
  237. that.$queue.showToast(res.msg);
  238. }
  239. });
  240. }
  241. }
  242. })
  243. },
  244. editSave() {
  245. this.bjShow = false;
  246. uni.navigateTo({
  247. url: '/my/order/editDetail?driverRouteId=' + this.driverRouteId
  248. });
  249. },
  250. typeCheck(index) {
  251. this.typeSel = index;
  252. this.page = 1;
  253. this.taskData()
  254. },
  255. getDetail() {
  256. this.$Request.getT('/app/driverRoute/selectDriverRouteById?driverRouteId=' + this.driverRouteId).then(
  257. res => {
  258. if (res.code == 0) {
  259. this.order = res.data;
  260. this.taskData()
  261. }
  262. });
  263. },
  264. // 获取新任务数据
  265. taskData() {
  266. let userId = this.$queue.getData('userId');
  267. let shipProvince = this.order.shipProvince
  268. let shipCity = this.order.shipCity
  269. let orderType = 1;
  270. let sort = this.typeSel == 0 ? '' : this.typeSel;
  271. let data = {
  272. page: this.page,
  273. limit: 10,
  274. od: this.order.shipAddressLatitude,
  275. ol: this.order.shipAddressLongitude,
  276. appointmentType: this.appointmentType ? this.appointmentType : '',
  277. appointmentNum: '',
  278. driverRouteId: this.driverRouteId,
  279. driverUserId: userId,
  280. // shipProvince: shipProvince,
  281. // shipCity: shipCity,
  282. orderType: orderType,
  283. status: 2,
  284. sort: sort
  285. }
  286. if (shipProvince) {
  287. data.shipProvince = shipProvince;
  288. }
  289. if (shipCity) {
  290. data.shipCity = shipCity;
  291. }
  292. this.$Request.getT('/app/orders/selectOrdersList', data).then(res => {
  293. uni.hideLoading()
  294. if (res.code == 0) {
  295. if (this.page == 1) {
  296. this.list = res.data.list
  297. } else {
  298. this.list = [...this.list, ...res.data.list]
  299. }
  300. }
  301. uni.stopPullDownRefresh();
  302. });
  303. }
  304. }
  305. }
  306. </script>
  307. <style lang="scss">
  308. page {
  309. background: #F5F5F5;
  310. }
  311. .sos {
  312. width: 100rpx;
  313. height: 100rpx;
  314. position: fixed;
  315. bottom: 290rpx;
  316. right: 32rpx;
  317. z-index: 99999;
  318. image {
  319. width: 100rpx;
  320. height: 100rpx;
  321. border-radius: 50%;
  322. }
  323. }
  324. .type_item {
  325. width: 150rpx;
  326. height: 58rpx;
  327. background: #FFFFFF;
  328. border-radius: 29rpx;
  329. line-height: 58rpx;
  330. text-align: center;
  331. font-family: PingFang SC;
  332. font-weight: 500;
  333. font-size: 24rpx;
  334. color: #999999;
  335. }
  336. .showTopView {
  337. display: flex;
  338. justify-content: space-between;
  339. padding-bottom: 20rpx;
  340. }
  341. .type_item_sel {
  342. width: 150rpx;
  343. height: 58rpx;
  344. background: #00c18a;
  345. border-radius: 29rpx;
  346. line-height: 58rpx;
  347. text-align: center;
  348. font-family: PingFang SC;
  349. font-weight: 500;
  350. font-size: 24rpx;
  351. color: #FFFFFF;
  352. }
  353. .boxa {
  354. background: #FFFFFF;
  355. border-radius: 24rpx;
  356. margin-top: 30rpx;
  357. .item_time {
  358. font-family: Source Han Sans CN;
  359. font-weight: bold;
  360. font-size: 28rpx;
  361. color: #242424;
  362. }
  363. .item_chakan {
  364. margin-left: 20rpx;
  365. background: #F2F2F2;
  366. border-radius: 6rpx;
  367. text-align: center;
  368. padding: 6rpx 14rpx;
  369. font-family: PingFang SC;
  370. font-weight: 500;
  371. font-size: 24rpx;
  372. color: #999999;
  373. }
  374. .item_shunlu {
  375. width: 210rpx;
  376. height: 80rpx;
  377. background: #e8fbf6;
  378. border-radius: 0px 24rpx 0px 50rpx;
  379. text-align: center;
  380. line-height: 80rpx;
  381. font-family: Source Han Sans CN;
  382. font-weight: bold;
  383. font-size: 32rpx;
  384. color: #00c18a;
  385. }
  386. .addbox {
  387. display: flex;
  388. align-items: center;
  389. justify-content: space-between;
  390. padding: 0 30rpx;
  391. height: 110rpx;
  392. border-radius: 16rpx;
  393. }
  394. .add_cont {
  395. display: flex;
  396. align-items: center;
  397. }
  398. .add_tit {
  399. font-size: 30rpx;
  400. font-family: PingFang SC;
  401. font-weight: bold;
  402. color: #333333;
  403. }
  404. .bg {
  405. background: #F5F5F5;
  406. }
  407. .bgs {
  408. background: #F5F8FF;
  409. }
  410. .green {
  411. width: 16rpx;
  412. height: 16rpx;
  413. background: #00c18a;
  414. border-radius: 50%;
  415. margin-right: 20rpx;
  416. }
  417. .orgin {
  418. width: 16rpx;
  419. height: 16rpx;
  420. background: #FBAC04;
  421. border-radius: 50%;
  422. margin-right: 20rpx;
  423. }
  424. .btn {
  425. height: 78rpx;
  426. background: linear-gradient(87deg, #00c18a 0%, #e8fbf6 100%);
  427. border-radius: 4rpx;
  428. font-size: 28rpx;
  429. font-family: PingFang SC;
  430. font-weight: bold;
  431. color: #FFFFFF;
  432. margin: 30rpx 30rpx 0;
  433. display: flex;
  434. align-items: center;
  435. justify-content: center;
  436. }
  437. }
  438. .topbox_addview {
  439. width: 624rpx;
  440. min-height: 100rpx;
  441. background: #e8fbf6;
  442. border-radius: 16rpx;
  443. border: 1px solid #00c18a;
  444. margin: 0 auto;
  445. // display: flex;
  446. align-items: center;
  447. padding: 20rpx 30rpx;
  448. image {
  449. width: 6rpx;
  450. height: 24rpx;
  451. margin-left: 6rpx;
  452. }
  453. .topbox_title {
  454. font-family: PingFang SC;
  455. font-weight: 500;
  456. font-size: 28rpx;
  457. color: #151515;
  458. }
  459. }
  460. .item_btn {
  461. width: 150rpx;
  462. height: 58rpx;
  463. background: #00c18a;
  464. border-radius: 29rpx;
  465. text-align: center;
  466. line-height: 58rpx;
  467. font-family: PingFang SC;
  468. font-weight: 500;
  469. font-size: 24rpx;
  470. color: #FFFFFF;
  471. }
  472. .topbox_addName {
  473. font-family: PingFang SC;
  474. font-weight: 800;
  475. font-size: 28rpx;
  476. color: #1A1A1A;
  477. width: 520rpx;
  478. white-space: nowrap;
  479. text-overflow: ellipsis;
  480. overflow: hidden;
  481. }
  482. .green {
  483. width: 16rpx;
  484. height: 16rpx;
  485. background: #1FC657;
  486. border-radius: 50%;
  487. margin-right: 20rpx;
  488. }
  489. .orgin {
  490. width: 16rpx;
  491. height: 16rpx;
  492. background: #FBAC04;
  493. border-radius: 50%;
  494. margin-right: 20rpx;
  495. }
  496. .top_view {
  497. width: 750rpx;
  498. height: 430rpx;
  499. background: linear-gradient(to bottom, #92eed4 70%, #c9fff0 90%);
  500. padding: 40rpx 0rpx;
  501. .top_title {
  502. font-family: Source Han Sans CN;
  503. font-weight: bold;
  504. font-size: 36rpx;
  505. color: #242424;
  506. }
  507. .top_rightview {
  508. position: relative;
  509. z-index: 9;
  510. width: 100rpx;
  511. text-align: right;
  512. image {
  513. width: 10rpx;
  514. height: 34rpx;
  515. margin-right: 20rpx;
  516. margin-top: 6rpx;
  517. }
  518. .top_popuView {
  519. position: absolute;
  520. top: 60rpx;
  521. right: 28rpx;
  522. z-index: 99;
  523. min-width: 220rpx;
  524. min-height: 171rpx;
  525. background: #FFFFFF;
  526. box-shadow: 0px 6rpx 12rpx 0px rgba(126, 126, 126, 0.27);
  527. border-radius: 24rpx 0px 24rpx 24rpx;
  528. font-family: PingFang SC;
  529. font-weight: 500;
  530. font-size: 28rpx;
  531. color: #666666;
  532. }
  533. }
  534. }
  535. </style>