shouye xiugai

This commit is contained in:
zmr900709 2020-07-17 08:36:53 +08:00
parent 552d0dfbf0
commit 750ff19690
2 changed files with 268 additions and 232 deletions

View File

@ -1,6 +1,10 @@
<template> <template>
<view class="video-item" v-if="item" @click="toDetailsPage"> <view class="video-item" v-if="item" @click="toDetailsPage">
<image class="head" :src="item.article_pic" v-if="item.type == 1" ></image>
<view class="header_fist" v-else>
<view class="backes">111</view>
<image class="head" :src="item.article_pic" ></image> <image class="head" :src="item.article_pic" ></image>
</view>
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view> <view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
<view class="jianjie">{{ item.article_content }}</view> <view class="jianjie">{{ item.article_content }}</view>
<view class="user"> <view class="user">
@ -163,6 +167,16 @@
background-color: transparent; background-color: transparent;
} }
} }
.header_fist{
position: relative;
.backes{
position: absolute;
top: 0;
background: #000000;
width: 100%;
height: 100%;
}
}
} }
</style> </style>
<script> <script>
@ -186,6 +200,7 @@ export default {
this.$u.api.articleLike({ this.$u.api.articleLike({
article_id: this.item.article_id, article_id: this.item.article_id,
}).then(res => { }).then(res => {
console.log(res)
if(res.errCode == 0) { if(res.errCode == 0) {
this.$emit("getArticlelist"); this.$emit("getArticlelist");
} }
@ -195,6 +210,7 @@ export default {
this.$u.api.articleCollect({ this.$u.api.articleCollect({
article_id: this.item.article_id, article_id: this.item.article_id,
}).then(res => { }).then(res => {
console.log(res)
if(res.errCode == 0) { if(res.errCode == 0) {
this.$emit("getArticlelist"); this.$emit("getArticlelist");
} }
@ -205,12 +221,16 @@ export default {
article_id: this.item.article_id, article_id: this.item.article_id,
member_id: this.item.member_id, member_id: this.item.member_id,
}).then(res => { }).then(res => {
console.log(res)
if(res.errCode == 0) { if(res.errCode == 0) {
this.$emit("getArticlelist"); this.$emit("getArticlelist");
} }
}) })
}, },
toDetailsPage() { toDetailsPage() {
uni.navigateTo({
url: '/pageB/photo/index',
});
}, },
}, },

View File

@ -7,11 +7,9 @@
'background-color':'#FF780F', 'background-color':'#FF780F',
'bottom':'10rpx' 'bottom':'10rpx'
}" }"
inactive-color="#333" inactive-color="#333" :active-item-style="{
:active-item-style="{
'color':'#333' 'color':'#333'
}" }" :bold="false"
:bold="false"
@change="dianji"></u-tabs> @change="dianji"></u-tabs>
</view> </view>
<view class="sosuo"></view> <view class="sosuo"></view>
@ -24,10 +22,12 @@
<u-swiper mode="dot" :list="indexImageSwiper" name="adv_code"></u-swiper> <u-swiper mode="dot" :list="indexImageSwiper" name="adv_code"></u-swiper>
<view class="list"> <view class="list">
<view> <view>
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem> <videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"
@getArticlelist="getArticlelist"></videoItem>
</view> </view>
<view style="margin-left:20rpx"> <view style="margin-left:20rpx">
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem> <videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item"
@getArticlelist="getArticlelist"></videoItem>
</view> </view>
</view> </view>
</view> </view>
@ -69,11 +69,13 @@
<view class="list"> <view class="list">
<view> <view>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> --> <!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem> <videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id"
:item="item" @getArticlelist="getArticlelist"></videoItem>
</view> </view>
<view style="margin-left:20rpx"> <view style="margin-left:20rpx">
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> --> <!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem> <videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id"
:item="item" @getArticlelist="getArticlelist"></videoItem>
</view> </view>
</view> </view>
</view> </view>
@ -90,6 +92,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
.top { .top {
padding: 0 30rpx; padding: 0 30rpx;
display: flex; display: flex;
@ -98,64 +101,78 @@
height: 88rpx; height: 88rpx;
align-items: center; align-items: center;
flex-shrink: 0; flex-shrink: 0;
.sosuo { .sosuo {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
} }
.tabs { .tabs {
width: 334rpx; width: 334rpx;
/deep/ .u-tab-item { /deep/ .u-tab-item {
font-weight: bold; font-weight: bold;
} }
} }
} }
.card { .card {
height: 100%; height: 100%;
width: 100%; width: 100%;
.box { .box {
width: 100%; width: 100%;
padding: 0 30rpx; padding: 0 30rpx;
} }
.list { .list {
display: flex; display: flex;
} }
} }
.tuijian { .tuijian {
width: 750rpx; width: 750rpx;
margin-left: -30rpx; margin-left: -30rpx;
height: 400rpx; height: 400rpx;
background-color: #ececec; background-color: #ececec;
padding: 30rpx; padding: 30rpx;
.title { .title {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
>view { >view {
width: 6rpx; width: 6rpx;
height: 30rpx; height: 30rpx;
background-color: #FF780F; background-color: #FF780F;
} }
>text { >text {
font-size: 30rpx; font-size: 30rpx;
color: 30rpx; color: 30rpx;
margin-left: 14rpx; margin-left: 14rpx;
} }
} }
.right { .right {
width: 14rpx; width: 14rpx;
height: 24rpx; height: 24rpx;
} }
} }
.tuijianlist { .tuijianlist {
width: 100%; width: 100%;
height: 282rpx; height: 282rpx;
margin-top: 30rpx; margin-top: 30rpx;
display: flex; display: flex;
>view:not(:last-child) { >view:not(:last-child) {
margin-right: 23rpx; margin-right: 23rpx;
} }
@ -173,15 +190,13 @@ export default {
name: "index", name: "index",
data() { data() {
return { return {
list:[ list: [{
{
name: '发现' name: '发现'
}, { }, {
name: '直播' name: '直播'
}, { }, {
name: '关注' name: '关注'
} }],
],
num: 0, num: 0,
page: 0, // 0 page: 0, // 0
articleList: [], articleList: [],
@ -230,6 +245,7 @@ export default {
page: this.page, page: this.page,
is_video_img: 0, // 1 2 0 is_video_img: 0, // 1 2 0
}).then(res => { }).then(res => {
console.log('37647744ghj',res)
if (res.errCode == 0) { if (res.errCode == 0) {
this.articleList = res.data.list; this.articleList = res.data.list;
} }