index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. <tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
  14. </view>
  15. </template>
  16. <script setup>
  17. import {
  18. toast,
  19. getUserIdentity
  20. } from "@/utils/common";
  21. import cacheManager from '@/utils/cacheManager.js';
  22. import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
  23. import {
  24. } from '@/api/zhuanti.js'
  25. import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
  26. import {
  27. reactive,
  28. ref
  29. } from "vue";
  30. import {
  31. onLoad
  32. } from '@dcloudio/uni-app';
  33. const youkeFlag = ref(null);
  34. const yhName = ref(null);
  35. const youkeDialogRef = ref(null);
  36. const biaoqingList = ref(
  37. [{
  38. name: '开心',
  39. type: 1
  40. },
  41. {
  42. name: '愤怒',
  43. type: 2
  44. },
  45. {
  46. name: '悲伤',
  47. type: 3
  48. },
  49. {
  50. name: '害怕',
  51. type: 4
  52. },
  53. {
  54. name: '得意',
  55. type: 5
  56. },
  57. {
  58. name: '嫉妒',
  59. type: 6
  60. },
  61. {
  62. name: '压抑',
  63. type: 7
  64. },
  65. {
  66. name: '抱怨',
  67. type: 8
  68. }
  69. ]
  70. )
  71. onLoad((options) => {
  72. if (cacheManager.get('auth')) {
  73. youkeFlag.value = true
  74. yhName.value = cacheManager.get('auth').realName || ''
  75. } else {
  76. // 游客
  77. youkeFlag.value = false
  78. }
  79. })
  80. // 游客弹窗---确定
  81. function ykConfirm() {
  82. uni.redirectTo({
  83. url: '/pages/login/index'
  84. });
  85. }
  86. function goZhuantiInfo(data) {
  87. console.log('data', data);
  88. if (!youkeFlag.value) {
  89. youkeDialogRef.value.handleShow();
  90. return false
  91. }
  92. uni.redirectTo({
  93. url: '/pages/zhuanti/zhuantiInfo?type=' + data.type
  94. })
  95. }
  96. </script>