deming/pageB/details/index.vue

122 lines
3.3 KiB
Vue
Raw Normal View History

2020-06-03 02:53:38 +00:00
<template>
<view class="details">
<view style="border-top: 1rpx solid #ececec;"></view>
2020-08-05 13:06:29 +00:00
<userinfo :list="userInfo"></userinfo>
2020-06-03 02:53:38 +00:00
<view style="border-top: 20rpx solid #ececec;"></view>
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
'background-color':'#FF780F',
'bottom':'10rpx'
}"
inactive-color="#333"
:active-item-style="{
'color':'#FF780F'
}"
:bold="false"
@change="dianji"
2020-08-05 13:06:29 +00:00
:show-bar="false">
</u-tabs>
<scroll-view class="scroll-box" scroll-y="true">
<view class="box">
<videoItem v-for="item in listInfo" :key="item.article_id" :item="item"
@getArticlelist="getArticlelist"></videoItem>
<view class="no-data" v-show="!listInfo && !page">暂无数据</view>
</view>
</scroll-view>
2020-06-03 02:53:38 +00:00
</view>
</template>
<style lang="scss" scoped>
.details{
.card{
height: 100vh;
width: 100%;
.box{
width: 100%;
padding: 0 30rpx;
}
.list{
display: flex;
}
}
2020-08-05 13:06:29 +00:00
.scroll-box {
// display: flex;
padding: 20rpx;
box-sizing: border-box;
.box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.no-data {
margin: 100rpx auto 0;
}
}
}
2020-06-03 02:53:38 +00:00
}
</style>
<script>
import userinfo from "../components/details/userinfo"
2020-08-05 13:06:29 +00:00
import videoItem from "@/components/index/video-item/index"
2020-06-03 02:53:38 +00:00
export default {
2020-08-05 13:06:29 +00:00
// name:"details",
2020-06-03 02:53:38 +00:00
components:{
userinfo,
2020-08-05 13:06:29 +00:00
videoItem
2020-06-03 02:53:38 +00:00
},
data(){
return {
list:[
{
name: '图文'
2020-08-05 13:06:29 +00:00
}, {
name: '短视频'
2020-06-03 02:53:38 +00:00
}
],
2020-08-05 13:06:29 +00:00
num: 0,
userInfo: {}, // 用户信息
listInfo: [], // 列表详情
member_id: 0,
page: 0,
2020-06-03 02:53:38 +00:00
}
},
2020-08-05 13:06:29 +00:00
onLoad(option) {
// console.log(option);
this.member_id = option.id;
this.getUserInfo(option.id);
this.getArticlelist();
},
2020-06-03 02:53:38 +00:00
methods:{
2020-08-05 13:06:29 +00:00
// 获取信息
getUserInfo(id) {
this.$u.post("MemberExpert/expertInfo",{member_id: id}).then(res => {
// console.log(res);
this.userInfo = res.data.info;
// console.log(this.userInfo);
})
},
// 获取列表
getArticlelist() {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: this.num + 1,
member_id: this.member_id,
}).then(res => {
if (res.errCode == 0) {
// console.log(res);
this.listInfo = res.data.list;
2020-08-07 11:56:47 +00:00
// console.log(this.listInfo);
2020-08-05 13:06:29 +00:00
} else {
console.log(res.message);
}
})
},
2020-06-03 02:53:38 +00:00
dianji(a){
2020-08-05 13:06:29 +00:00
console.log(a);
2020-06-03 02:53:38 +00:00
if(typeof a == "object"){
this.num = a.detail.current
}else{
this.num = a
}
2020-08-05 13:06:29 +00:00
this.getArticlelist();
2020-06-03 02:53:38 +00:00
}
}
}
</script>