index.vue 1.6 KB

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