index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="ezy-zhuanti-page">
  3. <view class="zt-qipao-box">
  4. <!-- wgy看这↓ 如果是游客的话不显示text标签内容-->
  5. <view>寻觅者<text>"小小同学"</text></view>
  6. <view>形容一下你的心情吧?</view>
  7. </view>
  8. <view class="zt-biaoqing-box">
  9. <view v-for="(item,index) in biaoqingList" :key="index" @click="goZhuantiInfo(item)"
  10. class="biaoqing-item-box"></view>
  11. </view>
  12. <CustomTabBar :currentTabNumber="1"></CustomTabBar>
  13. </view>
  14. </template>
  15. <script setup>
  16. import {
  17. toast,
  18. getUserIdentity
  19. } from "@/utils/common";
  20. import cacheManager from '@/utils/cacheManager.js';
  21. import {
  22. } from '@/api/zhuanti.js'
  23. import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
  24. import {
  25. reactive,
  26. ref
  27. } from "vue";
  28. import {
  29. onLoad
  30. } from '@dcloudio/uni-app';
  31. const youkeFlag = ref(null);
  32. const yhName = ref(null);
  33. const biaoqingList = ref(
  34. [{
  35. name: '开心',
  36. type: 1
  37. },
  38. {
  39. name: '愤怒',
  40. type: 2
  41. },
  42. {
  43. name: '悲伤',
  44. type: 3
  45. },
  46. {
  47. name: '害怕',
  48. type: 4
  49. },
  50. {
  51. name: '得意',
  52. type: 5
  53. },
  54. {
  55. name: '嫉妒',
  56. type: 6
  57. },
  58. {
  59. name: '压抑',
  60. type: 7
  61. },
  62. {
  63. name: '抱怨',
  64. type: 8
  65. }
  66. ]
  67. )
  68. onLoad((options) => {
  69. if (cacheManager.get('auth')) {
  70. youkeFlag.value = true
  71. yhName.value = cacheManager.get('auth').realName || ''
  72. } else {
  73. // 游客
  74. youkeFlag.value = false
  75. }
  76. })
  77. function goZhuantiInfo(data) {
  78. console.log('data', data);
  79. uni.redirectTo({
  80. url: '/pages/zhuanti/zhuantiInfo?type=' + data.type
  81. })
  82. }
  83. </script>