index.nvue
1.63 KB
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
<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>