orderdetail.vue 32 KB

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