Commit 23123278 by yanju

Merge branch 'xue' into 'master'

话题详情完成

See merge request !32
parents 64881725 32eb0eef
<template> <template>
<yun-div
:width-v="750"
:height-v="100"
:padding-v="[34,0,40]"
:margin-v="[0,'auto']"
bg-color-v="#fff"
:paddingV =[paddingL]
:extend-style="{boxSizing:'border-box'}"
:flex-v="['row','space-between','center']"
slot="card"
>
<yun-div <yun-div
:width-v="750" :ske-w="120"
:height-v="100" :font-style="[30,36,400,'black','left']"
:padding-v="[34,0,40]" >
:margin-v="[0,'auto']" {{title}}
bg-color-v="#fff" </yun-div>
:paddingV =[paddingL] <yun-div
:extend-style="{boxSizing:'border-box'}" :ske-w="100"
:flex-v="['row','space-between','center']" :font-style="[30,36,400,'#999999','left']"
slot="card" :flex-v="['row','flex-start','center']"
> >
<yun-div <yun-div
:ske-w="120" v-if="cardType===1"
:font-style="[30,36,400,'black','left']" :no-wrap="true"
:extend-style="{maxWidth: commonReturnFlexedLength(450)}"
> >
{{title}} {{right}}
</yun-div> </yun-div>
<yun-div <yun-div
:ske-w="100" v-if="cardType===3"
:font-style="[30,36,400,'#999999','left']" :width-v="32"
:flex-v="['row','flex-start','center']" :height-v="32"
:border-r="['50%']"
:show-ske="false"
bg-color-v="#FF4A4A"
:font-style="[20,36,400,'white','left']"
:flex-v="['row','center','center']"
> >
<yun-div {{right}}
v-if="cardType===1"
:no-wrap="true"
:extend-style="{maxWidth: commonReturnFlexedLength(450)}"
>
{{right}}
</yun-div>
<yun-div
v-if="cardType===3"
:width-v="32"
:height-v="32"
:border-r="['50%']"
:show-ske="false"
bg-color-v="#FF4A4A"
:font-style="[20,36,400,'white','left']"
:flex-v="['row','center','center']"
>
{{right}}
</yun-div>
<yun-img
v-if="cardType===2"
:width-v="66"
:height-v="66"
:ske-h="66"
:ske-w="66"
:border-r="[50,50,50,50]"
:src=userAvatar
>
</yun-img>
<yun-icon
:style="{marginLeft:commonReturnFlexedLength(15)}"
name="left_arrow"
v-tap="dataChange"
></yun-icon>
</yun-div> </yun-div>
<!--修改信息弹出框--> <yun-img
<yun-dialog v-if="cardType===2"
v-if="this.change" :width-v="66"
title="修改" :height-v="66"
:value="true" :ske-h="66"
:btns="slotDialog.btns" :ske-w="66"
:border-r="[50,50,50,50]"
:src=userAvatar
> >
<yun-div </yun-img>
<yun-icon
:style="{marginLeft:commonReturnFlexedLength(15)}"
name="left_arrow"
v-tap="dataChange"
></yun-icon>
</yun-div>
<!--修改信息弹出框-->
<yun-dialog
v-if="this.change"
title="修改"
:value="true"
:btns="slotDialog.btns"
>
<yun-div
:width-v="464"
:margin-v="[0,'auto']"
slot="header">
<yun-input
:width-v="464" :width-v="464"
:margin-v="[0,'auto']" :height-v="72"
slot="header"> :border-v="[6]"
<yun-input
:width-v="464"
:height-v="72"
:border-v="[6]"
placeholder="输入新昵称"
:show-icon="false"
>
</yun-input>
</yun-div>
</yun-dialog>
</yun-div> :show-icon="false"
v-model="public"
>
</yun-input>
</yun-div>
</yun-dialog>
</yun-div>
...@@ -102,7 +103,9 @@ ...@@ -102,7 +103,9 @@
}, },
data(){ data(){
return{ return{
public:'',
change:false, change:false,
rightNow:'',
slotDialog: { slotDialog: {
open: true, open: true,
btns: [ btns: [
...@@ -114,6 +117,14 @@ ...@@ -114,6 +117,14 @@
handler: this.dataPostRemarks, handler: this.dataPostRemarks,
}, },
], ],
gender:'',
mobile:'',
email:'',
signature:'',
nickName:null,
qqNumber:null,
wxNumber:null,
birthday:'',
}, },
} }
...@@ -121,8 +132,64 @@ ...@@ -121,8 +132,64 @@
methods:{ methods:{
dataChange(){ dataChange(){
this.change=true; this.change=true;
this.rightNow=this.right;
console.log(this.rightNow);
},
dataPostRemarks() {
if (this.title==="昵称") {
this.$axios.$put(config.api.put.User.reviseInfo, {
nickName: this.public
}).then((response) => {
this.$message({
type:'success',
message:'修改成功'
})
})
}
if (this.title==="生日") {
this.$axios.$put(config.api.put.User.reviseInfo, {
birthday: this.public
}).then((response) => {
this.$message({
type:'success',
message:'修改成功'
})
})
}
if (this.title==="QQ号") {
this.$axios.$put(config.api.put.User.reviseInfo, {
qqNumber: this.public
}).then((response) => {
this.$message({
type:'success',
message:'修改成功'
})
})
}
if (this.title==="微信号") {
this.$axios.$put(config.api.put.User.reviseInfo, {
wxNumber: this.public
}).then((response) => {
this.$message({
type:'success',
message:'修改成功'
})
})
}
if (this.title==="手机号") {
this.$axios.$put(config.api.put.User.reviseInfo, {
wxNumber: this.public
}).then((response) => {
this.$message({
type:'success',
message:'修改成功'
})
})
}
} }
} }
} }
......
<template> <template>
<yun-div>
<topic-card :info="detail"></topic-card>
<Nav :show-right="false" :path="path" :nav-list="navList"></Nav>
<dynamic-card
v-for="(val,index) in postList"
:key="val.postId"
:info="val"
></dynamic-card>
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template> </template>
<script> <script>
import topicCard from '../../../components/moblie/topicCard';
import Nav from '../../../components/moblie/nav';
import config from '../../../action/config';
import dynamicCard from '../../../components/moblie/dynamicCard';
import ScrollLoading from '../../../components/moblie/scrollLoading';
export default { export default {
async asyncData({$axios,params}){
let detail = await $axios.$get(config.api.get.Topic.detail+params.id);
return {detail: detail.data}
},
data(){
return{
path: `/topic/detail/${this.$route.params.id}`,
navList: [
{
label: '最新',
id: 'new'
},
{
label: '推荐',
id: 'recommends'
},
{
label: '文字',
id: 'word'
},
{
label: '视频',
id: 'video'
},
{
label: '图片',
id: 'picture'
}
],
detail:{},
postList:[],
name:'',
pages:1,
}
},
components:{
topicCard,Nav,dynamicCard,ScrollLoading
},
created() {
this.id = this.$route.params.id;
if (this.$route.query.type) {
}else{
this.$router.replace({
path: `/topic/detail/${this.id}`,
query: {
type: 'new'
}
})
}
},
watch:{
$route(val){
if (val.query.type) {
}else{
this.$router.replace({
path: `/topic/detail/${this.id}`,
query: {
type: 'new'
}
})
}
this.restartPagination();
}
},
methods:{
restartPagination(){
if(process.browser){
this.postList = [];
this.pages = 1 ;
this.$refs.pagination.setCurrentPage(1)
}
},
handleResponse(currentPage,response){
if(currentPage===1){
this.postList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.postList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetDynamicList(currentPage){
let params={
page:currentPage,
size:12
};
if(this.$route.query.type&&this.$route.query.type==='new') {
this.$axios.$get(config.api.get.Topic.postList + this.detail.topicName + '/posts',
{params:params}).then((response) => {
console.log(response);
this.handleResponse(currentPage, response)
})
}
if(this.$route.query.type&&this.$route.query.type==='recommends' ){
this.$axios.$get(config.api.get.Topic.recommendsPost+ this.detail.topicName+'/post/recommends' ,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
if(this.$route.query.type&&this.$route.query.type==='word') {
params.type = 0;
this.$axios.$get(config.api.get.Topic.postList + this.detail.topicName + '/posts',
{params:params}).then((response) => {
this.handleResponse(currentPage, response)
})
}
if(this.$route.query.type&&this.$route.query.type==='video') {
params.type = 1;
this.$axios.$get(config.api.get.Topic.postList + this.detail.topicName + '/posts',
{params:params}).then((response) => {
this.handleResponse(currentPage, response)
})
}
if(this.$route.query.type&&this.$route.query.type==='picture') {
params.type = 2;
this.$axios.$get(config.api.get.Topic.postList + this.detail.topicName + '/posts',
{params:params}).then((response) => {
this.handleResponse(currentPage, response)
})
}
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetDynamicList(currentPage)
},
}
} }
</script> </script>
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