裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
2.3 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="page">
  3. <image src="../../static/image/home/bg.png" class="bg" mode="scaleToFill"></image>
  4. <view class="content">
  5. <navbar title="首页" bgColor="transparent" color="#FFFFFF" />
  6. <view class="btns">
  7. <button
  8. v-for="item in list"
  9. :key="item.title"
  10. class="btn"
  11. plain
  12. @click="onClick(item.path)"
  13. >
  14. {{ item.title }}
  15. </button>
  16. </view>
  17. </view>
  18. <tabber select="home"/>
  19. </view>
  20. </template>
  21. <script>
  22. import { mapState } from 'vuex'
  23. import tabber from '@/components/base/tabbar.vue'
  24. export default {
  25. components : {
  26. tabber,
  27. },
  28. data() {
  29. return {
  30. list: [
  31. {
  32. title: '个人分享',
  33. path: '/pages_order/record/personalSharing'
  34. },
  35. {
  36. title: '视频分享',
  37. path: '/pages_order/record/videoSharing'
  38. },
  39. {
  40. title: '群分享',
  41. path: '/pages_order/record/groupSharing'
  42. },
  43. {
  44. title: '文章分享',
  45. path: '/pages_order/record/articleSharing'
  46. },
  47. ],
  48. bgUrl: null,
  49. }
  50. },
  51. computed: {
  52. ...mapState(['userInfo']),
  53. },
  54. onShow() {
  55. this.fetchBg()
  56. },
  57. onLoad() {
  58. if (uni.getStorageSync('token') && !this.userInfo?.id) {
  59. this.$store.commit('getUserInfo')
  60. }
  61. },
  62. methods: {
  63. async fetchBg() {
  64. try {
  65. // todo: check
  66. this.bgUrl = (await this.$fetch('getBanner'))?.[0]?.image
  67. } catch (err) {
  68. }
  69. },
  70. onClick(url) {
  71. if (!uni.getStorageSync('token')) {
  72. uni.navigateTo({
  73. url: '/pages_order/auth/wxLogin'
  74. })
  75. return
  76. }
  77. this.$utils.navigateTo(url)
  78. }
  79. },
  80. }
  81. </script>
  82. <style scoped lang="scss">
  83. .page{
  84. & /deep/ .uv-icon__icon{
  85. font-size: 30rpx !important;
  86. }
  87. position: relative;
  88. height: 100vh;
  89. overflow: hidden;
  90. .btns {
  91. display: grid;
  92. grid-column-gap: 34rpx;
  93. grid-row-gap: 34rpx;
  94. grid-template-columns: repeat(2, 1fr);
  95. position: absolute;
  96. bottom: 466rpx;
  97. width: 100%;
  98. padding: 0 58rpx;
  99. box-sizing: border-box;
  100. }
  101. .btn {
  102. color: $uni-text-color-highlight;
  103. border-color: #04D6A3;
  104. width: 100%;
  105. padding: 55rpx 0;
  106. }
  107. }
  108. .bg {
  109. width: 100vw;
  110. height: 100vh;
  111. }
  112. .content {
  113. position: absolute;
  114. width: 100vw;
  115. height: 100vh;
  116. top: 0;
  117. }
  118. </style>