order.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  1. <template>
  2. <view>
  3. <!-- <sjs src="../../../utils/formatFuc.sjs" module="utils" /> -->
  4. <view class="poster" v-if="myqr_show">
  5. <view>
  6. <image :src="myqr_url" :style="'width:' + myqr_width + 'rpx;'" mode="widthFix"></image>
  7. <view class="tool">
  8. <view>
  9. <button open-type="share" class="share-btn">
  10. <image class="img" style="width: 85rpx; margin-right: 25rpx" mode="widthFix" src="/static/images/share/p_dy.png"></image>
  11. </button>
  12. </view>
  13. <view>
  14. <image class="img" mode="widthFix" @tap="goSaveQrcode" src="/static/images/share/p_save.png"></image>
  15. </view>
  16. </view>
  17. <view style="text-align: center">
  18. <image class="closeImg" @tap="hidePoster" src="/static/images/share/close.png"></image>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="appoint-tabs-wrapper">
  23. <view :class="'appoint-tab-item ' + (showType == 2 ? 'active' : '')" data-tab="2" @tap="onTabChange">服务中</view>
  24. <view :class="'appoint-tab-item ' + (showType == 1 ? 'active' : '')" data-tab="1" @tap="onTabChange">未支付</view>
  25. <view :class="'appoint-tab-item ' + (showType == 0 ? 'active' : '')" data-tab="0" @tap="onTabChange">全 部</view>
  26. <!-- <view class="appoint-tab-item {{showType==4?'active':''}}" data-tab="4" bindtap="onTabChange">待评价</view> -->
  27. </view>
  28. <view class="container" :style="'filter:blur(' + myqr_blur + 'rpx)'">
  29. <!-- <view class="orders-switch">
  30. <view class="item {{ showType == 0 ? 'active' : ''}}" bindtap="switchTab" data-index='0'>
  31. <view class="txt">全部</view>
  32. </view>
  33. <view class="item {{ showType == 1 ? 'active' : ''}}" bindtap="switchTab" data-index='1'>
  34. <view class="txt">待付款</view>
  35. </view> -->
  36. <!-- <view class="item {{ showType == 2 ? 'active' : ''}}" bindtap="switchTab" data-index='2'>
  37. <view class="txt">待发货</view>
  38. </view> -->
  39. <!-- <view class="item {{ showType == 3 ? 'active' : ''}}" bindtap="switchTab" data-index='3'>
  40. <view class="txt">待上门</view>
  41. </view>
  42. <view class="item {{ showType == 4 ? 'active' : ''}}" bindtap="switchTab" data-index='4'>
  43. <view class="txt">待评价</view>
  44. </view>
  45. </view> -->
  46. <!-- <van-tabs active="{{showType }}" color="#09afff" bind:change="onTabChange">
  47. <van-tab title="全部" name="0"></van-tab>
  48. <van-tab title="待付款" name="1"></van-tab>
  49. <van-tab title="服务中" name="3"></van-tab>
  50. <van-tab title="待评价" name="4"></van-tab>
  51. </van-tabs> -->
  52. <!--
  53. <view class="appoint-tabs-wrapper">
  54. <view class="appoint-tab-item {{showType==0?'active':''}}" data-tab="0" bindtap="onTabChange">全 部</view>
  55. <view class="appoint-tab-item {{showType==1?'active':''}}" data-tab="1" bindtap="onTabChange">待付款</view>
  56. <view class="appoint-tab-item {{showType==3?'active':''}}" data-tab="3" bindtap="onTabChange">服务中</view>
  57. <view class="appoint-tab-item {{showType==4?'active':''}}" data-tab="4" bindtap="onTabChange">待评价</view>
  58. </view> -->
  59. <view class="no-order" v-if="orderList.length <= 0">
  60. <view class="c">
  61. <text>还没有任何订单呢</text>
  62. </view>
  63. </view>
  64. <view class="orders">
  65. <view class="order" v-for="(item, index) in orderList" :key="index">
  66. <view class="h">
  67. <view class="l" v-if="item.orderStatusVal == '待预约' || item.orderStatusVal == '服务中' || item.orderStatusVal == '服务已完成'">已支付</view>
  68. <view class="l" v-else>{{ item.orderStatusVal }}</view>
  69. <view class="r" v-if="item.orderStatusVal == '待预约' || item.orderStatusVal == '服务中' || item.orderStatusVal == '服务已完成'">
  70. {{ item.orderStatusVal }}
  71. </view>
  72. <view class="r" v-else></view>
  73. </view>
  74. <!-- open-type="redirect" -->
  75. <navigator :url="'../orderDetail/orderDetail?id=' + item.id">
  76. <view class="goods">
  77. <view class="img">
  78. <image :src="item.picUrl"></image>
  79. </view>
  80. <view class="info">
  81. <!-- <view class="info-orderSn" >订单编号: {{item.orderSn}}</view> -->
  82. <view class="info-main">
  83. <text class="product-name">{{ item.goodsName }}</text>
  84. <text class="price">¥{{ item.orderPrice }}</text>
  85. </view>
  86. <view class="sku-name" v-if="item.increaseSumPrice">
  87. <view>加购: {{ item.unitDescribe }}*{{ item.unitIncreaseNumber }}</view>
  88. <view>¥{{ item.increaseSumPrice }}</view>
  89. </view>
  90. <view class="sku-name">规格:{{ item.skuName }}</view>
  91. <!-- <text class="number">共{{item.number}}件商品</text> -->
  92. <text class="other-info">服务{{ item.serviceTimes }}次</text>
  93. <!-- <text class="other-info" wx:if="{{utils.getNotServiceTimes(item.serviceTimes,item.servedTimes)>0}}"> {{utils.getNotServiceTimes(item.serviceTimes,item.servedTimes)}}次未服务</text> -->
  94. <!-- 支付倒计时 payOverTime -->
  95. <view v-if="item.payOverTime > 0 && item.orderChannel != 38" class="over-time">{{ utils.formatOverTime(item.payOverTime) }} 后订单关闭</view>
  96. </view>
  97. <!-- <view class="status">
  98. </view> -->
  99. </view>
  100. </navigator>
  101. <view class="b">
  102. <view class="l">
  103. <text>实付款:¥{{ item.actualPrice }}</text>
  104. </view>
  105. </view>
  106. <!-- 提醒 -->
  107. <view class="status-tips" v-if="item.orderStatusVal == '已退款'">
  108. <image mode="aspectFit" src="https://jzmall.lifejingzhi.com/file/jzmall-dy/icon-refund-tips.png"></image>
  109. <view class="tips-title">已退款</view>
  110. <view>已按照原支付路径退回</view>
  111. </view>
  112. <view class="status-tips" v-if="item.orderStatusVal == '服务已完成'">
  113. <image mode="aspectFit" src="https://jzmall.lifejingzhi.com/file/jzmall-dy/icon-customer-msg.png"></image>
  114. <view class="tips-title">评价邀请</view>
  115. <view>服务已完成,请评价</view>
  116. </view>
  117. <view class="customer-msg" v-if="item.customerServiceReminder">
  118. <view class="msg-title">提醒:</view>
  119. <view class="msg-text">{{ item.customerServiceReminder }}</view>
  120. </view>
  121. <view class="customer-msg" v-if="item.ticketStatus == 1">
  122. <view class="msg-title">提醒:</view>
  123. <view class="msg-text">您的售后工单正在处理中,请耐心等待</view>
  124. </view>
  125. <view class="customer-msg" v-if="item.ticketStatus == 2">
  126. <view class="msg-title">提醒:</view>
  127. <view class="msg-text">您的售后工单已完成,可以去评价了哦</view>
  128. </view>
  129. <!-- 操作事件 -->
  130. <view class="order-operate-wrapper">
  131. <!-- <view catchtap="deleteOrder" wx:if="{{item.handleOption.delete}}" data-id="{{item.id}}" class="del">删除订单
  132. </view> -->
  133. <view @tap.stop.prevent="cancelOrder" v-if="item.handleOption.cancel" :data-id="item.id" class="del">取消订单</view>
  134. <view @tap.stop.prevent="revertOrder" :data-id="item.id" v-if="item.canReverse" class="del">取消预约</view>
  135. <view @tap.stop.prevent="refundOrder" :data-id="item.id" v-if="item.handleOption.refund" class="del">售后/退款</view>
  136. <!-- <view data-id="{{item.id}}" data-sn="{{item.orderSn}}" data-aid="{{item.addressId}}"
  137. data-type="{{item.type}}" wx:if="{{item.handleOption.book}}" class="eval-btn">评价</view> -->
  138. <!-- 抖音评价 -->
  139. <!-- <rate-button class="eval-btn"
  140. order-id="{{item.orderSn}}"
  141. bind:init="handleInit"
  142. bind:success="handleSuccess"
  143. bind:error="handleError"
  144. /> -->
  145. <!-- <view catchtap="confirmOrder" wx:if="{{item.handleOption.confirm}}" data-id="{{item.id}}">待上门</view> -->
  146. <!-- <view catchtap="refundOrder" wx:if="{{item.handleOption.refund&&item.goodsList[0].goodsSn!='1036016'}}" data-id="{{item.id}}">申请退款</view> -->
  147. <!-- <view data-id="{{item.goodsList[0].goodsId}}" catchtap="shareFriendOrCircle" >分享商品</view> -->
  148. <view
  149. @tap.stop.prevent="appointService"
  150. :data-id="item.id"
  151. :data-goodsid="item.goodsId"
  152. :data-sn="item.orderSn"
  153. :data-aid="item.addressId"
  154. :data-type="item.type"
  155. v-if="item.handleOption.book"
  156. class="appoint"
  157. >
  158. 预约服务
  159. </view>
  160. <view @tap.stop.prevent="payOrder" :data-id="item.id" :data-sn="item.orderSn" v-if="item.handleOption.pay">立即支付</view>
  161. <view class="btn-rebuy" @tap="buyAgain" :data-id="item.goodsId" v-if="item.handleOption.rebuy">再次购买</view>
  162. </view>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. </template>
  168. <script module="utils" lang="wxs" src="@/utils/formatFuc.wxs"></script>
  169. <script>
  170. var util = require('../../../utils/util.js');
  171. var api = require('../../../config/api.js');
  172. var app = getApp();
  173. export default {
  174. data() {
  175. return {
  176. timer: '',
  177. orderList: [],
  178. showType: 2,
  179. page: 1,
  180. limit: 10,
  181. totalPages: 1,
  182. myqr_show: false,
  183. //我的分享二维码
  184. myqr_url: null,
  185. myqr_blur: 0,
  186. //背景模糊值
  187. myqr_width: 0,
  188. hasLogin: false,
  189. goodsId: ''
  190. };
  191. },
  192. onLoad: function (options) {
  193. // 页面初始化 options为页面跳转所带来的参数
  194. if (options.tab) {
  195. this.setData({
  196. showType: options.tab
  197. });
  198. }
  199. },
  200. onHide: function () {
  201. console.log('onHide');
  202. clearInterval(this.timer);
  203. },
  204. onUnload: function () {
  205. console.log('onunload');
  206. clearInterval(this.timer);
  207. },
  208. onReachBottom() {
  209. if (this.totalPages > this.page) {
  210. this.setData({
  211. page: this.page + 1
  212. });
  213. this.getOrderList();
  214. } else if (this.orderList.length > 0) {
  215. uni.showToast({
  216. title: '没有更多订单了',
  217. icon: 'none',
  218. duration: 2000
  219. });
  220. return false;
  221. }
  222. },
  223. onReady: function () {
  224. // 页面渲染完成
  225. },
  226. onShow: function () {
  227. // 页面显示
  228. this.setData({
  229. orderList: [],
  230. page: 1
  231. });
  232. // wx.pageScrollTo({
  233. // scrollTop: 0,
  234. // duration: 1000,
  235. // });
  236. this.getOrderList();
  237. },
  238. methods: {
  239. getOrderList() {
  240. uni.showLoading({
  241. title: '加载中'
  242. });
  243. let that = this;
  244. util.request(api.OrderList, {
  245. showType: that.showType,
  246. page: that.page,
  247. limit: that.limit
  248. }).then((res) => {
  249. uni.hideLoading();
  250. if (res.errno === 0) {
  251. console.log(res.data);
  252. that.setData({
  253. orderList: that.orderList.concat(res.data.data),
  254. totalPages: res.data.pages
  255. });
  256. clearInterval(this.timer);
  257. // 如果有未支付订单,倒计时定时器
  258. let isHasOver = this.orderList.some((item) => {
  259. return item.payOverTime > 0;
  260. });
  261. console.log(isHasOver);
  262. if (isHasOver) {
  263. let timer = setInterval(() => {
  264. let list = this.orderList;
  265. let newList = [];
  266. list.forEach((item) => {
  267. let obj = item;
  268. if (item.payOverTime > 0) {
  269. obj.payOverTime = item.payOverTime - 1;
  270. }
  271. newList.push(obj);
  272. });
  273. this.setData({
  274. orderList: newList
  275. });
  276. }, 1000);
  277. this.setData({
  278. timer: timer
  279. });
  280. }
  281. }
  282. });
  283. },
  284. orderDetail(e) {
  285. let id = e.currentTarget.dataset.id;
  286. uni.navigateTo({
  287. url: '/pages/ucenter/orderDetail/orderDetail?id=' + id
  288. });
  289. },
  290. switchTab: function (event) {
  291. let showType = event.currentTarget.dataset.index;
  292. this.setData({
  293. orderList: [],
  294. showType: showType,
  295. page: 1,
  296. // limit: 10,
  297. totalPages: 1
  298. });
  299. this.getOrderList();
  300. },
  301. //撤销
  302. revertOrder(e) {
  303. let id = e.currentTarget.dataset.id;
  304. let that = this;
  305. uni.showModal({
  306. title: '',
  307. content: '确认取消预约?',
  308. success: function (res) {
  309. if (res.confirm) {
  310. util.request(
  311. api.RevertVerify,
  312. {
  313. orderId: id
  314. },
  315. 'GET'
  316. ).then(function (res) {
  317. if (res.errno === 0) {
  318. uni.showToast({
  319. title: '操作成功!'
  320. });
  321. that.setData({
  322. orderList: [],
  323. page: 1,
  324. totalPages: 1
  325. });
  326. that.getOrderList();
  327. } else {
  328. util.showErrorToast(res.errmsg);
  329. }
  330. });
  331. }
  332. }
  333. });
  334. },
  335. onTabChange(e) {
  336. // let showType = e.detail.name;
  337. let showType = e.currentTarget.dataset.tab;
  338. this.setData({
  339. orderList: [],
  340. showType: showType,
  341. page: 1,
  342. // limit: 10,
  343. totalPages: 1
  344. });
  345. this.getOrderList();
  346. },
  347. appointServiceOld(e) {
  348. let id = e.currentTarget.dataset.id;
  349. let addressId = e.currentTarget.dataset.aid;
  350. let type = e.currentTarget.dataset.type;
  351. if (type && type == 5) {
  352. uni.navigateTo({
  353. url: '/pages/ucenter/coupon/couponGoods?id=1'
  354. });
  355. return;
  356. }
  357. if (addressId == null || addressId == 0) {
  358. uni.navigateTo({
  359. url: '/pages/ucenter/appointOrder/appointOrder?orderId=' + id
  360. });
  361. } else {
  362. //买约分离 没有地址的预约
  363. uni.navigateTo({
  364. url: '/pages/ucenter/serviceDetail/serviceDetail?orderId=' + id
  365. });
  366. }
  367. },
  368. appointService(e) {
  369. let id = e.currentTarget.dataset.id;
  370. let addressId = e.currentTarget.dataset.aid;
  371. let type = e.currentTarget.dataset.type;
  372. let goodsId=e.currentTarget.dataset.goodsid
  373. uni.navigateTo({
  374. url: '/pages/ucenter/appointOrder/appointOrder?orderId=' + id+'&goodsId='+goodsId
  375. });
  376. },
  377. qrtouchstart: function () {
  378. this.setData({
  379. myqr_blur: 0,
  380. myqr_show: false
  381. });
  382. },
  383. shareFriendOrCircle: function (e) {
  384. // let that = this;
  385. // if (!app.globalData.hasLogin) {
  386. // wx.navigateTo({
  387. // url: "/pages/auth/login/login"
  388. // });
  389. // return;
  390. // }
  391. // //获取分享id 用来追踪链接
  392. // //引荐人和非引荐人的 链接不同
  393. // let imgUrl = that.data.goods.shareWxUrl ? that.data.goods.shareWxUrl : that.data.goods.gallery[0];
  394. // var path = '/pages/goods/goods?id=' + that.data.id + '&rId=' + that.data.userInfo.id;
  395. // if (that.data.userInfo.isDis) { //是引荐人
  396. // path = '/pages/goods/goods?id=' + that.data.id + '&shareId=' + that.data.wxShareId;
  397. // }
  398. // this.hidePoster();
  399. // return {
  400. // title: that.data.goods.name,
  401. // desc: that.data.myqr_ads,
  402. // path: path,
  403. // imageUrl: imgUrl
  404. // }
  405. },
  406. // 保存分享图
  407. saveShare: function () {
  408. let that = this;
  409. uni.showLoading({
  410. title: '图片保存中'
  411. });
  412. console.log(that);
  413. uni.downloadFile({
  414. url: that.myqr_url,
  415. success: function (res) {
  416. console.log(res);
  417. uni.saveImageToPhotosAlbum({
  418. filePath: res.tempFilePath,
  419. success: function (res) {
  420. uni.hideLoading();
  421. uni.showModal({
  422. title: '存图成功',
  423. content: '图片成功保存到相册了,可以分享到朋友圈了',
  424. showCancel: false,
  425. confirmText: '好的',
  426. confirmColor: '#a78845',
  427. success: function (res) {
  428. if (res.confirm) {
  429. console.log('用户点击确定');
  430. that.setData({
  431. myqr_show: false,
  432. myqr_blur: 0
  433. });
  434. }
  435. }
  436. });
  437. },
  438. fail: function (res) {
  439. uni.hideLoading();
  440. uni.showModal({
  441. title: '警告',
  442. content: '不授权无法保存',
  443. showCancel: false
  444. });
  445. that.setData({
  446. myqr_show: false,
  447. myqr_blur: 0
  448. });
  449. }
  450. });
  451. },
  452. fail: function (res) {
  453. uni.hideLoading();
  454. console.log(res);
  455. }
  456. });
  457. },
  458. // “去付款”按钮点击效果
  459. payOrder: function (e) {
  460. let that = this;
  461. let id = e.currentTarget.dataset.id;
  462. let ordern = e.currentTarget.dataset.sn;
  463. util.request(
  464. api.OrderPayCheck,
  465. {
  466. orderId: id
  467. },
  468. 'POST'
  469. ).then(function (res) {
  470. if (res.errno === 0) {
  471. const outOrderNo = res.data;
  472. console.log(res);
  473. uni.continueToPay({
  474. // orderId: this.data.orderId, // 内部订单号
  475. outOrderNo: outOrderNo,
  476. // 外部订单号 2个订单号必填一个
  477. success: (res) => {
  478. console.log(res);
  479. const { orderId, outOrderNo } = res;
  480. console.log('success res', res);
  481. console.log('orderId', orderId, 'outOrderNo', outOrderNo);
  482. uni.redirectTo({
  483. url: '/pages/ucenter/order/order'
  484. });
  485. },
  486. fail: (res) => {
  487. console.log(res);
  488. const { orderId, outOrderNo, errNo, errMsg, errLogId } = res;
  489. if (errLogId) {
  490. console.log('查询订单信息失败', errNo, errMsg, errLogId);
  491. }
  492. if (orderId || outOrderNo) {
  493. console.log('支付失败', errNo, errMsg, orderId, outOrderNo);
  494. console.log('订单号' + outOrderNo);
  495. // wx.navigateTo({
  496. // url: '/pages/ucenter/orderDetail/orderDetail?id='+outOrderNo
  497. // });
  498. }
  499. util.showErrorToast('支付失败');
  500. }
  501. });
  502. }
  503. });
  504. },
  505. // “删除”点击效果
  506. deleteOrder: function (e) {
  507. let that = this;
  508. let id = e.currentTarget.dataset.id;
  509. uni.showModal({
  510. title: '',
  511. content: '确定要删除此订单?',
  512. success: function (res) {
  513. if (res.confirm) {
  514. util.request(
  515. api.OrderDelete,
  516. {
  517. orderId: id
  518. },
  519. 'POST'
  520. ).then(function (res) {
  521. if (res.errno === 0) {
  522. uni.showToast({
  523. title: '删除订单成功'
  524. });
  525. util.redirect('/pages/ucenter/order/order');
  526. } else {
  527. util.showErrorToast(res.errmsg);
  528. }
  529. });
  530. }
  531. }
  532. });
  533. },
  534. // “取消订单”点击效果
  535. cancelOrder: function (e) {
  536. let that = this;
  537. let id = e.currentTarget.dataset.id;
  538. uni.showModal({
  539. title: '',
  540. content: '确定要取消此订单?',
  541. success: function (res) {
  542. if (res.confirm) {
  543. util.request(
  544. api.OrderCancel,
  545. {
  546. orderId: id
  547. },
  548. 'POST'
  549. ).then(function (res) {
  550. if (res.errno === 0) {
  551. uni.showToast({
  552. title: '取消订单成功'
  553. });
  554. util.redirect('/pages/ucenter/order/order');
  555. } else {
  556. util.showErrorToast(res.errmsg);
  557. }
  558. });
  559. }
  560. }
  561. });
  562. },
  563. // “待上门”点击效果
  564. confirmOrder: function (e) {
  565. let that = this;
  566. let id = e.currentTarget.dataset.id;
  567. uni.showModal({
  568. title: '',
  569. content: '确认上门服务?',
  570. success: function (res) {
  571. if (res.confirm) {
  572. util.request(
  573. api.OrderConfirm,
  574. {
  575. orderId: id
  576. },
  577. 'POST'
  578. ).then(function (res) {
  579. if (res.errno === 0) {
  580. uni.showToast({
  581. title: '确认上门成功!'
  582. });
  583. util.redirect('/pages/ucenter/order/order');
  584. } else {
  585. util.showErrorToast(res.errmsg);
  586. }
  587. });
  588. }
  589. }
  590. });
  591. },
  592. // “取消订单并退款”点击效果
  593. refundOrderOld: function (e) {
  594. let that = this;
  595. let id = e.currentTarget.dataset.id;
  596. uni.showModal({
  597. title: '',
  598. content: '确定要取消此订单?',
  599. success: function (res) {
  600. if (res.confirm) {
  601. util.request(
  602. api.OrderRefund,
  603. {
  604. orderId: id
  605. },
  606. 'POST'
  607. ).then(function (res) {
  608. if (res.errno === 0) {
  609. uni.showToast({
  610. title: '取消订单成功'
  611. });
  612. util.redirect('/pages/ucenter/order/order');
  613. } else {
  614. util.showErrorToast(res.errmsg);
  615. }
  616. });
  617. }
  618. }
  619. });
  620. },
  621. refundOrderOld: function (e) {
  622. let id = e.currentTarget.dataset.id;
  623. },
  624. refundOrder: function (e) {
  625. let id = e.currentTarget.dataset.id;
  626. uni.navigateTo({
  627. url: '/pages/ucenter/applyRefund/applyRefund?id=' + id
  628. });
  629. },
  630. buyAgain(e) {
  631. let id = e.currentTarget.dataset.id;
  632. uni.navigateTo({
  633. url: '/pages/goods/goods?id=' + id
  634. });
  635. },
  636. handleInit(event) {
  637. const { status } = event.detail;
  638. console.log(status);
  639. },
  640. handleSuccess(event) {
  641. const { result } = event.detail;
  642. // 团购订单不支持查看评价,此时可决定按钮是否展示
  643. console.log(result);
  644. },
  645. handleError(event) {
  646. const { errMsg, errNo } = event.detail;
  647. // errNo(错误码,对应某种具体报错原因)
  648. // errMsg(报错信息)
  649. console.log(errMsg, errNo);
  650. },
  651. goSaveQrcode() {
  652. console.log('占位:函数 goSaveQrcode 未声明');
  653. },
  654. hidePoster() {
  655. console.log('占位:函数 hidePoster 未声明');
  656. }
  657. }
  658. };
  659. </script>
  660. <style>
  661. page {
  662. /* height: 100%; */
  663. width: 100%;
  664. background: #f4f4f4;
  665. }
  666. .orders-switch {
  667. width: 100%;
  668. background: #fff;
  669. height: 84rpx;
  670. /* border-bottom: 1px solid rgba(0,0,0,.15); */
  671. }
  672. .orders-switch .item {
  673. display: inline-block;
  674. height: 82rpx;
  675. width: 18%;
  676. padding: 0 15rpx;
  677. text-align: center;
  678. }
  679. .orders-switch .item .txt {
  680. display: inline-block;
  681. height: 82rpx;
  682. padding: 0 20rpx;
  683. line-height: 82rpx;
  684. color: #9a9ba1;
  685. font-size: 30rpx;
  686. width: 170rpx;
  687. }
  688. .orders-switch .item.active .txt {
  689. color: #ab956d;
  690. border-bottom: 4rpx solid #ab956d;
  691. }
  692. .no-order {
  693. width: 100%;
  694. height: auto;
  695. margin: 0 auto;
  696. }
  697. .no-order .c {
  698. width: 100%;
  699. height: auto;
  700. padding-top: 400rpx;
  701. }
  702. .no-order .c text {
  703. margin: 0 auto;
  704. display: block;
  705. width: 258rpx;
  706. height: 29rpx;
  707. line-height: 29rpx;
  708. text-align: center;
  709. font-size: 29rpx;
  710. color: #999;
  711. }
  712. .orders {
  713. height: auto;
  714. width: 750rpx;
  715. /* overflow: hidden; */
  716. padding: 0 24rpx;
  717. margin-top: 110rpx;
  718. }
  719. .order {
  720. /* margin-top: 20rpx; */
  721. background: #fff;
  722. padding: 0 24rpx 24rpx 24rpx;
  723. border-radius: 24rpx;
  724. margin-bottom: 24rpx;
  725. }
  726. .order .h {
  727. height: 72rpx;
  728. border-bottom: 2rpx solid #e0e0e0;
  729. color: #191919;
  730. font-size: 28rpx;
  731. font-weight: bold;
  732. display: flex;
  733. align-items: center;
  734. justify-content: space-between;
  735. }
  736. .order .h .l {
  737. }
  738. .order .h .r {
  739. }
  740. .order .goods {
  741. display: flex;
  742. /* align-items: center; */
  743. padding: 24rpx 0 0;
  744. position: relative;
  745. }
  746. .order .goods .img {
  747. height: 190rpx;
  748. width: 190rpx;
  749. background: #f4f4f4;
  750. }
  751. .order .goods .img image {
  752. height: 190rpx;
  753. width: 190rpx;
  754. overflow: hidden;
  755. border-radius: 10rpx;
  756. }
  757. .order .goods .info {
  758. height: 145.83rpx;
  759. flex: 1;
  760. padding-left: 20rpx;
  761. }
  762. .info-orderSn {
  763. font-size: 28rpx;
  764. font-weight: bold;
  765. }
  766. .info-main {
  767. display: flex;
  768. height: 40rpx;
  769. align-items: center;
  770. justify-content: space-between;
  771. /* margin-bottom: 58rpx; */
  772. }
  773. .info .sku-name {
  774. color: #666666;
  775. font-size: 24rpx;
  776. margin: 10rpx 0;
  777. height: 34rpx;
  778. line-height: 34rpx;
  779. display: flex;
  780. justify-content: space-between;
  781. }
  782. .product-name {
  783. line-height: 40rpx;
  784. font-size: 28rpx;
  785. /* padding-left: 20rpx;
  786. text-indent: -16rpx; */
  787. overflow: hidden;
  788. text-overflow: ellipsis;
  789. white-space: nowrap;
  790. width: 328rpx;
  791. font-weight: bold;
  792. color: rgba(0, 0, 0, 0.9);
  793. }
  794. .info-main .price {
  795. color: rgba(0, 0, 0, 0.9);
  796. font-size: 24rpx;
  797. font-weight: bold;
  798. }
  799. .info .other-info {
  800. font-size: 24rpx;
  801. color: rgba(0, 0, 0, 0.9);
  802. line-height: 34rpx;
  803. }
  804. .order .goods .status {
  805. width: 105rpx;
  806. color: #b4282d;
  807. font-size: 25rpx;
  808. }
  809. .order .b {
  810. height: 44rpx;
  811. line-height: 44rpx;
  812. /* border-top: 1px solid #f4f4f4; */
  813. font-size: 26rpx;
  814. color: #666;
  815. text-align: right;
  816. }
  817. .order .b text {
  818. font-size: 24rpx;
  819. color: rgba(0, 0, 0, 0.9);
  820. font-weight: bold;
  821. }
  822. .order .b .l {
  823. /* float: left; */
  824. }
  825. .order .b .r {
  826. float: right;
  827. }
  828. .order .b .btn {
  829. margin-top: 19rpx;
  830. height: 64.5rpx;
  831. line-height: 64.5rpx;
  832. text-align: center;
  833. padding: 0 20rpx;
  834. border-radius: 5rpx;
  835. font-size: 28rpx;
  836. color: #fff;
  837. background: #b4282d;
  838. }
  839. .order-operate-wrapper {
  840. /* height: 80rpx; */
  841. display: flex;
  842. align-items: center;
  843. justify-content: flex-end;
  844. flex: 1;
  845. flex-wrap: wrap;
  846. border-top: 2rpx solid #e0e0e0;
  847. padding: 10rpx 0 12rpx;
  848. margin: 20rpx 0 0;
  849. }
  850. /* .order-operate-wrapper::after {
  851. content: '';
  852. flex: auto;
  853. } */
  854. .order-operate-wrapper > view {
  855. text-align: center;
  856. font-size: 24rpx;
  857. color: #fff;
  858. margin-left: 20rpx;
  859. width: 160rpx;
  860. height: 56rpx;
  861. line-height: 56rpx;
  862. background: linear-gradient(90deg, #ff9c49 0%, #ff8219 100%);
  863. border-radius: 56rpx;
  864. margin-top: 10rpx;
  865. }
  866. .order-operate-wrapper > view.del {
  867. border: 2rpx solid #d8d8d8;
  868. color: #666666;
  869. background: #fff;
  870. }
  871. .order-operate-wrapper > view.appoint {
  872. background: linear-gradient(90deg, #00baff 0%, #008dff 100%);
  873. }
  874. .myqr {
  875. position: fixed;
  876. z-index: 999;
  877. width: 100%;
  878. text-align: center;
  879. height: auto;
  880. padding-top: 50rpx;
  881. top: 0;
  882. left: 0;
  883. right: 0;
  884. bottom: 0;
  885. }
  886. .myqr .cancel {
  887. width: 60rpx;
  888. height: 60rpx;
  889. margin-top: 30rpx;
  890. margin-left: 480rpx;
  891. }
  892. .myqr .img {
  893. width: 480rpx;
  894. }
  895. .myqr .btn {
  896. width: 120rpx;
  897. height: 120rpx;
  898. line-height: 120rpx;
  899. margin-top: 20rpx;
  900. padding: 30rpx;
  901. background: #ffffff;
  902. border-radius: 60rpx;
  903. }
  904. /* 会员卡蒙层的样式 */
  905. .poster {
  906. position: fixed;
  907. top: 0;
  908. bottom: 0;
  909. right: 0;
  910. left: 0;
  911. background-color: #333333d1;
  912. /* padding: 0rpx 80rpx;
  913. padding-top: 20%;*/
  914. z-index: 99;
  915. height: 100%;
  916. text-align: center;
  917. justify-content: center;
  918. align-items: center;
  919. display: flex;
  920. }
  921. .title {
  922. color: #fff;
  923. margin: 20rpx 0;
  924. font-size: 30rpx;
  925. }
  926. .ads {
  927. margin: 10rpx 0rpx;
  928. color: #fff;
  929. }
  930. .tool {
  931. display: flex;
  932. text-align: center;
  933. justify-content: baseline;
  934. width: 100%;
  935. margin-top: 20rpx;
  936. }
  937. .tool view {
  938. flex: 1;
  939. }
  940. .img {
  941. width: 99rpx;
  942. }
  943. .closeImg {
  944. width: 57rpx;
  945. height: 57rpx;
  946. }
  947. .share-btn {
  948. background-color: transparent;
  949. }
  950. .share-btn::after {
  951. border: none;
  952. }
  953. .m-card {
  954. width: 100%;
  955. height: 230rpx;
  956. margin: 20rpx 0;
  957. }
  958. .m-card image {
  959. width: 100%;
  960. height: 230rpx;
  961. }
  962. .appoint-tabs-wrapper {
  963. height: 88rpx;
  964. display: flex;
  965. align-items: center;
  966. line-height: 88rpx;
  967. justify-content: space-around;
  968. position: fixed;
  969. left: 0;
  970. right: 0;
  971. top: 0;
  972. background: #fff;
  973. z-index: 99;
  974. }
  975. .appoint-tab-item {
  976. font-weight: bold;
  977. font-size: 30rpx;
  978. color: #191919;
  979. /* width:80rpx; */
  980. }
  981. .appoint-tab-item.active {
  982. color: #fe2b54;
  983. /* border-bottom:4rpx solid #09afff; */
  984. }
  985. .detail-btn {
  986. width: 148rpx;
  987. text-align: center;
  988. line-height: 60rpx;
  989. text-align: center;
  990. font-size: 26rpx;
  991. color: #00b9ff;
  992. margin-top: -20rpx;
  993. /* margin-left:340rpx; */
  994. width: 170rpx;
  995. height: 60rpx;
  996. background: #ffffff;
  997. border: 2rpx solid #00b9ff;
  998. border-radius: 60px;
  999. float: right;
  1000. }
  1001. .status-tips {
  1002. height: 56rpx;
  1003. background: #ebebeb;
  1004. border-radius: 10rpx;
  1005. display: flex;
  1006. align-items: center;
  1007. padding: 0 0 0 16rpx;
  1008. margin-top: 24rpx;
  1009. }
  1010. .status-tips image {
  1011. width: 36rpx;
  1012. height: 32rpx;
  1013. }
  1014. .status-tips view {
  1015. font-size: 24rpx;
  1016. color: #666;
  1017. }
  1018. .status-tips .tips-title {
  1019. color: #191919;
  1020. font-weight: bold;
  1021. margin: 0 16rpx;
  1022. }
  1023. .customer-msg {
  1024. background: #ebebeb;
  1025. border-radius: 10rpx;
  1026. display: flex;
  1027. padding: 12rpx 16rpx;
  1028. margin-top: 24rpx;
  1029. }
  1030. .customer-msg .msg-title {
  1031. color: #fe2b54;
  1032. font-weight: bold;
  1033. font-size: 24rpx;
  1034. white-space: nowrap;
  1035. }
  1036. .customer-msg .msg-text {
  1037. line-height: 34rpx;
  1038. display: -webkit-box;
  1039. -webkit-box-orient: vertical;
  1040. -webkit-line-clamp: 2;
  1041. text-overflow: ellipsis;
  1042. overflow: hidden;
  1043. font-size: 24rpx;
  1044. color: #000000;
  1045. }
  1046. .over-time {
  1047. position: absolute;
  1048. top: 170rpx;
  1049. right: 0;
  1050. line-height: 40rpx;
  1051. color: #ad0000;
  1052. font-size: 28rpx;
  1053. }
  1054. .eval-btn {
  1055. text-align: center;
  1056. font-size: 24rpx;
  1057. color: #fff;
  1058. margin-left: 20rpx;
  1059. width: 160rpx;
  1060. height: 56rpx;
  1061. line-height: 56rpx;
  1062. background: linear-gradient(90deg, #ff9c49 0%, #ff8219 100%);
  1063. border-radius: 56rpx;
  1064. margin-top: 10rpx;
  1065. border: 2rpx solid #ff8219;
  1066. color: #ff8219;
  1067. background: #fff;
  1068. }
  1069. .order-operate-wrapper view.eval-btn {
  1070. border: 2rpx solid #ff8219;
  1071. color: #ff8219;
  1072. background: #fff;
  1073. }
  1074. </style>