Commit 1087e21a authored by 罗林杰's avatar 罗林杰

Merge remote-tracking branch 'origin/master'

parents 62683b57 c619007e
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
firstLoaded: false, firstLoaded: false,
// 是否滚动到当前页 // 是否滚动到当前页
isCurrentPage: false, isCurrentPage: false,
//动态类型 0:关注
articleType: '', articleType: '',
} }
}, },
...@@ -96,6 +97,7 @@ ...@@ -96,6 +97,7 @@
if (newVal === 2){ if (newVal === 2){
//话题 //话题
this.getTopicList() this.getTopicList()
this.reload()
} }
// 懒加载,当滑动到当前的item时,才去加载 // 懒加载,当滑动到当前的item时,才去加载
if (!this.firstLoaded) { if (!this.firstLoaded) {
...@@ -115,6 +117,7 @@ ...@@ -115,6 +117,7 @@
//tab标签点击 //tab标签点击
tabClick({id}) { tabClick({id}) {
this.topicId = id this.topicId = id
this.$emit('topicId', this.topicId)
this.reload() this.reload()
}, },
//查询话题列表 //查询话题列表
...@@ -129,6 +132,7 @@ ...@@ -129,6 +132,7 @@
}); });
//初始化话题id 锁到第一个话题 //初始化话题id 锁到第一个话题
this.topicId = this.topicList[0].id this.topicId = this.topicList[0].id
this.$emit('topicId', this.topicId)
}) })
}, },
// 接收父组件传过来的刷新列表要求 // 接收父组件传过来的刷新列表要求
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<!-- swiper必须设置height:100%,因为swiper有默认的高度,只有设置高度100%才可以铺满页面 --> <!-- swiper必须设置height:100%,因为swiper有默认的高度,只有设置高度100%才可以铺满页面 -->
<swiper class="swiper" :current="current" @animationfinish="swiperAnimationfinish"> <swiper class="swiper" :current="current" @animationfinish="swiperAnimationfinish">
<swiper-item class="swiper-item" v-for="(i,index) in list" :key="index"> <swiper-item class="swiper-item" v-for="(i,index) in list" :key="index">
<ListVue ref="listItem" :tabIndex="index" :currentIndex="current"/> <ListVue ref="listItem" :tabIndex="index" :currentIndex="current" @topicId="handleTopicId"/>
</swiper-item> </swiper-item>
</swiper> </swiper>
<login @change="getToLogin" :isLoginPop="isLoginPop" class="my-select"></login> <login @change="getToLogin" :isLoginPop="isLoginPop" class="my-select"></login>
...@@ -92,7 +92,9 @@ ...@@ -92,7 +92,9 @@
current: 1, current: 1,
num: 0, num: 0,
//登录弹窗 //登录弹窗
isLoginPop: false isLoginPop: false,
//话题id
topicId: null,
}; };
}, },
onShow() { onShow() {
...@@ -104,6 +106,10 @@ ...@@ -104,6 +106,10 @@
} }
}, },
methods: { methods: {
//接收子组件传过来的话题id 为了进行发表动态使用
handleTopicId(value){
this.topicId = value
},
// swiper滑动结束 // swiper滑动结束
swiperAnimationfinish(e) { swiperAnimationfinish(e) {
this.current = e.detail.current; this.current = e.detail.current;
...@@ -133,7 +139,7 @@ ...@@ -133,7 +139,7 @@
&& memInfo.memCareer != '' && memInfo.memCareer != null && memInfo.memResidenceProvince != null && memInfo.memResidenceCity != null){ && memInfo.memCareer != '' && memInfo.memCareer != null && memInfo.memResidenceProvince != null && memInfo.memResidenceCity != null){
//已完善个人资料 可以发布动态 //已完善个人资料 可以发布动态
uni.navigateTo({ uni.navigateTo({
url: '/pagesArticle/publishArticle' url: '/pagesArticle/publishArticle?topicId='+this.topicId
}) })
}else { }else {
//没完善个人资料 需要去完善 //没完善个人资料 需要去完善
......
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
isConfirm: false, isConfirm: false,
h: 0, h: 0,
focus: false, focus: false,
isLoginPop: false isLoginPop: false,
//话题id
topicId:null,
} }
}, },
computed: { computed: {
...@@ -46,6 +48,9 @@ ...@@ -46,6 +48,9 @@
return `${this.h}px` return `${this.h}px`
} }
}, },
onLoad(value){
this.topicId = value.topicId
},
methods: { methods: {
//发布 //发布
submit() { submit() {
...@@ -59,6 +64,7 @@ ...@@ -59,6 +64,7 @@
const params = { const params = {
content:this.content, content:this.content,
pictureId: JSON.stringify(this.uploadImgJSON), pictureId: JSON.stringify(this.uploadImgJSON),
topicId:this.topicId
} }
//将params转成json //将params转成json
publishArticle(params).then( res => { publishArticle(params).then( res => {
......
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