bank-success.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="flex-direction plr-40-24 box-sizing-border box-b">
  3. <view @click="jumpOut" class="but-box sys-radius-200 text-align-center sys-color-4D72FA sys-size-28 sys-weight-600">
  4. 返回首页
  5. </view>
  6. <view class="align-items-center flex-justify-center cg-box">
  7. <image class="mr-18 icon-img" v-if="orderInfo.status === 2 || orderInfo.status === 6" src="@/static/success.png" mode="scaleToFill" />
  8. <image class="mr-18 icon-img" v-else src="@/static/ts-icon.png" mode="scaleToFill" />
  9. <view class="sys-size-28" v-if="orderInfo.status === 2 || orderInfo.status === 6">
  10. 支付成功
  11. </view>
  12. <view class="sys-size-28" v-else>
  13. 支付失败
  14. </view>
  15. </view>
  16. <view class="align-items-center flex-justify-center pb-32 pay_money-box mb-24">
  17. <view class="sys-color-3 sys-size-60 sys-weight-bold">
  18. ¥
  19. </view>
  20. <view class="sys-color-3 sys-size-60 sys-weight-bold">
  21. {{orderInfo.pay_money || '0.00'}}
  22. </view>
  23. </view>
  24. <view class="align-items-center flex-justify-space mb-24">
  25. <view class="sys-color-9 flex-shrink0 sys-size-28 mr-20">
  26. 商户名称
  27. </view>
  28. <view class="sys-size-28 sys-color-3">
  29. {{orderInfo.shop_name || '无'}}
  30. </view>
  31. </view>
  32. <view class="align-items-center flex-justify-space">
  33. <view class="sys-color-9 flex-shrink0 sys-size-28 mr-20">
  34. 支付订单
  35. </view>
  36. <view class="sys-size-28 sys-color-3">
  37. {{orderInfo.rs_sn || '无'}}
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import { shopOrderInfo, } from '@/http/shop_order';
  44. export default {
  45. components: {},
  46. data() {
  47. return {
  48. orderInfo: {}
  49. }
  50. },
  51. onLoad(data) {
  52. var mchData = {
  53. action: 'onIframeReady',
  54. displayStyle: 'SHOW_CUSTOM_PAGE'
  55. };
  56. var postData = JSON.stringify(mchData);
  57. parent.postMessage(postData, "https://payapp.weixin.qq.com");
  58. if (data.order_sn) {
  59. this.shopOrderInfo(data.order_sn)
  60. }
  61. },
  62. mounted() {},
  63. methods: {
  64. shopOrderInfo(order) {
  65. shopOrderInfo({
  66. order_sn: order
  67. }).then((res) => {
  68. if (res.code === 1) {
  69. this.orderInfo = res.data
  70. }else{
  71. uni.reLaunch({
  72. url:`/pages/error?message=` + res.message
  73. })
  74. }
  75. }).catch((err)=>{
  76. uni.reLaunch({
  77. url:`/pages/error?message=` + ((err && err.message) ? err.message : '查询订单失败')
  78. })
  79. })
  80. },
  81. jumpOut() {
  82. if (this.orderInfo.status === 2 || this.orderInfo.status === 6) {
  83. var mchData = {
  84. action: 'jumpOut',
  85. jumpOutUrl: "https://wap.jhcs888.com/#/pages/index-my/index"
  86. }
  87. var postData = JSON.stringify(mchData)
  88. parent.postMessage(postData, 'https://payapp.weixin.qq.com')
  89. } else {
  90. window.location.href = "https://wap.jhcs888.com/#/pages/index-my/index"
  91. }
  92. },
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .icon-img{
  98. width: 48rpx;
  99. height: 48rpx;
  100. }
  101. .flex-direction {
  102. display: flex;
  103. flex-direction: column;
  104. }
  105. .box-sizing-border {
  106. box-sizing: border-box;
  107. }
  108. .sys-radius-200 {
  109. border-radius: 200rpx;
  110. }
  111. .text-align-center {
  112. text-align: center;
  113. }
  114. .sys-color-4D72FA {
  115. color: #4D72FA;
  116. }
  117. .sys-size-28 {
  118. font-size: 28rpx;
  119. }
  120. .sys-weight-600 {
  121. font-weight: 600;
  122. }
  123. .align-items-center {
  124. display: flex;
  125. align-items: center;
  126. }
  127. .flex-justify-center {
  128. display: flex;
  129. justify-content: center;
  130. }
  131. .pb-32 {
  132. padding-bottom: 32rpx;
  133. }
  134. .mb-24 {
  135. margin-bottom: 24rpx;
  136. }
  137. .sys-color-3489FF {
  138. color: #3489FF;
  139. }
  140. .sys-size-60 {
  141. font-size: 60rpx;
  142. }
  143. .sys-weight-bold {
  144. font-weight: bold;
  145. }
  146. .flex-justify-space {
  147. display: flex;
  148. justify-content: space-between;
  149. }
  150. .flex-shrink0 {
  151. flex-shrink: 0;
  152. }
  153. .sys-color-9 {
  154. color: #999;
  155. }
  156. .box-b{
  157. position: relative;
  158. }
  159. .plr-40-24 {
  160. padding: 24rpx 40rpx 0;
  161. }
  162. .pt-50 {
  163. padding-top: 50rpx;
  164. }
  165. .cg-box {
  166. padding-bottom: 8rpx;
  167. padding-top: 32rpx;
  168. }
  169. .pay_money-box {
  170. border-bottom: 1rpx solid #F5F5F5;
  171. }
  172. .but-box {
  173. width: 148rpx;
  174. height: 48rpx;
  175. line-height: 48rpx;
  176. border: 1rpx solid #4D72FA;
  177. position: absolute;
  178. right: 40rpx;
  179. top: 40rpx;
  180. }
  181. </style>