mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2025-05-20 02:20:15 +09:00
update: 修复首次运行跳转页面非首页问题
This commit is contained in:
parent
90ef890766
commit
f6069cad95
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="article-card " :class="cardType" @click="fnClickEvent('card')">
|
<view class="article-card " :class="cardType" @click="fnClickEvent('card')">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<cache-image class="thumbnail" radius="6rpx" :url="$utils.checkThumbnailUrl(article.spec.cover)" :fileMd5="$utils.checkThumbnailUrl(article.spec.cover)" mode="aspectFill"></cache-image>
|
<cache-image class="thumbnail" radius="6rpx" :url="$utils.checkThumbnailUrl(article.spec.cover)" :fileMd5="article.spec.cover" mode="aspectFill"></cache-image>
|
||||||
<!-- <image class="thumbnail" lazy-load :src="$utils.checkThumbnailUrl(article.thumbnail)" mode="aspectFill"></image> -->
|
<!-- <image class="thumbnail" lazy-load :src="$utils.checkThumbnailUrl(article.spec.cover)" mode="aspectFill"></image> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
|
@ -12,19 +12,14 @@
|
|||||||
fnCheckShowStarted() {
|
fnCheckShowStarted() {
|
||||||
if (!getApp().globalData.start.use) {
|
if (!getApp().globalData.start.use) {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
// url: '/pages/tabbar/home/home'
|
url: '/pages/tabbar/home/home'
|
||||||
url: '/pages/tabbar/moments/moments'
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
// url: '/pages/tabbar/home/home'
|
url: '/pages/tabbar/home/home'
|
||||||
url: '/pages/tabbar/moments/moments'
|
|
||||||
});
|
});
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pagesA/friend-links/friend-links'
|
|
||||||
// });
|
|
||||||
} else {
|
} else {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pagesA/start/start'
|
url: '/pagesA/start/start'
|
||||||
|
@ -311,17 +311,17 @@
|
|||||||
// type: 'poup',
|
// type: 'poup',
|
||||||
// show: true
|
// show: true
|
||||||
// },
|
// },
|
||||||
{
|
// {
|
||||||
key: 'update',
|
// key: 'update',
|
||||||
title: '版本更新',
|
// title: '版本更新',
|
||||||
leftIcon: 'icon-clouddownload',
|
// leftIcon: 'icon-clouddownload',
|
||||||
leftIconColor: 'pink',
|
// leftIconColor: 'pink',
|
||||||
rightText: `当前版本 v${systemInfo.appVersion}`,
|
// rightText: `当前版本 v${systemInfo.appVersion}`,
|
||||||
path: 'update',
|
// path: 'update',
|
||||||
isAdmin: false,
|
// isAdmin: false,
|
||||||
type: 'poup',
|
// type: 'poup',
|
||||||
show: true
|
// show: true
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
key: 'setting',
|
key: 'setting',
|
||||||
title: '应用设置',
|
title: '应用设置',
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
markdownConfig: MarkdownConfig,
|
markdownConfig: MarkdownConfig,
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
queryParams: {
|
queryParams: {
|
||||||
size: 10,
|
size: 20,
|
||||||
page: 1
|
page: 1
|
||||||
},
|
},
|
||||||
result: null,
|
result: null,
|
||||||
|
@ -20,35 +20,17 @@
|
|||||||
<!-- 空布局 -->
|
<!-- 空布局 -->
|
||||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有分享图片~"></tm-empty>
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有分享图片~"></tm-empty>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
|
||||||
<tm-flowLayout v-if="globalAppSettings.gallery.useWaterfull" @click="fnOnClick" ref="wafll">
|
|
||||||
<template v-slot:left="{ hdata }">
|
|
||||||
<tm-translate animation-name="fadeUp">
|
|
||||||
<view class="card round-3 overflow white">
|
|
||||||
<tm-images :previmage="false" :src="hdata.item.spec.cover"
|
|
||||||
@click="fnPreview(hdata.item)"></tm-images>
|
|
||||||
</view>
|
|
||||||
</tm-translate>
|
|
||||||
</template>
|
|
||||||
<template v-slot:right="{ hdata }">
|
|
||||||
<tm-translate animation-name="fadeUp">
|
|
||||||
<view class="card round-3 overflow white">
|
|
||||||
<tm-images :previmage="false" :src="hdata.item.spec.cover"
|
|
||||||
@click="fnPreview(hdata.item)"></tm-images>
|
|
||||||
</view>
|
|
||||||
</tm-translate>
|
|
||||||
</template>
|
|
||||||
</tm-flowLayout>
|
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(item, index) in dataList" :key="index">
|
<block v-for="(item, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
<tm-translate style="box-sizing: border-box;padding: 6rpx;width: 50%;height: 250rpx;"
|
||||||
<view class="round-3 shadow-2 overflow white mb-24">
|
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<tm-images :previmage="false" :src="item.spec.cover"
|
<view style="border-radius: 12rpx;overflow: hidden;width: 100%;height: 250rpx;">
|
||||||
@click="fnPreview(item)"></tm-images>
|
<image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.cover"
|
||||||
|
@click="fnPreview(item)" />
|
||||||
</view>
|
</view>
|
||||||
</tm-translate>
|
</tm-translate>
|
||||||
</block>
|
</block>
|
||||||
</block>
|
|
||||||
<tm-flotbutton @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
<tm-flotbutton @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||||
<view class="load-text">{{ loadMoreText }}</view>
|
<view class="load-text">{{ loadMoreText }}</view>
|
||||||
</block>
|
</block>
|
||||||
@ -133,6 +115,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
fnOnCategoryChange(index) {
|
fnOnCategoryChange(index) {
|
||||||
this.fnResetSetAniWaitIndex();
|
this.fnResetSetAniWaitIndex();
|
||||||
|
this.cache.dataList = []
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
this.queryParams.group = this.category.list[index].name;
|
this.queryParams.group = this.category.list[index].name;
|
||||||
this.queryParams.page = 1;
|
this.queryParams.page = 1;
|
||||||
@ -175,13 +158,10 @@
|
|||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
this.fnCacheDataList(_list);
|
this.fnCacheDataList(_list);
|
||||||
if (this.globalAppSettings.gallery.useWaterfull) {
|
if (this.isLoadMore) {
|
||||||
this.dataList = _list;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.wafll.pushData(_list);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.dataList = this.dataList.concat(_list);
|
this.dataList = this.dataList.concat(_list);
|
||||||
|
} else {
|
||||||
|
this.dataList = _list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
@ -242,11 +222,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
padding-top: 24rpx;
|
padding-top: 24rpx;
|
||||||
|
gap: 12rpx 0;
|
||||||
|
|
||||||
.content-empty {
|
.content-empty {
|
||||||
|
width: 100%;
|
||||||
height: 60vh;
|
height: 60vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -262,4 +246,9 @@
|
|||||||
.card {
|
.card {
|
||||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.load-text {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page">
|
<view class="app-page">
|
||||||
<tm-menubars iconColor="white" color="white" :flat="true" :showback="false">
|
<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 slot="left" class="logo ml-24 round-24" :src="bloggerInfo.avatar" mode="scaleToFill"></image>
|
||||||
@click="$tm.toast('以后会放一个彩蛋~')"></image>
|
|
||||||
<view class="search-input round-12 pt-12 pb-12 flex pl-24" @click="fnToSearch">
|
<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>
|
<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 class="search-input_text pl-12 text-size-m text-grey">搜索文章...</view>
|
||||||
@ -11,7 +10,7 @@
|
|||||||
<view slot="right" class="mr-24 text-size-m text-grey">uni-halo</view>
|
<view slot="right" class="mr-24 text-size-m text-grey">uni-halo</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</tm-menubars>
|
</tm-menubars>
|
||||||
<view v-if="loading != 'success'" class="loading-wrap">
|
<view v-if="loading != 'success' && articleList.length===0" class="loading-wrap">
|
||||||
<tm-skeleton model="card"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="cardActions"></tm-skeleton>
|
<tm-skeleton model="cardActions"></tm-skeleton>
|
||||||
<tm-skeleton model="list"></tm-skeleton>
|
<tm-skeleton model="list"></tm-skeleton>
|
||||||
@ -65,28 +64,16 @@
|
|||||||
label="博主还没有发表任何文章~"></tm-empty></view>
|
label="博主还没有发表任何文章~"></tm-empty></view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<view :class="globalAppSettings.layout.home">
|
<view :class="globalAppSettings.layout.home">
|
||||||
<block v-for="(article, index) in articleList" :key="article.spec.slug">
|
<tm-translate v-for="(article, index) in articleList" :key="article.metadata.name" class="ani-item"
|
||||||
<tm-translate class="ani-item" animation-name="fadeUp" :wait="calcAniWait(index)">
|
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<article-card from="home" :article="article" @on-click="fnToArticleDetail"></article-card>
|
<article-card from="home" :article="article" @on-click="fnToArticleDetail"></article-card>
|
||||||
<!-- 广告区域 -->
|
|
||||||
<view v-if="haloAdConfig.home.use && (index + 1) % haloAdConfig.frequency == 0"
|
|
||||||
class="ad-wrap ma-24">
|
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
|
||||||
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
|
||||||
<ad v-if="haloAdConfig.adpid" :adpid="haloAdConfig.adpid"></ad>
|
|
||||||
<!-- #endif -->
|
|
||||||
</view>
|
|
||||||
</tm-translate>
|
</tm-translate>
|
||||||
</block>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="load-text mt-12">{{ loadMoreText }}</view>
|
<view class="load-text mt-12">{{ loadMoreText }}</view>
|
||||||
<tm-flotbutton v-if="articleList.length > 10" color="light-blue" @click="fnToTopPage" size="m"
|
<tm-flotbutton v-if="articleList.length > 10" color="light-blue" @click="fnToTopPage" size="m"
|
||||||
icon="icon-angle-up"></tm-flotbutton>
|
icon="icon-angle-up"></tm-flotbutton>
|
||||||
</block>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
<!-- <tm-flotbutton @click="fnChangeMode" size="m" color="light-blue" :icon="$tm.vx.state().tmVuetify.black ? 'icon-lightbulb' : 'icon-lightbulb-fill'"></tm-flotbutton> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -173,7 +160,6 @@
|
|||||||
this.$httpApi.v2
|
this.$httpApi.v2
|
||||||
.getCategoryList({})
|
.getCategoryList({})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('查询分类成功:', res);
|
|
||||||
this.categoryList = res.items.sort((a, b) => {
|
this.categoryList = res.items.sort((a, b) => {
|
||||||
return b.postCount - a.postCount;
|
return b.postCount - a.postCount;
|
||||||
});
|
});
|
||||||
@ -271,19 +257,22 @@
|
|||||||
this.loading = 'loading';
|
this.loading = 'loading';
|
||||||
}
|
}
|
||||||
this.loadMoreText = '加载中...';
|
this.loadMoreText = '加载中...';
|
||||||
|
|
||||||
|
|
||||||
this.$httpApi.v2
|
this.$httpApi.v2
|
||||||
.getPostList(this.queryParams)
|
.getPostList(this.queryParams)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('加载成功', res);
|
console.log('加载成功', res);
|
||||||
this.loading = 'success';
|
setTimeout(() => {
|
||||||
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
|
||||||
this.result = res;
|
this.result = res;
|
||||||
if (this.isLoadMore) {
|
if (this.isLoadMore) {
|
||||||
this.articleList = this.articleList.concat(res.items);
|
this.articleList = this.articleList.concat(res.items);
|
||||||
} else {
|
} else {
|
||||||
this.articleList = res.items;
|
this.articleList = res.items;
|
||||||
}
|
}
|
||||||
|
}, 200)
|
||||||
this.loading = 'success';
|
this.loading = 'success';
|
||||||
|
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.loading = 'error';
|
this.loading = 'error';
|
||||||
|
@ -34,7 +34,6 @@ const utils = {
|
|||||||
|
|
||||||
// 检查封面图
|
// 检查封面图
|
||||||
checkThumbnailUrl: function(thumbnail, mustRealUrl = false) {
|
checkThumbnailUrl: function(thumbnail, mustRealUrl = false) {
|
||||||
console.log("thumbnail",thumbnail)
|
|
||||||
if (!thumbnail && mustRealUrl) {
|
if (!thumbnail && mustRealUrl) {
|
||||||
return HaloConfig.defaultStaticThumbnailUrl
|
return HaloConfig.defaultStaticThumbnailUrl
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user