mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2025-05-19 10:00:13 +09:00
修改:修复恋爱日记在微信小程序ios下的日期转换错误bug;
修改:修复海报分享因为无图使用随机图在微信小程序下异常bug; 新增:halo.config.template.js 新增一个配置项 defaultStaticThumbnailUrl 默认静态图片用于海报在无图且使用了随机图时候的封面图片地址
This commit is contained in:
parent
5000da9a64
commit
261617fc12
@ -56,7 +56,7 @@ export default {
|
|||||||
margin: 12rpx 24rpx;
|
margin: 12rpx 24rpx;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
padding: 16rpx;
|
padding: 16rpx;
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
&.lr_image_text {
|
&.lr_image_text {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaultThumbnailUrl: '', // 默认封面图地址
|
defaultThumbnailUrl: '', // 默认封面图地址
|
||||||
|
defaultStaticThumbnailUrl: '', // 静态默认封面图(不可以是随机图地址)
|
||||||
defaultImageUrl: '', // 默认图片地址
|
defaultImageUrl: '', // 默认图片地址
|
||||||
defaultAvatarUrl: '', // 默认头像地址
|
defaultAvatarUrl: '', // 默认头像地址
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有文章分类~"></tm-empty>
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有文章分类~"></tm-empty>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<tm-sliderNav :list="categoryList" color="light-blue" rang-key="name" @change="fnOnCategoryChange"></tm-sliderNav>
|
<tm-sliderNav :list="categoryList" bg-color="white" color="light-blue" rang-key="name" @change="fnOnCategoryChange"></tm-sliderNav>
|
||||||
<scroll-view
|
<scroll-view
|
||||||
class="right-content pt-12 pb-12"
|
class="right-content pt-12 pb-12"
|
||||||
:scroll-y="true"
|
:scroll-y="true"
|
||||||
@ -20,6 +20,7 @@
|
|||||||
:refresher-enabled="true"
|
:refresher-enabled="true"
|
||||||
:refresher-triggered="triggered"
|
:refresher-triggered="triggered"
|
||||||
:refresher-threshold="60"
|
:refresher-threshold="60"
|
||||||
|
refresher-background="#fafafa"
|
||||||
@refresherrefresh="fnGetData(true)"
|
@refresherrefresh="fnGetData(true)"
|
||||||
@scrolltolower="fnGetData(false)"
|
@scrolltolower="fnGetData(false)"
|
||||||
@scroll="fnOnScroll"
|
@scroll="fnOnScroll"
|
||||||
@ -235,6 +236,7 @@ export default {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
background-color: #fafafa;
|
||||||
}
|
}
|
||||||
.loading-wrap {
|
.loading-wrap {
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page" :class="{ 'is-balck grey-darken-6': isBlackTheme }">
|
<view class="app-page">
|
||||||
<!-- 顶部切换 -->
|
<!-- 顶部切换 -->
|
||||||
<view class="e-fixed" v-if="category.list.length > 2">
|
<view class="e-fixed" v-if="category.list.length > 2">
|
||||||
<tm-tabs color="light-blue" v-model="category.activeIndex" :list="category.list" align="left" @change="fnOnCategoryChange"></tm-tabs>
|
<tm-tabs color="light-blue" v-model="category.activeIndex" :list="category.list" align="left" @change="fnOnCategoryChange"></tm-tabs>
|
||||||
@ -9,14 +9,12 @@
|
|||||||
<!-- 加载区域 -->
|
<!-- 加载区域 -->
|
||||||
<view v-if="loading != 'success'" class="loading-wrap">
|
<view v-if="loading != 'success'" class="loading-wrap">
|
||||||
<tm-skeleton model="card"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="cardActions"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="list"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<view class="content" v-else :class="{ 'bg-white': dataList.length !== 0 }">
|
<view class="content" v-else>
|
||||||
<view v-if="dataList.length == 0" class="content-empty">
|
<view v-if="dataList.length == 0" class="content-empty">
|
||||||
<!-- 空布局 -->
|
<!-- 空布局 -->
|
||||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有分享图片~"></tm-empty>
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有分享图片~"></tm-empty>
|
||||||
@ -25,7 +23,7 @@
|
|||||||
<tm-flowLayout v-if="globalAppSettings.gallery.useWaterfull" @click="fnOnClick" ref="wafll">
|
<tm-flowLayout v-if="globalAppSettings.gallery.useWaterfull" @click="fnOnClick" ref="wafll">
|
||||||
<template v-slot:left="{ hdata }">
|
<template v-slot:left="{ hdata }">
|
||||||
<tm-translate animation-name="fadeUp">
|
<tm-translate animation-name="fadeUp">
|
||||||
<view class="round-3 shadow-2 overflow white">
|
<view class="card round-3 overflow white">
|
||||||
<tm-images :previmage="false" :src="hdata.item.image" @click="fnPreview(hdata.item)"></tm-images>
|
<tm-images :previmage="false" :src="hdata.item.image" @click="fnPreview(hdata.item)"></tm-images>
|
||||||
<view class="pa-10 text-size-s">
|
<view class="pa-10 text-size-s">
|
||||||
<view class="text-overflow-2">
|
<view class="text-overflow-2">
|
||||||
@ -50,7 +48,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot:right="{ hdata }">
|
<template v-slot:right="{ hdata }">
|
||||||
<tm-translate animation-name="fadeUp">
|
<tm-translate animation-name="fadeUp">
|
||||||
<view class="round-3 shadow-2 overflow white">
|
<view class="card round-3 overflow white">
|
||||||
<tm-images :previmage="false" :src="hdata.item.image" @click="fnPreview(hdata.item)"></tm-images>
|
<tm-images :previmage="false" :src="hdata.item.image" @click="fnPreview(hdata.item)"></tm-images>
|
||||||
<view class="pa-10 text-size-s">
|
<view class="pa-10 text-size-s">
|
||||||
<view class="text-overflow-2">
|
<view class="text-overflow-2">
|
||||||
@ -301,7 +299,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-bottom: 24rpx;
|
padding-bottom: 24rpx;
|
||||||
background-color: #fafafd;
|
background-color: #fafafa;
|
||||||
|
|
||||||
&.is-balck {
|
&.is-balck {
|
||||||
background-color: #212121;
|
background-color: #212121;
|
||||||
@ -323,4 +321,7 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
}
|
}
|
||||||
|
.card {
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -95,7 +95,7 @@
|
|||||||
|
|
||||||
<!-- 版权声明 -->
|
<!-- 版权声明 -->
|
||||||
<view v-if="copyright.use" class="copyright-wrap bg-white mt-24 pa-24 round-4">
|
<view v-if="copyright.use" class="copyright-wrap bg-white mt-24 pa-24 round-4">
|
||||||
<view class="copyright-title text-weight-b">版权信息</view>
|
<view class="copyright-title text-weight-b">版权声明</view>
|
||||||
<view class="copyright-content mt-12 grey-lighten-5 text-grey-darken-2 round-4 pt-12 pb-12 pl-24 pr-24 ">
|
<view class="copyright-content mt-12 grey-lighten-5 text-grey-darken-2 round-4 pt-12 pb-12 pl-24 pr-24 ">
|
||||||
<view v-if="copyright.author" class="copyright-text text-size-s ">版权归属:{{ copyright.author }}</view>
|
<view v-if="copyright.author" class="copyright-text text-size-s ">版权归属:{{ copyright.author }}</view>
|
||||||
<view v-if="copyright.description" class="copyright-text text-size-s mt-12">版权说明:{{ copyright.description }}</view>
|
<view v-if="copyright.description" class="copyright-text text-size-s mt-12">版权说明:{{ copyright.description }}</view>
|
||||||
@ -392,6 +392,8 @@ export default {
|
|||||||
fnCreatePoster(callback) {
|
fnCreatePoster(callback) {
|
||||||
this.$nextTick(async () => {
|
this.$nextTick(async () => {
|
||||||
const systemInfo = await uni.getSystemInfoSync();
|
const systemInfo = await uni.getSystemInfoSync();
|
||||||
|
const _bloggerAvatar = this.$utils.checkAvatarUrl(this.bloggerInfo.avatar, true);
|
||||||
|
const _articleCover = this.$utils.checkThumbnailUrl(this.result.thumbnail, true);
|
||||||
// 初始化
|
// 初始化
|
||||||
await this.$refs.rCanvas.init({
|
await this.$refs.rCanvas.init({
|
||||||
canvas_id: 'rCanvas',
|
canvas_id: 'rCanvas',
|
||||||
@ -416,11 +418,10 @@ export default {
|
|||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
console.log(this.$utils.checkAvatarUrl(this.bloggerInfo.avatar, true));
|
|
||||||
// 博主信息
|
// 博主信息
|
||||||
await this.$refs.rCanvas
|
await this.$refs.rCanvas
|
||||||
.drawImage({
|
.drawImage({
|
||||||
url: this.$utils.checkAvatarUrl(this.bloggerInfo.avatar, true),
|
url: _bloggerAvatar,
|
||||||
x: 12,
|
x: 12,
|
||||||
y: 12,
|
y: 12,
|
||||||
w: 48,
|
w: 48,
|
||||||
@ -467,7 +468,7 @@ export default {
|
|||||||
// 文章封面图
|
// 文章封面图
|
||||||
await this.$refs.rCanvas
|
await this.$refs.rCanvas
|
||||||
.drawImage({
|
.drawImage({
|
||||||
url: this.$utils.checkThumbnailUrl(this.result.thumbnail),
|
url: _articleCover,
|
||||||
x: 12,
|
x: 12,
|
||||||
y: 75,
|
y: 75,
|
||||||
w: 312,
|
w: 312,
|
||||||
|
@ -89,7 +89,8 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
calcLoveDays() {
|
calcLoveDays() {
|
||||||
const start = new Date(this.loveConfig.loveStartDate),
|
const formatStartDate = this.loveConfig.loveStartDate.replace(/-/g, '/');
|
||||||
|
const start = new Date(formatStartDate),
|
||||||
now = new Date();
|
now = new Date();
|
||||||
const T = now.getTime() - start.getTime();
|
const T = now.getTime() - start.getTime();
|
||||||
const i = 24 * 60 * 60 * 1000;
|
const i = 24 * 60 * 60 * 1000;
|
||||||
|
@ -84,7 +84,8 @@ export default {
|
|||||||
clearTimeout(this.loveDayTimer);
|
clearTimeout(this.loveDayTimer);
|
||||||
const _countDownFn = () => {
|
const _countDownFn = () => {
|
||||||
this.loveDayTimer = setTimeout(_countDownFn, 1000);
|
this.loveDayTimer = setTimeout(_countDownFn, 1000);
|
||||||
const start = new Date(this.loveConfig.loveStartDate),
|
const formatStartDate = this.loveConfig.loveStartDate.replace(/-/g, '/');
|
||||||
|
const start = new Date(formatStartDate),
|
||||||
now = new Date();
|
now = new Date();
|
||||||
const T = now.getTime() - start.getTime();
|
const T = now.getTime() - start.getTime();
|
||||||
const i = 24 * 60 * 60 * 1000;
|
const i = 24 * 60 * 60 * 1000;
|
||||||
|
@ -32,7 +32,10 @@ const utils = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 检查封面图
|
// 检查封面图
|
||||||
checkThumbnailUrl: function(thumbnail) {
|
checkThumbnailUrl: function(thumbnail, mustRealUrl = false) {
|
||||||
|
if (!thumbnail && mustRealUrl) {
|
||||||
|
return HaloConfig.defaultStaticThumbnailUrl
|
||||||
|
}
|
||||||
if (!HaloConfig.defaultThumbnailUrl) {
|
if (!HaloConfig.defaultThumbnailUrl) {
|
||||||
// logUtils.saveLog(logTypes.config, {
|
// logUtils.saveLog(logTypes.config, {
|
||||||
// path: 'checkThumbnailUrl',
|
// path: 'checkThumbnailUrl',
|
||||||
|
Loading…
Reference in New Issue
Block a user