完善me页面
This commit is contained in:
parent
ebb57554ff
commit
ff5c6b474f
60
src/components/Posters.vue
Normal file
60
src/components/Posters.vue
Normal file
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div class="posters">
|
||||
<div class="poster-item" v-for="i in list">
|
||||
<img class="poster" src="../assets/img/poster/2.jpg" alt="">
|
||||
<div class="num">
|
||||
<img class="love" src="../assets/img/icon/love.svg" alt="">
|
||||
<span>123.2w</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Posters",
|
||||
props: {
|
||||
list: {
|
||||
type: [Array, Number],
|
||||
default: () => {
|
||||
return 5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.posters {
|
||||
display: grid;
|
||||
grid-template-columns: 33.33vw 33.33vw 33.33vw;
|
||||
grid-template-rows:calc(33.33vw * 1.2);
|
||||
}
|
||||
|
||||
.poster-item {
|
||||
border: 1px solid black;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.poster {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.num {
|
||||
color: white;
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
left: 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 1.4rem;
|
||||
|
||||
.love {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,137 +1,177 @@
|
||||
<template>
|
||||
<div class="Me">
|
||||
<SlideList key1="父" style="width: 100vw;">
|
||||
<SlideItem style="overflow:auto;">
|
||||
<div ref="desc">
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<p>我页面</p>
|
||||
<SlideList style="width: 100vw;"
|
||||
@first="first"
|
||||
@end="end"
|
||||
v-model:active-index="baseActiveIndex"
|
||||
>
|
||||
<SlideItem style="overflow:auto;" @scroll="scroll">
|
||||
<div ref="desc" class="desc">
|
||||
<header ref="header">
|
||||
<img src="../../assets/img/icon/next.svg" alt="" @click="$emit('back')">
|
||||
<img src="../../assets/img/icon/more.svg" alt="">
|
||||
</header>
|
||||
<div class="detail">
|
||||
<div class="head">
|
||||
<img src="../../assets/img/icon/head-image.jpeg" class="head-image">
|
||||
<div class="other-buttons" v-if="false">
|
||||
<div class="attention">
|
||||
关注
|
||||
</div>
|
||||
<div class="more-attention">
|
||||
-
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-buttons ">
|
||||
<div class="collect">
|
||||
<img src="../../assets/img/icon/collect-white.svg" alt="">
|
||||
<span class="mr5p">收藏</span>
|
||||
</div>
|
||||
<div class="add-friend">
|
||||
<img src="../../assets/img/icon/add-friend-white.svg" alt="">
|
||||
</div>
|
||||
<div class="qr-code">
|
||||
<img src="../../assets/img/icon/qr-code-white.svg" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<p class="name f22 mt5p mb5p">ttentau</p>
|
||||
<div class="number mb10p">
|
||||
<span>抖音号:605128307</span>
|
||||
<div class="jrtt">
|
||||
<img src="../../assets/img/icon/sina.svg" alt="">
|
||||
<span>头条主页</span>
|
||||
<img src="../../assets/img/icon/next.svg" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="signature f12 mb10p">
|
||||
<span>填写个性签名更容易获得别人关注哦</span>
|
||||
</div>
|
||||
<div class="info f10 mb10p">
|
||||
<div class="age">
|
||||
<img src="../../assets/img/icon/person.svg" alt="">
|
||||
<span>22岁</span>
|
||||
</div>
|
||||
<div class="location">
|
||||
<span>上海</span>
|
||||
</div>
|
||||
<div class="school">
|
||||
四川理工大学
|
||||
</div>
|
||||
</div>
|
||||
<div class="heat">
|
||||
<span>8获赞</span>
|
||||
<span>38关注</span>
|
||||
<span>42粉丝</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ref="content">
|
||||
<div ref="content" style="margin-bottom: 60px;">
|
||||
<SlideList
|
||||
:show-indicator="true"
|
||||
:indicator-fixed="indicatorFixed"
|
||||
indicator-type="me"
|
||||
v-model:active-index="contentIndex">
|
||||
<SlideItem>
|
||||
<div ref="tab-content1">1</div>
|
||||
<div ref="tab-content1">
|
||||
<div class="posters">
|
||||
<Posters></Posters>
|
||||
<div class="no-more">暂时没有更多了</div>
|
||||
</div>
|
||||
</div>
|
||||
</SlideItem>
|
||||
<SlideItem>
|
||||
<div ref="tab-content2">2</div>
|
||||
<div ref="tab-content2">
|
||||
<Posters :list="15"></Posters>
|
||||
<div class="no-more">暂时没有更多了</div>
|
||||
</div>
|
||||
</SlideItem>
|
||||
<SlideItem>
|
||||
<div class="content" ref="tab-content3">
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<p>喜欢</p>
|
||||
<div ref="tab-content3">
|
||||
<Posters :list="5"></Posters>
|
||||
<div class="no-more">暂时没有更多了</div>
|
||||
</div>
|
||||
</SlideItem>
|
||||
</SlideList>
|
||||
</div>
|
||||
<Footer v-bind:init-tab="5"/>
|
||||
</SlideItem>
|
||||
<SlideItem style="min-width: 60vw;line-height: 50px; overflow:auto;">
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<p>设置页</p>
|
||||
<ul>
|
||||
<li @click="$nav('MyCard')">
|
||||
<img src="../../assets/img/icon/card-gray.png" alt="">
|
||||
<span>个人名片</span>
|
||||
</li>
|
||||
<li @click="$nav('MyCollect')">
|
||||
<img src="../../assets/img/icon/collect-gray.png" alt="">
|
||||
<span>我的收藏</span>
|
||||
</li>
|
||||
<div class="line"></div>
|
||||
<li>
|
||||
<img src="../../assets/img/icon/wallet-gray.png" alt="">
|
||||
<span>钱包</span>
|
||||
</li>
|
||||
<li>
|
||||
<img src="../../assets/img/icon/order-gray.png" alt="">
|
||||
<span>订单</span>
|
||||
</li>
|
||||
<li class="exception" @click="toggleService()">
|
||||
<div class="d-flex align-items-center">
|
||||
<img src="../../assets/img/icon/category-gray.png" alt="">
|
||||
<span>服务</span>
|
||||
</div>
|
||||
<div class="triangle"></div>
|
||||
</li>
|
||||
<div class="service">
|
||||
<li>
|
||||
<img src="../../assets/img/icon/order-gray.png" alt="" class="op0">
|
||||
<span>购物助手</span>
|
||||
</li>
|
||||
<li>
|
||||
<img src="../../assets/img/icon/order-gray.png" alt="" class="op0">
|
||||
<span>生活服务订单</span>
|
||||
</li>
|
||||
<li>
|
||||
<img src="../../assets/img/icon/order-gray.png" alt="" class="op0">
|
||||
<span>DOU+ 上热门</span>
|
||||
</li>
|
||||
<li>
|
||||
<img src="../../assets/img/icon/order-gray.png" alt="" class="op0">
|
||||
<span>彩铃服务</span>
|
||||
</li>
|
||||
<li>
|
||||
<img src="../../assets/img/icon/order-gray.png" alt="" class="op0">
|
||||
<span>免流量看抖音</span>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<li>
|
||||
<img src="../../assets/img/icon/link-gray.png" alt="">
|
||||
<span>小程序</span>
|
||||
</li>
|
||||
<li>
|
||||
<img src="../../assets/img/icon/juan-gray.png" alt="">
|
||||
<span>卡卷</span>
|
||||
</li>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<li>
|
||||
<img src="../../assets/img/icon/umbrella-gray.png" alt="">
|
||||
<span>未成年保护工具</span>
|
||||
</li>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<li>
|
||||
<img src="../../assets/img/icon/setting-gray.png" alt="">
|
||||
<span>设置</span>
|
||||
</li>
|
||||
</ul>
|
||||
</SlideItem>
|
||||
</SlideList>
|
||||
</div>
|
||||
@ -139,21 +179,31 @@
|
||||
<script>
|
||||
import SlideList from "./SlideList.vue";
|
||||
import SlideItem from "./SlideItem.vue";
|
||||
import Posters from '../../components/Posters'
|
||||
import Footer from "../../components/Footer";
|
||||
|
||||
export default {
|
||||
name: "Me",
|
||||
components: {SlideList, SlideItem},
|
||||
components: {SlideList, SlideItem, Posters,Footer},
|
||||
data() {
|
||||
return {
|
||||
serviceEl: {},
|
||||
serviceHeight: 0,
|
||||
contentIndex: 0,
|
||||
desc: null
|
||||
baseActiveIndex: 0,
|
||||
desc: null,
|
||||
tabContents: [],
|
||||
indicatorHeight: 42,
|
||||
indicatorFixed: false,
|
||||
refs: {
|
||||
header: null,
|
||||
headerHeight: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
contentIndex(){
|
||||
this.changeIndex()
|
||||
watch: {
|
||||
contentIndex(newVal, oldVal) {
|
||||
this.changeIndex(newVal, oldVal)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -162,38 +212,60 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.changeIndex()
|
||||
setTimeout(() => {
|
||||
this.refs.header = this.$refs.header
|
||||
this.refs.headerHeight = this.$refs.header.offsetHeight
|
||||
this.changeIndex(0, null)
|
||||
})
|
||||
},
|
||||
methods:{
|
||||
changeIndex(){
|
||||
methods: {
|
||||
scroll() {
|
||||
let top = this.tabContents[this.contentIndex].getBoundingClientRect().top
|
||||
this.indicatorFixed = top < this.indicatorHeight;
|
||||
},
|
||||
changeIndex(newVal, oldVal) {
|
||||
let desc = this.$refs.desc
|
||||
// console.log(desc.clientHeight)
|
||||
let content = this.$refs['content']
|
||||
let tabContent1 = this.$refs['tab-content1']
|
||||
let tabContent2 = this.$refs['tab-content2']
|
||||
let tabContent3 = this.$refs['tab-content3']
|
||||
switch (this.contentIndex) {
|
||||
case 0:
|
||||
if (this.bodyHeight - desc.clientHeight > tabContent1.clientHeight) {
|
||||
content.style.height = this.bodyHeight - desc.clientHeight + 'px'
|
||||
} else {
|
||||
content.style.height = tabContent1.clientHeight + 'px'
|
||||
}
|
||||
break
|
||||
case 1:
|
||||
if (this.bodyHeight - desc.clientHeight > tabContent2.clientHeight) {
|
||||
content.style.height = this.bodyHeight - desc.clientHeight + 'px'
|
||||
}else {
|
||||
content.style.height = tabContent2.clientHeight + 'px'
|
||||
}
|
||||
break
|
||||
case 2:
|
||||
if (this.bodyHeight - desc.clientHeight > tabContent3.clientHeight) {
|
||||
content.style.height = this.bodyHeight - desc.clientHeight + 'px'
|
||||
}else {
|
||||
content.style.height = tabContent3.clientHeight + 'px'
|
||||
}
|
||||
break
|
||||
if (!this.tabContents.length) {
|
||||
this.tabContents = [this.$refs['tab-content1'], this.$refs['tab-content2'], this.$refs['tab-content3']]
|
||||
}
|
||||
// debugger
|
||||
let moveDistance = 0
|
||||
if (oldVal !== null) {
|
||||
moveDistance = this.bodyHeight - this.tabContents[oldVal].getBoundingClientRect().top
|
||||
} else {
|
||||
moveDistance = 0
|
||||
}
|
||||
// console.log('moveDistance', moveDistance)
|
||||
if (moveDistance > this.tabContents[newVal].clientHeight) {
|
||||
if (moveDistance + this.indicatorHeight > this.bodyHeight) {
|
||||
content.style.height = this.bodyHeight + 'px'
|
||||
} else {
|
||||
content.style.height = moveDistance + this.indicatorHeight + 'px'
|
||||
}
|
||||
} else {
|
||||
if (this.bodyHeight - desc.clientHeight > this.tabContents[this.contentIndex].clientHeight + this.indicatorHeight) {
|
||||
content.style.height = this.bodyHeight - desc.clientHeight + this.indicatorHeight + 'px'
|
||||
} else {
|
||||
return content.style.height = this.tabContents[this.contentIndex].clientHeight + this.indicatorHeight + 'px'
|
||||
// if (this.tabContents[this.contentIndex].clientHeight + this.indicatorHeight > this.bodyHeight) {
|
||||
// content.style.height = this.bodyHeight + 'px'
|
||||
// } else {
|
||||
// content.style.height = this.tabContents[this.contentIndex].clientHeight + this.indicatorHeight + 'px'
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
first(e) {
|
||||
if (this.baseActiveIndex !== 0) return
|
||||
this.refs.header.style.transition = 'all 0s'
|
||||
this.refs.header.style.height = this.refs.headerHeight + (e / 3) + 'px'
|
||||
},
|
||||
end() {
|
||||
if (this.baseActiveIndex !== 0) return
|
||||
this.refs.header.style.transition = 'all .3s'
|
||||
this.refs.header.style.height = this.refs.headerHeight + 'px'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -206,5 +278,188 @@ $right-bg-color: #2e3244;
|
||||
font-size: 1.6rem;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
|
||||
.no-more {
|
||||
font-size: 1.4rem;
|
||||
padding: 10px;
|
||||
color: gray;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.desc {
|
||||
header {
|
||||
height: 150px;
|
||||
/* background-image: url('./imgs/header2.jpg'); */
|
||||
background-image: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAQEBAQEBAPEBAPEBAPDw8QDw8NEA8OFRIWFhURFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGBAQGC0dHR0tLS0rKy0tLS0tLS0tKy0tKy0tLSstLS0tLS0tLSstLSstLS0tKy0tLS0tLS0tLisrN//AABEIAKgBLAMBIgACEQE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YiwAAWCwAAWCwAAWAugAAIoAAA00MZJaPVD8RWzJW4czn2G0arXQG1E0VTGOzFyNM4GQAWGqAABosmFypITF6cuI+lO1zOmTGYXGmVUTJlc5VzBV7ipE5irCYZFi5PUkgEi8XoWzC0wuXU8V2yLlAGr4r3C5QBpgAAMNgAAAAAAAAAAAAAAAAAAAAAAAAACYAAAoAAAAAAAAAJgAACgAAAAAAAAAAAAJgAABj/2Q==');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
/*background: url("../../assets/img/icon/top-bg.jpg");*/
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
|
||||
img {
|
||||
border-radius: 50%;
|
||||
padding: 5px;
|
||||
background: #524a4a;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
|
||||
&:nth-child(1) {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.detail {
|
||||
background: $left-bg-color;
|
||||
padding: 0 20px;
|
||||
|
||||
.head {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
transform: translateY(-20px);
|
||||
|
||||
.head-image {
|
||||
background: black;
|
||||
padding: 5px;
|
||||
border-radius: 50%;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.my-buttons {
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
float: left;
|
||||
border-radius: 2px;
|
||||
background: #676767;
|
||||
margin-right: 5px;
|
||||
|
||||
img {
|
||||
padding: 6px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #cdcdcd;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.description {
|
||||
color: white;
|
||||
transform: translateY(-20px);
|
||||
|
||||
.number {
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid gray;
|
||||
|
||||
.jrtt {
|
||||
float: right;
|
||||
|
||||
img {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
span {
|
||||
margin: 0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
float: left;
|
||||
border-radius: 2px;
|
||||
background: #676767;
|
||||
margin-right: 5px;
|
||||
padding: 2px 4px;
|
||||
|
||||
img {
|
||||
height: 10px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #cdcdcd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.heat {
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
|
||||
.line {
|
||||
height: 1px;
|
||||
background: #cccccc;
|
||||
opacity: .1;
|
||||
margin: 5px 20px;
|
||||
}
|
||||
|
||||
.service {
|
||||
transition: all .3s;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
li {
|
||||
background: $right-bg-color;
|
||||
padding: 20px;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&:active {
|
||||
background: #454b65;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
&.exception {
|
||||
justify-content: space-between;
|
||||
|
||||
.triangle {
|
||||
transform: translateY(3px);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 7px solid #cccccc;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid transparent;
|
||||
border-left: 7px solid transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -20,27 +20,27 @@
|
||||
</div>
|
||||
<div class="loading" :style="loadingStyle">AA</div>
|
||||
</div>
|
||||
<div class="indicator-me" v-if="showIndicator && indicatorType === 'me'">
|
||||
<div class="indicator-me" :class="indicatorFixed?'fixed':''" v-if="showIndicator && indicatorType === 'me'">
|
||||
<div class="tabs" ref="tabs">
|
||||
<div class="tab"
|
||||
:class="currentSlideItemIndex === 0?'active':''"
|
||||
@click="changeIndex(false,0)">
|
||||
<span>关注</span></div>
|
||||
<span>作品</span></div>
|
||||
<div class="tab"
|
||||
:class="currentSlideItemIndex === 1?'active':''"
|
||||
@click.stop="changeIndex(false,1)">
|
||||
<span>推荐</span>
|
||||
<span>私密</span>
|
||||
</div>
|
||||
<div class="tab"
|
||||
:class="currentSlideItemIndex === 2?'active':''"
|
||||
@click="changeIndex(false,2)">
|
||||
<span>推荐</span>
|
||||
@click="changeIndex(false,2,$event)">
|
||||
<span>喜欢</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="indicator" ref="indicator"></div>
|
||||
</div>
|
||||
<div id="base-slide-list" ref="slideList"
|
||||
:style="{'flex-direction':direction}"
|
||||
:style="{'flex-direction':direction,marginTop:indicatorFixed?'42px':'0'}"
|
||||
@touchstart="touchStart($event)"
|
||||
@touchmove="touchMove($event)"
|
||||
@touchend="touchEnd($event)">
|
||||
@ -61,6 +61,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: () => false
|
||||
},
|
||||
indicatorFixed: {
|
||||
type: Boolean,
|
||||
default: () => false
|
||||
},
|
||||
indicatorType: {
|
||||
type: String,
|
||||
default: () => 'home'
|
||||
@ -152,6 +156,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
activeIndex() {
|
||||
// console.log('activeIndex')
|
||||
this.changeIndex()
|
||||
},
|
||||
},
|
||||
@ -161,8 +166,7 @@ export default {
|
||||
this.changeIndex(true)
|
||||
},
|
||||
methods: {
|
||||
changeIndex(init = false, index = null) {
|
||||
console.log(111)
|
||||
changeIndex(init = false, index = null, e) {
|
||||
this.currentSlideItemIndex = index !== null ? index : this.activeIndex
|
||||
!init && this.$setCss(this.slideList, 'transition-duration', `300ms`)
|
||||
if (this.direction === 'row') {
|
||||
@ -173,6 +177,8 @@ export default {
|
||||
} else {
|
||||
this.$setCss(this.slideList, 'transform', `translate3d(0px, ${-this.getHeight(this.currentSlideItemIndex) + this.moveYDistance}px, 0px)`)
|
||||
}
|
||||
this.$attrs['onUpdate:active-index'] && this.$emit('update:active-index', this.currentSlideItemIndex)
|
||||
|
||||
},
|
||||
initTabs() {
|
||||
let tabs = this.$refs.tabs
|
||||
@ -225,6 +231,10 @@ export default {
|
||||
this.homeLoadingMoveYDistance = this.moveYDistance
|
||||
}
|
||||
|
||||
if (!this.isDrawDown) {
|
||||
this.$attrs['onFirst'] && this.$emit('first', this.moveYDistance)
|
||||
}
|
||||
|
||||
if (this.direction === 'row') {
|
||||
if (this.isCanRightWiping) {
|
||||
// //禁止在index=0页面的时候,向左划
|
||||
@ -240,10 +250,8 @@ export default {
|
||||
}
|
||||
} else {
|
||||
if (this.isCanDownWiping) {
|
||||
if (this.currentSlideItemIndex === 0 && !this.isDrawDown) {//在第一个item,并且想往下划。
|
||||
this.$attrs['onFirst'] && this.$emit('first', this.moveYDistance)
|
||||
return
|
||||
}
|
||||
if (this.currentSlideItemIndex === 0 && !this.isDrawDown)return; //在第一个item,并且想往下划。
|
||||
|
||||
if (this.virtual) {
|
||||
if (this.currentSlideItemIndex === this.total - 1 && this.isDrawDown) return
|
||||
} else {
|
||||
@ -279,9 +287,13 @@ export default {
|
||||
if (this.direction === 'row') {
|
||||
if (this.currentSlideItemIndex === 0 && !this.isDrawRight) return
|
||||
if (this.currentSlideItemIndex === this.slideItems.length - 1 && this.isDrawRight) return
|
||||
// console.log('row-end')
|
||||
this.$stopPropagation(e)//todo 如果是嵌套竖状的slide,会出问题,会到moveYDistance停下,不会移到
|
||||
|
||||
//21/06/28 发现一个bug,就是会把所有的点击事件,给失效了。。。//已解决
|
||||
// this.$stopPropagation(e)//todo 如果是嵌套竖状的slide,会出问题,会到moveYDistance停下,不会移到
|
||||
//this.getWidth(this.currentSlideItemIndex)位置,但是不禁示冒泡的话,又会出现划动过快,把父级也会移动。
|
||||
if (this.moveXDistance !== 0) {
|
||||
this.$stopPropagation(e)
|
||||
}
|
||||
if (Math.abs(this.moveXDistance) < 20) gapTime = 1000
|
||||
if (Math.abs(this.moveXDistance) > (this.wrapperWidth / 3)) gapTime = 100
|
||||
if (gapTime < 150) {
|
||||
@ -501,6 +513,10 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.indicator-me.fixed {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user