优化部分代码,增加微信公众号模板
This commit is contained in:
@@ -33,3 +33,4 @@
|
||||
- 兼容微信小程序 + App + H5
|
||||
- 交互:列表 → 详情 → 全屏表单;**禁止**底部抽屉做主 CRUD
|
||||
- 复用 `AppCardList` / `AppDetailHero` / `AppInfoGroup` / `AppBottomBar` / `AppPageForm`
|
||||
- 列表页统一:`AppPageAtmosphere`(氛围底)+ `AppSkeleton`(首屏骨架)+ `AppFab`(新增悬浮按钮)
|
||||
|
||||
@@ -9,6 +9,7 @@ import { deleteupperCamelCase, getupperCamelCaseInfo } from '../api'
|
||||
import AppBottomBar from '@/components/AppBottomBar.vue'
|
||||
import AppDetailHero from '@/components/AppDetailHero.vue'
|
||||
import AppInfoGroup, { type AppInfoRow } from '@/components/AppInfoGroup.vue'
|
||||
import AppPageAtmosphere from '@/components/AppPageAtmosphere.vue'
|
||||
|
||||
const id = ref(0)
|
||||
const info = ref<Record<string, any>>({})
|
||||
@@ -45,14 +46,17 @@ function onDelete() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="nl-page">
|
||||
<AppDetailHero
|
||||
:title="title"
|
||||
:subtitle="String(info.UNI_SUBTITLE_FIELD || '')"
|
||||
:status-text="Number(info.status) === 0 ? '正常' : '禁用'"
|
||||
:status-type="Number(info.status) === 0 ? 'success' : 'danger'"
|
||||
/>
|
||||
<AppInfoGroup title="详细信息" :items="rows" />
|
||||
<AppBottomBar primary-text="编辑" danger-text="删除" @primary="goEdit" @danger="onDelete" />
|
||||
</view>
|
||||
<!-- 氛围壳提供主题作用域 + 背景色斑,玻璃卡的模糊才有内容可透 -->
|
||||
<AppPageAtmosphere>
|
||||
<view class="nl-page">
|
||||
<AppDetailHero
|
||||
:title="title"
|
||||
:subtitle="String(info.UNI_SUBTITLE_FIELD || '')"
|
||||
:status-text="Number(info.status) === 0 ? '正常' : '禁用'"
|
||||
:status-type="Number(info.status) === 0 ? 'success' : 'danger'"
|
||||
/>
|
||||
<AppInfoGroup title="详细信息" :items="rows" />
|
||||
<AppBottomBar primary-text="编辑" danger-text="删除" @primary="goEdit" @danger="onDelete" />
|
||||
</view>
|
||||
</AppPageAtmosphere>
|
||||
</template>
|
||||
|
||||
@@ -9,8 +9,12 @@ import { onShow } from '@dcloudio/uni-app'
|
||||
import { getupperCamelCaseList } from '../api'
|
||||
import AppCardList, { type AppCardItem } from '@/components/AppCardList.vue'
|
||||
import AppEmpty from '@/components/AppEmpty.vue'
|
||||
import AppFab from '@/components/AppFab.vue'
|
||||
import AppFilterBar from '@/components/AppFilterBar.vue'
|
||||
import AppLoading from '@/components/AppLoading.vue'
|
||||
import AppPageAtmosphere from '@/components/AppPageAtmosphere.vue'
|
||||
import AppSearchBar from '@/components/AppSearchBar.vue'
|
||||
import AppSkeleton from '@/components/AppSkeleton.vue'
|
||||
import { usePullRefresh } from '@/composables/usePullRefresh'
|
||||
|
||||
const list = ref<any[]>([])
|
||||
@@ -82,26 +86,30 @@ function goCreate() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="nl-page page">
|
||||
<AppSearchBar
|
||||
v-model="keyword"
|
||||
placeholder="搜索模板名称"
|
||||
@search="(v) => { keyword = v; reload() }"
|
||||
@clear="() => { keyword = ''; reload() }"
|
||||
/>
|
||||
<AppFilterBar :selected-count="selectedCount" @reset="onFilterReset" @confirm="onFilterConfirm">
|
||||
<view class="filter-row">
|
||||
<text>关键词</text>
|
||||
<input v-model="draftKeyword" class="filter-input" placeholder="关键词" />
|
||||
<AppPageAtmosphere tone="cool">
|
||||
<view class="nl-page page">
|
||||
<AppSearchBar
|
||||
v-model="keyword"
|
||||
placeholder="搜索模板名称"
|
||||
@search="(v) => { keyword = v; reload() }"
|
||||
@clear="() => { keyword = ''; reload() }"
|
||||
/>
|
||||
<AppFilterBar :selected-count="selectedCount" @reset="onFilterReset" @confirm="onFilterConfirm">
|
||||
<view class="filter-row">
|
||||
<text>关键词</text>
|
||||
<input v-model="draftKeyword" class="filter-input" placeholder="关键词" />
|
||||
</view>
|
||||
</AppFilterBar>
|
||||
<AppSkeleton v-if="loading && !cards.length" :rows="5" />
|
||||
<AppCardList v-else-if="cards.length" :list="cards" @select="goDetail" />
|
||||
<AppEmpty v-else text="暂无数据" />
|
||||
<AppLoading v-if="loading && cards.length" text="加载更多…" />
|
||||
<view v-else-if="cards.length" class="more" @tap="loadMore">
|
||||
{{ finished ? '没有更多了' : '加载更多' }}
|
||||
</view>
|
||||
</AppFilterBar>
|
||||
<AppCardList v-if="cards.length" :list="cards" @select="goDetail" />
|
||||
<AppEmpty v-else text="暂无数据" />
|
||||
<view v-if="cards.length" class="more" @tap="loadMore">
|
||||
{{ finished ? '没有更多了' : loading ? '加载中…' : '加载更多' }}
|
||||
<AppFab @tap="goCreate" />
|
||||
</view>
|
||||
<view class="fab" @tap="goCreate">新增</view>
|
||||
</view>
|
||||
</AppPageAtmosphere>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -111,10 +119,4 @@ function goCreate() {
|
||||
}
|
||||
.filter-input { flex: 1; text-align: right; margin-left: 24rpx; }
|
||||
.more { text-align: center; color: $nl-color-text-muted; padding: 16rpx; font-size: 24rpx; }
|
||||
.fab {
|
||||
position: fixed; right: 32rpx; bottom: calc(48rpx + env(safe-area-inset-bottom));
|
||||
min-width: 120rpx; height: 88rpx; padding: 0 36rpx; border-radius: 999rpx;
|
||||
background: $nl-color-primary; color: #fff; display: flex; align-items: center; justify-content: center;
|
||||
font-weight: 700; box-shadow: 0 16rpx 40rpx rgba(255, 107, 0, 0.35);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user