success.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="">
  3. <view class="content">
  4. <view class="content-top">恭喜您!兑换成功!</view>
  5. <image src="@/static/images/gift/success.png" mode="widthFix" class="success"></image>
  6. <view class="content-middle">
  7. 消耗金额:<text style="color: #EA4A41;margin-left: 20rpx;">{{jifen}}</text>
  8. </view>
  9. <view class="content-middle">
  10. 还剩积分:<text style="color: #EA4A41;margin-left: 20rpx;">{{user_jifen}}</text>
  11. </view>
  12. <view class="content-bottom">
  13. <view class="goon" @click="goHome">
  14. 返回首页
  15. </view>
  16. <view class="check" @click="check">
  17. 查看兑换记录
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. totalPrice: '1830'
  28. }
  29. },
  30. computed: {
  31. userServerInfo() {
  32. //用户服务器信息
  33. return this.$store.state.userinfo;
  34. },
  35. },
  36. onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
  37. this.user_jifen = option.user_jifen
  38. this.jifen = option.jifen
  39. this.getUserInfo()
  40. },
  41. methods: {
  42. //获取当前用户的信息
  43. getUserInfo() {
  44. this.$u.get('/base/auth/me').then(res => {
  45. this.$u.vuex('vuex_user', res.data)
  46. })
  47. },
  48. goHome() {
  49. uni.switchTab({
  50. url: '/pages/index/index'
  51. })
  52. },
  53. //继续兑换
  54. goon() {
  55. uni.reLaunch({
  56. url: '/pages/gift/index'
  57. })
  58. },
  59. //兑换记录
  60. check() {
  61. uni.reLaunch({
  62. url: '/pages/gift/record'
  63. })
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. // page{
  70. // background-color: #fff;
  71. // }
  72. .content {
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. justify-content: center;
  77. .success {
  78. width: 275px;
  79. height: 148px;
  80. }
  81. &-top {
  82. margin-top: 150rpx;
  83. color: #333;
  84. font-weight: bold;
  85. font-size: 36rpx;
  86. }
  87. image {
  88. margin-top: 30rpx;
  89. margin-bottom: 20px;
  90. }
  91. &-middle {
  92. font-size: 36rpx;
  93. color: #333;
  94. font-weight: bold;
  95. }
  96. &-bottom {
  97. display: flex;
  98. margin-top: 72rpx;
  99. .goon {
  100. width: 300rpx;
  101. line-height: 88rpx;
  102. color: #FB231F;
  103. border-radius: 44rpx;
  104. border: 2rpx #FB231F solid;
  105. background-color: #FFF4F3;
  106. text-align: center;
  107. }
  108. .check {
  109. width: 300rpx;
  110. color: #fff;
  111. line-height: 88rpx;
  112. margin-left: 40rpx;
  113. border-radius: 44rpx;
  114. background: linear-gradient(93deg, #F97C55 0%, #F44545 100%);
  115. text-align: center;
  116. }
  117. }
  118. }
  119. </style>