orderDet.vue 26 KB

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