myOrderDetail.vue 14 KB

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