order-sharedetails.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="container details clearfix">
  3. <!-- 地址选择 -->
  4. <cm-address-temp ref="orderAddress" v-if="isRequest" :addressData="addressData" />
  5. <!-- 商品 -->
  6. <cm-goods-temp ref="goods" v-if="isRequest" :list="orderInfo.orderProductList" @popupClick="hanldePopupFn" />
  7. <!-- 订单信息 -->
  8. <cm-order-temp ref="orderInfo" v-if="skeletonShow" :orderInfo="orderInfo" />
  9. <!-- 发票信息 -->
  10. <cm-invice-temp ref="invoice" v-if="isRequest" :orderInvoice="orderInvoice" />
  11. <!-- 支付记录 -->
  12. <cm-payment-temp ref="payment" v-if="isRequest" :discernReceiptList="discernReceiptList" :receiptAmount="receiptAmount" />
  13. <!-- 退款记录 -->
  14. <cm-refund-temp ref="refund" v-if="isRequest" :returnedPurchaseList="returnedPurchaseList" :returnedPurchaseFee="returnedPurchaseFee" />
  15. <!-- 底部button -->
  16. <view class="button-content" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  17. <view class="btn btn-query" v-if="btnState.isQuery" @click.stop="queryLogistics">查看物流</view>
  18. <view class="btn btn-cancel" v-if="btnState.isPay" @click.stop="btnConfirmPay">立即支付</view>
  19. </view>
  20. <!-- 促销活动弹窗 -->
  21. <cm-promote-popup :Promotion="handlerPros" :popupShow="popupShow" />
  22. </view>
  23. </template>
  24. <script>
  25. import cmAddressTemp from './components/details/cm-address-temp' //地址信息
  26. import cmGoodsTemp from './components/details/cm-goods-temp' //商品列表
  27. import cmOrderTemp from './components/details/cm-order-temp' //订单信息
  28. import cmInviceTemp from './components/details/cm-invice-temp' //发票信息
  29. import cmPaymentTemp from './components/details/cm-payment-temp' //支付记录
  30. import cmRefundTemp from './components/details/cm-refund-temp' //退款记录
  31. import cmVoucherTemp from './components/details/cm-voucher-temp' //支付凭证记录
  32. import cmPromotePopup from './components/details/cm-promote-popup' //促销活动弹窗
  33. export default {
  34. components: {
  35. cmAddressTemp,
  36. cmGoodsTemp,
  37. cmOrderTemp,
  38. cmInviceTemp,
  39. cmPaymentTemp,
  40. cmRefundTemp,
  41. cmVoucherTemp,
  42. cmPromotePopup
  43. },
  44. data() {
  45. return {
  46. status: '',
  47. userId: '',
  48. orderId: 0,
  49. shopOrderId:0,
  50. cellPhone: '', //客服电话
  51. btnStatus: 0, //按钮组件状态
  52. isRequest: false, //是否加载完成渲染子组件
  53. addressData: {}, //地址信息初始化
  54. orderInfo: {}, //订单信息初始化
  55. shopOrderData: {}, //商品信息初始化
  56. orderInvoice: {}, //发票信息初始化
  57. returnedPurchaseList: {}, //退款信息初始化
  58. discernReceiptList: {}, //支付信息初始化
  59. receiptAmount: 0, //支付金额
  60. returnedPurchaseFee: 0, //退款金额
  61. isIphoneX: this.$store.state.isIphoneX,
  62. popupShow: false,
  63. handlerPros: {},
  64. btnState: {
  65. isQuery: false,
  66. isPay:false
  67. },
  68. mapStateArr: [
  69. { label: 'isQuery', val: [2, 6, 12, 13, 33, 22, 23, 32], status: true },
  70. { label: 'isPay', val: [11, 12, 13, 21, 22, 23], status: true }
  71. ]
  72. }
  73. },
  74. onLoad(option) {
  75. this.shopOrderId = option.shopOrderId
  76. this.userId = option.userId
  77. this.initOrderDetaileData()
  78. },
  79. methods: {
  80. initOrderDetaileData() {
  81. //初始化页面数据@参数:订单ID
  82. this.OrderService.QueryOrderDetails({ shopOrderId: this.shopOrderId, userId: this.userId })
  83. .then(response => {
  84. let data = response.data
  85. this.status = data.order.status
  86. this.addressData = data.userInfo
  87. this.orderInfo = data.shopOrder
  88. this.shopOrderData = data.shopOrderList
  89. this.orderInvoice = data.orderInvoice
  90. this.returnedPurchaseList = data.returnedPurchaseList
  91. this.discernReceiptList = data.discernReceiptList
  92. this.receiptAmount = data.shopOrder.receiptAmount
  93. this.returnedPurchaseFee = data.shopOrder.returnedPurchaseFee
  94. this.isRequest = true
  95. this.mapStateArr.forEach(el => {
  96. el.val.forEach(value => {
  97. if (this.status === value) {
  98. this.btnState[el.label] = el.status
  99. }
  100. })
  101. })
  102. })
  103. .catch(error => {
  104. this.$util.msg(error.msg, 2000)
  105. })
  106. },
  107. hanldePopupFn(data) {
  108. //监听活动内容
  109. this.popupShow = true
  110. this.handlerPros = data
  111. },
  112. queryLogistics() {
  113. //跳转查询物流页面
  114. this.$api.navigateTo('/pages/user/order/order-logistics?shopOrderId=' + this.shopOrderId)
  115. },
  116. btnConfirmPay() {
  117. //监听根据付款状态做操作
  118. this.OrderService.OrderPaymentValidation({ shopOrderId: this.shopOrderId })
  119. .then(response => {
  120. if (response.data.code == -1) {
  121. this.$util.modal('', '订单已申请全部退款,无需再付款!', '确定', '', false, () => {})
  122. } else {
  123. this.$api.navigateTo(`/pages/user/order/order-pay-list?shopOrderId=${this.shopOrderId}`,)
  124. }
  125. })
  126. .catch(error => {
  127. this.$util.msg(error.msg, 2000)
  128. })
  129. }
  130. },
  131. onShow() {}
  132. }
  133. </script>
  134. <style lang="scss">
  135. page {
  136. height: auto;
  137. background: #f7f7f7;
  138. }
  139. .details {
  140. padding-bottom: 180rpx;
  141. }
  142. .btn-hover {
  143. background: #ffffff;
  144. }
  145. .animation {
  146. /* transition: transform 0.3s ease;*/
  147. transition-property: transform;
  148. transition-duration: 0.3s;
  149. transition-timing-function: ease;
  150. }
  151. .invoice-balance {
  152. width: 702rpx;
  153. height: auto;
  154. padding: 0 24rpx;
  155. background: #ffffff;
  156. float: left;
  157. margin-top: 24rpx;
  158. margin-bottom: 24rpx;
  159. .balabce-t {
  160. width: 100%;
  161. height: 86rpx;
  162. line-height: 86rpx;
  163. font-size: $font-size-28;
  164. color: $text-color;
  165. float: left;
  166. .balabce-t-le {
  167. float: left;
  168. font-weight: bold;
  169. }
  170. .balabce-t-ri {
  171. float: right;
  172. display: flex;
  173. align-items: center;
  174. .money {
  175. display: flex;
  176. float: left;
  177. }
  178. .checkbox-box {
  179. display: flex;
  180. width: 60rpx;
  181. float: left;
  182. height: 100%;
  183. font-size: $font-size-24;
  184. .checkbox {
  185. width: 40rpx;
  186. text-align: right;
  187. box-sizing: border-box;
  188. text-align: center;
  189. text-decoration: none;
  190. border-radius: 0;
  191. -webkit-tap-highlight-color: transparent;
  192. overflow: hidden;
  193. }
  194. }
  195. }
  196. }
  197. .balabce-b {
  198. width: 100%;
  199. float: left;
  200. overflow: hidden;
  201. .balabce-b-text {
  202. width: 100%;
  203. line-height: 58rpx;
  204. font-size: $font-size-24;
  205. color: #ff2a2a;
  206. text-align: right;
  207. float: right;
  208. }
  209. &.balabce-b--hide {
  210. padding: 0 0;
  211. height: 0px;
  212. line-height: 0px;
  213. }
  214. }
  215. }
  216. .button-content {
  217. width: 702rpx;
  218. padding: 0 24rpx;
  219. height: auto;
  220. background: #ffffff;
  221. position: fixed;
  222. bottom: 0;
  223. left: 0;
  224. .btn {
  225. width: 160rpx;
  226. height: 64rpx;
  227. margin: 22rpx;
  228. line-height: 64rpx;
  229. font-size: $font-size-26;
  230. color: #ffffff;
  231. text-align: center;
  232. float: right;
  233. border-radius: 32rpx;
  234. }
  235. .btn-query {
  236. background: linear-gradient(135deg, rgba(255, 212, 129, 1) 0%, rgba(198, 129, 0, 1) 100%);
  237. }
  238. .btn-cancel {
  239. background: #ffffff;
  240. color: #666666;
  241. float: left;
  242. // margin: 22rpx 0;
  243. margin-right: 15rpx;
  244. border: 2rpx solid #999999;
  245. }
  246. }
  247. </style>