orderDet.vue 26 KB

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