orderdetail.vue 31 KB

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