detail.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="container">
  3. <u-navbar :placeholder="true" bgColor="#fff" leftIconSize="0" :autoBack="true" :border="true" title="兑换成功"></u-navbar>
  4. <view class="item">
  5. <view class="item-one">兑换成功</view>
  6. <view class="item-two">商品已成功兑换,当前盲豆数量: {{ 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. .container {
  53. height: 100vh;
  54. }
  55. .item {
  56. text-align: center;
  57. &-one {
  58. margin-top: 228rpx;
  59. color: #F9822C;
  60. font-size: 40rpx;
  61. line-height: 40rpx;
  62. font-weight: bold;
  63. }
  64. &-two {
  65. margin-top: 32rpx;
  66. color: #333;
  67. font-size: 26rpx;
  68. line-height: 26rpx;
  69. }
  70. &-three {
  71. margin-top: 80rpx;
  72. width: 600rpx;
  73. height: 88rpx;
  74. line-height: 88rpx;
  75. text-align: center;
  76. background: #F9822C;
  77. border-radius: 44rpx;
  78. color: #fff;
  79. font-size: 34rpx;
  80. }
  81. &-four {
  82. margin-top: 54rpx;
  83. width: 600rpx;
  84. height: 88rpx;
  85. line-height: 88rpx;
  86. text-align: center;
  87. border: 1px solid #F9822C;
  88. background: #fff;
  89. color: #F9822C;
  90. border-radius: 44rpx;
  91. font-size: 34rpx;
  92. }
  93. }
  94. </style>