pay.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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="">
  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 = 2
  41. this.id = option.id
  42. },
  43. onShow() {
  44. this.flag++
  45. },
  46. methods: {
  47. qxPay() {
  48. this.flag = 0
  49. },
  50. finishPay() {
  51. this.$request.baseRequest('wuyeAmountInfoApp', 'update', {
  52. wuyeAmountInfo: JSON.stringify({
  53. id: this.id,
  54. totalActualPayment: this.price
  55. })
  56. }, failres => {
  57. this.$refs.uToast.show({
  58. type: 'error',
  59. message: failres.errmsg,
  60. })
  61. uni.hideLoading()
  62. }).then(res => {
  63. uni.navigateTo({
  64. url: '/pages/index/index'
  65. })
  66. })
  67. }
  68. },
  69. }
  70. </script>
  71. <style lang="scss">
  72. .content {
  73. padding: 20rpx;
  74. }
  75. .img {
  76. display: flex;
  77. justify-content: center;
  78. margin-top: 20rpx
  79. }
  80. .row {
  81. margin-top: 20rpx;
  82. display: flex;
  83. }
  84. .row3 {
  85. margin: 40rpx;
  86. }
  87. .pay-btn {
  88. padding: 40rpx 20rpx;
  89. width: 80vw;
  90. display: flex;
  91. .btn {
  92. margin: 0 10rpx;
  93. }
  94. }
  95. </style>