朋友圈

This commit is contained in:
cansnow
2026-01-11 14:00:09 +08:00
parent c38846f13b
commit 2a0677014a
3 changed files with 14 additions and 22 deletions
@@ -133,7 +133,7 @@
...mapGetters(["storeSelfInfo"]),
},
data(){
console.log(this.item);
//console.log(this.item);
return {
girdItemCustomStyle:{
padding: '0',
+10 -11
View File
@@ -56,14 +56,17 @@
</view>
<u-overlay :show="showInput" @click="showInput = false">
<view class="input-box" style="height: 100rpx;" @tap.stop>
<view class="input-box" :style="{
height: '100rpx',
bottom:keyboardHeight+'px'
}" @tap.stop>
<view class="input-box-flex">
<view class="input-box-flex-grow">
<input :adjust-position="false" type="text" class="content" id="input" v-model="content"
:confirm-type="'send'" :confirm-hold="true" placeholder-style="color:#DDD;" :cursor-spacing="6"
:placeholder="placeholder" :focus="true" @confirm="sendMsg" />
:placeholder="placeholder" :focus="true" @confirm="commitComment" />
</view>
<u-button class="btn" type="primary" size="mini" @tap.prevent.stop="sendMsg">发送</u-button>
<u-button class="btn" type="primary" size="mini" @tap.prevent.stop="commitComment">发送</u-button>
</view>
</view>
</u-overlay>
@@ -107,6 +110,7 @@
content: '',
placeholder: '',
showInput: false,
keyboardHeight:0,
focus: false,
id: '', //某一条朋友圈id
commentInfo: {},
@@ -131,17 +135,12 @@
},
onReady() {
console.log(this.storeSelfInfo);
let that = this;
uni.onKeyboardHeightChange(res => {
that.keyboardHeight = res.height;
if (res.height == 0) {
let windowHeight = this.$u.sys().windowHeight;
//this.scrollViewHeight = windowHeight - 90;
this.showInput = false;
that.showInput = false;
return;
} else {
let windowHeight = this.$u.sys().windowHeight;
//this.scrollViewHeight = (windowHeight - res.height) - 120;
}
});
},
@@ -343,7 +342,7 @@
this.showInput = true;
},
//提交评论消息
sendMsg() {
commitComment() {
let that=this;
if (!that.$u.trim(that.content)) {
return;
+3 -10
View File
@@ -52,16 +52,9 @@ const actions = {
return new Promise((resolve,reject)=>{
uni.$u.http.post('/friendcircle/comment',params).then(data=>{
console.log("评论成功",data);
let index = -1;
for(let i=0;i<state.list.length;i++){
if(state.list[i].id==params.id){
index = i;
break;
}
}
console.log("index",index);
if(index!=-1){
state.list[index].comments.unshift(params);
const index = state.list.findIndex(i => i.id ==params.id);
if(index>=0){
state.list[index].comments.unshift(data);
resolve(data);
}else{
reject(data);