index.vue 3.0 KB

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