orderDet.vue 24 KB

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