index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view>
  3. <view>
  4. {{yhName}}
  5. </view>
  6. <view v-for="(item,index) in biaoqingList" :key="index" >
  7. <view @click="goZhuantiInfo(item)">{{item.name}}</view>
  8. <view >{{item.icon}}</view>
  9. </view>
  10. <CustomTabBar :currentTabNumber="1"></CustomTabBar>
  11. </view>
  12. </template>
  13. <script setup>
  14. import {
  15. toast,
  16. getUserIdentity
  17. } from "@/utils/common";
  18. import cacheManager from '@/utils/cacheManager.js';
  19. import {
  20. } from '@/api/zhuanti.js'
  21. import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
  22. import {
  23. reactive,
  24. ref
  25. } from "vue";
  26. import {
  27. onLoad
  28. } from '@dcloudio/uni-app';
  29. const youkeFlag = ref(null);
  30. const yhName = ref(null);
  31. const biaoqingList = ref(
  32. [{
  33. icon: '',
  34. name: '开心',
  35. type: 'kaixin'
  36. },
  37. {
  38. icon: '',
  39. name: '愤怒',
  40. type: 'fennu'
  41. },
  42. {
  43. icon: '',
  44. name: '悲伤',
  45. type: 'beishang'
  46. },
  47. {
  48. icon: '',
  49. name: '害怕',
  50. type: 'haipa'
  51. },
  52. {
  53. icon: '',
  54. name: '得意',
  55. type: 'deyi'
  56. },
  57. {
  58. icon: '',
  59. name: '嫉妒',
  60. type: 'jidu'
  61. },
  62. {
  63. icon: '',
  64. name: '压抑',
  65. type: 'yayi'
  66. },
  67. {
  68. icon: '',
  69. name: '抱怨',
  70. type: 'baoyuan'
  71. }
  72. ]
  73. )
  74. onLoad((options) => {
  75. if (cacheManager.get('auth')) {
  76. youkeFlag.value = true
  77. yhName.value = cacheManager.get('auth').realName || ''
  78. } else {
  79. // 游客
  80. youkeFlag.value = false
  81. }
  82. })
  83. function goZhuantiInfo(data) {
  84. console.log('data', data);
  85. uni.redirectTo({
  86. url: '/pages/zhuanti/zhuantiInfo?type='+data.type
  87. })
  88. }
  89. </script>