order.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. <template>
  2. <view>
  3. <view class="">
  4. <!-- #ifdef H5 -->
  5. <view style="position: fixed;top:0rpx;width: 100%;z-index: 999;">
  6. <!-- #endif -->
  7. <!-- #ifndef H5 -->
  8. <!-- v-if="shangxian=='否'" -->
  9. <view style="position: fixed;top: 0;width: 100%;z-index: 999;" >
  10. <!-- #endif -->
  11. <u-tabs :list="list" :is-scroll="false" active-color="#00c18a" inactive-color=" #666666"
  12. :bold="bold" :current="current" @change="change"></u-tabs>
  13. </view>
  14. <view class="ifbox">
  15. <view class="boxa" v-for="(item,index) in orderlist" :key="index" @click="goOrder(item)">
  16. <view class="order_box">
  17. <view class="order_success">
  18. <view class="text-bold text_bolds1" v-if="item.status==1">待支付</view>
  19. <view class="text-bold text_bolds2" v-if="item.status==2">待接单</view>
  20. <view class="text-bold text_bolds3" v-if="item.status==3">已接单</view>
  21. <view class="text-bold text_bolds4" v-if="item.status==4">进行中</view>
  22. <view class="text-bold text_bolds5" v-if="item.status==5">已抵达</view>
  23. <view class="text-bold text_bolds6" v-if="item.status==6">已取消</view>
  24. <view class="order_name"><!-- 待支付 --><view class="order_money">¥{{item.payMoney}}</view></view>
  25. </view>
  26. <!-- <view class="item_shunlu">{{item.similarity ? item.similarity : '0'}}% <text
  27. style="font-size: 24rpx;">顺路</text> </view> -->
  28. </view>
  29. <u-line color="#E6E6E6" />
  30. <view class="order_city">
  31. <view class="flex align-center">
  32. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/times.png'" style="width: 28rpx;height: 28rpx;"></image>
  33. <view style="margin-left: 16rpx;" class="add_name">{{item.appointmentStartTime}}</view>
  34. </view>
  35. <view class="margin-tb flex align-center">
  36. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/person.png'" style="width: 30rpx;height: 31rpx;"></image>
  37. <view style="margin-left: 16rpx;" class="add_name">
  38. {{item.appointmentNum}}人乘坐·{{item.appointmentType == 1 ? '独享' : '拼车'}}
  39. </view>
  40. </view>
  41. <view class="flex align-center add_name" style="margin: 30rpx 0rpx 4rpx;">
  42. <view class="green"></view>出发地点:{{item.shipAddress}}
  43. </view>
  44. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/up.png'" class="order_up"></image>
  45. <view class="flex align-center add_name">
  46. <view class="orgin"></view>到达地点:{{item.deliveryAddress}}
  47. </view>
  48. </view>
  49. <view class="margin-tb-sm" style="width: 100%;height:1rpx;background: #F2F2F2;"></view>
  50. <view class="flex align-center justify-between padding-lr ">
  51. <!-- <view>
  52. <view class="flex align-center" v-if="item.status != 5 && item.status != 6"
  53. @tap.stop="bindPhone(item.shipUserPhone)">
  54. <image src="/static/upload/phone.png" style="width: 32rpx;height: 40rpx;"></image>
  55. <view class="add_name margin-left-xs">联系TA</view>
  56. </view>
  57. </view> -->
  58. <!-- <view style="color: #FF2020;font-size: 32rpx;font-weight: bold;">
  59. <text>¥</text><text style="font-size: 42rpx;">{{item.driveMoney}}</text>
  60. </view> -->
  61. </view>
  62. <view class="padding" style="display: flex; align-items: center; justify-content: flex-end;">
  63. <view class="btn3" v-if="item.status == 3" @tap.stop="qxOrder(item.ordersId)">取消订单
  64. </view>
  65. <view class="btn3 margin-left" v-if="item.status == 5"
  66. @tap.stop="bindcomment(item)">
  67. 去评价
  68. </view>
  69. <view class="btn4 margin-left" v-if="item.status==4" @click="goNav('/my/setting/jinji')">安全求助</view>
  70. <view class="btn2 margin-left" v-if="item.status == 3">开始服务</view>
  71. <view class="btn2 margin-left" v-if="item.status == 4">抵达终点</view>
  72. </view>
  73. <!--
  74. <view v-if="item.status==1">待支付</view>
  75. <view v-if="item.status==2">待接单</view>
  76. <view v-if="item.status==3">已接单</view>
  77. <view v-if="item.status==4">进行中</view>
  78. <view v-if="item.status==5">已抵达</view>
  79. <view v-if="item.status==6">已取消</view>
  80. <view class="flex align-center justify-between padding-lr">
  81. <view class="flex align-center">
  82. <image src="../../static/image/data.png" style="width: 34rpx;height: 38rpx;"></image>
  83. <view class="margin-left-sm" v-if="item.indentType==1"> 即时代驾</view>
  84. <view class="margin-left-sm" v-if="item.indentType==2">朋友代叫</view>
  85. <view class="margin-left-sm" v-if="item.indentType==3">预约代驾</view>
  86. </view>
  87. <view style="color: #5FADFF;">
  88. <view v-if="item.indentState==1">已接单</view>
  89. <view v-if="item.indentState==2">进行中</view>
  90. <view v-if="item.indentState==3">待支付</view>
  91. <view v-if="item.indentState==4">已完成</view>
  92. <view v-if="item.indentState==5">已取消</view>
  93. </view>
  94. </view>
  95. <view class="margin-tb-sm" style="width: 100%;height:1rpx;background: #F2F2F2;"></view>
  96. <view class="addbox bgs margin-lr margin-bottom">
  97. <view class="add_cont">
  98. <view class="green"></view>
  99. <view class="add_tit">
  100. <view>{{item.shipAddress}}</view>
  101. </view>
  102. </view>
  103. <view>
  104. <image src="../../static/image/ladd.png" style="width: 30rpx;height: 35rpx;"></image>
  105. </view>
  106. </view>
  107. <view class="addbox bg margin-lr">
  108. <view class="add_cont">
  109. <view class="orgin"></view>
  110. <view class="add_tit">{{item.deliveryAddress}}</view>
  111. </view>
  112. <view>
  113. <image src="../../static/image/hadd.png" style="width: 30rpx;height: 35rpx;"></image>
  114. </view>
  115. </view>
  116. <view class="margin-lr margin-top-sm" v-if="item.remarks">备注:{{item.remarks}}</view>
  117. <view class="margin-tb-sm" style="width: 100%;height:1rpx;background: #F2F2F2;"></view>
  118. <view class="flex align-center justify-between padding-lr ">
  119. <view class="flex align-center" v-if="item.indentState==1&&item.riderDistance">
  120. <image src="../../static/image/add.png" style="width: 30rpx;height: 35rpx;"></image>
  121. <view v-if="item.riderDistance>1000" class="margin-left-xs">距您<text
  122. style="color: #3699FF;">{{(Number(item.riderDistance) / 1000).toFixed(2)}}km</text>
  123. </view>
  124. <view v-else class="margin-left-xs">距您<text
  125. style="color: #3699FF;">{{item.riderDistance}}m</text>
  126. </view>
  127. </view>
  128. <view class="flex align-center" v-if="item.riderMoney">
  129. <text v-if="item.indentState!=4">预估</text>
  130. <text v-else>实收</text>
  131. <view style="color: #FF2020;font-size: 32rpx;">
  132. <text>¥</text><text class="text-bold"
  133. style="font-size: 38rpx;">{{item.riderMoney}}</text>
  134. </view>
  135. </view>
  136. </view> -->
  137. <!-- <view class="flex align-center justify-between margin-lr margin-top flex-wrap">
  138. <view class="btn" v-if="item.indentState==1 || item.indentState==2"
  139. @click.stop="qxOrder(item.indentId)">取消订单</view>
  140. <view class="btn" v-if="item.indentState==1 && item.userId"
  141. @click.stop="openZd(item.indentId)">转单</view>
  142. <view class="btn1" v-if="item.indentState==1 && !item.startWaitTime"
  143. @click.stop="startAddress(item.indentId)">开始等待
  144. </view>
  145. <view class="btn1" v-if="item.indentState==1" @click.stop="daodaOrder(item.indentId)">开始服务
  146. </view>
  147. <view class="btn1" v-if="item.indentState==2" @click.stop="wcOrder(item.indentId)">抵达终点
  148. </view>
  149. <view class="btn1" v-if="item.indentState==2 && item.moneyType == 1"
  150. @click.stop="goOrder(item)">
  151. 加时
  152. </view>
  153. <view class="btn1" v-if="item.indentState==3" @click.stop="goOrder(item)">
  154. 出示收款码
  155. </view>
  156. </view> -->
  157. </view>
  158. </view>
  159. <empty v-if="orderlist.length == 0"></empty>
  160. <!-- 收货码弹框 -->
  161. <u-popup v-model="shows" mode="center" border-radius="18" width="580rpx" height="400rpx">
  162. <view class="receipt_code">
  163. <view class="code_title">填写收货码</view>
  164. <u-input v-model="shouhuoma" type="text" placeholder="请输入收货码" :border="true" />
  165. <view class="sure" @click="querenSh">确定</view>
  166. </view>
  167. </u-popup>
  168. <!-- 转单弹框 -->
  169. <u-popup v-model="show" mode="center" border-radius="18" width="580rpx" height="400rpx">
  170. <view class="receipt_code">
  171. <view class="code_title">转单</view>
  172. <u-input v-model="phone" type="number" maxlength="11" placeholder="请输入转单人手机号码" :border="true"
  173. :clearable="false" />
  174. <view class="sure" @click="zhundan()">确定</view>
  175. </view>
  176. </u-popup>
  177. </view>
  178. </view>
  179. </template>
  180. <script>
  181. import empty from '@/components/empty'
  182. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  183. export default {
  184. components: {
  185. empty
  186. },
  187. data() {
  188. return {
  189. shows: false,
  190. closeable: true,
  191. shouhuoma: '',
  192. list: [{
  193. name: '全部',
  194. id: ''
  195. },
  196. // {
  197. // name: '待接单',
  198. // id: 2
  199. // },
  200. {
  201. name: '已接单',
  202. id: 3
  203. }, {
  204. name: '进行中',
  205. id: 4
  206. }, {
  207. name: '已抵达',
  208. id: 5
  209. }, {
  210. name: '已取消',
  211. id: 6
  212. }
  213. ],
  214. current: 0,
  215. bold: false,
  216. page: 1,
  217. limit: 5,
  218. // order: [],
  219. orderlist: [],
  220. totalCount: 0,
  221. longitude: '', //经度
  222. latitude: '', //纬度
  223. indentState: '', //订单状态
  224. indentNumber: '', //订单号
  225. userId: '',
  226. arr: [],
  227. shangxian: '是',
  228. creditScore: 0,
  229. AllcreditScore: 0,
  230. show: false,
  231. phone: '',
  232. indentId: '',
  233. sfPhone: '',
  234. showModal1: true,
  235. globalImages: '',
  236. }
  237. },
  238. onLoad() {
  239. waitForGlobalImages().then((path) => {
  240. console.log('✅ 全局图片路径:', path)
  241. this.globalImages = path
  242. })
  243. // uni.getLocation({
  244. // type: 'wgs84',
  245. // success: function(res) {
  246. // console.log('当前位置的经度:' + res.longitude);
  247. // console.log('当前位置的纬度:' + res.latitude);
  248. // that.longitude = res.longitude
  249. // that.latitude = res.latitude
  250. // }
  251. // });
  252. var that = this
  253. that.$Request.getT('/app/common/type/428').then(res => { //师傅端小程序订单状态通知 428
  254. if (res.code == 0) {
  255. if (res.data && res.data.value) {
  256. that.arr.push(res.data.value)
  257. }
  258. }
  259. })
  260. that.$Request.getT('/app/common/type/429').then(res => { //师傅端小程序新订单通知 429
  261. if (res.code == 0) {
  262. if (res.data && res.data.value) {
  263. that.arr.push(res.data.value)
  264. }
  265. }
  266. })
  267. that.$Request.getT('/app/common/type/364').then(res => { // 每次取消扣除的信用分数量 364
  268. if (res.code == 0) {
  269. if (res.data && res.data.value) {
  270. that.creditScore = res.data.value
  271. }
  272. }
  273. })
  274. that.$Request.getT('/app/common/type/365').then(res => { // 低于多少不能接单和下单 365
  275. if (res.code == 0) {
  276. if (res.data && res.data.value) {
  277. that.AllcreditScore = res.data.value
  278. }
  279. }
  280. })
  281. },
  282. onShow() {
  283. var that = this
  284. this.shangxian = uni.getStorageSync('shangxian')
  285. that.userId = uni.getStorageSync('userId')
  286. if (that.userId) {
  287. that.page = 1
  288. that.taskData()
  289. that.getMyDetail();
  290. if (that.showModal1) {
  291. // #ifdef MP-WEIXIN
  292. that.openMsg()
  293. // #endif
  294. }
  295. } else {
  296. uni.navigateTo({
  297. url: '/pages/login/login'
  298. })
  299. }
  300. },
  301. methods: {
  302. // 紧急求助
  303. goNav(url) {
  304. // #ifdef MP-WEIXIN
  305. if (uni.getStorageSync('sendorderMsg')) {
  306. uni.requestSubscribeMessage({
  307. tmplIds: this.arr,
  308. success(re) {
  309. // console.log(re,'**********')
  310. var datas = JSON.stringify(re);
  311. if (datas.indexOf("accept") != -1) {
  312. console.log(re)
  313. }
  314. },
  315. fail: (res) => {
  316. console.log(res)
  317. }
  318. })
  319. }
  320. // #endif
  321. let token = this.$queue.getData("token");
  322. if (token) {
  323. uni.navigateTo({
  324. url: url
  325. })
  326. } else {
  327. this.bindlogin();
  328. }
  329. },
  330. // 去评价
  331. bindcomment(e) {
  332. // #ifdef MP-WEIXIN
  333. if (uni.getStorageSync('sendorderMsg')) {
  334. uni.requestSubscribeMessage({
  335. tmplIds: this.arr,
  336. success(re) {
  337. // console.log(re,'**********')
  338. var datas = JSON.stringify(re);
  339. if (datas.indexOf("accept") != -1) {
  340. console.log(re)
  341. }
  342. },
  343. fail: (res) => {
  344. console.log(res)
  345. }
  346. })
  347. }
  348. // #endif
  349. uni.navigateTo({
  350. url: '/my/order/comments?indentNumber=' + e.indentNumber + '&riderUserId=' + e
  351. .riderUserId
  352. })
  353. },
  354. getMyDetail() {
  355. let userId = this.$queue.getData('userId');
  356. this.$Request.getT('/app/user/selectUserDetails?userId=' + userId).then(res => {
  357. if (res.code == 0 && res.data) {
  358. this.sfPhone = res.data.phone;
  359. }
  360. });
  361. },
  362. // 开启订阅消息
  363. openMsg() {
  364. console.log('订阅消息')
  365. var that = this
  366. uni.getSetting({
  367. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  368. success(ret) {
  369. console.log(ret.subscriptionsSetting, '------------------')
  370. // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
  371. if (ret.subscriptionsSetting.itemSettings) {
  372. uni.setStorageSync('sendMsg', true)
  373. uni.openSetting({ // 打开设置页
  374. success(rea) {
  375. console.log(rea.authSetting)
  376. }
  377. });
  378. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  379. console.log(99999)
  380. uni.setStorageSync('sendMsg', false)
  381. uni.showModal({
  382. title: '提示',
  383. content: '为了更好的体验,请绑定消息推送',
  384. confirmText: '确定',
  385. cancelText: '取消',
  386. success: function(res) {
  387. if (res.confirm) {
  388. console.log(that.arr)
  389. wx.requestSubscribeMessage({
  390. tmplIds: that.arr,
  391. success(re) {
  392. console.log(JSON.stringify(re),
  393. '++++++++++++++')
  394. var datas = JSON.stringify(re);
  395. if (datas.indexOf("accept") != -1) {
  396. console.log(re)
  397. // uni.setStorageSync('sendMsg', true)
  398. }
  399. },
  400. fail: (res) => {
  401. console.log(res)
  402. }
  403. })
  404. // uni.setStorageSync('sendMsg', true)
  405. console.log('确认')
  406. that.showModal1 = false
  407. } else if (res.cancel) {
  408. console.log('取消')
  409. // uni.setStorageSync('sendMsg', false)
  410. that.showModal1 = true
  411. }
  412. }
  413. })
  414. }
  415. }
  416. })
  417. },
  418. zhundan() {
  419. if (!this.phone) {
  420. uni.showToast({
  421. title: '请输入手机号',
  422. icon: 'none'
  423. })
  424. return
  425. }
  426. this.$Request.postT('/app/indent/transferOfOrder', {
  427. indentId: this.indentId,
  428. phone: this.phone
  429. }).then(res => {
  430. this.show = false
  431. this.phone = ''
  432. if (res.code == 0) {
  433. uni.showToast({
  434. title: '转单成功',
  435. icon: 'none',
  436. duration: 3000
  437. })
  438. this.page = 1
  439. this.taskData()
  440. } else {
  441. uni.showToast({
  442. title: res.msg,
  443. icon: 'none'
  444. })
  445. }
  446. });
  447. },
  448. openZd(id) {
  449. this.phone = ''
  450. this.indentId = id
  451. this.show = true
  452. },
  453. bindPhone(phone) {
  454. let ysPhone = this.$queue.getData('ysPhone');
  455. if (ysPhone === '是') {
  456. this.$Request.getT('/app/user/insertVirtualPhone?phoneA=' + this.sfPhone + '&phoneB=' + phone).then(
  457. res => {
  458. if (res.code == 0) {
  459. if (res.data) {
  460. uni.makePhoneCall({
  461. phoneNumber: res.data //仅为示例
  462. });
  463. } else {
  464. this.$queue.showToast('手机号获取失败!');
  465. }
  466. } else {
  467. this.$queue.showToast(res.msg);
  468. }
  469. });
  470. } else {
  471. uni.makePhoneCall({
  472. phoneNumber: phone //仅为示例
  473. });
  474. }
  475. },
  476. goOrder(item) {
  477. // #ifdef MP-WEIXIN
  478. if (uni.getStorageSync('sendMsg')) {
  479. uni.requestSubscribeMessage({
  480. tmplIds: this.arr,
  481. success(re) {
  482. // console.log(re,'**********')
  483. var datas = JSON.stringify(re);
  484. if (datas.indexOf("accept") != -1) {
  485. console.log(re)
  486. }
  487. },
  488. fail: (res) => {
  489. console.log(res)
  490. }
  491. })
  492. }
  493. // #endif
  494. if (this.userId) {
  495. uni.navigateTo({
  496. url: '/my/order/pay?indentNumber=' + item.ordersId
  497. })
  498. } else {
  499. uni.navigateTo({
  500. url: '/pages/login/login'
  501. })
  502. }
  503. },
  504. change(index) {
  505. // #ifdef MP-WEIXIN
  506. if (uni.getStorageSync('sendMsg')) {
  507. uni.requestSubscribeMessage({
  508. tmplIds: this.arr,
  509. success(re) {
  510. // console.log(re,'**********')
  511. var datas = JSON.stringify(re);
  512. if (datas.indexOf("accept") != -1) {
  513. console.log(re)
  514. }
  515. },
  516. fail: (res) => {
  517. console.log(res)
  518. }
  519. })
  520. }
  521. // #endif
  522. this.current = index;
  523. this.orderlist = []
  524. this.page = 1
  525. this.taskData()
  526. },
  527. // 订单获取
  528. taskData() {
  529. let driverId = this.$queue.getData('driverId');
  530. if (!driverId) {
  531. return;
  532. }
  533. let indentState = this.list[this.current].id
  534. let userId = this.$queue.getData('userId');
  535. let data = {
  536. page: this.page,
  537. limit: 10,
  538. latitude: this.latitude,
  539. longitude: this.longitude,
  540. driverUserId: userId,
  541. appointmentType: '',
  542. status: indentState,
  543. driverId: driverId,
  544. sort: ''
  545. }
  546. this.$Request.getT('/app/orders/selectOrdersList', data).then(res => {
  547. uni.hideLoading()
  548. if (res.code == 0) {
  549. this.totalCount = res.data.totalCount
  550. if (this.page == 1) {
  551. this.orderlist = res.data.list
  552. } else {
  553. this.orderlist = [...this.orderlist, ...res.data.list]
  554. }
  555. }
  556. uni.stopPullDownRefresh();
  557. });
  558. // this.$Request.getT('/app/indent/getRiderIndentList', {
  559. // page: this.page,
  560. // limit: 10,
  561. // indentState: indentState
  562. // }).then(res => {
  563. // if (this.page == 1) {
  564. // this.orderlist = res.data.records
  565. // } else {
  566. // this.orderlist = this.orderlist.concat(res.data.records)
  567. // }
  568. // this.totalCount = res.data.pages
  569. // uni.stopPullDownRefresh();
  570. // });
  571. },
  572. // 订单详情
  573. bindorderDetail(indentNumber) {
  574. // #ifdef MP-WEIXIN
  575. if (uni.getStorageSync('sendMsg')) {
  576. uni.requestSubscribeMessage({
  577. tmplIds: this.arr,
  578. success(re) {
  579. // console.log(re,'**********')
  580. var datas = JSON.stringify(re);
  581. if (datas.indexOf("accept") != -1) {
  582. console.log(re)
  583. }
  584. },
  585. fail: (res) => {
  586. console.log(res)
  587. }
  588. })
  589. }
  590. // #endif
  591. uni.navigateTo({
  592. url: '/pages/index/orderdetail/orderdetail?id=' + indentNumber
  593. })
  594. },
  595. // 取消订单
  596. qxOrder(indentId) {
  597. let that = this
  598. uni.showModal({
  599. title: '提示',
  600. content: '取消订单将会被扣保证金以及信用分' + that.creditScore + '分,信用分低于' + that.AllcreditScore + '分无法接单',
  601. cancelText: '取消',
  602. confirmText: '确认',
  603. complete: function(ret) {
  604. if (ret.confirm) {
  605. that.$queue.showLoading('取消中...')
  606. that.$Request.postT('/app/orders/cancelOrders', {
  607. ordersId: indentId,
  608. isDriver: 1,
  609. }).then(res => {
  610. uni.hideLoading();
  611. if (res.code == 0) {
  612. that.page = 1
  613. that.taskData()
  614. uni.showToast({
  615. title: '订单已取消',
  616. icon: "none"
  617. });
  618. } else {
  619. uni.showToast({
  620. title: res.msg,
  621. icon: "none"
  622. });
  623. }
  624. });
  625. }
  626. }
  627. })
  628. },
  629. // 抵达起点
  630. startAddress(indentId) {
  631. let that = this
  632. uni.showModal({
  633. title: '提示',
  634. content: '确认已抵达起点,开始等待吗?',
  635. complete(ret) {
  636. if (ret.confirm) {
  637. that.$Request.getT('/app/indent/riderWaitDrive?indentId=' + indentId).then(res => {
  638. if (res.code == 0) {
  639. uni.showToast({
  640. title: '已开始等待'
  641. })
  642. that.page = 1
  643. that.taskData()
  644. } else {
  645. uni.showToast({
  646. title: res.msg,
  647. icon: 'none'
  648. })
  649. }
  650. })
  651. }
  652. }
  653. })
  654. },
  655. daodaOrder(indentId) { // 开始服务
  656. let that = this
  657. uni.showModal({
  658. title: '提示',
  659. content: '确认开始服务吗?',
  660. success: function(res) {
  661. if (res.confirm) {
  662. that.$Request.postT('/app/indent/riderStartDrive', {
  663. indentId: indentId
  664. }).then(res => {
  665. if (res.code == 0) {
  666. that.page = 1
  667. that.taskData()
  668. uni.showToast({
  669. title: '服务已开始',
  670. icon: "none"
  671. });
  672. } else {
  673. uni.showToast({
  674. title: res.msg,
  675. icon: "none"
  676. });
  677. }
  678. });
  679. }
  680. }
  681. })
  682. },
  683. wcOrder(indentId) { //抵达终点
  684. let that = this
  685. uni.showModal({
  686. title: '提示',
  687. content: '确认已抵达终点,完成服务吗?',
  688. success: function(res) {
  689. if (res.confirm) {
  690. that.$Request.postT('/app/indent/riderDelivery', {
  691. indentId: indentId
  692. }).then(res => {
  693. if (res.code == 0) {
  694. that.page = 1
  695. that.taskData()
  696. uni.showToast({
  697. title: '已到达终点',
  698. icon: "none"
  699. });
  700. } else {
  701. uni.showToast({
  702. title: res.msg,
  703. icon: "none"
  704. });
  705. }
  706. });
  707. }
  708. }
  709. })
  710. },
  711. querenSh() {
  712. this.$Request.postT('/app/indent/riderDelivery', {
  713. indentNumber: this.indentNumber,
  714. itemCode: this.shouhuoma
  715. }).then(res => {
  716. console.log(res)
  717. if (res.code == 0) {
  718. this.page = 1
  719. this.taskData()
  720. uni.showToast({
  721. title: '订单完成',
  722. icon: "none"
  723. });
  724. this.shows = false
  725. } else {
  726. uni.showToast({
  727. title: res.msg,
  728. icon: "none"
  729. });
  730. }
  731. });
  732. }
  733. },
  734. onReachBottom: function() {
  735. if (this.userId) {
  736. if (this.page < this.totalCount) {
  737. this.page += 1;
  738. this.taskData();
  739. }
  740. }
  741. },
  742. onPullDownRefresh: function() {
  743. if (this.userId) {
  744. this.page = 1;
  745. this.taskData()
  746. } else {
  747. uni.stopPullDownRefresh();
  748. }
  749. },
  750. }
  751. </script>
  752. <style lang="less">
  753. page {
  754. background: #F5F5F5;
  755. }
  756. .boxa {
  757. background: #FFFFFF;
  758. border-radius: 24rpx;
  759. margin: 30rpx;
  760. padding-bottom: 30rpx;
  761. // padding: 30rpx 0;
  762. }
  763. .order_success {
  764. display: flex;
  765. align-items: center;
  766. justify-content: space-between;
  767. padding: 30rpx;
  768. .order_name {
  769. color: #346EF6;
  770. font-weight: bold;
  771. }
  772. }
  773. .btn3 {
  774. width: 150rpx;
  775. height: 60rpx;
  776. border: 1px solid #00c18a;
  777. border-radius: 16rpx;
  778. font-size: 24rpx;
  779. font-family: PingFang SC;
  780. font-weight: 500;
  781. color: #00c18a;
  782. display: flex;
  783. align-items: center;
  784. justify-content: center;
  785. }
  786. .btn2 {
  787. width: 150rpx;
  788. height: 60rpx;
  789. background: #00c18a;
  790. border-radius: 16rpx;
  791. font-size: 24rpx;
  792. font-family: PingFang SC;
  793. font-weight: 500;
  794. color: #FFFFFF;
  795. display: flex;
  796. align-items: center;
  797. justify-content: center;
  798. }
  799. .btn4 {
  800. width: 150rpx;
  801. height: 60rpx;
  802. background: #f56c6c;
  803. border-radius: 16rpx;
  804. font-size: 24rpx;
  805. font-family: PingFang SC;
  806. font-weight: 500;
  807. color: #FFFFFF;
  808. display: flex;
  809. align-items: center;
  810. justify-content: center;
  811. }
  812. .btn1 {
  813. width: 150rpx;
  814. height: 60rpx;
  815. border: 1px solid #999999;
  816. border-radius: 16rpx;
  817. font-size: 24rpx;
  818. font-family: PingFang SC;
  819. font-weight: 500;
  820. color: #999999;
  821. display: flex;
  822. align-items: center;
  823. justify-content: center;
  824. }
  825. .order_box {
  826. background: #FFFFFF;
  827. border-radius: 24rpx;
  828. // margin: 30rpx;
  829. .order_success {
  830. display: flex;
  831. align-items: center;
  832. justify-content: space-between;
  833. padding: 30rpx;
  834. .order_name {
  835. color: #346EF6;
  836. font-weight: bold;
  837. }
  838. }
  839. .text_bolds1 {
  840. font-weight: 500;
  841. border: 1rpx #fe6b01 solid;
  842. padding: 8rpx 20rpx;
  843. border-radius: 13rpx;
  844. background: #fcf6ec;
  845. color: #fe6b01;
  846. }
  847. .text_bolds2 {
  848. font-weight: 500;
  849. border: 1rpx #fe6b01 solid;
  850. padding: 8rpx 20rpx;
  851. border-radius: 13rpx;
  852. background: #fcf6ec;
  853. color: #fe6b01;
  854. }
  855. .text_bolds3 {
  856. font-weight: 500;
  857. border: 1rpx #00c18a solid;
  858. padding: 8rpx 20rpx;
  859. border-radius: 13rpx;
  860. background: #e8fbf6;
  861. color: #00c18a;
  862. }
  863. .text_bolds4 {
  864. font-weight: 500;
  865. border: 1rpx #409eff solid;
  866. padding: 8rpx 20rpx;
  867. border-radius: 13rpx;
  868. background: #ecf5ff;
  869. color: #409eff;
  870. }
  871. .text_bolds5 {
  872. font-weight: 500;
  873. border: 1rpx #00c18a solid;
  874. padding: 8rpx 20rpx;
  875. border-radius: 13rpx;
  876. background: #e8fbf6;
  877. color: #00c18a;
  878. }
  879. .text_bolds6 {
  880. font-weight: 500;
  881. border: 1rpx #f56c6c solid;
  882. padding: 8rpx 20rpx;
  883. border-radius: 13rpx;
  884. background: #ffe9e9;
  885. color: #f56c6c;
  886. }
  887. .order_city {
  888. padding: 30rpx;
  889. color: #666666;
  890. }
  891. .order_up {
  892. width: 6rpx;
  893. height: 24rpx;
  894. margin-left: 6rpx;
  895. }
  896. .order_money {
  897. font-family: PingFang SC;
  898. font-weight: 800;
  899. font-size: 34rpx;
  900. color: #FF4B36;
  901. }
  902. .order_btn {
  903. display: flex;
  904. align-items: center;
  905. justify-content: flex-end;
  906. .btn3 {
  907. width: 150rpx;
  908. height: 60rpx;
  909. border: 1px solid #fe6b01;
  910. border-radius: 16rpx;
  911. font-size: 24rpx;
  912. font-family: PingFang SC;
  913. font-weight: 500;
  914. color: #fe6b01;
  915. display: flex;
  916. align-items: center;
  917. justify-content: center;
  918. }
  919. .btn2 {
  920. width: 150rpx;
  921. height: 60rpx;
  922. background: #fe6b01;
  923. border-radius: 16rpx;
  924. font-size: 24rpx;
  925. font-family: PingFang SC;
  926. font-weight: 500;
  927. color: #FFFFFF;
  928. display: flex;
  929. align-items: center;
  930. justify-content: center;
  931. }
  932. .btn1 {
  933. width: 150rpx;
  934. height: 60rpx;
  935. border: 1px solid #999999;
  936. border-radius: 16rpx;
  937. font-size: 24rpx;
  938. font-family: PingFang SC;
  939. font-weight: 500;
  940. color: #999999;
  941. display: flex;
  942. align-items: center;
  943. justify-content: center;
  944. }
  945. }
  946. }
  947. .item_shunlu {
  948. width: 210rpx;
  949. height: 80rpx;
  950. background: #EFF4FF;
  951. border-radius: 0px 24rpx 0px 50rpx;
  952. text-align: center;
  953. line-height: 80rpx;
  954. font-family: Source Han Sans CN;
  955. font-weight: bold;
  956. font-size: 32rpx;
  957. color: #346EF6;
  958. }
  959. .item_btn_qx {
  960. width: 303rpx;
  961. height: 78rpx;
  962. border-radius: 4rpx;
  963. border: 2rpx solid #999999;
  964. text-align: center;
  965. line-height: 78rpx;
  966. font-family: PingFang SC;
  967. font-weight: bold;
  968. font-size: 28rpx;
  969. color: #999999;
  970. }
  971. .item_btn_ddm {
  972. width: 660rpx;
  973. height: 78rpx;
  974. border-radius: 4rpx;
  975. background: #3670F6;
  976. text-align: center;
  977. line-height: 78rpx;
  978. font-family: PingFang SC;
  979. font-weight: bold;
  980. font-size: 28rpx;
  981. color: #FFFFFF;
  982. }
  983. .item_btn_dd {
  984. width: 303rpx;
  985. height: 78rpx;
  986. border-radius: 4rpx;
  987. background: #3670F6;
  988. text-align: center;
  989. line-height: 78rpx;
  990. font-family: PingFang SC;
  991. font-weight: bold;
  992. font-size: 28rpx;
  993. color: #FFFFFF;
  994. }
  995. .order_city {
  996. padding: 30rpx;
  997. color: #666666;
  998. }
  999. .order_up {
  1000. width: 6rpx;
  1001. height: 24rpx;
  1002. margin-left: 6rpx;
  1003. }
  1004. .ifbox {
  1005. /* #ifdef H5 */
  1006. padding-top: 85rpx;
  1007. /* #endif */
  1008. /* #ifndef H5 */
  1009. padding-top: 86rpx;
  1010. /* #endif */
  1011. }
  1012. .addbox {
  1013. display: flex;
  1014. align-items: center;
  1015. justify-content: space-between;
  1016. padding: 0 30rpx;
  1017. height: 110rpx;
  1018. border-radius: 16rpx;
  1019. }
  1020. .add_cont {
  1021. display: flex;
  1022. align-items: center;
  1023. }
  1024. .add_tit {
  1025. font-size: 30rpx;
  1026. font-family: PingFang SC;
  1027. font-weight: bold;
  1028. color: #333333;
  1029. }
  1030. .bg {
  1031. background: #F5F5F5;
  1032. }
  1033. .bgs {
  1034. background: #F5F8FF;
  1035. }
  1036. .green {
  1037. width: 16rpx;
  1038. height: 16rpx;
  1039. background: #1FC657;
  1040. border-radius: 50%;
  1041. margin-right: 20rpx;
  1042. }
  1043. .orgin {
  1044. width: 16rpx;
  1045. height: 16rpx;
  1046. background: #FBAC04;
  1047. border-radius: 50%;
  1048. margin-right: 20rpx;
  1049. }
  1050. .btn {
  1051. // width: 200rpx;
  1052. margin: 0 10rpx;
  1053. flex: 1;
  1054. height: 60rpx;
  1055. border: 1px solid #999999;
  1056. border-radius: 4rpx;
  1057. font-size: 28rpx;
  1058. font-family: PingFang SC;
  1059. font-weight: bold;
  1060. color: #999999;
  1061. display: flex;
  1062. align-items: center;
  1063. justify-content: center;
  1064. margin-bottom: 20rpx;
  1065. }
  1066. .btn1 {
  1067. margin: 0 10rpx;
  1068. // width: 200rpx;
  1069. flex: 1;
  1070. height: 60rpx;
  1071. background: linear-gradient(87deg, #346EF6 0%, #7BA2FF 100%);
  1072. border-radius: 4rpx;
  1073. font-size: 28rpx;
  1074. font-family: PingFang SC;
  1075. font-weight: bold;
  1076. color: #FFFFFF;
  1077. display: flex;
  1078. align-items: center;
  1079. justify-content: center;
  1080. margin-bottom: 20rpx;
  1081. }
  1082. /* 收货码弹框 */
  1083. .receipt_code {
  1084. width: 90%;
  1085. margin: 0 auto;
  1086. }
  1087. .code_title {
  1088. width: 100%;
  1089. line-height: 100rpx;
  1090. font-size: 31rpx;
  1091. font-weight: bold;
  1092. text-align: center;
  1093. letter-spacing: 2rpx;
  1094. margin-top: 21rpx;
  1095. margin-bottom: 10rpx;
  1096. }
  1097. ::v-deep .u-input--border {
  1098. border: 1px solid #F2F2F2 !important;
  1099. background: #F2F2F2 !important;
  1100. color: #999999 !important;
  1101. font-weight: 500 !important;
  1102. letter-spacing: 2rpx !important;
  1103. }
  1104. ::v-deep .u-input__input {
  1105. font-size: 30rpx;
  1106. font-weight: bold;
  1107. flex: 1;
  1108. color: #999999 !important;
  1109. min-height: 85rpx !important;
  1110. margin-top: 7rpx;
  1111. }
  1112. .sure {
  1113. width: 100%;
  1114. height: 80rpx;
  1115. background: linear-gradient(87deg, #346EF6 0%, #7BA2FF 100%);
  1116. color: white;
  1117. border-radius: 46rpx;
  1118. text-align: center;
  1119. line-height: 80rpx;
  1120. margin-top: 40rpx;
  1121. letter-spacing: 2rpx;
  1122. }
  1123. </style>