memorial.vue 1.0

This commit is contained in:
minimaxagent1 2025-08-08 10:15:54 +08:00
parent afbbeeeaea
commit 285a5bcd1f

View File

@ -2,9 +2,9 @@
<view class="page"> <view class="page">
<base-background /> <base-background />
<!-- 使用自定义导航栏组件 --> <!-- 使用自定义导航栏组件 -->
<custom-navbar title="带图片背景的基础界面" <custom-navbar title="往生殿"
ref="customNavbar"/> ref="customNavbar"/>
<view class="header" :style="{ backgroundColor: CommonEnum.BASE_COLOR }"> <view class="header">
<!-- 状态展示 --> <!-- 状态展示 -->
<status-display <status-display
v-if="loading" v-if="loading"
@ -12,33 +12,24 @@
loading-text="加载中..." loading-text="加载中..."
/> />
<!-- 页面内容将在这里添加 --> <!-- 页面内容将在这里添加 -->
<search-box
v-model="searchName"
:width="'682rpx'"
:search-icon="CommonEnum.SEARCH"
placeholder="请输入姓名或分区进行查找"
btn-text="搜索"
@search="handleSearch"
/>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { import {CommonEnum} from '@/enum/common.js'
CommonEnum
} from '@/enum/common.js'
import {
MonkEnum
} from '@/enum/monk.js'
import {
getMonkList
} from '@/api/monk/monk.js'
import CustomNavbar from "../../components/custom-navbar/custom-navbar.vue";
import BaseBackground from "../../components/base-background/base-background.vue";
import SearchBox from "../../components/search-box/search-box.vue"; import SearchBox from "../../components/search-box/search-box.vue";
import StatusDisplay from "../../components/status-display/status-display.vue";
export default { export default {
components: { components: {
StatusDisplay, SearchBox,
CustomNavbar,
BaseBackground,
MonkSearchBox: SearchBox MonkSearchBox: SearchBox
}, },
data() { data() {
@ -47,59 +38,26 @@ export default {
backgroundColor: "#F5F0E7" backgroundColor: "#F5F0E7"
}, },
CommonEnum, CommonEnum,
MonkEnum,
monkList: [],
searchName: '' searchName: ''
} }
}, },
onLoad() { onLoad() {
this.fetchMonkList()
}, },
methods: { methods: {
async fetchMonkList() {
try {
const res = await getMonkList({ name: this.searchName })
if (res.code === 200 && Array.isArray(res.rows)) {
this.monkList = res.rows
} else {
uni.showToast({
title: res.msg || '获取失败',
icon: 'none'
})
}
} catch (e) {
uni.showToast({
title: '网络错误',
icon: 'none'
})
}
},
// HTML
stripHtmlTags(html) {
if (!html) return ''; //
return html.replace(/<[^>]+>/g, ''); // HTML
},
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .page {
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
border-radius: 0rpx 0rpx 0rpx 0rpx;
} }
.header { .header {
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
display: flex; display: flex;
align-items: flex-start; align-items: center;
flex-direction: column; flex-direction: column;
padding: 0 15rpx; padding: 0 15rpx 40rpx 15rpx;
padding-bottom: 40rpx;
} }
</style> </style>