Commit 053b5dfc authored by liwei's avatar liwei

Merge remote-tracking branch 'origin/master'

parents 0a7ea39e 05944957
......@@ -2,7 +2,7 @@
module.exports = {
// baseUrl: 'http://106.3.97.198:20162'
baseUrl: 'http://localhost:8092',//接口URL
imgUrl:'http://192.168.1.7/static/images',//图片URL
imgUrl:'http://192.168.1.11/static/images',//图片URL
webViewUrl:'http://192.168.1.7:8080'//小程序跳转H5页面的URL
}
......
......@@ -252,6 +252,26 @@
"disableScroll": true
}
},
{
"path": "message/message",
"style": {
"navigationBarTitleText": "个人留言",
"backgroundColor": "#F4F5F9",
"backgroundColorTop": "#F4F5F9",
"navigationBarBackgroundColor": "#F4F5F9",
"navigationStyle": "custom"
}
},
{
"path": "message/info",
"style": {
"navigationBarTitleText": "个人留言",
"backgroundColor": "#F4F5F9",
"backgroundColorTop": "#F4F5F9",
"navigationBarBackgroundColor": "#F4F5F9",
"navigationStyle": "custom"
}
},
{
"path": "set/aboutme",
"style": {
......
......@@ -201,6 +201,11 @@ import {articleList, getOssUrl} from "../../api/article";
desc: "",
img: this.$IMG_URL+"/user/myren.png",
}, {
name: "我的留言",
num: '',
desc: "",
img: this.$IMG_URL+'/user/mymessage.png',
}, {
name: "推荐给好友",
num: '',
desc: "",
......@@ -210,7 +215,8 @@ import {articleList, getOssUrl} from "../../api/article";
num: '',
desc: "",
img: this.$IMG_URL+'/user/myset.png',
}],
}
],
numtwo: 0,
tipMsg: ""
};
......@@ -390,13 +396,17 @@ import {articleList, getOssUrl} from "../../api/article";
})
} else if (i == 1) {
this.updateInformation();
} else if (i == 3) {
} else if (i == 4) {
uni.navigateTo({
url: "/pagesme/set/set"
})
} else if (i == 2) {
} else if (i == 3) {
}
} else if (i == 2) {
uni.navigateTo({
url: "/pagesme/message/message"
})
} else if (i == 5) {}
},
//登录
login() {
......
......@@ -203,8 +203,9 @@
<view v-if="isFollowed === 0" class="right" @click="logion(userData.userId, true, baseUrl+'/user/con1.png')">
<image :src="baseUrl+'/user/con1-no.png'" style="width: 100%;height: 100%;;" mode="aspectFill"></image>
</view>
<view v-else-if="isFollowed === 1" class="right" @click="logion(userData.userId, false, baseUrl+'/user/con1-no.png')">
<image :src="baseUrl+'/user/con1.png'" style="width: 100%;height: 100%;;" mode="aspectFill"></image>
<!-- <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" >
<image :src="baseUrl+'/user/message.png'" style="width: 100%;height: 100%;;" mode="aspectFill"></image>
</view>
</view>
</view>
......
......@@ -125,7 +125,7 @@ export default {
//跳转用户详情
gotoDetail(item){
uni.navigateTo({
url: '/pagesUser/userInfo?id='+item.userId
url: '/pagesUser/userInfo?memberId='+item.businessId
})
},
//获取用户列表数据
......
......@@ -7,9 +7,9 @@
<view class="text">暂无数据</view>
</view>
<view class="card">
<view class="recommendation-card" v-for="item in userList" @click="gotoBusinessDetail(item)">
<view class="recommendation-card" v-for="item in userList">
<view class="card-image">
<image class="img" src="https://cdn.uviewui.com/uview/album/1.jpg"/>
<image @click="gotoDetail(item)" class="img" src="https://cdn.uviewui.com/uview/album/1.jpg"/>
</view>
<view class="card-bottom">
<view class="bottom-left">
......@@ -25,6 +25,7 @@
</view>
<view class="bottom-address">{{item.city}}</view>
</view>
<image v-if="type == '1' || type == '3'" class="cnacleLike" :src="baseUrl+'/user/cancelLike.png'" @click="deleteLike(item.userId)"/>
</view>
</view>
</view>
......@@ -33,7 +34,7 @@
</template>
<script>
import {userList} from "../../api/user";
import {deleteFollow, userList} from "../../api/user";
import {getOssUrl} from "../../api/article";
import {getCity, getValue} from "../../common/options";
import {calculateAge, parseDate} from "../../common";
......@@ -68,16 +69,6 @@ export default {
//设置页头
this.type = options.type;
this.num = options.num;
if (this.type == '1'){
//我喜欢的
this.title = '我喜欢的' + '('+ this.num +')';
} else if (this.type == '2'){
//喜欢我的
this.title = '喜欢我的' + '('+ this.num +')';
} else if (this.type == '3'){
//互相喜欢
this.title = '互相喜欢' + '('+ this.num +')';
}
//获取当前页面的页头高度
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
......@@ -103,6 +94,8 @@ export default {
//我喜欢的
userList(params).then(res =>{
this.userList = res.data.data
this.num = this.userList.length
this.getTitle()
//遍历this.userList
this.userList.forEach(item => {
//处理头像
......@@ -132,6 +125,19 @@ export default {
console.log(e)
})
},
//获取表头
getTitle(){
if (this.type == '1'){
//我喜欢的
this.title = '我喜欢的' + '('+ this.num +')';
} else if (this.type == '2'){
//喜欢我的
this.title = '喜欢我的' + '('+ this.num +')';
} else if (this.type == '3'){
//互相喜欢
this.title = '互相喜欢' + '('+ this.num +')';
}
},
//获取用户列表数据
getUserList(){
if (this.type == '1'){
......@@ -160,6 +166,34 @@ export default {
this.getList(params)
}
},
deleteLike(id){
//是否确认
uni.showModal({
title: '提示',
content: '是否取消关注',
success: (res) => {
if (res.confirm) {
const form = {
userId: uni.getStorageSync('userInfo').businessId,
targetId: id,
}
deleteFollow(form).then(res => {
if (res.data.code == 200){
this.$u.toast('取消关注成功')
this.getUserList()
}
})
} else if (res.cancel) {
}
}
});
},
//跳转用户详情
gotoDetail(item){
uni.navigateTo({
url: '/pagesUser/userInfo?memberId='+item.businessId
})
},
backbar() {
uni.navigateBack({
delta: 1, //返回层数,2则上上页
......@@ -287,4 +321,12 @@ export default {
}
}
.cnacleLike{
height: 40rpx;
width: 60rpx;
margin-top: 100rpx;
margin-right: 10rpx;
justify-content: flex-end;
display: flex
}
</style>
This diff is collapsed.
<template>
<view style="background-color: #F4F5F9;min-height: 100vh;">
<!-- 页头-->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" title="个人留言"></u-navbar>
<view class="recommendation" :style="{'top':navHeight+'px'}">
<view v-if="isdata" class="nodatacard">
<view class="text">暂无数据</view>
</view>
<view class="card">
<view class="recommendation-card" v-for="item in userList" @click="gotoBusinessDetail(item)">
<view class="card-image"style="justify-content: left;display: flex">
<image class="img" src="https://cdn.uviewui.com/uview/album/1.jpg"/>
<view style="margin-left: 20rpx;margin-top: 20rpx;font-weight: 400;font-size: 32rpx">
{{ item.nickName }}
<view class="message">
{{item.message}}
</view>
</view>
</view>
<view style="margin: 20rpx 20rpx 0 0;font-size: 24rpx;color: #8a8888;">
{{ item.createTime }}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
//图片路径
baseUrl: this.$IMG_URL,
//用户列表
userList:[],
//是否有数据
isdata: false,
//页面显示的数据类型 1我喜欢的 2喜欢我的 3互相喜欢
type:'',
//页面数据的数量
num:'',
//距离表头
navHeight:'',
share: false,
menuButtonInfo: '',
};
},
onLoad() {
//获取当前页面的页头高度
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
const {
top,
width,
height,
right
} = this.menuButtonInfo
uni.getSystemInfo({
success: (res) => {
const {
statusBarHeight
} = res;
const margin = top - statusBarHeight
this.navHeight = (height + statusBarHeight + (margin * 3)) //导航栏总高
}
})
this.getUserList()
},
methods: {
getUserList(){
//我喜欢的
const list = [
{
nickName:'暖洋洋',
message:'你好',
createTime:'2021-08-08 12:12:12'
},
{
nickName:'暖洋洋',
message:'最近的一条信息',
createTime:'2021-08-08 12:12:12'
},
{
nickName:'暖洋洋',
message:'最近的一条信息',
createTime:'2021-08-08 12:12:12'
},
{
nickName:'暖洋洋',
message:'最近的一条信息',
createTime:'2021-08-08 12:12:12'
},
{
nickName:'暖洋洋',
message:'最近的一条信息',
createTime:'2021-08-08 12:12:12'
},
{
nickName:'暖洋洋',
message:'最近的一条信息测试长度滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴的',
createTime:'2021-08-08 12:12:12'
},
]
this.userList = list
},
gotoBusinessDetail(){
uni.navigateTo({
url: "/pagesme/message/info"
})
},
backbar() {
uni.navigateBack({
delta: 1, //返回层数,2则上上页
})
}
}
};
</script>
<style lang="scss" scoped>
.recommendation {
background-color: #F4F5F9;
position: relative;
padding: 0 34rpx;
.nodatacard{
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.text{
text-align: center;
padding: 42rpx 0;
font-size: 13px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #B9B9B9;
}
}
.recommendation-top {
display: flex;
justify-content: space-between;
margin: 56rpx 0;
.top-title {
font-size: 19px;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #222222;
}
.more {
display: flex;
.more-title {
font-size: 17px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #848484;
margin-right: 14rpx;
}
.more-image {
display: flex;
align-items: center;
.rightimage {
width: 7px;
height: 12px;
}
}
}
}
.card {
display: grid;
grid-template-columns: 680rpx;
grid-column-gap: 22rpx;
.recommendation-card {
max-height: 180rpx;
justify-content: space-between;
display: flex;
width: 680rpx;
margin-bottom: 25rpx;
background-color: white;
.card-image {
.img {
margin: 15rpx 0 15rpx 15rpx;
width: 100rpx;
height: 100rpx;
}
}
}
}
}
.message{
max-width: 300rpx;
margin-top: 30rpx;
font-size: 24rpx;
color: #8a8888;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
</style>
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