index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="flex-direction plr-100-30 box-sizing-border">
  3. <view class="align-items-center flex-justify-center pt-50 mb-20">
  4. <view class="sys-color-547BFA sys-size-32">
  5. ¥
  6. </view>
  7. <view class="sys-color-547BFA sys-size-64 sys-weight-bold">
  8. {{orderInfo.pay_money || '0.00'}}
  9. </view>
  10. </view>
  11. <view class="align-items-center flex-justify-center cg-box">
  12. <uni-icons v-if="orderInfo.status === 2 || orderInfo.status === 6" class="mr-10" type="checkbox-filled" size="25" color="#547BFA"></uni-icons>
  13. <uni-icons v-else class="mr-10" type="clear" size="25" color="#FF0000"></uni-icons>
  14. <view class="" v-if="orderInfo.status === 2 || orderInfo.status === 6">
  15. 支付成功
  16. </view>
  17. <view class="" v-else>
  18. 支付失败
  19. </view>
  20. </view>
  21. <view class="align-items-center flex-justify-space mb-20">
  22. <view class="sys-color-AD flex-shrink0 mr-20">
  23. 商户名称
  24. </view>
  25. <view class="sys-size-28">
  26. {{orderInfo.shop_name || '无'}}
  27. </view>
  28. </view>
  29. <view class="align-items-center flex-justify-space mb-20">
  30. <view class="sys-color-AD flex-shrink0 mr-20">
  31. 订单号
  32. </view>
  33. <view class="sys-size-28">
  34. {{orderInfo.rs_sn || '无'}}
  35. </view>
  36. </view>
  37. <!-- <view class="align-items-center flex-justify-space mb-64">
  38. <view class="sys-color-AD flex-shrink0 mr-20">
  39. 交易流水号
  40. </view>
  41. <view class="sys-size-28">
  42. {{orderInfo.pay_sn}}
  43. </view>
  44. </view> -->
  45. <view class="flex-justify-center pb-24">
  46. <view @click="jumpOut" class="but-box border-449470 sys-radius-200 text-align-center sys-color-195E3F">
  47. 返回首页
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import {
  54. shopOrderInfo,
  55. shopAutomaticCancel
  56. } from '@/api/shop_order';
  57. export default {
  58. components: {},
  59. data() {
  60. return {
  61. orderInfo: {}
  62. }
  63. },
  64. onLoad(data) {
  65. var mchData = {
  66. action: 'onIframeReady',
  67. displayStyle: 'SHOW_CUSTOM_PAGE'
  68. };
  69. var postData = JSON.stringify(mchData);
  70. parent.postMessage(postData, "https://payapp.weixin.qq.com");
  71. if (data.order_sn) {
  72. this.shopOrderInfo(data.order_sn)
  73. }
  74. },
  75. mounted() {},
  76. methods: {
  77. shopOrderInfo(order) {
  78. shopOrderInfo({
  79. order_sn: order
  80. }).then((res) => {
  81. if (res.code === 1) {
  82. this.orderInfo = res.data
  83. if (res.data.status === 1) {
  84. this.shopAutomaticCancel(res.data.rs_sn)
  85. }
  86. }
  87. })
  88. },
  89. jumpOut() {
  90. var mchData = {
  91. action: 'jumpOut',
  92. jumpOutUrl: "https://wap.jhcs888.com/#/pages/index-my/index"
  93. }
  94. var postData = JSON.stringify(mchData)
  95. parent.postMessage(postData, 'https://payapp.weixin.qq.com')
  96. },
  97. shopAutomaticCancel(order_sn) {
  98. shopAutomaticCancel({
  99. order_sn: order_sn
  100. }).then((res) => {
  101. if (res.code === 1) {
  102. console.log(res, 'ok');
  103. }
  104. })
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .plr-100-30 {
  111. padding: 0 8%;
  112. }
  113. .pt-50 {
  114. padding-top: 50rpx;
  115. }
  116. .cg-box {
  117. padding-bottom: 50rpx;
  118. border-bottom: 1rpx solid #F5F5F5;
  119. margin-bottom: 50rpx;
  120. }
  121. .but-box {
  122. width: 40%;
  123. padding: 15rpx 0;
  124. }
  125. </style>