xueba.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <g-toast :is-show="isShowToast">
  3. <view class="toast_container xueba_toast" @click="toChallenge">
  4. <image class="bg" src="https://api.jiuweiyun.cn/public/uploads/icon/toast7.png"></image>
  5. <view class="text">{{ serverUserInfo.level_name }}学霸</view>
  6. </view>
  7. </g-toast>
  8. </template>
  9. <script>
  10. import { toClieckedToast } from "../../utils/api/toast.js"
  11. import GToast from "../../components/global/toast.vue"
  12. export default {
  13. components: {
  14. GToast
  15. },
  16. data() {
  17. return {
  18. serverUserInfo: uni.getStorageSync("serverUserInfo"),
  19. initToast: true
  20. }
  21. },
  22. computed: {
  23. isShowToast() {
  24. let { max_popovers } = this.serverUserInfo
  25. return this.initToast && max_popovers && max_popovers.type === 10
  26. }
  27. },
  28. methods: {
  29. // 学霸跳转荣誉殿堂
  30. toChallenge() {
  31. let { max_popovers } = this.serverUserInfo
  32. toClieckedToast({
  33. id: max_popovers.id
  34. }).then(res => {
  35. this.serverUserInfo.max_popovers = {}
  36. uni.setStorage({
  37. key: "serverUserInfo",
  38. data: this.serverUserInfo,
  39. success() {
  40. uni.navigateTo({
  41. url: "../../honor/index"
  42. })
  43. }
  44. })
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style scoped lang="scss">
  51. .toast_container {
  52. position: relative;
  53. margin: 0 auto;
  54. .bg {
  55. width: 100%;
  56. height: 100%;
  57. }
  58. &.xueba_toast {
  59. width: 662rpx;
  60. height: 685rpx;
  61. .text {
  62. width: 416rpx;
  63. text-align: center;
  64. height: 112rpx;
  65. line-height: 112rpx;
  66. color: #FFFFFF;
  67. font-size: 58rpx;
  68. position: absolute;
  69. left: 50%;
  70. bottom: 0;
  71. transform: translate(-50%, -230rpx);
  72. }
  73. }
  74. }
  75. </style>