placeOrders.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <!-- <template>
  2. <view style="padding-bottom: 100rpx;">
  3. #ifdef H5
  4. <u-sticky :h5-nav-height="0" @fixed="xdCheck" @unfixed="noXDCheck">
  5. #endif
  6. #ifndef H5
  7. <u-sticky @fixed="xdCheck" @unfixed="noXDCheck">
  8. #endif
  9. <view style="background: #FFFFFF;">
  10. <u-dropdown :menu-icon='menuicon' ref="uDropdown" @open="open" @close="close" menu-icon-size="18">
  11. <u-dropdown-item v-model="value1" :title="mrtitle">
  12. <view class="slot-content padding" style="background: #FFFFFF;">
  13. <view class="addbox bg" @click="goCFAddress(2)">
  14. <view class="add_cont">
  15. <view class="orgin"></view>
  16. <view class="add_tit" v-if="addlists.city === ''">选择出发地城市</view>
  17. <view class="add_tit" v-else>{{addlists.city}}</view>
  18. </view>
  19. <view>
  20. <image v-if="globalImages" :src="globalImages + 'imgs/static/image/go.png'" style="width: 16rpx;height: 25rpx;">
  21. </image>
  22. </view>
  23. </view>
  24. <view class="addbox bg" @click="goCFAddress(2)">
  25. <view class="add_cont">
  26. <u-input v-model="addlists.address" type="text" placeholder="请输入出发地地址"
  27. :border="true" :clearable="true"
  28. style="border: none;width: 610rpx;height: 100%;" />
  29. </view>
  30. </view>
  31. <view class="flex justify-between">
  32. <view class="qc_btn" @tap="goQC(2)">清除</view>
  33. <view class="sx_btn" @tap="goCX">查询</view>
  34. </view>
  35. </view>
  36. </u-dropdown-item>
  37. <u-dropdown-item v-model="value2" :title="carname">
  38. <view class="slot-content padding" style="background: #FFFFFF;">
  39. <view class="addbox bg" @click="goCFAddress(1)">
  40. <view class="add_cont">
  41. <view class="orgin"></view>
  42. <view class="add_tit" v-if="addlist.city === ''">选择目的地城市</view>
  43. <view class="add_tit" v-else>{{addlist.city}}</view>
  44. </view>
  45. <view>
  46. <image v-if="globalImages" :src="globalImages + 'imgs/static/image/go.png'" style="width: 16rpx;height: 25rpx;">
  47. </image>
  48. </view>
  49. </view>
  50. <view class="addbox bg" @click="goCFAddress(1)">
  51. <view class="add_cont">
  52. <u-input v-model="addlist.address" type="text" placeholder="请输入目的地地址"
  53. :border="true" :clearable="true"
  54. style="border: none;width: 610rpx;height: 100%;" />
  55. </view>
  56. </view>
  57. <view class="flex justify-between">
  58. <view class="qc_btn" @tap="goQC(1)">清除</view>
  59. <view class="sx_btn" @tap="goCX">查询</view>
  60. </view>
  61. </view>
  62. </u-dropdown-item>
  63. </u-dropdown>
  64. </view>
  65. </u-sticky>
  66. <view class="myOrder_itemView" v-for="(item,index) in orderList" @tap="goDetail(item)">
  67. <view style="padding: 30rpx 40rpx 30rpx;">
  68. <view class="flex justify-between align-center">
  69. <view class="item_title">{{item.appointmentStartTime}}</view>
  70. <view style="color: #346EF6;font-weight: bold;">等待接单中...</view>
  71. </view>
  72. <view class="flex align-center add_name" style="margin: 30rpx 6rpx 10rpx;">
  73. <view class="green"></view>出发地点:{{item.shipCity}} {{item.shipAddress}}
  74. </view>
  75. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/up.png'" class="order_up"></image>
  76. <view class="flex align-center add_name" style="margin-left: 6rpx;margin-top: 6rpx;">
  77. <view class="orgin"></view>到达地点:{{item.deliveryCity}} {{item.deliveryAddress}}
  78. </view>
  79. <view class="margin-top flex align-center justify-between">
  80. <view class="flex align-center">
  81. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/person.png'" style="width: 30rpx;height: 31rpx;"></image>
  82. <view style="margin-left: 16rpx;width: fit-content;" class="item_addName">
  83. {{item.appointmentNum}}人乘坐
  84. </view>
  85. </view>
  86. <view class="item_juli">订单里程{{item.kmDistance}}km</view>
  87. </view>
  88. </view>
  89. <u-line color="#E6E6E6" />
  90. <view style="padding: 30rpx 40rpx 0rpx;display: flex;justify-content: space-between;">
  91. <view class="item_money">一口价:<text style="font-size: 32rpx;">¥</text><text>{{item.driveMoney}}</text>
  92. </view>
  93. <view class="item_btn" @tap="save(item)">立即接单</view>
  94. </view>
  95. </view>
  96. <empty v-if="orderList.length == 0"></empty>
  97. </view>
  98. </template> -->
  99. // <script>
  100. // import empty from '@/components/empty'
  101. // import { waitForGlobalImages } from '@/utils/globalImageLoader'
  102. // export default {
  103. // components: {
  104. // empty
  105. // },
  106. // data() {
  107. // return {
  108. // addlists: {
  109. // city: '',
  110. // address: ''
  111. // },
  112. // addlist: {
  113. // city: '',
  114. // address: ''
  115. // },
  116. // itemDetail: {},
  117. // mrtitle: '筛选出发地',
  118. // carname: '筛选目的地',
  119. // menuicon: 'arrow-down-fill',
  120. // value1: 1,
  121. // value2: 2,
  122. // page: 1,
  123. // limit: 10,
  124. // orderList: [],
  125. // indentNumber: '',
  126. // openLists: [],
  127. // showpay: false,
  128. // isDrop: false, //是否打开下拉筛选
  129. // openWay: 1,
  130. // globalImages: '',
  131. // }
  132. // },
  133. // onLoad(d) {
  134. // waitForGlobalImages().then((path) => {
  135. // console.log('✅ 全局图片路径:', path)
  136. // this.globalImages = path
  137. // })
  138. // this.page = 1;
  139. // this.getMyOrderList();
  140. // this.getCityList();
  141. // },
  142. // onShow() {
  143. // let userId = uni.getStorageSync('userId')
  144. // if (!userId) {
  145. // uni.navigateTo({
  146. // url: '/pages/login/login'
  147. // })
  148. // }
  149. // },
  150. // methods: {
  151. // open(index) {
  152. // this.$refs.uDropdown.highlight();
  153. // this.isDrop = true
  154. // },
  155. // close(index) {
  156. // console.log('close', index)
  157. // // 关闭的时候,给当前项加上高亮
  158. // // 当然,您也可以通过监听dropdown-item的@change事件进行处理
  159. // this.$refs.uDropdown.highlight(index);
  160. // this.isDrop = false
  161. // },
  162. // goQC(index) {
  163. // if (index == 1) {
  164. // let addlist = {
  165. // city: '',
  166. // address: ''
  167. // }
  168. // this.addlist = addlist
  169. // }
  170. // if (index == 2) {
  171. // let addlists = {
  172. // city: '',
  173. // address: ''
  174. // }
  175. // this.addlists = addlists
  176. // }
  177. // if (this.isDrop) {
  178. // this.$refs.uDropdown.close();
  179. // }
  180. // this.page = 1;
  181. // this.getMyOrderList();
  182. // },
  183. // goCX() {
  184. // if (this.isDrop) {
  185. // this.$refs.uDropdown.close();
  186. // }
  187. // this.page = 1;
  188. // this.getMyOrderList();
  189. // },
  190. // goCFAddress(index) {
  191. // let that = this
  192. // uni.chooseLocation({
  193. // success: function(res) {
  194. // console.log('位置名称:' + res.name);
  195. // console.log('详细地址:' + res.address);
  196. // console.log('纬度:' + res.latitude);
  197. // console.log('经度:' + res.longitude);
  198. // if (index == 1) {
  199. // that.addlist.address = res.name
  200. // that.addlist.lng = res.longitude
  201. // that.addlist.lat = res.latitude
  202. // let data = {
  203. // lat: res.latitude,
  204. // lng: res.longitude
  205. // }
  206. // that.$Request.getT('/app/Login/selectCity', data).then(res => {
  207. // if (res.code === 0) {
  208. // that.addlist.province = res.data.province
  209. // that.addlist.city = res.data.city
  210. // that.addlist.district = res.data.district
  211. // }
  212. // });
  213. // } else if (index == 2) {
  214. // that.addlists.address = res.name
  215. // that.addlists.lng = res.longitude
  216. // that.addlists.lat = res.latitude
  217. // let data = {
  218. // lat: res.latitude,
  219. // lng: res.longitude
  220. // }
  221. // that.$Request.getT('/app/Login/selectCity', data).then(res => {
  222. // if (res.code === 0) {
  223. // that.addlists.province = res.data.province
  224. // that.addlists.city = res.data.city
  225. // that.addlists.district = res.data.district
  226. // }
  227. // });
  228. // }
  229. // }
  230. // });
  231. // },
  232. // getCityList() {
  233. // this.$Request.getT('/app/fixedStroke/selectShipCityList').then(res => {
  234. // if (res.code == 0) {
  235. // }
  236. // });
  237. // this.$Request.getT('/app/fixedStroke/selectDeliveryCityList').then(res => {
  238. // if (res.code == 0) {
  239. // }
  240. // });
  241. // },
  242. // save(item) {
  243. // let userId = this.$queue.getData('userId');
  244. // let that = this;
  245. // uni.showModal({
  246. // title: '提示',
  247. // content: '确定抢单吗?',
  248. // success: function(res) {
  249. // if (res.confirm) {
  250. // // console.log('用户点击确定');
  251. // that.$Request.postT(
  252. // '/app/orders/takingOrders?ordersId=' +
  253. // item.ordersId + '&userId=' + userId)
  254. // .then(res => {
  255. // if (res.code == 0) {
  256. // uni.showToast({
  257. // title: '接单成功',
  258. // icon: 'none'
  259. // })
  260. // that.page = 1;
  261. // that.getMyOrderList();
  262. // setTimeout(function() {
  263. // uni.switchTab({
  264. // url: '/pages/order/order'
  265. // })
  266. // }, 1000)
  267. // } else {
  268. // uni.showToast({
  269. // title: res.msg,
  270. // icon: 'none',
  271. // duration: 1500
  272. // })
  273. // }
  274. // });
  275. // } else if (res.cancel) {
  276. // // console.log('用户点击取消');
  277. // }
  278. // }
  279. // });
  280. // },
  281. // getMyOrderList() {
  282. // this.$queue.showLoading('加载中...')
  283. // let userId = this.$queue.getData('userId');
  284. // this.$Request.getT('/app/orders/selectOrdersList?isFixedStroke=1&page=' + this.page + '&limit=' + this
  285. // .limit + '&shipCity=' + this.addlists.city + '&shipAddress=' + this.addlists.address +
  286. // '&deliveryCity=' + this.addlist.city + '&deliveryAddress=' + this.addlist.address + '&driverUserId=' + userId + '&status=2').then(res => {
  287. // if (res.code == 0 && res.data) {
  288. // if (this.page == 1) {
  289. // this.orderList = res.data.list
  290. // } else {
  291. // this.orderList = [...this.orderList, ...res.data.list]
  292. // }
  293. // uni.hideLoading();
  294. // uni.stopPullDownRefresh();
  295. // }
  296. // });
  297. // }
  298. // },
  299. // // 上拉加载
  300. // onReachBottom: function() {
  301. // this.page = this.page + 1;
  302. // this.getMyOrderList();
  303. // },
  304. // onPullDownRefresh: function() {
  305. // this.page = 1;
  306. // this.getMyOrderList();
  307. // }
  308. // }
  309. // </script>
  310. // <style lang="scss">
  311. // page {
  312. // background: #F5F5F5;
  313. // }
  314. // .qc_btn {
  315. // margin: 0 10rpx 10rpx;
  316. // width: 320rpx;
  317. // padding: 0 30rpx;
  318. // height: 90rpx;
  319. // border-radius: 50rpx;
  320. // text-align: center;
  321. // line-height: 90rpx;
  322. // background: #346EF6;
  323. // font-family: PingFang SC;
  324. // font-weight: 500;
  325. // font-size: 30rpx;
  326. // color: #FFFFFF;
  327. // }
  328. // .sx_btn {
  329. // margin: 0 10rpx 10rpx;
  330. // width: 320rpx;
  331. // padding: 0 30rpx;
  332. // height: 90rpx;
  333. // border-radius: 50rpx;
  334. // text-align: center;
  335. // line-height: 90rpx;
  336. // background: #346EF6;
  337. // font-family: PingFang SC;
  338. // font-weight: 500;
  339. // font-size: 30rpx;
  340. // color: #FFFFFF;
  341. // }
  342. // .addbox {
  343. // display: flex;
  344. // align-items: center;
  345. // justify-content: space-between;
  346. // margin: 0 10rpx 30rpx;
  347. // padding: 0 30rpx;
  348. // height: 110rpx;
  349. // border-radius: 16rpx;
  350. // }
  351. // .add_cont {
  352. // display: flex;
  353. // align-items: center;
  354. // }
  355. // .add_tit {
  356. // font-size: 30rpx;
  357. // font-family: PingFang SC;
  358. // font-weight: bold;
  359. // color: #333333;
  360. // margin-left: 10rpx;
  361. // }
  362. // .bg {
  363. // background: #F5F5F5;
  364. // }
  365. // .box_money {
  366. // font-family: PingFang SC;
  367. // font-weight: 500;
  368. // font-size: 28rpx;
  369. // color: #030303;
  370. // margin-bottom: 30rpx;
  371. // margin-top: 10rpx;
  372. // text {
  373. // font-size: 40rpx;
  374. // color: #FF2020;
  375. // font-weight: bold;
  376. // }
  377. // }
  378. // .box_item {
  379. // padding: 0 20rpx;
  380. // display: flex;
  381. // align-items: center;
  382. // width: 520rpx;
  383. // height: 100rpx;
  384. // background: #F7F7F7;
  385. // border-radius: 16rpx;
  386. // justify-content: space-between;
  387. // }
  388. // .add_tit {
  389. // font-size: 30rpx;
  390. // font-family: PingFang SC;
  391. // font-weight: bold;
  392. // color: #333333;
  393. // margin-left: 10rpx;
  394. // }
  395. // .myOrder_itemView {
  396. // width: 686rpx;
  397. // // height: 549rpx;
  398. // background: #FFFFFF;
  399. // border-radius: 32rpx;
  400. // margin: 0 auto;
  401. // margin-top: 20rpx;
  402. // padding-bottom: 40rpx;
  403. // }
  404. // .item_title {
  405. // font-family: Source Han Sans CN;
  406. // font-weight: 600;
  407. // font-size: 32rpx;
  408. // color: #242424;
  409. // }
  410. // .order_up {
  411. // width: 6rpx;
  412. // height: 24rpx;
  413. // margin-left: 12rpx;
  414. // }
  415. // .add_name {
  416. // font-family: PingFang SC;
  417. // font-weight: 500;
  418. // font-size: 28rpx;
  419. // color: #101010;
  420. // }
  421. // .green {
  422. // width: 16rpx;
  423. // height: 16rpx;
  424. // background: #1FC657;
  425. // border-radius: 50%;
  426. // margin-right: 20rpx;
  427. // }
  428. // .item_money {
  429. // font-family: PingFang SC;
  430. // font-weight: 500;
  431. // font-size: 28rpx;
  432. // color: #101010;
  433. // text {
  434. // font-size: 42rpx;
  435. // color: #FF2020;
  436. // font-weight: bold;
  437. // }
  438. // }
  439. // .item_btn {
  440. // width: 150rpx;
  441. // height: 58rpx;
  442. // background: #346EF6;
  443. // border-radius: 30rpx;
  444. // text-align: center;
  445. // line-height: 58rpx;
  446. // font-family: PingFang SC;
  447. // font-weight: 500;
  448. // font-size: 24rpx;
  449. // color: #FFFFFF;
  450. // }
  451. // .orgin {
  452. // width: 16rpx;
  453. // height: 16rpx;
  454. // background: #FBAC04;
  455. // border-radius: 50%;
  456. // margin-right: 20rpx;
  457. // }
  458. // </style>