index.nvue 1.63 KB
<template>
	<view class="h-page">
    <!-- 客群画像 -->
    <CustomNavBar :title="t('PreMenu.customersasis')" />
    <view :style="`position: fixed;z-index: 99;top: ${navHeight+44}px;`">
      <PageOptions @change="handleOptionsChange"></PageOptions>
    </view>
    <view style="height: 164rpx;"></view>
		<view class="h-c-container">
			<FaceAnalyzeMallNvue ref="faceAnalyzeRef"></FaceAnalyzeMallNvue>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		onMounted
	} from 'vue'
	import PageOptions from '@/components/PageOptions.vue'
	import CardNvue from '@/pages/flow/components/Card.nvue'
  import CustomNavBar from '@/components/CustomNav.nvue'
	import FaceAnalyzeMallNvue from '@/pages/flow/components/FaceAnalyzeMall.nvue';
  import {
    useNav
  } from '@/hooks'
  
import { t } from '@/plugins/index.js'  
import { onPullDownRefresh } from '@dcloudio/uni-app'
  
  const {navHeight} = useNav()
  
	const params = ref({})
	const flag = ref(false) // 是否初始化完成
	const handleOptionsChange = (e) => {
		params.value = e
		if (flag.value) {
			initFaceAnalyzeCharts()
		}
	}

onMounted(() => {
		initFaceAnalyzeCharts()
		flag.value = true
	})

  onPullDownRefresh(() => {
	initFaceAnalyzeCharts()
	flag.value = true
    uni.stopPullDownRefresh()
  })

	const faceAnalyzeRef = ref(null)
	const initFaceAnalyzeCharts = () => {
		faceAnalyzeRef.value?.initData(params.value)
	}
</script>

<style lang="scss">
	.h-page {
		/* #ifdef H5 */
		min-height: calc(100vh - 44px);
		/* #endif */
		/* #ifndef H5 */
		min-height: 100vh;
		/* #endif */
		background-color: #f2f3f6;

		.h-c-container {
      padding: 0 20rpx 20rpx;
		}
	}
</style>