Commit 8f5ba615 authored by 罗林杰's avatar 罗林杰

修改留言

parent b5d9307b
......@@ -52,7 +52,7 @@
this.tipMsg = "发送成功";
this.$refs.elm.showDialog();
} else {
this.tipMsg = res.data.msg;
this.tipMsg = res.data.message;
this.$refs.elm.showDialog();
}
})
......
......@@ -8,6 +8,18 @@
<view class="button-item">关注</view>
</view>
<view style="height: 80rpx;"></view>
<z-paging ref="paging" empty-view-text=" "
:empty-view-title-style="{
'font-size': '32rpx',
'color': '#C9C9D0',
'position': 'absolute',
'width': '100vw',
}" :empty-view-img="baseUrl+'/common/empty.png'" :empty-view-img-style="{
'position': 'absolute',
'top': '210rpx',
'width': '447rpx',
'height': '375rpx'
}" v-model="chatList" @query="getMessageList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false">
<view class="page-layout">
<view class="page-body" id="x_chat">
<view v-for="(item, index) in chatList" :key="index">
......@@ -17,7 +29,7 @@
<view class="chat-inner-layout">
<view class="chat-item-name">{{item.memNickName}}</view>
<view class="chat-item-msg-layout">
<image class="chat-item-photo" :src="item.avatarUrl" mode="aspectFit"></image>
<image class="chat-item-photo" :src="item.avatarUrl" ></image>
<view class="chat-inner-msg-left">{{item.content}}</view>
</view>
</view>
......@@ -27,7 +39,7 @@
<view class="chat-item-name-right">{{item.memNickName}}</view>
<view class="chat-item-msg-layout">
<view class="chat-inner-msg-right">{{item.content}} </view>
<image class="chat-item-photo" :src="item.avatarUrl" mode="aspectFit"></image>
<image class="chat-item-photo" :src="item.avatarUrl" ></image>
</view>
</view>
</view>
......@@ -39,6 +51,7 @@
<view class="submit-submit" type="submit" size="mini" @tap="submitTo">发送</view>
</view>
</view>
</z-paging>
</view>
</template>
......@@ -50,6 +63,8 @@ export default {
name: "info",
data() {
return {
//图片路径
baseUrl: this.$IMG_URL,
chatList: [],
inputTemp: '',
targetId: '',
......@@ -59,19 +74,12 @@ export default {
this.targetId = options.targetId
},
onShow(){
this.getMessageList()
// 滚动到页面底部
this.$nextTick(() => {
this.pageScrollToBottom()
})
},
methods: {
/**
* 输入监听
*/
bindKeyInput(e) {
this.inputTemp = e.detail.value
},
getMessageList() {
const form ={
page: 1,
......@@ -85,14 +93,20 @@ export default {
if (item.avatar != null && item.avatar != ''){
getOssUrl(item.avatar).then(imgRes => {
if (imgRes.data.data != null) {
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/");
item.avatarUrl = imgRes.data.data
item.avatarUrl = imgRes.data.data.replace(/\\/g, "/");
}
})
}
})
this.$refs.paging.completeByTotal(this.chatList,res.data.total);
})
},
/**
* 输入监听
*/
bindKeyInput(e) {
this.inputTemp = e.detail.value
},
addBlack() {
uni.showModal({
title: '提示',
......@@ -131,8 +145,16 @@ export default {
content: inputValue
}
addMessage(data).then(res => {
this.getMessageList()
this.inputTemp = ''
if (res.data.code == 200){
this.getMessageList()
this.inputTemp = ''
} else {
uni.showToast({
title: res.data.message,
icon: 'none'
})
this.inputTemp = ''
}
})
// 滚动到页面底部
this.$nextTick(() => {
......
......@@ -2,6 +2,18 @@
<view style="background-color: #F4F5F9;min-height: 100vh;">
<!-- 页头-->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" title="个人留言"></u-navbar>
<z-paging ref="paging" empty-view-text=" "
:empty-view-title-style="{
'font-size': '32rpx',
'color': '#C9C9D0',
'position': 'absolute',
'width': '100vw',
}" :empty-view-img="baseUrl+'/common/empty.png'" :empty-view-img-style="{
'position': 'absolute',
'top': '210rpx',
'width': '447rpx',
'height': '375rpx'
}" v-model="userList" @query="getUserList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false">
<view class="recommendation" :style="{'top':navHeight+'px'}">
<view v-if="isdata" class="nodatacard">
<view class="text">暂无数据</view>
......@@ -29,7 +41,10 @@
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</z-paging>
</view>
</template>
......@@ -82,7 +97,6 @@ export default {
this.navHeight = (height + statusBarHeight + (margin * 3)) //导航栏总高
}
})
this.getUserList()
},
methods: {
getUserList(){
......@@ -97,12 +111,12 @@ export default {
if (item.avatar != null && item.avatar != ''){
getOssUrl(item.avatar).then(imgRes => {
if (imgRes.data.data != null) {
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/");
item.avatarUrl = imgRes.data.data
item.avatarUrl = imgRes.data.data.replace(/\\/g, "/");
}
})
}
})
this.$refs.paging.completeByTotal(this.userList,res.data.total);
})
},
gotoBusinessDetail(item){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment