user.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!-- 个人中心:支持装修 -->
  2. <template>
  3. <s-layout
  4. title="我的"
  5. tabbar="/pages/index/user"
  6. navbar="custom"
  7. :bgStyle="template.page"
  8. :navbarStyle="template.style?.navbar"
  9. onShareAppMessage
  10. >
  11. <s-block v-for="(item, index) in template.components" :key="index" :styles="item.property.style">
  12. <s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
  13. </s-block>
  14. </s-layout>
  15. </template>
  16. <script setup>
  17. import { computed } from 'vue';
  18. import { onShow, onPageScroll, onPullDownRefresh,onLoad } from '@dcloudio/uni-app';
  19. import sheep from '@/sheep';
  20. import {
  21. closeShareModal,
  22. showAuthModal
  23. } from '@/sheep/hooks/useModal';
  24. // 隐藏原生tabBar
  25. uni.hideTabBar();
  26. const template = computed(() => sheep.$store('app').template.user);
  27. const isLogin = computed(() => sheep.$store('user').isLogin);
  28. onShow(() => {
  29. sheep.$store('user').updateUserData();
  30. });
  31. onPullDownRefresh(() => {
  32. sheep.$store('user').updateUserData();
  33. setTimeout(function () {
  34. uni.stopPullDownRefresh();
  35. }, 800);
  36. });
  37. onPageScroll(() => {});
  38. onLoad((options) => {
  39. // uni.setStorageSync("linkId",74)
  40. // console.log("user.vue设置了缓存",uni.getStorageSync('linkId'))
  41. if (options.linkId) {
  42. uni.setStorageSync("linkId",options.linkId)
  43. if (!isLogin.value) {
  44. showAuthModal('register','register');
  45. }
  46. }
  47. // if (!isLogin.value) {
  48. // showAuthModal();
  49. // }
  50. });
  51. </script>
  52. <style></style>