pay_result.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="pay-result">
  3. <view class="contain bg-white">
  4. <view class="header flex-col col-center">
  5. <view>
  6. <image class="tips-icon" src="/static/images/icon_success.png"></image>
  7. </view>
  8. <view class="xl m-t-20">订单支付成功</view>
  9. </view>
  10. <view class="info">
  11. <view class="order-num flex row-between m-t-20">
  12. <view>订单编号</view>
  13. <view>
  14. {{payInfo.order_sn}}
  15. </view>
  16. </view>
  17. <view v-if="payInfo.pay_time" class="order-time flex row-between m-t-20">
  18. <view>付款时间</view>
  19. <view>{{payInfo.pay_time}}</view>
  20. </view>
  21. <view class="order-pay-type flex row-between m-t-20">
  22. <view>支付方式</view>
  23. <view>{{payInfo.pay_way}}</view>
  24. </view>
  25. <view class="order-pay-money flex row-between m-t-20">
  26. <view>支付金额</view>
  27. <view>
  28. {{payInfo.total_amount}}
  29. </view>
  30. </view>
  31. </view>
  32. <view class="line m-t-40"></view>
  33. <view class="m-t-40 flex-col row-center">
  34. <router-link :to="getPagesUrl" navType="replace">
  35. <button type="primary" size="lg" class="br60">查看订单</button>
  36. </router-link>
  37. <router-link navType="pushTab" to="/pages/index/index">
  38. <button size="lg" class="br60 plain primary m-t-30">返回首页</button>
  39. </router-link>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import {
  46. getPayResult
  47. } from '@/api/order';
  48. export default {
  49. data() {
  50. return {
  51. payInfo: {},
  52. from: ''
  53. };
  54. },
  55. onLoad() {
  56. const options = this.$Route.query;
  57. console.log(options)
  58. this.id = options.id
  59. this.from = options.from
  60. this.getOrderResultFun();
  61. },
  62. methods: {
  63. getOrderResultFun() {
  64. getPayResult({
  65. id: this.id,
  66. from: this.from,
  67. }).then(res => {
  68. if (res.code == 1) {
  69. this.payInfo = res.data
  70. }
  71. });
  72. },
  73. },
  74. computed: {
  75. getPagesUrl() {
  76. switch(this.from) {
  77. case 'integral': return '/bundle/pages/exchange_order/exchange_order'
  78. default: return '/bundle/pages/user_order/user_order'
  79. }
  80. }
  81. }
  82. };
  83. </script>
  84. <style lang="scss">
  85. .pay-result {
  86. .contain {
  87. border-radius: 10rpx;
  88. padding: 0 30rpx 40rpx;
  89. position: relative;
  90. margin: 78rpx 20rpx 0;
  91. .tips-icon {
  92. width: 112rpx;
  93. height: 112rpx;
  94. }
  95. .header {
  96. position: absolute;
  97. left: 50%;
  98. transform: translateX(-50%);
  99. top: -50rpx;
  100. }
  101. .info {
  102. padding-top: 180rpx;
  103. }
  104. .line {
  105. border-top: $-solid-border;
  106. }
  107. .plain {
  108. border: 1px solid $-color-primary;
  109. }
  110. }
  111. }
  112. </style>