Commit e78ef7be by yanju

修改细节问题

parent 11c35213
......@@ -125,6 +125,8 @@
solved:false,
currentPage:1,
pages:1,
totalRecords:0,
}
},
......
......@@ -111,7 +111,8 @@
floor:'',
likeNum:'',
currentPage:1,
pages:1
pages:1,
totalRecords:0,
}
},
......
......@@ -37,6 +37,7 @@
commentContent:'',
currentPage:1,
pages:1,
totalRecords:0,
}
},
components:{
......
......@@ -189,6 +189,8 @@ export default {
type:'success',
message:response.msg
})
this.showCard = false;
}else{
this.$message({
type:'warning',
......
......@@ -32,7 +32,7 @@
<span tag="span" to="/dynamic" :style="{color:route==='dynamic'?'#00AAE6':'#666'}">动态</span>
<div class="abs-line" v-if="route==='dynamic'"></div>
</nuxt-link>
<nuxt-link tag="li" to="/topic?type=all">
<nuxt-link tag="li" to="/topic?type=new">
<span :style="{color:route==='topic'?'#00AAE6':'#666'}">话题</span>
<div class="abs-line" v-if="route==='topic'"></div>
</nuxt-link>
......@@ -197,9 +197,6 @@
methods:{
consoleF(){
console.log(this.$store.state.auth.token);
},
clickToSearch(){
let searchValue = this.searchValue;
......
......@@ -245,8 +245,8 @@
})
}else{
this.$message({
type:'warning',
message:res.msg
type:'info',
message:'请在登陆后操作'
})
}
})
......@@ -269,8 +269,8 @@
})
}else{
this.$message({
type:'warning',
message:res.msg
type:'info',
message:'请在登陆后操作'
})
}
})
......
......@@ -135,14 +135,12 @@
this.followedTopic = true;
}else{
this.$message({
type:'warning',
message:response.msg
type:'info',
message:'请在登陆后操作'
})
}
this.loading = false;
})
},
......@@ -165,8 +163,8 @@
}else{
this.$message({
type:'warning',
message:response.msg
type:'info',
message:'请在登陆后操作'
})
}
......
<template>
<div class="user-card__wrap">
<div class="user-card1">
<yun-avatar :userId="userId" style="margin:40px auto 0;" :src="userAvatar" size="84px"></yun-avatar>
<yun-avatar :userId="userId1" style="margin:40px auto 0;" :src="userAvatar" size="84px"></yun-avatar>
<div class="info1">
<p class="name">{{nickName}}</p>
<yun-icon name="sex_man" size="12px" color="#00AAE6" v-if="gender===1"></yun-icon>
......@@ -11,10 +11,10 @@
<nuxt-link tag="div" v-if="from==='my'" class="button" to="/personal-center/account/info">修改资料</nuxt-link>
<div v-if="userId!==$store.state.userProfile.userId&&from!=='my'&&followedUser" class="follow1" @click="dataPostToCancelFollow">
<div v-if="userId1!==$store.state.userProfile.userId&&from!=='my'&&followedUser" class="follow1" @click="dataPostToCancelFollow">
<yun-icon name="loading" v-if="followLoading"></yun-icon><yun-icon v-if="!followLoading" name="right"></yun-icon>已关注
</div>
<div v-if="userId!==$store.state.userProfile.userId&&from!=='my'&&!followedUser" class="follow2" @click="dataPostToFollow">
<div v-if="userId1!==$store.state.userProfile.userId&&from!=='my'&&!followedUser" class="follow2" @click="dataPostToFollow">
<yun-icon name="loading" v-if="followLoading"></yun-icon><span v-if="!followLoading">+</span>关注
</div>
<div class="footer">
......@@ -61,7 +61,7 @@
data(){
return{
userAvatar:'https://s2.ax1x.com/2020/01/15/lO2kIf.png',
userId1:"",
nickName:'',
gender:0,
signature:'',
......@@ -85,79 +85,110 @@
from:{
type:String,
default:'',
}
},
info:{
type:Object,
default:()=>({})
},
nickName1:String
},
created(){
if(this.userId){
if(this.nickName1){
this.dataGet2UserInfo();
}else {
this.dataGetUserInfo();
}
},
watch:{
userId(){
this.dataGetUserInfo();
}
if(this.nickName1){
this.dataGet2UserInfo();
}else {
this.dataGetUserInfo();
}
},
nickName1(){
this.dataGet2UserInfo();
}
},
methods:{
dataGetUserInfo(){
this.followLoading=true;
this.$axios.$get(config.api.get.User.otherInfo+this.userId+'/baseinfo').then((response) => {
if(response.code===0){
let data = response.data;
this.nickName=data.nickName;
this.gender= data.gender;
this.signature = data.signature;
this.userAvatar = data.userAvatar;
this.statistics = data.statistics || {};
this.followLoading=false;
this.followedUser = data.followedUser;
}
})
if(this.userId){
this.$axios.$get(config.api.get.User.otherInfo+this.userId+'/baseinfo').then((response) => {
if(response.code===0){
let data = response.data;
this.userId1 = this.userId;
this.nickName=data.nickName;
this.gender= data.gender;
this.signature = data.signature;
this.userAvatar = data.userAvatar;
this.statistics = data.statistics || {};
this.followLoading=false;
this.followedUser = data.followedUser;
}
})
}
},
dataGet2UserInfo(){
let data = this.info;
this.nickName=data.nickName;
this.userId1 = data.userId;
this.gender= data.gender;
this.signature = data.signature;
this.userAvatar = data.userAvatar;
this.statistics = data.statistics || {};
this.followLoading=false;
this.followedUser = data.followedUser;
},
dataPostToFollow(){
this.followLoading=true;
this.$axios.$post(config.api.post.User.follow+this.userId+'/follower').then((response)=>{
this.$axios.$post(config.api.post.User.follow+this.userId1+'/follower').then((response)=>{
if(response.code===0){
this.$message({
type:'success',
message:response.msg
})
this.followedUser = true;
}else{
this.$message({
type:'warning',
message:response.msg
type:'info',
message:'请在登陆后操作'
})
}
this.followLoading=false;
this.followedUser = true;
})
},
dataPostToCancelFollow(){
this.followLoading=true;
this.$axios.$delete(config.api.delete.User.unfollow+this.userId+'/follower').then((response)=>{
this.$axios.$delete(config.api.delete.User.unfollow+this.userId1+'/follower').then((response)=>{
if(response.code===0){
this.$message({
type:'success',
message:response.msg
})
this.followedUser = false;
}else{
this.$message({
type:'warning',
message:response.msg
type:'info',
message:'请在登陆后操作'
})
}
this.followLoading=false;
this.followedUser = false;
})
},
dataPostToBlack(){
this.$axios.$post(config.api.post.User.shielding+this.userId).then((response)=>{
this.$axios.$post(config.api.post.User.shielding+this.userId1).then((response)=>{
if(response.code===0){
this.$message({
type:'success',
......@@ -173,7 +204,7 @@
},
dataPostToCancelBlack(){
this.$axios.$delete(config.api.post.User.shielding+this.userId).then((response)=>{
this.$axios.$delete(config.api.post.User.shielding+this.userId1).then((response)=>{
if(response.code===0){
this.$message({
type:'success',
......@@ -193,9 +224,9 @@
},
dataGet2Path(path){
if(!this.userId){
if(!this.userId1){
return ''
}else if(this.userId===this.$store.state.userProfile.userId){
}else if(this.userId1===this.$store.state.userProfile.userId){
if(path==='following'||path==='fans'){
return '/personal-center/person/'+path;
}else{
......@@ -203,7 +234,7 @@
}
}else{
return '/u/'+this.userId+'/'+path
return '/u/'+this.userId1+'/'+path
}
}
},
......
......@@ -116,14 +116,15 @@
type:'success',
message:response.msg
})
this.followedUser = true;
}else{
this.$message({
type:'warning',
message:response.msg
type:'info',
message:'请在登陆后操作'
})
}
this.followLoading=false;
this.followedUser = true;
})
},
......@@ -136,14 +137,15 @@
type:'success',
message:response.msg
})
this.followedUser = false;
}else{
this.$message({
type:'warning',
message:response.msg
type:'info',
message:'请在登陆后操作'
})
}
this.followLoading=false;
this.followedUser = false;
})
},
......
......@@ -87,11 +87,9 @@
tagId: item.categoryId
})
});
//console.log(classList);
if (query.hasOwnProperty('id')) {
const response = await $axios.$get(config.api.get.Question.detail + query.id);
console.log(response);
return {
questionList: questionListRes.data.dataList,
response:response,
......@@ -187,9 +185,6 @@
//参数判断
dataPostQuestion(){
// console.log(this.tagList);
// console.log(Array.from(this.tagList));
// console.log(this.questionTitle.slice(this.questionTitle.length-1,this.questionTitle.length));
if(this.questionTitle===''
){
this.$refs.questionTitle.focus();
......@@ -253,7 +248,7 @@
/* setTimeout(() => {
this.$router.push('/personal-center/home/blog')
}, 500);*/
this.$router.push('/personal-center/home/answer?type=my')
this.$router.push('/personal-center/home/question')
}else{
this.$message({
......@@ -300,6 +295,7 @@
imgAdd(pos, file) {
// filename: 写在md中的文件名, File: File Object
// 第一步.将图片上传到服务器.
......@@ -308,7 +304,6 @@
formdata.append('type', 5);
this.$axios.$post(config.api.post.Resource.file, formdata)
.then((res) => {
console.log(res);
let url = res.data;
this.$refs.editor.$img2Url(pos, url);
this.$message({
......@@ -326,11 +321,9 @@
imgDel(pos) {
//删除图片,并不是修改就会触发,仅支持工具栏操作
// filename: 写在md中的文件名
console.log(pos);
},
save(value, render) { //保存文章内容
this.questionDetail = render;
//console.log('save');
},
intervalSave(value, render) {
// 自动保存
......
......@@ -98,6 +98,38 @@
created() {
this.dataGetHotTopic();
this.dataGetActiveUser();
if(!this.$store.state.userProfile.userId){
this.list=[
{
label: '最新',
address: '/dynamic',
type: 'new'
},
{
label: '推荐',
address: '/dynamic',
type: 'recommends'
},
{
label: '文字',
address: '/dynamic',
type: 'word'
},
{
label: '视频',
address: '/dynamic',
type: 'video'
},
{
label: '图片',
address: '/dynamic',
type: 'picture'
}
]
}
},
watch:{
......
......@@ -120,8 +120,6 @@
val.link
)
})
console.log(this.imgArr)
console.log(this.linkArr)
})
},
......
......@@ -65,7 +65,7 @@
</div>
</div>
<div class="detail-container__right">
<card-container title="最新资讯" label="换一换" more="更多" @listenCardConMore="changeRoute('/news')">
<card-container title="最新资讯" label="换一换" more="更多" @listenCardConMore="$router.push('/news')">
<nuxt-link tag="div" :to="'/news/detail/'+val.contentId" class="information-wrap" v-for="(val,index) in newsList" :key="val.contentId">
<p class="information-time">{{dataConvert2(val.createTime)}}</p>
<p class="information-content">{{val.title}}</p>
......
......@@ -49,7 +49,6 @@
},
async asyncData({$axios}) {
let infoResponse = await $axios.$get(config.api.get.User.myInfo);
console.log(infoResponse);
return { ...infoResponse.data }
},
computed: {
......
......@@ -178,10 +178,8 @@ export default {
tagId:item.categoryId
})
});
console.log(classList);
if (query.hasOwnProperty('id')) {
const response = await $axios.$get(config.api.get.Project.detail + query.id);
console.log(response);
return {
projectList: projectListRes.data.dataList,
response:response,
......@@ -278,7 +276,6 @@ export default {
formdata.append('type', 5);
this.$axios.$post(config.api.post.Resource.file, formdata)
.then((res) => {
console.log(res);
let url = res.data;
this.$refs.editor.$img2Url(pos, url);
this.$message({
......@@ -296,7 +293,6 @@ export default {
imgDel(pos) {
//删除图片,并不是修改就会触发,仅支持工具栏操作
// filename: 写在md中的文件名
console.log(pos);
},
save(value, render) { //保存文章内容
this.projectDetail = render;
......@@ -358,7 +354,6 @@ export default {
message: '请输入项目名称'
})
} else if (this.license === '') {
//console.log(this.$refs.license);
this.$refs.license.handleShow();
this.$refs.license.$refs.select.focus();
this.$message({
......@@ -475,7 +470,6 @@ export default {
sourceLink: this.addressLink
})
}
console.log(projectRes);
if (projectRes.code === 0) {
this.$router.push('/personal-center/home/project');
this.$message({
......
......@@ -12,7 +12,7 @@
width="816px"
:title="labelTitle"
>
<!--<empty-card v-if="topicList.length === 0" height="556px"></empty-card>-->
<empty-card v-if="topicList.length === 0" height="556px"></empty-card>
<topic-card v-for="(val,index) in topicList" :key="val.topicId" :info="val"></topic-card>
</card-container>
......@@ -52,24 +52,19 @@ export default {
return{
list: [
{
label: '推荐',
label: '最新',
address: '/topic',
type: '推荐'
type: 'new'
},
{
label: '热门',
address: '/topic',
type: '热门'
type: 'hot'
},
{
label: '关注',
address: '/topic',
type: '关注'
},
{
label: '最新',
address: '/topic',
type: '最新'
type: 'following'
}
],
topicList:[],
......@@ -78,18 +73,35 @@ export default {
}
},
created() {
this.$router.replace({
path: '/topic',
query: {
type: '推荐'
}
});
this.dataGetHotTopic();
if(!this.$store.state.userProfile.userId){
this.list=[
{
label: '最新',
address: '/topic',
type: 'new'
},
{
label: '热门',
address: '/topic',
type: 'hot'
}
]
}
},
computed: {
labelTitle: function () {
return this.$route.query.type + '话题'
let type = this.$route.query.type;
if(type==='new'){
return '最新话题'
}
if(type==='hot'){
return '热门话题'
}
if(type==='following'){
return '关注话题'
}
}
},
watch: {
......@@ -111,18 +123,7 @@ export default {
})
},
// 推荐话题
dataGetRecommendTopicList(currentPage){
this.$axios.$get(config.api.get.Topic.hotSearch,{
params:{
page:currentPage,
size:10
}
}).then((response)=>{
this.topicList = response.data.dataList;
this.pages = response.data.totalPage;
})
},
// 关注的话题
dataGetFollowedTopicList(currentPage) {
this.$axios.$get(config.api.get.Topic.myfollowedList,{
......@@ -132,9 +133,6 @@ export default {
}
}).then((response)=>{
this.topicList = response.data.records;
this.topicList.forEach(item => {
item.followedTopic = item.userId !== this.$store.state.userProfile.userId;
});
this.pages = response.data.pages;
})
},
......@@ -162,20 +160,19 @@ export default {
})
},
restartPagination(){
this.topicList= [];
if(process.browser){
this.$refs.pagination.setCurrentPage(1)
}
},
changePage(currentPage){
//返回页数 请求新的数据
if (this.$route.query.type === '最新') {
if (this.$route.query.type === 'new') {
this.dataGetTopicList(currentPage);
} else if (this.$route.query.type === '热门') {
} else if (this.$route.query.type === 'hot') {
this.dataGetHotTopicList(currentPage);
} else if (this.$route.query.type === '关注') {
} else if (this.$route.query.type === 'following') {
this.dataGetFollowedTopicList(currentPage);
} else if (this.$route.query.type === '推荐') {
this.dataGetRecommendTopicList(currentPage);
}
}
},
......
......@@ -8,7 +8,7 @@
<div class="bottom-container__bg"></div>
<div class="bottom-container">
<div class="bottom-left">
<user-card :userId="userId"></user-card>
<user-card :nickName1="userInfo.nickName" :userId="userId" :info="userInfo"></user-card>
</div>
<div class="bottom-right">
<div class="bottom-right__tab">
......@@ -137,7 +137,9 @@
<p><span>昵称:</span>{{userInfo.nickName ? userInfo.nickName : '暂无'}}</p>
</div>
<div>
<p><span>性别:</span>{{genderInfo(userInfo.gender)}}</p>
<p><span>性别:</span>
{{genderInfo(userInfo.gender)}}
</p>
</div>
<div>
<p><span>生日:</span>暂无</p>
......@@ -207,8 +209,10 @@
$route(to,from){
if(this.$route.name){
this.selected = this.$route.params.id;
this.userId = this.$route.params.id;
if(this.$route.params.id==='info'){
this.dataGetInfo()
this.dataGetInfoU()
}
}
}
......@@ -252,7 +256,7 @@
this.userId = this.$route.params.id;
if(select==='info'){
this.dataGetInfo()
this.dataGetInfoU()
}
if(select!=='project'&&
......@@ -394,7 +398,7 @@
},
//获取我的资料
dataGetInfo(){
dataGetInfoU(){
let userId = this.$route.params.id;
this.$axios.$get(config.api.get.User.otherInfo+userId+'/baseinfo').then((response)=>{
......
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