detail.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="container">
  3. <view class="item">
  4. <view class="item-one">兑换成功</view>
  5. <view class="item-two">已成功兑换商品,去商城看看吧</view>
  6. <view class="item-twotwo">当前盲豆余额:{{coinNum}}</view>
  7. <button class="item-three" @click="toCore()">去商城看看</button>
  8. <button class="item-four" @click="toPrize()">进入仓库</button>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import $http from '@/utils/request.js'
  14. export default {
  15. data() {
  16. return {
  17. coinNum:'',
  18. }
  19. },
  20. onShow() {
  21. this.getBean()
  22. },
  23. methods: {
  24. getBean() {
  25. uni.showLoading({
  26. title: '加载中'
  27. });
  28. $http.post('/api/v1/mp/user/mine/init', {}).then(res => {
  29. uni.hideLoading();
  30. if (res.code == 0) {
  31. this.coinNum = res.data.coinNum
  32. }
  33. }).catch(() => {
  34. uni.hideLoading();
  35. })
  36. },
  37. toCore() {
  38. uni.switchTab({
  39. url: '/pages/core/index'
  40. })
  41. },
  42. toPrize() {
  43. uni.navigateBack({
  44. delta: 1
  45. })
  46. },
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .container {
  52. height: 100vh;
  53. }
  54. .item {
  55. text-align: center;
  56. &-one {
  57. margin-top: 400rpx;
  58. color: #F9822C;
  59. font-size: 40rpx;
  60. line-height: 40rpx;
  61. font-weight: bold;
  62. }
  63. &-two {
  64. margin-top: 32rpx;
  65. color: #333;
  66. font-size: 26rpx;
  67. line-height: 26rpx;
  68. }
  69. &-twotwo {
  70. margin-top: 32rpx;
  71. color: #999999;
  72. font-size: 26rpx;
  73. font-weight: 500;
  74. line-height: 26rpx;
  75. }
  76. &-three {
  77. margin-top: 80rpx;
  78. width: 600rpx;
  79. height: 88rpx;
  80. line-height: 88rpx;
  81. text-align: center;
  82. background: #F9822C;
  83. border-radius: 44rpx;
  84. color: #fff;
  85. font-size: 34rpx;
  86. }
  87. &-four {
  88. margin-top: 54rpx;
  89. width: 600rpx;
  90. height: 88rpx;
  91. line-height: 88rpx;
  92. text-align: center;
  93. border: 1px solid #F9822C;
  94. background: #fff;
  95. color: #F9822C;
  96. border-radius: 44rpx;
  97. font-size: 34rpx;
  98. }
  99. }
  100. </style>