success.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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 {projectWriteDiscount} from '@/api/project.js';
  17. export default {
  18. data(){
  19. return{
  20. totalPrice:'',//实付款
  21. money:'',//原价
  22. discount:'',
  23. invite_code:'',
  24. shop_id:'',
  25. }
  26. },
  27. onLoad(e) {
  28. this.shop_id = uni.getStorageSync('shop_id')
  29. if(this.shop_id == 299){
  30. this.upData();
  31. }
  32. if(e.discount*1 > 0){
  33. this.totalPrice = (((e.money*1)*(e.discount*1)*100).toFixed(2)/100).toFixed(2);
  34. let num1 = e.money*1
  35. let num2 = e.discount*1
  36. this.totalPrice = (((num1*num2*10000)/100).toFixed(0)/100).toFixed(2)
  37. }else{
  38. this.totalPrice = e.money;
  39. }
  40. this.money = e.money;
  41. this.invite_code = e.invite_code;
  42. this.discount = e.discount;
  43. },
  44. methods:{
  45. buy(){
  46. uni.reLaunch({
  47. url:'/pages/index/index'
  48. })
  49. },
  50. upData(){
  51. projectWriteDiscount({order_money:this.money,invite_code:this.invite_code,discount:this.discount}).then((res)=>{})
  52. },
  53. },
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .success-box{
  58. width: 100%;
  59. height: 100vh;
  60. background-color: #F2F3F5;
  61. position: relative;
  62. .box-2{
  63. margin-top: 600rpx;
  64. padding: 0 40rpx;
  65. view{
  66. width: 46%;
  67. height: 83rpx;
  68. line-height: 83rpx;
  69. border-radius: 69rpx;
  70. border: 2rpx solid #1778FD;
  71. text-align: center;
  72. color: #1778FD;
  73. font-size: 32rpx;
  74. margin: 0 auto;
  75. }
  76. }
  77. .box-1{
  78. width: 750rpx;
  79. height: 272rpx;
  80. background: #0473CF;
  81. border-radius: 0 0 100rpx 100rpx;
  82. }
  83. .img-1{
  84. background: url('@/static/img/s-1.png') no-repeat;
  85. background-size: 100% 100%;
  86. position: absolute;
  87. top: 185rpx;
  88. left: 48rpx;
  89. width: 650rpx;
  90. height: 610rpx;
  91. z-index: 0;
  92. box-sizing: border-box;
  93. padding-top: 78rpx;
  94. }
  95. .img-2{
  96. width: 160rpx;
  97. height: 127rpx;
  98. margin: 0 auto 35rpx auto;
  99. z-index: 2;
  100. }
  101. .mb-120{
  102. margin-bottom: 140rpx;
  103. }
  104. }
  105. </style>