orderdetail.vue 31 KB

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