orderdetail.vue 31 KB

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