朋友圈
This commit is contained in:
@@ -133,7 +133,7 @@
|
|||||||
...mapGetters(["storeSelfInfo"]),
|
...mapGetters(["storeSelfInfo"]),
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
console.log(this.item);
|
//console.log(this.item);
|
||||||
return {
|
return {
|
||||||
girdItemCustomStyle:{
|
girdItemCustomStyle:{
|
||||||
padding: '0',
|
padding: '0',
|
||||||
|
|||||||
@@ -56,14 +56,17 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-overlay :show="showInput" @click="showInput = false">
|
<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">
|
||||||
<view class="input-box-flex-grow">
|
<view class="input-box-flex-grow">
|
||||||
<input :adjust-position="false" type="text" class="content" id="input" v-model="content"
|
<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"
|
: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>
|
</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>
|
||||||
</view>
|
</view>
|
||||||
</u-overlay>
|
</u-overlay>
|
||||||
@@ -107,6 +110,7 @@
|
|||||||
content: '',
|
content: '',
|
||||||
placeholder: '',
|
placeholder: '',
|
||||||
showInput: false,
|
showInput: false,
|
||||||
|
keyboardHeight:0,
|
||||||
focus: false,
|
focus: false,
|
||||||
id: '', //某一条朋友圈id
|
id: '', //某一条朋友圈id
|
||||||
commentInfo: {},
|
commentInfo: {},
|
||||||
@@ -131,17 +135,12 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onReady() {
|
onReady() {
|
||||||
console.log(this.storeSelfInfo);
|
|
||||||
let that = this;
|
let that = this;
|
||||||
uni.onKeyboardHeightChange(res => {
|
uni.onKeyboardHeightChange(res => {
|
||||||
|
that.keyboardHeight = res.height;
|
||||||
if (res.height == 0) {
|
if (res.height == 0) {
|
||||||
let windowHeight = this.$u.sys().windowHeight;
|
that.showInput = false;
|
||||||
//this.scrollViewHeight = windowHeight - 90;
|
|
||||||
this.showInput = false;
|
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
let windowHeight = this.$u.sys().windowHeight;
|
|
||||||
//this.scrollViewHeight = (windowHeight - res.height) - 120;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -343,7 +342,7 @@
|
|||||||
this.showInput = true;
|
this.showInput = true;
|
||||||
},
|
},
|
||||||
//提交评论消息
|
//提交评论消息
|
||||||
sendMsg() {
|
commitComment() {
|
||||||
let that=this;
|
let that=this;
|
||||||
if (!that.$u.trim(that.content)) {
|
if (!that.$u.trim(that.content)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
+3
-10
@@ -52,16 +52,9 @@ const actions = {
|
|||||||
return new Promise((resolve,reject)=>{
|
return new Promise((resolve,reject)=>{
|
||||||
uni.$u.http.post('/friendcircle/comment',params).then(data=>{
|
uni.$u.http.post('/friendcircle/comment',params).then(data=>{
|
||||||
console.log("评论成功",data);
|
console.log("评论成功",data);
|
||||||
let index = -1;
|
const index = state.list.findIndex(i => i.id ==params.id);
|
||||||
for(let i=0;i<state.list.length;i++){
|
if(index>=0){
|
||||||
if(state.list[i].id==params.id){
|
state.list[index].comments.unshift(data);
|
||||||
index = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log("index",index);
|
|
||||||
if(index!=-1){
|
|
||||||
state.list[index].comments.unshift(params);
|
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}else{
|
}else{
|
||||||
reject(data);
|
reject(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user