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

Merge remote-tracking branch 'origin/master'

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