schangxiang@126.com
2025-09-11 e86f3bddecdc13210a546761ecf5e8550ea20799
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
<template>
    <div>
        <page-header :hasLeft="true" :hasRight="true" @tclick="onAsideClick" style='font-size: 55upx;'>
            <template v-slot:left>
                <u-icon name="arrow-left" ></u-icon>&nbsp;&nbsp;返回
            </template>
            {{ctitle}}
            <template v-slot:right>
                <u-icon name="plus"></u-icon>
            </template>
        </page-header>
        
        <u-action-sheet :list="actionlist" v-model="sheetVisible" @click="onConfirmSheet"></u-action-sheet>
    </div>
</template>
 
<script>
import PageHeader from './PageHeader.vue'
export default {
    name:'pageheadercompontentx',
    props:{
        ctitle:{
            type:String,
            default:''
        }
    },
    components:{'page-header':PageHeader},
    data(){
        return {
            sheetVisible:false,
            actionlist:[ //站点列表
                {
                    text:'首页'
                },
                {
                    text:'退出'
                }
            ]
        }
    },
    methods:{
        onAsideClick(type){
            if (type==='left'){
                uni.navigateBack({
                  delta: 1
                });
            } else if (type==='right') {
                this.sheetVisible = true;
            }
        },
        onConfirmSheet(index){
            this.sheetVisible = false;
            if (index===0){
                uni.redirectTo({url:'../index/index'})
            } else if (index===1) {
                uni.redirectTo({url:'../login/login'})
            }
        }
    }
}
</script>