chat-app/src/pages/chatSettings/components/settingFormItem.vue

86 lines
1.9 KiB
Vue
Raw Normal View History

<template>
<div class="setting-form-item">
<div class="item-main">
<div class="item-main-label">
<span class="text-[32rpx] font-regular">{{ item.label }}</span>
</div>
<div class="item-main-value" @click="toManagePage(item)">
<span class="text-[32rpx] font-regular" v-if="item.value">
{{ item.value }}
</span>
<img
v-if="item.hasPointer"
src="/src/static/image/chatSettings/pointer.png"
/>
<tm-switch
2025-01-02 09:10:31 +00:00
:width="88"
:height="48"
v-if="item.customInfo && item.customInfo === 'switch'"
barIcon=""
color="#46299D"
unCheckedColor="#EEEEEE"
></tm-switch>
</div>
</div>
<div class="item-sub" v-if="item.subValue">
<span class="text-[32rpx] font-regular">{{ item.subValue }}</span>
</div>
</div>
</template>
<script setup>
import { defineProps, defineEmits } from 'vue'
const props = defineProps({
item: {
type: Object,
default() {
return {}
},
},
})
const emits = defineEmits(['toManagePage'])
const toManagePage = (item) => {
emits('toManagePage', item.label)
}
</script>
<style lang="scss" scoped>
.setting-form-item {
.item-main {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
.item-main-label {
flex-shrink: 0;
span {
line-height: 44rpx;
color: $theme-text;
}
}
.item-main-value {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
span {
line-height: 44rpx;
color: #747474;
}
img {
width: 11rpx;
height: 18rpx;
margin: 0 0 0 32rpx;
}
}
}
.item-sub {
margin: 28rpx 0 0;
span {
line-height: 44rpx;
color: #747474;
}
}
}
</style>