<template>
  <u-navbar :autoBack="false" :placeholder="true" :safeAreaInsetTop="true">
    <template #left>
      <view class="u-navbar__content__left__item" style="width: 100%">
        <u-search v-model="state.search" placeholder="搜索" :show-action="true" actionText="取消" :animation="false" @custom="handleToCancel" @search="handleToSearch"></u-search>
      </view>
    </template>
  </u-navbar>

  <oa-scroll
    customClass="info-container scroll-height"
    :customStyle="{ height: `calc(100vh - (${proxy.$settingStore.barHightTop} + ${proxy.$settingStore.tabBarHeight}))` }"
    :refresherLoad="false"
    :refresherEnabled="false"
    :refresherEnabledTitle="false"
    :refresherDefaultStyle="'none'"
    :refresherThreshold="44"
    :refresherBackground="'#f5f6f7'"
    :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  >
    <template #default> </template>
  </oa-scroll>
</template>

<script setup>
/*----------------------------------依赖引入-----------------------------------*/
import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
/*----------------------------------接口引入-----------------------------------*/
/*----------------------------------组件引入-----------------------------------*/
/*----------------------------------store引入-----------------------------------*/
/*----------------------------------公共方法引入-----------------------------------*/
/*----------------------------------公共变量-----------------------------------*/
const { proxy } = getCurrentInstance();
/*----------------------------------变量声明-----------------------------------*/
const state = reactive({
  search: "",
});

//搜索
function handleToSearch() {
  console.log(2);
}

//取消
function handleToCancel() {
  proxy.$tab.navigateBack(1); //返回到需要执行方法的页面
}

onShow(() => {});
</script>

<style lang="scss" scoped>
:deep(.u-navbar__content__left) {
  width: 100%;
}
</style>
