orderDet.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. <template>
  2. <view class="pages">
  3. <!-- 余额 -->
  4. <view class="tosend">
  5. <view class="tosend_text" v-if="dataDet.status == 3 && dataDet.indentState == 2">待骑手接单</view>
  6. <view class="tosend_text" v-if="dataDet.status == 6 && dataDet.indentState == 2">制作中...</view>
  7. <view class="tosend_text" v-if="(dataDet.status == 3 || dataDet.status == 6) && dataDet.indentState == 3">骑手已接单</view>
  8. <view class="tosend_text" v-if="(dataDet.status == 3 || dataDet.status == 6) && dataDet.indentState == 4">骑手配送中</view>
  9. <view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 1">待取餐</view>
  10. <view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 2 && dataDet.riderUserId">配送中</view>
  11. <view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 2 && dataDet.riderUserId == null">待配送</view>
  12. <view class="tosend_text" v-if="dataDet.status == 4">已完成</view>
  13. <view class="tosend_text" v-if="dataDet.status == 5">已取消</view>
  14. <view class="tosend_text" v-if="dataDet.status == 8">已退款</view>
  15. <view class="tosend_text" v-if="dataDet.status == 7">待接单</view>
  16. <!-- <view class="btnCm" v-if="item.riderUserId">配送中</view>
  17. <view class="btnCm" v-else>待派送</view> -->
  18. <view style="padding: 0 30rpx; font-size: 20px" v-if="dataDet.orderSequence">#{{ dataDet.orderSequence }}</view>
  19. <view class="tosend_cont" style="position: relative; margin-top: 20upx" v-if="dataDet.orderType == 2">
  20. <image src="../../static/images/order/dizhi.png" style="position: absolute; width: 32rpx; height: 40rpx; top: 50rpx; left: 32rpx"></image>
  21. <view class="tosend_header_text" style="margin-left: 64rpx" @tap="bindGps(dataDet.address.lat, dataDet.address.lng, dataDet.address.addressDetail)">
  22. {{ dataDet.address.province }}{{ dataDet.address.city }}{{ dataDet.address.district }}{{ dataDet.address.addressDetail }}
  23. </view>
  24. <view class="tosend_cont_infor" style="margin-top: 0; margin-left: 64rpx">
  25. <view class="tosend_cont_infor_le" @click="bindphone(dataDet.address.userPhone)">
  26. {{ dataDet.address.userName }}&nbsp;&nbsp;{{ dataDet.address.userPhone }}
  27. </view>
  28. <!-- <view class="tosend_cont_infor_ri">{{dataDet.orderCode}}</view> -->
  29. </view>
  30. </view>
  31. <view class="tosend_header" style="margin-top: 20upx">
  32. <!-- 排序 -->
  33. <view class="cont_two_top">
  34. <view class="cont_two_top_le" v-if="dataDet.status == 3">取餐号码</view>
  35. <!-- <view class="cont_two_top_ri" v-if="dataDet.status == 6">制作中</view> -->
  36. </view>
  37. <view v-if="dataDet.status == 3 && dataDet.orderType == 1" class="cont_two_text">{{ dataDet.orderCode }}</view>
  38. <view v-if="dataDet.status == 3 && dataDet.orderType == 1" class="cont_two_text2">
  39. 前面还有
  40. <text>{{ dataDet.countOrder ? dataDet.countOrder : 0 }}</text>
  41. 个人排队
  42. </view>
  43. <view v-if="dataDet.status != 3">
  44. <view class="flex justify-between">
  45. <view>取餐号码</view>
  46. <!-- <view class="cont_two_top_ri">制作中</view> -->
  47. </view>
  48. <view style="font-size: 58upx" class="text-center text-bold padding-tb">{{ dataDet.orderCode }}</view>
  49. </view>
  50. <!-- 商品列表 -->
  51. <view class="tosend_header_food" v-for="(item, index) in dataDet.orderGoodsList" :key="index">
  52. <view class="tosend_header_food_le">
  53. <image :src="item.goodsPicture" alt="加载失败" style="border-radius: 10rpx"></image>
  54. </view>
  55. <view class="tosend_header_food_ce justify-between">
  56. <view class="tosend_header_food_text">{{ item.goodsName }}</view>
  57. <view class="tosend_header_food_text2" v-if="item.skuMessage">{{ item.skuMessage }}</view>
  58. <view class="tosend_header_food_text2">打包费</view>
  59. </view>
  60. <view class="tosend_header_food_ri">
  61. <view class="tosend_header_food_text">
  62. <text>¥</text>
  63. {{ item.goodsPrice }}
  64. </view>
  65. <view class="tosend_header_food_text2">×{{ item.goodsNum }}</view>
  66. <view class="tosend_header_food_text2">
  67. <text>¥</text>
  68. {{ item.goodsPack }}/份
  69. </view>
  70. </view>
  71. </view>
  72. <view
  73. class="tosend_header_do do_bot"
  74. v-if="dataDet.errandMoney > 0 && dataDet.orderType == 2 && dataDet.errandMoneyIsShop == '本单未达到商家满减金额,跑腿费由用户承担'"
  75. >
  76. <view>跑腿费</view>
  77. <view class="tosend_header_do_ri">¥{{ dataDet.errandMoney }}</view>
  78. </view>
  79. <view
  80. class="tosend_header_do do_bot"
  81. v-if="dataDet.errandMoney > 0 && dataDet.orderType == 2 && dataDet.errandMoneyIsShop == '商家未开启配送费满减,跑腿费由用户承担'"
  82. >
  83. <view>跑腿费</view>
  84. <view class="tosend_header_do_ri">¥{{ dataDet.errandMoney }}</view>
  85. </view>
  86. <view class="tosend_header_do do_bot" v-if="dataDet.insideDeliveryFee && dataDet.orderType == 2">
  87. <view>特殊地址跑腿费</view>
  88. <view class="tosend_header_do_ri">¥{{ dataDet.insideDeliveryFee }}</view>
  89. </view>
  90. <!-- <view class="tosend_header_do" v-if="dataDet.packMoney>0&& dataDet.orderType == 2">
  91. <view>打包费</view>
  92. <view class="tosend_header_do_ri">¥{{dataDet.packMoney}}</view>
  93. </view> -->
  94. <view class="tosend_header_do do_bot" v-if="dataDet.couponMoney > 0">
  95. <view>优惠券</view>
  96. <view class="tosend_header_do_ri">-¥{{ dataDet.couponMoney }}</view>
  97. </view>
  98. <view class="tosend_header_do margin-top">
  99. <view class="tosend_header_do_le2">实付</view>
  100. <view class="tosend_header_do_ri2">
  101. <text>¥</text>
  102. {{ dataDet.payMoney }}
  103. </view>
  104. </view>
  105. </view>
  106. <!-- #ifdef APP -->
  107. <map
  108. v-if="dataDet.riderUserId != null && latitude && longitude && dataDet.status == 3"
  109. id="map"
  110. @tap="goMap"
  111. style="width: 95%; height: 300rpx; margin-top: 20rpx; margin-left: 20rpx"
  112. :markers="markers"
  113. :latitude="latitude"
  114. :longitude="longitude"
  115. ></map>
  116. <!-- #endif -->
  117. <!-- #ifndef APP -->
  118. <map
  119. v-if="dataDet.riderUserId != null && latitude && longitude && dataDet.status == 3"
  120. id="map"
  121. @tap="goMap"
  122. style="width: 95%; height: 300rpx; margin: 20rpx auto 0"
  123. :markers="markers"
  124. :latitude="latitude"
  125. :longitude="longitude"
  126. ></map>
  127. <!-- #endif -->
  128. <!-- 联系骑手 -->
  129. <view class="rider_box" v-if="dataDet.riderUserId != null">
  130. <view class="flex justify-between align-center padding">
  131. <view style="font-size: 31rpx; color: black">联系骑手...</view>
  132. <image @click="gotousu()" src="../../static/images/my/tousu.png" style="width: 43rpx; height: 39rpx" mode=""></image>
  133. </view>
  134. <view>
  135. <u-line color="#F2F2F2" />
  136. </view>
  137. <view style="padding: 20rpx 25rpx; display: flex; justify-content: space-between; align-items: center">
  138. <view style="display: flex">
  139. <view class="rider_left">
  140. <image :src="dataDet.riderAvatar"></image>
  141. </view>
  142. <view style="margin-left: 10rpx; color: #333333">
  143. <view>{{ dataDet.riderUserName }}</view>
  144. <view>{{ riderPhone }}</view>
  145. </view>
  146. </view>
  147. <view class="phone" @click="bindphone(dataDet.riderPhone)">联系TA</view>
  148. </view>
  149. </view>
  150. <!-- 评论信息 -->
  151. <view class="tosend_cont" v-if="dataDet.evaluateMessage">
  152. <view class="tosend_header_text">评论信息</view>
  153. <view>
  154. <view class="flex align-center">
  155. <image :src="dataDet.avatar ? dataDet.avatar : '../../static/logo.png'" style="width: 40px; height: 40px; border-radius: 50%"></image>
  156. <view class="flex justify-between align-center" style="width: 100%; margin-left: 5upx">
  157. <view class="text-bold text-df">{{ dataDet.userNickName }}</view>
  158. <view style="color: #999999; font-size: 24rpx" v-if="dataDet.ecreateTime">
  159. {{ dataDet.ecreateTime }}
  160. </view>
  161. </view>
  162. </view>
  163. <view class="padding-left margin-left-xl" style="font-size: 30upx">{{ dataDet.evaluateMessage }}</view>
  164. <view class="flex justify-end padding-top-sm margin-right" @click="show = true" v-if="!dataDet.shopReplyMessage">
  165. <image src="../../static/images/order/pinglun.png" style="width: 20px; height: 20px"></image>
  166. </view>
  167. <view class="padding-left margin-left-xl margin-top-sm" v-else>
  168. <view class="flex align-center">
  169. <view class="flex align-center text-df" style="color: #999999">
  170. <view class="text-df">商家回复:</view>
  171. {{ dataDet.shopReplyMessage }}
  172. </view>
  173. </view>
  174. <!-- <view class="text-lg padding-left margin-left-xl">{{dataDet.shopReplyMessage}}</view> -->
  175. </view>
  176. </view>
  177. </view>
  178. <!-- 其他信息 -->
  179. <view class="tosend_cont">
  180. <view class="tosend_header_text">其他信息</view>
  181. <view class="tosend_cont_infor" v-if="dataDet.remark">
  182. <view class="tosend_cont_infor_le">订单备注</view>
  183. <view class="tosend_cont_infor_ri">{{ dataDet.remark }}</view>
  184. </view>
  185. <view class="tosend_cont_infor">
  186. <view class="tosend_cont_infor_le">取餐号码</view>
  187. <view class="tosend_cont_infor_ri">{{ dataDet.orderCode }}</view>
  188. </view>
  189. <view class="tosend_cont_infor" v-if="dataDet.phone" @tap="call(dataDet.address.userPhone)">
  190. <view class="tosend_cont_infor_le">取餐电话</view>
  191. <image src="../../static/images/my/phone.png" style="width: 40upx; height: 40upx"></image>
  192. <!-- <view class="tosend_cont_infor_ri">{{dataDet.phone}}</view> -->
  193. </view>
  194. <view class="tosend_cont_infor">
  195. <view class="tosend_cont_infor_le">下单时间</view>
  196. <view class="tosend_cont_infor_ri">{{ dataDet.payTime }}</view>
  197. </view>
  198. <view class="flex justify-between align-center" style="margin-top: 3%">
  199. <view class="tosend_cont_infor_le">订单编号</view>
  200. <view class="tosend_cont_infor_ri">{{ dataDet.orderNumber }}</view>
  201. <view class="text-orange margin-left-lg" @click="copy(dataDet.orderNumber)">复制</view>
  202. </view>
  203. <view class="tosend_cont_infor">
  204. <view class="tosend_cont_infor_le">支付方式</view>
  205. <view class="tosend_cont_infor_ri" v-if="dataDet.payType == 1">微信支付</view>
  206. <view class="tosend_cont_infor_ri" v-if="dataDet.payType == 2">余额支付</view>
  207. </view>
  208. <view class="tosend_cont_infor" v-if="dataDet.orderType == 2 && dataDet.receivingTime">
  209. <view class="tosend_cont_infor_le">骑手取餐时间</view>
  210. <view class="tosend_cont_infor_ri">{{ dataDet.receivingTime }}</view>
  211. </view>
  212. <view class="tosend_cont_infor padding-bottom-sm" v-if="dataDet.finishTime">
  213. <view class="tosend_cont_infor_le">订单送达时间</view>
  214. <view class="tosend_cont_infor_ri">{{ dataDet.finishTime }}</view>
  215. </view>
  216. </view>
  217. <view class="addgood" @click="refund()" v-if="dataDet.status == 6">退款</view>
  218. <view class="addgood" @click="finish()" v-if="dataDet.status == 6">制作完成</view>
  219. <view class="addgood" @click.stop="xiaoPiao()" v-if="dataDet.status == 6 || dataDet.status == 3 || dataDet.status == 4">补打小票</view>
  220. <view class="addgood" @click="refund()" v-if="dataDet.status == 3 && dataDet.orderType == 2">退款</view>
  221. <view class="addgood" @click="peisong()" v-if="dataDet.status == 3 && dataDet.orderType == 1">制作已完成</view>
  222. <view class="addgood" v-if="dataDet.status == 3 && dataDet.orderType == 2 && dataDet.autoSendOrder == 1" @click.stop="succOrder(dataDet)">完成送达</view>
  223. <!-- <view class="addgood" @click="peisong()" v-if="dataDet.status == 3&&dataDet.orderType==2">餐品已完成,等待配送</view> -->
  224. <!-- 聊天室 -->
  225. <view class="chats" @click.stop="chat(dataDet)">
  226. <image src="../../static/images/img/chats.png"></image>
  227. <view class="shopxiaoix" v-if="ShopUnreadCount">{{ ShopUnreadCount }}</view>
  228. </view>
  229. </view>
  230. <!-- 评论弹框 -->
  231. <u-popup v-model="show" mode="bottom" border-radius="14" :closeable="closeable">
  232. <view>
  233. <view class="margin padding-tb">
  234. <u-input v-model="pinglun" type="textarea" height="200" placeholder="请填写回复的内容" maxlengt="200" :clearable="false" style="background: #f5f5f5" />
  235. </view>
  236. <view class="btn" @click="bindEvaluate()">提交</view>
  237. </view>
  238. </u-popup>
  239. </view>
  240. </template>
  241. <script>
  242. export default {
  243. data() {
  244. return {
  245. orderNumber: '',
  246. dataDet: {},
  247. orderType: '',
  248. latitude: '',
  249. longitude: '',
  250. markers: [], //标记点
  251. orderId: '',
  252. address: {},
  253. riderPhone: '',
  254. ShopUnreadCount: 0,
  255. pinglun: '',
  256. show: false,
  257. closeable: true,
  258. first: false
  259. }
  260. },
  261. onLoad(option) {
  262. uni.showLoading({
  263. title: '加载中...',
  264. mask: true // 是否显示透明蒙层,防止触摸穿透
  265. })
  266. console.log(option, 'kl')
  267. this.orderNumber = option.orderNumber
  268. this.orderId = option.orderId
  269. this.first = false
  270. this.getDataDet()
  271. let that = this
  272. setInterval(function () {
  273. that.getShopUnreadCount()
  274. }, 10000)
  275. },
  276. onShow() {
  277. this.first = false
  278. },
  279. methods: {
  280. //评论
  281. bindEvaluate() {
  282. let data = {
  283. shopReplyMessage: this.pinglun,
  284. orderNumber: this.orderNumber
  285. }
  286. this.$Request.postT('/admin/order/shopReplyEvaluate', data).then((res) => {
  287. uni.hideLoading()
  288. if (res.code == 0) {
  289. this.show = false
  290. this.getDataDet()
  291. }
  292. })
  293. },
  294. goMap() {
  295. uni.navigateTo({
  296. url: '/pages/order/orderMap?indentNumber=' + this.orderNumber + '&orderId=' + this.orderId
  297. })
  298. },
  299. //投诉
  300. gotousu() {
  301. console.log(this.orderNumber)
  302. uni.navigateTo({
  303. url: '/pages/my/comments?indentNumber=' + this.orderNumber
  304. })
  305. },
  306. // 拨打电话
  307. bindphone(e) {
  308. uni.makePhoneCall({
  309. phoneNumber: e
  310. })
  311. },
  312. // 一键导航
  313. bindGps(latitude, longitude, name, detailsadd) {
  314. console.log(latitude, longitude, name, detailsadd)
  315. uni.openLocation({
  316. latitude: latitude - 0, //要去的纬度-地址
  317. longitude: longitude - 0, //要去的经度-地址
  318. name: name, //地址名称
  319. address: detailsadd, //详细地址名称
  320. success: function () {
  321. console.log('导航成功')
  322. },
  323. fail: function (error) {
  324. console.log(error)
  325. }
  326. })
  327. },
  328. //聊天室
  329. chat(e) {
  330. // console.log(e)
  331. uni.navigateTo({
  332. url: '/pages/my/im?orderId=' + e.orderId
  333. })
  334. },
  335. //获取骑手位置
  336. getaddress(addressId, riderUserId) {
  337. console.log(addressId)
  338. let data = {
  339. addressId: addressId
  340. }
  341. this.$Request.getA('/app/address/selectAddressById', data).then((res) => {
  342. // uni.hideLoading()
  343. console.log(res)
  344. if (res.code == 0) {
  345. // this.address = res.data
  346. this.getRider(res.data.lat, res.data.lng, riderUserId)
  347. }
  348. })
  349. },
  350. //获取骑手信息
  351. getRider(lat, lng, riderUserId) {
  352. console.log(lat, lng, riderUserId, '111111')
  353. let data = {
  354. lat: lat,
  355. lng: lng,
  356. riderUserId: riderUserId
  357. }
  358. this.$Request.getA('/timedtask/selectRiderLocation', data).then((res) => {
  359. if (res.code == 0) {
  360. console.log(res.data, '经纬度')
  361. this.latitude = res.data.riderLocation.lat
  362. this.longitude = res.data.riderLocation.lng
  363. this.markers = [
  364. {
  365. id: 1,
  366. latitude: res.data.riderLocation.lat,
  367. longitude: res.data.riderLocation.lng,
  368. iconPath: '../../static/images/order/rider.png',
  369. width: '40',
  370. height: '40'
  371. }
  372. ]
  373. uni.hideLoading()
  374. }
  375. })
  376. },
  377. getDataDet() {
  378. let data = {
  379. // page: 1,
  380. // limit: 10,
  381. orderId: this.orderId
  382. }
  383. this.$Request.getA('/app/order/selectOrderById', data).then((res) => {
  384. // console.log(res, 963258)
  385. uni.hideLoading()
  386. if (res.code == 0) {
  387. this.dataDet = res.data
  388. let start = res.data.orderCode.length - 3
  389. this.dataDet.orderCode = res.data.orderCode.substring(start, res.data.orderCode.length)
  390. this.getaddress(res.data.addressId, res.data.riderUserId)
  391. this.dataDet.orderGoodsList.forEach((res) => {
  392. res.goodsPicture = res.goodsPicture.split(',')
  393. })
  394. this.dataDet.address = JSON.parse(this.dataDet.address)
  395. this.riderPhone = this.dataDet.riderPhone
  396. if (this.dataDet.riderPhone) {
  397. this.riderPhone = this.riderPhone.replace(this.dataDet.riderPhone.substr(3, 4), '****')
  398. }
  399. this.orderType = res.data.orderType
  400. console.log(this.dataDet, '2222222')
  401. }
  402. })
  403. },
  404. copy(value) {
  405. uni.setClipboardData({
  406. data: value, //要被复制的内容
  407. success: () => {
  408. //复制成功的回调函数
  409. uni.showToast({
  410. //提示
  411. title: '复制成功'
  412. })
  413. }
  414. })
  415. },
  416. // 打电话
  417. call(phone) {
  418. uni.makePhoneCall({
  419. phoneNumber: phone
  420. })
  421. },
  422. // 打开地图
  423. openMap(e) {
  424. let latitude = e.latitude
  425. let longitude = e.longitude
  426. uni.openLocation({
  427. latitude: Number(latitude),
  428. longitude: Number(longitude),
  429. name: e.address,
  430. success: function () {
  431. console.log('success')
  432. }
  433. })
  434. },
  435. // 完成送达
  436. succOrder(e) {
  437. let that = this
  438. uni.showModal({
  439. title: '提示',
  440. content: '确认完成送达吗?',
  441. success: function (res) {
  442. if (res.confirm) {
  443. console.log('用户点击确定')
  444. let data = {
  445. orderId: e.orderId,
  446. sendSmsFlag: 0
  447. // orderNumber: e.orderNumber,
  448. // shopId: that.shopId,
  449. // addressId: e.addressId,
  450. // status: 3
  451. }
  452. that.$Request.postT('/admin/order/accomplishOrder', data).then((res) => {
  453. if (res.code == 0) {
  454. uni.navigateBack()
  455. }
  456. })
  457. } else if (res.cancel) {
  458. console.log('用户点击取消')
  459. }
  460. }
  461. })
  462. },
  463. refund() {
  464. let that = this
  465. uni.showModal({
  466. title: '提示',
  467. content: '确认退款吗?',
  468. success: function (res) {
  469. if (res.confirm) {
  470. console.log('用户点击确定')
  471. let data = {
  472. orderId: that.dataDet.orderId
  473. }
  474. that.$Request.postA('/admin/order/adminCancelOrder', data).then((res) => {
  475. if (res.code == 0) {
  476. let pages = getCurrentPages() // 当前页面
  477. let beforePage = pages[pages.length - 2] // 上一页
  478. uni.navigateBack({
  479. success: function () {
  480. beforePage.onLoad() // 执行上一页的onLoad方法
  481. }
  482. })
  483. }
  484. })
  485. } else if (res.cancel) {
  486. console.log('用户点击取消')
  487. }
  488. }
  489. })
  490. },
  491. // 补打小票
  492. xiaoPiao() {
  493. let that = this
  494. uni.showModal({
  495. title: '提示',
  496. content: '确认补打小票吗?',
  497. success: function (re) {
  498. if (re.confirm) {
  499. console.log('用户点击确定')
  500. let data = {
  501. orderId: that.dataDet.orderId,
  502. isAppend: 1
  503. // orderNumber: e.orderNumber,
  504. // status: 8
  505. }
  506. that.$Request.post('/admin/order/print', data).then((res) => {
  507. if (res.code == 0) {
  508. // that.page = 1
  509. // that.getOrderList()
  510. } else {
  511. that.$queue.showToast(res.msg)
  512. }
  513. })
  514. } else if (re.cancel) {
  515. console.log('用户点击取消')
  516. }
  517. }
  518. })
  519. },
  520. finish(e) {
  521. let that = this
  522. uni.showModal({
  523. title: '提示',
  524. content: '确认订单完成吗?',
  525. success: function (res) {
  526. if (res.confirm) {
  527. console.log('用户点击确定')
  528. let data = {
  529. orderId: that.dataDet.orderId,
  530. orderNumber: that.dataDet.orderNumber,
  531. status: 3
  532. }
  533. that.$Request.postJsonA('/admin/order/updateOrder', data).then((res) => {
  534. if (res.code == 0) {
  535. let pages = getCurrentPages() // 当前页面
  536. let beforePage = pages[pages.length - 2] // 上一页
  537. uni.navigateBack({
  538. success: function () {
  539. beforePage.onLoad() // 执行上一页的onLoad方法
  540. }
  541. })
  542. }
  543. })
  544. } else if (res.cancel) {
  545. console.log('用户点击取消')
  546. }
  547. }
  548. })
  549. },
  550. peisong(e) {
  551. let that = this
  552. uni.showModal({
  553. title: '提示',
  554. content: '确认开始配送吗?',
  555. success: function (res) {
  556. if (res.confirm) {
  557. console.log('用户点击确定')
  558. let data = {
  559. orderId: that.dataDet.orderId,
  560. orderNumber: that.dataDet.orderNumber,
  561. status: 4
  562. }
  563. that.$Request.postJsonA('/admin/order/updateOrder', data).then((res) => {
  564. if (res.code == 0) {
  565. let pages = getCurrentPages() // 当前页面
  566. let beforePage = pages[pages.length - 2] // 上一页
  567. uni.navigateBack({
  568. success: function () {
  569. beforePage.onLoad() // 执行上一页的onLoad方法
  570. }
  571. })
  572. }
  573. })
  574. } else if (res.cancel) {
  575. console.log('用户点击取消')
  576. }
  577. }
  578. })
  579. },
  580. //获取用户聊天消息
  581. getShopUnreadCount() {
  582. let that = this
  583. let data = {
  584. ordersId: that.orderId
  585. }
  586. that.$Request.getT('/shop/ordersChat/selectShopUnreadCount', data).then((res) => {
  587. if (res.code == 0) {
  588. // that.ShopUnreadCount = res.data
  589. if (res.data > 0) {
  590. if (this.ShopUnreadCount != res.data && !this.first) {
  591. that.aplayAudio()
  592. this.ShopUnreadCount = res.data
  593. uni.showModal({
  594. title: '消息',
  595. content: '有' + res.data + '条消息,请前往聊天列表处理。',
  596. success: (ret) => {
  597. if (ret.confirm) {
  598. uni.redirectTo({
  599. url: '/pages/my/liaotian'
  600. })
  601. this.first = true
  602. } else {
  603. console.log('else', ret)
  604. that.defineCallBack()
  605. }
  606. }
  607. })
  608. // this.chatNum = data.data
  609. }
  610. } else {
  611. that.ShopUnreadCount = 0
  612. }
  613. }
  614. })
  615. },
  616. //消息提示
  617. aplayAudio() {
  618. // console.log('语音提示')
  619. const innerAudioContext = uni.createInnerAudioContext()
  620. innerAudioContext.autoplay = true
  621. innerAudioContext.src = 'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3'
  622. innerAudioContext.onPlay(() => {
  623. console.log('开始播放')
  624. })
  625. innerAudioContext.onError((res) => {
  626. console.log(res.errMsg)
  627. console.log(res.errCode)
  628. })
  629. }
  630. }
  631. }
  632. </script>
  633. <style scoped>
  634. /* 余额 */
  635. .tosend {
  636. width: 100%;
  637. height: 280rpx;
  638. /* background: -webkit-linear-gradient(top, #FCD202, #F5F5F5); */
  639. }
  640. .tosend_text {
  641. padding: 3% 3% 0%;
  642. font-size: 38upx;
  643. font-weight: 800;
  644. color: #333333;
  645. }
  646. .tosend_header {
  647. width: 94%;
  648. background-color: #ffffff;
  649. margin: 0 auto;
  650. border-radius: 18rpx;
  651. padding: 3%;
  652. }
  653. /* 排序 */
  654. .cont_two_top {
  655. width: 100%;
  656. display: flex;
  657. justify-content: space-between;
  658. }
  659. .cont_two_top_le {
  660. font-size: 30rpx;
  661. font-weight: 500;
  662. color: #333333;
  663. }
  664. .cont_two_top_ri {
  665. padding: 6rpx 10rpx;
  666. text-align: center;
  667. background: rgba(255, 19, 10, 0.2);
  668. font-size: 24rpx;
  669. border: 2rpx solid #ff130a;
  670. color: #ff130a;
  671. opacity: 0.6;
  672. border-radius: 8rpx;
  673. }
  674. .cont_two_text {
  675. font-size: 56rpx;
  676. text-align: center;
  677. font-weight: bold;
  678. color: #333333;
  679. margin: 5% 0;
  680. line-height: 32rpx;
  681. }
  682. .cont_two_text2 {
  683. font-size: 30rpx;
  684. width: 100%;
  685. font-weight: 500;
  686. color: #333333;
  687. text-align: center;
  688. padding-bottom: 4%;
  689. line-height: 32rpx;
  690. border-bottom: 1rpx solid #e6e6e6;
  691. }
  692. .cont_two_text2 text {
  693. color: #ff130a;
  694. }
  695. /* 商品列表 */
  696. .tosend_header_text {
  697. font-family: PingFang SC;
  698. font-weight: 800;
  699. color: #333333;
  700. line-height: 2;
  701. font-size: 30rpx;
  702. }
  703. .tosend_header_food {
  704. width: 100%;
  705. display: flex;
  706. margin-top: 35rpx;
  707. justify-content: space-between;
  708. }
  709. .tosend_header_food_le {
  710. /* width: 15%; */
  711. }
  712. .tosend_header_food_le image {
  713. width: 135rpx;
  714. height: 135rpx;
  715. }
  716. .tosend_header_food_ce {
  717. /* margin: 0 0 0 4%; */
  718. width: 57%;
  719. margin-left: 10upx;
  720. }
  721. .tosend_header_food_ri {
  722. text-align: right;
  723. width: 25%;
  724. }
  725. .tosend_header_food_text {
  726. font-size: 34rpx;
  727. font-weight: 500;
  728. color: #333333;
  729. line-height: 1.8;
  730. overflow: hidden;
  731. text-overflow: ellipsis;
  732. white-space: nowrap;
  733. }
  734. .tosend_header_food_text text {
  735. font-size: 25rpx;
  736. }
  737. .tosend_header_food_text2 {
  738. font-size: 26rpx;
  739. /* font-weight: 500; */
  740. color: #999999;
  741. }
  742. .do_top {
  743. padding-top: 3%;
  744. }
  745. .do_bot {
  746. padding-bottom: 3%;
  747. border-bottom: 2rpx solid #e6e6e6;
  748. }
  749. .tosend_header_do {
  750. width: 100%;
  751. color: #333333;
  752. font-size: 30rpx;
  753. display: flex;
  754. line-height: 1.5;
  755. }
  756. .tosend_header_do view {
  757. flex: 1;
  758. }
  759. .tosend_header_do_ri {
  760. text-align: right;
  761. }
  762. .tosend_header_do_le2 {
  763. font-family: PingFang SC;
  764. font-weight: 500;
  765. color: #999999;
  766. padding-top: 1.5%;
  767. }
  768. .tosend_header_do_ri2 {
  769. text-align: right;
  770. color: #ea0000;
  771. font-size: 40rpx;
  772. }
  773. .tosend_header_do_ri2 text {
  774. font-size: 30rpx;
  775. }
  776. /* 其他信息 */
  777. .tosend_cont {
  778. width: 94%;
  779. background-color: #ffffff;
  780. margin: 3% auto;
  781. border-radius: 18rpx;
  782. padding: 3%;
  783. }
  784. .tosend_cont_infor {
  785. display: flex;
  786. margin-top: 30rpx;
  787. }
  788. .tosend_cont_infor_le {
  789. flex: 1;
  790. color: #999999;
  791. }
  792. .tosend_cont_infor_ri {
  793. flex: 2;
  794. text-align: right;
  795. color: #333333;
  796. }
  797. .tosend_cont_text {
  798. text-align: right;
  799. }
  800. .addgood {
  801. width: 685upx;
  802. height: 88upx;
  803. background: #ffcc00;
  804. border-radius: 8upx;
  805. text-align: center;
  806. line-height: 88rpx;
  807. margin: 40rpx auto;
  808. font-size: 32rpx;
  809. font-weight: bold;
  810. color: #ffffff;
  811. }
  812. .chats {
  813. position: fixed;
  814. bottom: 70px;
  815. right: 15px;
  816. }
  817. .chats image {
  818. width: 60px;
  819. height: 60px;
  820. }
  821. /* 联系骑手 */
  822. .rider_box {
  823. width: 95%;
  824. margin: 0 auto;
  825. background: #ffffff;
  826. margin-top: 20rpx;
  827. border-radius: 10rpx;
  828. }
  829. .rider_left image {
  830. width: 80rpx;
  831. height: 85rpx;
  832. border-radius: 60%;
  833. }
  834. .phone {
  835. background: #fd6416;
  836. color: #ffffff;
  837. padding: 8rpx 15rpx;
  838. border-radius: 13rpx;
  839. font-size: 24rpx;
  840. }
  841. .shopxiaoix {
  842. background: red;
  843. color: #ffffff;
  844. width: 40rpx;
  845. height: auto;
  846. text-align: center;
  847. border-radius: 30rpx;
  848. position: relative;
  849. top: -66px;
  850. left: 35px;
  851. }
  852. .btn {
  853. width: 690upx;
  854. height: 88upx;
  855. margin: 30upx auto;
  856. background: #fcd202;
  857. box-shadow: 0px 10upx 20upx 0upx #ffd9b3;
  858. border-radius: 16upx;
  859. display: flex;
  860. align-items: center;
  861. justify-content: center;
  862. color: #000000;
  863. }
  864. </style>