This commit is contained in:
2020-08-09 18:39:35 +08:00
parent 9631e9f827
commit 9b93b6a5a9
20 changed files with 148 additions and 66 deletions

View File

@@ -125,7 +125,7 @@ export default {
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeight = res.windowHeight - 90 / 2 + 'px';
this.scrollHeight = res.windowHeight - (res.windowWidth / 750) * 90 + 'px';
// console.log(this.scrollHeight);
},
toDetailsPage(id) {

View File

@@ -115,7 +115,7 @@ export default {
setViewHeight() {
const res = uni.getSystemInfoSync();
const otherHeight = 347 + 140 + 20 + 98;
this.scrollHeight = res.windowHeight - otherHeight / 2 + 'px';
this.scrollHeight = res.windowHeight - (res.windowWidth / 750) * otherHeight + 'px';
// console.log(this.scrollHeight);
},
toDetailsPage(id) {

View File

@@ -38,12 +38,12 @@
</view>
<view class="main">
<scroll-view class="video-image" scroll-y v-if="cur==0 && indextop.length" :style="{ height: scrollHeiht }">
<view v-for="item in indextop" :key="item.id">
<videoTop :url="item.article_pic" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.article_pic"></imageTop>
<view v-for="item in indextop" :key="item.id" class="container-top">
<videoTop :url="item.article_pic" v-if="item.type == 2" @click.native="toDetailsPage(item.article_id)"></videoTop>
<imageTop v-else :url="item.article_pic" @click.native="toDetailsPage(item.article_id)"></imageTop>
</view>
<view style="display: flex;flex-wrap: wrap;" v-if="indexlist.length">
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.article_pic"></listitem>
<view v-if="indexlist.length" class="container-bottom">
<listitem v-for="item in indexlist" :key="item.id" :type="item.type" :url="item.article_pic" class="bottom-item" @click.native="toDetailsPage(item.article_id)"></listitem>
</view>
</scroll-view>
<view class="item" v-if="cur==1">
@@ -109,6 +109,12 @@ export default {
// if(e.index == 0) this.show = true;
},
methods: {
toDetailsPage(id) {
// console.log(11);
this.$u.route('pageB/photo/index', {
id: id
});
},
switchCurrent(current) {
this.cur = current;
if(current == 0) {
@@ -123,15 +129,15 @@ export default {
uni.stopPullDownRefresh();
})
},
getStoreImgVideoList() {
this.$u.api.getStoreImgVideoList({ id: this.sid }).then((res)=>{
if(res.data.length) {
this.indextop = [res.data[0], res.data[1]];
this.indexlist = res.data.slice(2,);
}
uni.stopPullDownRefresh();
})
},
// getStoreImgVideoList() {
// this.$u.api.getStoreImgVideoList({ id: this.sid }).then((res)=>{
// if(res.data.length) {
// this.indextop = [res.data[0], res.data[1]];
// this.indexlist = res.data.slice(2,);
// }
// uni.stopPullDownRefresh();
// })
// },
attentionMember() {
this.$u.api.attentionMember({ member_id: this.info.member_id }).then(res => {
if(res.errCode == 0) {
@@ -149,13 +155,15 @@ export default {
uni.stopPullDownRefresh();
if (res.errCode == 0) {
// this.articleList = res.data.list;
if(res.data.list.length > 0) {
this.indextop = [res.data.list[0]]
this.indextop = [res.data.list[0], res.data.list[1]];
}
if(res.data.list.length > 1) {
this.indextop.push(res.data.list[1]);
this.indexlist.push(...res.data.list.slice(2,));
if(JSON.stringify(res.data) != '[]') {
if(res.data.list.length > 0) {
this.indextop = [res.data.list[0]]
// this.indextop = [res.data.list[0], res.data.list[1]];
}
if(res.data.list.length > 1) {
this.indextop.push(res.data.list[1]);
this.indexlist.push(...res.data.list.slice(2,));
}
}
}
})
@@ -288,9 +296,23 @@ export default {
.video-image {
padding-bottom: 98rpx;
}
> view {
margin-top: 20rpx;
.container-top {
> view {
margin-bottom: 10rpx;
}
}
.container-bottom {
margin-top: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.bottom-item {
margin-bottom: 10rpx;
}
}
// > view {
// margin-top: 20rpx;
// }
}
.tabbar {
border-top: 1rpx #DBDADA solid;