裂变星小程序-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.

158 lines
2.8 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month 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. <popupAuditMsg ref="popupAuditMsgRef"></popupAuditMsg>
  19. <popupActivate ref="popupActivate"></popupActivate>
  20. <tabber select="home"/>
  21. </view>
  22. </template>
  23. <script>
  24. import { mapState } from 'vuex'
  25. import tabber from '@/components/base/tabbar.vue'
  26. import popupAuditMsg from '@/components/home/popupAuditMsg.vue'
  27. import popupActivate from '@/components/center/popupActivate.vue'
  28. export default {
  29. components : {
  30. tabber,
  31. popupAuditMsg,
  32. popupActivate,
  33. },
  34. data() {
  35. return {
  36. list: [
  37. {
  38. title: '个人分享',
  39. path: '/pages_order/record/personalSharing'
  40. },
  41. {
  42. title: '视频分享',
  43. path: '/pages_order/record/videoSharing'
  44. },
  45. {
  46. title: '群分享',
  47. path: '/pages_order/record/groupSharing'
  48. },
  49. {
  50. title: '文章分享',
  51. path: '/pages_order/record/articleSharing'
  52. },
  53. ],
  54. }
  55. },
  56. computed: {
  57. ...mapState(['userInfo']),
  58. },
  59. onLoad(option) {
  60. const { id, state, shareId } = option
  61. if (shareId) {
  62. uni.setStorageSync('shareId', shareId)
  63. }
  64. if (state) {
  65. uni.setStorageSync('state', state)
  66. }
  67. if (id) {
  68. uni.setStorageSync('id', id)
  69. }
  70. if (shareId && !uni.getStorageSync('token')) {
  71. uni.navigateTo({
  72. url: '/pages_order/auth/wxLogin'
  73. })
  74. return
  75. }
  76. if (uni.getStorageSync('token') && !this.userInfo?.id) {
  77. this.$store.commit('getUserInfo')
  78. }
  79. },
  80. methods: {
  81. onClick(url) {
  82. if (!uni.getStorageSync('token')) {
  83. uni.navigateTo({
  84. url: '/pages_order/auth/wxLogin'
  85. })
  86. return
  87. }
  88. if (!this.userInfo.isPay) {
  89. this.$refs.popupActivate.open()
  90. return
  91. }
  92. this.$utils.navigateTo(url)
  93. }
  94. },
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .page{
  99. & /deep/ .uv-icon__icon{
  100. font-size: 30rpx !important;
  101. }
  102. position: relative;
  103. height: 100vh;
  104. overflow: hidden;
  105. .btns {
  106. display: grid;
  107. grid-column-gap: 34rpx;
  108. grid-row-gap: 34rpx;
  109. grid-template-columns: repeat(2, 1fr);
  110. position: absolute;
  111. bottom: 360rpx;
  112. width: 100%;
  113. padding: 0 58rpx;
  114. box-sizing: border-box;
  115. }
  116. .btn {
  117. color: $uni-text-color-highlight;
  118. border-color: #04D6A3;
  119. width: 100%;
  120. padding: 55rpx 0;
  121. }
  122. }
  123. .bg {
  124. width: 100vw;
  125. height: 100vh;
  126. }
  127. .content {
  128. position: absolute;
  129. width: 100vw;
  130. height: 100vh;
  131. top: 0;
  132. }
  133. </style>