zs
2025-05-15 9eaf758e97367dbc2eca2bdbdc92ab39e08be9d0
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
<template>
    <default-header-page-layout ref="page" title="收货作业" >
        <view class="page-frame with-action-user-row" :style="{height:pageBodyHeight+'px'}" v-if="pageBodyHeight">
            <action-user-row />
            <view class="with-action-user-row-page-content">
            </view>
        </view>
    </default-header-page-layout>
</template>
 
<script>
import DefaultHeaderPageLayout from '@/components/DefaultHeaderPageLayout.vue'
import ActionUserRow from '@/components/ActionUserRow.vue'
let initInterVal = null;
export default {
    name:'takeInStorePage',
    components:{DefaultHeaderPageLayout,ActionUserRow},
    data(){
        return {
            pageBodyHeight:0
        }
    },
    methods:{
        /* 页面初始化获取页面body高度的定时器 */
        startInitInterval(callback){
            initInterVal = setInterval(()=>{
                if (this.pageBodyHeight) {
                    this.clearInitInterval()
                    callback && callback()
                } else {
                    this.pageBodyHeight = this.$refs.page.getBodyHeight()
                }
            },200)
        },
        /* 清除定时器 */
        clearInitInterval(){
            try{
                clearInterval(initInterVal)
                initInterVal = null
            }catch(e){
                //TODO handle the exception
            }
        }
    },
    onReady(){
        this.startInitInterval(()=>{
            /* 页面初始化后需要执行的代码在这边调用 */
        })
    },
    onUnload(){
        this.clearInitInterval()
    }
}
</script>
 
<style scoped lang="scss">
</style>