zhengyiming
2025-02-11 591ccbd63d0ef8d71442ee043b4a5f485ec89462
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<template>
  <PageLayoutWithBg class="index-page-wrapper" :title="'首页'" :need-auth="false">
    <template #left>
      <div class="menu-btn-wrapper menu-logo">
        <img :src="IconLogo" class="logo" />
      </div>
    </template>
    <div class="home-searchbar-wrapper">
      <BlSearchbar v-model.trim="searchValue"></BlSearchbar>
    </div>
  </PageLayoutWithBg>
</template>
 
<script setup lang="ts">
import { useUser } from '@/hooks';
import { useUserStore } from '@/stores/modules/user';
import { RectDown } from '@nutui/icons-vue-taro';
import Taro from '@tarojs/taro';
import { LocationUtils, trim } from '@12333/utils';
import _ from 'lodash';
import IconLogo from '@/assets/home/icon-logo.png';
 
const { locationCity } = useUser();
 
const searchValue = ref('');
 
const queryState = reactive({
  searchValueTrim: '',
});
 
const handleSearch = _.debounce(function () {
  queryState.searchValueTrim = trim(searchValue.value);
}, 300);
 
const userStore = useUserStore();
 
function goCitySelect() {
  Taro.navigateTo({
    url: RouterPath.citySelect,
  });
}
// onMounted(async () => {
//   if (!isSetMatchMakingIdentity.value) {
//     Taro.navigateTo({
//       url: RouterPath.toggleMatchMakingIdentity,
//     });
//   }
// });
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.index-page-wrapper {
  .menu-logo {
    padding: 0;
 
    .logo {
      width: 96px;
      height: 64px;
    }
  }
 
  .city-btn {
    display: flex;
    align-items: center;
 
    .city-btn-text {
      max-width: 200px;
      @include ellipsis;
      margin-right: 12px;
    }
  }
 
  .home-searchbar-wrapper {
    padding: 32px 0;
  }
}
</style>