Commit 64881725 by yanju

Merge branch 'yoona' into 'master'

Yoona

See merge request !31
parents 701e470d 83a02a8a
<template>
<yun-div>
<answer-card></answer-card>
<answer-card
v-for="(val, index) in dataList"
:info="val"
:key="val.questionId"
></answer-card>
<!-- <empty-card v-if="dataList.length === 0"></empty-card>-->
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import answerCard from '../../../components/moblie/answerCard'
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
export default {
name: "answer",
components:{
answerCard
ScrollLoading,
answerCard,
EmptyCard
},
data() {
return {
dataList: [],
pages: 1
}
},
methods: {
handleResponse(currentPage,response){
if(currentPage===1){
this.dataList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.dataList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetNoticeAnswer(currentPage){
this.$axios.$get(config.api.get.Question.myParticipated,{
params:{
page:currentPage,
size:10
}
}).then((response)=>{
this.handleResponse(currentPage, response)
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetNoticeAnswer(currentPage);
}
}
}
</script>
......
<template>
<yun-div>
<project-card></project-card>
<project-card
v-for="val in dataList"
:info="val"
:key="val.blogId"
:is-my="true"
></project-card>
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import projectCard from '../../../components/moblie/projectCard'
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
export default {
name: "blog",
components:{
projectCard
EmptyCard,
projectCard,
ScrollLoading
},
data() {
return {
dataList: [],
pages: 1
}
},
methods: {
handleResponse(currentPage,response){
if(currentPage===1){
this.dataList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.dataList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetBlog(currentPage){
this.$axios.$get(config.api.get.Blog.myList, {
params: {
page: currentPage,
size: 10
}
}).then((response) => {
this.handleResponse(currentPage, response)
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetBlog(currentPage);
}
}
}
</script>
......
<template>
<yun-div>
<dynamic-card
v-for="val in dataList"
:key="val.postId"
:info="val"
:is-my="true"
></dynamic-card>
<!-- <empty-card v-if="dataList.length === 0"></empty-card>-->
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
import DynamicCard from "../../../components/moblie/dynamicCard";
export default {
components: {
EmptyCard,
DynamicCard,
ScrollLoading
},
data() {
return {
dataList: [],
pages: 1
}
},
methods: {
handleResponse(currentPage,response){
if(currentPage===1){
this.dataList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.dataList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetDynamic(currentPage){
this.$axios.$get(config.api.get.Post.myList, {
params: {
page: currentPage,
size: 10
}
}).then((response) => {
this.handleResponse(currentPage, response)
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetDynamic(currentPage);
}
}
}
</script>
<style scoped>
</style>
<template>
<yun-div>
<topic-card
v-for="val in dataList"
:key="val.topicId"
:info="val"
from="notice"
></topic-card>
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import topicCard from '../../../components/moblie/topicCard'
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
export default {
components:{
topicCard,
ScrollLoading,
EmptyCard
},
data() {
return {
dataList: [],
pages: 1
}
},
methods: {
handleResponse(currentPage,response){
if(currentPage===1){
this.dataList=response.data.records;
this.pages = response.data.totalPage;
}else{
response.data.records.map((val,index)=>{
this.dataList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetMyFollowingTopic(currentPage){
this.$axios.$get(config.api.get.Topic.myfollowedList, {
params: {
page: currentPage,
size: 10
}
}).then((response) => {
this.handleResponse(currentPage, response)
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetMyFollowingTopic(currentPage);
}
}
}
</script>
<style scoped>
</style>
<template>
<yun-div>
<topic-card
v-for="val in dataList"
:key="val.topicId"
:info="val"
></topic-card>
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import topicCard from '../../../components/moblie/topicCard'
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
export default {
components:{
topicCard,
ScrollLoading,
EmptyCard
},
data() {
return {
dataList: [],
pages: 1
}
},
methods: {
handleResponse(currentPage,response){
if(currentPage===1){
this.dataList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.dataList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetMyTopic(currentPage){
this.from = 'my';
this.$axios.$get(config.api.get.Topic.myList, {
params: {
page: currentPage,
size: 10
}
}).then((response) => {
this.handleResponse(currentPage, response)
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetMyTopic(currentPage);
}
}
}
</script>
<style scoped>
</style>
<template>
<yun-div>
<project-card></project-card>
</yun-div>
<yun-div>
<project-card
v-for="val in dataList"
:key="val.projectId"
:info="val"
:is-my="true"
></project-card>
<!-- <empty-card v-if="dataList.length === 0"></empty-card>-->
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import projectCard from '../../../components/moblie/projectCard'
export default {
name: "project",
components:{
projectCard
import projectCard from '../../../components/moblie/projectCard'
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
export default {
components: {
EmptyCard,
projectCard,
ScrollLoading
},
data() {
return {
dataList: [],
pages: 1
}
},
methods: {
handleResponse(currentPage,response){
if(currentPage===1){
this.dataList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.dataList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetProject(currentPage){
this.$axios.$get(config.api.get.Project.myList, {
params: {
page: currentPage,
size: 10
}
}).then((response) => {
this.handleResponse(currentPage, response)
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetProject(currentPage);
}
}
}
</script>
<style scoped>
......
<template>
<yun-div>
<answer-card></answer-card>
</yun-div>
<yun-div>
<answer-card
v-for="(val, index) in dataList"
:info="val"
:key="val.questionId"
></answer-card>
<!-- <empty-card v-if="dataList.length === 0"></empty-card>-->
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import answerCard from '../../../components/moblie/answerCard'
export default {
name: "question",
components: {
answerCard
import answerCard from '../../../components/moblie/answerCard'
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
export default {
name: "answer",
components:{
ScrollLoading,
answerCard,
EmptyCard
},
data() {
return {
dataList: [],
pages: 1
}
},
methods: {
handleResponse(currentPage,response){
if(currentPage===1){
this.dataList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.dataList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetMyAnswer(currentPage){
this.$axios.$get(config.api.get.Question.myCreated,{
params:{
page:currentPage,
size:10
}
}).then((response)=>{
this.handleResponse(currentPage, response)
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetMyAnswer(currentPage);
}
}
}
</script>
<style scoped>
......
<template>
<yun-div>
<topic-card></topic-card>
</yun-div>
</template>
<script>
import topicCard from '../../../components/moblie/topicCard'
export default {
name: "topic",
components:{
topicCard
}
}
</script>
<style scoped>
</style>
......@@ -4,15 +4,16 @@
:margin-v="[0,'auto']"
>
<user-card-big
:info="myInfo"
></user-card-big>
<yun-div
:margin-v="[15,0,0,0]">
<data-card title="我的消息" :cardType="3" right="23"></data-card>
<data-card title="我的消息" :cardType="3" right="23" v-tap="()=> toJump('///')"></data-card>
</yun-div>
<yun-div
bg-color-v="white"
:margin-v="[15,0,0,0]">
<data-card title="我的喜欢" right="23"></data-card>
<data-card title="我的喜欢" v-tap="()=> toJump('/personal-center/like')"></data-card>
<yun-div
:width-v="704"
:margin-v="[0,'auto']"
......@@ -22,32 +23,32 @@
<yun-div
bg-color-v="white"
:margin-v="[15,0,0,0]">
<data-card title="我的项目"></data-card>
<data-card title="我的项目" :right="this.myInfo.statistics.projectNum" v-tap="()=> toJump('/personal-center/home/project')"></data-card>
<yun-div
:width-v="704"
:margin-v="[0,'auto']"
:border-v="[1,'solid','#EFEFEF','bottom']"></yun-div>
<data-card title="我的博客"></data-card>
<data-card title="我的博客" :right="this.myInfo.statistics.blogNum" v-tap="()=> toJump('/personal-center/home/blog')"></data-card>
<yun-div
:width-v="704"
:margin-v="[0,'auto']"
:border-v="[1,'solid','#EFEFEF','bottom']"></yun-div>
<data-card title="我的提问"></data-card>
<data-card title="我的提问" :right="this.myInfo.statistics.questionNum" v-tap="()=> toJump('/personal-center/home/question')"></data-card>
<yun-div
:width-v="704"
:margin-v="[0,'auto']"
:border-v="[1,'solid','#EFEFEF','bottom']"></yun-div>
<data-card title="我的回答"></data-card>
<data-card title="我的回答" :right="this.myInfo.statistics.questionReplyNum" v-tap="()=> toJump('/personal-center/home/answer')"></data-card>
<yun-div
:width-v="704"
:margin-v="[0,'auto']"
:border-v="[1,'solid','#EFEFEF','bottom']"></yun-div>
<data-card title="我的动态"></data-card>
:border-v="[1,'solid','#EFEFEF','bottom']" v-tap="()=> toJump('/personal-center/home/dynamic')"></yun-div>
<data-card title="我的动态" v-tap="()=> toJump('/personal-center/home/dynamic')"></data-card>
<yun-div
:width-v="704"
:margin-v="[0,'auto']"
:border-v="[1,'solid','#EFEFEF','bottom']"></yun-div>
<data-card title="我创建的话题"></data-card>
<data-card title="我创建的话题" :right="this.myInfo.statistics.postNum" v-tap="()=> toJump('/personal-center/home/my-topic')"></data-card>
</yun-div>
<yun-div
:margin-v="[15,0,0,0]"
......@@ -75,12 +76,29 @@
import userCardBig from '../../components/moblie/userCardBig'
import dataCard from '../../components/moblie/dataCard'
import config from "../../action/config";
import commonMixin from "../../components/moblie/commonMixin";
const Cookie = process.client ? require('js-cookie') : null
export default {
mixins: [commonMixin],
async asyncData({$axios}) {
let res = await $axios.$get(config.api.get.User.myInfo)
return {
myInfo: res.data
}
},
components:{
userCardBig,dataCard
},
data() {
return {
myInfo: {},
}
},
created() {
},
methods:{
handleLogout() {
......@@ -104,6 +122,10 @@
}
});
},
toJump(route) {
console.log(route);
this.changeRoute1(route)
}
}
}
......
<template>
<yun-div>
<fans-card></fans-card>
<fans-card v-for="(val,index) in fansList" :key="val.userId"></fans-card>
<!-- <empty-card v-if="fansList.length === 0"></empty-card>-->
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import FansCard from "../../../components/moblie/fansCard";
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
export default {
components: {FansCard},
components: {ScrollLoading, FansCard,EmptyCard},
data() {
return {
fansList: [],
pages: 1
}
},
mounted() {
this.restartPagination()
},
methods: {
restartPagination(){
if(process.browser){
this.fansList = [];
this.pages = 1 ;
this.$refs.pagination.setCurrentPage(1)
}
},
handleResponse(currentPage,response){
if(currentPage===1){
this.fansList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.fansList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetPeople(currentPage){
this.$axios.$get(config.api.get.User.myFans,{
params:{
page:currentPage,
size:10
}
}).then((response)=>{
if(response.code===0){
this.handleResponse(currentPage,response)
}
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetPeople(currentPage)
}
}
}
......
<template>
<yun-div>
<fans-card></fans-card>
<fans-card v-for="(val,index) in followingList" :key="val.userId"></fans-card>
<!-- <empty-card v-if="followingList.length === 0"></empty-card>-->
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import FansCard from "../../../components/moblie/fansCard";
import ScrollLoading from "../../../components/moblie/scrollLoading";
import config from "../../../action/config";
import EmptyCard from "../../../components/moblie/emptyCard";
export default {
components: {FansCard},
components: {ScrollLoading, FansCard,EmptyCard},
data() {
return {
followingList: [],
pages: 1
}
},
mounted() {
this.restartPagination()
},
methods: {
restartPagination(){
if(process.browser){
this.followingList = [];
this.pages = 1 ;
this.$refs.pagination.setCurrentPage(1)
}
},
handleResponse(currentPage,response){
if(currentPage===1){
this.followingList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.followingList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetPeople(currentPage){
this.$axios.$get(config.api.get.User.myFollowing,{
params:{
page:currentPage,
size:10
}
}).then((response)=>{
if(response.code===0){
this.handleResponse(currentPage,response)
}
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetPeople(currentPage)
}
}
}
......
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