info.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view>
  3. <block v-if="loading">
  4. <view class="skeleton">
  5. <view class="skeleton-line max animate" style="height: 200upx;"></view>
  6. <view class="skeleton-line animate"></view>
  7. <view class="skeleton-line min animate"></view>
  8. <view class="skeleton-line min animate"></view>
  9. <view class="skeleton-line max animate" style="height: 200upx;"></view>
  10. <view class="skeleton-line max animate" style="height: 200upx;"></view>
  11. </view>
  12. </block>
  13. <block v-else>
  14. <view class="order-status">
  15. <view class="status-name" v-if="orderData.status == 1">已核销</view>
  16. <view class="status-name success" v-if="orderData.status == 2">预约中</view>
  17. <view class="status-name" v-if="orderData.status == 3">已撤销</view>
  18. <view class="status-name" v-if="orderData.status == 4">已完成</view>
  19. <view class="status-desc" v-if="orderData.status == 1">团购券已完成核销</view>
  20. <view class="status-desc success" v-if="orderData.status == 2">预约中,如有问题可以联系客服</view>
  21. <view class="status-desc" v-if="orderData.status == 3">已撤销,可在团购订单中申请退款</view>
  22. <view class="status-desc" v-if="orderData.status == 4">服务已完成,欢迎您再次使用</view>
  23. </view>
  24. <view class="order-goods">
  25. <view class="goods-img"><image :src="orderData.goods.product_img"></image></view>
  26. <view class="goods-info">
  27. <view class="name">{{ orderData.goods.product_name }}</view>
  28. <view class="desc">
  29. <view class="time" v-if="orderData.end_at">有效期至:{{ orderData.end_at }} </view>
  30. <view class="num">x {{ orderData.number?orderData.number:1 }}</view>
  31. </view>
  32. <view class="total">合计:¥ {{orderData.goods.product_price}}</view>
  33. </view>
  34. </view>
  35. <view class="goods-store" v-if="poiData">
  36. <view class="title">预约门店</view>
  37. <view class="store-info">
  38. <view class="store-left">
  39. <view class="name">{{poiData.poi_name}}</view>
  40. <view class="address">{{poiData.poi_address}}</view>
  41. </view>
  42. <view class="store-right">
  43. <view class="right-item">
  44. <image src="/static/image/map.png"></image>
  45. <view class="desc">导航</view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="order-info">
  51. <view class="title">订单信息</view>
  52. <view class="info-item">
  53. <view class="name">订单编号</view>
  54. <view class="right">{{ orderData.order_id }} <text @click="copyOrder(orderData.order_id)">复制</text></view>
  55. </view>
  56. <view class="info-item">
  57. <view class="name">下单时间</view>
  58. <view class="right">{{ orderData.create_at }}</view>
  59. </view>
  60. </view>
  61. <view class="order-info" v-if="orderData.service_type==1">
  62. <view class="title">预约信息</view>
  63. <view class="info-item">
  64. <view class="name">到店时间</view>
  65. <view class="right">{{ orderData.time }}</view>
  66. </view>
  67. </view>
  68. <view class="order-info" v-if="orderData.service_type==2">
  69. <view class="title">会员资料</view>
  70. <view class="info-item">
  71. <view class="name"></view>
  72. <view class="right">{{ orderData.username }}<text>{{ orderData.mobile }}</text></view>
  73. </view>
  74. <view class="address-info">
  75. {{ orderData.region }}{{ orderData.address }}
  76. </view>
  77. </view>
  78. <view class="line-footer"></view>
  79. <view class="footer">
  80. <view class="footer-op" v-if="orderData.status == 1">
  81. <view class="footer-right">
  82. <view class="btn">已核销</view>
  83. </view>
  84. </view>
  85. <view class="footer-op" v-if="orderData.status == 2">
  86. <view class="footer-left" @click="cancelOrder"><text>取消预约</text></view>
  87. <view class="footer-right">
  88. <pay-button-sdk
  89. :mode="1"
  90. :goods-id="orderData.goods.out_id"
  91. :order-id="orderData.order_sn"
  92. :order-status="1"
  93. :refund-total-amount="orderData.goods.product_price*100"
  94. :apply-refund-params="applyRefundParams"
  95. />
  96. <view class="btn">服务进行中</view>
  97. </view>
  98. </view>
  99. <view class="footer-op" v-if="orderData.status == 3">
  100. <view class="footer-right" @click="toGoods">
  101. <view class="btn">已撤销</view>
  102. </view>
  103. </view>
  104. <view class="footer-op" v-if="orderData.status == 4">
  105. <view class="footer-right">
  106. <view class="btn">已完成</view>
  107. </view>
  108. </view>
  109. <view class="footer-safe"></view>
  110. </view>
  111. </block>
  112. </view>
  113. </template>
  114. <script>
  115. var app;
  116. import * as Api from "@/static/api/order.js";
  117. export default {
  118. data() {
  119. return {
  120. loading:true,
  121. order:"",
  122. poiData:null,
  123. goodsData:null,
  124. orderData:null,
  125. storeData:null,
  126. orderIdForRefundAmount:"",
  127. applyRefundParams:{
  128. orderId:""
  129. }
  130. }
  131. },
  132. onLoad({order}) {
  133. app = this;
  134. app.order = order;
  135. app.getOrder()
  136. },
  137. methods: {
  138. toRefund(){
  139. },
  140. applyrefund(event) {
  141. console.log('退款申请',event);
  142. const { orderId } = event.detail;
  143. console.log('退款申请-02',orderId);
  144. const extra = { orderId }; // 开发者需要透传的参数,可自定义内容
  145. return new Promise(resolve => {
  146. resolve(extra);
  147. });
  148. },
  149. cancelOrder(){
  150. app.$dialog.showError("确定要取消该预约吗?",function(res){
  151. if (res.confirm) {
  152. Api.cancel({"order":app.order}).then((res)=>{
  153. if (res.code == 0) {
  154. return app.$dialog.showSuccess(res.msg)
  155. }
  156. app.$dialog.showSuccess(res.msg,"none",function(){
  157. app.getOrder()
  158. })
  159. })
  160. }
  161. },"取消预约")
  162. },
  163. getOrder(){
  164. Api.orderDetail({"order":app.order}).then((res)=>{
  165. app.loading = false;
  166. if (res.code !== 1) {
  167. app.$dialog.showSuccess(res.msg,function(){
  168. uni.navigateBack()
  169. });
  170. return ;
  171. }
  172. app.applyRefundParams.orderId = res.data.order_id;
  173. app.orderData = res.data
  174. app.poiData = res.data.poi;
  175. })
  176. }
  177. }
  178. }
  179. </script>
  180. <style>
  181. page{background-color: #f8f8f8;}
  182. .skeleton{width: 90%;margin: 20upx auto;}
  183. .line-footer{height: 200upx;}
  184. .address-info{font-size: 28upx;color: #333;}
  185. .footer{position: fixed;bottom: 0;background-color: #fff;padding: 20upx 20upx 0 20upx;border-top: 2upx solid #f8f8f8;left: 0;right: 0;}
  186. .footer .footer-op{display: flex;align-items: center;}
  187. .footer .footer-op .footer-left{display: flex;align-items: center;gap: 10upx;justify-content: center;font-size: 32upx;color: #f00;font-weight: bold;}
  188. .footer .footer-op .footer-left text{color: #666;font-size: 24upx;font-weight: normal;}
  189. .footer .footer-op .footer-left .item{flex-direction: column;display: flex;font-size: 24rpx;color: #333;align-items: center;}
  190. .footer .footer-op .footer-left image{width: 40upx;height: 40upx;}
  191. .footer .footer-op .footer-right{margin-left: auto;margin-right: 0;display: flex;align-items: center;gap: 20upx;}
  192. .footer .footer-op .footer-right .btn{font-size: 28rpx;height: 80upx;border-radius: 10upx;line-height: 80upx;text-align: center;width: 200upx;color: #333;border: 2upx solid #ccc;}
  193. .footer .footer-op .footer-right .btn.danger{border:2upx solid #f00;color: #f00;}
  194. .footer .footer-op .footer-right .btn.full{background-color: #007aff;color: #fff;border:2upx solid #007aff;}
  195. .footer .footer-safe {height: env(safe-area-inset-bottom);width: 100%;}
  196. .order-status{padding: 40upx 20upx;text-align: center;}
  197. .order-status .status-name{text-align: center;font-size: 32upx;color: #333;font-weight: bold;display: flex;align-items: center;justify-content: center;}
  198. .order-status .status-desc{font-size: 24upx;color: #666;margin-top: 20upx;}
  199. .order-info{background-color: #fff;padding: 20upx;margin-top: 20upx;}
  200. .order-info .title{font-size: 32upx;color: #333;font-weight: bold;margin-bottom: 20upx;}
  201. .order-info .info-item{height: 80upx;line-height: 80upx;font-size: 28upx;display: flex;align-items: center;}
  202. .order-info .info-item .right{color: #666;margin-left: auto;margin-right: 0;}
  203. .order-info .info-item .right text{border: 2upx solid #ccc;color: #333;font-size: 24upx;padding: 0 15upx;margin-left: 20upx;border-radius: 5upx;}
  204. .goods-safe{display: flex;align-items: center;font-size: 24rpx;color: #999;gap: 40upx;background: #fff;border-top: 2upx solid #f8f8f8;padding: 20upx;}
  205. .goods-safe .safe-item{display: flex;align-items: center;}
  206. .goods-safe image{width: 30upx;height: 30upx;margin-right: 10upx;}
  207. .order-goods{display: flex;align-items: center;background-color: #fff;padding: 0 20upx;}
  208. .order-goods image{width: 140upx;height: 140upx;}
  209. .goods-info{margin-left: 20upx;font-size: 28upx;flex: 1;padding: 20upx 0;}
  210. .goods-info .name{font-size: 30upx;color: #333;}
  211. .goods-info .desc{font-size: 24upx;color: #999;display: flex;align-items: center;justify-content: space-between;margin: 20upx 0;}
  212. .goods-info .total{font-size: 30upx;color: #333;text-align: right;font-weight: bold;}
  213. .home-store{margin: 20upx auto;display: flex;align-items: center;background-color: #fff;border-radius: 10upx;display: flex;align-items: center;padding: 30upx;}
  214. .home-store .store-right{width: 120upx;height: 120upx;background-color: #fff;text-align: center;display: flex;align-items: center;justify-content: center;margin-left: auto;margin-right: 0;border-radius: 10upx;}
  215. .home-store .store-right image{width: 60upx;height: 60upx;}
  216. .home-store .left{display: flex;align-items: center;}
  217. .home-store .left image{width: 60upx;height: 60upx;margin-right: 20upx;}
  218. .home-store .right {margin-left: auto;margin-right: 0;display: flex;align-items: center;}
  219. .home-store .right image{width: 50upx;height: 50upx;}
  220. .home-store .name{font-size: 32upx;color: #000;font-weight: bold;}
  221. .home-store .desc{font-size: 26upx;color: #666;margin-top: 20upx;}
  222. .home-store .status{color: #333;font-size: 28upx;padding:5upx 15upx;border-radius: 10upx;margin-left: 10upx;}
  223. .home-store .status.error{background-color: #fef0f0;color: #f56c6c;}
  224. .service-popup .item{height: 100upx;line-height: 100upx;text-align: center;font-size: 28upx;color: #333;border-bottom: 2upx solid #f8f8f8;}
  225. .service-popup .item .btn{background-color: #fff;border: 0;height: 100upx;line-height: 100upx;text-align: center;font-size: 28upx;color: #333;}
  226. .service-popup .item .btn::after{border: 0;}
  227. .service-popup .foot{height: 100upx;line-height: 100upx;text-align: center;font-size: 28upx;color: #333;border-top: 20upx solid #f8f8f8;}
  228. .goods-store{background-color: #fff;padding: 0 20upx;margin-top: 20upx;}
  229. .goods-store .title{line-height: 80upx;font-size: 32rpx;color: #333;font-weight: bold;display: flex;align-items: center;border-bottom: 2upx solid #f8f8f8;}
  230. .goods-store .store-info{display: flex;align-items: center;padding: 20upx 0;}
  231. .goods-store .store-info .store-right{margin-left: auto;margin-right: 0;font-size: 24rpx;color: #999;}
  232. .goods-store .store-info .store-right image{width: 50upx;height: 50upx;margin-bottom: 10upx;}
  233. .goods-store .store-info .store-left .name{font-size: 30rpx;color: #333;font-weight: bold;line-height: 80upx;}
  234. .goods-store .store-info .store-left .address{font-size: 24rpx;color: #999;}
  235. </style>