Forráskód Böngészése

回复焦点问题

zouling 3 hónapja
szülő
commit
afa0a42a23

+ 8 - 8
property_ui/manage/components/car/list.vue

@@ -319,16 +319,16 @@
 				<view class="flex1 overh">
 					<view class="flexat mb14 ">
 						<view class="plname flex1 over">{{ite.commentUser.nickName}}</view>
-						<view class="plrbtn flexc flex0" @click.stop="getDzFn(ite.id,'2',ite.content,idx)">
+						<view class="plrbtn flexc flex0" @click="getDzFn(ite.id,'2',ite.content,idx)">
 							<image :src="nicond" v-if="ite.isLike=='Y'"></image>
 							<image :src="niconb" class="imga" v-else></image>
 							<view>点赞</view>
 						</view>
-						<view class="plrbtn flexc flex0" @click.stop="getHfFn('yjhf',ite,ite.id)">
+						<view class="plrbtn flexc flex0" @touchend.prevent="getHfFn('yjhf',ite,ite.id)">
 							<image :src="nicone" class="imgb"></image>
 							<view>回复</view>
 						</view>
-						<view class="plrbtn flexc flex0" @click.stop="getDelFn(ite.id)" v-if="checkPermi(['wuYe:commentIndex:remove'])&&ite.isMyself=='Y'">
+						<view class="plrbtn flexc flex0" @click="getDelFn(ite.id)" v-if="checkPermi(['wuYe:commentIndex:remove'])&&ite.isMyself=='Y'">
 							<image :src="del" class="imgc"></image>
 							<view class="cof4">删除</view>
 						</view>
@@ -351,16 +351,16 @@
 									<!-- 判断是不是二级回复的回复 加字段-->
 									<!-- <block v-if="ite."></block> -->
 								</view>
-								<view class="plrbtn flexc flex0" @click.stop="getDzFn(aite.id,'2',aite.content,idx,aidx,'ejdz')">
+								<view class="plrbtn flexc flex0" @click="getDzFn(aite.id,'2',aite.content,idx,aidx,'ejdz')">
 									<image :src="nicond" v-if="aite.isLike=='Y'"></image>
 									<image :src="niconb" class="imga" v-else></image>
 									<view>点赞</view>
 								</view>
-								<view class="plrbtn flexc flex0" @click.stop="getHfFn('ejhf',aite,ite.id)">
+								<view class="plrbtn flexc flex0" @touchend.prevent="getHfFn('ejhf',aite,ite.id)">
 									<image :src="nicone" class="imgb"></image>
 									<view>回复</view>
 								</view>
-								<view class="plrbtn flexc flex0" @click.stop="getDelFn(aite.id)" v-if="checkPermi(['wuYe:commentIndex:remove'])&&aite.isMyself=='Y'">
+								<view class="plrbtn flexc flex0" @click="getDelFn(aite.id)" v-if="checkPermi(['wuYe:commentIndex:remove'])&&aite.isMyself=='Y'">
 									<image :src="del" class="imgc"></image>
 									<view class="cof4">删除</view>
 								</view>
@@ -371,12 +371,12 @@
 						</view>
 					</view>
 					<view class="flexc" v-if="ite.childrenListCount>0">
-						<view class="zhanbox flexc" v-if="ite.reachflag" @click.stop="getZhanFn(ite,idx)">
+						<view class="zhanbox flexc" v-if="ite.reachflag" @click="getZhanFn(ite,idx)">
 							<block v-if="ite.childrenList&&ite.childrenList.length">展开更多</block>
 							<block v-else>展开{{ite.childrenListCount}}条回复</block>
 							<image :src="upimg" class="zhan"></image>
 						</view>
-						<view v-if="ite.childrenList&&ite.childrenList.length" class="zhanbox flexc ml10" @click.stop="getShouFn(idx)">收起<image :src="upimg"></view>
+						<view v-if="ite.childrenList&&ite.childrenList.length" class="zhanbox flexc ml10" @click="getShouFn(idx)">收起<image :src="upimg"></view>
 					</view>
 					<!-- <view style="height: 16rpx;" v-else></view>	 -->
 				</view>

+ 50 - 15
property_ui/manage/pages/community/newssqdetail.vue

@@ -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,14 +34,14 @@
 				<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>
-	<loading></loading>	
+		</block>	
+		<loading></loading>	
 	</view>
 </template>
 
@@ -64,6 +64,12 @@
 				starb:require('@/manage/static/news/starb.png'),
 				nonews:require('@/manage/static/news/nonews.png'),
 				baseUrl:config.baseUrl,
+				autoHeight:true,
+				confirmBar:false,
+				adrfixed:true,
+				adjustpos:false,
+				curspac:0,//光标和键盘距离
+				placeholder:'发表我的评论',
 				datainfo:{
 					
 				},
@@ -80,12 +86,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() {
@@ -94,8 +111,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){
@@ -215,7 +246,6 @@
 			},
 			getplDzFn(data){
 				var info=JSON.parse(JSON.stringify(data))
-				console.log(info,1)
 				this.getDzFn('2',info)
 			},
 			// 收藏
@@ -244,12 +274,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;
 			},
@@ -325,7 +360,6 @@
 						} else {
 							this.commentlist = this.list.concat(newArr)
 						}
-						console.log(this.commentlist)
 					}
 				})
 			},
@@ -374,6 +408,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;
 	}
@@ -381,6 +416,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>

+ 3 - 0
property_ui/manifest.json

@@ -8,6 +8,9 @@
     "app-plus" : {
         "usingComponents" : true,
         "nvueCompiler" : "uni-app",
+		"compatible" : {
+		    "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
+		},
         "splashscreen" : {
             "alwaysShowBeforeRender" : true,
             "waiting" : true,