xuewei.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <g-toast :is-show="isShowToast">
  3. <view class="toast_container xuewei_toast" @click="toHonor">
  4. <image class="bg" src="https://api.jiuweiyun.cn/public/uploads/icon/toast8.png"></image>
  5. <view class="text">{{ serverUserInfo.score | userXueWei }}</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 { glory_popovers } = this.serverUserInfo
  25. return this.initToast && glory_popovers && glory_popovers.toast_id
  26. }
  27. },
  28. methods: {
  29. // 学位弹窗
  30. toHonor() {
  31. let { glory_popovers } = this.serverUserInfo
  32. toClieckedToast({
  33. id: glory_popovers.toast_id
  34. }).then(res => {
  35. this.serverUserInfo.glory_popovers = {}
  36. uni.setStorage({
  37. key: "serverUserInfo",
  38. data: this.serverUserInfo,
  39. success() {
  40. uni.navigateTo({
  41. url: '../../pages/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. &.xuewei_toast {
  59. width: 712rpx;
  60. height: 750rpx;
  61. .text {
  62. font-size: 62rpx;
  63. color: #FFFFFF;
  64. position: absolute;
  65. width: 488rpx;
  66. text-align: center;
  67. height: 104rpx;
  68. line-height: 104rpx;
  69. left: 50%;
  70. margin-left: -244rpx;
  71. bottom: 138rpx;
  72. }
  73. }
  74. }
  75. </style>