detail.vue 1.6 KB

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