zhifutanchuan.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view :style="{ top: 0 }" class="z-popup">
  3. <view class="zhuangtaitubiao" v-if="[1].includes(type)">
  4. <image src="@/static/common/jiazai.gif" mode="aspectFill" style="width: 240rpx; height: 240rpx"></image>
  5. <view class="textclass"> 支付中请耐心等待 </view>
  6. </view>
  7. <view class="zhuangtaitubiao" v-if="[2].includes(type)">
  8. <view class="icon">
  9. <text class="iconfont icon-chenggong true" style="font-size: 100rpx; color: greenyellow"></text>
  10. </view>
  11. <view class="textclass"> 支付成功 </view>
  12. <view class="textclass" style="margin-top: 20rpx"> ¥{{ detail.totalAmount }} </view>
  13. </view>
  14. <view class="zhuangtaitubiao" v-if="[3, 4].includes(type)">
  15. <view class="icon">
  16. <text class="iconfont icon-shibai false" style="font-size: 100rpx; color: red"></text>
  17. </view>
  18. <view class="textclass"> 支付失败 </view>
  19. <view class="textclass" style="margin-top: 20rpx"> ¥{{ detail.totalAmount }} </view>
  20. </view>
  21. <view class="zhuangtaitubiao" style="justify-content: flex-start !important" v-if="[2].includes(type)">
  22. <view class="title">支付信息</view>
  23. <view class="row">
  24. <view class="label">支付单号:</view>
  25. <view class="value">{{ orderId }}</view>
  26. </view>
  27. <view class="row">
  28. <view class="label">支付金额:</view>
  29. <view class="price">¥{{ detail.totalAmount || '' }}</view>
  30. </view>
  31. <view class="row">
  32. <view class="label">支付时间:</view>
  33. <view class="value">{{ detail.payTime || '' }}</view>
  34. </view>
  35. <view class="row">
  36. <view class="label">支付结果:</view>
  37. <view class="value">成功</view>
  38. </view>
  39. <view class="row">
  40. <view class="label">支付方式:</view>
  41. <!-- <view class="value">微信支付</view> -->
  42. <view class="value">线下支付</view>
  43. </view>
  44. </view>
  45. <view class="anniukuang" v-if="[1].includes(type)">
  46. <u-button text="取消" @click="back"></u-button>
  47. </view>
  48. <view class="anniukuang" v-if="[1, 3, 4].includes(type)">
  49. <u-button type="primary" text="重新扫描" @click="scan"></u-button>
  50. </view>
  51. <view class="anniukuang" v-if="[2].includes(type)">
  52. <u-button type="primary" text="返回订单" @click="back"></u-button>
  53. </view>
  54. <view class="anniukuang" v-if="[3].includes(type)">
  55. <u-button type="primary" text="查询支付结果" @click="KeepWaiting"></u-button>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. props: {
  62. detail: {
  63. type: Object,
  64. default: () => ({})
  65. },
  66. orderId: {
  67. type: [String, Number],
  68. default: ''
  69. },
  70. state: {
  71. type: [String, Number],
  72. default: 0
  73. }
  74. },
  75. data() {
  76. return {
  77. type: this.state,
  78. miao: 30
  79. }
  80. },
  81. watch: {
  82. state() {
  83. if (this.state == 2) {
  84. if (this.timeId) {
  85. clearTimeout(this.timeId)
  86. }
  87. this.$emit('offTiming')
  88. }
  89. this.type = this.state
  90. },
  91. miao: {
  92. handler(newVal, oldVal) {
  93. if (newVal > 0) {
  94. if (this.timeId) {
  95. clearTimeout(this.timeId)
  96. }
  97. this.timeId = setTimeout(() => {
  98. this.miao--
  99. }, 1000)
  100. } else if (this.state != 2) {
  101. this.type = 3
  102. }
  103. },
  104. immediate: true
  105. }
  106. },
  107. methods: {
  108. scan() {
  109. if (this.timeId) {
  110. clearTimeout(this.timeId)
  111. }
  112. this.$emit('scan')
  113. },
  114. KeepWaiting() {
  115. this.type = 1
  116. this.miao = 30
  117. },
  118. back() {
  119. if (this.timeId) {
  120. clearTimeout(this.timeId)
  121. }
  122. this.$emit('back')
  123. }
  124. }
  125. }
  126. </script>
  127. <style scoped lang="scss">
  128. .z-popup {
  129. position: fixed;
  130. background: #efefef;
  131. width: 100%;
  132. height: 100vh;
  133. z-index: 1000000000;
  134. left: 0;
  135. right: 0;
  136. transition: top 0.5s;
  137. box-sizing: border-box;
  138. padding: 40rpx;
  139. .zhuangtaitubiao {
  140. width: 100%;
  141. height: auto;
  142. box-sizing: border-box;
  143. padding: 40rpx;
  144. background: #fff;
  145. border-radius: 20rpx;
  146. margin-bottom: 50rpx;
  147. display: flex;
  148. justify-content: center;
  149. align-items: center;
  150. flex-direction: column;
  151. .textclass {
  152. font-size: 42rpx;
  153. font-weight: 500;
  154. }
  155. }
  156. .anniukuang {
  157. width: 100%;
  158. margin-bottom: 20rpx;
  159. }
  160. .title {
  161. font-size: 32rpx;
  162. font-weight: 500;
  163. align-items: left;
  164. }
  165. .row {
  166. display: flex;
  167. align-items: left;
  168. margin-top: 30rpx;
  169. width: 100%;
  170. .label {
  171. color: $sec-font;
  172. }
  173. .price {
  174. color: $minor-color;
  175. font-weight: 500;
  176. }
  177. }
  178. }
  179. </style>