tijaio
This commit is contained in:
@@ -45,6 +45,8 @@ export default {
|
|||||||
}
|
}
|
||||||
uni.navigateBack({ delta: 1 });
|
uni.navigateBack({ delta: 1 });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
//复制内容
|
//复制内容
|
||||||
handleCopy(value, title) {
|
handleCopy(value, title) {
|
||||||
uniCopy({
|
uniCopy({
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
@click.stop="clickUser()"
|
@click.stop="clickUser()"
|
||||||
>{{ name }}</text
|
>{{ name }}</text
|
||||||
>
|
>
|
||||||
<view style="display: flex; align-items: center;margin-top: 14rpx;"
|
<view style="display: flex; align-items: center;margin-top:8rpx;"
|
||||||
><text class="user__content-note uni-ellipsis">{{
|
><text class="user__content-note uni-ellipsis">{{
|
||||||
|
|
||||||
createTime
|
createTime
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
height: auto;
|
height: auto;
|
||||||
color: #4b4b4b;
|
color: #4b4b4b;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;text-indent: 0px !important;
|
||||||
"
|
"
|
||||||
/></u-read-more>
|
/></u-read-more>
|
||||||
<view class="allImage">
|
<view class="allImage">
|
||||||
@@ -263,9 +263,31 @@ export default {
|
|||||||
},
|
},
|
||||||
// 自适应判断
|
// 自适应判断
|
||||||
judgeImg() {
|
judgeImg() {
|
||||||
if (this.imgList.length == 1) {
|
if (this.imgList.length === 1) {
|
||||||
this.imgWidth = ((this.windowWidth - 60) * 2) / 3;
|
const firstImg = this.imgList[0];
|
||||||
this.imgHeight = (this.windowHeight * 3) / 5;
|
|
||||||
|
// 获取图片的宽高信息
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: firstImg, // 获取图片路径
|
||||||
|
success: (res) => {
|
||||||
|
const imgWidth = res.width;
|
||||||
|
const imgHeight = res.height;
|
||||||
|
|
||||||
|
// 如果是横向图片(宽大于高)
|
||||||
|
if (imgWidth > imgHeight) {
|
||||||
|
// 横向图片尺寸设置
|
||||||
|
this.imgWidth = ((this.windowWidth - 90) * 2) / 2;
|
||||||
|
this.imgHeight = (this.windowHeight * 3) / 5;
|
||||||
|
} else {
|
||||||
|
// 纵向图片尺寸设置
|
||||||
|
this.imgWidth = (this.windowWidth - 80) * 0.7; // 纵向图片稍微缩小宽度
|
||||||
|
this.imgHeight = (this.windowHeight * 3) / 5;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error("图片加载失败", err);
|
||||||
|
},
|
||||||
|
});
|
||||||
} else if (this.imgList.length == 4) {
|
} else if (this.imgList.length == 4) {
|
||||||
this.imgWidth = (this.windowWidth - 60) / 3.3;
|
this.imgWidth = (this.windowWidth - 60) / 3.3;
|
||||||
this.imgHeight = this.imgWidth;
|
this.imgHeight = this.imgWidth;
|
||||||
@@ -461,7 +483,7 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.user__content-note {
|
.user__content-note {
|
||||||
margin-top: 3px;
|
margin-top: 2rpx;
|
||||||
color: #aaacab;
|
color: #aaacab;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
@@ -485,23 +507,37 @@ export default {
|
|||||||
text-align: justify;
|
text-align: justify;
|
||||||
color: #292929;
|
color: #292929;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 32rpx;
|
font-size: 38rpx;
|
||||||
margin-bottom: 10rpx;
|
line-height: 42rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
.user__content-title {
|
.user__content-title {
|
||||||
color: #5a6988;
|
color: #5a6988;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
line-height: 38rpx;
|
line-height: 34rpx;
|
||||||
|
// margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
::v-deep rich-text {
|
::v-deep rich-text {
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
::v-deep rich-text p {
|
::v-deep rich-text p,h1,h2 {
|
||||||
text-indent: 0 !important;
|
text-indent: 0 !important;
|
||||||
}
|
}
|
||||||
|
/deep/ rich-text br {
|
||||||
|
height: 0 !important;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
::v-deep rich-text h1 {
|
||||||
|
font-size: 34rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
::v-deep rich-text h2 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 30rpx;
|
||||||
|
}
|
||||||
.likeList {
|
.likeList {
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
@@ -513,8 +549,8 @@ export default {
|
|||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
.hidden2 {
|
.hidden2 {
|
||||||
line-height: 24px;
|
line-height: 20px;
|
||||||
max-height: 120px;
|
max-height: 100px;
|
||||||
-webkit-line-clamp: 5;
|
-webkit-line-clamp: 5;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,44 +2,81 @@
|
|||||||
<view
|
<view
|
||||||
class="content"
|
class="content"
|
||||||
:class="`${options.type == 'detail' ? 'content_detail' : ''}`"
|
:class="`${options.type == 'detail' ? 'content_detail' : ''}`"
|
||||||
|
:style="options.statusId == 0 ? 'background-color: #f0f0f026;' : ''"
|
||||||
>
|
>
|
||||||
|
<u-loading-page
|
||||||
|
:loading="submitLoading"
|
||||||
|
style="
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
z-index: 9999;
|
||||||
|
top: 0;
|
||||||
|
background-color: #00000080;
|
||||||
|
"
|
||||||
|
loading-text="文章正在发布中,请稍后..."
|
||||||
|
color="#fff"
|
||||||
|
></u-loading-page>
|
||||||
|
|
||||||
<z-nav-bar
|
<z-nav-bar
|
||||||
:title="options.navTitle"
|
:title="options.navTitle"
|
||||||
:bgColor="options.type == 'detail' ? '#d8e6ff73' : '#5188e5'"
|
:bgColor="
|
||||||
:fontColor="options.type == 'detail' ? '#5188e5' : '#fff'"
|
options.type == 'detail'
|
||||||
|
? options.statusId == 0
|
||||||
|
? '#f7f7f7'
|
||||||
|
: '#d8e6ff73'
|
||||||
|
: '#5188e5'
|
||||||
|
"
|
||||||
|
:fontColor="
|
||||||
|
options.type == 'detail'
|
||||||
|
? options.statusId == 0
|
||||||
|
? '#333'
|
||||||
|
: '#333'
|
||||||
|
: '#fff'
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<template v-slot:right>
|
<template v-slot:right>
|
||||||
<view
|
<view
|
||||||
class="top_right"
|
class="top_right"
|
||||||
|
style="
|
||||||
|
background-color: #fff;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
"
|
||||||
@tap="handleOpenShowSubmit"
|
@tap="handleOpenShowSubmit"
|
||||||
v-if="options.type == 'add'"
|
v-if="options.type == 'add'"
|
||||||
>
|
>
|
||||||
<text
|
<text
|
||||||
style="
|
style="
|
||||||
padding: 4rpx 10rpx;
|
padding: 2rpx 20rpx;
|
||||||
margin-right: 10rpx;
|
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
line-height: 40rpx;
|
line-height: 50rpx;
|
||||||
color: #fff;
|
color: #215fc7;
|
||||||
"
|
"
|
||||||
>提交</text
|
>提交</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
v-if="options.type == 'detail'"
|
v-if="options.type == 'detail' && options.statusId == 1"
|
||||||
class="top_right"
|
class="top_right"
|
||||||
@tap="showDel = true"
|
|
||||||
style="display: flex; align-items: center"
|
style="display: flex; align-items: center"
|
||||||
>
|
>
|
||||||
<uni-icons
|
<uni-icons
|
||||||
type="trash-filled"
|
type="redo-filled"
|
||||||
size="22"
|
size="28"
|
||||||
style="color: #aa3629; margin-left: 40rpx"
|
@tap="newOnShare()"
|
||||||
|
style="color: #66bc54"
|
||||||
></uni-icons>
|
></uni-icons>
|
||||||
|
|
||||||
<text
|
<text
|
||||||
style="letter-spacing: 4rpx; color: #aa3629; margin-right: 20rpx"
|
style="
|
||||||
>删除</text
|
letter-spacing: 2rpx;
|
||||||
|
color: #66bc54;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
"
|
||||||
|
>分享</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -123,15 +160,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
<scroll-view
|
||||||
<view
|
:scroll-into-view="targetId"
|
||||||
class="home_wrap home_wrap_analysis"
|
scroll-y
|
||||||
|
class="home_wrap home_wrap_analysis home"
|
||||||
|
ref="homeContainer"
|
||||||
v-if="options.type == 'detail'"
|
v-if="options.type == 'detail'"
|
||||||
:style="`height: calc(100% - ${
|
:style="`height: calc(100% - ${
|
||||||
48 + statusBarHeight + 60
|
48 + statusBarHeight + (options.statusId == 0 ? 10 : 60)
|
||||||
}px);padding:40rpx 20rpx;text-align: justify;`"
|
}px);padding:0 20rpx;text-align: justify;`"
|
||||||
>
|
>
|
||||||
<view class="analysis_box" style="height: auto">
|
<view class="analysis_box" style="height: auto; padding-top: 40rpx">
|
||||||
<view class="analysis_img_box">
|
<view class="analysis_img_box">
|
||||||
<view class="analysis_img">
|
<view class="analysis_img">
|
||||||
<image
|
<image
|
||||||
@@ -172,7 +211,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="analysis_title analysis_title_detail"
|
class="analysis_title analysis_title_detail"
|
||||||
style="color: #302f35; font-size: 32rpx"
|
style="
|
||||||
|
color: #302f35;
|
||||||
|
font-size: 40rpx !important;
|
||||||
|
line-height: 50rpx;
|
||||||
|
"
|
||||||
>
|
>
|
||||||
{{ articleInfo.title }}
|
{{ articleInfo.title }}
|
||||||
</view>
|
</view>
|
||||||
@@ -210,9 +253,23 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
style="letter-spacing: 1rpx; color: #aaacab; margin-top: 20rpx"
|
style="
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
color: #aaacab;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
"
|
||||||
v-if="articleInfo.createTime"
|
v-if="articleInfo.createTime"
|
||||||
>{{ articleInfo.createTime }}
|
>{{ articleInfo.createTime }}
|
||||||
|
<uni-icons
|
||||||
|
v-if="articleInfo.come == 0"
|
||||||
|
type="trash-filled"
|
||||||
|
size="24"
|
||||||
|
@tap="showDel = true"
|
||||||
|
style="color: #aa3629; margin-left: 20rpx; margin-right: 20rpx"
|
||||||
|
></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="likeList" v-if="likeList.length > 0" style="color: #5188e5">
|
<view class="likeList" v-if="likeList.length > 0" style="color: #5188e5">
|
||||||
<uni-icons
|
<uni-icons
|
||||||
@@ -228,6 +285,22 @@
|
|||||||
.join(" , ")
|
.join(" , ")
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="commentData" id="commentData">
|
||||||
|
<hb-comment
|
||||||
|
:isDisable="options.statusId == 0 ? true : false"
|
||||||
|
:isShowList="true"
|
||||||
|
:articleUserId="articleInfo.userId"
|
||||||
|
style=""
|
||||||
|
:user="currentUser"
|
||||||
|
ref="hbComment"
|
||||||
|
@add="sendComment"
|
||||||
|
@del="del"
|
||||||
|
@focusOn="focusOn"
|
||||||
|
:deleteTip="'确认删除?'"
|
||||||
|
:cmData="commentData"
|
||||||
|
v-if="commentData"
|
||||||
|
></hb-comment>
|
||||||
|
</view>
|
||||||
<!-- 显示聊天记录 -->
|
<!-- 显示聊天记录 -->
|
||||||
<!-- <articleDetail
|
<!-- <articleDetail
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@@ -242,7 +315,7 @@
|
|||||||
ref="commonMedicalDetail"
|
ref="commonMedicalDetail"
|
||||||
></articleDetail> -->
|
></articleDetail> -->
|
||||||
|
|
||||||
<view class="footer_box">
|
<!-- <view class="footer_box" v-if="options.statusId != 0">
|
||||||
<template>
|
<template>
|
||||||
<view
|
<view
|
||||||
class="footer_item"
|
class="footer_item"
|
||||||
@@ -280,6 +353,7 @@
|
|||||||
<text style="letter-spacing: 4rpx">评论</text>
|
<text style="letter-spacing: 4rpx">评论</text>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
|
v-if="articleInfo.showFlag != 0"
|
||||||
class="footer_item"
|
class="footer_item"
|
||||||
style="color: #9a9a9a"
|
style="color: #9a9a9a"
|
||||||
@click.stop="newOnShare"
|
@click.stop="newOnShare"
|
||||||
@@ -294,8 +368,8 @@
|
|||||||
<text style="letter-spacing: 4rpx">分享</text>
|
<text style="letter-spacing: 4rpx">分享</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</scroll-view>
|
||||||
<view style="padding-bottom: 20px">
|
<view style="padding-bottom: 20px">
|
||||||
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff">
|
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff">
|
||||||
<uni-popup-share :bottom="500" @select="haveSelected"></uni-popup-share>
|
<uni-popup-share :bottom="500" @select="haveSelected"></uni-popup-share>
|
||||||
@@ -368,6 +442,7 @@
|
|||||||
>
|
>
|
||||||
<view class="slot-content"> 是否立即发布文章? </view>
|
<view class="slot-content"> 是否立即发布文章? </view>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -387,6 +462,9 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
targetId: null,
|
||||||
|
submitLoading: false,
|
||||||
|
|
||||||
currentUser: {},
|
currentUser: {},
|
||||||
likeList: [],
|
likeList: [],
|
||||||
|
|
||||||
@@ -495,7 +573,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async onShow() {},
|
async onShow() {
|
||||||
|
this.submitLoading = false;
|
||||||
|
},
|
||||||
async onPullDownRefresh() {
|
async onPullDownRefresh() {
|
||||||
this.isRefreshing = true;
|
this.isRefreshing = true;
|
||||||
console.log("下拉刷新");
|
console.log("下拉刷新");
|
||||||
@@ -518,6 +598,14 @@ export default {
|
|||||||
}, 800);
|
}, 800);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
scrollToView(id) {
|
||||||
|
// commentData
|
||||||
|
this.targetId = id; // 设置目标元素 id
|
||||||
|
setTimeout(() => {
|
||||||
|
this.targetId = null;
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
|
||||||
confirmDel: throttle(function () {
|
confirmDel: throttle(function () {
|
||||||
this.delArticle();
|
this.delArticle();
|
||||||
}, 2000),
|
}, 2000),
|
||||||
@@ -534,10 +622,13 @@ export default {
|
|||||||
this.$commonJS.showToast("请至少上传一张图片");
|
this.$commonJS.showToast("请至少上传一张图片");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.showSubmit = true;
|
// this.showSubmit = true;
|
||||||
|
this.confirmSubmit();
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmSubmit: throttle(function () {
|
confirmSubmit: throttle(function () {
|
||||||
|
this.submitLoading = true;
|
||||||
|
this.showSubmit = false;
|
||||||
this.handleSubmit("submit");
|
this.handleSubmit("submit");
|
||||||
}, 2000),
|
}, 2000),
|
||||||
|
|
||||||
@@ -626,9 +717,31 @@ export default {
|
|||||||
},
|
},
|
||||||
// 自适应判断
|
// 自适应判断
|
||||||
judgeImg() {
|
judgeImg() {
|
||||||
if (this.fileList1.length == 1) {
|
if (this.fileList1.length === 1) {
|
||||||
this.imgWidth = ((this.windowWidth - 10) * 2) / 3;
|
const firstImg = this.fileList1[0];
|
||||||
this.imgHeight = (this.windowHeight * 3) / 5;
|
|
||||||
|
// 获取图片的宽高信息
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: firstImg, // 获取图片路径
|
||||||
|
success: (res) => {
|
||||||
|
const imgWidth = res.width;
|
||||||
|
const imgHeight = res.height;
|
||||||
|
|
||||||
|
// 如果是横向图片(宽大于高)
|
||||||
|
if (imgWidth > imgHeight) {
|
||||||
|
// 横向图片尺寸设置
|
||||||
|
this.imgWidth = ((this.windowWidth - 40) * 2) / 2;
|
||||||
|
this.imgHeight = (this.windowHeight * 3) / 5;
|
||||||
|
} else {
|
||||||
|
// 纵向图片尺寸设置
|
||||||
|
this.imgWidth = ((this.windowWidth - 40) * 2) / 3;
|
||||||
|
this.imgHeight = (this.windowHeight * 3) / 5;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error("图片加载失败", err);
|
||||||
|
},
|
||||||
|
});
|
||||||
} else if (this.fileList1.length == 4) {
|
} else if (this.fileList1.length == 4) {
|
||||||
this.imgWidth = (this.windowWidth - 10) / 3.3;
|
this.imgWidth = (this.windowWidth - 10) / 3.3;
|
||||||
this.imgHeight = this.imgWidth;
|
this.imgHeight = this.imgWidth;
|
||||||
@@ -637,6 +750,7 @@ export default {
|
|||||||
this.imgHeight = this.imgWidth;
|
this.imgHeight = this.imgWidth;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
previewImg(index) {
|
previewImg(index) {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: this.fileList1,
|
urls: this.fileList1,
|
||||||
@@ -705,12 +819,18 @@ export default {
|
|||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$commonJS.refreshPrevPageData(1);
|
setTimeout(() => {
|
||||||
|
this.$commonJS.refreshPrevPageData(1);
|
||||||
|
this.submitLoading = false;
|
||||||
|
}, 2000);
|
||||||
} else {
|
} else {
|
||||||
|
this.submitLoading = false;
|
||||||
this.$commonJS.showToast(res.msg);
|
this.$commonJS.showToast(res.msg);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {});
|
.catch((err) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
});
|
||||||
}, 3000),
|
}, 3000),
|
||||||
|
|
||||||
async addPic(e) {
|
async addPic(e) {
|
||||||
@@ -955,8 +1075,35 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
scrollToComment() {
|
||||||
|
// 获取容器
|
||||||
|
const container = this.$refs.homeWrap;
|
||||||
|
|
||||||
|
// 先获取目标元素的位置
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
query
|
||||||
|
.select("#commentData")
|
||||||
|
.boundingClientRect((rect) => {
|
||||||
|
if (rect) {
|
||||||
|
// 获取容器的位置
|
||||||
|
query
|
||||||
|
.select("#home_wrap")
|
||||||
|
.boundingClientRect((containerRect) => {
|
||||||
|
if (containerRect) {
|
||||||
|
console.log("containerRect at line 1068:", containerRect);
|
||||||
|
// 计算相对位置并设置 scrollTop
|
||||||
|
const scrollTop =
|
||||||
|
container.scrollTop + (rect.top - containerRect.top);
|
||||||
|
container.scrollTop = scrollTop; // 滚动容器到目标位置
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.exec(); // 执行容器位置查询
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.exec(); // 执行目标元素位置查询
|
||||||
|
},
|
||||||
//创建新对话
|
//创建新对话
|
||||||
sendComment(comment, pid) {
|
sendComment: throttle(function (comment, pid) {
|
||||||
this.$http
|
this.$http
|
||||||
.request({
|
.request({
|
||||||
url: "common/taihuTalentArticle/addArticleComment",
|
url: "common/taihuTalentArticle/addArticleComment",
|
||||||
@@ -974,11 +1121,19 @@ export default {
|
|||||||
console.log("res at line 713:", res);
|
console.log("res at line 713:", res);
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.getMedicalDetail();
|
this.getMedicalDetail();
|
||||||
|
if(pid==0){
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToView("commentData");
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// this.scrollToComment();
|
||||||
} else {
|
} else {
|
||||||
this.$commonJS.showToast("评论失败");
|
this.$commonJS.showToast("评论失败");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
}),
|
||||||
|
|
||||||
//交谈请求,获取回答
|
//交谈请求,获取回答
|
||||||
getTree(data) {
|
getTree(data) {
|
||||||
@@ -1017,6 +1172,7 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
this.articleInfo = res.article;
|
this.articleInfo = res.article;
|
||||||
|
this.options.statusId = res.article.showFlag;
|
||||||
this.medicalForm = { ...this.articleInfo };
|
this.medicalForm = { ...this.articleInfo };
|
||||||
console.log("this.medicalForm at line 193:", this.articleInfo);
|
console.log("this.medicalForm at line 193:", this.articleInfo);
|
||||||
if (this.articleInfo.img) {
|
if (this.articleInfo.img) {
|
||||||
@@ -1550,9 +1706,9 @@ h3 {
|
|||||||
}
|
}
|
||||||
.analysis_title_detail {
|
.analysis_title_detail {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 40rpx;
|
||||||
// color: #1781ff;
|
// color: #1781ff;
|
||||||
font-size: 42rpx;
|
font-size: 38rpx !important;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1642,6 +1798,7 @@ h3 {
|
|||||||
}
|
}
|
||||||
.allImage {
|
.allImage {
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -1672,4 +1829,26 @@ h3 {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
::v-deep rich-text {
|
||||||
|
text-align: justify;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
::v-deep rich-text p,
|
||||||
|
h1,
|
||||||
|
h2 {
|
||||||
|
text-indent: 0 !important;
|
||||||
|
}
|
||||||
|
/deep/ rich-text br {
|
||||||
|
height: 0 !important;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
::v-deep rich-text h1 {
|
||||||
|
font-size: 36rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
::v-deep rich-text h2 {
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 30rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content" style="background-color: #d8e6ff57">
|
<view class="content" style="background-color: #d8e6ff57">
|
||||||
|
|
||||||
<z-nav-bar title="我的文章" bgColor="#5188e5" fontColor="#fff">
|
<z-nav-bar title="我的文章" bgColor="#5188e5" fontColor="#fff">
|
||||||
<template v-slot:right>
|
<template v-slot:right>
|
||||||
<view class="top_right" @tap="createFolder">
|
<view class="top_right" @tap="createFolder">
|
||||||
@@ -94,7 +95,8 @@
|
|||||||
>评论</view
|
>评论</view
|
||||||
></view
|
></view
|
||||||
>
|
>
|
||||||
<view
|
<view v-if="item.showFlag != 0"
|
||||||
|
|
||||||
class="operate"
|
class="operate"
|
||||||
@click.stop="handleMore(item)"
|
@click.stop="handleMore(item)"
|
||||||
style="
|
style="
|
||||||
@@ -104,12 +106,27 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
...
|
...
|
||||||
<!-- <button class="like" @click.stop="handleLike">
|
|
||||||
赞
|
</view>
|
||||||
</button>
|
<view v-else
|
||||||
<button class="comment" @click.stop="handleComment">
|
|
||||||
评论
|
class="operate"
|
||||||
</button> -->
|
@click.stop="selectArticleId = item.id;showDel=true"
|
||||||
|
style="
|
||||||
|
line-height: 10rpx;
|
||||||
|
font-size: 38rpx;
|
||||||
|
/* margin-top: -20rpx; */
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<uni-icons
|
||||||
|
|
||||||
|
|
||||||
|
type="trash-filled"
|
||||||
|
size="22"
|
||||||
|
color="#aa3629"
|
||||||
|
></uni-icons
|
||||||
|
>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <view style="color: #5188e5"
|
<!-- <view style="color: #5188e5"
|
||||||
><uni-icons
|
><uni-icons
|
||||||
@@ -153,37 +170,34 @@
|
|||||||
cancelText="取消"
|
cancelText="取消"
|
||||||
round="8"
|
round="8"
|
||||||
></u-action-sheet>
|
></u-action-sheet>
|
||||||
|
<u-modal
|
||||||
|
:show="showDel"
|
||||||
|
@confirm="confirmDel"
|
||||||
|
@cancel="showDel = false"
|
||||||
|
ref="uModalDel"
|
||||||
|
:asyncClose="true"
|
||||||
|
:showCancelButton="true"
|
||||||
|
confirmText="删除"
|
||||||
|
confirmColor="#aa3629"
|
||||||
|
title="提示"
|
||||||
|
>
|
||||||
|
<view class="slot-content"> 您确定要删除该文章吗? </view>
|
||||||
|
</u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import $http from "@/config/requestConfig.js";
|
import $http from "@/config/requestConfig.js";
|
||||||
import PrecisionImageGrid from "./PrecisionImageGrid.vue";
|
import PrecisionImageGrid from "./PrecisionImageGrid.vue";
|
||||||
|
import { debounce, throttle } from "@/common/debounce.js";
|
||||||
export default {
|
export default {
|
||||||
components: { PrecisionImageGrid },
|
components: { PrecisionImageGrid },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectArticleId: null,
|
selectArticleId: null,
|
||||||
|
showDel: false, // 控制弹窗显示隐藏
|
||||||
showOperate: false, // 控制弹窗显示隐藏
|
showOperate: false, // 控制弹窗显示隐藏
|
||||||
operateList: [
|
operateList: [],
|
||||||
{
|
|
||||||
name: "查看评论",
|
|
||||||
|
|
||||||
fontSize: "16",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "分享文章",
|
|
||||||
|
|
||||||
fontSize: "16",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "删除",
|
|
||||||
|
|
||||||
color: "#aa3629",
|
|
||||||
|
|
||||||
fontSize: "16",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
tabsList: [],
|
tabsList: [],
|
||||||
currentCateIndex: 0,
|
currentCateIndex: 0,
|
||||||
@@ -223,46 +237,44 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
this.getTabData()
|
this.getTabData();
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// this.getListData(this.taihumedId);
|
// this.getListData(this.taihumedId);
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
confirmDel: throttle(function () {
|
||||||
|
this.delArticle();
|
||||||
|
}, 2000),
|
||||||
refreshData(reset) {
|
refreshData(reset) {
|
||||||
this.current = 1;
|
this.current = 1;
|
||||||
this.list = [];
|
this.list = [];
|
||||||
this.noMore = false;
|
this.noMore = false;
|
||||||
if(reset){
|
if (reset) {
|
||||||
this.currentCateIndex = 0;
|
this.currentCateIndex = 0;
|
||||||
this.courseName = "";
|
this.courseName = "";
|
||||||
this.taihumedId = this.tabsList[this.currentCateIndex].id;
|
this.taihumedId = this.tabsList[this.currentCateIndex].id;
|
||||||
this.statusTitle = this.tabsList[this.currentCateIndex].statusTitle;
|
this.statusTitle = this.tabsList[this.currentCateIndex].statusTitle;
|
||||||
this.statusColor = this.tabsList[this.currentCateIndex].color;
|
this.statusColor = this.tabsList[this.currentCateIndex].color;
|
||||||
//重置
|
//重置
|
||||||
this.list = [];
|
this.list = [];
|
||||||
this.noMore = false;
|
this.noMore = false;
|
||||||
this.show = false;
|
this.show = false;
|
||||||
this.count = 0;
|
this.count = 0;
|
||||||
this.current = 1;
|
this.current = 1;
|
||||||
this.getListData(this.taihumedId);
|
this.getListData(this.taihumedId);
|
||||||
}else{
|
} else {
|
||||||
this.getListData(this.taihumedId);
|
this.getListData(this.taihumedId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
selectClick(e) {
|
selectClick(e) {
|
||||||
console.log(e.name);
|
console.log(e.name);
|
||||||
if (e.name == "删除") {
|
if (e.name == "删除") {
|
||||||
this.delArticle();
|
this.showDel=true;
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/articleList/article?navTitle=文章详情&title=文章详情&id=${this.selectArticleId}&type=detail&statusId=1&open=${e.name}`,
|
url: `/pages/articleList/article?navTitle=文章详情&title=文章详情&id=${this.selectArticleId}&type=detail&statusId=1&open=${e.name}`,
|
||||||
@@ -279,6 +291,37 @@ export default {
|
|||||||
// console.log('调用失败', err);
|
// console.log('调用失败', err);
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
|
var list = [];
|
||||||
|
if (item.showFlag != 0) {
|
||||||
|
list = [
|
||||||
|
// {
|
||||||
|
// name: "查看评论",
|
||||||
|
|
||||||
|
// fontSize: "16",
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
name: "分享文章",
|
||||||
|
|
||||||
|
fontSize: "16",
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.come == 1) {
|
||||||
|
this.operateList = list;
|
||||||
|
} else {
|
||||||
|
this.operateList = [
|
||||||
|
...list,
|
||||||
|
{
|
||||||
|
name: "删除文章",
|
||||||
|
|
||||||
|
color: "#aa3629",
|
||||||
|
|
||||||
|
fontSize: "16",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
this.selectArticleId = item.id;
|
this.selectArticleId = item.id;
|
||||||
this.showOperate = true;
|
this.showOperate = true;
|
||||||
// this.$refs.commentLikePopup.showCommentPopup();
|
// this.$refs.commentLikePopup.showCommentPopup();
|
||||||
@@ -365,23 +408,17 @@ export default {
|
|||||||
icon: "success",
|
icon: "success",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(() => {
|
||||||
this.list=this.list.filter((e)=>{
|
this.list = this.list.filter((e) => {
|
||||||
return e.id!=this.selectArticleId
|
return e.id != this.selectArticleId;
|
||||||
})
|
});
|
||||||
this.count=this.list.length
|
this.count = this.list.length;
|
||||||
|
});
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getListData(taihumedId, type) {
|
getListData(taihumedId, type) {
|
||||||
console.log('taihumedId at line 344:', taihumedId)
|
console.log("taihumedId at line 344:", taihumedId);
|
||||||
if (type) {
|
if (type) {
|
||||||
this.current = 1;
|
this.current = 1;
|
||||||
this.list = [];
|
this.list = [];
|
||||||
@@ -390,6 +427,9 @@ this.count=this.list.length
|
|||||||
if (this.noMore) {
|
if (this.noMore) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (this.current == 1) {
|
||||||
|
this.list = [];
|
||||||
|
}
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -421,15 +461,28 @@ this.count=this.list.length
|
|||||||
) {
|
) {
|
||||||
this.noMore = true;
|
this.noMore = true;
|
||||||
}
|
}
|
||||||
this.list = [
|
|
||||||
...this.list,
|
if (this.current == 1) {
|
||||||
...res.page.records.map((e) => {
|
this.list = [
|
||||||
return {
|
...res.page.records.map((e) => {
|
||||||
...e,
|
return {
|
||||||
fileList1: e.img ? e.img.split(",") : [],
|
...e,
|
||||||
};
|
fileList1: e.img ? e.img.split(",") : [],
|
||||||
}),
|
};
|
||||||
];
|
}),
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
this.list = [
|
||||||
|
...this.list,
|
||||||
|
...res.page.records.map((e) => {
|
||||||
|
return {
|
||||||
|
...e,
|
||||||
|
fileList1: e.img ? e.img.split(",") : [],
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
this.current += 1; //更新页码
|
this.current += 1; //更新页码
|
||||||
//显示提示语
|
//显示提示语
|
||||||
this.showText = true;
|
this.showText = true;
|
||||||
@@ -473,21 +526,13 @@ this.count=this.list.length
|
|||||||
|
|
||||||
switch (this.taihumedId) {
|
switch (this.taihumedId) {
|
||||||
case 0:
|
case 0:
|
||||||
navTitle = "编辑文章";
|
navTitle = "文章详情";
|
||||||
type = "edit";
|
type = "detail";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
navTitle = "文章详情";
|
navTitle = "文章详情";
|
||||||
type = "detail";
|
type = "detail";
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
navTitle = "文章详情";
|
|
||||||
type = "detail";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
navTitle = "文章详情";
|
|
||||||
type = "detail";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/articleList/article?navTitle=${navTitle}&title=${navTitle}&id=${item.id}&type=${type}&statusId=${this.taihumedId}`,
|
url: `/pages/articleList/article?navTitle=${navTitle}&title=${navTitle}&id=${item.id}&type=${type}&statusId=${this.taihumedId}`,
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
mode="bottom"
|
mode="bottom"
|
||||||
:round="8"
|
:round="8"
|
||||||
:background="'#fff'"
|
:background="'#fff'"
|
||||||
|
@close="closeOrderModalShow"
|
||||||
|
|
||||||
style="background: #fff" backgroundColor="#fff"
|
style="background: #fff" backgroundColor="#fff"
|
||||||
>
|
>
|
||||||
<view class="orderModalShow popup_box">
|
<view class="orderModalShow popup_box">
|
||||||
@@ -29,7 +31,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="hb-comment" style="height: 80vh">
|
<view class="hb-comment" style="max-height: 70vh">
|
||||||
<view class="comment-list" v-if="likeList.length != 0">
|
<view class="comment-list" v-if="likeList.length != 0">
|
||||||
<view class="comment-box" v-for="(item, index) in likeList">
|
<view class="comment-box" v-for="(item, index) in likeList">
|
||||||
<view class="comment-box-item">
|
<view class="comment-box-item">
|
||||||
@@ -109,6 +111,18 @@ export default {
|
|||||||
async onLoad(options) {
|
async onLoad(options) {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
orderModalShow: {
|
||||||
|
handler(newVal, oldVal) {
|
||||||
|
|
||||||
|
this.$emit("show",this.orderModalShow);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
||||||
|
|
||||||
@@ -128,13 +142,16 @@ export default {
|
|||||||
this.articleInfo.taihuTalent
|
this.articleInfo.taihuTalent
|
||||||
);
|
);
|
||||||
await this.getMedicalDetail(()=>{
|
await this.getMedicalDetail(()=>{
|
||||||
|
|
||||||
this.orderModalShow = true;
|
this.orderModalShow = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
closeOrderModalShow() {
|
closeOrderModalShow() {
|
||||||
|
|
||||||
this.orderModalShow = false;
|
this.orderModalShow = false;
|
||||||
|
|
||||||
this.$emit("close",this.articleId);
|
this.$emit("close",this.articleId);
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -351,7 +368,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.comment-main-top {
|
.comment-main-top {
|
||||||
width: 600rpx;
|
width: 100%;
|
||||||
padding-top: 12rpx;
|
padding-top: 12rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
:show="orderModalShow"
|
:show="orderModalShow"
|
||||||
mode="bottom"
|
mode="bottom"
|
||||||
:round="8"
|
:round="8"
|
||||||
|
@close="closeOrderModalShow"
|
||||||
:background="'#fff'"
|
:background="'#fff'"
|
||||||
style="background: #fff" backgroundColor="#fff"
|
style="background: #fff"
|
||||||
|
backgroundColor="#fff"
|
||||||
>
|
>
|
||||||
<view class="orderModalShow popup_box">
|
<view class="orderModalShow popup_box">
|
||||||
<view style="text-align: center"
|
<view style="text-align: center"
|
||||||
@@ -24,17 +26,21 @@
|
|||||||
top: 20rpx;
|
top: 20rpx;
|
||||||
"
|
"
|
||||||
></u-icon>
|
></u-icon>
|
||||||
<hb-comment
|
<scroll-view :scroll-into-view="targetId" scroll-y style="height: 70vh;padding-top: 40rpx; padding-bottom: 100rpx">
|
||||||
style="padding-top: 40rpx; overflow: auto; padding-bottom: 100rpx"
|
<hb-comment
|
||||||
:user="currentUser"
|
style=""
|
||||||
ref="hbComment"
|
:user="currentUser"
|
||||||
@add="sendComment"
|
:isPopup="true"
|
||||||
@del="del"
|
:articleUserId="articleInfo.userId"
|
||||||
@focusOn="focusOn"
|
ref="hbComment"
|
||||||
:deleteTip="'确认删除?'"
|
@add="sendComment"
|
||||||
:cmData="commentData"
|
@del="del"
|
||||||
v-if="commentData"
|
@focusOn="focusOn"
|
||||||
></hb-comment>
|
:deleteTip="'确认删除?'"
|
||||||
|
:cmData="commentData"
|
||||||
|
v-if="commentData"
|
||||||
|
></hb-comment
|
||||||
|
></scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
@@ -43,58 +49,59 @@
|
|||||||
<script>
|
<script>
|
||||||
import $http from "@/config/requestConfig.js";
|
import $http from "@/config/requestConfig.js";
|
||||||
import { mapState, mapMutations } from "vuex";
|
import { mapState, mapMutations } from "vuex";
|
||||||
|
import { debounce, throttle } from "@/common/debounce.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {},
|
||||||
|
props: [],
|
||||||
},
|
|
||||||
props:[],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
targetId: null,
|
||||||
articleId: null,
|
articleId: null,
|
||||||
currentUser: {},
|
currentUser: {},
|
||||||
|
|
||||||
orderModalShow: false,
|
orderModalShow: false,
|
||||||
commentData: [],
|
commentData: [],
|
||||||
articleInfo: {},
|
articleInfo: {},
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["userInfo"]),
|
...mapState(["userInfo"]),
|
||||||
},
|
},
|
||||||
async onLoad(options) {
|
async onLoad(options) {},
|
||||||
|
onShow() {},
|
||||||
},
|
watch: {
|
||||||
onShow() {
|
orderModalShow: {
|
||||||
|
handler(newVal, oldVal) {
|
||||||
|
this.$emit("show", this.orderModalShow);
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 自适应判断
|
// 自适应判断
|
||||||
|
scrollToView(id) {
|
||||||
|
// commentData
|
||||||
|
this.targetId = id; // 设置目标元素 id
|
||||||
|
setTimeout(() => {
|
||||||
|
this.targetId = null;
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
|
||||||
|
async onHandleClickOpenComment(id) {
|
||||||
|
this.articleId = id;
|
||||||
async onHandleClickOpenComment(id) {
|
|
||||||
this.articleId=id;
|
|
||||||
console.log("111 at line 384:", 111);
|
console.log("111 at line 384:", 111);
|
||||||
console.log(
|
console.log(
|
||||||
"this.currentUser at line 365:",
|
"this.currentUser at line 365:",
|
||||||
this.articleInfo.taihuTalent
|
this.articleInfo.taihuTalent
|
||||||
);
|
);
|
||||||
await this.getMedicalDetail(()=>{
|
await this.getMedicalDetail(() => {
|
||||||
this.orderModalShow = true;
|
this.orderModalShow = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
closeOrderModalShow() {
|
closeOrderModalShow() {
|
||||||
this.orderModalShow = false;
|
this.orderModalShow = false;
|
||||||
this.$emit("close",this.articleId);
|
this.$emit("close", this.articleId);
|
||||||
|
|
||||||
},
|
},
|
||||||
saveContens(content) {
|
saveContens(content) {
|
||||||
console.log("content at line 322:", content);
|
console.log("content at line 322:", content);
|
||||||
@@ -148,14 +155,10 @@ export default {
|
|||||||
.catch((err) => {});
|
.catch((err) => {});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//点击每个记录
|
//点击每个记录
|
||||||
|
|
||||||
|
|
||||||
//创建新对话
|
//创建新对话
|
||||||
sendComment(comment, pid) {
|
sendComment: throttle(function (comment, pid) {
|
||||||
this.$http
|
this.$http
|
||||||
.request({
|
.request({
|
||||||
url: "common/taihuTalentArticle/addArticleComment",
|
url: "common/taihuTalentArticle/addArticleComment",
|
||||||
@@ -174,11 +177,16 @@ export default {
|
|||||||
console.log("res at line 713:", res);
|
console.log("res at line 713:", res);
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.getMedicalDetail();
|
this.getMedicalDetail();
|
||||||
|
if (pid == 0) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToView("commentData");
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$commonJS.showToast("评论失败");
|
this.$commonJS.showToast("评论失败");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
}),
|
||||||
|
|
||||||
//交谈请求,获取回答
|
//交谈请求,获取回答
|
||||||
getTree(data) {
|
getTree(data) {
|
||||||
@@ -205,7 +213,7 @@ export default {
|
|||||||
url: "common/taihuTalentArticle/getArticleLikeAndComment",
|
url: "common/taihuTalentArticle/getArticleLikeAndComment",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
articleId: this.articleId,
|
articleId: this.articleId,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
@@ -219,14 +227,17 @@ export default {
|
|||||||
this.articleInfo = res.article;
|
this.articleInfo = res.article;
|
||||||
this.medicalForm = { ...this.articleInfo };
|
this.medicalForm = { ...this.articleInfo };
|
||||||
console.log("this.medicalForm at line 193:", this.articleInfo);
|
console.log("this.medicalForm at line 193:", this.articleInfo);
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// if (this.userInfo.id == this.articleInfo.userId) {
|
// if (this.userInfo.id == this.articleInfo.userId) {
|
||||||
// this.currentUser = this.articleInfo.taihuTalent;
|
// this.currentUser = this.articleInfo.taihuTalent;
|
||||||
// } else {
|
// } else {
|
||||||
this.currentUser = {...this.userInfo,icon:this.userInfo.avatar};
|
this.currentUser = {
|
||||||
|
...this.userInfo,
|
||||||
|
icon: this.userInfo.avatar,
|
||||||
|
};
|
||||||
|
|
||||||
console.log('this.currentUser at line 823:', this.currentUser)
|
console.log("this.currentUser at line 823:", this.currentUser);
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
this.commentData = res.comments;
|
this.commentData = res.comments;
|
||||||
@@ -234,8 +245,8 @@ export default {
|
|||||||
commentSize: res.commentCount,
|
commentSize: res.commentCount,
|
||||||
comment: this.getTree(this.commentData),
|
comment: this.getTree(this.commentData),
|
||||||
};
|
};
|
||||||
|
|
||||||
if(fn){
|
if (fn) {
|
||||||
fn();
|
fn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
fontColor="#fff"
|
fontColor="#fff"
|
||||||
:backState="2000"
|
:backState="2000"
|
||||||
>
|
>
|
||||||
<template v-slot:right v-if="activeTab === 1">
|
<template v-slot:right v-if="activeTab === 1">
|
||||||
<view class="top_right" @tap="createFolder" style="margin-right: 20rpx;">
|
<view class="top_right" @tap="createFolder" style="margin-right: 20rpx">
|
||||||
<uni-icons type="folder-add" size="17" color="#fff"></uni-icons>
|
<uni-icons type="folder-add" size="17" color="#fff"></uni-icons>
|
||||||
<text>发布文章</text>
|
<text>发布文章</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</z-nav-bar>
|
</z-nav-bar>
|
||||||
<view
|
<view
|
||||||
class="doctors_module"
|
class="doctors_module"
|
||||||
:style="`top: ${42 + statusBarHeight}px;`"
|
:style="`top: ${42 + statusBarHeight}px;`"
|
||||||
@@ -198,8 +198,8 @@
|
|||||||
v-for="(item, index) in list"
|
v-for="(item, index) in list"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:imgList="item.fileList1"
|
:imgList="item.fileList1"
|
||||||
:avatar="item.taihuTalent.icon"
|
:avatar="item.taihuTalent&&item.taihuTalent.icon?item.taihuTalent.icon:''"
|
||||||
:name="item.taihuTalent.name"
|
:name="item.taihuTalent&&item.taihuTalent.name?item.taihuTalent.name:''"
|
||||||
:createTime="item.createTime"
|
:createTime="item.createTime"
|
||||||
:title="item.title"
|
:title="item.title"
|
||||||
:content="item.content"
|
:content="item.content"
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
:giveRewardNumber="item.giveRewardNumber"
|
:giveRewardNumber="item.giveRewardNumber"
|
||||||
:commentCount="item.commentCount"
|
:commentCount="item.commentCount"
|
||||||
@clickDynamic="clickDynamic(index)"
|
@clickDynamic="clickDynamic(index)"
|
||||||
@clickUser="clickUser(item.id)"
|
@clickUser="clickUser(item)"
|
||||||
@clickFocus="clickFocus(index)"
|
@clickFocus="clickFocus(index)"
|
||||||
@clickThumbsup="(type) => clickThumbsup(item.id, type)"
|
@clickThumbsup="(type) => clickThumbsup(item.id, type)"
|
||||||
@clickGiveReward="clickGiveReward(item.id)"
|
@clickGiveReward="clickGiveReward(item.id)"
|
||||||
@@ -227,8 +227,8 @@
|
|||||||
<text class="null_text" v-else>{{ null_text }}</text>
|
<text class="null_text" v-else>{{ null_text }}</text>
|
||||||
|
|
||||||
<z-navigation></z-navigation>
|
<z-navigation></z-navigation>
|
||||||
<common-pinglun ref="pinglun" @close="close"></common-pinglun>
|
<common-pinglun ref="pinglun" @close="close" @show="(e)=>pinglunShow=e"></common-pinglun>
|
||||||
<common-likeList ref="commonLikeList" @close="close"></common-likeList>
|
<common-likeList ref="commonLikeList" @close="close" @show="(e)=>likeShow=e"></common-likeList>
|
||||||
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff">
|
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff">
|
||||||
<uni-popup-share @select="haveSelected"></uni-popup-share>
|
<uni-popup-share @select="haveSelected"></uni-popup-share>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
@@ -252,7 +252,8 @@ export default {
|
|||||||
list: [],
|
list: [],
|
||||||
|
|
||||||
null_text: "",
|
null_text: "",
|
||||||
|
pinglunShow:false,
|
||||||
|
likeShow:false,
|
||||||
current: 1,
|
current: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
courseName: "",
|
courseName: "",
|
||||||
@@ -275,6 +276,14 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
if(this.pinglunShow){
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if(this.likeShow){
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
return false
|
||||||
|
}
|
||||||
this.isRefreshing = true;
|
this.isRefreshing = true;
|
||||||
console.log("下拉刷新");
|
console.log("下拉刷新");
|
||||||
|
|
||||||
@@ -288,7 +297,6 @@ export default {
|
|||||||
this.getArticleListData();
|
this.getArticleListData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
this.isRefreshing = false;
|
this.isRefreshing = false;
|
||||||
console.log("下拉刷新已停止");
|
console.log("下拉刷新已停止");
|
||||||
@@ -300,6 +308,19 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
refreshData(reset) {
|
||||||
|
if (reset) {
|
||||||
|
this.currentCateIndex = 0;
|
||||||
|
|
||||||
|
//重置
|
||||||
|
this.list = [];
|
||||||
|
this.noMore = false;
|
||||||
|
this.show = false;
|
||||||
|
this.count = 0;
|
||||||
|
this.current = 1;
|
||||||
|
this.getArticleListData();
|
||||||
|
}
|
||||||
|
},
|
||||||
createFolder() {
|
createFolder() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/articleList/article?navTitle=文章&title=文章&type=add`,
|
url: `/pages/articleList/article?navTitle=文章&title=文章&type=add`,
|
||||||
@@ -359,6 +380,9 @@ export default {
|
|||||||
clickUser(e) {
|
clickUser(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
console.log("childUser");
|
console.log("childUser");
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/talents/detail?id=" + e.taihuTalent.id,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 点击关注
|
// 点击关注
|
||||||
clickFocus(e) {
|
clickFocus(e) {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
class="card_label"
|
class="card_label"
|
||||||
v-if="statusTitle"
|
v-if="statusTitle"
|
||||||
:style="`background-color:${statusColor} ;`"
|
:style="`background-color:${statusColor} ;`"
|
||||||
>{{item.state==4?'质检未通过': statusTitle }}</text
|
>{{ item.state == 4 ? "质检未通过" : statusTitle }}</text
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
v-if="currentCateIndex == 3 && item.state == 6"
|
v-if="currentCateIndex == 3 && item.state == 6"
|
||||||
@@ -168,22 +168,50 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
@click.stop="changeShowFlag(item)"
|
|
||||||
v-if="taihumedId == 4"
|
v-if="taihumedId == 4"
|
||||||
:style="`color: ${
|
:style="`color: ${
|
||||||
item.showFlag == 1 ? '#5188e5' : '#5e6d82'
|
item.showFlag == 1 ? '#5188e5' : '#5e6d82'
|
||||||
};display: flex;align-items: center;`"
|
};display: flex;align-items: center;`"
|
||||||
>
|
>
|
||||||
<text style="margin-right: 10rpx"
|
<template @click.stop="changeShowFlag(item)">
|
||||||
>是否在我的医案中展示</text
|
<text style="margin-right: 10rpx"
|
||||||
>
|
>是否在我的医案中展示</text
|
||||||
<uni-icons
|
>
|
||||||
:color="item.showFlag == 1 ? '#5188e5' : '#5e6d82'"
|
<uni-icons
|
||||||
:type="
|
:color="item.showFlag == 1 ? '#5188e5' : '#5e6d82'"
|
||||||
item.showFlag == 0 ? 'eye-slash-filled' : 'eye-filled'
|
:type="
|
||||||
|
item.showFlag == 0 ? 'eye-slash-filled' : 'eye-filled'
|
||||||
|
"
|
||||||
|
size="24"
|
||||||
|
></uni-icons>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<view @click.stop="changeShowArticleFlag(item)"
|
||||||
|
v-if="item.articleFlag == 0"
|
||||||
|
style="
|
||||||
|
position: absolute;
|
||||||
|
right: 20rpx;
|
||||||
|
top: 0;
|
||||||
|
background-color: #0552c5;
|
||||||
|
padding: 2rpx 20rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
color: #fff;
|
||||||
"
|
"
|
||||||
size="24"
|
>发布医案文章</view
|
||||||
></uni-icons>
|
>
|
||||||
|
<view
|
||||||
|
v-else
|
||||||
|
style="
|
||||||
|
position: absolute;
|
||||||
|
right: 20rpx;
|
||||||
|
top: 0;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 2rpx 20rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
color: #0552c5;
|
||||||
|
"
|
||||||
|
>已发布</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view @click.stop="changeShowFlag(item)" v-if="taihumedId == 4" :style="`color: ${item.article_flag==1?'#5188e5':'#5e6d82'};display: flex;align-items: center;`">
|
<!-- <view @click.stop="changeShowFlag(item)" v-if="taihumedId == 4" :style="`color: ${item.article_flag==1?'#5188e5':'#5e6d82'};display: flex;align-items: center;`">
|
||||||
<text style="margin-right: 10rpx;">是否在我的文章中展示</text>
|
<text style="margin-right: 10rpx;">是否在我的文章中展示</text>
|
||||||
@@ -401,6 +429,24 @@ export default {
|
|||||||
this.getListData(this.taihumedId);
|
this.getListData(this.taihumedId);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
changeShowArticleFlag(data) {
|
||||||
|
this.$http
|
||||||
|
.request({
|
||||||
|
url: "common/medicalRecords/addTaihuTalentArticle",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
...data,
|
||||||
|
showArticleFlag: 1,
|
||||||
|
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.getListData(this.taihumedId);
|
||||||
|
});
|
||||||
|
},
|
||||||
//加载更多
|
//加载更多
|
||||||
loadMore() {
|
loadMore() {
|
||||||
this.getListData(this.taihumedId);
|
this.getListData(this.taihumedId);
|
||||||
|
|||||||
@@ -382,6 +382,10 @@ export default {
|
|||||||
this.$commonJS.showToast("请输入 " + titleHtml);
|
this.$commonJS.showToast("请输入 " + titleHtml);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (this.fileList1.length == 0) {
|
||||||
|
this.$commonJS.showToast("请至少上传一张图片");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
["妇科", "儿科"].includes(this.medicalForm.labelTitle) &&
|
["妇科", "儿科"].includes(this.medicalForm.labelTitle) &&
|
||||||
|
|||||||
@@ -270,11 +270,7 @@ export default {
|
|||||||
url: "/pages/curriculum/index/index",
|
url: "/pages/curriculum/index/index",
|
||||||
type: "pageJump",
|
type: "pageJump",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "我的文章",
|
|
||||||
url: "/pages/articleList/index",
|
|
||||||
type: "pageJump",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "个人资料",
|
name: "个人资料",
|
||||||
url: "/pages/my/persData",
|
url: "/pages/my/persData",
|
||||||
@@ -295,9 +291,10 @@ export default {
|
|||||||
if (this.userInfo.id != undefined) {
|
if (this.userInfo.id != undefined) {
|
||||||
try {
|
try {
|
||||||
// 同时发送两个请求,使用 Promise.all 确保并行处理
|
// 同时发送两个请求,使用 Promise.all 确保并行处理
|
||||||
const [res1, res2] = await Promise.all([
|
const [res1, res2,res3] = await Promise.all([
|
||||||
this.$http.post("common/medicalRecords/getMedicalRecordsRoleByUser"),
|
this.$http.post("common/medicalRecords/getMedicalRecordsRoleByUser"),
|
||||||
this.$http.post("common/medicalRecords/canCheck")
|
this.$http.post("common/medicalRecords/canCheck"),
|
||||||
|
this.$http.post("common/taihuTalentArticle/getArticleRoleByUser")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
console.log("res1 at line 237:", res1);
|
console.log("res1 at line 237:", res1);
|
||||||
@@ -313,13 +310,24 @@ export default {
|
|||||||
type: "pageJump",
|
type: "pageJump",
|
||||||
contentType: "shengpi",
|
contentType: "shengpi",
|
||||||
});
|
});
|
||||||
} if (res1.code == 0 && res1.roleFlag == 1) {
|
}
|
||||||
|
|
||||||
|
if (res1.code == 0 && res1.roleFlag == 1) {
|
||||||
this.pageList.splice(2, 0, {
|
this.pageList.splice(2, 0, {
|
||||||
name: "我的医案",
|
name: "我的医案",
|
||||||
url: "/pages/medicalRecords/index",
|
url: "/pages/medicalRecords/index",
|
||||||
type: "pageJump",
|
type: "pageJump",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (res3.code == 0 && res3.roleFlag == 1) {
|
||||||
|
this.pageList.splice(2, 0, {
|
||||||
|
|
||||||
|
name: "我的文章",
|
||||||
|
url: "/pages/articleList/index",
|
||||||
|
type: "pageJump",
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 在两个请求都成功后更新 pageList
|
// 在两个请求都成功后更新 pageList
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<view class="bottom_input_box" :style="show ? 'bottom: 430rpx' : ''">
|
||||||
|
<!-- <image src="../static/audio.png" mode=""></image> -->
|
||||||
|
|
||||||
|
<image src="./emoji.png" @click="emojichet" mode=""></image><Emoji :show="show" @emoji="emojiChange" @emojiblur="emojiblur" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Emoji from './emoji.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false, // 表示 emoji 列表是否显示
|
||||||
|
inputValue: '', // 输入框的值
|
||||||
|
focus: false, // 是否获得焦点
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
Emoji
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
confirm() {
|
||||||
|
this.$emit('inputvalue', this.inputValue); // 发送按钮点击时,把input的值传递给父组件
|
||||||
|
},
|
||||||
|
|
||||||
|
emojiblur() {
|
||||||
|
this.show = false; // 关闭 emoji 列表
|
||||||
|
},
|
||||||
|
|
||||||
|
emojiChange(e) {
|
||||||
|
this.inputValue += e; // 添加 emoji 到输入框中
|
||||||
|
},
|
||||||
|
|
||||||
|
keychange() {
|
||||||
|
this.show = false; // 关闭 emoji 列表并打开键盘
|
||||||
|
this.focus = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
emojichet() {
|
||||||
|
this.show = true; // 打开 emoji 列表
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.bottom_input_box {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
height: 160rpx;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 99;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
border-radius: 20rpx 20rpx 0px 0px;
|
||||||
|
|
||||||
|
image {
|
||||||
|
height: 62rpx;
|
||||||
|
width: 62rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input_ {
|
||||||
|
height: 62rpx;
|
||||||
|
width: calc(100% - 300rpx);
|
||||||
|
border: 1rpx solid #bbbbbb;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 90%;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
BIN
uni_modules/hb-comment/components/hb-comment/emoji.png
Normal file
BIN
uni_modules/hb-comment/components/hb-comment/emoji.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
79
uni_modules/hb-comment/components/hb-comment/emoji.vue
Normal file
79
uni_modules/hb-comment/components/hb-comment/emoji.vue
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<template>
|
||||||
|
<view class="emoji_blur" @click="emoji_blur" v-if="show">
|
||||||
|
<view class="emoji_box">
|
||||||
|
<scroll-view class="scrool" scroll-y="true">
|
||||||
|
<view class="emojis">
|
||||||
|
<text
|
||||||
|
@click.stop="tap(item)"
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
{{ item }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
show: Boolean
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: [
|
||||||
|
'😃', '😆', '😅', '🤣', '😂', '🙂', '🙃', '😉', '😊', '😇', '🥰', '😍', '🤩', '😘', '😗', '☺️', '😚', '😙',
|
||||||
|
'😋', '😛', '😜', '🤪', '😝', '🤑', '😩', '😖', '😨', '😭', '😞', '🤓', '🤠', '😎', '🥳', '😵', '🤧', '🤕',
|
||||||
|
'🤗', '🤭', '🤫', '🤔', '🤐', '🤨', '😐', '😑', '😶', '😏', '😒', '🙄', '😬', '🤥', '😶🌫️', '😮🌫️', '😴',
|
||||||
|
'🤮', '❤️', '💯', '💔', '💩', '🤡', '🤖', '👻', '🙈', '🙉', '🙊', '💣', '💋', '😡', '🤬', '😠'
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
tap(item) {
|
||||||
|
this.$emit('emoji', item); // 触发 emoji 事件,将选择的 emoji 传给父组件
|
||||||
|
},
|
||||||
|
emoji_blur() {
|
||||||
|
this.$emit('emojiblur'); // 触发 emojiblur 事件,告诉父组件关闭 emoji 选择器
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.emoji_blur {
|
||||||
|
height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.emoji_box {
|
||||||
|
height: 430rpx;
|
||||||
|
background: #f6f6f6;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrool {
|
||||||
|
height: 400rpx;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.emojis {
|
||||||
|
width: 95%;
|
||||||
|
margin: 0 auto;
|
||||||
|
font-size: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10rpx 25rpx;
|
||||||
|
flex-shrink: 3;
|
||||||
|
padding-bottom: 50rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="hb-comment" style="height: 60vh">
|
<view
|
||||||
|
class="hb-comment"
|
||||||
|
:style="isDisable || isShowList || isPopup ? 'height:auto' : 'height: 70vh'"
|
||||||
|
id="commentData"
|
||||||
|
>
|
||||||
<!-- 阅读数-start -->
|
<!-- 阅读数-start -->
|
||||||
|
|
||||||
<!-- 阅读数-end -->
|
<!-- 阅读数-end -->
|
||||||
@@ -11,7 +15,21 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
<!-- 阅读数下边那条线-end -->
|
<!-- 阅读数下边那条线-end -->
|
||||||
<!-- 评论主体-start -->
|
<!-- 评论主体-start -->
|
||||||
<view class="comment-list" v-if="commentData.comment.length != 0">
|
<view
|
||||||
|
class="comment-list"
|
||||||
|
:style="
|
||||||
|
isDisable || isShowList
|
||||||
|
? ' background-color: #f7f7f7;padding: 4px 10px;display: flex;align-items:flex-start'
|
||||||
|
: ''
|
||||||
|
"
|
||||||
|
v-if="commentData.comment.length != 0"
|
||||||
|
>
|
||||||
|
<uni-icons
|
||||||
|
v-if="isDisable || isShowList"
|
||||||
|
type="chat"
|
||||||
|
size="22"
|
||||||
|
style="color: #5188e5; margin-right: 10rpx; margin-top: 10rpx"
|
||||||
|
></uni-icons>
|
||||||
<!-- 评论主体-顶部数量及发表评论按钮-start -->
|
<!-- 评论主体-顶部数量及发表评论按钮-start -->
|
||||||
<!-- <view class="comment-num">
|
<!-- <view class="comment-num">
|
||||||
<view>共 {{ commentData.commentSize }} 条评论</view>
|
<view>共 {{ commentData.commentSize }} 条评论</view>
|
||||||
@@ -23,191 +41,213 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
<!-- 评论主体-顶部数量及发表评论按钮-end -->
|
<!-- 评论主体-顶部数量及发表评论按钮-end -->
|
||||||
<!-- 评论列表-start -->
|
<!-- 评论列表-start -->
|
||||||
<view class="comment-box" v-for="(item, index) in commentData.comment">
|
<view :style="isDisable || isShowList ? 'width:calc(100% - 46rpx);' : ''">
|
||||||
<view class="comment-box-item">
|
<view class="comment-box" v-for="(item, index) in commentData.comment">
|
||||||
<view>
|
<view class="comment-box-item">
|
||||||
<image
|
<view>
|
||||||
v-if="item.user.avatar"
|
<image
|
||||||
:src="item.user.avatar"
|
v-if="item.user.avatar"
|
||||||
mode="aspectFill"
|
:src="item.user.avatar"
|
||||||
class="avatar"
|
mode="aspectFill"
|
||||||
></image>
|
class="avatar"
|
||||||
<image
|
></image>
|
||||||
v-else
|
<image
|
||||||
src="/static/icon/noIcon.png"
|
v-else
|
||||||
mode="aspectFill"
|
src="/static/icon/noIcon.png"
|
||||||
class="avatar"
|
mode="aspectFill"
|
||||||
></image>
|
class="avatar"
|
||||||
</view>
|
></image>
|
||||||
<view class="comment-main">
|
|
||||||
<!-- 父评论体-start -->
|
|
||||||
<view class="comment-main-top">
|
|
||||||
<view class="nick-name-box">
|
|
||||||
<view class="nick-name"
|
|
||||||
>{{ item.user.nickname ? item.user.nickname : "普通用户" }}
|
|
||||||
<text
|
|
||||||
class="zuozhe"
|
|
||||||
v-if="user.userId || user.id == item.user.userId"
|
|
||||||
>作者</text
|
|
||||||
></view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="comment-main">
|
||||||
class="comment-main-content"
|
<!-- 父评论体-start -->
|
||||||
style="color: #232325; line-height: 38rpx"
|
<view class="comment-main-top">
|
||||||
@click="reply(item.user.nickname, item.user.nickname, item.id)"
|
<view class="nick-name-box">
|
||||||
>
|
<view class="nick-name"
|
||||||
{{ item.content }}
|
>{{ item.user.nickname ? item.user.nickname : "普通用户" }}
|
||||||
<!-- {{
|
<text class="zuozhe" v-if="articleUserId == item.userId"
|
||||||
|
>作者</text
|
||||||
|
></view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="comment-main-content"
|
||||||
|
style="color: #232325; line-height: 38rpx"
|
||||||
|
@click="reply(item.user.nickname, item.user.nickname, item.id)"
|
||||||
|
>
|
||||||
|
{{ item.content }}
|
||||||
|
<!-- {{
|
||||||
item.content.length > 60
|
item.content.length > 60
|
||||||
? item.content.slice(0, 59)
|
? item.content.slice(0, 59)
|
||||||
: item.content
|
: item.content
|
||||||
}} -->
|
}} -->
|
||||||
<!-- <span v-if="item.content.length > 60">
|
<!-- <span v-if="item.content.length > 60">
|
||||||
{{ item.hasShowMore ? item.content.slice(59) : "..." }}
|
{{ item.hasShowMore ? item.content.slice(59) : "..." }}
|
||||||
<span class="foot-btn" @click="showMore(item.id)" style="color: #5188e5 !important;">
|
<span class="foot-btn" @click="showMore(item.id)" style="color: #5188e5 !important;">
|
||||||
{{ item.hasShowMore ? "收起" : "展开" }}
|
{{ item.hasShowMore ? "收起" : "展开" }}
|
||||||
</span>
|
</span>
|
||||||
</span> -->
|
</span> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="comment-main-foot">
|
<view class="comment-main-foot">
|
||||||
<view
|
<view
|
||||||
class="foot-time"
|
@click="
|
||||||
style="color: #b7b8ba; letter-spacing: 1rpx; font-size: 24rpx"
|
reply(item.user.nickname, item.user.nickname, item.id)
|
||||||
>{{ item.createTime }}</view
|
"
|
||||||
>
|
class="foot-time"
|
||||||
<view
|
style="color: #b7b8ba; letter-spacing: 1rpx; font-size: 24rpx"
|
||||||
class="foot-btn"
|
>{{ item.createTime }}</view
|
||||||
style="color: #777775"
|
>
|
||||||
@click="reply(item.user.nickname, item.user.nickname, item.id)"
|
<view
|
||||||
>回复</view
|
class="foot-btn"
|
||||||
>
|
style="color: #777775"
|
||||||
<!-- <view
|
v-if="!isDisable"
|
||||||
|
@click="
|
||||||
|
reply(item.user.nickname, item.user.nickname, item.id)
|
||||||
|
"
|
||||||
|
>回复</view
|
||||||
|
>
|
||||||
|
<!-- <view
|
||||||
class="foot-btn"
|
class="foot-btn"
|
||||||
v-if="item.owner"
|
v-if="item.owner"
|
||||||
@click="confirmDelete(item.id)"
|
@click="confirmDelete(item.id)"
|
||||||
>删除</view
|
>删除</view
|
||||||
> -->
|
> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 父评论体-end -->
|
<!-- 父评论体-end -->
|
||||||
<!-- 子评论列表-start -->
|
<!-- 子评论列表-start -->
|
||||||
<view class="comment-sub-box" v-if="item.children.length != 0">
|
<view class="comment-sub-box" v-if="item.children.length != 0">
|
||||||
<view class="comment-sub-item" v-for="each in item.children">
|
<view class="comment-sub-item" v-for="each in item.children">
|
||||||
<view>
|
<view>
|
||||||
<image
|
<image
|
||||||
v-if="each.user.avatar"
|
v-if="each.user.avatar"
|
||||||
:src="each.user.avatar"
|
:src="each.user.avatar"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
class="avatar"
|
class="avatar"
|
||||||
></image>
|
></image>
|
||||||
<image
|
<image
|
||||||
v-else
|
v-else
|
||||||
src="/static/icon/noIcon.png"
|
src="/static/icon/noIcon.png"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
class="avatar"
|
class="avatar"
|
||||||
></image>
|
></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="comment-main">
|
<view class="comment-main">
|
||||||
<view class="sub-comment-main-top">
|
<view class="sub-comment-main-top">
|
||||||
<view class="nick-name" v-if="each.user"
|
<view class="nick-name" v-if="each.user"
|
||||||
>{{
|
>{{
|
||||||
each.user.nickname ? each.user.nickname : "普通用户"
|
each.user.nickname ? each.user.nickname : "普通用户"
|
||||||
}}
|
}}
|
||||||
<text
|
<text class="zuozhe" v-if="articleUserId == each.userId"
|
||||||
class="zuozhe"
|
>作者</text
|
||||||
v-if="user.userId || user.id == each.user.userId"
|
>
|
||||||
>作者</text
|
</view>
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
class="comment-main-content"
|
|
||||||
style="color: #232325 !important; line-height: 38rpx"
|
|
||||||
>
|
|
||||||
{{ each.content }}
|
|
||||||
</view>
|
|
||||||
<view class="comment-main-foot">
|
|
||||||
<view
|
<view
|
||||||
class="foot-time"
|
class="comment-main-content"
|
||||||
style="
|
style="color: #232325 !important; line-height: 38rpx"
|
||||||
color: #b7b8ba;
|
|
||||||
letter-spacing: 1rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
"
|
|
||||||
>{{ each.createTime }}</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="foot-btn"
|
|
||||||
style="color: #777775"
|
|
||||||
v-if="each.user"
|
|
||||||
@click="
|
@click="
|
||||||
reply(each.user.nickname, each.user.nickname, item.id)
|
reply(each.user.nickname, each.user.nickname, item.id)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
回复</view
|
{{ each.content }}
|
||||||
>
|
</view>
|
||||||
<!-- <view
|
<view class="comment-main-foot">
|
||||||
|
<view
|
||||||
|
@click="
|
||||||
|
reply(each.user.nickname, each.user.nickname, item.id)
|
||||||
|
"
|
||||||
|
class="foot-time"
|
||||||
|
style="
|
||||||
|
color: #b7b8ba;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
"
|
||||||
|
>{{ each.createTime }}</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="foot-btn"
|
||||||
|
style="color: #777775"
|
||||||
|
v-if="each.user && !isDisable"
|
||||||
|
@click="
|
||||||
|
reply(each.user.nickname, each.user.nickname, item.id)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
回复</view
|
||||||
|
>
|
||||||
|
<!-- <view
|
||||||
class="foot-btn"
|
class="foot-btn"
|
||||||
v-if="each.owner"
|
v-if="each.owner"
|
||||||
@click="confirmDelete(each.id)"
|
@click="confirmDelete(each.id)"
|
||||||
>删除
|
>删除
|
||||||
</view> -->
|
</view> -->
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 子评论列表-end -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 子评论列表-end -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 评论列表-end -->
|
<!-- 评论列表-end -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 评论主体-end -->
|
<!-- 评论主体-end -->
|
||||||
<!-- 无评论-start -->
|
<!-- 无评论-start -->
|
||||||
<view class="comment-none">
|
<view
|
||||||
<image v-if="user.icon"
|
class="comment-none"
|
||||||
|
@click="
|
||||||
|
showInput = false;
|
||||||
|
commentContent = '';
|
||||||
|
"
|
||||||
|
v-if="!isDisable"
|
||||||
|
style="background-color: #fafafa"
|
||||||
|
>
|
||||||
|
<!-- <image
|
||||||
|
v-if="user.icon"
|
||||||
:src="user.icon"
|
:src="user.icon"
|
||||||
style="
|
style="
|
||||||
width: 60rpx;
|
width: 64rpx;
|
||||||
height: 60rpx;
|
height: 64rpx;
|
||||||
margin: 0 8rpx;
|
margin: 0 8rpx;
|
||||||
display: block;
|
display: block;
|
||||||
border-radius: 60rpx;
|
border-radius: 64rpx;
|
||||||
margin-top: 4rpx;
|
margin-top: 4rpx;
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<image v-else
|
<image
|
||||||
|
v-else
|
||||||
src="/static/icon/noIcon.png"
|
src="/static/icon/noIcon.png"
|
||||||
style="
|
style="
|
||||||
width: 60rpx;
|
width: 64rpx;
|
||||||
height: 60rpx;
|
height: 64rpx;
|
||||||
margin: 0 8rpx;
|
margin: 0 8rpx;
|
||||||
display: block;
|
display: block;
|
||||||
border-radius: 60rpx;margin-top: 4rpx;
|
border-radius: 64rpx;
|
||||||
|
margin-top: 4rpx;
|
||||||
"
|
"
|
||||||
/>
|
/> -->
|
||||||
|
|
||||||
<!-- background-color: #dadada59; -->
|
<!-- background-color: #dadada59; -->
|
||||||
<view
|
<view
|
||||||
style="
|
style="
|
||||||
width: calc(100% - 100rpx);
|
width: calc(100% - 20rpx);
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 14rpx 20rpx;
|
padding: 14rpx 20rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<view v-if="currentInputComment" style="position: absolute; top: 10rpx"
|
<!-- <view v-if="currentInputComment" style="position: absolute; top: 10rpx"
|
||||||
><text @click="currentInputComment = ''">清空</text
|
><text @click="currentInputComment = ''">清空</text
|
||||||
><text @click="sendComment">发送</text></view
|
><text @click="sendComment">发送</text></view
|
||||||
>
|
> -->
|
||||||
<!-- @click="showInput = true" -->
|
<!-- @click="showInput = true" -->
|
||||||
<view
|
<view
|
||||||
style="font-size: 30rpx; width: calc(100%)"
|
style="font-size: 28rpx; width: calc(100%)"
|
||||||
@click="reply('', '', 0)"
|
@click.stop="reply('', '', 0)"
|
||||||
v-if="!showInput"
|
v-if="!showInput"
|
||||||
>写评论...</view
|
>发表评论...</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
@@ -215,18 +255,51 @@
|
|||||||
:style="{ bottom: keyboardHeight + 'px' }"
|
:style="{ bottom: keyboardHeight + 'px' }"
|
||||||
v-if="showInput"
|
v-if="showInput"
|
||||||
>
|
>
|
||||||
<view style="overflow: hidden; margin-bottom: 4rpx;font-size: 26rpx"
|
<view style="overflow: hidden; margin-bottom: 4rpx; font-size: 28rpx"
|
||||||
><text
|
><text
|
||||||
@click="
|
@click.stop="
|
||||||
showInput = false;
|
showInput = false;
|
||||||
commentContent = '';
|
commentContent = '';
|
||||||
"
|
"
|
||||||
style="float: left"
|
style="float: left"
|
||||||
>取消</text
|
>取消</text
|
||||||
><text @click="sendComment" style="float: right; color: #1985fd"
|
>
|
||||||
|
|
||||||
|
<text @click.stop="sendComment" style="float: right; color: #1985fd"
|
||||||
>发送</text
|
>发送</text
|
||||||
></view
|
>
|
||||||
|
<image v-if="!show"
|
||||||
|
src="./emoji.png"
|
||||||
|
@click.stop="emojichet()"
|
||||||
|
mode=""
|
||||||
|
style="
|
||||||
|
height: 52rpx;
|
||||||
|
width: 52rpx;
|
||||||
|
object-fit: fill;
|
||||||
|
float: right;
|
||||||
|
margin-right: 2%;
|
||||||
|
margin-top: -4rpx;
|
||||||
|
"
|
||||||
|
></image
|
||||||
>
|
>
|
||||||
|
<image v-else
|
||||||
|
src="./jianpan.png"
|
||||||
|
@click.stop="emojichet()"
|
||||||
|
mode=""
|
||||||
|
style="
|
||||||
|
height: 52rpx;
|
||||||
|
width: 52rpx;
|
||||||
|
object-fit: fill;
|
||||||
|
float: right;
|
||||||
|
margin-right: 2%;
|
||||||
|
margin-top: -4rpx;
|
||||||
|
"
|
||||||
|
></image
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<textarea
|
<textarea
|
||||||
auto-height
|
auto-height
|
||||||
@@ -234,19 +307,37 @@
|
|||||||
v-model="commentContent"
|
v-model="commentContent"
|
||||||
class="comment-input"
|
class="comment-input"
|
||||||
maxlength="-1"
|
maxlength="-1"
|
||||||
:placeholder="placeholder ? placeholder : '写评论...'"
|
:placeholder="placeholder ? placeholder : '发表评论...'"
|
||||||
@focus="onInputFocus"
|
@focus.stop="onInputFocus"
|
||||||
@blur="onInputBlur"
|
@blur.stop="onInputBlur"
|
||||||
:auto-focus="showInput"
|
:auto-focus="showInput"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view
|
||||||
|
class="emoji_box"
|
||||||
|
v-if="show"
|
||||||
|
:style="{ height: keyboardHeight + 'px' }"
|
||||||
|
>
|
||||||
|
<scroll-view class="scrool" scroll-y="true">
|
||||||
|
<view class="emojis">
|
||||||
|
<text
|
||||||
|
@click.stop="tap(item)"
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
{{ item }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 暂无评论,<span @click="commentInput" style="color: #007AFF;">立即评论</span> -->
|
<!-- 暂无评论,<span @click="commentInput" style="color: #007AFF;">立即评论</span> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 无评论-end -->
|
<!-- 无评论-end -->
|
||||||
<!-- 新增评论-start -->
|
<!-- 新增评论-start -->
|
||||||
<view class="comment-submit-box" v-if="submit" @click="closeInput">
|
<view class="comment-submit-box" v-if="submit" @click.stop="closeInput">
|
||||||
<!-- 下边的click.stop.prevent用于让上边的click不传下去,以防点到下边的空白处触发closeInput方法 -->
|
<!-- 下边的click.stop.prevent用于让上边的click不传下去,以防点到下边的空白处触发closeInput方法 -->
|
||||||
<view
|
<view
|
||||||
class="comment-add"
|
class="comment-add"
|
||||||
@@ -271,19 +362,21 @@
|
|||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:adjust-position="false"
|
:adjust-position="false"
|
||||||
:show-confirm-bar="false"
|
:show-confirm-bar="false"
|
||||||
@blur="blur"
|
@blur.stop="blur"
|
||||||
@focus="focusOn"
|
@focus.stop="focusOn"
|
||||||
:focus="focus"
|
:focus="focus"
|
||||||
maxlength="800"
|
maxlength="800"
|
||||||
></textarea>
|
></textarea>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <Emoji :show="show" @emoji="emojiChange" @emojiblur="emojiblur" /> -->
|
||||||
<!-- 新增评论-end -->
|
<!-- 新增评论-end -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import text from "uview-ui/libs/config/props/text";
|
import text from "uview-ui/libs/config/props/text";
|
||||||
|
import Emoji from "./emoji.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "hb-comment",
|
name: "hb-comment",
|
||||||
@@ -294,12 +387,35 @@ export default {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
isDisable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
isShowList: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
isPopup: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
user: {
|
user: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
articleUserId: {
|
||||||
|
default: () => {
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
},
|
||||||
deleteTip: {
|
deleteTip: {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => {
|
default: () => {
|
||||||
@@ -315,9 +431,84 @@ export default {
|
|||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
Emoji,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
list: [
|
||||||
|
"😃",
|
||||||
|
"😆",
|
||||||
|
"😅",
|
||||||
|
"🤣",
|
||||||
|
"😂",
|
||||||
|
"🙂",
|
||||||
|
"🙃",
|
||||||
|
"😉",
|
||||||
|
"😊",
|
||||||
|
"😇",
|
||||||
|
"🥰",
|
||||||
|
"😍",
|
||||||
|
"🤩",
|
||||||
|
"😘",
|
||||||
|
"😗",
|
||||||
|
"☺️",
|
||||||
|
"😚",
|
||||||
|
"😙",
|
||||||
|
"😋",
|
||||||
|
"😛",
|
||||||
|
"😜",
|
||||||
|
"🤪",
|
||||||
|
"😝",
|
||||||
|
"🤑",
|
||||||
|
"😩",
|
||||||
|
"😖",
|
||||||
|
"😨",
|
||||||
|
"😭",
|
||||||
|
"😞",
|
||||||
|
"🤓",
|
||||||
|
"🤠",
|
||||||
|
"😎",
|
||||||
|
"🥳",
|
||||||
|
"😵",
|
||||||
|
"🤧",
|
||||||
|
"🤕",
|
||||||
|
"🤗",
|
||||||
|
"🤭",
|
||||||
|
"🤫",
|
||||||
|
"🤔",
|
||||||
|
"🤐",
|
||||||
|
"🤨",
|
||||||
|
"😐",
|
||||||
|
"😑",
|
||||||
|
"😶",
|
||||||
|
"😏",
|
||||||
|
"😒",
|
||||||
|
"🙄",
|
||||||
|
"😬",
|
||||||
|
"🤥",
|
||||||
|
"😶🌫️",
|
||||||
|
"😮🌫️",
|
||||||
|
"😴",
|
||||||
|
"🤮",
|
||||||
|
"❤️",
|
||||||
|
"💯",
|
||||||
|
"💔",
|
||||||
|
"💩",
|
||||||
|
"🤡",
|
||||||
|
"🤖",
|
||||||
|
"👻",
|
||||||
|
"🙈",
|
||||||
|
"🙉",
|
||||||
|
"🙊",
|
||||||
|
"💣",
|
||||||
|
"💋",
|
||||||
|
"😡",
|
||||||
|
"🤬",
|
||||||
|
"😠",
|
||||||
|
],
|
||||||
pId: 0,
|
pId: 0,
|
||||||
|
show: false, // 是否显示输入框
|
||||||
showInput: false, // 是否显示输入框
|
showInput: false, // 是否显示输入框
|
||||||
commentContent: "", // 评论内容
|
commentContent: "", // 评论内容
|
||||||
keyboardHeight: 0, // 软键盘高度
|
keyboardHeight: 0, // 软键盘高度
|
||||||
@@ -339,7 +530,7 @@ export default {
|
|||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.pId = 0;
|
this.pId = 0;
|
||||||
this.showInput = false;
|
this.showInput = false;
|
||||||
this.placeholder = "写评论...";
|
this.placeholder = "发表评论...";
|
||||||
this.commentContent = "";
|
this.commentContent = "";
|
||||||
|
|
||||||
this.keyboardListener = uni.onKeyboardHeightChange((res) => {
|
this.keyboardListener = uni.onKeyboardHeightChange((res) => {
|
||||||
@@ -356,16 +547,44 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
tap(item) {
|
||||||
|
console.log("item at line 515:", item);
|
||||||
|
this.commentContent += item;
|
||||||
|
|
||||||
|
// this.$emit("emoji", item); // 触发 emoji 事件,将选择的 emoji 传给父组件
|
||||||
|
},
|
||||||
|
|
||||||
|
emojichet() {
|
||||||
|
// this.reply("", "", 0);
|
||||||
|
|
||||||
|
this.show = !this.show; // 打开 emoji 列表
|
||||||
|
},
|
||||||
|
|
||||||
|
scrollToView(callback) {
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
query
|
||||||
|
.select("#commentData")
|
||||||
|
.boundingClientRect((rect) => {
|
||||||
|
if (rect) {
|
||||||
|
callback(rect);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
},
|
||||||
onInputFocus() {
|
onInputFocus() {
|
||||||
// 可以在这里添加额外的逻辑,如滚动到输入框位置
|
// 可以在这里添加额外的逻辑,如滚动到输入框位置
|
||||||
},
|
},
|
||||||
|
|
||||||
// 输入框失去焦点
|
// 输入框失去焦点
|
||||||
onInputBlur() {
|
onInputBlur() {
|
||||||
|
console.log(11111111111);
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!this.commentContent.trim() && !this.show) {
|
||||||
|
this.showInput = false;
|
||||||
|
}
|
||||||
|
}, 200);
|
||||||
|
|
||||||
// 如果输入框为空,点击空白处关闭输入框
|
// 如果输入框为空,点击空白处关闭输入框
|
||||||
if (!this.commentContent.trim()) {
|
|
||||||
this.showInput = false;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 发送评论
|
// 发送评论
|
||||||
@@ -378,6 +597,8 @@ export default {
|
|||||||
// 发送成功后清空并隐藏输入框
|
// 发送成功后清空并隐藏输入框
|
||||||
this.commentContent = "";
|
this.commentContent = "";
|
||||||
this.showInput = false;
|
this.showInput = false;
|
||||||
|
} else {
|
||||||
|
this.$commonJS.showToast("请输入评论");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 初始化评论
|
// 初始化评论
|
||||||
@@ -394,6 +615,9 @@ export default {
|
|||||||
stopPrevent() {},
|
stopPrevent() {},
|
||||||
// 回复评论
|
// 回复评论
|
||||||
reply(pUser, reUser, pId) {
|
reply(pUser, reUser, pId) {
|
||||||
|
if (this.isDisable) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
this.pUser = pUser;
|
this.pUser = pUser;
|
||||||
this.commentReq.pId = pId;
|
this.commentReq.pId = pId;
|
||||||
this.pId = pId;
|
this.pId = pId;
|
||||||
@@ -402,7 +626,7 @@ export default {
|
|||||||
this.placeholder = "回复 " + str + ":";
|
this.placeholder = "回复 " + str + ":";
|
||||||
} else {
|
} else {
|
||||||
var str = "";
|
var str = "";
|
||||||
this.placeholder = "写评论...";
|
this.placeholder = "发表评论...";
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (reUser) {
|
// if (reUser) {
|
||||||
@@ -585,14 +809,14 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.comment-main {
|
.comment-main {
|
||||||
width: calc(100% - 70rpx);
|
width: calc(100% - 64rpx);
|
||||||
|
|
||||||
padding-left: 20rpx;
|
padding-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-main-top {
|
.comment-main-top {
|
||||||
width: 600rpx;
|
width: 100%;
|
||||||
padding-top: 12rpx;
|
padding-top: 4rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
@@ -605,8 +829,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
width: 70rpx;
|
width: 64rpx;
|
||||||
height: 70rpx;
|
height: 64rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -709,11 +933,12 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.comment-none {
|
.comment-none {
|
||||||
|
height: auto;
|
||||||
padding: 4rpx 0;
|
padding: 4rpx 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// text-align: center;
|
// text-align: center;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
position: absolute;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -826,4 +1051,37 @@ export default {
|
|||||||
line-height: 20rpx;
|
line-height: 20rpx;
|
||||||
margin-top: -4rpx;
|
margin-top: -4rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.emoji_blur {
|
||||||
|
height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.emoji_box {
|
||||||
|
height: 440rpx;
|
||||||
|
background: #f6f6f6;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrool {
|
||||||
|
height: 400rpx;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.emojis {
|
||||||
|
width: 95%;
|
||||||
|
margin: 0 auto;
|
||||||
|
font-size: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10rpx 25rpx;
|
||||||
|
flex-shrink: 3;
|
||||||
|
// padding-bottom: 50rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
BIN
uni_modules/hb-comment/components/hb-comment/jianpan.png
Normal file
BIN
uni_modules/hb-comment/components/hb-comment/jianpan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 966 B |
Reference in New Issue
Block a user