pay.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="content">
  3. <view class="">
  4. 长按下方二维码,识别二维码支付!
  5. </view>
  6. <view class="row">
  7. <view class="">
  8. 待付金额:
  9. </view>
  10. <view class="price">
  11. {{price}}元
  12. </view>
  13. </view>
  14. <view class="img">
  15. <image src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/dongfangyu.png" mode="widthFix"></image>
  16. </view>
  17. <view class="row3">
  18. 支付完成后,请点击支付完成按钮!
  19. </view>
  20. <u-popup :show="flag>1" @close="flag=1" mode="center" :closeOnClickOverlay='false' :round="10">
  21. <view class="pay-btn">
  22. <u-button type="primary" text="支付完成" @click="finishPay" class="pay btn"></u-button>
  23. <u-button type="primary" text="取消支付" @click="qxPay" class="pay btn"></u-button>
  24. </view>
  25. </u-popup>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. price: '',
  33. flag: 0
  34. };
  35. },
  36. onLoad(option) {
  37. this.price = option.price
  38. console.log("option", option)
  39. console.log(option)
  40. this.flag = 0
  41. this.id = option.id
  42. },
  43. onShow() {
  44. this.flag++
  45. },
  46. methods: {
  47. qxPay() {
  48. this.flag = 1
  49. },
  50. finishPay() {
  51. this.$request.baseRequest('wuyeAmountInfoApp', 'update', {
  52. wuyeAmountInfo: JSON.stringify({
  53. id: this.id,
  54. totalActualPayment: this.price,
  55. paymentMethod:'在线扫码支付',
  56. })
  57. }, failres => {
  58. this.$refs.uToast.show({
  59. type: 'error',
  60. message: failres.errmsg,
  61. })
  62. uni.hideLoading()
  63. }).then(res => {
  64. uni.navigateTo({
  65. url: '/pages/index/index'
  66. })
  67. })
  68. }
  69. },
  70. }
  71. </script>
  72. <style lang="scss">
  73. .content {
  74. padding: 40rpx;
  75. }
  76. .img {
  77. display: flex;
  78. justify-content: center;
  79. margin-top: 20rpx
  80. }
  81. .row {
  82. margin-top: 20rpx;
  83. display: flex;
  84. }
  85. .price{
  86. font-size: 36rpx;
  87. font-weight: 700;
  88. margin-left: 50rpx;
  89. color:#21d261;
  90. }
  91. .row3 {
  92. margin: 40rpx;
  93. color:red
  94. }
  95. .pay-btn {
  96. padding: 40rpx 20rpx;
  97. width: 80vw;
  98. display: flex;
  99. .btn {
  100. margin: 0 10rpx;
  101. }
  102. }
  103. </style>