success.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="success-box">
  3. <view class="box-1"></view>
  4. <view class="img-1">
  5. <image class="img-2" src="@/static/img/s-2.png" mode="scaleToFill"></image>
  6. <view class="text-align-center fs-32 fc-3 fw-400 mb-25 ">支付成功</view>
  7. <view class="text-align-center fs-42 fc-3 fw-b mb-120 ">¥{{totalPrice}}</view>
  8. <view class="fs-30 text-align-center fc-6 fw-400 ">请取走你的小票和商品</view>
  9. </view>
  10. <view class="box-border-box box-2">
  11. <view class="" @click="buy()">继续购买</view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. projectWriteDiscount
  18. } from '@/api/project.js';
  19. export default {
  20. data() {
  21. return {
  22. totalPrice: '', //实付款
  23. money: '', //原价
  24. discount: '',
  25. invite_code: '',
  26. shop_id: '',
  27. }
  28. },
  29. onShow(){
  30. uni.$on('mqttEmit',(e)=>{
  31. this.totalPrice = e*1
  32. })
  33. },
  34. onLoad(e) {
  35. if (e.amount) {
  36. this.totalPrice = e.amount*1
  37. } else {
  38. if (e.discount * 1 > 0) {
  39. this.totalPrice = (((e.money * 1) * (e.discount * 1) * 100).toFixed(2) / 100).toFixed(2);
  40. let num1 = e.money * 1
  41. let num2 = e.discount * 1
  42. this.totalPrice = (((num1 * num2 * 10000) / 100).toFixed(0) / 100).toFixed(2)
  43. } else {
  44. this.totalPrice = e.money;
  45. }
  46. this.money = e.money;
  47. this.invite_code = e.invite_code;
  48. this.discount = e.discount;
  49. }
  50. },
  51. methods: {
  52. buy() {
  53. uni.reLaunch({
  54. url: '/pages/index/index'
  55. })
  56. },
  57. },
  58. }
  59. </script>
  60. <style scoped lang="scss">
  61. .success-box {
  62. width: 100%;
  63. height: 100vh;
  64. background-color: #F2F3F5;
  65. position: relative;
  66. .box-2 {
  67. margin-top: 600rpx;
  68. padding: 0 40rpx;
  69. view {
  70. width: 46%;
  71. height: 83rpx;
  72. line-height: 83rpx;
  73. border-radius: 69rpx;
  74. border: 2rpx solid #1778FD;
  75. text-align: center;
  76. color: #1778FD;
  77. font-size: 32rpx;
  78. margin: 0 auto;
  79. }
  80. }
  81. .box-1 {
  82. width: 750rpx;
  83. height: 272rpx;
  84. background: #0473CF;
  85. border-radius: 0 0 100rpx 100rpx;
  86. }
  87. .img-1 {
  88. background: url('@/static/img/s-1.png') no-repeat;
  89. background-size: 100% 100%;
  90. position: absolute;
  91. top: 185rpx;
  92. left: 48rpx;
  93. width: 650rpx;
  94. height: 610rpx;
  95. z-index: 0;
  96. box-sizing: border-box;
  97. padding-top: 78rpx;
  98. }
  99. .img-2 {
  100. width: 160rpx;
  101. height: 127rpx;
  102. margin: 0 auto 35rpx auto;
  103. z-index: 2;
  104. }
  105. .mb-120 {
  106. margin-bottom: 140rpx;
  107. }
  108. }
  109. </style>