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

修改留言

parent b5d9307b
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
this.tipMsg = "发送成功"; this.tipMsg = "发送成功";
this.$refs.elm.showDialog(); this.$refs.elm.showDialog();
} else { } else {
this.tipMsg = res.data.msg; this.tipMsg = res.data.message;
this.$refs.elm.showDialog(); this.$refs.elm.showDialog();
} }
}) })
......
...@@ -8,6 +8,18 @@ ...@@ -8,6 +8,18 @@
<view class="button-item">关注</view> <view class="button-item">关注</view>
</view> </view>
<view style="height: 80rpx;"></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-layout">
<view class="page-body" id="x_chat"> <view class="page-body" id="x_chat">
<view v-for="(item, index) in chatList" :key="index"> <view v-for="(item, index) in chatList" :key="index">
...@@ -17,7 +29,7 @@ ...@@ -17,7 +29,7 @@
<view class="chat-inner-layout"> <view class="chat-inner-layout">
<view class="chat-item-name">{{item.memNickName}}</view> <view class="chat-item-name">{{item.memNickName}}</view>
<view class="chat-item-msg-layout"> <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 class="chat-inner-msg-left">{{item.content}}</view>
</view> </view>
</view> </view>
...@@ -27,7 +39,7 @@ ...@@ -27,7 +39,7 @@
<view class="chat-item-name-right">{{item.memNickName}}</view> <view class="chat-item-name-right">{{item.memNickName}}</view>
<view class="chat-item-msg-layout"> <view class="chat-item-msg-layout">
<view class="chat-inner-msg-right">{{item.content}} </view> <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> </view>
</view> </view>
...@@ -39,6 +51,7 @@ ...@@ -39,6 +51,7 @@
<view class="submit-submit" type="submit" size="mini" @tap="submitTo">发送</view> <view class="submit-submit" type="submit" size="mini" @tap="submitTo">发送</view>
</view> </view>
</view> </view>
</z-paging>
</view> </view>
</template> </template>
...@@ -50,6 +63,8 @@ export default { ...@@ -50,6 +63,8 @@ export default {
name: "info", name: "info",
data() { data() {
return { return {
//图片路径
baseUrl: this.$IMG_URL,
chatList: [], chatList: [],
inputTemp: '', inputTemp: '',
targetId: '', targetId: '',
...@@ -59,19 +74,12 @@ export default { ...@@ -59,19 +74,12 @@ export default {
this.targetId = options.targetId this.targetId = options.targetId
}, },
onShow(){ onShow(){
this.getMessageList()
// 滚动到页面底部 // 滚动到页面底部
this.$nextTick(() => { this.$nextTick(() => {
this.pageScrollToBottom() this.pageScrollToBottom()
}) })
}, },
methods: { methods: {
/**
* 输入监听
*/
bindKeyInput(e) {
this.inputTemp = e.detail.value
},
getMessageList() { getMessageList() {
const form ={ const form ={
page: 1, page: 1,
...@@ -85,14 +93,20 @@ export default { ...@@ -85,14 +93,20 @@ export default {
if (item.avatar != null && item.avatar != ''){ if (item.avatar != null && item.avatar != ''){
getOssUrl(item.avatar).then(imgRes => { getOssUrl(item.avatar).then(imgRes => {
if (imgRes.data.data != null) { if (imgRes.data.data != null) {
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/"); item.avatarUrl = imgRes.data.data.replace(/\\/g, "/");
item.avatarUrl = imgRes.data.data
} }
}) })
} }
}) })
this.$refs.paging.completeByTotal(this.chatList,res.data.total);
}) })
}, },
/**
* 输入监听
*/
bindKeyInput(e) {
this.inputTemp = e.detail.value
},
addBlack() { addBlack() {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
...@@ -131,8 +145,16 @@ export default { ...@@ -131,8 +145,16 @@ export default {
content: inputValue content: inputValue
} }
addMessage(data).then(res => { addMessage(data).then(res => {
this.getMessageList() if (res.data.code == 200){
this.inputTemp = '' this.getMessageList()
this.inputTemp = ''
} else {
uni.showToast({
title: res.data.message,
icon: 'none'
})
this.inputTemp = ''
}
}) })
// 滚动到页面底部 // 滚动到页面底部
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -2,6 +2,18 @@ ...@@ -2,6 +2,18 @@
<view style="background-color: #F4F5F9;min-height: 100vh;"> <view style="background-color: #F4F5F9;min-height: 100vh;">
<!-- 页头--> <!-- 页头-->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" title="个人留言"></u-navbar> <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 class="recommendation" :style="{'top':navHeight+'px'}">
<view v-if="isdata" class="nodatacard"> <view v-if="isdata" class="nodatacard">
<view class="text">暂无数据</view> <view class="text">暂无数据</view>
...@@ -29,7 +41,10 @@ ...@@ -29,7 +41,10 @@
</view> </view>
</view> </view>
</view> </view>
</u-swipe-action-item>
</u-swipe-action>
</view> </view>
</z-paging>
</view> </view>
</template> </template>
...@@ -82,7 +97,6 @@ export default { ...@@ -82,7 +97,6 @@ export default {
this.navHeight = (height + statusBarHeight + (margin * 3)) //导航栏总高 this.navHeight = (height + statusBarHeight + (margin * 3)) //导航栏总高
} }
}) })
this.getUserList()
}, },
methods: { methods: {
getUserList(){ getUserList(){
...@@ -97,12 +111,12 @@ export default { ...@@ -97,12 +111,12 @@ export default {
if (item.avatar != null && item.avatar != ''){ if (item.avatar != null && item.avatar != ''){
getOssUrl(item.avatar).then(imgRes => { getOssUrl(item.avatar).then(imgRes => {
if (imgRes.data.data != null) { if (imgRes.data.data != null) {
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/"); item.avatarUrl = imgRes.data.data.replace(/\\/g, "/");
item.avatarUrl = imgRes.data.data
} }
}) })
} }
}) })
this.$refs.paging.completeByTotal(this.userList,res.data.total);
}) })
}, },
gotoBusinessDetail(item){ 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