orderDet.vue 25 KB

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