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

181 lines
3.4 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 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 v-for="item in list" :key="item.title" class="btn" plain @click="onClick(item.path)">
  8. {{ item.title }}
  9. </button>
  10. </view>
  11. </view>
  12. <popupAuditMsg ref="popupAuditMsgRef" :count="count"></popupAuditMsg>
  13. <popupActivate ref="popupActivate"></popupActivate>
  14. <tabber select="home" />
  15. </view>
  16. </template>
  17. <script>
  18. import {
  19. mapState
  20. } from 'vuex'
  21. import tabber from '@/components/base/tabbar.vue'
  22. import popupAuditMsg from '@/components/home/popupAuditMsg.vue'
  23. import popupActivate from '@/components/center/popupActivate.vue'
  24. export default {
  25. components: {
  26. tabber,
  27. popupAuditMsg,
  28. popupActivate,
  29. },
  30. data() {
  31. return {
  32. list: [{
  33. title: '个人分享',
  34. path: '/pages_order/record/personalSharing'
  35. },
  36. {
  37. title: '视频分享',
  38. path: '/pages_order/record/videoSharing'
  39. },
  40. {
  41. title: '群分享',
  42. path: '/pages_order/record/groupSharing'
  43. },
  44. {
  45. title: '文章分享',
  46. path: '/pages_order/record/articleSharing'
  47. },
  48. // {
  49. // title: '视频',
  50. // path: '/pages_order/sharing/video?id=1922875315630133249'
  51. // },
  52. ],
  53. count : 0,
  54. }
  55. },
  56. computed: {
  57. ...mapState(['userInfo']),
  58. },
  59. onLoad(option) {
  60. const {
  61. id,
  62. state,
  63. shareId
  64. } = option
  65. if (shareId) {
  66. uni.setStorageSync('shareId', shareId)
  67. }
  68. if (state) {
  69. uni.setStorageSync('state', state)
  70. }
  71. if (id) {
  72. uni.setStorageSync('id', id)
  73. }
  74. if (shareId && !uni.getStorageSync('token')) {
  75. uni.navigateTo({
  76. url: '/pages_order/auth/wxLogin'
  77. })
  78. return
  79. }
  80. if (uni.getStorageSync('token') && !this.userInfo?.id) {
  81. this.$store.commit('getUserInfo')
  82. this.queryShareCount()
  83. }
  84. },
  85. onShow() {
  86. },
  87. methods: {
  88. queryShareCount(){
  89. this.$fetch('queryShareCount')
  90. .then(result => {
  91. if(result > 0){
  92. this.count = result
  93. this.$refs.popupAuditMsgRef.open()
  94. }
  95. })
  96. },
  97. onClick(url) {
  98. if (!uni.getStorageSync('token')) {
  99. uni.navigateTo({
  100. url: '/pages_order/auth/wxLogin'
  101. })
  102. return
  103. }
  104. if (!this.userInfo.isPay) {
  105. this.$refs.popupActivate.open()
  106. return
  107. }
  108. if(this.$dayjs(this.userInfo.endTime).isBefore(this.$dayjs())){
  109. uni.showToast({
  110. title: '代理已过期',
  111. icon: 'none'
  112. })
  113. this.$refs.popupActivate.open(true)
  114. return
  115. }
  116. this.$utils.navigateTo(url)
  117. },
  118. },
  119. }
  120. </script>
  121. <style scoped lang="scss">
  122. .page {
  123. & /deep/ .uv-icon__icon {
  124. font-size: 30rpx !important;
  125. }
  126. position: relative;
  127. height: 100vh;
  128. overflow: hidden;
  129. .btns {
  130. display: grid;
  131. grid-column-gap: 34rpx;
  132. grid-row-gap: 34rpx;
  133. grid-template-columns: repeat(2, 1fr);
  134. position: absolute;
  135. bottom: 360rpx;
  136. width: 100%;
  137. padding: 0 58rpx;
  138. box-sizing: border-box;
  139. }
  140. .btn {
  141. color: $uni-text-color-highlight;
  142. border-color: #04D6A3;
  143. width: 100%;
  144. padding: 55rpx 0;
  145. }
  146. }
  147. .bg {
  148. width: 100vw;
  149. height: 100vh;
  150. }
  151. .content {
  152. position: absolute;
  153. width: 100vw;
  154. height: 100vh;
  155. top: 0;
  156. }
  157. </style>