Commit 62683b57 authored by 罗林杰's avatar 罗林杰

修改留言

parent 4e469be4
...@@ -88,3 +88,13 @@ export function rankList(data){ ...@@ -88,3 +88,13 @@ export function rankList(data){
data data
}); });
} }
/**
* 留言
*/
export function addMessage(data){
return request({
url: '/app/memInfo/leaveMessage',
data: data,
method: 'POST',
});
}
\ No newline at end of file
...@@ -89,6 +89,16 @@ ...@@ -89,6 +89,16 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "addMessage",
"style": {
"navigationBarTitleText": "",
"backgroundColorTop": "#F4F5F9",
"backgroundColorBottom": "#F4F5F9",
"navigationBarBackgroundColor": "#F4F5F9",
"backgroundColor": "#F4F5F9"
}
},
{ {
"path": "userArticleList", "path": "userArticleList",
"style": { "style": {
......
<template>
<view class="content">
<view class="text">
<u-textarea v-model="message" :cursorSpacing="100" :height="165" :show-confirm-bar="false" :maxlength="50" placeholder="请输入内容"
count></u-textarea>
</view>
<view class="adding" @click="saveAbout">
保存
</view>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" @confirm="confirm"></ELM>
</view>
</template>
<script>
import ELM from '@/components/elm-toast/index.vue';
import {addMessage} from "../api/user";
export default {
data() {
return {
userId: '',
message:'',
type: 0,
tipMsg: '',
isConfirm: false
}
},
components: {
ELM
},
onLoad(option) {
this.type = option.type;
this.userId = option.userId;
uni.setNavigationBarTitle({
title: "留言"
})
},
onPageScroll(e) {
if (e.scrollTop > 50) {} else {}
},
methods: {
async saveAbout() {
uni.showLoading({
title: '保存中...'
})
const data = {
targetId: this.userId,
content: this.message
}
addMessage(data).then(res => {
if (res.data.code == 200) {
this.isConfirm = true;
this.tipMsg = "保存成功";
this.$refs.elm.showDialog();
} else {
this.tipMsg = res.data.msg;
this.$refs.elm.showDialog();
}
})
},
confirm() {
this.isConfirm = false;
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style lang="less">
page {
background-color: #F4F5F9;
}
.content {
width: 100%;
height: 100%;
}
.text {
width: 100%;
height: 365rpx;
background: #ffffff;
border-top: 1rpx solid #eee;
}
.adding {
width: 614rpx;
height: 84rpx;
background: linear-gradient(86deg, #C2D2F9 0%, #C5C2F3 100%);
border-radius: 42rpx 42rpx 42rpx 42rpx;
font-size: 28rpx;
font-family: 'PingFang SC-Regular, PingFang SC';
font-weight: 400;
color: #415C9E;
line-height: 84rpx;
position: fixed;
bottom: 54rpx;
left: 68rpx;
text-align: center;
}
</style>
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
<image :src="baseUrl+'/user/con1-no.png'" style="width: 100%;height: 100%;;" mode="aspectFill"></image> <image :src="baseUrl+'/user/con1-no.png'" style="width: 100%;height: 100%;;" mode="aspectFill"></image>
</view> </view>
<!-- <view v-else-if="isFollowed === 1" class="right" @click="logion(userData.userId, false, baseUrl+'/user/con1-no.png')">--> <!-- <view v-else-if="isFollowed === 1" class="right" @click="logion(userData.userId, false, baseUrl+'/user/con1-no.png')">-->
<view v-else-if="isFollowed === 1" class="right" > <view v-else-if="isFollowed === 1" @click="addMessage(userData.userId)" class="right" >
<image :src="baseUrl+'/user/message.png'" style="width: 100%;height: 100%;;" mode="aspectFill"></image> <image :src="baseUrl+'/user/message.png'" style="width: 100%;height: 100%;;" mode="aspectFill"></image>
</view> </view>
</view> </view>
...@@ -468,6 +468,11 @@ import {addFollow, deleteFollow, isFollow, likeUser, userDetail} from "../api/us ...@@ -468,6 +468,11 @@ import {addFollow, deleteFollow, isFollow, likeUser, userDetail} from "../api/us
}) })
} }
}) })
},
addMessage(id){
uni.navigateTo({
url: "/pagesUser/addMessage?userId=" + id
})
}, },
backbar() { backbar() {
uni.navigateBack({ uni.navigateBack({
......
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
</view> </view>
</view> </view>
<view class=" mt25 fs28" style="color: #434343; "> <view class=" mt25 fs28" style="color: #434343; ">
<view>{{userInfo.memIntroduce}}</view> <view>{{userInfo.memIntroduce ? userInfo.memIntroduce : ''}}</view>
</view> </view>
</view> </view>
<!-- 兴趣爱好--> <!-- 兴趣爱好-->
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
</view> </view>
</view> </view>
<view class=" mt25 fs28" style="color: #434343; "> <view class=" mt25 fs28" style="color: #434343; ">
<view>{{userInfo.memHobby}}</view> <view>{{userInfo.memHobby ? userInfo.memHobby : ''}}</view>
</view> </view>
</view> </view>
<!-- 心仪的Ta--> <!-- 心仪的Ta-->
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
</view> </view>
</view> </view>
<view class=" mt25 fs28" style="color: #434343; "> <view class=" mt25 fs28" style="color: #434343; ">
<view>{{userInfo.memHalfDesire}}</view> <view>{{userInfo.memHalfDesire ? userInfo.memHalfDesire : ''}}</view>
</view> </view>
</view> </view>
<!-- 未来规划--> <!-- 未来规划-->
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
</view> </view>
</view> </view>
<view class=" mt25 fs28" style="color: #434343; "> <view class=" mt25 fs28" style="color: #434343; ">
<view>{{userInfo.memFuturePlan}}</view> <view>{{userInfo.memFuturePlan ? userInfo.memFuturePlan : ''}}</view>
</view> </view>
</view> </view>
......
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