diff --git a/common/mixins/wxshare.mixin.js b/common/mixins/wxshare.mixin.js
index fb7c959..bb57b4a 100644
--- a/common/mixins/wxshare.mixin.js
+++ b/common/mixins/wxshare.mixin.js
@@ -1,66 +1,65 @@
// 微信分享配置
import HaloTokenConfig from '@/config/token.config.js'
-import {
- jsonToUrlParams2
-} from '@/utils/url.params.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
- }
- },
+ 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)
+ // 分享到朋友圈-这里封装不够,在页面还要声明一次,否则是拿不到参数的,被分享者在朋友圈打开链接是空的
+ 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);
- this.haloWxShareData = _config;
- }
- }
-}
\ No newline at end of file
+ uni.$tm.vx.commit('setWxShare', _config);
+ }
+ }
+}
diff --git a/components/comment-list/comment-list.vue b/components/comment-list/comment-list.vue
index d0065e0..92e0b9a 100644
--- a/components/comment-list/comment-list.vue
+++ b/components/comment-list/comment-list.vue
@@ -1,272 +1,273 @@
-
\ No newline at end of file
+ ::v-deep {
+ .tm-button .tm-button-btn uni-button {
+ height: 70rpx;
+ }
+ }
+}
+
diff --git a/pagesA/comment/comment.vue b/components/comment-modal/comment-modal.vue
similarity index 50%
rename from pagesA/comment/comment.vue
rename to components/comment-modal/comment-modal.vue
index a5abb35..f2f7117 100644
--- a/pagesA/comment/comment.vue
+++ b/components/comment-modal/comment-modal.vue
@@ -1,45 +1,62 @@
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
-
-
-
+
+ {{ calcTitle }}
+
+
+
+
+
+
+
+ 提交
+
+
+
+
-
diff --git a/pages.json b/pages.json
index 27d034a..cd60e02 100644
--- a/pages.json
+++ b/pages.json
@@ -225,16 +225,6 @@
}
}
},
- {
- "path": "comment/comment",
- "style": {
- "navigationBarTitleText": "",
- "enablePullDownRefresh": false
- },
- "meta": {
- "auth": "login"
- }
- },
{
"path": "disclaimers/disclaimers",
"style": {
diff --git a/pagesA/article-detail/article-detail.vue b/pagesA/article-detail/article-detail.vue
index 9adbe8b..5b99f31 100644
--- a/pagesA/article-detail/article-detail.vue
+++ b/pagesA/article-detail/article-detail.vue
@@ -97,7 +97,8 @@
-
+
版权声明
@@ -107,7 +108,8 @@
版权说明:{{ postDetailConfig.copyrightDesc }}
-
+
侵权处理:{{ postDetailConfig.copyrightViolation }}
@@ -116,8 +118,9 @@
@@ -203,6 +206,11 @@
+
+
+
+
@@ -220,6 +228,7 @@ import tmMore from '@/tm-vuetify/components/tm-more/tm-more.vue';
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
import commentList from '@/components/comment-list/comment-list.vue';
import commentItem from '@/components/comment-item/comment-item.vue';
+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';
@@ -239,7 +248,8 @@ export default {
commentList,
commentItem,
rCanvas,
- barrage
+ barrage,
+ commentModal
},
mixins: [haloWxShareMixin],
data() {
@@ -277,7 +287,13 @@ export default {
visitType: 0, // 0 未加密 1 后端部分隐藏 2 前端部分隐藏 3 全部隐藏
visitPwd: undefined,
showValidVisitMore: true,
- showGetPassword: false
+ showGetPassword: false,
+ commentModal: {
+ show: false,
+ isComment: false,
+ postName: "",
+ title: ""
+ }
};
},
computed: {
@@ -285,7 +301,7 @@ export default {
return this.$tm.vx.getters().getConfigs;
},
postDetailConfig() {
- return this.haloConfigs.postDetailConfig;
+ return this.haloConfigs.basicConfig.postDetailConfig;
},
calcUrl() {
return url => {
@@ -297,7 +313,7 @@ export default {
},
// 获取博主信息
bloggerInfo() {
- let blogger = this.$tm.vx.getters().getConfigs.authorConfig.blogger;
+ const blogger = this.$tm.vx.getters().getConfigs.authorConfig.blogger;
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
return blogger;
},
@@ -310,12 +326,16 @@ export default {
return '';
}
},
+
+ calcIsShowComment() {
+ return this.postDetailConfig.showComment
+ }
},
watch: {
haloConfigs: {
deep: true,
immediate: true,
- handler: (newVal) => {
+ handler: function (newVal) {
if (!newVal) return;
this.fnHandleSetFlotButtonItems(newVal);
}
@@ -394,13 +414,11 @@ export default {
});
},
fnHandleSetFlotButtonItems(configs) {
-
- const actions = [
- {
- icon: 'icon-share1',
- color: 'bg-gradient-blue-accent',
- use: true,
- },
+ const actions = [{
+ icon: 'icon-share1',
+ color: 'bg-gradient-blue-accent',
+ use: true,
+ },
{
icon: 'icon-like',
color: 'bg-gradient-orange-accent',
@@ -431,25 +449,32 @@ export default {
},
fnToComment() {
- if (!this.haloConfig.basicConfig.postDetailConfig.showComment) {
+ if (!this.calcIsShowComment) {
return;
}
if (!this.result.spec.allowComment) {
return uni.$tm.toast('文章已开启禁止评论!');
}
- this.$Router.push({
- path: '/pagesA/comment/comment',
- query: {
- isComment: true,
- postName: this.result.metadata.name,
- title: this.result.spec.title,
- from: 'posts',
- formPage: 'comment_list',
- type: 'post'
- }
- });
+ this.commentModal.isComment = true;
+ this.commentModal.postName = this.result.metadata.name;
+ this.commentModal.title = this.result.spec.title;
+ this.commentModal.show = true;
+ },
+ fnOnComment(data) {
+ this.commentModal.isComment = data.isComment;
+ this.commentModal.postName = data.name;
+ this.commentModal.title = data.title;
+ this.commentModal.show = true;
+ },
+ fnOnCommentModalClose(refresh) {
+ if (refresh && this.$refs.commentListRef) {
+ this.$refs.commentListRef.fnGetData()
+ }
+ this.commentModal.show = false;
+ this.commentModal.isComment = false;
+ this.commentModal.postName = "";
+ this.commentModal.title = "";
},
-
fnDoLikes() {
this.$httpApi
.postLikePost(this.result.id)
@@ -624,7 +649,7 @@ export default {
// 小程序信息
await this.$refs.rCanvas
.drawImage({
- url: this.haloConfig.imagesConfig.miniCodeImageUrl,
+ url: this.$utils.checkImageUrl(this.haloConfig.imagesConfig.miniCodeImageUrl),
x: 20,
y: 360,
w: 80,
@@ -730,7 +755,6 @@ export default {
});
},
async fnOnCommentLoaded(data) {
- console.log("data", data)
const _list = [];
const _handleData = list => {
return new Promise(resolve => {