pushdeer/quickapp/src/pages/component/Settings/index.ux

65 lines
1.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<import name="setting-card" src="./card"></import>
<template>
<div class="wrapper">
<div class="header">
<text>设置</text>
<!-- <image @click="onPlusBtnClick" src="/assets/images/arrow-up.png" /> -->
</div>
<list style="width: 80%">
<list-item type="settingitem" for="{{ s in settings}}">
<setting-card
label="{{s.label}}"
opt-name="{{s.optName}}"
idx="{{$idx}}"
></setting-card>
</list-item>
</list>
</div>
</template>
<script>
export default {
data: {
settings: [
{ label: "登录为 Easy", optName: "退出", handler: () => { $utils.showToast('点击了退出按钮') } },
{ label: "自定义服务器", optName: "扫码", handler: () => { $utils.showToast('点击了扫码按钮') } },
{ label: "喜欢PushDeer", optName: "评分", handler: () => { $utils.showToast('点击了评分按钮') } }
]
},
onLogoutBtnClick() {
console.log('settings', 'onLogoutBtnClick')
},
onInit() {
console.log('settings', 'init')
this.$on('SettingsItemClick', (evt) => {
evt.stop()
this.settings[evt.detail].handler();
})
}
}
</script>
<style lang="less">
@import '../../../assets/styles/style.less';
.wrapper {
.flex-box-mixins(column, flex-start, center);
width: 100%;
height: 100%;
padding-top: 84px;
.header {
margin-bottom: 24px;
width: 80%;
justify-content: space-between;
text {
font-size: 48px;
color: #000000;
}
}
}
</style>