orderDet.vue 25 KB

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