order-sharedetails.vue 6.7 KB

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