duplikat dari
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-12 13:19:31 +08:00
refactor: 将页面配置通过插件动态化配置(plugin-uni-halo)
This commit is contained in:
+42
-31
@@ -1,35 +1,46 @@
|
||||
<template>
|
||||
<view class="app-page"></view>
|
||||
<view class="app-page"></view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onLoad() {
|
||||
this.fnCheckShowStarted();
|
||||
},
|
||||
methods: {
|
||||
// 检查是否需要跳转到启动页
|
||||
fnCheckShowStarted() {
|
||||
if (!getApp().globalData.start.use) {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
});
|
||||
|
||||
// uni.navigateTo({
|
||||
// url:'/pagesA/test-page/test-page'
|
||||
// })
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pagesA/start/start'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
export default {
|
||||
computed: {
|
||||
configs() {
|
||||
return this.$tm.vx.getters().getConfigs;
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
|
||||
console.log('正常:', res)
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
||||
// #endif
|
||||
this.fnCheckShowStarted();
|
||||
}).catch((err) => {
|
||||
console.log('异常:', err)
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
});
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
fnCheckShowStarted() {
|
||||
if (!this.configs.startConfig.enable) {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pagesA/start/start'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
+579
-602
File diff ditekan karena terlalu besar
Load Diff
@@ -7,20 +7,19 @@
|
||||
</view>
|
||||
<!-- 内容区域 -->
|
||||
<view v-else class="app-page-content">
|
||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center">
|
||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center" style="height: 70vh;">
|
||||
<!-- 空布局 -->
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无数据"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
|
||||
<tm-translate v-for="(item, index) in dataList" :key="index"
|
||||
style="box-sizing: border-box;width: 50%;padding: 0 8rpx;" animation-name="fadeUp"
|
||||
:wait="calcAniWait(index)">
|
||||
<view class="catgory-card" :style="{backgroundImage:`url(${item.spec.cover})`}">
|
||||
<view class="content" @click="handleToCategory(item)">
|
||||
<view style="font-size: 32rpx;color: #ffffff;">{{item.spec.displayName}}</view>
|
||||
<view style="font-size: 32rpx;color: #ffffff;">{{ item.spec.displayName }}</view>
|
||||
<view style="font-size: 24rpx;color: #ffffff;margin-top: 6rpx;">共
|
||||
{{item.postCount}} 篇文章
|
||||
{{ item.postCount }} 篇文章
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -40,6 +39,7 @@
|
||||
|
||||
import MarkdownConfig from '@/common/markdown/markdown.config.js';
|
||||
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
tmSkeleton,
|
||||
@@ -63,12 +63,6 @@
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
bloggerInfo() {
|
||||
return this.$tm.vx.getters().getBlogger;
|
||||
},
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.fnGetData();
|
||||
},
|
||||
|
||||
+235
-235
@@ -1,253 +1,253 @@
|
||||
<template>
|
||||
<view class="app-page">
|
||||
<!-- 顶部切换 -->
|
||||
<view class="e-fixed" v-if="category.list.length > 0">
|
||||
<tm-tabs color="light-blue" v-model="category.activeIndex" range-key="displayName" :list="category.list"
|
||||
align="left" @change="fnOnCategoryChange"></tm-tabs>
|
||||
</view>
|
||||
<!-- 占位区域 -->
|
||||
<view v-if="category.list.length > 0" style="width: 100vw;height: 90rpx;"></view>
|
||||
<!-- 加载区域 -->
|
||||
<view v-if="loading != 'success'" class="loading-wrap">
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
</view>
|
||||
<!-- 内容区域 -->
|
||||
<view class="content" v-else>
|
||||
<view v-if="dataList.length == 0" class="content-empty">
|
||||
<!-- 空布局 -->
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有分享图片~"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<block v-for="(item, index) in dataList" :key="index">
|
||||
<tm-translate style="box-sizing: border-box;padding: 6rpx;width: 50%;height: 250rpx;"
|
||||
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||
<view style="border-radius: 12rpx;overflow: hidden;width: 100%;height: 250rpx;">
|
||||
<image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.cover"
|
||||
@click="fnPreview(index)" />
|
||||
</view>
|
||||
</tm-translate>
|
||||
</block>
|
||||
<view class="app-page">
|
||||
<!-- 顶部切换 -->
|
||||
<view class="e-fixed" v-if="category.list.length > 0">
|
||||
<tm-tabs color="light-blue" v-model="category.activeIndex" range-key="displayName" :list="category.list"
|
||||
align="left" @change="fnOnCategoryChange"></tm-tabs>
|
||||
</view>
|
||||
<!-- 占位区域 -->
|
||||
<view v-if="category.list.length > 0" style="width: 100vw;height: 90rpx;"></view>
|
||||
<!-- 加载区域 -->
|
||||
<view v-if="loading != 'success'" class="loading-wrap">
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
</view>
|
||||
<!-- 内容区域 -->
|
||||
<view class="content" v-else>
|
||||
<view v-if="dataList.length == 0" class="content-empty">
|
||||
<!-- 空布局 -->
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有分享图片~"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<block v-for="(item, index) in dataList" :key="index">
|
||||
<tm-translate style="box-sizing: border-box;padding: 6rpx;width: 50%;height: 250rpx;"
|
||||
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||
<view style="border-radius: 12rpx;overflow: hidden;width: 100%;height: 250rpx;">
|
||||
<image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.cover"
|
||||
@click="fnPreview(index)"/>
|
||||
</view>
|
||||
</tm-translate>
|
||||
</block>
|
||||
|
||||
<tm-flotbutton @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||
<view class="load-text">{{ loadMoreText }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<tm-flotbutton @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||
<view class="load-text">{{ loadMoreText }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
||||
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
||||
import tmFlowLayout from '@/tm-vuetify/components/tm-flowLayout/tm-flowLayout.vue';
|
||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
||||
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
||||
import tmFlowLayout from '@/tm-vuetify/components/tm-flowLayout/tm-flowLayout.vue';
|
||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
tmSkeleton,
|
||||
tmTranslate,
|
||||
tmFlotbutton,
|
||||
tmTags,
|
||||
tmEmpty,
|
||||
tmIcons,
|
||||
tmImages,
|
||||
tmFlowLayout,
|
||||
tmTabs
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isBlackTheme: false,
|
||||
loading: 'loading',
|
||||
category: {
|
||||
activeIndex: 0,
|
||||
activeValue: '',
|
||||
list: []
|
||||
},
|
||||
queryParams: {
|
||||
size: 10,
|
||||
page: 1,
|
||||
group: ""
|
||||
},
|
||||
cache: {
|
||||
dataList: [],
|
||||
total: 0
|
||||
},
|
||||
isLoadMore: false,
|
||||
loadMoreText: '',
|
||||
hasNext: false,
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
filterTakeTime(val) {
|
||||
return uni.$tm.dayjs(val).format('DD/MM/YYYY');
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.fnSetPageTitle('个人图库');
|
||||
this.fnGetCategory();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.dataList = []
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 1;
|
||||
this.fnGetData();
|
||||
},
|
||||
onReachBottom(e) {
|
||||
if (this.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetData();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnOnCategoryChange(index) {
|
||||
this.fnResetSetAniWaitIndex();
|
||||
this.cache.dataList = []
|
||||
this.dataList = [];
|
||||
this.queryParams.group = this.category.list[index].name;
|
||||
this.queryParams.page = 1;
|
||||
this.fnToTopPage();
|
||||
this.fnGetData();
|
||||
},
|
||||
fnGetCategory() {
|
||||
this.$httpApi.v2.getPhotoGroupList({
|
||||
page: 1,
|
||||
size: 9999
|
||||
}).then(res => {
|
||||
this.category.list = res.items.map(item => {
|
||||
return {
|
||||
name: item.metadata.name,
|
||||
displayName: item.spec.displayName
|
||||
}
|
||||
});
|
||||
if (this.category.list.length !== 0) {
|
||||
this.queryParams.group = this.category.list[0].name;
|
||||
this.fnGetData();
|
||||
}
|
||||
export default {
|
||||
components: {
|
||||
tmSkeleton,
|
||||
tmTranslate,
|
||||
tmFlotbutton,
|
||||
tmTags,
|
||||
tmEmpty,
|
||||
tmIcons,
|
||||
tmImages,
|
||||
tmFlowLayout,
|
||||
tmTabs
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isBlackTheme: false,
|
||||
loading: 'loading',
|
||||
category: {
|
||||
activeIndex: 0,
|
||||
activeValue: '',
|
||||
list: []
|
||||
},
|
||||
queryParams: {
|
||||
size: 10,
|
||||
page: 1,
|
||||
group: ""
|
||||
},
|
||||
cache: {
|
||||
dataList: [],
|
||||
total: 0
|
||||
},
|
||||
isLoadMore: false,
|
||||
loadMoreText: '',
|
||||
hasNext: false,
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
filterTakeTime(val) {
|
||||
return uni.$tm.dayjs(val).format('DD/MM/YYYY');
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.fnSetPageTitle('个人图库');
|
||||
this.fnGetCategory();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.dataList = []
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 1;
|
||||
this.fnGetData();
|
||||
},
|
||||
onReachBottom(e) {
|
||||
if (this.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetData();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnOnCategoryChange(index) {
|
||||
this.fnResetSetAniWaitIndex();
|
||||
this.cache.dataList = []
|
||||
this.dataList = [];
|
||||
this.queryParams.group = this.category.list[index].name;
|
||||
this.queryParams.page = 1;
|
||||
this.fnToTopPage();
|
||||
this.fnGetData();
|
||||
},
|
||||
fnGetCategory() {
|
||||
this.$httpApi.v2.getPhotoGroupList({
|
||||
page: 1,
|
||||
size: 9999
|
||||
}).then(res => {
|
||||
this.category.list = res.items.map(item => {
|
||||
return {
|
||||
name: item.metadata.name,
|
||||
displayName: item.spec.displayName
|
||||
}
|
||||
});
|
||||
if (this.category.list.length !== 0) {
|
||||
this.queryParams.group = this.category.list[0].name;
|
||||
this.fnGetData();
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
fnGetData() {
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '';
|
||||
this.$httpApi.v2
|
||||
.getPhotoListByGroupName(this.queryParams)
|
||||
.then(res => {
|
||||
console.log("相册 res", res)
|
||||
this.hasNext = res.hasNext;
|
||||
this.loading = 'success';
|
||||
if (res.items.length != 0) {
|
||||
const _list = res.items.map((item, index) => {
|
||||
item.spec.cover = this.$utils.checkImageUrl(item.spec.cover);
|
||||
return item;
|
||||
});
|
||||
this.fnCacheDataList(_list);
|
||||
if (this.isLoadMore) {
|
||||
this.dataList = this.dataList.concat(_list);
|
||||
} else {
|
||||
this.dataList = _list;
|
||||
}
|
||||
}
|
||||
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
});
|
||||
},
|
||||
fnGetData() {
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '';
|
||||
this.$httpApi.v2
|
||||
.getPhotoListByGroupName(this.queryParams)
|
||||
.then(res => {
|
||||
console.log("相册 res", res)
|
||||
this.hasNext = res.hasNext;
|
||||
this.loading = 'success';
|
||||
if (res.items.length != 0) {
|
||||
const _list = res.items.map((item, index) => {
|
||||
item.spec.cover = this.$utils.checkImageUrl(item.spec.cover);
|
||||
return item;
|
||||
});
|
||||
this.fnCacheDataList(_list);
|
||||
if (this.isLoadMore) {
|
||||
this.dataList = this.dataList.concat(_list);
|
||||
} else {
|
||||
this.dataList = _list;
|
||||
}
|
||||
}
|
||||
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
this.waterfall.loading = 'finish';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
// 缓存数据
|
||||
fnCacheDataList(dataList) {
|
||||
if (this.queryParams.page == 1) {
|
||||
this.cache.dataList = dataList;
|
||||
} else {
|
||||
this.cache.dataList = [...this.cache.dataList, ...dataList];
|
||||
}
|
||||
},
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
this.waterfall.loading = 'finish';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
// 缓存数据
|
||||
fnCacheDataList(dataList) {
|
||||
if (this.queryParams.page == 1) {
|
||||
this.cache.dataList = dataList;
|
||||
} else {
|
||||
this.cache.dataList = [...this.cache.dataList, ...dataList];
|
||||
}
|
||||
},
|
||||
|
||||
// 瀑布流组件点击事件
|
||||
fnOnClick(data) {
|
||||
console.log('点击数据', data);
|
||||
},
|
||||
// 预览
|
||||
fnPreview(index) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: this.dataList.map(x => x.spec.cover),
|
||||
indicator: 'number',
|
||||
loop: true
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
// 瀑布流组件点击事件
|
||||
fnOnClick(data) {
|
||||
console.log('点击数据', data);
|
||||
},
|
||||
// 预览
|
||||
fnPreview(index) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: this.dataList.map(x => x.spec.cover),
|
||||
indicator: 'number',
|
||||
loop: true
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 24rpx;
|
||||
background-color: #fafafa;
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 24rpx;
|
||||
background-color: #fafafa;
|
||||
|
||||
&.is-balck {
|
||||
background-color: #212121;
|
||||
}
|
||||
}
|
||||
&.is-balck {
|
||||
background-color: #212121;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
padding: 0 24rpx;
|
||||
padding-top: 24rpx;
|
||||
gap: 12rpx 0;
|
||||
.content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
padding: 0 24rpx;
|
||||
padding-top: 24rpx;
|
||||
gap: 12rpx 0;
|
||||
|
||||
.content-empty {
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
.content-empty {
|
||||
width: 100%;
|
||||
height: 70vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.loading-wrap {
|
||||
box-sizing: border-box;
|
||||
padding: 24rpx;
|
||||
}
|
||||
.loading-wrap {
|
||||
box-sizing: border-box;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
.card {
|
||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.load-text {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
.load-text {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
+412
-406
@@ -1,446 +1,452 @@
|
||||
<template>
|
||||
<view class="app-page">
|
||||
<tm-menubars iconColor="white" color="white" :flat="true" :showback="false">
|
||||
<image slot="left" class="logo ml-24 round-24" :src="bloggerInfo.avatar" mode="scaleToFill"></image>
|
||||
<view class="search-input round-12 pt-12 pb-12 flex pl-24" @click="fnToSearch">
|
||||
<text class="search-input_icon iconfont text-size-m icon-search text-grey"></text>
|
||||
<view class="search-input_text pl-12 text-size-m text-grey">搜索文章...</view>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS || H5 -->
|
||||
<view slot="right" class="mr-24 text-size-m text-grey">uni-halo</view>
|
||||
<!-- #endif -->
|
||||
</tm-menubars>
|
||||
<view v-if="loading != 'success' && articleList.length===0" class="loading-wrap">
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
<tm-skeleton model="cardActions"></tm-skeleton>
|
||||
<tm-skeleton model="list"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="bg-white pb-24">
|
||||
<view class="banner bg-white ml-24 mr-24 mt-12 round-3" v-if="bannerList.length != 0">
|
||||
<e-swiper :dotPosition="globalAppSettings.banner.dotPosition" :autoplay="true"
|
||||
:useDot="globalAppSettings.banner.useDot" :list="bannerList"
|
||||
@on-click="fnOnBannerClick"></e-swiper>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-between mt-16 mb-24 pl-24 pr-24">
|
||||
<view class="page-item_title text-weight-b ">精品分类</view>
|
||||
<view class="show-more flex flex-center bg-white round-3" @click="fnToCategoryPage">
|
||||
<text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text>
|
||||
</view>
|
||||
<view v-if="false" class="flex flex-center text-size-s text-grey-darken-1" @click="fnToCategoryPage">
|
||||
<text class=" text-size-m">查看更多</text>
|
||||
<text class="iconfont icon-angle-right text-size-s "></text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view class="category" scroll-x="true">
|
||||
<view v-if="categoryList.length == 0" class="cate-empty round-3 mr-5 flex flex-center text-grey">
|
||||
还没有任何文章分类~</view>
|
||||
<block v-else>
|
||||
<view class="content" v-for="(category, index) in categoryList" :key="category.metadata.name"
|
||||
@click="fnToCategoryBy(category)">
|
||||
<category-mini-card :category="category"></category-mini-card>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
<view class="app-page">
|
||||
<tm-menubars iconColor="white" color="white" :flat="true" :showback="false">
|
||||
<image slot="left" class="logo ml-24 round-24" :src="bloggerInfo.avatar" mode="scaleToFill"></image>
|
||||
<view class="search-input round-12 pt-12 pb-12 flex pl-24" @click="fnToSearch">
|
||||
<text class="search-input_icon iconfont text-size-m icon-search text-grey"></text>
|
||||
<view class="search-input_text pl-12 text-size-m text-grey">搜索文章...</view>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS || H5 -->
|
||||
<view slot="right" class="mr-24 text-size-m text-grey">uni-halo</view>
|
||||
<!-- #endif -->
|
||||
</tm-menubars>
|
||||
<view v-if="loading !== 'success' && articleList.length===0" class="loading-wrap">
|
||||
<tm-skeleton model="card"></tm-skeleton>
|
||||
<tm-skeleton model="cardActions"></tm-skeleton>
|
||||
<tm-skeleton model="list"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="bg-white pb-24">
|
||||
<view class="banner bg-white ml-24 mr-24 mt-12 round-3" v-if="bannerList.length != 0">
|
||||
<e-swiper :dotPosition="globalAppSettings.banner.dotPosition" :autoplay="true"
|
||||
:useDot="globalAppSettings.banner.useDot" :list="bannerList"
|
||||
@on-click="fnOnBannerClick"></e-swiper>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-between mt-16 mb-24 pl-24 pr-24">
|
||||
<view class="page-item_title text-weight-b ">精品分类</view>
|
||||
<view class="show-more flex flex-center bg-white round-3" @click="fnToCategoryPage">
|
||||
<text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text>
|
||||
</view>
|
||||
<view v-if="false" class="flex flex-center text-size-s text-grey-darken-1" @click="fnToCategoryPage">
|
||||
<text class=" text-size-m">查看更多</text>
|
||||
<text class="iconfont icon-angle-right text-size-s "></text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view class="category" scroll-x="true">
|
||||
<view v-if="categoryList.length == 0" class="cate-empty round-3 mr-5 flex flex-center text-grey">
|
||||
还没有任何文章分类~
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="content" v-for="(category, index) in categoryList" :key="category.metadata.name"
|
||||
@click="fnToCategoryBy(category)">
|
||||
<category-mini-card :category="category"></category-mini-card>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 最新文章 -->
|
||||
<view class="flex flex-between mt-24 mb-24 pl-24 pr-24">
|
||||
<view class="page-item_title text-weight-b">文章列表</view>
|
||||
<view class="show-more flex flex-center bg-white round-3" @click="fnToArticlesPage">
|
||||
<text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text>
|
||||
</view>
|
||||
<view v-if="false" class="flex flex-center text-size-s text-grey-darken-1" @click="fnToArticlesPage">
|
||||
<text class=" text-size-m ">查看更多</text>
|
||||
<text class="iconfont icon-angle-right text-size-s "></text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="articleList.length == 0" class="article-empty"><tm-empty icon="icon-shiliangzhinengduixiang-"
|
||||
label="博主还没有发表任何文章~"></tm-empty></view>
|
||||
<block v-else>
|
||||
<view :class="globalAppSettings.layout.home">
|
||||
<tm-translate v-for="(article, index) in articleList" :key="index" class="ani-item"
|
||||
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||
<article-card from="home" :article="article" :post="article"
|
||||
@on-click="fnToArticleDetail"></article-card>
|
||||
</tm-translate>
|
||||
</view>
|
||||
<view class="load-text mt-12">{{ loadMoreText }}</view>
|
||||
<tm-flotbutton v-if="articleList.length > 10" color="light-blue" @click="fnToTopPage" size="m"
|
||||
icon="icon-angle-up"></tm-flotbutton>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 最新文章 -->
|
||||
<view class="flex flex-between mt-24 mb-24 pl-24 pr-24">
|
||||
<view class="page-item_title text-weight-b">文章列表</view>
|
||||
<view class="show-more flex flex-center bg-white round-3" @click="fnToArticlesPage">
|
||||
<text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text>
|
||||
</view>
|
||||
<view v-if="false" class="flex flex-center text-size-s text-grey-darken-1" @click="fnToArticlesPage">
|
||||
<text class=" text-size-m ">查看更多</text>
|
||||
<text class="iconfont icon-angle-right text-size-s "></text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="articleList.length == 0" class="article-empty">
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-"
|
||||
label="博主还没有发表任何文章~"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<view :class="globalAppSettings.layout.home">
|
||||
<tm-translate v-for="(article, index) in articleList" :key="index" class="ani-item"
|
||||
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||
<article-card from="home" :article="article" :post="article"
|
||||
@on-click="fnToArticleDetail"></article-card>
|
||||
</tm-translate>
|
||||
</view>
|
||||
<view class="load-text mt-12">{{ loadMoreText }}</view>
|
||||
<tm-flotbutton v-if="articleList.length > 10" color="light-blue" @click="fnToTopPage" size="m"
|
||||
icon="icon-angle-up"></tm-flotbutton>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tmMenubars from '@/tm-vuetify/components/tm-menubars/tm-menubars.vue';
|
||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
import tmMenubars from '@/tm-vuetify/components/tm-menubars/tm-menubars.vue';
|
||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
|
||||
import eSwiper from '@/components/e-swiper/e-swiper.vue';
|
||||
import qs from 'qs'
|
||||
import eSwiper from '@/components/e-swiper/e-swiper.vue';
|
||||
import qs from 'qs'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
tmMenubars,
|
||||
tmSkeleton,
|
||||
tmTranslate,
|
||||
tmFlotbutton,
|
||||
tmIcons,
|
||||
tmEmpty,
|
||||
eSwiper
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: 'loading',
|
||||
queryParams: {
|
||||
size: 5,
|
||||
page: 1,
|
||||
sort: ['spec.pinned,desc', 'spec.publishTime,desc']
|
||||
},
|
||||
result: {},
|
||||
isLoadMore: false,
|
||||
loadMoreText: '加载中...',
|
||||
bannerCurrent: 0,
|
||||
bannerList: [],
|
||||
noticeList: [],
|
||||
articleList: [],
|
||||
categoryList: [],
|
||||
};
|
||||
},
|
||||
export default {
|
||||
components: {
|
||||
tmMenubars,
|
||||
tmSkeleton,
|
||||
tmTranslate,
|
||||
tmFlotbutton,
|
||||
tmIcons,
|
||||
tmEmpty,
|
||||
eSwiper
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: 'loading',
|
||||
queryParams: {
|
||||
size: 5,
|
||||
page: 1,
|
||||
sort: ['spec.pinned,desc', 'spec.publishTime,desc']
|
||||
},
|
||||
result: {},
|
||||
isLoadMore: false,
|
||||
loadMoreText: '加载中...',
|
||||
bannerCurrent: 0,
|
||||
bannerList: [],
|
||||
noticeList: [],
|
||||
articleList: [],
|
||||
categoryList: [],
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
bloggerInfo() {
|
||||
let blogger = this.$tm.vx.getters().getBlogger;
|
||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||
return blogger;
|
||||
},
|
||||
computed: {
|
||||
bloggerInfo() {
|
||||
let blogger = this.$tm.vx.getters().getConfigs.authorConfig.blogger;
|
||||
console.log('blogger----------------', blogger)
|
||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||
return blogger;
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
this.fnSetPageTitle();
|
||||
},
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
this.fnSetPageTitle();
|
||||
},
|
||||
created() {
|
||||
this.fnQuery();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 1;
|
||||
this.fnQuery();
|
||||
},
|
||||
|
||||
created() {
|
||||
this.fnQuery();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 1;
|
||||
this.fnQuery();
|
||||
},
|
||||
onReachBottom(e) {
|
||||
if (this.result.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetArticleList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnQuery() {
|
||||
this.fnGetBanner();
|
||||
this.fnGetArticleList();
|
||||
this.fnGetCategoryList();
|
||||
},
|
||||
|
||||
onReachBottom(e) {
|
||||
if (this.result.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetArticleList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnQuery() {
|
||||
this.fnGetBanner();
|
||||
this.fnGetArticleList();
|
||||
this.fnGetCategoryList();
|
||||
},
|
||||
fnGetCategoryList() {
|
||||
this.$httpApi.v2
|
||||
.getCategoryList({})
|
||||
.then(res => {
|
||||
this.categoryList = res.items.sort((a, b) => {
|
||||
return b.postCount - a.postCount;
|
||||
});
|
||||
|
||||
fnGetCategoryList() {
|
||||
this.$httpApi.v2
|
||||
.getCategoryList({})
|
||||
.then(res => {
|
||||
this.categoryList = res.items.sort((a, b) => {
|
||||
return b.postCount - a.postCount;
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.loading = 'success';
|
||||
}, 500);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
// 获取轮播图
|
||||
fnGetBanner() {
|
||||
const _this = this;
|
||||
const _format = function (list) {
|
||||
return list.map((item, index) => {
|
||||
return {
|
||||
mp4: '',
|
||||
id: item.metadata.name,
|
||||
nickname: item.owner.displayName,
|
||||
avatar: _this.$utils.checkImageUrl(item.owner.avatar),
|
||||
address: '',
|
||||
createTime: uni.$tm.dayjs(item.spec.publishTime).fromNow(),
|
||||
title: item.spec.title,
|
||||
src: _this.$utils.checkImageUrl(item.spec.cover),
|
||||
image: _this.$utils.checkImageUrl(item.spec.cover)
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
setTimeout(() => {
|
||||
this.loading = 'success';
|
||||
}, 500);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
// 获取轮播图
|
||||
fnGetBanner() {
|
||||
const _this = this;
|
||||
const _format = function(list) {
|
||||
return list.map((item, index) => {
|
||||
return {
|
||||
mp4: '',
|
||||
id: item.metadata.name,
|
||||
nickname: item.owner.displayName,
|
||||
avatar: _this.$utils.checkImageUrl(item.owner.avatar),
|
||||
address: '',
|
||||
createTime: uni.$tm.dayjs(item.spec.publishTime).fromNow(),
|
||||
title: item.spec.title,
|
||||
src: _this.$utils.checkImageUrl(item.spec.cover),
|
||||
image: _this.$utils.checkImageUrl(item.spec.cover)
|
||||
};
|
||||
});
|
||||
};
|
||||
const paramsStr = qs.stringify(this.queryParams, {
|
||||
allowDots: true,
|
||||
encodeValuesOnly: true,
|
||||
skipNulls: true,
|
||||
encode: true,
|
||||
arrayFormat: 'repeat'
|
||||
})
|
||||
uni.request({
|
||||
url: this.$baseApiUrl + '/apis/api.content.halo.run/v1alpha1/posts?' + paramsStr,
|
||||
method: 'GET',
|
||||
params: this.queryParams,
|
||||
success: (res) => {
|
||||
this.bannerList = _format(res.data.items);
|
||||
},
|
||||
fail: (err) => {
|
||||
}
|
||||
})
|
||||
|
||||
const paramsStr = qs.stringify(this.queryParams, {
|
||||
allowDots: true,
|
||||
encodeValuesOnly: true,
|
||||
skipNulls: true,
|
||||
encode: true,
|
||||
arrayFormat: 'repeat'
|
||||
})
|
||||
uni.request({
|
||||
url: this.$baseApiUrl + '/apis/api.content.halo.run/v1alpha1/posts?' + paramsStr,
|
||||
method: 'GET',
|
||||
params: this.queryParams,
|
||||
success: (res) => {
|
||||
this.bannerList = _format(res.data.items);
|
||||
},
|
||||
fail: (err) => {}
|
||||
})
|
||||
},
|
||||
fnOnBannerChange(e) {
|
||||
this.bannerCurrent = e.current;
|
||||
},
|
||||
fnOnBannerClick(item) {
|
||||
if (item.id == '') return;
|
||||
this.fnToArticleDetail({
|
||||
metadata: {
|
||||
name: item.id
|
||||
}
|
||||
});
|
||||
},
|
||||
// 文章列表
|
||||
fnGetArticleList() {
|
||||
// uni.showLoading({
|
||||
// mask: true,
|
||||
// title: '加载中...'
|
||||
// });
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '加载中...';
|
||||
|
||||
},
|
||||
fnOnBannerChange(e) {
|
||||
this.bannerCurrent = e.current;
|
||||
},
|
||||
fnOnBannerClick(item) {
|
||||
if (item.id == '') return;
|
||||
this.fnToArticleDetail({
|
||||
metadata: {
|
||||
name: item.id
|
||||
}
|
||||
});
|
||||
},
|
||||
// 文章列表
|
||||
fnGetArticleList() {
|
||||
// uni.showLoading({
|
||||
// mask: true,
|
||||
// title: '加载中...'
|
||||
// });
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '加载中...';
|
||||
const paramsStr = qs.stringify(this.queryParams, {
|
||||
allowDots: true,
|
||||
encodeValuesOnly: true,
|
||||
skipNulls: true,
|
||||
encode: true,
|
||||
arrayFormat: 'repeat'
|
||||
})
|
||||
uni.request({
|
||||
url: this.$baseApiUrl + '/apis/api.content.halo.run/v1alpha1/posts?' + paramsStr,
|
||||
method: 'GET',
|
||||
params: this.queryParams,
|
||||
success: (res) => {
|
||||
const data = res.data;
|
||||
this.result.hasNext = data.hasNext;
|
||||
if (this.isLoadMore) {
|
||||
this.articleList = this.articleList.concat(data.items);
|
||||
} else {
|
||||
this.articleList = data.items;
|
||||
}
|
||||
this.loading = 'success';
|
||||
this.loadMoreText = data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
fail: (err) => {
|
||||
this.loading = 'error';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
uni.$tm.toast(err.message || '数据加载失败!');
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
const paramsStr = qs.stringify(this.queryParams, {
|
||||
allowDots: true,
|
||||
encodeValuesOnly: true,
|
||||
skipNulls: true,
|
||||
encode: true,
|
||||
arrayFormat: 'repeat'
|
||||
})
|
||||
uni.request({
|
||||
url: this.$baseApiUrl + '/apis/api.content.halo.run/v1alpha1/posts?' + paramsStr,
|
||||
method: 'GET',
|
||||
params: this.queryParams,
|
||||
success: (res) => {
|
||||
const data = res.data;
|
||||
this.result.hasNext = data.hasNext;
|
||||
if (this.isLoadMore) {
|
||||
this.articleList = this.articleList.concat(data.items);
|
||||
} else {
|
||||
this.articleList = data.items;
|
||||
}
|
||||
this.loading = 'success';
|
||||
this.loadMoreText = data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
fail: (err) => {
|
||||
this.loading = 'error';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
uni.$tm.toast(err.message || '数据加载失败!');
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
})
|
||||
},
|
||||
//跳转文章详情
|
||||
fnToArticleDetail(article) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/article-detail/article-detail?name=' + article.metadata.name,
|
||||
animationType: 'slide-in-right'
|
||||
});
|
||||
},
|
||||
// 快捷导航页面跳转
|
||||
fnToNavPage(item) {
|
||||
switch (item.type) {
|
||||
case 'tabbar':
|
||||
uni.switchTab({
|
||||
url: item.path
|
||||
});
|
||||
break;
|
||||
case 'page':
|
||||
uni.navigateTo({
|
||||
url: item.path
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 分类页面
|
||||
fnToCategoryPage() {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/category/category'
|
||||
});
|
||||
},
|
||||
// 所有的文章列表页面
|
||||
fnToArticlesPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/articles/articles'
|
||||
});
|
||||
},
|
||||
|
||||
//跳转文章详情
|
||||
fnToArticleDetail(article) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/article-detail/article-detail?name=' + article.metadata.name,
|
||||
animationType: 'slide-in-right'
|
||||
});
|
||||
},
|
||||
// 快捷导航页面跳转
|
||||
fnToNavPage(item) {
|
||||
switch (item.type) {
|
||||
case 'tabbar':
|
||||
uni.switchTab({
|
||||
url: item.path
|
||||
});
|
||||
break;
|
||||
case 'page':
|
||||
uni.navigateTo({
|
||||
url: item.path
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 分类页面
|
||||
fnToCategoryPage() {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/category/category'
|
||||
});
|
||||
},
|
||||
// 所有的文章列表页面
|
||||
fnToArticlesPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/articles/articles'
|
||||
});
|
||||
},
|
||||
// 根据slug查询分类下的文章
|
||||
fnToCategoryBy(category) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesA/category-detail/category-detail?name=${category.metadata.name}&title=${category.spec.displayName}`
|
||||
});
|
||||
},
|
||||
|
||||
// 根据slug查询分类下的文章
|
||||
fnToCategoryBy(category) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesA/category-detail/category-detail?name=${category.metadata.name}&title=${category.spec.displayName}`
|
||||
});
|
||||
},
|
||||
fnChangeMode() {
|
||||
const isBlackTheme = this.$tm.vx.state().tmVuetify.black;
|
||||
this.$tm.theme.setBlack(!isBlackTheme);
|
||||
uni.setNavigationBarColor({
|
||||
backgroundColor: !isBlackTheme ? '#0a0a0a' : '#ffffff',
|
||||
frontColor: !isBlackTheme ? '#ffffff' : '#0a0a0a'
|
||||
});
|
||||
},
|
||||
|
||||
fnChangeMode() {
|
||||
const isBlackTheme = this.$tm.vx.state().tmVuetify.black;
|
||||
this.$tm.theme.setBlack(!isBlackTheme);
|
||||
uni.setNavigationBarColor({
|
||||
backgroundColor: !isBlackTheme ? '#0a0a0a' : '#ffffff',
|
||||
frontColor: !isBlackTheme ? '#ffffff' : '#0a0a0a'
|
||||
});
|
||||
},
|
||||
|
||||
fnToSearch() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/articles/articles'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
fnToSearch() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/articles/articles'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// background-color: #ffffff;
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// background-color: #ffffff;
|
||||
|
||||
.logo {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.logo {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
::v-deep {
|
||||
.tm-menubars .body .body_wk .left {
|
||||
min-width: initial;
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep {
|
||||
.tm-menubars .body .body_wk .left {
|
||||
min-width: initial;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-wrap {
|
||||
padding: 24rpx;
|
||||
}
|
||||
.loading-wrap {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
background-color: #f5f5f5;
|
||||
align-items: center;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
margin-right: 24rpx;
|
||||
.search-input {
|
||||
background-color: #f5f5f5;
|
||||
align-items: center;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
margin-right: 24rpx;
|
||||
|
||||
/* #endif */
|
||||
&_icon {}
|
||||
/* #endif */
|
||||
&_icon {
|
||||
}
|
||||
|
||||
&_text {}
|
||||
}
|
||||
&_text {
|
||||
}
|
||||
}
|
||||
|
||||
.show-more {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
.show-more {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.banner {
|
||||
overflow: hidden;
|
||||
}
|
||||
.banner {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.quick-nav {
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
.quick-nav {
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
|
||||
// box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
.name {
|
||||
color: var(--main-text-color);
|
||||
}
|
||||
}
|
||||
// box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
.name {
|
||||
color: var(--main-text-color);
|
||||
}
|
||||
}
|
||||
|
||||
.category {
|
||||
width: 94vw;
|
||||
display: flex;
|
||||
height: 200rpx;
|
||||
white-space: nowrap;
|
||||
margin: 0 24rpx;
|
||||
.category {
|
||||
width: 94vw;
|
||||
display: flex;
|
||||
height: 200rpx;
|
||||
white-space: nowrap;
|
||||
margin: 0 24rpx;
|
||||
|
||||
.content {
|
||||
display: inline-block;
|
||||
padding-left: 24rpx;
|
||||
.content {
|
||||
display: inline-block;
|
||||
padding-left: 24rpx;
|
||||
|
||||
&:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
&:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cate-empty {
|
||||
height: inherit;
|
||||
}
|
||||
}
|
||||
.cate-empty {
|
||||
height: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.page-item {
|
||||
&_title {
|
||||
position: relative;
|
||||
padding-left: 24rpx;
|
||||
font-size: 32rpx;
|
||||
z-index: 1;
|
||||
color: var(--main-text-color);
|
||||
.page-item {
|
||||
&_title {
|
||||
position: relative;
|
||||
padding-left: 24rpx;
|
||||
font-size: 32rpx;
|
||||
z-index: 1;
|
||||
color: var(--main-text-color);
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0rpx;
|
||||
top: 8rpx;
|
||||
width: 8rpx;
|
||||
height: 30rpx;
|
||||
background-color: rgba(33, 150, 243, 1);
|
||||
border-radius: 6rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
&:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0rpx;
|
||||
top: 8rpx;
|
||||
width: 8rpx;
|
||||
height: 30rpx;
|
||||
background-color: rgba(33, 150, 243, 1);
|
||||
border-radius: 6rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.h_row_col2 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
padding: 0 12rpx;
|
||||
.h_row_col2 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
padding: 0 12rpx;
|
||||
|
||||
.ani-item {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.ani-item {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
+219
-215
@@ -1,236 +1,240 @@
|
||||
<template>
|
||||
<view class="app-page">
|
||||
<view v-if="loading != 'success'" class="loading-wrap">
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
</view>
|
||||
<!-- 内容区域 -->
|
||||
<view v-else class="app-page-content">
|
||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center">
|
||||
<!-- 空布局 -->
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无数据"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<block v-for="(moment, index) in dataList" :key="index">
|
||||
<!-- 卡片 -->
|
||||
<tm-translate animation-name="fadeUp" :wait="calcAniWait()">
|
||||
<view class="moment-card">
|
||||
<view class="head" style="display: flex;align-items: center;">
|
||||
<view class="avatar" style="flex-shrink: 0;">
|
||||
<image style="width: 66rpx;height: 66rpx;border-radius: 50%;"
|
||||
:src="moment.spec.user.avatar" />
|
||||
</view>
|
||||
<view class="nickname" style="margin-left: 12rpx;">
|
||||
<view style="font-size: 30rpx;font-weight: bold;color: #333333;">
|
||||
{{moment.spec.user.displayName}}
|
||||
</view>
|
||||
<view style="margin-top: 6rpx;font-size: 24rpx;color: #666;">
|
||||
{{ { d: moment.spec.releaseTime, f: 'yyyy年MM月dd日 星期w' } | formatTime }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<mp-html class="evan-markdown" lazy-load :domain="markdownConfig.domain"
|
||||
:loading-img="markdownConfig.loadingGif" :scroll-table="true" :selectable="true"
|
||||
:tag-style="markdownConfig.tagStyle" :container-style="markdownConfig.containStyle"
|
||||
:content="moment.spec.content.html" :markdown="true" :showLineNumber="true"
|
||||
:showLanguageName="true" :copyByLongPress="true" />
|
||||
</view>
|
||||
<view v-if="moment.spec.content.medium.length!==0" class="images"
|
||||
:class="['images-'+moment.spec.content.medium.length]">
|
||||
<view class="image-item" v-for="(image,mediumIndex) in moment.spec.content.medium"
|
||||
:key="mediumIndex">
|
||||
<image mode="aspectFill" style="width: 100%;height: 100%;border-radius: 6rpx;"
|
||||
:src="image.url" @click="handlePreview(mediumIndex,moment.spec.content.medium)" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tm-translate>
|
||||
</block>
|
||||
<tm-flotbutton @click="fnToTopPage" size="m" color="light-blue" icon="icon-angle-up"></tm-flotbutton>
|
||||
<view class="load-text">{{ loadMoreText }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="app-page">
|
||||
<view v-if="loading != 'success'" class="loading-wrap">
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
</view>
|
||||
<!-- 内容区域 -->
|
||||
<view v-else class="app-page-content">
|
||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center" style="min-height: 70vh;">
|
||||
<!-- 空布局 -->
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无数据"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<block v-for="(moment, index) in dataList" :key="index">
|
||||
<!-- 卡片 -->
|
||||
<tm-translate animation-name="fadeUp" :wait="calcAniWait()">
|
||||
<view class="moment-card">
|
||||
<view class="head" style="display: flex;align-items: center;">
|
||||
<view class="avatar" style="flex-shrink: 0;">
|
||||
<image style="width: 66rpx;height: 66rpx;border-radius: 50%;"
|
||||
:src="moment.spec.user.avatar"/>
|
||||
</view>
|
||||
<view class="nickname" style="margin-left: 12rpx;">
|
||||
<view style="font-size: 30rpx;font-weight: bold;color: #333333;">
|
||||
{{ moment.spec.user.displayName }}
|
||||
</view>
|
||||
<view style="margin-top: 6rpx;font-size: 24rpx;color: #666;">
|
||||
{{ {d: moment.spec.releaseTime, f: 'yyyy年MM月dd日 星期w'} | formatTime }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<mp-html class="evan-markdown" lazy-load :domain="markdownConfig.domain"
|
||||
:loading-img="markdownConfig.loadingGif" :scroll-table="true" :selectable="true"
|
||||
:tag-style="markdownConfig.tagStyle" :container-style="markdownConfig.containStyle"
|
||||
:content="moment.spec.content.html" :markdown="true" :showLineNumber="true"
|
||||
:showLanguageName="true" :copyByLongPress="true"/>
|
||||
</view>
|
||||
<view v-if="moment.spec.content.medium.length!==0" class="images"
|
||||
:class="['images-'+moment.spec.content.medium.length]">
|
||||
<view class="image-item" v-for="(image,mediumIndex) in moment.spec.content.medium"
|
||||
:key="mediumIndex">
|
||||
<image mode="aspectFill" style="width: 100%;height: 100%;border-radius: 6rpx;"
|
||||
:src="image.url"
|
||||
@click="handlePreview(mediumIndex,moment.spec.content.medium)"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</tm-translate>
|
||||
</block>
|
||||
<tm-flotbutton @click="fnToTopPage" size="m" color="light-blue" icon="icon-angle-up"></tm-flotbutton>
|
||||
<view class="load-text">{{ loadMoreText }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
|
||||
import MarkdownConfig from '@/common/markdown/markdown.config.js';
|
||||
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
||||
export default {
|
||||
components: {
|
||||
tmSkeleton,
|
||||
tmFlotbutton,
|
||||
tmTranslate,
|
||||
tmEmpty,
|
||||
mpHtml
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
markdownConfig: MarkdownConfig,
|
||||
loading: 'loading',
|
||||
queryParams: {
|
||||
size: 10,
|
||||
page: 1
|
||||
},
|
||||
hasNext: false,
|
||||
dataList: [],
|
||||
isLoadMore: false,
|
||||
loadMoreText: '加载中...'
|
||||
};
|
||||
},
|
||||
import MarkdownConfig from '@/common/markdown/markdown.config.js';
|
||||
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
||||
|
||||
computed: {
|
||||
bloggerInfo() {
|
||||
return this.$tm.vx.getters().getBlogger;
|
||||
},
|
||||
},
|
||||
export default {
|
||||
components: {
|
||||
tmSkeleton,
|
||||
tmFlotbutton,
|
||||
tmTranslate,
|
||||
tmEmpty,
|
||||
mpHtml
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
markdownConfig: MarkdownConfig,
|
||||
loading: 'loading',
|
||||
queryParams: {
|
||||
size: 10,
|
||||
page: 1
|
||||
},
|
||||
hasNext: false,
|
||||
dataList: [],
|
||||
isLoadMore: false,
|
||||
loadMoreText: '加载中...'
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.fnGetData();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 0;
|
||||
this.fnGetData();
|
||||
},
|
||||
computed: {
|
||||
bloggerInfo() {
|
||||
let blogger = this.$tm.vx.getters().getConfigs.authorConfig.blogger;
|
||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||
return blogger;
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom(e) {
|
||||
if (this.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetData();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnGetData() {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中...'
|
||||
});
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '加载中...';
|
||||
this.$httpApi.v2
|
||||
.getMomentList(this.queryParams)
|
||||
.then(res => {
|
||||
console.log('请求结果:');
|
||||
console.log(res);
|
||||
onLoad() {
|
||||
this.fnGetData();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 0;
|
||||
this.fnGetData();
|
||||
},
|
||||
|
||||
this.loading = 'success';
|
||||
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
this.hasNext = res.hasNext;
|
||||
onReachBottom(e) {
|
||||
if (this.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetData();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnGetData() {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中...'
|
||||
});
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '加载中...';
|
||||
this.$httpApi.v2
|
||||
.getMomentList(this.queryParams)
|
||||
.then(res => {
|
||||
console.log('请求结果:');
|
||||
console.log(res);
|
||||
|
||||
const tempItems = res.items.map(item => {
|
||||
item.spec.user = {
|
||||
displayName: this.bloggerInfo.nickname,
|
||||
avatar: this.$utils.checkAvatarUrl(this.bloggerInfo.avatar)
|
||||
}
|
||||
item.spec.content.medium
|
||||
.filter(x => x.type === 'PHOTO')
|
||||
.map(medium => {
|
||||
medium.url = this.$utils.checkThumbnailUrl(medium.url, true)
|
||||
})
|
||||
return item;
|
||||
})
|
||||
this.loading = 'success';
|
||||
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
this.hasNext = res.hasNext;
|
||||
|
||||
if (this.isLoadMore) {
|
||||
this.dataList = this.dataList.concat(tempItems);
|
||||
} else {
|
||||
this.dataList = tempItems;
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
handlePreview(index, list) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: list.map(item => item.url)
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
const tempItems = res.items.map(item => {
|
||||
item.spec.user = {
|
||||
displayName: this.bloggerInfo.nickname,
|
||||
avatar: this.$utils.checkAvatarUrl(this.bloggerInfo.avatar)
|
||||
}
|
||||
item.spec.content.medium
|
||||
.filter(x => x.type === 'PHOTO')
|
||||
.map(medium => {
|
||||
medium.url = this.$utils.checkThumbnailUrl(medium.url, true)
|
||||
})
|
||||
return item;
|
||||
})
|
||||
|
||||
if (this.isLoadMore) {
|
||||
this.dataList = this.dataList.concat(tempItems);
|
||||
} else {
|
||||
this.dataList = tempItems;
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
handlePreview(index, list) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: list.map(item => item.url)
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 24rpx 0;
|
||||
}
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 24rpx 0;
|
||||
}
|
||||
|
||||
.loading-wrap {
|
||||
padding: 24rpx;
|
||||
}
|
||||
.loading-wrap {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.moment-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
margin: 0 24rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: #ffff;
|
||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
overflow: hidden;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.moment-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
margin: 0 24rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: #ffff;
|
||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
overflow: hidden;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.head {
|
||||
padding: 24rpx;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.head {
|
||||
padding: 24rpx;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.images {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
padding: 24rpx;
|
||||
padding-top: 0;
|
||||
.images {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
padding: 24rpx;
|
||||
padding-top: 0;
|
||||
|
||||
.image-item {
|
||||
box-sizing: border-box;
|
||||
border-radius: 24rpx;
|
||||
padding: 6rpx;
|
||||
width: 33%;
|
||||
height: 200rpx
|
||||
}
|
||||
.image-item {
|
||||
box-sizing: border-box;
|
||||
border-radius: 24rpx;
|
||||
padding: 6rpx;
|
||||
width: 33%;
|
||||
height: 200rpx
|
||||
}
|
||||
|
||||
&-1 {
|
||||
>.image-item {
|
||||
width: 100%;
|
||||
height: 350rpx
|
||||
}
|
||||
}
|
||||
&-1 {
|
||||
> .image-item {
|
||||
width: 100%;
|
||||
height: 350rpx
|
||||
}
|
||||
}
|
||||
|
||||
&-2 {
|
||||
>.image-item {
|
||||
width: 50%;
|
||||
height: 250rpx
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
&-2 {
|
||||
> .image-item {
|
||||
width: 50%;
|
||||
height: 250rpx
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user