|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="ndetail ">
|
|
|
+ <view class="ndetail " @click="getComflag">
|
|
|
<image :src="nonews" v-if="datainfo.status==2" class="noimg"></image>
|
|
|
<block v-else>
|
|
|
<!-- 详情 -->
|
|
@@ -12,16 +12,16 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="ndbfox flexc">
|
|
|
- <view class="flexcc ndbflist" @click="getHfFn">
|
|
|
+ <view class="flexcc ndbflist" @touchend.prevent="getHfFna">
|
|
|
<image :src="nicona"></image>
|
|
|
<view>{{datainfo.userComment}}</view>
|
|
|
</view>
|
|
|
- <view class="flexcc ndbflist" @click="getDzFn('1')">
|
|
|
+ <view class="flexcc ndbflist" @click.stop="getDzFn('1')">
|
|
|
<image :src="nicond" v-if="datainfo.isLike=='Y'"></image>
|
|
|
<image :src="niconb" v-else></image>
|
|
|
<view>{{datainfo.userLikes}}</view>
|
|
|
</view>
|
|
|
- <view class="flexcc ndbflist" @click="getScFn('1')">
|
|
|
+ <view class="flexcc ndbflist" @click.stop="getScFn('1')">
|
|
|
<image :src="starb" v-if="datainfo.isStar=='Y'"></image>
|
|
|
<image :src="niconc" v-else></image>
|
|
|
<view>{{datainfo.userStars}}</view>
|
|
@@ -34,10 +34,10 @@
|
|
|
<box-list :datainfo="commentlist" type="comment" @getZhanFn="getZhanFn" @getShouFn="getShouFn" @getDzFn="getplDzFn" @getHfFn="getplHfFn" @getDelFn="getDelFn"></box-list>
|
|
|
</view>
|
|
|
<!-- 评论 -->
|
|
|
- <view class="pjfbtn">
|
|
|
+ <view class="pjfbtn" @click.stop="btns" :style="{bottom: `${bottom}px`}">
|
|
|
<view class="flexc pjfbox">
|
|
|
- <uni-easyinput :focus="isfocus" type="textarea" autoHeight v-model="text" :inputBorder='false' placeholder="发表我的评论…" />
|
|
|
- <view class="btns" @click="getPinLunFn">发送</view>
|
|
|
+ <textarea :placeholder="placeholder" :adjust-position="adjustpos" :focus="isfocus" v-model="text" :auto-height="autoHeight" :cursor-spacing='curspac' fixed="true" :show-confirm-bar="confirmBar" ></textarea>
|
|
|
+ <view class="btns" @click.stop="getPinLunFn">发送</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</block>
|
|
@@ -66,6 +66,12 @@
|
|
|
upimg:require('@/mine/static/house/up.png'),
|
|
|
nonews:require('@/news/static/news/nonews.png'),
|
|
|
baseUrl:config.baseUrl,
|
|
|
+ autoHeight:true,
|
|
|
+ confirmBar:false,
|
|
|
+ adrfixed:true,
|
|
|
+ adjustpos:false,
|
|
|
+ curspac:0,//光标和键盘距离
|
|
|
+ placeholder:'发表我的评论',
|
|
|
datainfo:{
|
|
|
|
|
|
},
|
|
@@ -82,12 +88,23 @@
|
|
|
isRoot:'1',//isRoot,根评论id 1:根评论 2:子评论
|
|
|
isfocus:false,
|
|
|
plinfo:'',//二级评论信息
|
|
|
+ bottom:0,
|
|
|
}
|
|
|
},
|
|
|
onLoad: function(e) {
|
|
|
this.id=e.id;
|
|
|
this.getDetailFn();
|
|
|
- this.getRootComment()
|
|
|
+ this.getRootComment();
|
|
|
+ // #ifndef H5
|
|
|
+ uni.onKeyboardHeightChange(res=> { //监听键盘高度变化
|
|
|
+ const res_keyboard = uni.getSystemInfoSync();
|
|
|
+ // let key_height = res.height - (res_keyboard.screenHeight - res_keyboard.windowHeight)
|
|
|
+ this.bottom = `${ res.height>0 ? res.height : 0}`;
|
|
|
+ // if(this.bottom==0){
|
|
|
+ // this.isfocus=false;
|
|
|
+ // }
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
},
|
|
|
// 上拉触底加载更多触发事件
|
|
|
onReachBottom() {
|
|
@@ -96,8 +113,22 @@
|
|
|
this.getDataFn()
|
|
|
}
|
|
|
},
|
|
|
+ onPageScroll(e) {
|
|
|
+ this.isfocus=false;
|
|
|
+ },
|
|
|
methods:{
|
|
|
checkPermi, checkRole,
|
|
|
+ //评论
|
|
|
+ getComflag(){
|
|
|
+ if(this.isfocus){
|
|
|
+ this.isfocus=false;
|
|
|
+ this.placeholder="发表我的评论"
|
|
|
+ this.isRoot='1'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ btns(){
|
|
|
+
|
|
|
+ },
|
|
|
getDetailFn(){
|
|
|
newsDet(this.id).then(res=>{
|
|
|
if(res.code==200){
|
|
@@ -217,7 +248,6 @@
|
|
|
},
|
|
|
getplDzFn(data){
|
|
|
var info=JSON.parse(JSON.stringify(data))
|
|
|
- console.log(info,1)
|
|
|
this.getDzFn('2',info)
|
|
|
},
|
|
|
// 收藏
|
|
@@ -246,12 +276,17 @@
|
|
|
})
|
|
|
},
|
|
|
// 评论回复
|
|
|
- getHfFn(data){
|
|
|
+ getHfFna(data){
|
|
|
+ var that=this;
|
|
|
this.isRoot='1';
|
|
|
+ this.placeholder='发表我的评论'
|
|
|
this.isfocus=true;
|
|
|
},
|
|
|
getplHfFn(data){
|
|
|
+ this.isfocus=false;
|
|
|
+ var that=this;
|
|
|
this.plinfo=JSON.parse(JSON.stringify(data))
|
|
|
+ this.placeholder='回复:'+data.toNickName
|
|
|
this.isRoot='2';
|
|
|
this.isfocus=true;
|
|
|
},
|
|
@@ -327,7 +362,6 @@
|
|
|
} else {
|
|
|
this.commentlist = this.list.concat(newArr)
|
|
|
}
|
|
|
- console.log(this.commentlist)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -376,6 +410,7 @@
|
|
|
|
|
|
.pjfbtn{background: #FFFFFF;position: fixed;bottom: 0;left: 0;right: 0;padding:20rpx 48rpx;box-shadow: 0px 0px 18rpx 0px rgba(159,159,159,0.47);
|
|
|
.pjfbox{background: #E6E6E6;border-radius: 10rpx;
|
|
|
+ textarea{flex: 1;font-size: 26rpx;color: #222327;min-height: 40rpx;font-size: 26rpx;margin: 0;background: #E6E6E6;box-sizing: border-box;padding: 10rpx 0 10rpx 36rpx;border-radius:10rpx 0 0 10rpx;}
|
|
|
.btns{nt-weight: bold;padding: 0 34rpx;height: 60rpx;line-height: 60rpx;flex: 0 0 auto;
|
|
|
font-size: 26rpx;
|
|
|
}
|
|
@@ -383,6 +418,6 @@
|
|
|
color: #314081;}
|
|
|
}
|
|
|
|
|
|
-.pjfbtn /deep/ .uni-easyinput{flex: 1;font-size: 26rpx;color: #222327;}
|
|
|
-.pjfbtn /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;margin: 0;background: #E6E6E6;box-sizing: border-box;padding: 10rpx 0 10rpx 36rpx;border-radius:10rpx 0 0 10rpx;}
|
|
|
+// .pjfbtn /deep/ .uni-easyinput{flex: 1;font-size: 26rpx;color: #222327;}
|
|
|
+// .pjfbtn /deep/ .uni-textarea-textarea{min-height: 40rpx;font-size: 26rpx;margin: 0;background: #E6E6E6;box-sizing: border-box;padding: 10rpx 0 10rpx 36rpx;border-radius:10rpx 0 0 10rpx;}
|
|
|
</style>
|