This commit is contained in:
Gdpao
2020-08-14 19:49:57 +08:00
parent cd0e8bbf9e
commit 9158f27afb
5 changed files with 62 additions and 51 deletions

View File

@@ -52,7 +52,7 @@
</view>
<view class="child_content">{{ child.content }}</view>
</view>
<view class="more-reply" v-if="item.reply_count && is_more" @click="getReplyList(item.id)">展开更多回复<u-icon name="arrow-down"></u-icon></view>
<view class="more-reply" v-if="item.reply_count" @click="getReplyList(item.id)">展开更多回复<u-icon name="arrow-down"></u-icon></view>
</view>
</block>
<view class="no-data" v-if="!commentList.length">还没有评论快来评论吧</view>
@@ -292,6 +292,7 @@
height: 90rpx;
& > input {
width: 80%;
font-size: 24rpx;
padding: 4rpx 20rpx;
border-radius: 20rpx;
}
@@ -575,7 +576,6 @@ export default {
})
if (!this.page_[id] === 0) {
}
console.log(this.page_[id]);
this.$u.post("article/articleReplyList", {id: id, page: this.page_[id]}).then(res => {
uni.hideLoading();
if (res.errCode == 0) {
@@ -583,10 +583,8 @@ export default {
// this.is_more = false;
// }
this.page_[id]++;
console.log(this.page_[id]);
this.$nextTick(() => {
this.allList[id] = res.data;
})
this.allList[id] = res.data;
this.$forceUpdate();
console.log(this.allList);
}
})

View File

@@ -77,9 +77,9 @@
</view>
</view>
</view>
<view class="send-box">
<view class="send-box" @click="openKeyInput">
<input class="send-val" type="text" :placeholder="edit_text" placeholder-class="placeholder-class"
disabled="true" @blur="blue" @click="openKeyInput" value="" />
disabled="true" @click="openKeyInput" />
<text class="btn-send">发送</text>
</view>
<loading class="loading" @loading="onloading" :display="loadinging ? 'show' : 'hide'">
@@ -89,13 +89,13 @@
</scroller>
</cover-view>
<!-- 评论框 -->
<cover-view class="edit-box" :style="videoSize" v-if="is_edit">
<view class="input-main" :style="{ bottom: editTop }">
<input class="edit-input" type="text" value="" :focus="is_focus" :placeholder=" edit_text_other ? edit_text_other : edit_text"
<cover-view class="edit-box" :style="videoSize" v-if="is_edit" @click="hideEdit">
<view class="input-main">
<input class="edit-input" type="text" :focus="is_focus" :placeholder=" edit_text_other ? edit_text_other : edit_text"
placeholder-class="placeholder-class" v-model="send_value" />
<text class="btn-send" @click="sendComment">发送</text>
</view>
<view></view>
<!-- <view class="key-height" :style="{ height: editTop }"></view> -->
</cover-view>
<!-- 购物车 -->
<cover-view class="cart-box" v-if="cart_type">
@@ -124,9 +124,10 @@
<cover-image class="close" @click="goBack" src="../../static/close.png">
</cover-image>
<!-- 暂停按钮 -->
<cover-image class="pause" :style="{ top: fixTop + 100 }" @click="stoping" src="../../static/videoPlay.png"
v-if="!is_play">
</cover-image>
<cover-view class="pause" :style="{ top: fixTop + 100 }">
<cover-image class="pause-img" src="../../static/videoPlay.png" @click="stoping" v-if="!is_play">
</cover-image>
</cover-view>
</view>
</template>
@@ -242,9 +243,12 @@
},
// 发布评论
sendComment() {
console.log(this.article_id,this.send_value,this.pid,this.reply_id);
console.log(this.article_id, this.send_value, this.pid, this.reply_id);
if (this.send_value.length == 0) {
this.$u.toast("内容不能为空!");
uni.showToast({
title: "输入内容不能为空!",
icon: "none"
})
return;
}
uni.request({
@@ -266,7 +270,7 @@
this.send_value = "";
this.comment_num = res.data.num;
let p_id = res.data.data.data.pid;
console.log(this.pid,this.reply_id,this.comment_id);
console.log(this.pid, this.reply_id, this.comment_id);
if (res.data.data.data.pid) {
this.commentList[this.comment_id].reply_count = true;
console.log(this.allList[p_id]);
@@ -305,8 +309,7 @@
uni.showLoading({
title: "loading..."
})
if (!this.page_[id] === 0) {
}
if (!this.page_[id] === 0) {}
console.log(id);
uni.request({
url: temp_url + "article/articleReplyList",
@@ -325,11 +328,10 @@
this.is_more = false;
}
this.page_[id]++;
console.log(this.page_[id]);
this.$nextTick(function(){
this.allList[id] = res.data.data;
})
console.log(this.allList);
this.allList[id] = res.data.data;
this.$forceUpdate();
// console.log(this.page_[id]);
// console.log(this.allList);
}
}
})
@@ -404,7 +406,7 @@
},
// 打开评论输入
openKeyInput(data, index) {
console.log(data);
// console.log(data);
let me = this;
this.is_focus = true;
setTimeout(() => {
@@ -416,7 +418,7 @@
me.is_focus = false;
me.is_edit = false;
} else {
me.editTop = res.height;
me.editTop = res.height + "rpx";
}
})
this.comment_id = index;
@@ -458,6 +460,8 @@
url: "/pageB/sdetails/index?id=" + id + "&type=" + 1,
})
},
// 收起键盘
hideEdit() {},
// stop
stopClick(event) {
event.stopPropagation();
@@ -478,6 +482,7 @@
/* 关闭 */
.close {
z-index: 99;
position: fixed;
top: 100rpx;
right: 70rpx;
@@ -493,6 +498,11 @@
width: 100rpx;
height: 100rpx;
}
.pause-img {
width: 100rpx;
height: 100rpx;
}
/* 用户操作 */
.user-info {
@@ -561,7 +571,7 @@
}
.mask {
z-index: 999999;
z-index: 10000;
position: fixed;
top: 0;
left: 0;
@@ -569,7 +579,7 @@
}
.content-box {
z-index: 99;
z-index: 999;
position: fixed;
bottom: 0;
left: 0;
@@ -604,7 +614,7 @@
flex-direction: row;
padding-left: 100rpx;
}
.content-style {
width: 600rpx;
@@ -612,39 +622,37 @@
color: #333;
lines: 2;
}
.more-content-box {
margin-left: 100rpx;
}
.child-box {
}
.child-box {}
.child-info {
margin: 10rpx 0;
flex-direction: row;
align-items: center;
}
.child-avatar {
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
border-radius: 50%;
}
.child-name {
font-size: 22rpx;
color: #333;
}
.child_content {
padding: 4rpx 0;
margin-left: 40rpx;
font-size: 26rpx;
}
.more-comment {
margin: 10rpx 0;
font-size: 22rpx;
@@ -725,6 +733,7 @@
.input-main {
position: fixed;
left: 0;
bottom: 0;
/* #ifdef H5 */
display: flex;
/* #endif */
@@ -735,6 +744,13 @@
padding: 0 20rpx;
line-height: 80rpx;
background-color: #fff;
border-top-right-radius: 10rpx;
border-top-left-radius: 10rpx;
}
.key-height {
width: 750rpx;
background-color: #fff;
}
.edit-input {
@@ -746,7 +762,7 @@
}
.cart-box {
z-index: 99;
z-index: 1000;
position: fixed;
bottom: 0;
left: 0;