detail.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view>
  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:2,
  45. url: '/packagePrize/prize/index'
  46. })
  47. },
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .item {
  53. text-align: center;
  54. &-one {
  55. margin-top: 450rpx;
  56. color: #F9822C;
  57. font-size: 36rpx;
  58. line-height: 60rpx;
  59. font-weight: 600;
  60. }
  61. &-two {
  62. margin-top: 20rpx;
  63. color: #333;
  64. font-size: 26rpx;
  65. font-weight: 500;
  66. }
  67. &-twotwo {
  68. margin-top: 20rpx;
  69. color: #999999;
  70. font-size: 26rpx;
  71. font-weight: 500;
  72. }
  73. &-three {
  74. margin-top: 230rpx;
  75. width: 540rpx;
  76. height: 84rpx;
  77. line-height: 78rpx;
  78. background-color: #F9822C;
  79. border: 2rpx solid #F9822C;
  80. color: #fff;
  81. font-size: 34rpx;
  82. }
  83. &-four {
  84. margin-top: 34rpx;
  85. width: 536rpx;
  86. height: 80rpx;
  87. line-height: 74rpx;
  88. background-color: #fff;
  89. border: 2rpx solid #bbb;
  90. font-size: 34rpx;
  91. color: #333;
  92. }
  93. }
  94. </style>