orderdetail.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  1. <template>
  2. <view class="content">
  3. <view class="part_one u-skeleton-fillet" v-if="orderDelites.indentState == '3' || orderDelites.indentState == '4'">
  4. <view class="pickup" v-if="orderDelites.indentState == '3'">待取货...</view>
  5. <view class="pickup" v-if="orderDelites.indentState == '4'">配送中...</view>
  6. <view class="pickup_tit" v-if="orderDelites.indentState == '3'">抢单成功请及时取货送达</view>
  7. <view class="pickup_tit" v-if="orderDelites.indentState == '4'">取货成功请及时送达</view>
  8. </view>
  9. <view class="part_one u-skeleton-fillet" v-else>
  10. <view class="pickup" v-if="orderDelites.indentState == '5'">已完成...</view>
  11. <view class="pickup" v-if="orderDelites.indentState == '6'">已完成...</view>
  12. <view class="pickup" v-if="orderDelites.indentState == '7'">已完成...</view>
  13. <view class="pickup" v-if="orderDelites.indentState == '9'">已取消...</view>
  14. <view class="pickup" v-if="orderDelites.indentState == '10'">已取消...</view>
  15. <view class="pickup_tit">加油明天会更好!</view>
  16. </view>
  17. <view
  18. class="part_one u-skeleton-fillet"
  19. style="height: auto"
  20. v-if="orderDelites.indentState == '3' || (orderDelites.indentState == '4' && orderDelites.indentType == '5' && orderDelites.indentType != '3')"
  21. >
  22. <view class="pickup">取货码</view>
  23. <view class="pickup_tit quhuoma">{{ orderDelites.orderCode }}</view>
  24. </view>
  25. <view class="list_box1 u-skeleton-fillet">
  26. <view class="part2">
  27. <view style="padding: 0 30rpx; font-size: 20px" v-if="orderDelites.orderPaySequence">#{{ orderDelites.orderPaySequence }}</view>
  28. <view
  29. class="box_add"
  30. style="padding-bottom: 12px"
  31. v-if="
  32. orderDelites.indentType == 5 || orderDelites.indentType == 1 || orderDelites.indentType == 2 || (orderDelites.indentType == 3 && orderDelites.buyType == 1)
  33. "
  34. >
  35. <view class="add_name">
  36. <view class="flex">
  37. <view class="buy">
  38. <image src="../../../static/rider/icon-buy.png"></image>
  39. </view>
  40. <view class="sh_name" @click="goStart()">
  41. {{ orderDelites.shopAddressDetail }}
  42. <u-icon name="map"></u-icon>
  43. </view>
  44. </view>
  45. <view class="xs_add" @click="coll(orderDelites.shopPhone)">
  46. {{ orderDelites.shopName ? orderDelites.shopName : '' }}
  47. <text style="margin-left: 10upx">{{ orderDelites.shopPhone ? orderDelites.shopPhone : '' }}</text>
  48. <u-icon name="phone"></u-icon>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="box_add">
  53. <view class="add_name">
  54. <view class="flex">
  55. <view class="send">
  56. <image src="../../../static/rider/icon-send.png"></image>
  57. </view>
  58. <view class="sh_name" @click="goEnd()">
  59. {{ orderDelites.userAddressDetail }}({{ orderDelites.userProvince ? orderDelites.userProvince : '' }}
  60. {{ orderDelites.userCity ? orderDelites.userCity : '' }}{{ orderDelites.userDistrict ? orderDelites.userDistrict : '' }})
  61. <u-icon name="map"></u-icon>
  62. </view>
  63. </view>
  64. <view class="xs_add" @click="coll(orderDelites.userPhone)">
  65. {{ orderDelites.userName ? orderDelites.userName : '' }}
  66. <text style="margin-left: 10upx">{{ orderDelites.userPhone ? orderDelites.userPhone : '' }}</text>
  67. <u-icon name="phone"></u-icon>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view v-if="orderDelites.indentType == 5" style="padding-bottom: 15px"></view>
  73. <view class="part3" v-if="orderDelites.indentType != 5">
  74. <view class="three_left" v-if="orderDelites.predictTime">
  75. <image src="../../../static/rider/icon_data.png"></image>
  76. <text>{{ orderDelites.predictTime }}分钟内送达</text>
  77. </view>
  78. <view class="three_right">{{ orderDelites.errandMoney }}元</view>
  79. </view>
  80. </view>
  81. <!-- tip -->
  82. <view class="tip_box u-skeleton-fillet" v-if="orderDelites.indentType != 5">
  83. <view class="tip_part1">
  84. <view class="tip_title" v-if="orderDelites.indentType == 1">帮送清单</view>
  85. <view class="tip_title" v-if="orderDelites.indentType == 2">帮取清单</view>
  86. <view class="tip_title" v-if="orderDelites.indentType == 3">帮买清单</view>
  87. <view class="tip_title" v-if="orderDelites.indentType == 4">服务内容</view>
  88. <view class="tip_rider" v-if="orderDelites.prepayMoney" style="margin-right: 16upx">
  89. 商品预付:¥
  90. <text>{{ orderDelites.prepayMoney }}</text>
  91. </view>
  92. <view class="box_two1" v-if="orderDelites.itemType">{{ orderDelites.itemType }}</view>
  93. <view class="box_two1" v-if="orderDelites.serviceType">{{ orderDelites.serviceType }}</view>
  94. <view class="box_two1" v-if="orderDelites.itemValue">{{ orderDelites.itemValue }}</view>
  95. <view class="box_two1" v-if="orderDelites.itemWeight">{{ orderDelites.itemWeight }}</view>
  96. </view>
  97. <u-line color="#F2F2F2" />
  98. <view class="tip_content" v-if="orderDelites.indentType == 3">
  99. {{ orderDelites.productDetails ? orderDelites.productDetails : '' }}
  100. </view>
  101. <view class="tip_content" v-if="orderDelites.indentType == 1 || orderDelites.indentType == 2">
  102. {{ orderDelites.remarks ? orderDelites.remarks : '' }}
  103. </view>
  104. <view class="tip_content" v-if="orderDelites.indentType == 4">
  105. {{ orderDelites.serviceDetails ? orderDelites.serviceDetails : '' }}
  106. </view>
  107. </view>
  108. <!-- 订单信息 -->
  109. <view class="order_box u-skeleton-fillet">
  110. <view class="order_title">订单信息</view>
  111. <view class="order_list">
  112. <view class="order_name">订单号码</view>
  113. <view class="order_numbers" @click="copyOrder(orderDelites.indentNumber)">
  114. {{ orderDelites.indentNumber }}
  115. <u-icon name="order"></u-icon>
  116. </view>
  117. </view>
  118. <view class="order_list">
  119. <view class="order_name">发布时间</view>
  120. <view class="order_numbers">{{ orderDelites.createTime }}</view>
  121. </view>
  122. <view class="order_list">
  123. <view class="order_name">接单时间</view>
  124. <view class="order_numbers">{{ orderDelites.receivingTime }}</view>
  125. </view>
  126. <view class="order_list" v-if="orderDelites.finishTime">
  127. <view class="order_name">完成时间</view>
  128. <view class="order_numbers">{{ orderDelites.finishTime }}</view>
  129. </view>
  130. <view class="order_list padding-bottom-sm" v-if="orderDelites.remarks">
  131. <view class="order_name">订单备注</view>
  132. <view class="order_numbers">{{ orderDelites.remarks }}</view>
  133. </view>
  134. <!-- <view class="order_list">
  135. <view class="order_name">发票抬头</view>
  136. <view class="order_numbers">无(不需要发票)</view>
  137. </view> -->
  138. </view>
  139. <!-- 费用明细 -->
  140. <view class="order_box u-skeleton-fillet">
  141. <view class="order_title">费用明细</view>
  142. <view class="order_list">
  143. <view class="income_name">跑腿费</view>
  144. <view class="income_numbers">
  145. ¥
  146. <text>{{ orderDelites.errandMoney }}</text>
  147. </view>
  148. </view>
  149. <view class="order_list" v-if="orderDelites.tip">
  150. <view class="income_name">小费奖励</view>
  151. <view class="income_numbers">
  152. ¥
  153. <text>{{ orderDelites.tip ? orderDelites.tip : '0' }}</text>
  154. </view>
  155. </view>
  156. <view class="order_list" v-if="orderDelites.prepayMoney">
  157. <view class="income_name">商品费用</view>
  158. <view class="income_numbers1">
  159. ¥
  160. <text>{{ orderDelites.prepayMoney }}</text>
  161. </view>
  162. </view>
  163. <view class="order_list">
  164. <view class="income_name">合计</view>
  165. <view class="income_numbers1">
  166. ¥
  167. <text>{{ orderDelites.riderMoney }}</text>
  168. </view>
  169. </view>
  170. </view>
  171. <!-- 接单按钮 -->
  172. <view class="tabbar_btn" v-if="orderDelites.indentState == '3' || orderDelites.indentState == '4' || orderDelites.indentState == '5'">
  173. <!-- <view class="btn_left">
  174. 联系TA
  175. </view>
  176. <view class="btn_right" @click="onshow">
  177. 确定送达
  178. </view> -->
  179. <view class="btn_right" @click="quhuo(orderDelites.indentId)" v-if="orderDelites.indentState == '3'">确认取货</view>
  180. <view class="btn_left" @click="zhuanOrder(orderDelites.indentId)" v-if="orderDelites.indentState == '3'">转单</view>
  181. <view class="btn_left" v-if="orderDelites.indentState == '4'" @click="coll(orderDelites.userPhone)">联系TA</view>
  182. <view class="btn_right" v-if="orderDelites.indentState == '4'" @click.stop="shouhuo(orderDelites)">确认送达</view>
  183. <view class="btn_right" v-if="orderDelites.indentState == '5'">客户待确认</view>
  184. <!-- <view class="flex"
  185. v-if="item.indentState=='4'||item.indentState=='7'">
  186. <view class="btn_pai" @click.stop="paiOrder(item)">拍照</view>
  187. </view> -->
  188. </view>
  189. <!-- 聊天室 -->
  190. <view style="position: fixed; bottom: 150rpx; right: 50rpx">
  191. <image
  192. @tap="goChat(orderDelites.indentId, orderDelites.orderId)"
  193. src="../../../static/image/chats.png"
  194. style="width: 100rpx; height: 100rpx; border-radius: 50rpx"
  195. ></image>
  196. <view class="shopxiaoix" v-if="RiderUnreadCount">{{ RiderUnreadCount }}</view>
  197. </view>
  198. <!-- 转单 -->
  199. <u-popup v-model="showOrder" mode="center" border-radius="18" :closeable="closeable" close-icon="close-circle" close-icon-size="45" width="580rpx" height="600rpx">
  200. <view class="receipt_code">
  201. <view class="code_title">填写转单信息(二选一即可)</view>
  202. <u-input v-model="phone" type="number" placeholder="填写转单人手机号码" :border="border" />
  203. <u-input v-model="zhuanName" type="text" placeholder="填写转单人姓名" :border="border" />
  204. <view class="sure" style="margin-top: 40rpx" @click="zhuandan">确定</view>
  205. </view>
  206. </u-popup>
  207. <!-- 收货码弹框 -->
  208. <u-popup v-model="show" mode="center" border-radius="18" :closeable="closeable" close-icon="close-circle" close-icon-size="45" width="580rpx" height="400rpx">
  209. <view class="receipt_code">
  210. <view class="code_title">填写收货码</view>
  211. <u-input v-model="shouhuoma" :type="type" placeholder="请输入收货码" :border="border" />
  212. <view class="sure" @click="querenSh">确定</view>
  213. </view>
  214. </u-popup>
  215. <!-- <u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton> -->
  216. <!-- 确认收货拍照弹出框 -->
  217. <u-popup
  218. v-model="alertPhone"
  219. mode="center"
  220. border-radius="18"
  221. :closeable="closeable"
  222. close-icon="close-circle"
  223. close-icon-size="45"
  224. width="680rpx"
  225. height="900rpx"
  226. @close="onclose"
  227. >
  228. <view class="receipt_code">
  229. <view class="phone_title">图片凭证</view>
  230. <view class="phone_title2">请在确认外卖送达后、通过拍照,进行现场还原</view>
  231. <view>
  232. <view class="flex" style="overflow: hidden; flex-wrap: wrap">
  233. <view v-if="goodsPicture.length">
  234. <view class="margin-top flex margin-right-sm flex-wrap">
  235. <view
  236. class="flex"
  237. style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative"
  238. v-for="(image, index) in goodsPicture"
  239. :key="index"
  240. >
  241. <image :src="image" style="width: 100%; height: 100%"></image>
  242. <view style="z-index: 9; position: absolute; top: -15rpx; right: -15rpx" @click="removeImg(index, 'lb')">
  243. <u-icon name="close-circle-fill" color="#FCD202" size="50rpx"></u-icon>
  244. </view>
  245. </view>
  246. </view>
  247. </view>
  248. <view class="margin-top" @click="addImages(1)" v-if="goodsPicture.length <= 1">
  249. <view style="width: 200rpx; height: 200rpx; background: #f4f5f6" class="flex justify-center align-center">
  250. <view>
  251. <view class="text-center">
  252. <image src="../../../static/addimg.png" style="width: 65rpx; height: 55rpx"></image>
  253. </view>
  254. <view class="text-center text-black">添加图片</view>
  255. </view>
  256. </view>
  257. </view>
  258. </view>
  259. </view>
  260. <view class="receipt_code" v-if="alertduan">
  261. <view class="code_title">是否确认送达</view>
  262. <view class="code_title2">已选订单:1单</view>
  263. <view class="code_title2">通知形式:短信</view>
  264. <view class="code_title2">通知内容:{{ duanxin[0].templateContent.substring(0, 21) }}{{ qiPhone }}</view>
  265. <view class="sure" @click="querenSh">确认送达</view>
  266. </view>
  267. <!-- <view class="sure" @click="querenduanxin">确认拍照</view> -->
  268. </view>
  269. </u-popup>
  270. <!-- 确认收货选择短信框 -->
  271. <u-popup v-model="alertduan" mode="center" border-radius="18" :closeable="closeable" close-icon="close-circle" close-icon-size="45" width="680rpx" height="600rpx">
  272. <view class="receipt_code">
  273. <view class="code_title">是否确认送达</view>
  274. <view class="code_title2">已选订单:1单</view>
  275. <view class="code_title2">通知形式:短信</view>
  276. <view class="code_title2">通知内容:{{ duanxin[0].templateContent.substring(0, 21) }}{{ qiPhone }}</view>
  277. <view class="sure" @click="querenSh">确认送达</view>
  278. </view>
  279. </u-popup>
  280. <!-- 用于图片压缩的canvas画布 -->
  281. <canvas
  282. :style="{
  283. width: cw + 'px',
  284. height: cw + 'px',
  285. position: 'absolute',
  286. zIndex: -1,
  287. left: '-10000rpx',
  288. top: '-10000rpx'
  289. }"
  290. canvas-id="zipCanvas"
  291. ></canvas>
  292. <!--画布结束-->
  293. </view>
  294. </template>
  295. <script>
  296. import configdata from '@/common/config.js'
  297. import getLessLimitSizeImage from '@/utils/imageCompress.js'
  298. export default {
  299. data() {
  300. return {
  301. show: false,
  302. closeable: true,
  303. value: '',
  304. type: 'text',
  305. border: true,
  306. indentNumber: '',
  307. orderId: '',
  308. orderDelites: {},
  309. latitude: '', //骑手起点经度
  310. longitude: '', //骑手起点纬度
  311. qiJuli: '', //骑手距离
  312. shouhuoma: '',
  313. loading: true, // 是否显示骨架屏组件
  314. RiderUnreadCount: 0,
  315. indentId: '',
  316. showOrder: false,
  317. phone: '',
  318. zhuanName: '', //转单人姓名
  319. alertPhone: false, //确认收货拍照弹出框
  320. alertduan: false, //确认收货选择短信框
  321. goodsPicture: [],
  322. count: 3,
  323. duanxin: [], //发送的短信
  324. qiPhone: '', //骑手电话
  325. //画板边长默认是屏幕宽度,正方形画布
  326. cw: uni.getSystemInfoSync().windowWidth
  327. }
  328. },
  329. onLoad(options) {
  330. this.qiPhone = uni.getStorageSync('phone')
  331. var that = this
  332. console.error(options)
  333. // uni.showLoading({
  334. // title: '加载中......',
  335. // icon: 'none'
  336. // })
  337. that.indentNumber = options.id
  338. that.orderId = options.orderId
  339. uni.getLocation({
  340. type: 'wgs84',
  341. success: function (res) {
  342. console.log('当前位置的经度:' + res.longitude)
  343. console.log('当前位置的纬度:' + res.latitude)
  344. that.longitude = res.longitude
  345. that.latitude = res.latitude
  346. that.taskData()
  347. }
  348. })
  349. setInterval(function () {
  350. that.getRiderUnreadCount()
  351. }, 10000)
  352. },
  353. methods: {
  354. zhuanOrder(indentId) {
  355. this.phone = ''
  356. this.zhuanName = ''
  357. this.indentId = indentId
  358. this.showOrder = true
  359. },
  360. zhuandan() {
  361. this.$Request
  362. .postT('/app/tbindent/transferOfOrder', {
  363. indentId: this.indentId,
  364. phone: this.phone,
  365. realName: this.zhuanName
  366. })
  367. .then((res) => {
  368. if (res.code == 0) {
  369. this.phone = ''
  370. this.$queue.setData('zhuandan', this.indentId)
  371. uni.showToast({
  372. title: '转单成功',
  373. icon: 'none'
  374. })
  375. setTimeout((d) => {
  376. uni.navigateBack()
  377. }, 1000)
  378. } else {
  379. uni.showToast({
  380. title: res.msg,
  381. icon: 'none'
  382. })
  383. }
  384. })
  385. },
  386. goChat(indentId, orderId) {
  387. uni.navigateTo({
  388. url: '/pages/riderMy/kefu/liaotianshi?indentId=' + indentId + '&orderId=' + orderId
  389. })
  390. },
  391. copyOrder(value) {
  392. uni.setClipboardData({
  393. data: value, //要被复制的内容
  394. success: () => {
  395. //复制成功的回调函数
  396. uni.showToast({
  397. //提示
  398. title: '复制成功'
  399. })
  400. }
  401. })
  402. },
  403. onshow() {
  404. this.show = true
  405. },
  406. coll(phone) {
  407. uni.makePhoneCall({
  408. phoneNumber: phone
  409. })
  410. },
  411. taskData() {
  412. if (this.indentNumber) {
  413. if (!this.longitude) {
  414. uni.showModal({
  415. title: '温馨提示',
  416. content: '未开启定位权限,无法获取数据,请开启一下',
  417. showCancel: false,
  418. cancelText: '',
  419. confirmText: '我知道了',
  420. success: (res) => {
  421. uni.navigateBack({})
  422. },
  423. fail: () => {},
  424. complete: () => {}
  425. })
  426. return
  427. }
  428. this.$Request
  429. .postT('/app/tbindent/indentMessage', {
  430. indentNumber: this.indentNumber,
  431. ol: this.longitude,
  432. od: this.latitude
  433. })
  434. .then((res) => {
  435. this.loading = false
  436. uni.hideLoading()
  437. if (res.code == 0 && res.data) {
  438. // this.jsjl(this.longitude,this.latitude,res.data.deliveryAddressLatitude, res.data.deliveryAddressLongitude)
  439. // this.jsjl(res.data.shipAddressLatitude, res.data.shipAddressLongitude,res.data.deliveryAddressLatitude, res.data.deliveryAddressLongitude)
  440. // if (res.data.distanceInitial > 1000) {
  441. // res.data.distanceInitials = (Number(res.data.distanceInitial) / 1000).toFixed(2)
  442. // }
  443. if (res.data.distance > 1000) {
  444. res.data.distances = (Number(res.data.distance) / 1000).toFixed(2)
  445. }
  446. this.orderDelites = res.data
  447. this.orderDelites.orderCode = res.data.orderCode.substring(res.data.orderCode.length - 3)
  448. console.log('````', res.data)
  449. } else {
  450. console.log('失败:', res.data)
  451. uni.navigateBack({})
  452. }
  453. this.loading = false
  454. })
  455. } else {
  456. this.$Request
  457. .postT('/app/tbindent/indentMessageByOrderId', {
  458. orderId: this.orderId,
  459. ol: this.longitude,
  460. od: this.latitude
  461. })
  462. .then((res) => {
  463. this.loading = false
  464. uni.hideLoading()
  465. if (res.code == 0) {
  466. // this.jsjl(this.longitude,this.latitude,res.data.deliveryAddressLatitude, res.data.deliveryAddressLongitude)
  467. // this.jsjl(res.data.shipAddressLatitude, res.data.shipAddressLongitude,res.data.deliveryAddressLatitude, res.data.deliveryAddressLongitude)
  468. if (res.data.distanceInitial > 1000) {
  469. res.data.distanceInitials = (Number(res.data.distanceInitial) / 1000).toFixed(2)
  470. }
  471. if (res.data.distance > 1000) {
  472. res.data.distances = (Number(res.data.distance) / 1000).toFixed(2)
  473. }
  474. this.orderDelites = res.data
  475. this.orderDelites.orderCode = res.data.orderCode.substring(res.data.orderCode.length - 3)
  476. console.log('````', res.data)
  477. } else {
  478. console.log('失败:', res.data)
  479. }
  480. this.loading = false
  481. })
  482. }
  483. },
  484. quhuo(indentId) {
  485. let that = this
  486. uni.showModal({
  487. title: '提示',
  488. content: '确认取到货吗',
  489. success: function (res) {
  490. if (res.confirm) {
  491. that.$Request
  492. .postJson('/app/tbindent/riderBuyGoods', {
  493. indentId: indentId,
  494. indentState: '4'
  495. })
  496. .then((res) => {
  497. if (res.code == 0) {
  498. that.taskData()
  499. uni.showToast({
  500. title: '确认取货成功',
  501. icon: 'none'
  502. })
  503. } else {
  504. uni.showToast({
  505. title: res.msg,
  506. icon: 'none'
  507. })
  508. }
  509. })
  510. }
  511. }
  512. })
  513. },
  514. goStart() {
  515. // let obj = {
  516. // name: this.orderDelites.shopAddressDetail,
  517. // lat: this.orderDelites.shopLat,
  518. // long: this.orderDelites.shopLng,
  519. // }
  520. // this.navgate(obj)
  521. // 一键导航
  522. let latitude = this.orderDelites.shopLat
  523. let longitude = this.orderDelites.shopLng
  524. let name = this.orderDelites.shopAddressDetail
  525. uni.openLocation({
  526. latitude: latitude - 0, //要去的纬度-地址
  527. longitude: longitude - 0, //要去的经度-地址
  528. name: name, //地址名称
  529. address: name, //详细地址名称
  530. success: function () {
  531. console.log('导航成功')
  532. },
  533. fail: function (error) {
  534. console.log(error)
  535. }
  536. })
  537. },
  538. goEnd() {
  539. // let obj = {
  540. // name: this.orderDelites.userAddressDetail,
  541. // lat: this.orderDelites.userLat,
  542. // long: this.orderDelites.userLng,
  543. // }
  544. // this.navgate(obj)
  545. let latitude = this.orderDelites.userLat
  546. let longitude = this.orderDelites.userLng
  547. let name = this.orderDelites.userAddressDetail
  548. uni.openLocation({
  549. latitude: Number(latitude), //要去的纬度-地址
  550. longitude: Number(longitude), //要去的经度-地址
  551. name: name, //地址名称
  552. address: name, //详细地址名称
  553. success: function () {
  554. console.log('导航成功')
  555. },
  556. fail: function (error) {
  557. console.log(error)
  558. }
  559. })
  560. },
  561. navgate(e) {
  562. console.log(e)
  563. let plugin = requirePlugin('routePlan')
  564. let key = this.$queue.getData('mapKey') //使用在腾讯位置服务申请的key
  565. let referer = this.$queue.getData('mapName') //调用插件的app的名称
  566. let endPoint = JSON.stringify({
  567. //终点
  568. name: e.name,
  569. latitude: e.lat,
  570. longitude: e.long
  571. })
  572. wx.navigateTo({
  573. url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
  574. })
  575. },
  576. shouhuo(e) {
  577. console.log(e)
  578. this.indentNumber = e.indentNumber
  579. if (e.itemCodeFlag == 0 && e.indentType != 5) {
  580. this.show = true
  581. } else {
  582. this.orderId = e.orderId
  583. this.querenduanxin()
  584. //需拍照的弹出框
  585. this.alertduan = true
  586. // this.querenSh()
  587. }
  588. },
  589. // 图片上传
  590. addImages(e) {
  591. if (e == 1) {
  592. var num = this.goodsPicture.length
  593. this.count = 2 - num
  594. }
  595. let that = this
  596. uni.chooseImage({
  597. count: this.count,
  598. sourceType: ['camera'],
  599. success: (res) => {
  600. for (let i = 0; i < res.tempFiles.length; i++) {
  601. //这里的id和页面中写的html代码的canvas的id要一致
  602. let canvasId = 'zipCanvas'
  603. //原图的路径
  604. let imagePath = res.tempFiles[i].path
  605. //大小限制
  606. let limitSize = 1024 * 2
  607. //初始绘画区域是画布自身的宽度也就是屏幕宽度
  608. let drawWidth = uni.getSystemInfoSync().windowWidth
  609. let that = this
  610. getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
  611. uni.showLoading({
  612. title: '上传中'
  613. })
  614. uni.uploadFile({
  615. url: that.config('APIHOST1') + '/alioss/upload',
  616. filePath: resPath,
  617. name: 'file',
  618. success: (uploadFileRes) => {
  619. if (e == 1) {
  620. if (that.goodsPicture.length < 2) {
  621. that.goodsPicture.push(JSON.parse(uploadFileRes.data).data)
  622. }
  623. }
  624. uni.hideLoading()
  625. this.querenduanxin()
  626. },
  627. fail: () => {
  628. uni.showToast({
  629. title: '上传失败',
  630. icon: 'error'
  631. })
  632. }
  633. })
  634. })
  635. }
  636. }
  637. })
  638. },
  639. // 图片删除
  640. removeImg(index, texts) {
  641. if (texts == 'lb') {
  642. this.goodsPicture.splice(index, 1)
  643. }
  644. },
  645. config: function (name) {
  646. var info = null
  647. if (name) {
  648. var name2 = name.split('.') //字符分割
  649. if (name2.length > 1) {
  650. info = configdata[name2[0]][name2[1]] || null
  651. } else {
  652. info = configdata[name] || null
  653. }
  654. if (info == null) {
  655. let web_config = cache.get('web_config')
  656. if (web_config) {
  657. if (name2.length > 1) {
  658. info = web_config[name2[0]][name2[1]] || null
  659. } else {
  660. info = web_config[name] || null
  661. }
  662. }
  663. }
  664. }
  665. return info
  666. },
  667. // 监听拍照框关闭
  668. onclose() {
  669. console.log('关闭')
  670. this.alertPhone = false
  671. this.alertduan = false
  672. this.goodsPicture = []
  673. },
  674. // 获取确认送达短信模板
  675. querenduanxin() {
  676. // this.$Request.postT('/app/tb-indent-sms/template', {
  677. this.$Request
  678. .getT('/app/tb-indent-sms/template', {
  679. // indentNumber: this.indentNumber,
  680. // itemCode: this.shouhuoma
  681. })
  682. .then((res) => {
  683. console.log(res)
  684. this.duanxin = res.data.list
  685. if (res.code == 0) {
  686. this.page = 1
  687. // this.alertPhone = false
  688. this.alertduan = true
  689. } else {
  690. uni.showToast({
  691. title: res.msg,
  692. icon: 'none'
  693. })
  694. }
  695. })
  696. },
  697. querenSh() {
  698. var tupian = this.goodsPicture.toString()
  699. let that = this
  700. that.$Request
  701. .postJson('/app/tbindent/riderDelivery', {
  702. imgs: tupian,
  703. smsTemplateId: this.duanxin[0].id,
  704. indentNumber: that.indentNumber
  705. // itemCode: that.shouhuoma
  706. })
  707. .then((res) => {
  708. console.log(res)
  709. if (res.code == 0) {
  710. this.alertPhone = false
  711. // this.alertduan = false
  712. this.shows = false
  713. uni.showToast({
  714. title: '订单完成',
  715. icon: 'none'
  716. })
  717. setTimeout(function () {
  718. uni.navigateBack()
  719. }, 1000)
  720. } else {
  721. uni.showToast({
  722. title: res.msg,
  723. icon: 'none'
  724. })
  725. }
  726. })
  727. },
  728. getRiderUnreadCount() {
  729. let that = this
  730. let data = {
  731. ordersId: that.orderId
  732. }
  733. that.$Request.getT('/app/ordersChat/selectRiderUnreadCount', data).then((res) => {
  734. if (res.code == 0) {
  735. if (res.data > 0) {
  736. if (that.RiderUnreadCount != res.data) {
  737. that.RiderUnreadCount = res.data
  738. that.aplayAudio()
  739. uni.showModal({
  740. title: '消息',
  741. content: '有' + res.data + '条消息,请前往聊天列表处理。',
  742. success: (ret) => {
  743. if (ret.confirm) {
  744. uni.navigateTo({
  745. url: '/pages/riderMy/kefu/liaotian'
  746. })
  747. } else {
  748. console.log('else', ret)
  749. that.defineCallBack()
  750. }
  751. }
  752. })
  753. }
  754. }
  755. }
  756. })
  757. },
  758. //消息提示
  759. aplayAudio() {
  760. // console.log('语音提示')
  761. const innerAudioContext = uni.createInnerAudioContext()
  762. innerAudioContext.autoplay = true
  763. innerAudioContext.src = 'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3'
  764. innerAudioContext.onPlay(() => {
  765. console.log('开始播放')
  766. })
  767. innerAudioContext.onError((res) => {
  768. console.log(res.errMsg)
  769. console.log(res.errCode)
  770. })
  771. }
  772. }
  773. }
  774. </script>
  775. <style>
  776. body {
  777. background: #f5f5f5;
  778. }
  779. .content {
  780. width: 100%;
  781. margin-bottom: 159rpx;
  782. }
  783. .part_one {
  784. width: 90%;
  785. margin: 0 auto;
  786. height: 120rpx;
  787. background: #ffffff;
  788. margin-top: 20rpx;
  789. border-radius: 23rpx;
  790. padding-top: 10rpx;
  791. }
  792. .pickup {
  793. width: 90%;
  794. margin: 0 auto;
  795. font-size: 29rpx;
  796. font-weight: bold;
  797. letter-spacing: 2rpx;
  798. line-height: 60rpx;
  799. }
  800. .pickup_tit {
  801. color: #999999;
  802. font-size: 22rpx;
  803. width: 90%;
  804. margin: 0 auto;
  805. }
  806. .quhuoma {
  807. font-size: 50rpx;
  808. text-align: center;
  809. font-weight: 600;
  810. margin: 50rpx 0;
  811. height: 100rpx;
  812. }
  813. .list_box1 {
  814. width: 90%;
  815. margin: 0 auto;
  816. /* height: 320rpx; */
  817. background: #ffffff;
  818. border-radius: 23rpx;
  819. /* box-shadow: 0rpx 5rpx 5rpx 0rpx rgba(198, 186, 181, 0.20); */
  820. margin-top: 20rpx;
  821. }
  822. .part2 {
  823. width: 90%;
  824. margin: 0 auto;
  825. padding-top: 25rpx;
  826. }
  827. .box_add {
  828. display: flex;
  829. }
  830. .distance {
  831. flex: 1;
  832. text-align: center;
  833. font-size: 28rpx;
  834. }
  835. .a {
  836. font-size: 16rpx;
  837. }
  838. .add_name {
  839. flex: 8;
  840. position: relative;
  841. }
  842. .buy {
  843. /* position: absolute;
  844. top: 0rpx; */
  845. }
  846. .buy image {
  847. width: 20px;
  848. height: 20px;
  849. }
  850. .send {
  851. /* position: absolute;
  852. top: 0rpx; */
  853. }
  854. .send image {
  855. width: 20px;
  856. height: 20px;
  857. }
  858. .sh_name {
  859. font-size: 30rpx;
  860. font-weight: bold;
  861. letter-spacing: 2rpx;
  862. margin-left: 10px;
  863. }
  864. .xs_add {
  865. color: #999999;
  866. font-size: 24rpx;
  867. margin-top: 10rpx;
  868. margin-left: 30px;
  869. }
  870. .jiantou {
  871. margin-left: 23rpx;
  872. }
  873. .jiantou image {
  874. width: 20rpx;
  875. height: 40rpx;
  876. }
  877. .part3 {
  878. width: 90%;
  879. margin: 0 auto;
  880. display: flex;
  881. }
  882. .three_left {
  883. flex: 1;
  884. height: 100rpx;
  885. display: flex;
  886. justify-content: left;
  887. align-items: center;
  888. }
  889. .three_left image {
  890. width: 36rpx;
  891. height: 37rpx;
  892. }
  893. .box_two1 {
  894. background: #c4e2ff;
  895. color: #359cff;
  896. /* width: 60px; */
  897. padding: 0 5px;
  898. height: 45rpx;
  899. font-size: 22rpx;
  900. text-align: center;
  901. line-height: 45rpx;
  902. border-radius: 5rpx;
  903. margin-top: 20rpx;
  904. margin-left: 10rpx;
  905. }
  906. .three_left text {
  907. color: #333333;
  908. font-size: 25rpx;
  909. margin-left: 10rpx;
  910. }
  911. .three_right {
  912. flex: 1;
  913. height: 100rpx;
  914. display: flex;
  915. justify-content: flex-end;
  916. align-items: center;
  917. color: #ff412d;
  918. font-size: 32rpx;
  919. font-weight: bold;
  920. }
  921. /* tip */
  922. .tip_box {
  923. width: 90%;
  924. margin: 0 auto;
  925. height: 180rpx;
  926. background: #ffffff;
  927. margin-top: 20rpx;
  928. border-radius: 22rpx;
  929. }
  930. .tip_part1 {
  931. display: flex;
  932. }
  933. .tip_title {
  934. /* flex: 1; */
  935. height: 80rpx;
  936. display: flex;
  937. justify-content: left;
  938. align-items: center;
  939. font-size: 32rpx;
  940. font-weight: bold;
  941. margin-left: 30rpx;
  942. }
  943. .tip_rider {
  944. flex: 1;
  945. font-size: 20rpx;
  946. display: flex;
  947. justify-content: flex-end;
  948. align-items: center;
  949. margin-left: 30rpx;
  950. }
  951. .tip_rider text {
  952. font-size: 30rpx;
  953. }
  954. .tip_content {
  955. width: 90%;
  956. margin: 0 auto;
  957. font-size: 27rpx;
  958. font-weight: bold;
  959. letter-spacing: 2rpx;
  960. margin-top: 15rpx;
  961. }
  962. .u-line {
  963. border-bottom-width: 3px !important;
  964. }
  965. /* 订单信息 */
  966. .order_box {
  967. width: 90%;
  968. margin: 0 auto;
  969. /* height: 300rpx; */
  970. background: #ffffff;
  971. margin-top: 20rpx;
  972. border-radius: 22rpx;
  973. }
  974. .order_title {
  975. width: 90%;
  976. margin: 0 auto;
  977. font-size: 32rpx;
  978. font-weight: 600;
  979. line-height: 67rpx;
  980. letter-spacing: 3rpx;
  981. }
  982. .order_list {
  983. display: flex;
  984. }
  985. .order_name {
  986. flex: 1;
  987. margin-left: 35rpx;
  988. color: #999999;
  989. font-size: 25rpx;
  990. height: 75rpx;
  991. display: flex;
  992. justify-content: left;
  993. align-items: center;
  994. }
  995. .order_numbers {
  996. flex: 1;
  997. color: #333333;
  998. display: flex;
  999. justify-content: flex-end;
  1000. align-items: center;
  1001. font-size: 26rpx;
  1002. margin-right: 35rpx;
  1003. }
  1004. /* 费用明细 */
  1005. .income_name {
  1006. flex: 1;
  1007. margin-left: 35rpx;
  1008. color: #999999;
  1009. font-size: 26rpx;
  1010. height: 75rpx;
  1011. display: flex;
  1012. justify-content: left;
  1013. align-items: center;
  1014. }
  1015. .income_numbers {
  1016. flex: 1;
  1017. color: #333333;
  1018. display: flex;
  1019. justify-content: flex-end;
  1020. align-items: center;
  1021. font-size: 26rpx;
  1022. margin-right: 35rpx;
  1023. }
  1024. .income_numbers1 {
  1025. flex: 1;
  1026. color: #ff2400;
  1027. display: flex;
  1028. justify-content: flex-end;
  1029. align-items: center;
  1030. font-size: 26rpx;
  1031. margin-right: 35rpx;
  1032. }
  1033. /* 接单按钮 */
  1034. .tabbar_btn {
  1035. position: fixed;
  1036. bottom: 0rpx;
  1037. left: 0rpx;
  1038. right: 0rpx;
  1039. width: 100%;
  1040. height: 120rpx;
  1041. background: #ffffff;
  1042. display: flex;
  1043. justify-content: center;
  1044. align-items: center;
  1045. }
  1046. .btn_left {
  1047. flex: 1;
  1048. height: 80rpx;
  1049. color: white;
  1050. background: #33d442;
  1051. text-align: center;
  1052. line-height: 80rpx;
  1053. border-radius: 16rpx;
  1054. margin-left: 35rpx;
  1055. margin-right: 20rpx;
  1056. font-size: 26rpx;
  1057. letter-spacing: 3rpx;
  1058. }
  1059. .btn_right {
  1060. flex: 1;
  1061. height: 80rpx;
  1062. color: white;
  1063. background: #ff7f00;
  1064. text-align: center;
  1065. line-height: 80rpx;
  1066. border-radius: 16rpx;
  1067. margin-left: 20rpx;
  1068. margin-right: 35rpx;
  1069. font-size: 26rpx;
  1070. letter-spacing: 3rpx;
  1071. }
  1072. /* 收货码弹框 */
  1073. .receipt_code {
  1074. width: 90%;
  1075. margin: 0 auto;
  1076. }
  1077. .code_title {
  1078. width: 100%;
  1079. line-height: 100rpx;
  1080. font-size: 31rpx;
  1081. font-weight: bold;
  1082. text-align: center;
  1083. letter-spacing: 2rpx;
  1084. margin-top: 21rpx;
  1085. margin-bottom: 25rpx;
  1086. }
  1087. .u-input--border {
  1088. border: 1px solid #f2f2f2 !important;
  1089. background: #f2f2f2 !important;
  1090. color: #999999 !important;
  1091. font-weight: 500 !important;
  1092. letter-spacing: 2rpx !important;
  1093. }
  1094. .u-input__input {
  1095. font-size: 30rpx;
  1096. font-weight: bold;
  1097. flex: 1;
  1098. color: #999999 !important;
  1099. min-height: 85rpx !important;
  1100. margin-top: 7rpx;
  1101. }
  1102. .sure {
  1103. width: 100%;
  1104. height: 80rpx;
  1105. background: #ff7f00;
  1106. color: white;
  1107. border-radius: 46rpx;
  1108. text-align: center;
  1109. line-height: 80rpx;
  1110. margin-top: 30rpx;
  1111. letter-spacing: 2rpx;
  1112. }
  1113. .shopxiaoix {
  1114. background: red;
  1115. color: #ffffff;
  1116. width: 40rpx;
  1117. height: auto;
  1118. text-align: center;
  1119. border-radius: 30rpx;
  1120. position: relative;
  1121. top: -66px;
  1122. left: 35px;
  1123. }
  1124. /* 确认送达拍照框 */
  1125. .phone_title {
  1126. margin-top: 10px;
  1127. width: 100%;
  1128. height: 40px;
  1129. /* background-color: #FF7F00; */
  1130. text-align: center;
  1131. line-height: 40px;
  1132. /* color:#FFFFFF; */
  1133. }
  1134. .phone_title2 {
  1135. margin-top: 10px;
  1136. text-align: center;
  1137. color: #9d9d9d;
  1138. }
  1139. .code_title2 {
  1140. width: 100%;
  1141. line-height: 50rpx;
  1142. text-align: center;
  1143. letter-spacing: 2rpx;
  1144. margin-top: 21rpx;
  1145. margin-bottom: 25rpx;
  1146. }
  1147. </style>