order.vue 30 KB

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