<script setup lang="ts">
import HomeTabs from "./components/HomeTabs.vue";
import HomeList from "./components/HomeList.vue";
import { ref, reactive, onMounted } from "vue";
import { login } from "@/hooks/useIsLogin";
import { onShow } from "@dcloudio/uni-app";
const companyName = ref<string>("");

const phoneGet = ref<any>();

onMounted(() => {
  //我来了
});
onShow(() => {
  console.log("onshow");
  login();
});
//调用子组件
const phoneGetFun = () => {
  phoneGet.value.open();
};
const validFun = () => {
  //判断用户授权登录没有
  phoneGetFun();
  //跳转到邀请用户页面
  // uni.navigateTo({ url: "/pages/index/inviteUser" });
};
</script>
<template>
  <!-- 引入头部安全区域组件 -->
  <view class="home_padding">
    <ShuiWuTop />
    <HomeTabs @jumpInvite="validFun" />
    <view class="list_search">
      <uni-easyinput type="text" v-model="companyName" placeholder="请输入公司名称" />
    </view>
    <HomeList class="home_list_com" />
    <ShuiWuGetPhone ref="phoneGet" />
  </view>
</template>
<style>
.list_search >>> .is-input-border {
  display: flex;
  box-sizing: border-box;
  flex-direction: row;
  align-items: center;
  border: 1px solid #dcdfe6;
  border-radius: 400px !important;
}
</style>
<style lang="scss">
page {
  height: 100%;
  background-color: rgb(243, 250, 248);
}
.home_padding {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0rpx 20rpx;
  .home_list_com {
    flex: 1;
    overflow: scroll;
  }
  .list_search {
    margin-top: 40rpx;
  }
}
</style>
