|
|
@@ -1,5 +1,264 @@
|
|
|
+import Toast from '@vant/weapp/toast/toast'
|
|
|
+
|
|
|
+interface Stat {
|
|
|
+ label: string
|
|
|
+ value: string
|
|
|
+ unit: string
|
|
|
+ icon?: string
|
|
|
+}
|
|
|
+
|
|
|
+interface HeritageItem {
|
|
|
+ name: string
|
|
|
+ meta: string
|
|
|
+ desc: string
|
|
|
+ icon: string
|
|
|
+ image: string
|
|
|
+ level: string
|
|
|
+ district: string
|
|
|
+ category: string
|
|
|
+}
|
|
|
+
|
|
|
+interface TagOption {
|
|
|
+ name: string
|
|
|
+ active: boolean
|
|
|
+}
|
|
|
+
|
|
|
+const MEDIA = 'https://modao.cc/agent-py/media'
|
|
|
+
|
|
|
+const PROJECTS: HeritageItem[] = [
|
|
|
+ {
|
|
|
+ name: '漳州布袋木偶戏',
|
|
|
+ meta: '国家级 · 芗城',
|
|
|
+ desc: '掌中乾坤,一口道尽千古事',
|
|
|
+ icon: 'ph:mask-happy-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-07/a0d729e3db234da0b8ce54c7076e4fed.jpg`,
|
|
|
+ level: '国家级',
|
|
|
+ district: '芗城',
|
|
|
+ category: '传统戏剧',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '漳浦剪纸',
|
|
|
+ meta: '国家级 · 漳浦',
|
|
|
+ desc: '剪刻乡土记忆与吉祥纹样',
|
|
|
+ icon: 'ph:scissors-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-07/236e78587aac4527ae84a006f6397167.jpg`,
|
|
|
+ level: '国家级',
|
|
|
+ district: '漳浦',
|
|
|
+ category: '传统美术',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '东山歌册',
|
|
|
+ meta: '省级 · 东山',
|
|
|
+ desc: '方言吟唱里的海岛生活',
|
|
|
+ icon: 'ph:music-notes-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/49d50567367248718d0d833c46ada65c.jpg`,
|
|
|
+ level: '省级',
|
|
|
+ district: '东山',
|
|
|
+ category: '民间文学',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '南靖土楼营造技艺',
|
|
|
+ meta: '市级 · 南靖',
|
|
|
+ desc: '夯土筑圆楼,聚族而居',
|
|
|
+ icon: 'ph:building-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/2a2356e6bdb74d3abff8576c1339926f.jpg`,
|
|
|
+ level: '市级',
|
|
|
+ district: '南靖',
|
|
|
+ category: '传统技艺',
|
|
|
+ },
|
|
|
+]
|
|
|
+
|
|
|
+const INHERITORS: HeritageItem[] = [
|
|
|
+ {
|
|
|
+ name: '陈黎晖',
|
|
|
+ meta: '布袋木偶戏 · 芗城',
|
|
|
+ desc: '四十载掌上演绎漳州故事',
|
|
|
+ icon: 'ph:user-focus-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/69916b535e7d4045993ee45b945a67d2.jpg`,
|
|
|
+ level: '国家级',
|
|
|
+ district: '芗城',
|
|
|
+ category: '传统戏剧',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '林桃',
|
|
|
+ meta: '剪纸 · 漳浦',
|
|
|
+ desc: '以剪代笔,留住花鸟人情',
|
|
|
+ icon: 'ph:user-focus-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/ca5ca067074747e8b76d98546b37ea6d.jpg`,
|
|
|
+ level: '省级',
|
|
|
+ district: '漳浦',
|
|
|
+ category: '传统美术',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '沈水仙',
|
|
|
+ meta: '歌册 · 东山',
|
|
|
+ desc: '乡音传唱海岛古韵',
|
|
|
+ icon: 'ph:user-focus-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/33251f5102fe4de18a2cc548b85035fc.jpg`,
|
|
|
+ level: '市级',
|
|
|
+ district: '东山',
|
|
|
+ category: '民间文学',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '简天佑',
|
|
|
+ meta: '竹编 · 平和',
|
|
|
+ desc: '一篾一挑编出山野风物',
|
|
|
+ icon: 'ph:user-focus-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/6f7e281e05064529899f0cd60dc9dbf4.jpg`,
|
|
|
+ level: '县级',
|
|
|
+ district: '平和',
|
|
|
+ category: '传统技艺',
|
|
|
+ },
|
|
|
+]
|
|
|
+
|
|
|
+const UNITS: HeritageItem[] = [
|
|
|
+ {
|
|
|
+ name: '漳州市木偶剧团',
|
|
|
+ meta: '国家级保护单位 · 芗城',
|
|
|
+ desc: '布袋木偶戏系统保护与展演',
|
|
|
+ icon: 'ph:columns-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/40f6b69d9e9a4bf7be8bb81fffa1cb7b.jpg`,
|
|
|
+ level: '国家级',
|
|
|
+ district: '芗城',
|
|
|
+ category: '传统戏剧',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '南靖县文化馆',
|
|
|
+ meta: '市级保护单位 · 南靖',
|
|
|
+ desc: '土楼民俗资料整理与活化',
|
|
|
+ icon: 'ph:bank-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/42d41037be194bdca22ced6a181d08c7.jpg`,
|
|
|
+ level: '市级',
|
|
|
+ district: '南靖',
|
|
|
+ category: '民俗',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '东山县文化馆',
|
|
|
+ meta: '省级保护单位 · 东山',
|
|
|
+ desc: '海洋民俗与歌册传承基地',
|
|
|
+ icon: 'ph:lighthouse-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/636da2f41d614f8797833a11f2967743.jpg`,
|
|
|
+ level: '省级',
|
|
|
+ district: '东山',
|
|
|
+ category: '民间文学',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '诏安县美术馆',
|
|
|
+ meta: '县级保护单位 · 诏安',
|
|
|
+ desc: '书画艺术与民间美术守护',
|
|
|
+ icon: 'ph:frame-corners-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/50b938f366134e749616ad065f1b4b32.jpg`,
|
|
|
+ level: '县级',
|
|
|
+ district: '诏安',
|
|
|
+ category: '传统美术',
|
|
|
+ },
|
|
|
+]
|
|
|
+
|
|
|
+const CENTERS: HeritageItem[] = [
|
|
|
+ {
|
|
|
+ name: '芗城木偶传习所',
|
|
|
+ meta: '芗城 · 预约开放',
|
|
|
+ desc: '木偶操演、唱腔与道具体验',
|
|
|
+ icon: 'ph:storefront-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/4f7a53eab8c8493ab98704d4d2d452fd.jpg`,
|
|
|
+ level: '国家级',
|
|
|
+ district: '芗城',
|
|
|
+ category: '传统戏剧',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '南靖土楼营造传习中心',
|
|
|
+ meta: '南靖 · 周二至周日',
|
|
|
+ desc: '夯筑工具与传统工序展示',
|
|
|
+ icon: 'ph:house-line-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/5b8c846df27049b1ba38df648280df8d.jpg`,
|
|
|
+ level: '市级',
|
|
|
+ district: '南靖',
|
|
|
+ category: '传统技艺',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '云霄竹塔传习所',
|
|
|
+ meta: '云霄 · 公益课堂',
|
|
|
+ desc: '竹艺制作与节庆文化传习',
|
|
|
+ icon: 'ph:plant-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/dd3693b6cae1420999e57a56aa10e735.jpg`,
|
|
|
+ level: '区级',
|
|
|
+ district: '云霄',
|
|
|
+ category: '传统技艺',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '诏安木版年画传习中心',
|
|
|
+ meta: '诏安 · 可现场体验',
|
|
|
+ desc: '刻版、拓印与年俗课堂',
|
|
|
+ icon: 'ph:paint-brush-broad-duotone',
|
|
|
+ image: `${MEDIA}/generated_images/2026-08-06/9b460a47a8f34e1dafbf29ecd5260a68.jpg`,
|
|
|
+ level: '县级',
|
|
|
+ district: '诏安',
|
|
|
+ category: '传统美术',
|
|
|
+ },
|
|
|
+]
|
|
|
+
|
|
|
+function matchItems(
|
|
|
+ items: HeritageItem[],
|
|
|
+ query: string,
|
|
|
+ category: string,
|
|
|
+ levels: string[],
|
|
|
+ district: string,
|
|
|
+): HeritageItem[] {
|
|
|
+ const q = query.trim().toLowerCase()
|
|
|
+ return items.filter((item) => {
|
|
|
+ const matchQuery = !q || `${item.name}${item.meta}${item.desc}`.toLowerCase().includes(q)
|
|
|
+ const matchCategory = !category || item.category === category
|
|
|
+ const matchLevel = levels.length === 0 || levels.includes(item.level)
|
|
|
+ const matchDistrict = district === '全部' || item.district === district
|
|
|
+ return matchQuery && matchCategory && matchLevel && matchDistrict
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
Component({
|
|
|
- data: {},
|
|
|
+ data: {
|
|
|
+ keyword: '',
|
|
|
+
|
|
|
+ stats: [
|
|
|
+ { label: '非遗项目总数', value: '1,286', unit: '项' },
|
|
|
+ { label: '传承人总量', value: '2,560', unit: '人' },
|
|
|
+ { label: '文保单位数量', value: '486', unit: '处', icon: 'ph:columns-duotone' },
|
|
|
+ { label: '传习工坊数量', value: '128', unit: '家' },
|
|
|
+ ] as Stat[],
|
|
|
+
|
|
|
+ categories: [
|
|
|
+ '民间文学',
|
|
|
+ '传统音乐',
|
|
|
+ '传统舞蹈',
|
|
|
+ '传统戏剧',
|
|
|
+ '曲艺',
|
|
|
+ '传统体育游艺与杂技',
|
|
|
+ '传统美术',
|
|
|
+ '传统技艺',
|
|
|
+ '传统医药',
|
|
|
+ '民俗',
|
|
|
+ ],
|
|
|
+ selectedCategory: '',
|
|
|
+
|
|
|
+ levels: [
|
|
|
+ { name: '全部', active: true },
|
|
|
+ { name: '国家级', active: false },
|
|
|
+ { name: '省级', active: false },
|
|
|
+ { name: '市级', active: false },
|
|
|
+ { name: '区级', active: false },
|
|
|
+ { name: '县级', active: false },
|
|
|
+ ] as TagOption[],
|
|
|
+
|
|
|
+ districts: ['全部', '芗城', '龙文', '南靖', '东山', '云霄', '诏安', '漳浦', '平和', '华安', '长泰'],
|
|
|
+ selectedDistrict: '全部',
|
|
|
+
|
|
|
+ projects: PROJECTS as HeritageItem[],
|
|
|
+ inheritors: INHERITORS as HeritageItem[],
|
|
|
+ units: UNITS as HeritageItem[],
|
|
|
+ centers: CENTERS as HeritageItem[],
|
|
|
+
|
|
|
+ summary: '当前展示全部非遗内容 · 共 16 条',
|
|
|
+ hasResult: true,
|
|
|
+ },
|
|
|
|
|
|
pageLifetimes: {
|
|
|
show() {
|
|
|
@@ -8,4 +267,106 @@ Component({
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ refresh() {
|
|
|
+ const { keyword, selectedCategory, selectedDistrict } = this.data as {
|
|
|
+ keyword: string
|
|
|
+ selectedCategory: string
|
|
|
+ selectedDistrict: string
|
|
|
+ }
|
|
|
+ const selectedLevels = (this.data.levels as TagOption[])
|
|
|
+ .filter(l => l.active && l.name !== '全部')
|
|
|
+ .map(l => l.name)
|
|
|
+
|
|
|
+ const projects = matchItems(PROJECTS, keyword, selectedCategory, selectedLevels, selectedDistrict)
|
|
|
+ const inheritors = matchItems(INHERITORS, keyword, selectedCategory, selectedLevels, selectedDistrict)
|
|
|
+ const units = matchItems(UNITS, keyword, selectedCategory, selectedLevels, selectedDistrict)
|
|
|
+ const centers = matchItems(CENTERS, keyword, selectedCategory, selectedLevels, selectedDistrict)
|
|
|
+ const total = projects.length + inheritors.length + units.length + centers.length
|
|
|
+
|
|
|
+ const active = [
|
|
|
+ selectedCategory,
|
|
|
+ ...selectedLevels,
|
|
|
+ selectedDistrict === '全部' ? '' : selectedDistrict,
|
|
|
+ ].filter(Boolean)
|
|
|
+ const summary = active.length
|
|
|
+ ? `已筛选:${active.join('、')} · 共 ${total} 条内容`
|
|
|
+ : `当前展示全部非遗内容 · 共 ${total} 条`
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ projects,
|
|
|
+ inheritors,
|
|
|
+ units,
|
|
|
+ centers,
|
|
|
+ summary,
|
|
|
+ hasResult: total > 0,
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ onSearch(e: WechatMiniprogram.CustomEvent) {
|
|
|
+ this.setData({ keyword: e.detail.keyword as string })
|
|
|
+ this.refresh()
|
|
|
+ },
|
|
|
+
|
|
|
+ onSelectCategory(e: WechatMiniprogram.TouchEvent) {
|
|
|
+ const category = e.currentTarget.dataset.name as string
|
|
|
+ const selectedCategory = this.data.selectedCategory === category ? '' : category
|
|
|
+ this.setData({ selectedCategory })
|
|
|
+ this.refresh()
|
|
|
+ },
|
|
|
+
|
|
|
+ onToggleLevel(e: WechatMiniprogram.TouchEvent) {
|
|
|
+ const name = e.currentTarget.dataset.name as string
|
|
|
+ let levels = this.data.levels as TagOption[]
|
|
|
+ if (name === '全部') {
|
|
|
+ levels = levels.map(l => ({ ...l, active: l.name === '全部' }))
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ levels = levels.map((l) => {
|
|
|
+ if (l.name === '全部') {
|
|
|
+ return { ...l, active: false }
|
|
|
+ }
|
|
|
+ if (l.name === name) {
|
|
|
+ return { ...l, active: !l.active }
|
|
|
+ }
|
|
|
+ return l
|
|
|
+ })
|
|
|
+ const hasSpecific = levels.some(l => l.name !== '全部' && l.active)
|
|
|
+ if (!hasSpecific) {
|
|
|
+ levels = levels.map(l => ({ ...l, active: l.name === '全部' }))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setData({ levels })
|
|
|
+ this.refresh()
|
|
|
+ },
|
|
|
+
|
|
|
+ onSelectDistrict(e: WechatMiniprogram.TouchEvent) {
|
|
|
+ const district = e.currentTarget.dataset.name as string
|
|
|
+ if (!district) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.setData({ selectedDistrict: district })
|
|
|
+ this.refresh()
|
|
|
+ },
|
|
|
+
|
|
|
+ onReset() {
|
|
|
+ const levels = (this.data.levels as TagOption[]).map(l => ({ ...l, active: l.name === '全部' }))
|
|
|
+ this.setData({
|
|
|
+ keyword: '',
|
|
|
+ selectedCategory: '',
|
|
|
+ levels,
|
|
|
+ selectedDistrict: '全部',
|
|
|
+ })
|
|
|
+ this.refresh()
|
|
|
+ },
|
|
|
+
|
|
|
+ onFilter() {
|
|
|
+ Toast('可使用下方门类、级别与区县进行筛选')
|
|
|
+ },
|
|
|
+
|
|
|
+ onBack() {
|
|
|
+ wx.switchTab({ url: '/pages/home/home' })
|
|
|
+ },
|
|
|
+ },
|
|
|
})
|