orderdetail.vue 32 KB

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