order.vue 29 KB

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