mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-07-27 04:20:43 +08:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 82062d9465 | |||
| 706cee2240 | |||
| da60eb2daf | |||
| a764c3dbfe | |||
| 88fb74a795 | |||
| 52d4b7927b | |||
| ff31e0d8e8 | |||
| a65ea2617b | |||
| bb228c6705 | |||
| 62992b2688 | |||
| da141ae10a | |||
| d22224e2fc | |||
| d0b3a42c1d | |||
| c3349ae070 | |||
| ad6719e201 | |||
| 0e342d5fa3 | |||
| daf1318a90 | |||
| d4ccc9b7d6 | |||
| ce60c334ec | |||
| ca723bae80 | |||
| c312fab4b1 | |||
| d9db03959a | |||
| add84f6e4b | |||
| 850ee73fa2 | |||
| 77da85f7d4 | |||
| 4d0901b650 | |||
| 66a39dd723 | |||
| 4cdcbb1958 | |||
| e0569e287f | |||
| b42932ddad |
@@ -1,66 +1,60 @@
|
||||
<script>
|
||||
import HaloTokenConfig from '@/config/token.config.js';
|
||||
import HaloTokenConfig from '@/config/token.config.js';
|
||||
|
||||
// app升级检测(搭配:https://ext.dcloud.net.cn/plugin?id=4470 升级中心)
|
||||
import CheckAppUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
|
||||
import {
|
||||
CheckWxUpdate
|
||||
} from '@/utils/update.js';
|
||||
export default {
|
||||
globalData: {
|
||||
baseApiUrl: HaloTokenConfig.BASE_API
|
||||
},
|
||||
onLaunch: function() {
|
||||
console.log('App Launch');
|
||||
// app升级检测(搭配:https://ext.dcloud.net.cn/plugin?id=4470 升级中心)
|
||||
import CheckAppUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
|
||||
import {CheckWxUpdate} from '@/utils/update.js';
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
CheckAppUpdate();
|
||||
// #endif
|
||||
export default {
|
||||
globalData: {
|
||||
baseApiUrl: HaloTokenConfig.BASE_API
|
||||
},
|
||||
onLaunch: function () {
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
CheckWxUpdate();
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
CheckAppUpdate();
|
||||
// #endif
|
||||
|
||||
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
|
||||
console.log('正常:', res)
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
||||
// #endif
|
||||
})
|
||||
// 启动检查app的配置是否已经就绪,若未就绪则设置默认的
|
||||
uni.$tm.vx.actions('setting/checkAndSetDefaultAppSettings');
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show');
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide');
|
||||
}
|
||||
};
|
||||
// #ifdef MP-WEIXIN
|
||||
CheckWxUpdate();
|
||||
// #endif
|
||||
|
||||
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
|
||||
})
|
||||
// 启动检查app的配置是否已经就绪,若未就绪则设置默认的
|
||||
uni.$tm.vx.actions('setting/checkAndSetDefaultAppSettings');
|
||||
},
|
||||
onShow: function () {
|
||||
console.log('App Show');
|
||||
},
|
||||
onHide: function () {
|
||||
console.log('App Hide');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 基础样式
|
||||
@import './common/styles/app.theme.scss';
|
||||
@import './common/styles/app.base.scss';
|
||||
// 基础样式
|
||||
@import './common/styles/app.theme.scss';
|
||||
@import './common/styles/app.base.scss';
|
||||
|
||||
// 引入tmUI2.x样式
|
||||
@import './tm-vuetify/mian.min.css';
|
||||
// 引入tmUI2.x主题包
|
||||
@import './tm-vuetify/scss/theme.css';
|
||||
// 引入tmUI2.x预置图标
|
||||
@import './tm-vuetify/scss/fonts/fontawesome_base64.css';
|
||||
// 引入tmUI2.x样式
|
||||
@import './tm-vuetify/mian.min.css';
|
||||
// 引入tmUI2.x主题包
|
||||
@import './tm-vuetify/scss/theme.css';
|
||||
// 引入tmUI2.x预置图标
|
||||
@import './tm-vuetify/scss/fonts/fontawesome_base64.css';
|
||||
|
||||
// 自定义图标
|
||||
@import './common/icons/halocoloriconfont.css';
|
||||
@import './common/icons/haloiconfont.css';
|
||||
@import './common/icons/mphtmliconfont.css';
|
||||
// 自定义图标
|
||||
@import './common/icons/halocoloriconfont.css';
|
||||
@import './common/icons/haloiconfont.css';
|
||||
@import './common/icons/mphtmliconfont.css';
|
||||
|
||||
/* #ifndef MP-WEIXIN */
|
||||
@import './common/markdown/markdown.scss';
|
||||
/* #endif */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
@import './common/markdown/markdown.scss';
|
||||
/* #endif */
|
||||
|
||||
page {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
page {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
</style>
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
<br />
|
||||
<p align="center">
|
||||
<a href="https://b.925i.cn">作者博客</a>
|
||||
<a href="https://uni-halo.925i.cn">文档地址(等待更新v2版本说明)</a>
|
||||
<a href="https://gitee.com/ialley-workshop-open/uni-halo">Gitee仓库</a>
|
||||
<a href="https://github.com/ialley-workshop-open/uni-halo">Github仓库</a>
|
||||
<a href="https://www.xiaoxiaomo.cn">作者主页</a>
|
||||
<a href="https://uni-halo.925i.cn">官方文档</a>
|
||||
<a href="https://github.com/ialley-workshop-open/uni-halo">仓库地址</a>
|
||||
<a href="https://github.com/ialley-workshop-open/plugin-uni-halo">插件仓库</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
@@ -24,50 +24,25 @@
|
||||
|:----------------------------------------------:|:---------------------------------------------:|:---------------------------------------------:|
|
||||
|  |  |  |
|
||||
|
||||
## 一、项目介绍
|
||||
|
||||
## 🧐 功能介绍
|
||||
基于 Halo 2.x 提供的 API 接口,为微信小程序提供的一套开源的博客应用。
|
||||
|
||||
#### 🍻 基础功能
|
||||
- 完全免费开源,包括程序源码、插件源码
|
||||
- 页面支持插件配置
|
||||
- 使用最新流行的技术栈
|
||||
- 支持特色功能,恋爱日记
|
||||
- 理论支持编译为 小程序(推荐)、APP
|
||||
|
||||
`重要说明:2.0版本 暂时去掉后台管理功能。`
|
||||
|
||||
- 用户端:文章列表、文章分类、文章详情、图库、友链、瞬间等
|
||||
### 在线预览
|
||||
|
||||
<br/>
|
||||
微信内容扫描下方二维码,即可在线预览小程序。
|
||||
|
||||
#### 💞 特色功能
|
||||

|
||||
|
||||
- 恋爱日记:精心为您设计了秀恩爱的模块,秀出关于你们的故事、情侣甜蜜相册、恋爱记录清单,为您的恋爱保驾护航。
|
||||
|
||||
<br/>
|
||||
|
||||
#### 😘 插件配置
|
||||
|
||||
已支持通过插件配置,插件地址 [plugin-uni-halo](https://github.com/ialley-workshop-open/plugin-uni-halo)
|
||||
|
||||
<br/>
|
||||
|
||||
## 😎 文档源码
|
||||
|
||||
- 作者博客:[https://b.925i.cn/](https://b.925i.cn/)
|
||||
- 官方文档(待更新v2版本说明):[https://uni-halo.925i.cn/](https://uni-halo.925i.cn/)
|
||||
- Gitee :[https://gitee.com/ialley-workshop-open/uni-halo](https://gitee.com/ialley-workshop-open/uni-halo)
|
||||
- Github :[https://github.com/ialley-workshop-open/uni-halo](https://github.com/ialley-workshop-open/uni-halo)
|
||||
|
||||
<br/>
|
||||
|
||||
## 😏 在线体验
|
||||
|
||||
说明:微信扫码、或搜索【小莫唐尼】即可在线体验已上线小程序!!!
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
## 😘 界面预览
|
||||
|
||||
##### 📱 用户端
|
||||
|
||||
说明:以下仅为部分截图
|
||||
### 部分截图
|
||||
|
||||
|首页|分类|图库|
|
||||
|:--:|:--:|:--:|
|
||||
@@ -78,25 +53,51 @@
|
||||
|||
|
||||
|
||||
|
||||
##### 📱 恋爱日记
|
||||
|
||||
说明:以下仅为部分截图
|
||||
### 恋爱日记
|
||||
|
||||
|主页|恋爱清单|
|
||||
|:--:|:--:|
|
||||
|||
|
||||
<br/>
|
||||
|
||||
## 🙋 使用交流
|
||||
|
||||
### 功能介绍
|
||||
|
||||
- 基础功能:文章列表、文章分类、文章详情、个人图库、友情链接、我的瞬间
|
||||
|
||||
- 特色功能:恋爱日记,精心为您设计了秀恩爱的模块,秀出关于你们的故事、情侣甜蜜相册、恋爱记录清单,为您的恋爱保驾护航。
|
||||
|
||||
|
||||
## 二、配套插件
|
||||
|
||||
### 下载地址
|
||||
- 代码仓库:[https://github.com/ialley-workshop-open/plugin-uni-halo](https://github.com/ialley-workshop-open/plugin-uni-halo)
|
||||
- 仓库版本:[https://github.com/ialley-workshop-open/plugin-uni-halo/releases](https://github.com/ialley-workshop-open/plugin-uni-halo/releases)
|
||||
- 应用市场:[https://www.halo.run/store/apps/app-ryemX](https://www.halo.run/store/apps/app-ryemX)
|
||||
|
||||
### 使用方式
|
||||
|
||||
直接下载安装插件,在插件市场安装即可,安装完成后,需要配置插件,配置完成后,即可使用插件提供的功能。
|
||||
|
||||
|
||||
## 三、相关文档
|
||||
|
||||
- 作者主页:[https://www.xiaoxiaomo.cn/](https://www.xiaoxiaomo.cn/)
|
||||
- 作者博客:[https://blog.925i.cn/](https://blog.925i.cn/)
|
||||
- 官方文档:[https://uni-halo.925i.cn/](https://uni-halo.925i.cn/)
|
||||
- 代码仓库:[https://github.com/ialley-workshop-open/uni-halo](https://github.com/ialley-workshop-open/uni-halo)
|
||||
- 插件地址:[https://github.com/ialley-workshop-open/plugin-uni-halo](https://github.com/ialley-workshop-open/uni-halo)
|
||||
- 应用市场:[https://www.halo.run/store/apps/app-ryemX](https://www.halo.run/store/apps/app-ryemX)
|
||||
|
||||
|
||||
## 四、使用交流
|
||||
|
||||
- 提交 issues:[Github Issues](https://github.com/ialley-workshop-open/uni-halo/issues)
|
||||
丨 [Gitee Issues](https://gitee.com/ialley-workshop-open/uni-halo/issues)
|
||||
- 微信交流群:由于微信交流群时效性太短,所以有需要的话可以先加入QQ群,再邀请进微信群
|
||||
- QQ 交流群:632969367
|
||||
-
|
||||
快速加群:[](https://qm.qq.com/cgi-bin/qm/qr?k=cuam7lhrB_vHuvjw2mzUO1sOKdF9KRyM&jump_from=webapi&authKey=d6bJhNaqupTTfoMDWDIeYUTAs44Ax7p64SsM/5NRtFhXE09YexDO15Izuyth6XAi)
|
||||
|
||||

|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
+13
-1
@@ -77,7 +77,7 @@ export default {
|
||||
},
|
||||
// 提交回复
|
||||
addPostCommentReply: (commentName, data) => {
|
||||
return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/comments/${commentName}/replay`, data)
|
||||
return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/comments/${commentName}/reply`, data)
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -200,5 +200,17 @@ export default {
|
||||
*/
|
||||
submitLink(form) {
|
||||
return HttpHandler.Post(`/apis/linksSubmit.muyin.site/v1alpha1/submit`, form, null)
|
||||
},
|
||||
/**
|
||||
* 获取二维码信息
|
||||
*/
|
||||
getQRCodeInfo: (key) => {
|
||||
return HttpHandler.Get(`/apis/api.uni.uhalo.pro/v1alpha1/plugins/plugin-uni-halo/getQRCodeInfo/${key}`, null,)
|
||||
},
|
||||
/**
|
||||
* 获取二维码图片
|
||||
*/
|
||||
getQRCodeImg: (postId) => {
|
||||
return HttpHandler.Get(`/apis/api.uni.uhalo.pro/v1alpha1/plugins/plugin-uni-halo/getQRCodeImg/${postId}`, null,)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* markdown配置
|
||||
*/
|
||||
|
||||
import {
|
||||
getAppConfigs
|
||||
} from '@/config/index.js'
|
||||
import {getAppConfigs} from '@/config/index.js'
|
||||
import HaloTokenConfig from '@/config/token.config.js'
|
||||
import utils from '@/utils/index.js'
|
||||
|
||||
export default {
|
||||
domain: HaloTokenConfig.BASE_API,
|
||||
tagStyle: {
|
||||
table: `
|
||||
domain: HaloTokenConfig.BASE_API,
|
||||
tagStyle: {
|
||||
table: `
|
||||
table-layout: fixed;
|
||||
border-collapse:collapse;
|
||||
margin-bottom: 18px;
|
||||
@@ -20,17 +20,17 @@ export default {
|
||||
border: 1px solid #dcdcdc;
|
||||
border-radius: 4px;
|
||||
`,
|
||||
th: `
|
||||
th: `
|
||||
padding: 8px;
|
||||
border-right: 1px solid var(--classE);
|
||||
border-bottom: 1px solid var(--classE);
|
||||
`,
|
||||
td: `
|
||||
td: `
|
||||
padding: 8px;
|
||||
border-right: 1px solid var(--classE);
|
||||
border-bottom: 1px solid var(--classE);
|
||||
`,
|
||||
blockquote: `
|
||||
blockquote: `
|
||||
padding: 8px 15px;
|
||||
color: #606266;
|
||||
background: #f2f6fc;
|
||||
@@ -39,62 +39,62 @@ export default {
|
||||
line-height: 26px;
|
||||
margin-bottom: 18px;
|
||||
`,
|
||||
ul: 'padding-left: 15px;line-height: 1.85;',
|
||||
ol: 'padding-left: 15px;line-height: 1.85;',
|
||||
li: 'margin-bottom: 12px;line-height: 1.85;',
|
||||
h1: `
|
||||
ul: 'padding-left: 15px;line-height: 1.85;',
|
||||
ol: 'padding-left: 15px;line-height: 1.85;',
|
||||
li: 'margin-bottom: 12px;line-height: 1.85;',
|
||||
h1: `
|
||||
margin: 30px 0 20px;
|
||||
color: var(--main);
|
||||
line-height: 24px;
|
||||
position: relative;
|
||||
font-size:1.2em;
|
||||
`,
|
||||
h2: `
|
||||
h2: `
|
||||
color: var(--main);
|
||||
line-height: 24px;
|
||||
position: relative;
|
||||
margin: 22px 0 16px;
|
||||
font-size: 1.16em;
|
||||
`,
|
||||
h3: `
|
||||
h3: `
|
||||
color: var(--main);
|
||||
line-height: 24px;
|
||||
position: relative;
|
||||
margin: 26px 0 18px;
|
||||
font-size: 1.14em;
|
||||
`,
|
||||
h4: `
|
||||
h4: `
|
||||
color: var(--main);
|
||||
line-height: 24px;
|
||||
margin-bottom: 18px;
|
||||
position: relative;
|
||||
font-size: 1.12em;
|
||||
`,
|
||||
h5: `
|
||||
h5: `
|
||||
color: var(--main);
|
||||
line-height: 24px;
|
||||
margin-bottom: 14px;
|
||||
position: relative;
|
||||
font-size: 1.1em;
|
||||
`,
|
||||
h6: `
|
||||
h6: `
|
||||
color: #303133;
|
||||
line-height: 24px;
|
||||
margin-bottom: 14px;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
`,
|
||||
p: `
|
||||
p: `
|
||||
line-height: 1.65;
|
||||
margin-bottom: 14px;
|
||||
font-size: 14px;
|
||||
`,
|
||||
'code': ` `,
|
||||
strong: 'font-weight: 700;color: rgb(248, 57, 41);',
|
||||
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: 14px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px;border-radius: 6px;background-color:#FFFFFF;',
|
||||
'code': ` `,
|
||||
strong: 'font-weight: 700;color: rgb(248, 57, 41);',
|
||||
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: 14px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px;border-radius: 6px;background-color:#FFFFFF;',
|
||||
|
||||
loadingGif: getAppConfigs().imagesConfig.loadingGifUrl,
|
||||
emptyGif: getAppConfigs().imagesConfig.loadingEmptyUrl,
|
||||
loadingGif: utils.checkImageUrl(getAppConfigs().imagesConfig.loadingGifUrl),
|
||||
emptyGif: utils.checkImageUrl(getAppConfigs().imagesConfig.loadingEmptyUrl),
|
||||
}
|
||||
+1
-13
@@ -42,18 +42,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
haloConfig: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (!newVal) return;
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.$tm.vx.commit('setWxShare', newVal.shareConfig);
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.fnResetSetAniWaitIndex()
|
||||
},
|
||||
@@ -72,7 +60,7 @@ export default {
|
||||
// 设置页面标题
|
||||
fnSetPageTitle(title) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: title || (this.haloConfig && this.haloConfig.startConfig.title) || "uni-halo",
|
||||
title: title || this.haloConfig?.appConfig?.startConfig?.title || "uni-halo",
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
// 微信分享配置
|
||||
import HaloTokenConfig from '@/config/token.config.js'
|
||||
import {jsonToUrlParams2} from '@/utils/url.params.js'
|
||||
|
||||
export const haloWxShareMixin = {
|
||||
computed: {
|
||||
haloWxShareData() {
|
||||
const configs = this.$tm.vx.getters().getConfigs;
|
||||
return configs?.shareConfig || {}
|
||||
}
|
||||
},
|
||||
//#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: HaloTokenConfig.BASE_API,
|
||||
query: {}
|
||||
}, config)
|
||||
|
||||
uni.$tm.vx.commit('setWxShare', _config);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,207 +0,0 @@
|
||||
<template>
|
||||
<tm-poup v-model="show" position="bottom" height="auto" @change="fnClose">
|
||||
<view class="poup-head pa-24 text-align-center text-weight-b ">{{ title }}</view>
|
||||
<view class="poup-body pa-24 pt-0 pb-0">
|
||||
<view v-if="loading != 'success'" class="loading-wrap flex flex-center">
|
||||
<view v-if="loading == 'loading'" class="loading">加载中...</view>
|
||||
<view v-else class="error" @click="fnGetData()">加载失败,点击刷新!</view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<view v-if="total == 0" class="empty">无附件</view>
|
||||
<scroll-view v-else class="poup-content" :enable-flex="true" :scroll-y="true" @touchmove.stop>
|
||||
<view class="card-content">
|
||||
<view class="card pa-12" v-for="(file, index) in dataList" :key="index" @click="fnOnSelect(file, index)">
|
||||
<view class="card-inner round-3" :class="{ 'is-select': selectIndex == index }">
|
||||
<cache-image v-if="file.isImage" class="cover" height="160rpx" :url="file.thumbPath" :fileMd5="file.thumbPath" mode="aspectFill"></cache-image>
|
||||
<view v-else class="cover flex pl-46 pr-46 flex-center bg-gradient-blue-grey-accent text-align-center text-size-m">{{ file.mediaType }}</view>
|
||||
|
||||
<view class="name text-overflow text-size-m pa-12">{{ file.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="poup-foot pa-30 pb-12 pt-0">
|
||||
<!-- 分页 -->
|
||||
<view v-if="total > queryParams.size" class="mt-36 pl-24 pr-24">
|
||||
<tm-pagination color="bg-gradient-blue-accent" :page.sync="queryParams.page" :total="total" :totalVisible="5" @change="fnGetPagingData"></tm-pagination>
|
||||
</view>
|
||||
<view class=" flex flex-center mt-12">
|
||||
<tm-button size="m" theme="bg-gradient-blue-accent" @click="fnSava()">确定选用</tm-button>
|
||||
<tm-button size="m" theme="bg-gradient-orange-accent" @click="fnUpload()">上传</tm-button>
|
||||
<tm-button size="m" theme="bg-gradient-blue-grey-accent" @click="fnClose(false)">关 闭</tm-button>
|
||||
</view>
|
||||
</view>
|
||||
</tm-poup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAdminAccessToken } from '@/utils/auth.js';
|
||||
|
||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||
import tmPagination from '@/tm-vuetify/components/tm-pagination/tm-pagination.vue';
|
||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||
export default {
|
||||
name: 'attachment-select',
|
||||
components: { tmPoup, tmPagination, tmButton },
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: '附件列表'
|
||||
},
|
||||
selectType: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: true,
|
||||
loading: 'loading',
|
||||
total: 0,
|
||||
queryParams: {
|
||||
size: 6,
|
||||
page: 1
|
||||
},
|
||||
dataList: [],
|
||||
select: null,
|
||||
selectIndex: -1
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.fnGetData();
|
||||
},
|
||||
methods: {
|
||||
fnGetData() {
|
||||
this.queryParams.page = 1;
|
||||
this.fnGetPagingData(1);
|
||||
},
|
||||
fnGetPagingData(page) {
|
||||
this.loading = 'loading';
|
||||
const _params = {
|
||||
...this.queryParams
|
||||
};
|
||||
_params.page = page - 1;
|
||||
this.$httpApi.admin
|
||||
.getAttachmentsByPage(_params)
|
||||
.then(res => {
|
||||
if (res.status == 200) {
|
||||
this.total = res.data.total;
|
||||
this.dataList = res.data.content.map(file => {
|
||||
if (this.$utils.fnCheckIsFileType('image', file) && file.size / 1024 / 1024 > 2) {
|
||||
file.isImage = false;
|
||||
file.desc = '图片过大无法显示缩略图';
|
||||
} else {
|
||||
file.isImage = this.$utils.fnCheckIsFileType('image', file);
|
||||
}
|
||||
file.thumbPath = this.$utils.checkThumbnailUrl(file.thumbPath);
|
||||
return file;
|
||||
});
|
||||
this.loading = 'success';
|
||||
} else {
|
||||
uni.$tm.toast('加载失败,请重试!');
|
||||
this.loading = 'error';
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
uni.$tm.toast('加载失败,请重试!');
|
||||
this.loading = 'error';
|
||||
});
|
||||
},
|
||||
fnOnSelect(file, index) {
|
||||
this.select = file;
|
||||
this.selectIndex = index;
|
||||
},
|
||||
fnSava() {
|
||||
if (this.selectType) {
|
||||
if (this.$utils.fnCheckIsFileType(this.selectType, this.select)) {
|
||||
this.$emit('on-select', this.select);
|
||||
} else {
|
||||
uni.$tm.toast('该附件类型不符合!');
|
||||
}
|
||||
} else {
|
||||
this.$emit('on-select', this.select);
|
||||
}
|
||||
},
|
||||
fnClose(e) {
|
||||
if (!e) {
|
||||
this.$emit('on-close');
|
||||
}
|
||||
},
|
||||
fnUpload() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: res => {
|
||||
uni.uploadFile({
|
||||
filePath: res.tempFilePaths[0],
|
||||
header: {
|
||||
'admin-authorization': getAdminAccessToken()
|
||||
},
|
||||
url: this.$baseApiUrl + '/api/admin/attachments/upload',
|
||||
name: 'file',
|
||||
success: upladRes => {
|
||||
const _uploadRes = JSON.parse(upladRes.data);
|
||||
if (_uploadRes.status == 200) {
|
||||
uni.$tm.toast('上传成功!');
|
||||
this.fnGetData(1);
|
||||
} else {
|
||||
uni.$tm.toast(_uploadRes.message);
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
uni.$tm.toast(err.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.poup-head {
|
||||
}
|
||||
.poup-body {
|
||||
height: 50vh;
|
||||
}
|
||||
.loading-wrap {
|
||||
height: 50vh;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
.poup-content {
|
||||
height: inherit;
|
||||
box-sizing: border-box;
|
||||
.card-content {
|
||||
height: inherit;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
.card {
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
&-inner {
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||
border: 4rpx solid transparent;
|
||||
&.is-select {
|
||||
border-color: rgb(13, 141, 242);
|
||||
}
|
||||
}
|
||||
.cover {
|
||||
width: 100%;
|
||||
height: 160rpx;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.name {
|
||||
color: #303133;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,194 +0,0 @@
|
||||
<template>
|
||||
<view class="bottom-tool-bar">
|
||||
<tm-translate :auto="true" animation-name="fadeUp">
|
||||
<view class="content flex">
|
||||
<view class="input" @click="fnToComment()">
|
||||
<text class="icon iconfont icon-edit"></text>
|
||||
<text class="text">(*^▽^*)说点啥吧~</text>
|
||||
</view>
|
||||
<view class="right flex">
|
||||
<!-- 点赞 -->
|
||||
<view class="item likes" @click="fnDoLikes()">
|
||||
<view class="iconfont icon-like"></view>
|
||||
<view class="text">{{ tempPost.likes }}</view>
|
||||
</view>
|
||||
<!-- 评论 -->
|
||||
<view class="item comment">
|
||||
<view class="iconfont icon-comment-dots"></view>
|
||||
<view class="text">{{ tempPost.commentCount }}</view>
|
||||
</view>
|
||||
<!-- 分享 -->
|
||||
<view class="item share" @click="fnOnShare()"><text class="iconfont icon-share1"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
</tm-translate>
|
||||
|
||||
<tm-shareSheet @change="fnOnShareChange" :actions="share.list" title="分享文章" v-model="share.show"></tm-shareSheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmShareSheet from '@/tm-vuetify/components/tm-shareSheet/tm-shareSheet.vue';
|
||||
export default {
|
||||
name: 'bottom-tool-bar',
|
||||
components: {
|
||||
tmTranslate,
|
||||
tmShareSheet
|
||||
},
|
||||
props: {
|
||||
// 文章数据
|
||||
post: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
// 其他参数
|
||||
params: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
share: {
|
||||
show: false,
|
||||
list: [
|
||||
[
|
||||
{ name: '微信好友', bgcolor: '#07c160', icon: 'icon-weixin', color: 'white' },
|
||||
{ name: '朋友圈', bgcolor: '#04c887', icon: 'icon-pengyouquan', color: 'white' },
|
||||
{ name: '生成海报', bgcolor: '#1dc0fd', icon: 'icon-QQ', color: 'white' }
|
||||
]
|
||||
]
|
||||
},
|
||||
tempPost: {}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
post: {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
console.log('watch', val);
|
||||
this.tempPost = this.$utils.deepClone(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.post);
|
||||
this.tempPost = this.$utils.deepClone(this.post);
|
||||
console.log(this.tempPost);
|
||||
},
|
||||
methods: {
|
||||
fnToComment() {
|
||||
this.$Router.push({
|
||||
path: '/pagesA/comment/comment',
|
||||
query: {
|
||||
postId: this.post.id,
|
||||
parentId: 0,
|
||||
title: this.post.title,
|
||||
formPage: 'comment_list',
|
||||
type: 'post'
|
||||
}
|
||||
});
|
||||
},
|
||||
fnDoLikes() {
|
||||
this.$httpApi
|
||||
.postLikePost(this.post.id)
|
||||
.then(res => {
|
||||
if (res.status == 200) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '点赞成功'
|
||||
});
|
||||
this.tempPost.likes += 1;
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
});
|
||||
});
|
||||
},
|
||||
fnOnShare() {
|
||||
// this.$emit('on-share');
|
||||
this.share.show = true;
|
||||
},
|
||||
fnOnShareChange(e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.bottom-tool-bar {
|
||||
width: 100vw;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 401;
|
||||
|
||||
::v-deep {
|
||||
.tm-shareSheet-wk .uni-scroll-view-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 24rpx;
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0rpx -4rpx 24rpx rgba(0, 0, 0, 0.07);
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
.input {
|
||||
width: 280rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 60rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
.icon {
|
||||
}
|
||||
.text {
|
||||
padding-left: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 0;
|
||||
flex-grow: 1;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-left: 24rpx;
|
||||
.item {
|
||||
margin-left: 24rpx;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&.share {
|
||||
.iconfont {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
.iconfont {
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
}
|
||||
.text {
|
||||
padding-left: 6rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,197 +1,198 @@
|
||||
<template>
|
||||
<view class="cache-image-wrap">
|
||||
<view v-if="loadStatus == 'loading'" class="img-loading" :style="[imgStyle, loadStyle]">
|
||||
<!-- <text class="img-load-icon iconfont icon-loading"></text>
|
||||
<text class="img-load-text">{{ loadText }}</text> -->
|
||||
<image :src="loadingImgSrc" :style="[loadingImgStyle]" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view v-if="loadStatus == 'error'" class="img-error" :style="[imgStyle, loadErrStyle]">
|
||||
<!-- <text class="img-err-icon iconfont icon-exclamation-circle"></text>
|
||||
<text class="img-load-text">{{ loadErrText }}</text> -->
|
||||
<image class="img-error-img" :src="loadingErrorImageSrc" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<image v-show="loadStatus == 'success'" :src="src" @load="fnOnLoad" @error="fnOnError" :lazy-load="lazyLoad"
|
||||
:style="[imgStyle]" :mode="mode" @click="$emit('on-click', url)"></image>
|
||||
</view>
|
||||
<view class="cache-image-wrap">
|
||||
<view v-if="loadStatus == 'loading'" class="img-loading" :style="[imgStyle, loadStyle]">
|
||||
<!-- <text class="img-load-icon iconfont icon-loading"></text>
|
||||
<text class="img-load-text">{{ loadText }}</text> -->
|
||||
<image :src="loadingImgSrc" :style="[loadingImgStyle]" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view v-if="loadStatus == 'error'" class="img-error" :style="[imgStyle, loadErrStyle]">
|
||||
<!-- <text class="img-err-icon iconfont icon-exclamation-circle"></text>
|
||||
<text class="img-load-text">{{ loadErrText }}</text> -->
|
||||
<image class="img-error-img" :src="loadingErrorImageSrc" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<image v-show="loadStatus == 'success'" :src="src" @load="fnOnLoad" @error="fnOnError" :lazy-load="lazyLoad"
|
||||
:style="[imgStyle]" :mode="mode" @click="$emit('on-click', url)"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import imageCache from '@/utils/imageCache.js';
|
||||
export default {
|
||||
name: 'cache-image',
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
lazyLoad: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
loadStyle: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {
|
||||
backgroundColor: '#ffffff',
|
||||
color: '#333'
|
||||
};
|
||||
}
|
||||
},
|
||||
loadErrStyle: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {
|
||||
color: 'rgba(244, 67, 54,1)'
|
||||
// backgroundColor: 'rgba(244, 67, 54,0.2)'
|
||||
};
|
||||
}
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'aspectFill'
|
||||
},
|
||||
loadText: {
|
||||
type: String,
|
||||
default: '加载中...'
|
||||
},
|
||||
loadErrText: {
|
||||
type: String,
|
||||
default: '加载失败'
|
||||
},
|
||||
fileMd5: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
styles: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
radius: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgStyle: {},
|
||||
loadingImgStyle: {
|
||||
width: '120rpx',
|
||||
},
|
||||
src: '', // 图片地址
|
||||
loadStatus: 'loading'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
imagesConfig() {
|
||||
return this.$tm.vx.getters().getConfigs.imagesConfig
|
||||
},
|
||||
loadingImgSrc() {
|
||||
return this.imagesConfig.loadingGifUrl;
|
||||
},
|
||||
loadingErrorImageSrc() {
|
||||
return this.imagesConfig.loadingErrUrl
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听图片md5值的变化
|
||||
fileMd5(val) {
|
||||
// 查找获取图片缓存
|
||||
this.fnGetImageCache();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.imgStyle = {
|
||||
width: this.width,
|
||||
height: this.height,
|
||||
borderRadius: this.radius,
|
||||
...this.styles
|
||||
};
|
||||
import imageCache from '@/utils/imageCache.js';
|
||||
|
||||
// 查找获取图片缓存
|
||||
this.fnGetImageCache();
|
||||
},
|
||||
methods: {
|
||||
// 查找获取图片缓存
|
||||
async fnGetImageCache() {
|
||||
// #ifdef APP-PLUS
|
||||
var result = await imageCache.getImageCache(this.url, this.fileMd5);
|
||||
if (result) {
|
||||
this.src = result;
|
||||
} else {
|
||||
this.src = this.url;
|
||||
}
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
this.src = this.url;
|
||||
// #endif
|
||||
},
|
||||
fnOnLoad() {
|
||||
this.loadStatus = 'success';
|
||||
},
|
||||
fnOnError(e) {
|
||||
this.loadStatus = 'error';
|
||||
}
|
||||
}
|
||||
};
|
||||
export default {
|
||||
name: 'cache-image',
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
lazyLoad: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
loadStyle: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
backgroundColor: '#ffffff',
|
||||
color: '#333'
|
||||
};
|
||||
}
|
||||
},
|
||||
loadErrStyle: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
color: 'rgba(244, 67, 54,1)'
|
||||
// backgroundColor: 'rgba(244, 67, 54,0.2)'
|
||||
};
|
||||
}
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'aspectFill'
|
||||
},
|
||||
loadText: {
|
||||
type: String,
|
||||
default: '加载中...'
|
||||
},
|
||||
loadErrText: {
|
||||
type: String,
|
||||
default: '加载失败'
|
||||
},
|
||||
fileMd5: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
styles: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
radius: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgStyle: {},
|
||||
loadingImgStyle: {
|
||||
width: '120rpx',
|
||||
},
|
||||
src: '', // 图片地址
|
||||
loadStatus: 'loading'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
imagesConfig() {
|
||||
return this.$tm.vx.getters().getConfigs.imagesConfig
|
||||
},
|
||||
loadingImgSrc() {
|
||||
return this.$utils.checkImageUrl(this.imagesConfig.loadingGifUrl);
|
||||
},
|
||||
loadingErrorImageSrc() {
|
||||
return this.$utils.checkImageUrl(this.imagesConfig.loadingErrUrl)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听图片md5值的变化
|
||||
fileMd5(val) {
|
||||
// 查找获取图片缓存
|
||||
this.fnGetImageCache();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.imgStyle = {
|
||||
width: this.width,
|
||||
height: this.height,
|
||||
borderRadius: this.radius,
|
||||
...this.styles
|
||||
};
|
||||
|
||||
// 查找获取图片缓存
|
||||
this.fnGetImageCache();
|
||||
},
|
||||
methods: {
|
||||
// 查找获取图片缓存
|
||||
async fnGetImageCache() {
|
||||
// #ifdef APP-PLUS
|
||||
var result = await imageCache.getImageCache(this.url, this.fileMd5);
|
||||
if (result) {
|
||||
this.src = result;
|
||||
} else {
|
||||
this.src = this.url;
|
||||
}
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
this.src = this.url;
|
||||
// #endif
|
||||
},
|
||||
fnOnLoad() {
|
||||
this.loadStatus = 'success';
|
||||
},
|
||||
fnOnError(e) {
|
||||
this.loadStatus = 'error';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.cache-image-wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.cache-image-wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.img-loading,
|
||||
.img-error {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.img-loading,
|
||||
.img-error {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.img-load-icon {
|
||||
font-size: 36rpx;
|
||||
animation: xhRote 0.8s infinite linear;
|
||||
}
|
||||
.img-load-icon {
|
||||
font-size: 36rpx;
|
||||
animation: xhRote 0.8s infinite linear;
|
||||
}
|
||||
|
||||
.img-load-text {
|
||||
font-size: 28rpx;
|
||||
margin-top: 8rpx;
|
||||
color: inherit;
|
||||
}
|
||||
.img-load-text {
|
||||
font-size: 28rpx;
|
||||
margin-top: 8rpx;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.img-error {
|
||||
font-size: 28rpx;
|
||||
.img-error {
|
||||
font-size: 28rpx;
|
||||
|
||||
&-img {
|
||||
width: 100%;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
&-img {
|
||||
width: 100%;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.img-err-icon {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.img-err-icon {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
@keyframes xhRote {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
@keyframes xhRote {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -30,8 +30,7 @@
|
||||
<text class="text-red text-size-s">- 文章已开启禁止评论 -</text>
|
||||
</tm-empty>
|
||||
<tm-empty v-else icon="icon-shiliangzhinengduixiang-" label="暂无评论">
|
||||
<tm-button theme="light-blue" :dense="true" :shadow="0" size="m"
|
||||
@click="fnToComment(null)">抢沙发
|
||||
<tm-button theme="light-blue" :dense="true" :shadow="0" size="m" @click="fnToComment(null)">抢沙发
|
||||
</tm-button>
|
||||
</tm-empty>
|
||||
</view>
|
||||
@@ -146,11 +145,9 @@ export default {
|
||||
return uni.$tm.toast('文章已禁止评论!');
|
||||
}
|
||||
let _comment = {};
|
||||
console.log('data', data)
|
||||
if (data) {
|
||||
let {
|
||||
type,
|
||||
comment
|
||||
} = data;
|
||||
let {type, comment} = data;
|
||||
// 来自用户
|
||||
_comment = {
|
||||
isComment: false,
|
||||
@@ -165,16 +162,14 @@ export default {
|
||||
_comment = {
|
||||
isComment: true,
|
||||
postName: this.post.metadata.name,
|
||||
title: '评论文章:' + this.post.spec.title,
|
||||
title: '新增评论',
|
||||
formPage: 'comment_list',
|
||||
from: 'posts',
|
||||
type: 'post'
|
||||
};
|
||||
}
|
||||
|
||||
this.$emit("on-comment", {
|
||||
_comment
|
||||
})
|
||||
this.$emit("on-comment", _comment)
|
||||
},
|
||||
fnCopyContent(content) {
|
||||
uni.$tm.u.setClipboardData(content);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<tm-poup v-model="isShow" position="bottom" height="71vh" @change="handleOnChange">
|
||||
<view class="title text-align-center">{{ calcTitle }}</view>
|
||||
<tm-form @submit="fnOnSubmit">
|
||||
<tm-input :auto-focus="true" name="content" :vertical="true" required :height="220" input-type="textarea"
|
||||
<tm-input name="content" :vertical="true" required :height="220" input-type="textarea"
|
||||
bg-color="grey-lighten-5" :maxlength="200" :borderBottom="false" placeholder="请输入内容,不超过200字符..."
|
||||
v-model="form.content"></tm-input>
|
||||
<tm-input name="author" align="right" required title="我的昵称" placeholder="请输入您的昵称..."
|
||||
@@ -169,7 +169,7 @@ export default {
|
||||
}
|
||||
this.$httpApi.v2.addPostComment(commentForm)
|
||||
.then(res => {
|
||||
uni.$tm.toast('评论成功!');
|
||||
uni.$tm.toast('评论成功,可能需要审核!');
|
||||
// 更新评论者信息
|
||||
this.handleSetVisitor();
|
||||
this.handleClose(true)
|
||||
@@ -196,7 +196,7 @@ export default {
|
||||
}
|
||||
this.$httpApi.v2.addPostCommentReply(this.form.postName, replyForm)
|
||||
.then(res => {
|
||||
uni.$tm.toast('回复成功!');
|
||||
uni.$tm.toast('回复成功,可能需要审核!');
|
||||
// 更新评论者信息
|
||||
this.handleSetVisitor();
|
||||
this.handleClose(true)
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
<template>
|
||||
<view class="journal-card mb-24 round-3 bg-white ">
|
||||
<view class="head pa-24 pb-0 flex flex-between">
|
||||
<view class="left flex">
|
||||
<cache-image class="avatar rounded" radius="50%" width="70rpx" height="70rpx" :url="bloggerInfo.avatar"
|
||||
:fileMd5="bloggerInfo.avatar" mode="scaleToFill"></cache-image>
|
||||
<view class="info pl-16 flex flex-col">
|
||||
<view class="nickname text-weight-b text-grey-darken-4">{{ bloggerInfo.nickname }}</view>
|
||||
<view class="mt-3 time text-size-m ">
|
||||
{{ $tm.dayjs(journal.createTime).format('YYYY-MM-DD HH:mm:ss') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<tm-button v-if="useLike" :shadow="0" theme="light-blue" size="s"
|
||||
@click="fnLike(journal)">点赞({{ journal.likes }})</tm-button>
|
||||
<tm-button v-if="useEdit" :shadow="0" theme="light-blue" size="s"
|
||||
@click="$emit('on-edit', journal)">编辑</tm-button>
|
||||
<tm-button v-if="useDel" :shadow="0" theme="red" size="s" @click="fnDel(journal)">删除</tm-button>
|
||||
</view>
|
||||
</view>
|
||||
<tm-more v-if="journal.content.length > 50" :maxHeight="100" label="查看全部内容" open-label="隐藏部分内容">
|
||||
<mp-html class="evan-markdown" lazy-load :domain="markdownConfig.domain"
|
||||
:loading-img="markdownConfig.loadingGif" :scroll-table="true" :selectable="true"
|
||||
:tag-style="markdownConfig.tagStyle" :container-style="markdownConfig.containStyle"
|
||||
:content="journal.content" :markdown="true" :showLineNumber="true" :showLanguageName="true"
|
||||
:copyByLongPress="true" />
|
||||
</tm-more>
|
||||
<mp-html v-else class="evan-markdown" lazy-load :domain="markdownConfig.domain"
|
||||
:loading-img="markdownConfig.loadingGif" :scroll-table="true" :selectable="true"
|
||||
:tag-style="markdownConfig.tagStyle" :container-style="markdownConfig.containStyle"
|
||||
:content="journal.content" :markdown="true" :showLineNumber="true" :showLanguageName="true"
|
||||
:copyByLongPress="true" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MarkdownConfig from '@/common/markdown/markdown.config.js';
|
||||
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||
import tmMore from '@/tm-vuetify/components/tm-more/tm-more.vue';
|
||||
export default {
|
||||
name: 'journal-card',
|
||||
components: {
|
||||
mpHtml,
|
||||
tmButton,
|
||||
tmMore
|
||||
},
|
||||
props: {
|
||||
isAdmin: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
journal: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
useLike: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
useEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
useDel: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
markdownConfig: MarkdownConfig
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
bloggerInfo() {
|
||||
let blogger = this.$tm.vx.getters().getConfigs.authorConfig.blogger;
|
||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||
return blogger;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
fnLike(journal) {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '正在点赞中...'
|
||||
});
|
||||
this.$httpApi
|
||||
.postJournalLikes(journal.id)
|
||||
.then(res => {
|
||||
if (res.status == 200) {
|
||||
journal.likes += 1;
|
||||
uni.$tm.toast('o( ̄▽ ̄)d点赞成功!');
|
||||
} else {
|
||||
uni.$tm.toast('Ծ‸Ծ点赞失败了~');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
uni.$tm.toast('Ծ‸Ծ点赞失败了~');
|
||||
});
|
||||
},
|
||||
|
||||
fnDel(journal) {
|
||||
uni.$eShowModal({
|
||||
title: '提示',
|
||||
content: '您确定要删除该日记吗?',
|
||||
showCancel: true,
|
||||
cancelText: '否',
|
||||
cancelColor: '#999999',
|
||||
confirmText: '是',
|
||||
confirmColor: '#03a9f4'
|
||||
})
|
||||
.then(res => {
|
||||
this.$httpApi.admin
|
||||
.deleteJournalsById(journal.id)
|
||||
.then(res => {
|
||||
if (res.status == 200) {
|
||||
this.$emit('on-del', journal);
|
||||
uni.$tm.toast('删除成功!');
|
||||
} else {
|
||||
uni.$tm.toast('Ծ‸Ծ删除失败~');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
uni.$tm.toast('Ծ‸Ծ删除失败~');
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.journal-card {
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||
overflow: hidden;
|
||||
|
||||
.avatar {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
border: 6rpx solid #fff;
|
||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.info {
|
||||
justify-content: center;
|
||||
|
||||
.nickname {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+2
-2
@@ -8,7 +8,7 @@ export const DefaultAppConfigs = {
|
||||
authorConfig: {},
|
||||
appConfig: {},
|
||||
pluginConfig: {},
|
||||
adConfig: {},
|
||||
pageConfig:{}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -19,7 +19,7 @@ export const getAppConfigs = () => {
|
||||
if (configs) return JSON.parse(configs)
|
||||
|
||||
uni.setStorageSync(_AppConfigKey, JSON.stringify(DefaultAppConfigs))
|
||||
return configs;
|
||||
return DefaultAppConfigs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import App from "./App";
|
||||
import Vue from "vue";
|
||||
import {
|
||||
router,
|
||||
RouterMount
|
||||
} from './router/router.js'
|
||||
Vue.use(router)
|
||||
|
||||
// 挂载全局工具类
|
||||
import utils from "./utils/index.js";
|
||||
@@ -75,10 +70,4 @@ const app = new Vue({
|
||||
...App,
|
||||
});
|
||||
|
||||
// #ifdef H5
|
||||
RouterMount(app, router, '#app')
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
|
||||
// #endif
|
||||
app.$mount();
|
||||
|
||||
+24
-26
@@ -1,28 +1,26 @@
|
||||
{
|
||||
"name": "uni-halo",
|
||||
"version": "1.0.0",
|
||||
"description": "<p align=\"center\">\r <img alt=\"logo\" src=\"https://b.925i.cn/uni_halo/uni_halo_logo.png\" width=\"120\" height=\"120\" style=\"margin-bottom: 10px;\">\r </p>\r <h3 align=\"center\" style=\"margin: 30px 0 30px;font-weight: bold;font-size:40px;\">uni-halo</h3>\r <h3 align=\"center\">uni-halo 基于Halo一款现代化的开源博客/CMS系统API开发的可多端编译应用</h3>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitee.com/ialley-workshop-open/uni-halo.git"
|
||||
},
|
||||
"keywords": [
|
||||
"uni-halo",
|
||||
"小莫唐尼",
|
||||
"巷子工坊"
|
||||
],
|
||||
"author": "巷子工坊丨小莫唐尼",
|
||||
"license": "AGPL-3.0",
|
||||
"bugs": {
|
||||
"url": "https://gitee.com/ialley-workshop-open/uni-halo/issues"
|
||||
},
|
||||
"homepage": "https://uni-halo.925i.cn",
|
||||
"devDependencies": {
|
||||
"vue-i18n": "^9.1.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"qs": "^6.12.1",
|
||||
"uni-read-pages": "^1.0.5",
|
||||
"uni-simple-router": "^2.0.8-beta.4"
|
||||
}
|
||||
"name": "uni-halo",
|
||||
"version": "1.0.0",
|
||||
"description": "<p align=\"center\">\r <img alt=\"logo\" src=\"https://b.925i.cn/uni_halo/uni_halo_logo.png\" width=\"120\" height=\"120\" style=\"margin-bottom: 10px;\">\r </p>\r <h3 align=\"center\" style=\"margin: 30px 0 30px;font-weight: bold;font-size:40px;\">uni-halo</h3>\r <h3 align=\"center\">uni-halo 基于Halo一款现代化的开源博客/CMS系统API开发的可多端编译应用</h3>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitee.com/ialley-workshop-open/uni-halo.git"
|
||||
},
|
||||
"keywords": [
|
||||
"uni-halo",
|
||||
"小莫唐尼",
|
||||
"巷子工坊"
|
||||
],
|
||||
"author": "巷子工坊丨小莫唐尼",
|
||||
"license": "AGPL-3.0",
|
||||
"bugs": {
|
||||
"url": "https://gitee.com/ialley-workshop-open/uni-halo/issues"
|
||||
},
|
||||
"homepage": "https://uni-halo.925i.cn",
|
||||
"devDependencies": {
|
||||
"vue-i18n": "^9.1.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"qs": "^6.12.1"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-22
@@ -107,7 +107,7 @@
|
||||
{
|
||||
"path": "article-detail/article-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "文章详情",
|
||||
"navigationBarTitleText": "内容详情",
|
||||
"enablePullDownRefresh": true,
|
||||
"app-plus": {
|
||||
"pullToRefresh": {
|
||||
@@ -163,7 +163,7 @@
|
||||
{
|
||||
"path": "archives/archives",
|
||||
"style": {
|
||||
"navigationBarTitleText": "文章归档",
|
||||
"navigationBarTitleText": "归档",
|
||||
"enablePullDownRefresh": true,
|
||||
"app-plus": {
|
||||
"pullToRefresh": {
|
||||
@@ -186,23 +186,10 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "journal/journal",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人日记",
|
||||
"enablePullDownRefresh": true,
|
||||
"app-plus": {
|
||||
"pullToRefresh": {
|
||||
"color": "#03a9f4",
|
||||
"style": "circle"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "articles/articles",
|
||||
"style": {
|
||||
"navigationBarTitleText": "文章列表",
|
||||
"navigationBarTitleText": "内容搜索",
|
||||
"enablePullDownRefresh": true,
|
||||
"app-plus": {
|
||||
"pullToRefresh": {
|
||||
@@ -273,12 +260,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "test-page/test-page",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "advertise/advertise",
|
||||
"style": {
|
||||
|
||||
+33
-11
@@ -5,24 +5,37 @@
|
||||
<script>
|
||||
const homePagePath = '/pages/tabbar/home/home'
|
||||
const startPagePath = '/pagesA/start/start'
|
||||
const articleDetailPath = '/pagesA/article-detail/article-detail';
|
||||
export default {
|
||||
computed: {
|
||||
configs() {
|
||||
return this.$tm.vx.getters().getConfigs;
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
||||
// #endif
|
||||
this.fnCheckShowStarted();
|
||||
}).catch((err) => {
|
||||
uni.switchTab({
|
||||
url: homePagePath
|
||||
onLoad: function (options) {
|
||||
uni.$tm.vx.actions('config/fetchConfigs').then(async (res) => {
|
||||
if (options.scene) {
|
||||
if ('' !== options.scene) {
|
||||
const postId = await this.getPostIdByQRCode(options.scene);
|
||||
if (postId) {
|
||||
uni.redirectTo({
|
||||
url: articleDetailPath + `?name=${postId}`,
|
||||
animationType: 'slide-in-right'
|
||||
});
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
||||
// #endif
|
||||
this.fnCheckShowStarted();
|
||||
}).catch((err) => {
|
||||
uni.switchTab({
|
||||
url: homePagePath
|
||||
});
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
fnCheckShowStarted() {
|
||||
if (!this.configs.appConfig.startConfig.enabled) {
|
||||
@@ -51,6 +64,15 @@ export default {
|
||||
url: startPagePath
|
||||
});
|
||||
}
|
||||
},
|
||||
async getPostIdByQRCode(key) {
|
||||
const response = await this.$httpApi.v2.getQRCodeInfo(key);
|
||||
if (response) {
|
||||
if(response && response.postId) {
|
||||
return response.postId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.post"
|
||||
:duration="3000"></tm-flop>
|
||||
</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 class="item flex-1 text-align-center">
|
||||
<view class="number text-size-xl text-bg-gradient-green-accent">
|
||||
@@ -132,43 +132,39 @@ export default {
|
||||
haloConfigs() {
|
||||
return this.$tm.vx.getters().getConfigs
|
||||
},
|
||||
calcDefaultImageConfig() {
|
||||
return this.haloConfigs.imagesConfig
|
||||
pageConfig() {
|
||||
return this.haloConfigs.pageConfig.aboutConfig;
|
||||
},
|
||||
postDetailConfig() {
|
||||
return this.haloConfigs.basicConfig.postDetailConfig;
|
||||
},
|
||||
bloggerInfo() {
|
||||
return this.haloConfigs.authorConfig.blogger;
|
||||
},
|
||||
calcProfileStyle() {
|
||||
const _imgUrlOr = this.calcDefaultImageConfig.aboutProfileImageUrl;
|
||||
const _imgUrlOr = this.pageConfig.bgImageUrl;
|
||||
return {
|
||||
backgroundImage: `url(${this.$utils.checkImageUrl(_imgUrlOr)})`
|
||||
}
|
||||
},
|
||||
calcWaveUrl() {
|
||||
return this.$utils.checkImageUrl(this.calcDefaultImageConfig.waveImageUrl);
|
||||
return this.$utils.checkImageUrl(this.pageConfig.waveImageUrl);
|
||||
},
|
||||
copyrightConfig() {
|
||||
return this.haloConfigs.basicConfig.copyrightConfig;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
globalAppSettings: {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
this.statisticsShowMore = val.about.showAllCount;
|
||||
this.fnGetNavList();
|
||||
}
|
||||
},
|
||||
haloConfigs: {
|
||||
handler(val) {
|
||||
if (!val) return;
|
||||
this.fnGetNavList();
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
this.fnGetNavList();
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.statisticsShowMore = this.globalAppSettings.about.showAllCount;
|
||||
this.fnGetData();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
@@ -232,7 +228,7 @@ export default {
|
||||
path: '/pagesA/contact/contact',
|
||||
isAdmin: false,
|
||||
type: 'page',
|
||||
show: true
|
||||
show: this.haloConfigs.authorConfig.social.enabled
|
||||
},
|
||||
{
|
||||
key: 'session',
|
||||
@@ -291,28 +287,28 @@ export default {
|
||||
// type: 'poup',
|
||||
// show: true
|
||||
// },
|
||||
{
|
||||
key: 'setting',
|
||||
title: '应用设置',
|
||||
leftIcon: 'icon-cog',
|
||||
leftIconColor: 'indigo',
|
||||
rightText: `进入系统常用设置`,
|
||||
path: '/pagesA/setting/setting',
|
||||
isAdmin: false,
|
||||
type: 'page',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
key: 'admin',
|
||||
title: '后台管理',
|
||||
leftIcon: 'icon-lock',
|
||||
leftIconColor: 'gray',
|
||||
rightText: '博客后台系统入口',
|
||||
path: '/pagesB/admin/admin',
|
||||
isAdmin: true,
|
||||
type: 'page',
|
||||
show: this.globalAppSettings.about.showAdmin
|
||||
}
|
||||
// {
|
||||
// key: 'setting',
|
||||
// title: '应用设置',
|
||||
// leftIcon: 'icon-cog',
|
||||
// leftIconColor: 'indigo',
|
||||
// rightText: `进入系统常用设置`,
|
||||
// path: '/pagesA/setting/setting',
|
||||
// isAdmin: false,
|
||||
// type: 'page',
|
||||
// show: false
|
||||
// },
|
||||
// {
|
||||
// key: 'admin',
|
||||
// title: '后台管理',
|
||||
// leftIcon: 'icon-lock',
|
||||
// leftIconColor: 'gray',
|
||||
// rightText: '博客后台系统入口',
|
||||
// path: '/pagesB/admin/admin',
|
||||
// isAdmin: true,
|
||||
// type: 'page',
|
||||
// show: false
|
||||
// }
|
||||
];
|
||||
},
|
||||
fnGetData() {
|
||||
@@ -406,9 +402,9 @@ export default {
|
||||
break;
|
||||
}
|
||||
} else if (type == 'page') {
|
||||
this.$Router.push({
|
||||
path: path
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: path
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -62,7 +62,11 @@
|
||||
loadMoreText: '加载中...'
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
haloConfigs() {
|
||||
return this.$tm.vx.getters().getConfigs;
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
this.fnGetData();
|
||||
},
|
||||
@@ -86,6 +90,9 @@
|
||||
},
|
||||
methods: {
|
||||
fnGetData() {
|
||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中...'
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<!-- 占位区域 -->
|
||||
<view v-if="category.list.length > 0" style="width: 100vw;height: 90rpx;"></view>
|
||||
<!-- 加载区域 -->
|
||||
<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="card"></tm-skeleton>
|
||||
@@ -16,17 +16,23 @@
|
||||
</view>
|
||||
<!-- 内容区域 -->
|
||||
<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>
|
||||
</view>
|
||||
<block v-else>
|
||||
<block v-for="(item, index) in dataList" :key="index">
|
||||
<tm-translate style="box-sizing: border-box;padding: 6rpx;width: 50%;height: 250rpx;"
|
||||
<block v-if="galleryConfig.useWaterfall">
|
||||
<!--瀑布流-->
|
||||
<tm-flowLayout-custom ref="wafll" style="width: 100%;" @click="fnOnFlowClick"></tm-flowLayout-custom>
|
||||
</block>
|
||||
<!-- 列表 -->
|
||||
<block v-else>
|
||||
<tm-translate v-for="(item, index) in dataList" :key="index"
|
||||
style="box-sizing: border-box;padding: 6rpx;width: 50%;height: 250rpx;"
|
||||
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||
<view style="border-radius: 12rpx;overflow: hidden;width: 100%;height: 250rpx;">
|
||||
<image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.cover"
|
||||
@click="fnPreview(index)"/>
|
||||
<image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.url"
|
||||
@click="fnPreview(item)"/>
|
||||
</view>
|
||||
</tm-translate>
|
||||
</block>
|
||||
@@ -34,6 +40,7 @@
|
||||
<tm-flotbutton @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||
<view class="load-text">{{ loadMoreText }}</view>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -46,10 +53,13 @@ import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
||||
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
||||
import tmFlowLayout from '@/tm-vuetify/components/tm-flowLayout/tm-flowLayout.vue';
|
||||
import tmFlowLayoutCustom from '@/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue';
|
||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||
|
||||
export default {
|
||||
options: {
|
||||
multipleSlots: true
|
||||
},
|
||||
components: {
|
||||
tmSkeleton,
|
||||
tmTranslate,
|
||||
@@ -58,7 +68,7 @@ export default {
|
||||
tmEmpty,
|
||||
tmIcons,
|
||||
tmImages,
|
||||
tmFlowLayout,
|
||||
tmFlowLayoutCustom,
|
||||
tmTabs
|
||||
},
|
||||
data() {
|
||||
@@ -75,36 +85,39 @@ export default {
|
||||
page: 1,
|
||||
group: ""
|
||||
},
|
||||
cache: {
|
||||
dataList: [],
|
||||
total: 0
|
||||
},
|
||||
isLoadMore: false,
|
||||
loadMoreText: '',
|
||||
hasNext: false,
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
filterTakeTime(val) {
|
||||
return uni.$tm.dayjs(val).format('DD/MM/YYYY');
|
||||
computed: {
|
||||
galleryConfig() {
|
||||
return this.$tm.vx.getters().getConfigs.pageConfig.galleryConfig;
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.fnSetPageTitle('个人图库');
|
||||
this.fnGetCategory();
|
||||
watch: {
|
||||
galleryConfig: {
|
||||
handler(newValue, oldValue) {
|
||||
if (!newValue) return;
|
||||
this.fnSetPageTitle(newValue.pageTitle);
|
||||
this.fnGetCategory();
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.dataList = []
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 1;
|
||||
this.fnGetData();
|
||||
this.fnGetData(true);
|
||||
},
|
||||
onReachBottom(e) {
|
||||
if (this.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetData();
|
||||
this.fnGetData(false);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
@@ -115,17 +128,16 @@ export default {
|
||||
methods: {
|
||||
fnOnCategoryChange(index) {
|
||||
this.fnResetSetAniWaitIndex();
|
||||
this.cache.dataList = []
|
||||
this.dataList = [];
|
||||
this.queryParams.group = this.category.list[index].name;
|
||||
this.queryParams.page = 1;
|
||||
this.fnToTopPage();
|
||||
this.fnGetData();
|
||||
this.dataList = [];
|
||||
this.fnGetData(true);
|
||||
},
|
||||
fnGetCategory() {
|
||||
this.$httpApi.v2.getPhotoGroupList({
|
||||
page: 1,
|
||||
size: 9999
|
||||
size: 0
|
||||
}).then(res => {
|
||||
this.category.list = res.items.map(item => {
|
||||
return {
|
||||
@@ -135,12 +147,11 @@ export default {
|
||||
});
|
||||
if (this.category.list.length !== 0) {
|
||||
this.queryParams.group = this.category.list[0].name;
|
||||
this.fnGetData();
|
||||
this.fnGetData(true);
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
fnGetData() {
|
||||
fnGetData(isClearWallfull = false) {
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
@@ -149,28 +160,32 @@ export default {
|
||||
this.$httpApi.v2
|
||||
.getPhotoListByGroupName(this.queryParams)
|
||||
.then(res => {
|
||||
console.log("相册 res", res)
|
||||
this.hasNext = res.hasNext;
|
||||
this.loading = 'success';
|
||||
if (res.items.length != 0) {
|
||||
if (res.items.length !== 0) {
|
||||
const _list = res.items.map((item, index) => {
|
||||
item.spec.cover = this.$utils.checkImageUrl(item.spec.cover);
|
||||
item.spec.url = this.$utils.checkImageUrl(item.spec.url || item.spec.cover);
|
||||
return item;
|
||||
});
|
||||
this.fnCacheDataList(_list);
|
||||
if (this.isLoadMore) {
|
||||
this.dataList = this.dataList.concat(_list);
|
||||
} else {
|
||||
this.dataList = _list;
|
||||
}
|
||||
if (this.galleryConfig.useWaterfall) {
|
||||
this.$nextTick(() => {
|
||||
if(isClearWallfull){
|
||||
this.$refs.wafll.clear()
|
||||
}
|
||||
this.$refs.wafll.pushData(_list)
|
||||
})
|
||||
}
|
||||
}
|
||||
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
this.waterfall.loading = 'finish';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -180,24 +195,14 @@ export default {
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
// 缓存数据
|
||||
fnCacheDataList(dataList) {
|
||||
if (this.queryParams.page == 1) {
|
||||
this.cache.dataList = dataList;
|
||||
} else {
|
||||
this.cache.dataList = [...this.cache.dataList, ...dataList];
|
||||
}
|
||||
},
|
||||
|
||||
// 瀑布流组件点击事件
|
||||
fnOnClick(data) {
|
||||
console.log('点击数据', data);
|
||||
fnOnFlowClick({item}) {
|
||||
this.fnPreview(item)
|
||||
},
|
||||
// 预览
|
||||
fnPreview(index) {
|
||||
fnPreview(data) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: this.dataList.map(x => x.spec.cover),
|
||||
current: this.dataList.findIndex(x => x.metadata.name === data.metadata.name),
|
||||
urls: this.dataList.map(x => x.spec.url),
|
||||
indicator: 'number',
|
||||
loop: true
|
||||
});
|
||||
@@ -214,18 +219,13 @@ export default {
|
||||
flex-direction: column;
|
||||
padding-bottom: 24rpx;
|
||||
background-color: #fafafa;
|
||||
|
||||
&.is-balck {
|
||||
background-color: #212121;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
padding: 0 24rpx;
|
||||
padding-top: 24rpx;
|
||||
padding: 24rpx 24rpx 0;
|
||||
gap: 12rpx 0;
|
||||
|
||||
.content-empty {
|
||||
@@ -242,10 +242,6 @@ export default {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.load-text {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
|
||||
+23
-16
@@ -2,14 +2,14 @@
|
||||
<view class="app-page">
|
||||
<tm-menubars iconColor="white" color="white" :flat="true" :showback="false">
|
||||
<view slot="left">
|
||||
<image class="logo ml-24 round-24" :src="appInfo.logo" mode="scaleToFill"/>
|
||||
<image @click="fnOnLogoToPage" class="logo ml-24 round-24" :src="appInfo.logo" mode="scaleToFill"/>
|
||||
</view>
|
||||
<view class="search-input round-12 pt-12 pb-12 flex pl-24" @click="fnToSearch">
|
||||
<text class="search-input_icon iconfont text-size-m icon-search text-grey"></text>
|
||||
<view class="search-input_text pl-12 text-size-m text-grey">搜索文章...</view>
|
||||
<view class="search-input_text pl-12 text-size-m text-grey">搜索内容...</view>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS || H5 -->
|
||||
<view slot="right" class="mr-24 text-size-m text-grey">uni-halo</view>
|
||||
<view slot="right" class="mr-24 text-size-m text-grey">{{ appInfo.name }}</view>
|
||||
<!-- #endif -->
|
||||
</tm-menubars>
|
||||
<view v-if="loading !== 'success' && articleList.length===0" class="loading-wrap">
|
||||
@@ -40,7 +40,7 @@
|
||||
</view>
|
||||
<scroll-view class="category" scroll-x="true">
|
||||
<view v-if="categoryList.length == 0" class="cate-empty round-3 mr-5 flex flex-center text-grey">
|
||||
还没有任何文章分类~
|
||||
还没有任何分类~
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="content" v-for="(category, index) in categoryList" :key="category.metadata.name"
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<!-- 最新文章 -->
|
||||
<view class="flex flex-between mt-24 mb-24 pl-24 pr-24">
|
||||
<view class="page-item_title text-weight-b">文章列表</view>
|
||||
<view class="page-item_title text-weight-b">最新列表</view>
|
||||
<view class="show-more flex flex-center bg-white round-3" @click="fnToArticlesPage">
|
||||
<text class="iconfont icon-angle-right text-size-s text-grey-darken-1"></text>
|
||||
</view>
|
||||
@@ -62,8 +62,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="articleList.length == 0" class="article-empty">
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-"
|
||||
label="博主还没有发表任何文章~"></tm-empty>
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有发表任何内容~"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<view :class="globalAppSettings.layout.home">
|
||||
@@ -168,6 +167,9 @@ export default {
|
||||
},
|
||||
|
||||
fnGetCategoryList() {
|
||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
||||
return;
|
||||
}
|
||||
this.$httpApi.v2
|
||||
.getCategoryList({})
|
||||
.then(res => {
|
||||
@@ -192,6 +194,9 @@ export default {
|
||||
},
|
||||
// 获取轮播图
|
||||
fnGetBanner() {
|
||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
||||
return;
|
||||
}
|
||||
const _this = this;
|
||||
const _format = function (list) {
|
||||
return list.map((item, index) => {
|
||||
@@ -199,12 +204,12 @@ export default {
|
||||
mp4: '',
|
||||
id: item.metadata.name,
|
||||
nickname: item.owner.displayName,
|
||||
avatar: _this.$utils.checkImageUrl(item.owner.avatar),
|
||||
avatar: _this.$utils.checkAvatarUrl(item.owner.avatar),
|
||||
address: '',
|
||||
createTime: uni.$tm.dayjs(item.spec.publishTime).fromNow(),
|
||||
title: item.spec.title,
|
||||
src: _this.$utils.checkImageUrl(item.spec.cover),
|
||||
image: _this.$utils.checkImageUrl(item.spec.cover)
|
||||
src: _this.$utils.checkThumbnailUrl(item.spec.cover),
|
||||
image: _this.$utils.checkThumbnailUrl(item.spec.cover)
|
||||
};
|
||||
});
|
||||
};
|
||||
@@ -219,7 +224,6 @@ export default {
|
||||
uni.request({
|
||||
url: this.$baseApiUrl + '/apis/api.content.halo.run/v1alpha1/posts?' + paramsStr,
|
||||
method: 'GET',
|
||||
params: this.queryParams,
|
||||
success: (res) => {
|
||||
this.bannerList = _format(res.data.items);
|
||||
},
|
||||
@@ -241,10 +245,9 @@ export default {
|
||||
},
|
||||
// 文章列表
|
||||
fnGetArticleList() {
|
||||
// uni.showLoading({
|
||||
// mask: true,
|
||||
// title: '加载中...'
|
||||
// });
|
||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
||||
return;
|
||||
}
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
@@ -261,7 +264,6 @@ export default {
|
||||
uni.request({
|
||||
url: this.$baseApiUrl + '/apis/api.content.halo.run/v1alpha1/posts?' + paramsStr,
|
||||
method: 'GET',
|
||||
params: this.queryParams,
|
||||
success: (res) => {
|
||||
const data = res.data;
|
||||
this.result.hasNext = data.hasNext;
|
||||
@@ -339,6 +341,11 @@ export default {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/articles/articles'
|
||||
});
|
||||
},
|
||||
fnOnLogoToPage() {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/about/about'
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
<template>
|
||||
<view class="app-page">
|
||||
<view v-if="loading != 'success'" class="loading-wrap">
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
</view>
|
||||
<!-- 内容区域 -->
|
||||
<view v-else class="app-page-content">
|
||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center">
|
||||
<!-- 空布局 -->
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="该分类下暂无数据"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<block v-for="(item, index) in dataList" :key="index">
|
||||
<!-- 卡片 -->
|
||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
||||
<!-- 列表项 -->
|
||||
{{ item }}
|
||||
</tm-translate>
|
||||
</block>
|
||||
<tm-flotbutton @click="fnToTopPage" size="m" color="light-blue" icon="icon-angle-up"></tm-flotbutton>
|
||||
<view class="load-text">{{ loadMoreText }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
export default {
|
||||
components: {
|
||||
tmSkeleton,
|
||||
tmFlotbutton,
|
||||
tmTranslate,
|
||||
tmEmpty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: 'loading',
|
||||
queryParams: {
|
||||
size: 10,
|
||||
page: 0
|
||||
},
|
||||
result: null,
|
||||
dataList: [],
|
||||
hasNext:false,
|
||||
isLoadMore: false,
|
||||
loadMoreText: '加载中...'
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.fnSetPageTitle();
|
||||
},
|
||||
created() {
|
||||
this.fnGetData();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 0;
|
||||
this.fnGetData();
|
||||
},
|
||||
|
||||
onReachBottom(e) {
|
||||
if (this.result.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetData();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnGetData() {
|
||||
return;
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中...'
|
||||
});
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '加载中...';
|
||||
this.$httpApi
|
||||
.getXXX(this.queryParams)
|
||||
.then(res => {
|
||||
console.log('请求结果:');
|
||||
console.log(res);
|
||||
|
||||
this.loading = 'success';
|
||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
// 处理数据
|
||||
this.result = res.data;
|
||||
if (this.isLoadMore) {
|
||||
this.dataList = this.dataList.concat(res.data.content);
|
||||
} else {
|
||||
this.dataList = res.data.content;
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 24rpx 0;
|
||||
padding-bottom: 144rpx;
|
||||
}
|
||||
.loading-wrap {
|
||||
padding: 24rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -55,8 +55,8 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
adConfigs() {
|
||||
return this.$tm.vx.getters().getConfigs.adConfig;
|
||||
toolsPluginConfigs() {
|
||||
return this.$tm.vx.getters().getConfigs?.pluginConfig?.toolsPlugin || {};
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
adLoad() {
|
||||
if (wx.createRewardedVideoAd) {
|
||||
videoAd = wx.createRewardedVideoAd({
|
||||
adUnitId: this.adConfigs.rewardedVideoAdId //你的广告key
|
||||
adUnitId: this.toolsPluginConfigs.rewardedVideoAdId //你的广告key
|
||||
})
|
||||
videoAd.onError(err => {
|
||||
})
|
||||
@@ -91,7 +91,7 @@ export default {
|
||||
}
|
||||
},
|
||||
openVideoAd: function () {
|
||||
if (videoAd && this.adConfigs.rewardedVideoAdId != '') {
|
||||
if (videoAd && this.toolsPluginConfigs.rewardedVideoAdId !== '') {
|
||||
videoAd.show().catch(err => {
|
||||
// 失败重试
|
||||
console.log("广告拉取失败")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="app-page">
|
||||
<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="card"></tm-skeleton>
|
||||
@@ -29,7 +29,7 @@
|
||||
<text class="value">{{ result.stats.upvote }}</text>
|
||||
<text class="label">喜欢</text>
|
||||
</view>
|
||||
<view class="count-item">
|
||||
<view v-if="postDetailConfig && postDetailConfig.showComment" class="count-item">
|
||||
<text class="value">{{ result.stats.comment }}</text>
|
||||
<text class="label">评论</text>
|
||||
</view>
|
||||
@@ -44,7 +44,7 @@
|
||||
<view class="category">
|
||||
<view class="category-type">
|
||||
<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>
|
||||
<text class="category-tag" v-for="(item, index) in result.categories" :key="index"
|
||||
@click="fnToCate(item)">
|
||||
@@ -54,7 +54,7 @@
|
||||
</view>
|
||||
<view class="mt-18 category-type">
|
||||
<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>
|
||||
<text class="category-tag" :style="{ backgroundColor: item.color }"
|
||||
v-for="(item, index) in result.tags" :key="index" @click="fnToTag(item)">
|
||||
@@ -145,12 +145,12 @@
|
||||
</view>
|
||||
|
||||
<scroll-view :scroll-y="true" class="poup-body">
|
||||
<view v-if="commentDetail.loading != 'success'" class="poup-loading-wrap flex flex-center">
|
||||
<view v-if="commentDetail.loading == 'loading'" class="loading flex flex-center flex-col">
|
||||
<view v-if="commentDetail.loading !== 'success'" class="poup-loading-wrap flex flex-center">
|
||||
<view v-if="commentDetail.loading === 'loading'" class="loading flex flex-center flex-col">
|
||||
<text class="e-loading-icon iconfont icon-loading text-blue"></text>
|
||||
<view class="text-size-n text-grey-lighten-1 py-12 mt-12">加载中,请稍等...</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-button theme="bg-gradient-light-blue-accent" size="m" @click="fnGetChildComments()">
|
||||
刷新试试
|
||||
@@ -232,8 +232,7 @@ import commentModal from '@/components/comment-modal/comment-modal.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';
|
||||
import {getAppConfigs} from '@/config/index.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -251,7 +250,6 @@ export default {
|
||||
barrage,
|
||||
commentModal
|
||||
},
|
||||
mixins: [haloWxShareMixin],
|
||||
data() {
|
||||
return {
|
||||
loading: 'loading',
|
||||
@@ -320,11 +318,7 @@ export default {
|
||||
|
||||
// 原文链接:个人资质=可以打开公众号文章;非个人:任意链接地址(需在小程序后台配置)
|
||||
originalURL() {
|
||||
if ('unihalo_originalURL' in this.result?.metadata?.annotations) {
|
||||
return this.result?.metadata?.annotations?.unihalo_originalURL;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
return this.result?.metadata?.annotations?.unihalo_originalURL || ""
|
||||
},
|
||||
|
||||
calcIsShowComment() {
|
||||
@@ -365,7 +359,9 @@ export default {
|
||||
}
|
||||
const visitFlag = uni.getStorageSync('visit_' + this.result?.metadata?.name);
|
||||
|
||||
if (!visitFlag) {
|
||||
const toolsPluginEnabled = getAppConfigs().pluginConfig.toolsPlugin?.enabled;
|
||||
|
||||
if (toolsPluginEnabled && !visitFlag) {
|
||||
const annotationsMap = res?.metadata?.annotations;
|
||||
if (('restrictReadEnable' in annotationsMap) && annotationsMap.restrictReadEnable ===
|
||||
'true') {
|
||||
@@ -394,15 +390,6 @@ export default {
|
||||
|
||||
this.fnSetPageTitle('文章详情');
|
||||
this.loading = 'success';
|
||||
this.fnSetWxShareConfig({
|
||||
title: this.result.spec.title,
|
||||
desc: this.result.content.raw,
|
||||
imageUrl: this.$utils.checkThumbnailUrl(this.result.spec.cover),
|
||||
path: `/pagesA/article-detail/article-detail?name=${this.result.metadata.name}`,
|
||||
copyLink: this.$baseApiUrl,
|
||||
query: {}
|
||||
});
|
||||
|
||||
})
|
||||
.catch(err => {
|
||||
console.log("错误", err)
|
||||
@@ -457,12 +444,12 @@ export default {
|
||||
}
|
||||
this.commentModal.isComment = true;
|
||||
this.commentModal.postName = this.result.metadata.name;
|
||||
this.commentModal.title = this.result.spec.title;
|
||||
this.commentModal.title = "新增评论";
|
||||
this.commentModal.show = true;
|
||||
},
|
||||
fnOnComment(data) {
|
||||
this.commentModal.isComment = data.isComment;
|
||||
this.commentModal.postName = data.name;
|
||||
this.commentModal.postName = data.postName;
|
||||
this.commentModal.title = data.title;
|
||||
this.commentModal.show = true;
|
||||
},
|
||||
@@ -629,7 +616,7 @@ export default {
|
||||
});
|
||||
await this.$refs.rCanvas
|
||||
.drawText({
|
||||
text: this.result.content.raw,
|
||||
text: this.result?.status?.excerpt || "文章暂无摘要信息",
|
||||
max_width: 312,
|
||||
line_clamp: 2,
|
||||
x: 12,
|
||||
@@ -647,9 +634,10 @@ export default {
|
||||
|
||||
this.drawDashedLine(this.$refs.rCanvas.ctx, 14, 356, 332, 0.5, [8, 5, 5, 5], '#999');
|
||||
// 小程序信息
|
||||
const _qrCodeImageUrl = await this.qrCodeImageUrl();
|
||||
await this.$refs.rCanvas
|
||||
.drawImage({
|
||||
url: this.$utils.checkImageUrl(this.haloConfig.imagesConfig.miniCodeImageUrl),
|
||||
url: this.$utils.checkImageUrl(_qrCodeImageUrl),
|
||||
x: 20,
|
||||
y: 360,
|
||||
w: 80,
|
||||
@@ -940,6 +928,16 @@ export default {
|
||||
return;
|
||||
}
|
||||
},
|
||||
async qrCodeImageUrl() {
|
||||
const useDynamicQRCode = this.haloConfigs?.appConfig?.appInfo?.useDynamicQRCode;
|
||||
if (useDynamicQRCode) {
|
||||
const qrCodeImg = await this.$httpApi.v2.getQRCodeImg(this.result.metadata.name);
|
||||
return qrCodeImg;
|
||||
} else {
|
||||
return this.haloConfigs?.appConfig?.appInfo?.qrCodeImageUrl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
<!-- 空布局 -->
|
||||
<tm-empty v-if="!queryParams.keyword" icon="icon-shiliangzhinengduixiang-" label="请输入关键词搜索"></tm-empty>
|
||||
<tm-empty v-else icon="icon-shiliangzhinengduixiang-"
|
||||
:label="`未搜到 ${queryParams.keyword} 相关文章`"></tm-empty>
|
||||
:label="`未搜到 ${queryParams.keyword} 相关内容`"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 文章卡片 -->
|
||||
<tm-translate v-for="(article, index) in dataList" :key="article.name" animation-name="fadeUp"
|
||||
<tm-translate v-for="(article, index) in dataList" :key="article.metadataName" animation-name="fadeUp"
|
||||
:wait="calcAniWait(index)">
|
||||
<view class="article-card" @click="fnToArticleDetail(article)">
|
||||
<rich-text style="font-size: 32rpx;font-weight: bold;color: #333;"
|
||||
@@ -34,13 +34,13 @@
|
||||
<rich-text style="font-size: 28rpx;margin-top: 16rpx;color: #555;"
|
||||
:nodes="article.content"></rich-text>
|
||||
<text style="font-size: 24rpx;margin-top: 24rpx;color:#888">
|
||||
发布日期:{{ {d: article.publishTimestamp, f: 'yyyy年MM月dd日'} | formatTime }}
|
||||
最近更新:{{ {d: article.updateTimestamp, f: 'yyyy年MM月dd日 HH点mm分ss秒'} | formatTime }}
|
||||
</text>
|
||||
</view>
|
||||
</tm-translate>
|
||||
|
||||
<tm-flotbutton @click="fnToTopPage" size="m" color="light-blue" icon="icon-angle-up"></tm-flotbutton>
|
||||
<view class="load-text">{{ loadMoreText }}</view>
|
||||
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
@@ -81,14 +81,16 @@ export default {
|
||||
dataList: [],
|
||||
total: 0
|
||||
},
|
||||
hasNext: false,
|
||||
isLoadMore: false,
|
||||
loadMoreText: '加载中...',
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
haloConfigs() {
|
||||
return this.$tm.vx.getters().getConfigs;
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
this.fnSetPageTitle('文章列表');
|
||||
this.fnSetPageTitle('内容搜索');
|
||||
},
|
||||
created() {
|
||||
if (!this.queryParams.keyword) {
|
||||
@@ -99,7 +101,6 @@ export default {
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.fnResetSetAniWaitIndex();
|
||||
this.isLoadMore = false;
|
||||
this.fnGetData();
|
||||
},
|
||||
|
||||
@@ -121,7 +122,7 @@ export default {
|
||||
},
|
||||
fnOnSearch() {
|
||||
this.fnResetSetAniWaitIndex();
|
||||
this.isLoadMore = false;
|
||||
|
||||
if (!this.queryParams.keyword) {
|
||||
this.dataList = []
|
||||
} else {
|
||||
@@ -129,34 +130,20 @@ export default {
|
||||
}
|
||||
},
|
||||
fnGetData() {
|
||||
// uni.showLoading({
|
||||
// mask: true,
|
||||
// title: '加载中...'
|
||||
// });
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
||||
return;
|
||||
}
|
||||
this.loadMoreText = '加载中...';
|
||||
// 设置状态为加载中
|
||||
this.loading = 'loading';
|
||||
this.$httpApi.v2
|
||||
.getPostListByKeyword(this.queryParams)
|
||||
.then(res => {
|
||||
console.log('请求结果:');
|
||||
console.log(res);
|
||||
|
||||
this.loading = 'success';
|
||||
this.loadMoreText = res.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
this.hasNext = res.hasNext;
|
||||
if (this.isLoadMore) {
|
||||
this.dataList = this.dataList.concat(res.hits);
|
||||
} else {
|
||||
this.dataList = res.hits;
|
||||
}
|
||||
this.dataList = res.hits;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
@@ -169,7 +156,7 @@ export default {
|
||||
//跳转文章详情
|
||||
fnToArticleDetail(article) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/article-detail/article-detail?name=' + article.name,
|
||||
url: '/pagesA/article-detail/article-detail?name=' + article.metadataName,
|
||||
animationType: 'slide-in-right'
|
||||
});
|
||||
}
|
||||
|
||||
+29
-19
@@ -26,7 +26,6 @@
|
||||
<!-- 社交联系方式列表 -->
|
||||
<view class="contact ma-50 mt-0 pt-12">
|
||||
<block v-if="calcIsNotEmpty">
|
||||
|
||||
<block v-for="(item, index) in result" :key="index">
|
||||
<view v-if="item.value" class="item mt-24 flex" @click="fnOnClick(item)">
|
||||
<view class="left">
|
||||
@@ -37,9 +36,9 @@
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<view v-else class="mt-12 pt-12">
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无联系方式"/>
|
||||
</view>
|
||||
<view v-else class="mt-12 pt-12">
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无联系方式"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -137,36 +136,47 @@ export default {
|
||||
return blogger;
|
||||
},
|
||||
socialConfig() {
|
||||
return this.authorConfig.social
|
||||
return this.authorConfig.social;
|
||||
},
|
||||
calcIsNotEmpty() {
|
||||
return this.result.some((item) => item.value !== "");
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
socialConfig: {
|
||||
handler(newVal) {
|
||||
if (!newVal) return;
|
||||
this.fnGetData();
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.fnSetPageTitle('联系博主');
|
||||
},
|
||||
created() {
|
||||
this.fnGetData();
|
||||
},
|
||||
methods: {
|
||||
fnGetData() {
|
||||
for (let key in this.socialConfig) {
|
||||
if (key === 'enabled') {
|
||||
continue;
|
||||
}
|
||||
this.result.find(x => x.key === key).value = this.socialConfig[key];
|
||||
}
|
||||
},
|
||||
fnOnClick(item) {
|
||||
if (this.globalAppSettings.contact.isLinkCopy && this.$utils.checkIsUrl(item.value)) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesC/website/website?data=' +
|
||||
JSON.stringify({
|
||||
title: item.name,
|
||||
url: item.value
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.$utils.copyText(item.value, item.name + ' 已复制!');
|
||||
}
|
||||
this.$utils.copyText(item.value, item.name + ' 已复制!');
|
||||
// if (this.globalAppSettings.contact.isLinkCopy && this.$utils.checkIsUrl(item.value)) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pagesC/website/website?data=' +
|
||||
// JSON.stringify({
|
||||
// title: item.name,
|
||||
// url: item.value
|
||||
// })
|
||||
// });
|
||||
// } else {
|
||||
// this.$utils.copyText(item.value, item.name + ' 已复制!');
|
||||
// }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -152,6 +152,9 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
haloConfigs() {
|
||||
return this.$tm.vx.getters().getConfigs;
|
||||
},
|
||||
haloPluginConfigs() {
|
||||
return this.$tm.vx.getters().getConfigs.pluginConfig;
|
||||
},
|
||||
@@ -207,6 +210,9 @@ export default {
|
||||
return this.linkGroupList.find(item => item.metadata.name === groupName)?.spec?.displayName || groupName || "未分组"
|
||||
},
|
||||
fnGetData() {
|
||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
||||
return;
|
||||
}
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
@@ -290,9 +296,9 @@ export default {
|
||||
});
|
||||
},
|
||||
toSubmitLinkPage() {
|
||||
this.$Router.push({
|
||||
path: '/pagesA/submit-link/submit-link'
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/submit-link/submit-link'
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
<template>
|
||||
<view class="app-page">
|
||||
<view v-if="loading != 'success'" class="loading-wrap pa-24">
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||
</view>
|
||||
<!-- 内容区域 -->
|
||||
<view v-else class="app-page-content pa-24">
|
||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center">
|
||||
<!-- 空布局 -->
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有写任何日记"></tm-empty>
|
||||
</view>
|
||||
<block v-else>
|
||||
<block v-for="(journal, index) in dataList" :key="index">
|
||||
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||
<!-- 日记卡片 -->
|
||||
<journal-card :journal="journal" :useLike="true"></journal-card>
|
||||
</tm-translate>
|
||||
</block>
|
||||
|
||||
<tm-flotbutton @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||
<view class="load-text">{{ loadMoreText }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MarkdownConfig from '@/common/markdown/markdown.config.js';
|
||||
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
||||
import journalCard from '@/components/journal-card/journal-card.vue';
|
||||
|
||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||
|
||||
export default {
|
||||
components: {mpHtml, tmSkeleton, tmEmpty, tmTranslate, tmFlotbutton, journalCard},
|
||||
data() {
|
||||
return {
|
||||
loading: 'loading',
|
||||
markdownConfig: MarkdownConfig,
|
||||
queryParams: {
|
||||
size: 10,
|
||||
page: 0
|
||||
},
|
||||
|
||||
dataList: [],
|
||||
hasNext: false,
|
||||
isLoadMore: false,
|
||||
loadMoreText: '加载中...'
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.fnSetPageTitle('个人日记');
|
||||
},
|
||||
created() {
|
||||
this.fnGetData();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 0;
|
||||
this.fnGetData();
|
||||
},
|
||||
onReachBottom(e) {
|
||||
if (this.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetData();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnGetData() {
|
||||
// uni.showLoading({
|
||||
// mask: true,
|
||||
// title: '加载中...'
|
||||
// });
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '加载中...';
|
||||
this.$httpApi
|
||||
.getJournals(this.queryParams)
|
||||
.then(res => {
|
||||
this.loading = 'success';
|
||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
// 处理数据
|
||||
this.result = res.data;
|
||||
if (this.isLoadMore) {
|
||||
this.dataList = this.dataList.concat(res.data.content);
|
||||
} else {
|
||||
this.dataList = res.data.content;
|
||||
}
|
||||
this.loading = 'success';
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
this.loading = 'error';
|
||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.loading-wrap {
|
||||
}
|
||||
|
||||
.app-page-content {
|
||||
}
|
||||
|
||||
.content-empty {
|
||||
height: 60vh;
|
||||
}
|
||||
</style>
|
||||
@@ -123,14 +123,13 @@ export default {
|
||||
fnGetData() {
|
||||
this.loading = 'loading';
|
||||
this.queryParams.group = this.loveConfig.lovePhoto.groupName
|
||||
console.log('this.loveConfig------------',this.loveConfig)
|
||||
this.$httpApi.v2
|
||||
.getPhotoListByGroupName(this.queryParams)
|
||||
.then(res => {
|
||||
console.log("相册 res", res)
|
||||
this.loading = 'success';
|
||||
this.dataList = res.items.map((item, index) => {
|
||||
item['image'] = this.$utils.checkImageUrl(item.spec.cover);
|
||||
item['image'] = this.$utils.checkImageUrl(item.spec.cover || item.spec.url);
|
||||
item['takeTime'] = this.$tm.dayjs(item.metadata.creationTimestamp).format(
|
||||
'DD/MM/YYYY');
|
||||
return item;
|
||||
@@ -161,13 +160,13 @@ export default {
|
||||
fnChange(isNext) {
|
||||
throttle(() => {
|
||||
if (isNext) {
|
||||
if (this.swiperIndex == this.dataList.length - 1) {
|
||||
if (this.swiperIndex === this.dataList.length - 1) {
|
||||
this.swiperIndex = 0;
|
||||
} else {
|
||||
this.swiperIndex += 1;
|
||||
}
|
||||
} else {
|
||||
if (this.swiperIndex == 0) {
|
||||
if (this.swiperIndex === 0) {
|
||||
this.swiperIndex = this.dataList.length - 1;
|
||||
} else {
|
||||
this.swiperIndex -= 1;
|
||||
|
||||
+108
-43
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="app-page bg-gradient-blue-lighten-b" :style="pageStyle">
|
||||
<view class="tn-satr">
|
||||
<view class="app-page bg-gradient-blue-lighten-b" :class="calcPageClass" :style="[calcPageStyle]">
|
||||
<view v-if="calcBackgroundType!=='video'" class="tn-satr">
|
||||
<view class="sky"></view>
|
||||
<view class="stars">
|
||||
<view class="falling-stars">
|
||||
@@ -40,22 +40,41 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="user-info__container flex flex-col flex-center">
|
||||
<image class="user-info__avatar" :src="$utils.checkImageUrl(startConfig.logo)" mode="aspectFill"></image>
|
||||
<view class="user-info__nick-name">「 {{ startConfig.title }} 」</view>
|
||||
</view>
|
||||
<video v-else class="video-bg" :object-fit="startConfig.bgVideoFit" :src="startConfig.bgVideo" :loop="true" :autoplay="true"
|
||||
:muted="true" :controls="false" :show-fullscreen-btn="false" :show-play-btn="false"
|
||||
:show-center-play-btn="false" :show-loading="false" :enable-progress-gesture="false"
|
||||
:show-progress="false"></video>
|
||||
|
||||
<view class="text-align-center text-white" style="padding: 60vh 0 0 0;">
|
||||
<view class="" style="font-size: 44rpx;" v-if="startConfig.desc1">{{ startConfig.desc1 }}</view>
|
||||
<view class="mt-30 text-size-m" v-if="startConfig.desc2">{{ startConfig.desc2 }}</view>
|
||||
</view>
|
||||
<cover-view v-if="startConfig.title || startConfig.logo" class="title-container">
|
||||
|
||||
<view class="" style="padding: 120rpx 200rpx;z-index: 999;position: relative;">
|
||||
<view class="start-btn" @click="fnStart()">{{ startConfig.btnText || '开始体验' }}</view>
|
||||
</view>
|
||||
<cover-view v-if="startConfig.logo" class="app-logo">
|
||||
<cover-view class="app-logo-border">
|
||||
<cover-image class="app-logo-image" :src="$utils.checkImageUrl(startConfig.logo)"
|
||||
mode="aspectFill"></cover-image>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view v-if="startConfig.title" class="app-title" :style="startConfig.titleStyle">
|
||||
「 {{ startConfig.title }} 」
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view v-if="startConfig.desc1 || startConfig.desc2" class="bottom-container">
|
||||
<cover-view class="text-align-center" :style="startConfig.descStyle"
|
||||
style="color:white;padding: 60vh 0 0 0;">
|
||||
<cover-view class="" style="font-size: 44rpx;" v-if="startConfig.desc1">{{ startConfig.desc1 }}
|
||||
</cover-view>
|
||||
<cover-view class="mt-30 text-size-m" v-if="startConfig.desc2">{{ startConfig.desc2 }}</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="" style="padding: 120rpx 200rpx;z-index: 999;position: relative;">
|
||||
<cover-view class="start-btn" :class="[startConfig.btnClass]" @click="fnStart()"
|
||||
:style="startConfig.btnStyle">{{ startConfig.btnText || '开始体验' }}
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<!-- 波浪效果 -->
|
||||
<wave></wave>
|
||||
<wave v-if="startConfig.useWave"></wave>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -70,13 +89,29 @@ export default {
|
||||
startConfig() {
|
||||
return this.$tm.vx.getters().getConfigs.appConfig.startConfig;
|
||||
},
|
||||
pageStyle() {
|
||||
if (this.startConfig.bg) {
|
||||
const _bg = this.$utils.checkIsUrl(this.startConfig.bg) ? `url(${this.$utils.checkImageUrl(this.startConfig.bg)})` : this
|
||||
.startConfig.bg;
|
||||
calcBackgroundType() {
|
||||
return this.startConfig.backgroundType;
|
||||
},
|
||||
calcPageClass() {
|
||||
if (this.calcBackgroundType === 'color') {
|
||||
return [this.startConfig.bg]
|
||||
}
|
||||
return []
|
||||
},
|
||||
calcPageStyle() {
|
||||
if (this.calcBackgroundType === 'color') {
|
||||
return {}
|
||||
}
|
||||
if (this.calcBackgroundType === 'image') {
|
||||
return {
|
||||
background: _bg + '!important'
|
||||
};
|
||||
backgroundImage: `url(${this.$utils.checkImageUrl(this.startConfig.bgImage)})!important`,
|
||||
backgroundSize: this.startConfig.bgImageFit
|
||||
}
|
||||
}
|
||||
if (this.calcBackgroundType === 'video') {
|
||||
return {
|
||||
background: '#ffffff'
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
@@ -96,8 +131,11 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-page {
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.start-btn {
|
||||
@@ -111,37 +149,64 @@ export default {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* 用户信息 start */
|
||||
.user-info {
|
||||
&__container {
|
||||
position: absolute;
|
||||
top: 25vh;
|
||||
left: 50%;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.bottom-container {
|
||||
position: absolute;
|
||||
bottom: 50rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
&__avatar {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border: 8rpx solid rgba(255, 255, 255, 0.05);
|
||||
.video-bg {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.title-container {
|
||||
width: 100vw;
|
||||
position: absolute;
|
||||
top: 20vh;
|
||||
left: 0;
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.app-logo {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
|
||||
&-border {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
border: 8rpx solid rgba(255, 255, 255, 0.35);
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
&__nick-name {
|
||||
color: #ffffff;
|
||||
margin-top: 26rpx;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
&-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
/* 用户信息 end */
|
||||
.app-title {
|
||||
color: #ffffff;
|
||||
margin-top: 26rpx;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
/* 流星*/
|
||||
.tn-satr {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
@@ -161,7 +226,7 @@ export default {
|
||||
.star {
|
||||
border-radius: 50%;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 0px 6px 0px rgba(255, 255, 255, 0.8);
|
||||
box-shadow: 0 0 6px 0 rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.small-stars .star {
|
||||
|
||||
@@ -1,289 +0,0 @@
|
||||
<template>
|
||||
<view class="app-page">
|
||||
|
||||
<view v-if="loading != 'success' && articleList.length===0" class="loading-wrap">
|
||||
加载中
|
||||
</view>
|
||||
<block v-else>
|
||||
|
||||
<view v-if="articleList.length == 0" class="article-empty"><tm-empty icon="icon-shiliangzhinengduixiang-"
|
||||
label="博主还没有发表任何文章~"></tm-empty></view>
|
||||
<block v-else>
|
||||
|
||||
<view style="width: 100%;text-align: center;display: flex;flex-direction: column;align-items: center;"
|
||||
v-for="(article, index) in articleList" :key="index">
|
||||
<image style="width: 100%;height: 250rpx;" :src="article.cover"></image>
|
||||
<view style="margin-top: 12rpx;">{{article.title}}</view>
|
||||
</view>
|
||||
<view class="load-text mt-12">{{ loadMoreText }}</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: 'loading',
|
||||
queryParams: {
|
||||
size: 30,
|
||||
page: 1
|
||||
},
|
||||
result: {},
|
||||
isLoadMore: false,
|
||||
loadMoreText: '加载中...',
|
||||
bannerCurrent: 0,
|
||||
bannerList: [],
|
||||
noticeList: [],
|
||||
articleList: [],
|
||||
categoryList: [],
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.fnQuery();
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
this.isLoadMore = false;
|
||||
this.queryParams.page = 1;
|
||||
this.fnQuery();
|
||||
},
|
||||
|
||||
onReachBottom(e) {
|
||||
if (this.result.hasNext) {
|
||||
this.queryParams.page += 1;
|
||||
this.isLoadMore = true;
|
||||
this.fnGetArticleList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '没有更多数据了'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fnQuery() {
|
||||
this.fnGetArticleList();
|
||||
},
|
||||
fnOnBannerChange(e) {
|
||||
this.bannerCurrent = e.current;
|
||||
},
|
||||
fnOnBannerClick(item) {
|
||||
if (item.id == '') return;
|
||||
this.fnToArticleDetail({
|
||||
metadata: {
|
||||
name: item.id
|
||||
}
|
||||
});
|
||||
},
|
||||
fnGetArticleList() {
|
||||
|
||||
// 设置状态为加载中
|
||||
if (!this.isLoadMore) {
|
||||
this.loading = 'loading';
|
||||
}
|
||||
this.loadMoreText = '加载中...';
|
||||
const list = new Array(30).fill(10).map(item => {
|
||||
return {
|
||||
title: '红红火火恍恍惚惚哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈发放',
|
||||
cover: 'https://blog.925i.cn/upload/房间%20少女%20蓝色眼睛%20夏天的裙子%20室内绿色植物%20动漫壁纸_彼岸壁纸.webp'
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
this.result = {
|
||||
hasNext: true
|
||||
};
|
||||
|
||||
if (this.isLoadMore) {
|
||||
this.articleList = this.articleList.concat(list);
|
||||
} else {
|
||||
this.articleList = list;
|
||||
}
|
||||
}, 200)
|
||||
this.loading = 'success';
|
||||
this.loadMoreText = this.result ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 300)
|
||||
|
||||
|
||||
},
|
||||
|
||||
//跳转文章详情
|
||||
fnToArticleDetail(article) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/article-detail/article-detail?name=' + article.metadata.name,
|
||||
animationType: 'slide-in-right'
|
||||
});
|
||||
},
|
||||
// 快捷导航页面跳转
|
||||
fnToNavPage(item) {
|
||||
switch (item.type) {
|
||||
case 'tabbar':
|
||||
uni.switchTab({
|
||||
url: item.path
|
||||
});
|
||||
break;
|
||||
case 'page':
|
||||
uni.navigateTo({
|
||||
url: item.path
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 分类页面
|
||||
fnToCategoryPage() {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/category/category'
|
||||
});
|
||||
},
|
||||
// 所有的文章列表页面
|
||||
fnToArticlesPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/articles/articles'
|
||||
});
|
||||
},
|
||||
|
||||
// 根据slug查询分类下的文章
|
||||
fnToCategoryBy(category) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesA/category-detail/category-detail?name=${category.metadata.name}&title=${category.spec.displayName}`
|
||||
});
|
||||
},
|
||||
|
||||
fnChangeMode() {
|
||||
const isBlackTheme = this.$tm.vx.state().tmVuetify.black;
|
||||
this.$tm.theme.setBlack(!isBlackTheme);
|
||||
uni.setNavigationBarColor({
|
||||
backgroundColor: !isBlackTheme ? '#0a0a0a' : '#ffffff',
|
||||
frontColor: !isBlackTheme ? '#ffffff' : '#0a0a0a'
|
||||
});
|
||||
},
|
||||
|
||||
fnToSearch() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/articles/articles'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-page {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// background-color: #ffffff;
|
||||
|
||||
.logo {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
::v-deep {
|
||||
.tm-menubars .body .body_wk .left {
|
||||
min-width: initial;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-wrap {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
background-color: #f5f5f5;
|
||||
align-items: center;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
margin-right: 24rpx;
|
||||
|
||||
/* #endif */
|
||||
&_icon {}
|
||||
|
||||
&_text {}
|
||||
}
|
||||
|
||||
.show-more {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.banner {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.quick-nav {
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
|
||||
// box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
.name {
|
||||
color: var(--main-text-color);
|
||||
}
|
||||
}
|
||||
|
||||
.category {
|
||||
width: 94vw;
|
||||
display: flex;
|
||||
height: 200rpx;
|
||||
white-space: nowrap;
|
||||
margin: 0 24rpx;
|
||||
|
||||
.content {
|
||||
display: inline-block;
|
||||
padding-left: 24rpx;
|
||||
|
||||
&:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cate-empty {
|
||||
height: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.page-item {
|
||||
&_title {
|
||||
position: relative;
|
||||
padding-left: 24rpx;
|
||||
font-size: 32rpx;
|
||||
z-index: 1;
|
||||
color: var(--main-text-color);
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0rpx;
|
||||
top: 8rpx;
|
||||
width: 8rpx;
|
||||
height: 30rpx;
|
||||
background-color: rgba(33, 150, 243, 1);
|
||||
border-radius: 6rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.h_row_col2 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
padding: 0 12rpx;
|
||||
|
||||
.ani-item {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,24 +0,0 @@
|
||||
// router.js
|
||||
import {
|
||||
RouterMount,
|
||||
createRouter
|
||||
} from 'uni-simple-router';
|
||||
|
||||
const router = createRouter({
|
||||
platform: process.env.VUE_APP_PLATFORM,
|
||||
routes: [...ROUTES]
|
||||
});
|
||||
|
||||
//全局路由前置守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
next();
|
||||
});
|
||||
// 全局路由后置守卫
|
||||
router.afterEach((to, from) => {
|
||||
console.log('跳转结束')
|
||||
})
|
||||
|
||||
export {
|
||||
router,
|
||||
RouterMount
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<view class="tm-flowLayout relative">
|
||||
<view class="tm-flowLayout-hidden absolute fulled">
|
||||
<view v-for="(item, index) in list2" :key="index" style="width: 350rpx;" :class="'tm-flowLayout-hidden-'+index">
|
||||
<tm-images @error="loadimg($event,false,index)" @load="loadimg($event,true,index)" :src="item.spec.url"></tm-images>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tm-flowLayout-cm flex-between">
|
||||
<view class="tm-flowLayout-left" style="width: 48.6%;">
|
||||
<block v-for="(item, index) in dataList[0]" :key="index">
|
||||
<view @click.stop="onclick(index,0)" class="tm-flowLayout-item mb-20 fulled" :class="['tm-flowLayout-item_'+index]">
|
||||
<tm-translate animation-name="fadeUp">
|
||||
<view class="card round-3 overflow white">
|
||||
<tm-images :previmage="false" :src="item.spec.url"></tm-images>
|
||||
</view>
|
||||
</tm-translate>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="tm-flowLayout-right" style="width: 48.6%;">
|
||||
<block v-for="(item, index) in dataList[1]" :key="index">
|
||||
<view @click.stop="onclick(index,1)" class="tm-flowLayout-item mb-20 fulled" :class="['tm-flowLayout-item_'+index]">
|
||||
<tm-translate animation-name="fadeUp">
|
||||
<view class="card round-3 overflow white">
|
||||
<tm-images :previmage="false" :src="item.spec.url"></tm-images>
|
||||
</view>
|
||||
</tm-translate>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view v-if="isLoading" class="flex-shrink fulled">
|
||||
<tm-loadding></tm-loadding>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
/**
|
||||
* 瀑布流组件
|
||||
* @property {Function} click 点击项目时触发
|
||||
* @property {Function} load 当前列表加载完成发出的事件。
|
||||
* @property {String} model = [rank|desc] desc下正时排序,所有加载完成再进行显示,rank随机,哪个先加载哪个先排前面。
|
||||
*/
|
||||
import tmImages from "@/tm-vuetify/components/tm-images/tm-images.vue"
|
||||
import tmLoadding from "@/tm-vuetify/components/tm-loadding/tm-loadding.vue"
|
||||
import tmIcons from "@/tm-vuetify/components/tm-icons/tm-icons.vue"
|
||||
import tmTranslate from "@/tm-vuetify/components/tm-translate/tm-translate.vue"
|
||||
|
||||
export default {
|
||||
components: {tmImages, tmLoadding, tmIcons, tmTranslate},
|
||||
name: 'tm-flowLayout',
|
||||
props: {
|
||||
model: {
|
||||
type: String,
|
||||
default: 'rank' //desc下正时排序,所有加载完成再进行显示,rank随机,哪个先加载哪个先排前面。
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list2: [],
|
||||
dataList: [
|
||||
[], []
|
||||
],
|
||||
colHeight: [0, 0],
|
||||
minWidth: 0,
|
||||
isLoading: true,
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
let p = await this.$Querey('.tm-flowLayout-left').catch(e => {
|
||||
});
|
||||
this.minWidth = p[0].width;
|
||||
},
|
||||
|
||||
methods: {
|
||||
onclick(index, dirIndex) {
|
||||
this.$emit('click',
|
||||
{
|
||||
childrenIndex: index,
|
||||
dirIndex: dirIndex,
|
||||
item: this.dataList[dirIndex][index]
|
||||
});
|
||||
},
|
||||
//修改或者替换列表数据
|
||||
changeItemData(dirIndex, childrenIndex, item) {
|
||||
this.dataList[dirIndex].splice(childrenIndex, 1, item);
|
||||
},
|
||||
//删除一项列表数据
|
||||
delItemData(dirIndex, childrenIndex) {
|
||||
this.colHeight.splice(dirIndex, 1, this.colHeight[dirIndex] - this.dataList[dirIndex][childrenIndex].height)
|
||||
this.dataList[dirIndex].splice(childrenIndex, 1);
|
||||
this.list2.splice(this.dataList[dirIndex][childrenIndex].index, 1);
|
||||
|
||||
this.$nextTick(function () {
|
||||
this.sucessRank();
|
||||
})
|
||||
},
|
||||
//向列表添加数据
|
||||
pushData(list) {
|
||||
console.log('添加图片数据----------',list)
|
||||
|
||||
let prIdx_i = this.list2.length;
|
||||
if (!Array.isArray(list) || typeof list == 'undefined') {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
this.list2.push({
|
||||
index: i + prIdx_i,
|
||||
isLoad: false,
|
||||
image: "",
|
||||
width: 0,
|
||||
height: 0,
|
||||
...list[i]
|
||||
})
|
||||
}
|
||||
},
|
||||
//获取内部列表数据
|
||||
getDataList() {
|
||||
return this.dataList;
|
||||
},
|
||||
async loadimg(event, isLoad, index) {
|
||||
console.log('图片加载事件----------',event)
|
||||
|
||||
this.isLoading = true;
|
||||
let ps = this.list2[index];
|
||||
ps.isLoad = true;
|
||||
if (isLoad == false) {
|
||||
ps.width = this.minWidth;
|
||||
ps.height = this.minWidth;
|
||||
|
||||
} else {
|
||||
ps.width = this.minWidth;
|
||||
ps.height = ps.height + event.height;
|
||||
}
|
||||
if (this.list2.length == 0 && this.dataList[0].length == 0 && this.dataList[1].length == 0) {
|
||||
this.isLoading = false;
|
||||
return;
|
||||
}
|
||||
this.list2.splice(index, 1, ps);
|
||||
if (this.model == 'desc') {
|
||||
this.sucessRank();
|
||||
} else if (this.model == 'rank') {
|
||||
let indexCol = this.colHeight[0] <= this.colHeight[1] ? 0 : 1;
|
||||
this.dataList[indexCol].push(this.list2[index]);
|
||||
this.colHeight.splice(indexCol, 1, this.colHeight[indexCol] + this.list2[index].height);
|
||||
if (this.isAllLoading() === false) return;
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
isAllLoading() {
|
||||
let isAllload = true;
|
||||
for (let i = 0; i < this.list2.length; i++) {
|
||||
if (this.list2[i].isLoad === false) {
|
||||
isAllload = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isAllload === true) {
|
||||
// 当前列表加载完成发出的事件。
|
||||
this.$emit('load', this.dataList)
|
||||
}
|
||||
return isAllload;
|
||||
},
|
||||
sucessRank() {
|
||||
if (this.isAllLoading() === false) return;
|
||||
this.isLoading = false;
|
||||
for (let i = 0; i < this.list2.length; i++) {
|
||||
// let p = await this.getLeftRightHeight();
|
||||
let index = this.colHeight[0] <= this.colHeight[1] ? 0 : 1;
|
||||
this.dataList[index].push(this.list2[i]);
|
||||
this.colHeight.splice(index, 1, this.colHeight[index] + this.list2[i].height)
|
||||
}
|
||||
|
||||
},
|
||||
//清空瀑布流数据 。
|
||||
clear() {
|
||||
this.list2 = [];
|
||||
this.dataList = [[], []];
|
||||
this.isLoading = false;
|
||||
},
|
||||
getLeftRightHeight(index) {
|
||||
let t = this;
|
||||
return new Promise((resolve, rejecvt) => {
|
||||
let q = uni.createSelectorQuery().in(t);
|
||||
q.select(".tm-flowLayout-left").boundingClientRect();
|
||||
q.select(".tm-flowLayout-right").boundingClientRect();
|
||||
q.exec((res) => {
|
||||
resolve([res[0].height, res[1].height])
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.tm-flowLayout {
|
||||
.tm-flowLayout-hidden {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
overflow-y: auto;
|
||||
left: -300%;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.tm-flowLayout-cm {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,8 +1,4 @@
|
||||
//vue.config.js
|
||||
const TransformPages = require('uni-read-pages')
|
||||
const {
|
||||
webpack
|
||||
} = new TransformPages()
|
||||
module.exports = {
|
||||
devServer: {
|
||||
disableHostCheck: true,
|
||||
@@ -16,17 +12,5 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
configureWebpack: {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
ROUTES: webpack.DefinePlugin.runtimeValue(() => {
|
||||
const tfPages = new TransformPages({
|
||||
includes: ['path', 'name', 'aliasPath', "meta"]
|
||||
});
|
||||
return JSON.stringify(tfPages.routes)
|
||||
}, true)
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user