mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-07-27 04:20:43 +08:00
Compare commits
8 Commits
v1.0.3-beta
...
v1.1.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ba87b1972 | |||
| a0f3d1b220 | |||
| 6e80fa14c8 | |||
| 22a8e92dc2 | |||
| 6b1e0e5cc0 | |||
| 261617fc12 | |||
| 5000da9a64 | |||
| 9573b303e2 |
@@ -94,8 +94,13 @@
|
|||||||
|
|
||||||
## 🌈 在线体验
|
## 🌈 在线体验
|
||||||
|
|
||||||
- 敬请期待...
|
微信小程序搜索:小莫唐尼
|
||||||
|
<br/>
|
||||||
|

|
||||||
|
|
||||||
|
## 🌈 交流群
|
||||||
|
|
||||||
|
QQ群号:632969367
|
||||||
|
|
||||||
## 🔍 许可证
|
## 🔍 许可证
|
||||||
|
|
||||||
|
|||||||
@@ -65,14 +65,14 @@ export default {
|
|||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 1.2em;
|
font-size: 1.12em;
|
||||||
`,
|
`,
|
||||||
h5: `
|
h5: `
|
||||||
color: var(--main);
|
color: var(--main);
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 16px;
|
font-size: 1.1em;
|
||||||
`,
|
`,
|
||||||
h6: `
|
h6: `
|
||||||
color: #303133;
|
color: #303133;
|
||||||
@@ -90,7 +90,7 @@ export default {
|
|||||||
strong: 'font-weight: 700;color: rgb(248, 57, 41);',
|
strong: 'font-weight: 700;color: rgb(248, 57, 41);',
|
||||||
video: 'width: 100%',
|
video: 'width: 100%',
|
||||||
},
|
},
|
||||||
containStyle: 'font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;padding:12px;font-size: 16px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px;border-radius: 6px;background-color:#FFFFFF;',
|
containStyle: 'font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;padding:12px;font-size: 14px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px;border-radius: 6px;background-color:#FFFFFF;',
|
||||||
|
|
||||||
loadingGif: HaloConfig.loadingGifUrl,
|
loadingGif: HaloConfig.loadingGifUrl,
|
||||||
emptyGif: HaloConfig.loadingEmptyUrl,
|
emptyGif: HaloConfig.loadingEmptyUrl,
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
// 微信分享配置
|
||||||
|
import haloConfig from '@/config/halo.config.js'
|
||||||
|
import { jsonToUrlParams2 } from '@/utils/url.params.js'
|
||||||
|
export const haloWxShareMixin = {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
haloWxShareData: {
|
||||||
|
...haloConfig.wxShareConfig
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//#ifdef MP-WEIXIN
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
return {
|
||||||
|
...this.haloWxShareData,
|
||||||
|
success: res => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//#endif
|
||||||
|
/* 分享到微信好友 */
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
const promise = new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve({
|
||||||
|
title: this.haloWxShareData.title,
|
||||||
|
path: this.haloWxShareData.path,
|
||||||
|
})
|
||||||
|
}, 2000)
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
title: this.haloWxShareData.title,
|
||||||
|
path: '',
|
||||||
|
promise
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 分享到朋友圈-这里封装不够,在页面还要声明一次,否则是拿不到参数的,被分享者在朋友圈打开链接是空的
|
||||||
|
onShareTimeline: function() {
|
||||||
|
return {
|
||||||
|
title: this.haloWxShareData.title,
|
||||||
|
query: {},
|
||||||
|
imageUrl: this.haloWxShareData.imageUrl,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 设置分享信息(需要在页面调用)
|
||||||
|
fnSetWxShareConfig(config = {}) {
|
||||||
|
let currentRoutes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||||
|
let currentRoute = currentRoutes[currentRoutes.length - 1].route; //获取当前页面路由(分销思路,分享者点开使用的小程序将获取到分享者的id)
|
||||||
|
let sharePath = currentRoutes
|
||||||
|
if (config.params) {
|
||||||
|
const URLParams = config.params ? jsonToUrlParams2(config.params) : {};
|
||||||
|
sharePath += URLParams
|
||||||
|
}
|
||||||
|
let _config = Object.assign({}, {
|
||||||
|
path: sharePath,
|
||||||
|
copyLink: haloConfig.apiUrl,
|
||||||
|
query: {}
|
||||||
|
}, config)
|
||||||
|
|
||||||
|
uni.$tm.vx.commit('setWxShare', _config);
|
||||||
|
this.haloWxShareData = _config;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,3 +36,120 @@
|
|||||||
transform: rotateZ(360deg);
|
transform: rotateZ(360deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 自定义广告
|
||||||
|
|
||||||
|
.ad-card {
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
|
&.is-lr {
|
||||||
|
display: flex;
|
||||||
|
.ad-card_tip {
|
||||||
|
top: initial;
|
||||||
|
left: 288rpx;
|
||||||
|
bottom: 24rpx;
|
||||||
|
// right: 160rpx;
|
||||||
|
padding: 4rpx 20rpx;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 2rpx solid #607d8b;
|
||||||
|
color: #607d8b;
|
||||||
|
}
|
||||||
|
.ad-card_cover {
|
||||||
|
width: 240rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
animation: adLinkAni 1s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.ad-card_info {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding-left: 24rpx;
|
||||||
|
&-title {
|
||||||
|
margin-top: 0;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
&-link {
|
||||||
|
top: initial;
|
||||||
|
// right: 150rpx;
|
||||||
|
bottom: 0;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&_tip {
|
||||||
|
position: absolute;
|
||||||
|
left: 36rpx;
|
||||||
|
top: 36rpx;
|
||||||
|
display: inline-flex;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
padding: 4rpx 10rpx;
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
&_cover {
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
}
|
||||||
|
&_info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
&-title {
|
||||||
|
width: calc(100% - 120rpx);
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
&-desc {
|
||||||
|
margin-top: 6rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #616161;
|
||||||
|
line-height: 1.8;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
}
|
||||||
|
&-link {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 6rpx;
|
||||||
|
display: inline-flex;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
padding: 4rpx 10rpx;
|
||||||
|
border: 2rpx solid #03a9f4;
|
||||||
|
color: #03a9f4;
|
||||||
|
font-size: 24rpx;
|
||||||
|
transform: scale(0.93);
|
||||||
|
// animation: adLinkAni 0.8s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes adLinkAni {
|
||||||
|
0% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: scale(1.02);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<text class="is-top" v-if="article.topped">置顶</text>
|
<text class="is-top bg-gradient-blue-accent" v-if="article.topped">置顶</text>
|
||||||
<text class="title-text text-overflow">{{ article.title }}</text>
|
<text class="title-text text-overflow">{{ article.title }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content text-overflow-2">{{ article.summary }}</view>
|
<view class="content text-overflow-2">{{ article.summary }}</view>
|
||||||
@@ -33,8 +33,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'article-card',
|
name: 'article-card',
|
||||||
|
components: { tmTags },
|
||||||
props: {
|
props: {
|
||||||
from: {
|
from: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -253,6 +255,7 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.title {
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: var(--main-text-color);
|
color: var(--main-text-color);
|
||||||
.is-top {
|
.is-top {
|
||||||
@@ -264,8 +267,9 @@ export default {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
vertical-align: 4rpx;
|
vertical-align: 4rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-image: -webkit-linear-gradient(0deg, #3ca5f6 0, #a86af9 100%);
|
// background-image: -webkit-linear-gradient(0deg, #3ca5f6 0, #a86af9 100%);
|
||||||
border-radius: 4rpx 12rpx;
|
border-radius: 6rpx 12rpx;
|
||||||
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
&-text {
|
&-text {
|
||||||
color: #303133;
|
color: #303133;
|
||||||
|
|||||||
@@ -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 {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="overflow: hidden;position: fixed;width: 100%;height: 100%;pointer-events: none; top: 0;">
|
<view class="barrage-wrap" :class="[type]">
|
||||||
<view class="danmu-li" v-for="(item, index) in listData" :class="item.type" :style="item.style" :key="index">
|
<view class="danmu-li" v-for="(item, index) in listData" :class="[type, item.type]" :style="[item.style]" :key="index">
|
||||||
<view class="danmu-inner">
|
<view class="danmu-inner">
|
||||||
<view class="user-box">
|
<view class="user-box">
|
||||||
<view class="user-img">
|
<view class="user-img"><image class="avatar" :src="item.item.avatar"></image></view>
|
||||||
<view class="img-box">
|
<view class="user-text cl1">{{ item.item.author }}</view>
|
||||||
<image :src="item.avatar || 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=317894666,3379114684&fm=26&gp=0.jpg'"></image>
|
<view class="user-status cl1">{{ item.item.content }}</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="user-text cl1">{{ item.nickName }}</view>
|
|
||||||
<view class="user-status cl1">{{ item.text }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -18,11 +14,17 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
//rightToLeft leftToRight leftBottom
|
// rightToLeft leftToRight leftBottom
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'rightToLeft'
|
default: 'rightToLeft'
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default() {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
minTime: {
|
minTime: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 4
|
default: 4
|
||||||
@@ -43,34 +45,34 @@ export default {
|
|||||||
//轨道高度
|
//轨道高度
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 40
|
default: 40
|
||||||
},
|
|
||||||
noStacked: {
|
|
||||||
//不允许堆叠(暂不可用)
|
|
||||||
type: Array,
|
|
||||||
default() {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
closeTimer: null,
|
||||||
listData: []
|
listData: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.hrackNum = Math.floor((this.maxTop - this.minTop) / this.hrackH);
|
//leftBottom 使用参数
|
||||||
|
if (this.type === 'leftBottom') {
|
||||||
|
this.hrackNum = Math.floor(this.maxTop / this.hrackH);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add(obj) {
|
add(obj) {
|
||||||
|
this.isShow = true;
|
||||||
|
this.showFlag = true;
|
||||||
let data = {
|
let data = {
|
||||||
item: obj.item,
|
...obj,
|
||||||
id: Date.parse(new Date()),
|
id: Date.parse(new Date()),
|
||||||
time: Math.ceil(Math.floor(Math.random() * (this.maxTime - this.minTime + 1) + this.minTime)),
|
time: Math.ceil(Math.floor(Math.random() * (this.maxTime - this.minTime + 1) + this.minTime)),
|
||||||
type: this.type
|
type: this.type
|
||||||
};
|
};
|
||||||
if (this.type === 'leftBottom') {
|
if (this.type === 'leftBottom') {
|
||||||
let objData = {
|
let objData = {
|
||||||
item: data.item,
|
item: data,
|
||||||
type: 'leftBottomEnter',
|
type: 'leftBottomEnter',
|
||||||
style: {
|
style: {
|
||||||
transition: `all 0.5s`,
|
transition: `all 0.5s`,
|
||||||
@@ -88,7 +90,7 @@ export default {
|
|||||||
} else if (this.listData[i].status === 'reset') {
|
} else if (this.listData[i].status === 'reset') {
|
||||||
//重置
|
//重置
|
||||||
this.listData[i].style.transition = 'none';
|
this.listData[i].style.transition = 'none';
|
||||||
this.listData[i].style.bottom = 0;
|
this.listData[i].style.bottom = '6px';
|
||||||
this.listData[i].status = 'reuse';
|
this.listData[i].status = 'reuse';
|
||||||
} else if (this.listData[i].status === 'recycle') {
|
} else if (this.listData[i].status === 'recycle') {
|
||||||
//回收
|
//回收
|
||||||
@@ -105,8 +107,16 @@ export default {
|
|||||||
if (listLen < hrackNum + 2) {
|
if (listLen < hrackNum + 2) {
|
||||||
this.listData.push(objData);
|
this.listData.push(objData);
|
||||||
}
|
}
|
||||||
} else if (this.type === 'rightToLeft' || this.type === 'leftToRight') {
|
} else if (this.type === 'rightToLeft') {
|
||||||
let objData = this.horStacked(data);
|
let objData = {
|
||||||
|
item: data,
|
||||||
|
type: 'rightToLeft',
|
||||||
|
style: {
|
||||||
|
animationDuration: `${data.time}s`,
|
||||||
|
top: `${Math.ceil(Math.random() * (this.maxTop - this.minTop + 1) + this.minTop)}px`
|
||||||
|
},
|
||||||
|
delTime: Date.parse(new Date()) + data.time * 1200
|
||||||
|
};
|
||||||
for (let i in this.listData) {
|
for (let i in this.listData) {
|
||||||
if (this.listData[i].delTime <= Date.parse(new Date())) {
|
if (this.listData[i].delTime <= Date.parse(new Date())) {
|
||||||
this.repaint(i, objData.type);
|
this.repaint(i, objData.type);
|
||||||
@@ -118,16 +128,50 @@ export default {
|
|||||||
this.listData.push(objData);
|
this.listData.push(objData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
horStacked(data) {
|
async remove(options = {}) {
|
||||||
return {
|
if (this.type == 'rightToLeft') {
|
||||||
item: data.item,
|
if (this.listData.length != 0) {
|
||||||
type: this.type,
|
const last = this.listData[this.listData.length - 1];
|
||||||
style: {
|
setTimeout(() => {
|
||||||
animationDuration: `${data.time}s`,
|
this.listData = [];
|
||||||
top: `${Math.ceil(Math.random() * (this.maxTop - this.minTop + 1) + this.minTop)}px`
|
}, last.item.time * 1200 + 1000);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
options = Object.assign(
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
duration: 5000, // 延迟关闭的时间
|
||||||
|
speed: 1000 // 弹幕消失的速度
|
||||||
},
|
},
|
||||||
delTime: Date.parse(new Date()) + data.time * 1200
|
options
|
||||||
|
);
|
||||||
|
|
||||||
|
const _fnHandleRemove = item => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
// item['type'] = 'leftBottomExitLeft';
|
||||||
|
item['type'] = 'is-hide';
|
||||||
|
resolve();
|
||||||
|
}, options.speed);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
const _fnHandleLoop = item => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
setTimeout(async () => {
|
||||||
|
for (var i = 0; i < this.listData.length; i++) {
|
||||||
|
await _fnHandleRemove(this.listData[i]);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
}, options.duration);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
await _fnHandleLoop();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.listData = [];
|
||||||
|
}, options.duration + 200);
|
||||||
},
|
},
|
||||||
repaint(index, type) {
|
repaint(index, type) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -137,8 +181,8 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style></style>
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
@keyframes leftBottomEnter {
|
@keyframes leftBottomEnter {
|
||||||
0% {
|
0% {
|
||||||
transform: translateY(100%);
|
transform: translateY(100%);
|
||||||
@@ -163,6 +207,20 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes leftBottomExitLeft {
|
||||||
|
0% {
|
||||||
|
transform: translateX(0%);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateX(-50%);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateX(-100%);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@keyframes leftToRight {
|
@keyframes leftToRight {
|
||||||
0% {
|
0% {
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
@@ -182,13 +240,38 @@ export default {
|
|||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.barrage-wrap {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
pointer-events: none;
|
||||||
|
top: 0;
|
||||||
|
z-index: 99;
|
||||||
|
transition: all 1s ease-in-out;
|
||||||
|
&.leftBottom {
|
||||||
|
top: initial;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
bottom: 130rpx;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef H5 */
|
||||||
|
bottom: 36rpx;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
}
|
||||||
.danmu-li {
|
.danmu-li {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
transform: translateX(100%);
|
transform: translateX(100%);
|
||||||
animation-timing-function: linear;
|
animation-timing-function: linear;
|
||||||
|
transition: all 0.5s ease-in-out;
|
||||||
|
opacity: 1;
|
||||||
|
&.is-hide {
|
||||||
|
opacity: 0;
|
||||||
|
// transform: translateX(-100%) !important;
|
||||||
|
}
|
||||||
|
&.leftBottom {
|
||||||
|
left: 24rpx;
|
||||||
|
}
|
||||||
&.leftBottomEnter {
|
&.leftBottomEnter {
|
||||||
animation-name: leftBottomEnter;
|
animation-name: leftBottomEnter;
|
||||||
}
|
}
|
||||||
@@ -196,53 +279,59 @@ export default {
|
|||||||
animation-name: leftBottomExit;
|
animation-name: leftBottomExit;
|
||||||
animation-fill-mode: forwards;
|
animation-fill-mode: forwards;
|
||||||
}
|
}
|
||||||
|
&.leftBottomExitLeft {
|
||||||
|
animation-name: leftBottomExitLeft;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
}
|
||||||
&.rightToLeft {
|
&.rightToLeft {
|
||||||
animation-name: rightToLeft;
|
animation-name: rightToLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.leftToRight {
|
&.leftToRight {
|
||||||
animation-name: leftToRight;
|
animation-name: rightToLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danmu-inner {
|
.danmu-inner {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
font-size: 24rpx;
|
||||||
.user-box {
|
.user-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 3rpx 40rpx 3rpx 10rpx;
|
padding: 6rpx 40rpx 6rpx 10rpx;
|
||||||
background: rgba(0, 0, 0, 0.3);
|
background: rgba(0, 0, 0, 0.3);
|
||||||
border-radius: 32rpx;
|
border-radius: 32rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.user-img {
|
.user-img {
|
||||||
.img-box {
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
image {
|
.avatar {
|
||||||
width: 58rpx;
|
width: 42rpx;
|
||||||
height: 58rpx;
|
height: 42rpx;
|
||||||
background: rgba(55, 55, 55, 1);
|
background: rgba(55, 55, 55, 1);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-status {
|
.user-status {
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
|
max-width: 320rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-text {
|
.user-text {
|
||||||
|
max-width: 100rpx;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
// white-space: nowrap;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
width: 80rpx;
|
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,14 +34,13 @@
|
|||||||
:shadow="0"
|
:shadow="0"
|
||||||
label="Ծ‸Ծ博主已设置该文章禁止评论!"
|
label="Ծ‸Ծ博主已设置该文章禁止评论!"
|
||||||
:round="3"
|
:round="3"
|
||||||
close
|
|
||||||
></tm-alerts>
|
></tm-alerts>
|
||||||
<view class="empty pt-50" v-if="dataList.length == 0">
|
<view class="empty pt-50" v-if="dataList.length == 0">
|
||||||
<tm-empty v-if="disallowComment" icon="icon-shiliangzhinengduixiang-" label="暂无评论">
|
<tm-empty v-if="disallowComment" icon="icon-shiliangzhinengduixiang-" label="暂无评论">
|
||||||
<text class="text-red text-size-s">- 文章已开启禁止评论 -</text>
|
<text class="text-red text-size-s">- 文章已开启禁止评论 -</text>
|
||||||
</tm-empty>
|
</tm-empty>
|
||||||
<tm-empty v-else icon="icon-shiliangzhinengduixiang-" label="暂无评论">
|
<tm-empty v-else icon="icon-shiliangzhinengduixiang-" label="暂无评论">
|
||||||
<tm-button theme="bg-gradient-light-blue-accent" size="m" @click="fnToComment(null)">抢沙发</tm-button>
|
<tm-button theme="light-blue" :dense="true" :shadow="0" size="m" @click="fnToComment(null)">抢沙发</tm-button>
|
||||||
</tm-empty>
|
</tm-empty>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
@@ -143,6 +142,7 @@ export default {
|
|||||||
this.result = res.data;
|
this.result = res.data;
|
||||||
this.dataList = res.data.content;
|
this.dataList = res.data.content;
|
||||||
this.loading = 'success';
|
this.loading = 'success';
|
||||||
|
this.$emit('on-loaded', this.dataList);
|
||||||
} else {
|
} else {
|
||||||
this.loading = 'error';
|
this.loading = 'error';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
#如何使用
|
|
||||||
###js
|
|
||||||
```javascript
|
|
||||||
import lffBarrage from '@/components/lff-barrage/lff-barrage.vue'
|
|
||||||
components:{lffBarrage},
|
|
||||||
methods:{
|
|
||||||
colrdo(){ //插入一条弹幕
|
|
||||||
this.$refs.lffBarrage.add({item:'你好呀小伙子'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
###HTML
|
|
||||||
```html
|
|
||||||
<lff-barrage ref="lffBarrage"></lff-barrage>
|
|
||||||
```
|
|
||||||
@@ -20,12 +20,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return { _scrollTop: 0 };
|
return { timer: null, _scrollTop: 0 };
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
scrollTop(val) {
|
scrollTop(val) {
|
||||||
this._scrollTop = val;
|
this._scrollTop = val;
|
||||||
console.log('监听1:', val);
|
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -35,11 +34,18 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
fnScroll() {
|
fnScroll() {
|
||||||
throttle(() => {
|
throttle(() => {
|
||||||
|
this.$emit('on-status', false);
|
||||||
const isTop = this._scrollTop >= 180;
|
const isTop = this._scrollTop >= 180;
|
||||||
this._scrollTop = isTop ? 0 : 999999;
|
this._scrollTop = isTop ? 0 : 999999999999;
|
||||||
uni.pageScrollTo({
|
uni.pageScrollTo({
|
||||||
duration: 500,
|
duration: 500,
|
||||||
scrollTop: this._scrollTop
|
scrollTop: this._scrollTop,
|
||||||
|
success: () => {
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.$emit('on-status', true);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.$emit('update:scrollTop', this._scrollTop);
|
this.$emit('update:scrollTop', this._scrollTop);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,6 +15,16 @@ export default {
|
|||||||
},
|
},
|
||||||
// 文章详情广告
|
// 文章详情广告
|
||||||
articleDetail: {
|
articleDetail: {
|
||||||
use: false, // 是否启用
|
// 微信广告/dclound申请的广告
|
||||||
|
use: true,
|
||||||
|
|
||||||
|
// 自定义广告
|
||||||
|
custom: {
|
||||||
|
use: true,
|
||||||
|
cover: 'https://b.925i.cn/uni_halo/uni_halo_ad_cover.png',
|
||||||
|
title: 'uni-halo 正式开源啦,欢迎来使用和体验!',
|
||||||
|
content: '基于 uni-app + halo1.x API 实现一款现代化的开源博客 / CMS 系统API开发的多端应用。功能包括:前台博客系统 和 后台管理系统,同时满足浏览和管理两端合一的需求,真正实现一个应用实现博客浏览和后台管理。',
|
||||||
|
url: 'https://uni-halo.925i.cn'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaultThumbnailUrl: '', // 默认封面图地址
|
defaultThumbnailUrl: '', // 默认封面图地址
|
||||||
|
defaultStaticThumbnailUrl: '', // 静态默认封面图(不可以是随机图地址)
|
||||||
defaultImageUrl: '', // 默认图片地址
|
defaultImageUrl: '', // 默认图片地址
|
||||||
defaultAvatarUrl: '', // 默认头像地址
|
defaultAvatarUrl: '', // 默认头像地址
|
||||||
|
|
||||||
@@ -121,8 +122,8 @@ export default {
|
|||||||
title: '', // 小程序分享标题[非必填]
|
title: '', // 小程序分享标题[非必填]
|
||||||
desc: '', // 小程序分享描述[非必填]
|
desc: '', // 小程序分享描述[非必填]
|
||||||
imageUrl: '', // 小程序分享时候图片地址[非必填]
|
imageUrl: '', // 小程序分享时候图片地址[非必填]
|
||||||
path: '/pages/start/start', // 分享路径[非必填] - 基本不需要修改
|
path: '/pages/index/index', // 分享路径[非必填] - 基本不需要修改
|
||||||
copyLink: '/pages/start/start', // 复制链接[非必填] - 基本不需要修改
|
copyLink: '/pages/index/index', // 复制链接[非必填] - 基本不需要修改
|
||||||
query: {}, // 分享参数[非必填] - 基本不需要填写
|
query: {}, // 分享参数[非必填] - 基本不需要填写
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ export default {
|
|||||||
girl: {
|
girl: {
|
||||||
name: '未知女主',
|
name: '未知女主',
|
||||||
avatar: 'https://b.925i.cn/uni_halo_love/love_girl.png',
|
avatar: 'https://b.925i.cn/uni_halo_love/love_girl.png',
|
||||||
birthday: '2022-07-25', // 生日
|
birthday: '2022-04-19', // 生日
|
||||||
},
|
},
|
||||||
timeTitle: '这是我们一起走过的',
|
timeTitle: '这是我们一起走过的',
|
||||||
loveStartDate: '2022-05-20 13:14:20', // 恋爱开始时间
|
loveStartDate: '2022-04-10 13:14:20', // 恋爱开始时间
|
||||||
|
|
||||||
nav: [{
|
nav: [{
|
||||||
key: 'journey',
|
key: 'journey',
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
<view class="app-page pb-24">
|
<view class="app-page pb-24">
|
||||||
<!-- 博主信息 -->
|
<!-- 博主信息 -->
|
||||||
<view class="blogger-info" :style="[calcProfileStyle]">
|
<view class="blogger-info" :style="[calcProfileStyle]">
|
||||||
<image class="avatar" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill" @click="miniProfileCard.show = true"></image>
|
<image class="avatar" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
||||||
<view class="profile">
|
<view class="profile">
|
||||||
<view class="author mt-24 text-size-g text-weight-b">{{ bloggerInfo.nickname }}</view>
|
<view class="author mt-24 text-size-g text-weight-b">{{ bloggerInfo.nickname }}</view>
|
||||||
<view class="desc mt-24 text-size-m">{{ bloggerInfo.description || '这个博主很懒,竟然没写介绍~' }}</view>
|
<view class="desc mt-24 text-size-m">
|
||||||
|
{{ bloggerInfo.description || '这个博主很懒,竟然没写介绍~' }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image v-if="calcWaveUrl" :src="calcWaveUrl" mode="scaleToFill" class="gif-wave"></image>
|
<image v-if="calcWaveUrl" :src="calcWaveUrl" mode="scaleToFill" class="gif-wave"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -17,19 +19,34 @@
|
|||||||
<view class="statistics flex pt-24 pb-24" :class="{ 'has-solid': statisticsShowMore }">
|
<view class="statistics flex pt-24 pb-24" :class="{ 'has-solid': statisticsShowMore }">
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-orange-accent">
|
<view class="number text-size-xl text-bg-gradient-orange-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.postCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.postCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">文章总数</view>
|
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">文章总数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-blue-accent">
|
<view class="number text-size-xl text-bg-gradient-blue-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.categoryCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.categoryCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">分类总数</view>
|
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">分类总数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-green-accent">
|
<view class="number text-size-xl text-bg-gradient-green-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.tagCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.tagCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-size-s text-grey-darken-1">标签总数</view>
|
<view class="mt-6 text-size-s text-grey-darken-1">标签总数</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -37,19 +54,34 @@
|
|||||||
<view class="statistics solid-top has-solid flex pt-24 pb-24">
|
<view class="statistics solid-top has-solid flex pt-24 pb-24">
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-orange-accent">
|
<view class="number text-size-xl text-bg-gradient-orange-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.commentCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.commentCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">评论数量</view>
|
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">评论数量</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-blue-accent">
|
<view class="number text-size-xl text-bg-gradient-blue-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.linkCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.linkCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">点赞数量</view>
|
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">点赞数量</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-green-accent">
|
<view class="number text-size-xl text-bg-gradient-green-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.visitCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.visitCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-size-s text-grey-darken-1">访客数量</view>
|
<view class="mt-6 text-size-s text-grey-darken-1">访客数量</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -60,7 +92,12 @@
|
|||||||
|
|
||||||
<!-- 快捷导航 -->
|
<!-- 快捷导航 -->
|
||||||
<view v-if="useQuickNav" class="quick-nav flex flex-between round-3 ma-24 pa-24 pl-40 pr-40">
|
<view v-if="useQuickNav" class="quick-nav flex flex-between round-3 ma-24 pa-24 pl-40 pr-40">
|
||||||
<view class="quick-nav-item flex flex-col flex-center" v-for="(nav, index) in quickNavList" :key="index" @click="fnToNavPage(nav)">
|
<view
|
||||||
|
class="quick-nav-item flex flex-col flex-center"
|
||||||
|
v-for="(nav, index) in quickNavList"
|
||||||
|
:key="index"
|
||||||
|
@click="fnToNavPage(nav)"
|
||||||
|
>
|
||||||
<view class="icon round-24 halocoloricon" :class="[nav.icon]"></view>
|
<view class="icon round-24 halocoloricon" :class="[nav.icon]"></view>
|
||||||
<view class="name text-size-s mt-8">{{ nav.text }}</view>
|
<view class="name text-size-s mt-8">{{ nav.text }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -80,7 +117,9 @@
|
|||||||
@click="fnOnNav(nav)"
|
@click="fnOnNav(nav)"
|
||||||
>
|
>
|
||||||
<template slot="rightValue">
|
<template slot="rightValue">
|
||||||
<button class="right-value-btn" v-if="nav.openType" :open-type="nav.openType">{{ nav.rightText }}</button>
|
<button class="right-value-btn" v-if="nav.openType" :open-type="nav.openType">
|
||||||
|
{{ nav.rightText }}
|
||||||
|
</button>
|
||||||
<text v-else>{{ nav.rightText }}</text>
|
<text v-else>{{ nav.rightText }}</text>
|
||||||
</template>
|
</template>
|
||||||
</tm-listitem>
|
</tm-listitem>
|
||||||
@@ -88,7 +127,9 @@
|
|||||||
</tm-grouplist>
|
</tm-grouplist>
|
||||||
</view>
|
</view>
|
||||||
<!-- 版权 -->
|
<!-- 版权 -->
|
||||||
<view v-if="showCopyright" class="copyright mt-40 text-size-xs text-align-center"><view class="">「 2022 uni-halo 丨 开源项目@小莫唐尼 」</view></view>
|
<view v-if="showCopyright" class="copyright mt-40 text-size-xs text-align-center">
|
||||||
|
<view class="">「 2022 uni-halo 丨 开源项目@小莫唐尼 」</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 名片 -->
|
<!-- 名片 -->
|
||||||
<tm-poup v-model="miniProfileCard.show" width="94vw" height="auto" :round="3" position="center">
|
<tm-poup v-model="miniProfileCard.show" width="94vw" height="auto" :round="3" position="center">
|
||||||
@@ -97,17 +138,35 @@
|
|||||||
<view class="left flex flex-col flex-center">
|
<view class="left flex flex-col flex-center">
|
||||||
<image class="avatar" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
<image class="avatar" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
||||||
<view class="name mt-10 text-size-m text-weight-b">{{ bloggerInfo.nickname }}</view>
|
<view class="name mt-10 text-size-m text-weight-b">{{ bloggerInfo.nickname }}</view>
|
||||||
<view class="mt-10 round-a-1 pa-2 pl-12 pr-12 text-size-s bg-gradient-light-blue-accent">前端摸鱼大师</view>
|
<view class="mt-10 round-a-1 pa-2 pl-12 pr-12 text-size-s bg-gradient-light-blue-accent">
|
||||||
<view class="mt-6 text-size-xs text-align-center text-grey-darken-2">一个爱凑热闹的、喜欢捣鼓前端的博主。</view>
|
前端摸鱼大师
|
||||||
|
</view>
|
||||||
|
<view class="mt-6 text-size-xs text-align-center text-grey-darken-2">
|
||||||
|
一个爱凑热闹的、喜欢捣鼓前端的博主。
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right flex flex-col pl-12">
|
<view class="right flex flex-col pl-12">
|
||||||
<view class="label text-size-s text-weight-b">爱好:摸鱼、打游戏、听音乐、逛B站</view>
|
<view class="label text-size-s text-weight-b">爱好:摸鱼、打游戏、听音乐、逛B站</view>
|
||||||
<view class="motto mt-12 text-size-s text-grey-darken-1">如果不是在空闲着的时候就能挣到钱,那就不算摸鱼!</view>
|
<view class="motto mt-12 text-size-s text-grey-darken-1">
|
||||||
|
如果不是在空闲着的时候就能挣到钱,那就不算摸鱼!
|
||||||
|
</view>
|
||||||
<view class="mt-12 text-size-m text-weight-b text-grey-darken-2">精选图片</view>
|
<view class="mt-12 text-size-m text-weight-b text-grey-darken-2">精选图片</view>
|
||||||
<view class="photos mt-6 flex ">
|
<view class="photos mt-6 flex ">
|
||||||
<image class="photos-img round-2" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
<image
|
||||||
<image class="photos-img round-2" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
class="photos-img round-2"
|
||||||
<image class="photos-img round-2" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
:src="$utils.checkAvatarUrl(bloggerInfo.avatar)"
|
||||||
|
mode="aspectFill"
|
||||||
|
></image>
|
||||||
|
<image
|
||||||
|
class="photos-img round-2"
|
||||||
|
:src="$utils.checkAvatarUrl(bloggerInfo.avatar)"
|
||||||
|
mode="aspectFill"
|
||||||
|
></image>
|
||||||
|
<image
|
||||||
|
class="photos-img round-2"
|
||||||
|
:src="$utils.checkAvatarUrl(bloggerInfo.avatar)"
|
||||||
|
mode="aspectFill"
|
||||||
|
></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -386,7 +445,8 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.clearStorageSync();
|
uni.clearStorageSync();
|
||||||
this.navList.find(x => x.key == 'cache').rightText = uni.getStorageInfoSync().currentSize + 'KB';
|
this.navList.find(x => x.key == 'cache').rightText =
|
||||||
|
uni.getStorageInfoSync().currentSize + 'KB';
|
||||||
})
|
})
|
||||||
.catch(err => {});
|
.catch(err => {});
|
||||||
break;
|
break;
|
||||||
@@ -417,6 +477,18 @@ export default {
|
|||||||
|
|
||||||
// 快捷导航页面跳转
|
// 快捷导航页面跳转
|
||||||
fnToNavPage(item) {
|
fnToNavPage(item) {
|
||||||
|
// 判断是内置页面还是网页
|
||||||
|
if (this.$utils.checkIsUrl(item.path)) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pagesC/website/website?data=' +
|
||||||
|
JSON.stringify({
|
||||||
|
title: item.text || this.$haloConfig.title,
|
||||||
|
url: item.path
|
||||||
|
})
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'tabbar':
|
case 'tabbar':
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -13,16 +13,34 @@
|
|||||||
|
|
||||||
<!-- 如果只有一个分组:使用列表的形式 result.length == 1 -->
|
<!-- 如果只有一个分组:使用列表的形式 result.length == 1 -->
|
||||||
<view v-else-if="result.length == 1" class="flex flex-col pb-24">
|
<view v-else-if="result.length == 1" class="flex flex-col pb-24">
|
||||||
<block v-for="(item, index) in result[0].children" :key="index">
|
<block v-for="(link, index) in result[0].children" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
||||||
<view class="link-card one round-a-6 flex ma-24 mb-0 pa-24" @click="fnOnLinkEvent(item)">
|
<!-- 色彩版本 -->
|
||||||
<cache-image class="logo shadow-2" radius="12rpx" width="80rpx" height="80rpx" :url="item.logo" :fileMd5="item.logo" mode="aspectFill"></cache-image>
|
<view
|
||||||
|
v-if="!globalAppSettings.links.useSimple"
|
||||||
|
class="info flex pt-24 pb-24 pl-12 pr-12 border-b-1"
|
||||||
|
:class="{ 'border-b-1': index != team.children.length - 1 }"
|
||||||
|
@click="fnOnLinkEvent(link)"
|
||||||
|
>
|
||||||
|
<view class="link-logo"><cache-image class="link-logo_img" radius="12rpx" :url="link.logo" :fileMd5="link.logo" mode="aspectFill"></cache-image></view>
|
||||||
|
<view class="flex flex-col pl-30 info-detail">
|
||||||
|
<view class="link-card_name text-size-l text-weight-b text-red">{{ link.name }}</view>
|
||||||
|
<view class="poup-tag ml--10 mt-6">
|
||||||
|
<tm-tags color="bg-gradient-amber-accent" :shadow="0" size="s" model="fill">ID:{{ link.id }}</tm-tags>
|
||||||
|
<tm-tags color=" bg-gradient-light-blue-lighten" :shadow="0" size="s" model="fill">{{ link.team || '暂未分组' }}</tm-tags>
|
||||||
|
</view>
|
||||||
|
<view class="link-card_desc text-overflow text-size-s mt-4">博客简介:{{ link.description || '这个博主很懒,没写简介~' }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 简洁版本 -->
|
||||||
|
<view v-else class="link-card flex ml-24 mr-24 pt-24 pb-24" @click="fnOnLinkEvent(link)">
|
||||||
|
<image class="logo shadow-6" :src="link.logo" mode="aspectFill"></image>
|
||||||
<view class="info pl-24">
|
<view class="info pl-24">
|
||||||
<view class="name text-size-g">{{ item.name }}</view>
|
<view class="name text-size-g">{{ link.name }}</view>
|
||||||
<view class="desc mt-12 text-size-s text-grey-darken-1">{{ item.description }}</view>
|
<view class="desc mt-12 text-size-s text-grey-darken-1">{{ link.description }}</view>
|
||||||
<view class="link mt-12 text-size-m text-grey-darken-1">
|
<view v-if="false" class="link mt-12 text-size-m text-grey-darken-1">
|
||||||
<text class="iconfont icon-link mr-6 text-size-s"></text>
|
<text class="iconfont icon-link mr-6 text-size-s"></text>
|
||||||
{{ item.url }}
|
{{ link.url }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -51,7 +69,7 @@
|
|||||||
<view class="link-card_name text-size-l text-weight-b text-red">{{ link.name }}</view>
|
<view class="link-card_name text-size-l text-weight-b text-red">{{ link.name }}</view>
|
||||||
<view class="poup-tag ml--10 mt-6">
|
<view class="poup-tag ml--10 mt-6">
|
||||||
<tm-tags color="bg-gradient-amber-accent" :shadow="0" size="s" model="fill">ID:{{ link.id }}</tm-tags>
|
<tm-tags color="bg-gradient-amber-accent" :shadow="0" size="s" model="fill">ID:{{ link.id }}</tm-tags>
|
||||||
<tm-tags color=" bg-gradient-light-blue-lighten" :shadow="0" size="s" model="fill">{{ link.team }}</tm-tags>
|
<tm-tags color=" bg-gradient-light-blue-lighten" :shadow="0" size="s" model="fill">{{ link.team || '暂未分组' }}</tm-tags>
|
||||||
</view>
|
</view>
|
||||||
<view class="link-card_desc text-overflow text-size-s mt-4">博客简介:{{ link.description || '这个博主很懒,没写简介~' }}</view>
|
<view class="link-card_desc text-overflow text-size-s mt-4">博客简介:{{ link.description || '这个博主很懒,没写简介~' }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -86,7 +104,7 @@
|
|||||||
<view class="poup-name text-size-lg text-weight-b">{{ detail.data.name }}</view>
|
<view class="poup-name text-size-lg text-weight-b">{{ detail.data.name }}</view>
|
||||||
<view class="poup-tag ml--10">
|
<view class="poup-tag ml--10">
|
||||||
<tm-tags color="bg-gradient-amber-accent" size="n" model="fill">ID:{{ detail.data.id }}</tm-tags>
|
<tm-tags color="bg-gradient-amber-accent" size="n" model="fill">ID:{{ detail.data.id }}</tm-tags>
|
||||||
<tm-tags color="bg-gradient-light-blue-lighten" size="n" model="fill">{{ detail.data.team }}</tm-tags>
|
<tm-tags color="bg-gradient-light-blue-lighten" size="n" model="fill">{{ detail.data.team || '暂未分组' }}</tm-tags>
|
||||||
</view>
|
</view>
|
||||||
<view class="poup-link text-size-m" @click="fnCopyLink(detail.data)">
|
<view class="poup-link text-size-m" @click="fnCopyLink(detail.data)">
|
||||||
<text class="text-orange">{{ detail.data.url }}</text>
|
<text class="text-orange">{{ detail.data.url }}</text>
|
||||||
|
|||||||
@@ -12,10 +12,14 @@
|
|||||||
<view class="detail">
|
<view class="detail">
|
||||||
<view class="author">
|
<view class="author">
|
||||||
<text class="author-name">博主:{{ author.nickname }}</text>
|
<text class="author-name">博主:{{ author.nickname }}</text>
|
||||||
<text class="author-time">时间:{{ { d: result.createTime, f: 'yyyy年MM月dd日 星期w' } | formatTime }}</text>
|
<text class="author-time">
|
||||||
|
时间:{{ { d: result.createTime, f: 'yyyy年MM月dd日 星期w' } | formatTime }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="cover" v-if="result.thumbnail"><image class="cover-img" mode="aspectFill" :src="calcUrl(result.thumbnail)"></image></view>
|
<view class="cover" v-if="result.thumbnail">
|
||||||
|
<image class="cover-img" mode="aspectFill" :src="calcUrl(result.thumbnail)"></image>
|
||||||
|
</view>
|
||||||
<view class="count" :class="{ 'no-thumbnail': !result.thumbnail }">
|
<view class="count" :class="{ 'no-thumbnail': !result.thumbnail }">
|
||||||
<view class="count-item">
|
<view class="count-item">
|
||||||
<text class="value">{{ result.visits }}</text>
|
<text class="value">{{ result.visits }}</text>
|
||||||
@@ -42,14 +46,27 @@
|
|||||||
<text class="text-weight-b">分类:</text>
|
<text class="text-weight-b">分类:</text>
|
||||||
<text v-if="result.categories.length == 0" class="category-tag is-empty">未选择分类</text>
|
<text v-if="result.categories.length == 0" class="category-tag is-empty">未选择分类</text>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<text class="category-tag" v-for="(item, index) in result.categories" :key="index" @click="fnToCate(item)">{{ item.name }}</text>
|
<text
|
||||||
|
class="category-tag"
|
||||||
|
v-for="(item, index) in result.categories"
|
||||||
|
:key="index"
|
||||||
|
@click="fnToCate(item)"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</text>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-18 category-type">
|
<view class="mt-18 category-type">
|
||||||
<text class="text-weight-b">标签:</text>
|
<text class="text-weight-b">标签:</text>
|
||||||
<text v-if="result.tags.length == 0" class="category-tag is-empty">未选择标签</text>
|
<text v-if="result.tags.length == 0" class="category-tag is-empty">未选择标签</text>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<text class="category-tag" :style="{ backgroundColor: item.color }" v-for="(item, index) in result.tags" :key="index" @click="fnToTag(item)">
|
<text
|
||||||
|
class="category-tag"
|
||||||
|
:style="{ backgroundColor: item.color }"
|
||||||
|
v-for="(item, index) in result.tags"
|
||||||
|
:key="index"
|
||||||
|
@click="fnToTag(item)"
|
||||||
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</text>
|
</text>
|
||||||
</block>
|
</block>
|
||||||
@@ -76,14 +93,14 @@
|
|||||||
:selectable="true"
|
:selectable="true"
|
||||||
:tag-style="markdownConfig.tagStyle"
|
:tag-style="markdownConfig.tagStyle"
|
||||||
:container-style="markdownConfig.containStyle"
|
:container-style="markdownConfig.containStyle"
|
||||||
:content="result.content"
|
:content="result.content || result.formatContent"
|
||||||
:markdown="true"
|
:markdown="true"
|
||||||
:showLineNumber="true"
|
:showLineNumber="true"
|
||||||
:showLanguageName="true"
|
:showLanguageName="true"
|
||||||
:copyByLongPress="true"
|
:copyByLongPress="true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 广告区域 -->
|
<!-- 广告区域:微信/decloud申请 -->
|
||||||
<view v-if="haloAdConfig.articleDetail.use" class="ad-wrap mt-24 mb-24 ">
|
<view v-if="haloAdConfig.articleDetail.use" class="ad-wrap mt-24 mb-24 ">
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
|
<ad v-if="haloAdConfig.unitId" :unit-id="haloAdConfig.unitId"></ad>
|
||||||
@@ -93,25 +110,73 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 广告区域:自定义广告位 -->
|
||||||
|
<view class="ad-card" v-if="haloAdConfig.articleDetail.custom.use">
|
||||||
|
<text class="ad-card_tip">广告</text>
|
||||||
|
<image
|
||||||
|
class="ad-card_cover"
|
||||||
|
:src="haloAdConfig.articleDetail.custom.cover"
|
||||||
|
mode="scaleToFill"
|
||||||
|
></image>
|
||||||
|
<view class="ad-card_info">
|
||||||
|
<view class="ad-card_info-title">{{ haloAdConfig.articleDetail.custom.title }}</view>
|
||||||
|
<view class="ad-card_info-desc">{{ haloAdConfig.articleDetail.custom.content }}</view>
|
||||||
|
<view
|
||||||
|
v-if="haloAdConfig.articleDetail.custom.url"
|
||||||
|
class="ad-card_info-link"
|
||||||
|
@click="fnToWebview(haloAdConfig.articleDetail.custom)"
|
||||||
|
>
|
||||||
|
立即查看
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 版权声明 -->
|
<!-- 版权声明 -->
|
||||||
<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
|
||||||
<view v-if="copyright.author" class="copyright-text text-size-s ">版权归属:{{ copyright.author }}</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.description" class="copyright-text text-size-s mt-12">版权说明:{{ copyright.description }}</view>
|
>
|
||||||
<view v-if="copyright.violation" class="copyright-text text-size-s mt-12 text-red">侵权处理:{{ copyright.violation }}</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.violation" class="copyright-text text-size-s mt-12 text-red">
|
||||||
|
侵权处理:{{ copyright.violation }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 评论展示区域 -->
|
<!-- 评论展示区域 -->
|
||||||
<view class="comment-wrap bg-white mt-24 pa-24 round-4">
|
<view class="comment-wrap bg-white mt-24 pa-24 round-4">
|
||||||
<commentList :disallowComment="result.disallowComment" :postId="result.id" :post="result" @on-comment-detail="fnOnShowCommentDetail"></commentList>
|
<commentList
|
||||||
|
:disallowComment="result.disallowComment"
|
||||||
|
:postId="result.id"
|
||||||
|
:post="result"
|
||||||
|
@on-comment-detail="fnOnShowCommentDetail"
|
||||||
|
@on-loaded="fnOnCommentLoaded"
|
||||||
|
></commentList>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 弹幕效果 -->
|
||||||
|
<barrage ref="barrage" :maxTop="240" :type="globalAppSettings.barrage.type"></barrage>
|
||||||
<!-- 返回顶部 -->
|
<!-- 返回顶部 -->
|
||||||
<tm-flotbutton :offset="[16, 80]" icon="icon-angle-up" color="bg-gradient-light-blue-accent" @click="fnToTopPage()"></tm-flotbutton>
|
<tm-flotbutton
|
||||||
<tm-flotbutton :actions="btnOption.actions" actions-pos="left" :show-text="true" color="bg-gradient-orange-accent" @change="fnOnFlotButtonChange"></tm-flotbutton>
|
:offset="[16, 80]"
|
||||||
|
icon="icon-angle-up"
|
||||||
|
color="bg-gradient-light-blue-accent"
|
||||||
|
@click="fnToTopPage()"
|
||||||
|
></tm-flotbutton>
|
||||||
|
<tm-flotbutton
|
||||||
|
:actions="btnOption.actions"
|
||||||
|
actions-pos="left"
|
||||||
|
:show-text="true"
|
||||||
|
color="bg-gradient-orange-accent"
|
||||||
|
@change="fnOnFlotButtonChange"
|
||||||
|
></tm-flotbutton>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<!-- 评论详情 -->
|
<!-- 评论详情 -->
|
||||||
@@ -119,7 +184,13 @@
|
|||||||
<view class="pa-24">
|
<view class="pa-24">
|
||||||
<view class="poup-head pb-24">
|
<view class="poup-head pb-24">
|
||||||
<view class="poup-title text-align-center text-size-g text-weight-b mb-32">评论详情</view>
|
<view class="poup-title text-align-center text-size-g text-weight-b mb-32">评论详情</view>
|
||||||
<comment-item :useContentBg="false" :useActions="false" :isChild="false" :comment="commentDetail.comment" :postId="result.id"></comment-item>
|
<comment-item
|
||||||
|
:useContentBg="false"
|
||||||
|
:useActions="false"
|
||||||
|
:isChild="false"
|
||||||
|
:comment="commentDetail.comment"
|
||||||
|
:postId="result.id"
|
||||||
|
></comment-item>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view :scroll-y="true" class="poup-body">
|
<scroll-view :scroll-y="true" class="poup-body">
|
||||||
@@ -130,7 +201,14 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else-if="commentDetail.loading == 'error'" class="error">
|
<view v-else-if="commentDetail.loading == 'error'" class="error">
|
||||||
<tm-empty icon="icon-wind-cry" label="加载失败">
|
<tm-empty icon="icon-wind-cry" label="加载失败">
|
||||||
<tm-button theme="bg-gradient-light-blue-accent" size="m" v-if="!disallowComment" @click="fnGetChildComments()">刷新试试</tm-button>
|
<tm-button
|
||||||
|
theme="bg-gradient-light-blue-accent"
|
||||||
|
size="m"
|
||||||
|
v-if="!disallowComment"
|
||||||
|
@click="fnGetChildComments()"
|
||||||
|
>
|
||||||
|
刷新试试
|
||||||
|
</tm-button>
|
||||||
</tm-empty>
|
</tm-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -166,9 +244,15 @@
|
|||||||
<block v-if="poster.showCanvas">
|
<block v-if="poster.showCanvas">
|
||||||
<r-canvas ref="rCanvas"></r-canvas>
|
<r-canvas ref="rCanvas"></r-canvas>
|
||||||
<view class="poster-save ma-24 mt-0 pt-20 flex flex-center">
|
<view class="poster-save ma-24 mt-0 pt-20 flex flex-center">
|
||||||
<tm-button theme="bg-gradient-light-blue-accent" size="m" @click="fnSavePoster()">保存到相册</tm-button>
|
<tm-button theme="bg-gradient-light-blue-accent" size="m" @click="fnSavePoster()">
|
||||||
<tm-button v-if="false" theme="bg-gradient-orange-accent" size="m" @click="fnShareTo()">分享给好友</tm-button>
|
保存到相册
|
||||||
<tm-button theme="bg-gradient-blue-grey-accent" size="m" @click="fnOnPosterClose()">关 闭</tm-button>
|
</tm-button>
|
||||||
|
<tm-button v-if="false" theme="bg-gradient-orange-accent" size="m" @click="fnShareTo()">
|
||||||
|
分享给好友
|
||||||
|
</tm-button>
|
||||||
|
<tm-button theme="bg-gradient-blue-grey-accent" size="m" @click="fnOnPosterClose()">
|
||||||
|
关 闭
|
||||||
|
</tm-button>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
@@ -190,6 +274,9 @@ import commentList from '@/components/comment-list/comment-list.vue';
|
|||||||
import commentItem from '@/components/comment-item/comment-item.vue';
|
import commentItem from '@/components/comment-item/comment-item.vue';
|
||||||
|
|
||||||
import rCanvas from '@/components/r-canvas/r-canvas.vue';
|
import rCanvas from '@/components/r-canvas/r-canvas.vue';
|
||||||
|
import barrage from '@/components/barrage/barrage.vue';
|
||||||
|
|
||||||
|
import { haloWxShareMixin } from '@/common/mixins/wxshare.mixin.js';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
@@ -200,8 +287,10 @@ export default {
|
|||||||
mpHtml,
|
mpHtml,
|
||||||
commentList,
|
commentList,
|
||||||
commentItem,
|
commentItem,
|
||||||
rCanvas
|
rCanvas,
|
||||||
|
barrage
|
||||||
},
|
},
|
||||||
|
mixins: [haloWxShareMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
@@ -283,7 +372,14 @@ export default {
|
|||||||
this.result = res.data;
|
this.result = res.data;
|
||||||
this.fnSetPageTitle('文章详情');
|
this.fnSetPageTitle('文章详情');
|
||||||
this.loading = 'success';
|
this.loading = 'success';
|
||||||
this.fnSetWxShareInfo();
|
this.fnSetWxShareConfig({
|
||||||
|
title: this.result.title,
|
||||||
|
desc: this.result.summary,
|
||||||
|
imageUrl: this.$utils.checkThumbnailUrl(this.result.thumbnail),
|
||||||
|
path: `/pagesA/article-detail/article-detail?articleId=${this.queryParams.articleId}`,
|
||||||
|
copyLink: this.$haloConfig.apiUrl,
|
||||||
|
query: {}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.loading = 'error';
|
this.loading = 'error';
|
||||||
@@ -293,19 +389,7 @@ export default {
|
|||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fnSetWxShareInfo() {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
uni.$tm.vx.commit('setWxShare', {
|
|
||||||
title: this.result.title,
|
|
||||||
desc: this.result.summary,
|
|
||||||
// imageUrl: this.poster.res.tempFilePath,
|
|
||||||
imageUrl: this.$utils.checkThumbnailUrl(this.result.thumbnail),
|
|
||||||
path: `/pagesA/article-detail/article-detail?articleId=${this.queryParams.articleId}`,
|
|
||||||
copyLink: this.$haloConfig.apiUrl,
|
|
||||||
query: {}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
// 浮动按钮点击
|
// 浮动按钮点击
|
||||||
fnOnFlotButtonChange(index) {
|
fnOnFlotButtonChange(index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
@@ -382,6 +466,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',
|
||||||
@@ -406,11 +492,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,
|
||||||
@@ -457,7 +542,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,
|
||||||
@@ -629,6 +714,60 @@ export default {
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pagesA/tag-detail/tag-detail?id=${tag.id}&slug=${tag.slug}&name=${tag.name}`
|
url: `/pagesA/tag-detail/tag-detail?id=${tag.id}&slug=${tag.slug}&name=${tag.name}`
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
async fnOnCommentLoaded(data) {
|
||||||
|
const _list = [];
|
||||||
|
const _handleData = list => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
if (list.length == 0) {
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
list.forEach(item => {
|
||||||
|
_list.push(item);
|
||||||
|
if (item.children && item.children.length != 0) {
|
||||||
|
_handleData(item.children);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
await _handleData(data);
|
||||||
|
if (this.globalAppSettings.barrage.use) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (_list.length != 0) {
|
||||||
|
_handleAddBarrage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const _handleRemove = () => {
|
||||||
|
this.$refs['barrage'].remove({
|
||||||
|
duration: 5000, // 延迟关闭的时间
|
||||||
|
speed: 600 // 弹幕消失的速度
|
||||||
|
});
|
||||||
|
};
|
||||||
|
let index = 0;
|
||||||
|
const _handleAddBarrage = () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$refs['barrage'].add(_list[index]);
|
||||||
|
index += 1;
|
||||||
|
if (index < _list.length - 1) {
|
||||||
|
_handleAddBarrage();
|
||||||
|
} else {
|
||||||
|
_handleRemove();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
};
|
||||||
|
},
|
||||||
|
fnToWebview(data) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pagesC/website/website?data=' +
|
||||||
|
JSON.stringify({
|
||||||
|
title: data.title,
|
||||||
|
url: data.url
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -303,7 +303,8 @@ export default {
|
|||||||
&-desc {
|
&-desc {
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
font-size: 28rpx;
|
font-size: 30rpx;
|
||||||
|
color: rgba(26, 26, 26, 0.9);
|
||||||
&.is-empty {
|
&.is-empty {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="page-title">我们的故事</view>
|
<view class="page-title">我们的故事</view>
|
||||||
<view class="html-typed" v-html="html">内容渲染</view>
|
<view class="html-typed" v-html="html">内容渲染</view>
|
||||||
|
|
||||||
<scroll-btn bottom="60rpx" :scrollTop.sync="scrollTop"></scroll-btn>
|
<scroll-btn bottom="160rpx" :scrollTop.sync="scrollTop"></scroll-btn>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -76,6 +76,7 @@ export default {
|
|||||||
rgba(7, 179, 155, 0.1) 86%,
|
rgba(7, 179, 155, 0.1) 86%,
|
||||||
rgba(109, 186, 130, 0.1)
|
rgba(109, 186, 130, 0.1)
|
||||||
);
|
);
|
||||||
|
color: rgba(26, 26, 26, 1);
|
||||||
}
|
}
|
||||||
.page-title {
|
.page-title {
|
||||||
font-size: 42rpx;
|
font-size: 42rpx;
|
||||||
|
|||||||
+22
-7
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page">
|
<view class="app-page" @touchstart="fnOnTouchstart" @touchend="fnOnTouchend" @touchcancel="fnOnTouchend">
|
||||||
<view class="love-card">
|
<view class="love-card" :class="{ ani: isDoAni }">
|
||||||
<view class="head">
|
<view class="head">
|
||||||
<image class="avatar" :src="loveConfig.boy.avatar" mode="scaleToFill"></image>
|
<image class="avatar" :src="loveConfig.boy.avatar" mode="scaleToFill"></image>
|
||||||
<view class="love-days">
|
<view class="love-days">
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else class="list">
|
<view v-else class="list">
|
||||||
<block v-for="(item, index) in list" :key="index">
|
<block v-for="(item, index) in list" :key="index">
|
||||||
<view class="card" :style="{ '--delay': calcCardDelay(index) }">
|
<view class="card" :class="{ ani: isDoAni }" :style="{ '--delay': calcCardDelay(index) }">
|
||||||
<view class="head">
|
<view class="head">
|
||||||
<view class="status">
|
<view class="status">
|
||||||
<view v-if="!item.finish" class="text">进行中</view>
|
<view v-if="!item.finish" class="text">进行中</view>
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<scroll-btn :scrollTop.sync="scrollTop"></scroll-btn>
|
<scroll-btn :scrollTop.sync="scrollTop" @on-status="fnOnScrollStatus"></scroll-btn>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -81,6 +81,7 @@ export default {
|
|||||||
components: { ScrollBtn },
|
components: { ScrollBtn },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isDoAni: true,
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
loveConfig: LoveConfig,
|
loveConfig: LoveConfig,
|
||||||
list: []
|
list: []
|
||||||
@@ -88,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;
|
||||||
@@ -142,6 +144,15 @@ export default {
|
|||||||
fnOnItemOpen(item) {
|
fnOnItemOpen(item) {
|
||||||
item.open = !item.open;
|
item.open = !item.open;
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
|
},
|
||||||
|
fnOnScrollStatus(isEnd) {
|
||||||
|
this.isDoAni = isEnd;
|
||||||
|
},
|
||||||
|
fnOnTouchstart() {
|
||||||
|
this.isDoAni = false;
|
||||||
|
},
|
||||||
|
fnOnTouchend() {
|
||||||
|
this.isDoAni = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -188,7 +199,9 @@ export default {
|
|||||||
background-color: rgba(255, 199, 184, 0.9);
|
background-color: rgba(255, 199, 184, 0.9);
|
||||||
margin-bottom: 52rpx;
|
margin-bottom: 52rpx;
|
||||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.1);
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.1);
|
||||||
animation: loveCardAni 3s ease-in-out infinite;
|
&.ani {
|
||||||
|
animation: loveCardAni 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -302,8 +315,10 @@ export default {
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
margin-bottom: 36rpx;
|
margin-bottom: 36rpx;
|
||||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
animation: cardAni 3s ease-in-out infinite;
|
|
||||||
animation-delay: var(--delay);
|
animation-delay: var(--delay);
|
||||||
|
&.ani {
|
||||||
|
animation: cardAni 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
.head {
|
.head {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -25,9 +25,10 @@
|
|||||||
<tm-input
|
<tm-input
|
||||||
name="status"
|
name="status"
|
||||||
required
|
required
|
||||||
title="首页布局"
|
title="首页文章布局"
|
||||||
placeholder="请选择首页布局"
|
placeholder="请选择首页文章布局"
|
||||||
disabled
|
disabled
|
||||||
|
align="right"
|
||||||
:value="homeLayout.selectLabel"
|
:value="homeLayout.selectLabel"
|
||||||
right-icon="icon-angle-right"
|
right-icon="icon-angle-right"
|
||||||
></tm-input>
|
></tm-input>
|
||||||
@@ -43,9 +44,10 @@
|
|||||||
<tm-input
|
<tm-input
|
||||||
name="status"
|
name="status"
|
||||||
required
|
required
|
||||||
title="卡片样式"
|
title="文章卡片样式"
|
||||||
placeholder="请选择文章卡片样式"
|
placeholder="请选择文章卡片样式"
|
||||||
disabled
|
disabled
|
||||||
|
align="right"
|
||||||
:value="articleCardStyle.selectLabel"
|
:value="articleCardStyle.selectLabel"
|
||||||
right-icon="icon-angle-right"
|
right-icon="icon-angle-right"
|
||||||
></tm-input>
|
></tm-input>
|
||||||
@@ -78,6 +80,29 @@
|
|||||||
<text class="text-size-m ">友链简洁模式</text>
|
<text class="text-size-m ">友链简洁模式</text>
|
||||||
<tm-switch v-model="appSettings.links.useSimple" color="light-blue" :text="['是', '否']"></tm-switch>
|
<tm-switch v-model="appSettings.links.useSimple" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="mx-32 mt-24 mb-0 border-b-1 pb-24 flex-between">
|
||||||
|
<text class="text-size-m">启用评论弹幕</text>
|
||||||
|
<tm-switch v-model="appSettings.barrage.use" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
|
</view>
|
||||||
|
<tm-pickers
|
||||||
|
v-if="appSettings.barrage.use"
|
||||||
|
title="评论弹幕位置"
|
||||||
|
btn-color="light-blue"
|
||||||
|
:default-value.sync="barrage.selectDefault"
|
||||||
|
rang-key="name"
|
||||||
|
:list="barrage.list"
|
||||||
|
@confirm="fnOnBarrageConfirm"
|
||||||
|
>
|
||||||
|
<tm-input
|
||||||
|
name="status"
|
||||||
|
title="评论弹幕位置"
|
||||||
|
placeholder="请选择评论弹幕位置"
|
||||||
|
disabled
|
||||||
|
align="right"
|
||||||
|
:value="barrage.selectLabel"
|
||||||
|
right-icon="icon-angle-right"
|
||||||
|
></tm-input>
|
||||||
|
</tm-pickers>
|
||||||
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
||||||
<text class="text-size-m">是否圆形头像</text>
|
<text class="text-size-m">是否圆形头像</text>
|
||||||
<tm-switch v-model="appSettings.isAvatarRadius" color="light-blue" :text="['是', '否']"></tm-switch>
|
<tm-switch v-model="appSettings.isAvatarRadius" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
@@ -173,7 +198,13 @@ export default {
|
|||||||
selectLabel: '左图右文',
|
selectLabel: '左图右文',
|
||||||
selectValue: 'lr_image_text'
|
selectValue: 'lr_image_text'
|
||||||
},
|
},
|
||||||
dotPositionList: [{ name: '右边', value: 'right', checked: true }, { name: '下边', value: 'bottom', checked: false }]
|
dotPositionList: [{ name: '右边', value: 'right', checked: true }, { name: '下边', value: 'bottom', checked: false }],
|
||||||
|
barrage: {
|
||||||
|
list: [{ name: '顶部', value: 'rightToLeft' }, { name: '左下', value: 'leftBottom' }],
|
||||||
|
selectDefault: ['顶部'],
|
||||||
|
selectLabel: '顶部',
|
||||||
|
selectValue: 'rightToLeft'
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -219,6 +250,11 @@ export default {
|
|||||||
this.articleCardStyle.selectDefault = [_articleCardStyle.name];
|
this.articleCardStyle.selectDefault = [_articleCardStyle.name];
|
||||||
this.articleCardStyle.selectLabel = _articleCardStyle.name;
|
this.articleCardStyle.selectLabel = _articleCardStyle.name;
|
||||||
this.articleCardStyle.selectValue = _articleCardStyle.value;
|
this.articleCardStyle.selectValue = _articleCardStyle.value;
|
||||||
|
|
||||||
|
const _barrage = this.fnFindObjInList(this.barrage.list, 'value', this.appSettings.barrage.type);
|
||||||
|
this.barrage.selectDefault = [_barrage.name];
|
||||||
|
this.barrage.selectLabel = _barrage.name;
|
||||||
|
this.barrage.selectValue = _barrage.value;
|
||||||
},
|
},
|
||||||
// 在集合中找匹配的对象
|
// 在集合中找匹配的对象
|
||||||
fnFindObjInList(list, key, value) {
|
fnFindObjInList(list, key, value) {
|
||||||
@@ -249,10 +285,17 @@ export default {
|
|||||||
this.articleCardStyle.selectValue = _select.value;
|
this.articleCardStyle.selectValue = _select.value;
|
||||||
this.appSettings.layout.cardType = _select.value;
|
this.appSettings.layout.cardType = _select.value;
|
||||||
},
|
},
|
||||||
|
// 弹幕设置
|
||||||
|
fnOnBarrageConfirm(e) {
|
||||||
|
const _select = e[0].data;
|
||||||
|
this.barrage.selectDefault = [_select.name];
|
||||||
|
this.barrage.selectLabel = _select.name;
|
||||||
|
this.barrage.selectValue = _select.value;
|
||||||
|
this.appSettings.barrage.type = _select.value;
|
||||||
|
},
|
||||||
// 保存
|
// 保存
|
||||||
fnOnSave() {
|
fnOnSave() {
|
||||||
this.isSaved = true;
|
this.isSaved = true;
|
||||||
console.log('this.appSettings', this.appSettings);
|
|
||||||
this.$tm.vx.commit('setting/setSettings', this.appSettings);
|
this.$tm.vx.commit('setting/setSettings', this.appSettings);
|
||||||
uni.$tm.toast('保存成功,部分设置在重启后生效!');
|
uni.$tm.toast('保存成功,部分设置在重启后生效!');
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -4,4 +4,4 @@
|
|||||||
*
|
*
|
||||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||||
*/
|
*/
|
||||||
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("./dayjs.min")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){switch(_){case"W":return e+"周";default:return e+"日"}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));
|
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("./dayjs.min")):"function"==typeof define&&define.amd?define(["./dayjs.min"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){switch(_){case"W":return e+"周";default:return e+"日"}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));
|
||||||
+12
-5
@@ -35,6 +35,11 @@ export const _DefaultAppSettings = {
|
|||||||
timeout: 3, // 屏蔽广告时长,时间到后自动恢复展示(单位小时)
|
timeout: 3, // 屏蔽广告时长,时间到后自动恢复展示(单位小时)
|
||||||
disabled: false, // 是否屏蔽广告(看广告可以关闭应用内设置的广告)
|
disabled: false, // 是否屏蔽广告(看广告可以关闭应用内设置的广告)
|
||||||
},
|
},
|
||||||
|
// 评论弹幕(文章详情)
|
||||||
|
barrage: {
|
||||||
|
use: true, // 是否启用
|
||||||
|
type: 'leftBottom' // 弹幕位置(rightToLeft leftBottom)
|
||||||
|
},
|
||||||
gallery: {
|
gallery: {
|
||||||
// 是否使用瀑布流
|
// 是否使用瀑布流
|
||||||
useWaterfull: true
|
useWaterfull: true
|
||||||
@@ -56,17 +61,19 @@ export const _DefaultAppSettings = {
|
|||||||
contact: {
|
contact: {
|
||||||
// 链接是否使用复制的方式,否则直接在内部打开(小程序需要配置对应链接的业务域名)
|
// 链接是否使用复制的方式,否则直接在内部打开(小程序需要配置对应链接的业务域名)
|
||||||
isLinkCopy: true,
|
isLinkCopy: true,
|
||||||
}
|
},
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// 应用设置存储key值
|
||||||
|
export const _AppSettingsKey = 'APP_GLOBAL_SETTINGS';
|
||||||
/**
|
/**
|
||||||
* 获取应用设置
|
* 获取应用设置
|
||||||
*/
|
*/
|
||||||
export const getAppSettings = () => {
|
export const getAppSettings = () => {
|
||||||
let _appSettings = uni.getStorageSync('APP_GLOBAL_SETTINGS')
|
let _appSettings = uni.getStorageSync(_AppSettingsKey)
|
||||||
if (_appSettings) return JSON.parse(_appSettings)
|
if (_appSettings) return JSON.parse(_appSettings)
|
||||||
|
|
||||||
uni.setStorageSync('APP_GLOBAL_SETTINGS', JSON.stringify(_DefaultAppSettings))
|
uni.setStorageSync(_AppSettingsKey, JSON.stringify(_DefaultAppSettings))
|
||||||
return _appSettings;
|
return _appSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,5 +81,5 @@ export const getAppSettings = () => {
|
|||||||
* 保存应用设置
|
* 保存应用设置
|
||||||
*/
|
*/
|
||||||
export const setAppSettings = (appSettings) => {
|
export const setAppSettings = (appSettings) => {
|
||||||
uni.setStorageSync('APP_GLOBAL_SETTINGS', JSON.stringify(appSettings))
|
uni.setStorageSync(_AppSettingsKey, JSON.stringify(appSettings))
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-7
@@ -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',
|
||||||
@@ -43,9 +46,9 @@ const utils = {
|
|||||||
let _url = HaloConfig.defaultThumbnailUrl
|
let _url = HaloConfig.defaultThumbnailUrl
|
||||||
if (_url) {
|
if (_url) {
|
||||||
if (_url.indexOf('?') == -1) {
|
if (_url.indexOf('?') == -1) {
|
||||||
_url += `&next-v=${new Date().getTime()}`
|
|
||||||
} else {
|
|
||||||
_url += `?next-v=${new Date().getTime()}`
|
_url += `?next-v=${new Date().getTime()}`
|
||||||
|
} else {
|
||||||
|
_url += `&next-v=${new Date().getTime()}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!thumbnail) return _url;
|
if (!thumbnail) return _url;
|
||||||
@@ -58,9 +61,9 @@ const utils = {
|
|||||||
let _url = HaloConfig.defaultImageUrl
|
let _url = HaloConfig.defaultImageUrl
|
||||||
if (_url) {
|
if (_url) {
|
||||||
if (_url.indexOf('?') == -1) {
|
if (_url.indexOf('?') == -1) {
|
||||||
_url += `&next-v=${new Date().getTime()}`
|
|
||||||
} else {
|
|
||||||
_url += `?next-v=${new Date().getTime()}`
|
_url += `?next-v=${new Date().getTime()}`
|
||||||
|
} else {
|
||||||
|
_url += `&next-v=${new Date().getTime()}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!image) return _url;
|
if (!image) return _url;
|
||||||
@@ -75,9 +78,9 @@ const utils = {
|
|||||||
let _url = HaloConfig.defaultAvatarUrl
|
let _url = HaloConfig.defaultAvatarUrl
|
||||||
if (_url) {
|
if (_url) {
|
||||||
if (_url.indexOf('?') == -1) {
|
if (_url.indexOf('?') == -1) {
|
||||||
_url += `&next-v=${new Date().getTime()}`
|
|
||||||
} else {
|
|
||||||
_url += `?next-v=${new Date().getTime()}`
|
_url += `?next-v=${new Date().getTime()}`
|
||||||
|
} else {
|
||||||
|
_url += `&next-v=${new Date().getTime()}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _url;
|
return _url;
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/**
|
||||||
|
* 对象转换为url参数形式
|
||||||
|
* @param {Object} param 将要转换为URL参数的字符串对象
|
||||||
|
* @param {String} key URL 参数字符串的前缀
|
||||||
|
* @param {Boolean} encode 是否进行URL编码,默认为true
|
||||||
|
* @return {String} URL参数字符串
|
||||||
|
*/
|
||||||
|
export function jsonToUrlParams(param, key, encode) {
|
||||||
|
if (param == null) return '';
|
||||||
|
let paramStr = '';
|
||||||
|
let t = typeof(param);
|
||||||
|
if (t == 'string' || t == 'number' || t == 'boolean') {
|
||||||
|
paramStr += '&' + key + '=' + ((encode == null || encode) ? encodeURIComponent(param) : param);
|
||||||
|
} else {
|
||||||
|
for (var i in param) {
|
||||||
|
var k = key == null ? i : key + (param instanceof Array ? '[' + i + ']' : '.' + i);
|
||||||
|
paramStr += jsonToUrlParams(param[i], k, encode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return paramStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Array} actual
|
||||||
|
* @returns {Array}
|
||||||
|
*/
|
||||||
|
export function cleanArray(actual) {
|
||||||
|
const newArray = []
|
||||||
|
for (let i = 0; i < actual.length; i++) {
|
||||||
|
if (actual[i]) {
|
||||||
|
newArray.push(actual[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newArray
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json对象转Url参数2
|
||||||
|
* @param {Object} json
|
||||||
|
* @returns {Array}
|
||||||
|
*/
|
||||||
|
export function jsonToUrlParams2(json) {
|
||||||
|
if (!json) return ''
|
||||||
|
return cleanArray(
|
||||||
|
Object.keys(json).map(key => {
|
||||||
|
if (json[key] === undefined) return ''
|
||||||
|
return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
|
||||||
|
})
|
||||||
|
).join('&')
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user