Browse Source

优化me页面和添加login页面

pull/19/head
zyronon 4 years ago
parent
commit
e83f773b80
  1. 1
      src/App.vue
  2. 38
      src/assets/scss/custom.scss
  3. 11
      src/assets/scss/index.scss
  4. 6
      src/config/index.js
  5. 115
      src/pages/login/Login.vue
  6. 263
      src/pages/me/Me2.vue
  7. 702
      src/pages/me/Me3.vue
  8. 2
      src/pages/me/userinfo/EditUserInfoItem.vue
  9. 2
      src/router/index.js
  10. 10
      src/store/index.js

1
src/App.vue

@ -69,6 +69,7 @@ export default { @@ -69,6 +69,7 @@ export default {
'/me/right-menu/minor-protection/detail-setting',
'/me/right-menu/minor-protection/trigger-time',
'/me/right-menu/setting',
'/login',
'/service-protocol',

38
src/assets/scss/custom.scss

@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
background: $main-bg;
}
}
&.no-padding {
padding: 0;
}
@ -83,6 +84,22 @@ @@ -83,6 +84,22 @@
}
}
&.no-active {
&:active {
&.primary {
background: $primary-btn-color;
}
&.dark {
background: $second-btn-color;
}
&.white {
background: white;
}
}
}
&.dark {
background: $second-btn-color;
@ -90,4 +107,25 @@ @@ -90,4 +107,25 @@
background: $second-btn-color-tran;
}
}
&.white {
background: white;
color: black;
border: 1px solid gainsboro;
}
}
p {
padding: 0;
margin: 0;
}
.line {
height: 1px;
background: $line-color;
width: 100%;
}
.link {
color: rgb(18, 100, 149);
}

11
src/assets/scss/index.scss

@ -18,14 +18,3 @@ html, body { @@ -18,14 +18,3 @@ html, body {
margin: 0;
padding: 0;
}
p {
padding: 0;
margin: 0;
}
.line {
height: 1px;
background: $line-color;
width: 100%;
}

6
src/config/index.js

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
export default {
baseUrl: 'http://192.168.0.105//index.php/v1',
filePreview:'http://192.168.0.105//static/uploads/'
// baseUrl: 'http://192.168.0.105//index.php/v1',
// filePreview:'http://192.168.0.105/static/uploads/',
baseUrl: 'http://192.168.10.164//index.php/v1',
filePreview:'http://192.168.10.164/static/uploads/'
}

115
src/pages/login/Login.vue

@ -0,0 +1,115 @@ @@ -0,0 +1,115 @@
<template>
<div class="login">
<BaseHeader>
<template v-slot:right>
<span class="f16">帮助</span>
</template>
</BaseHeader>
<div class="content">
<div class="notice">
<div class="title">登录看朋友内容</div>
<div class="phone-number">138****8000</div>
<div class="sub-title">认证服务由中国移动提供</div>
</div>
<div class="button primary no-active">一键登录</div>
<div class="button white">其他手机号码登录</div>
<div class="protocol">
<!-- TODO -->
<div class="left"></div>
<div class="right">
我已阅读并同意
<span class="link" @click="$nav('/service-protocol',{type:'“抖音”用户服务协议'})">用户协议</span>
<span class="link" @click="$nav('/service-protocol',{type:'“抖音”用户服务协议'})">隐私政策</span>
<div>
以及
<span class="link" @click="$nav('/service-protocol',{type:'“抖音”用户服务协议'})">中国移动认证服务条款</span>
同时登录并使用抖音火山版火山小视频和抖音
</div>
</div>
</div>
<!-- TODO -->
<div class="other-login">
<span class="link">其他方式登录</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: "login",
data() {
return {}
},
computed: {},
created() {
},
methods: {}
}
</script>
<style scoped lang="scss">
@import "../../assets/scss/index";
.login {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow: auto;
color: black;
font-size: 1.4rem;
background: white;
.content {
padding: 6rem 3rem;
//padding-top: 6rem;
.notice {
margin-bottom: 8rem;
margin-top: 12rem;
display: flex;
align-items: center;
flex-direction: column;
.title {
margin-bottom: 2rem;
}
.phone-number {
font-size: 3rem;
margin-bottom: 1rem;
}
.sub-title {
font-size: 1.2rem;
color: $second-text-color;
}
}
.button {
margin-bottom: .5rem;
}
.protocol{
margin-top: 2rem;
font-size: 1.2rem;
}
.other-login{
position: absolute;
bottom: 4rem;
font-size: 1.2rem;
left: 50%;
transform: translateX(-50%);
}
}
}
</style>

263
src/pages/me/Me2.vue

@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
<div class="my-buttons ">
<div class="collect" @click="$nav('/edit-userinfo')">
<span class="mr1r">编辑资料</span>
<span class="f10p" style="color: darkgray">85%</span>
<!-- <span class="f10p" style="color: darkgray">85%</span>-->
</div>
<div class="add-friend" @click="$nav('/find-acquaintance')">
<img src="../../assets/img/icon/add-white.png" alt="">
@ -53,8 +53,29 @@ @@ -53,8 +53,29 @@
<span>抖音号605128307</span>
<img src="../../assets/img/icon/me/qrcode-gray.png" alt="" @click.stop="$nav('/my-card')">
</div>
<div class="signature f12 mb1r">
<span>填写个性签名更容易获得别人关注哦</span>
<div class="signature" @click="$nav('/edit-userinfo-item',{type:3})">
<template v-if="!userinfo.desc">
<template v-if="false">
<!-- 有个版本是这样子的应该是灰度测试-->
<span>点击添加介绍让大家认识你...</span>
<img src="../../assets/img/icon/me/write-gray.png" alt="">
</template>
<span>你还没有填写个人简介点击添加...</span>
</template>
<span v-else class="text">{{ userinfo.desc }}</span>
</div>
<div class="more">
<div class="age item" v-if="userinfo.birthday">
<img v-if="userinfo.sex === '女'" src="../../assets/img/icon/me/woman.png" alt="">
<img v-if="userinfo.sex === '男'" src="../../assets/img/icon/me/man.png" alt="">
<span>{{ filterAge(userinfo.birthday) }}</span>
</div>
<div class="item" v-if="userinfo.location">
{{ userinfo.location }}
</div>
<div class="item" v-if="userinfo.school.name">
{{ userinfo.school.name }}
</div>
</div>
<div class="heat">
<div class="text"><span class="num">8</span>获赞</div>
@ -62,6 +83,22 @@ @@ -62,6 +83,22 @@
<div class="text"><span class="num">8</span>粉丝</div>
</div>
</div>
<div class="other">
<div class="item">
<img src="../../assets/img/icon/me/shopping-cart-white.png" alt="">
<div class="right">
<div class="top">抖音商城</div>
<div class="bottom">发现超值好物</div>
</div>
</div>
<div class="item">
<img src="../../assets/img/icon/me/music-white.png" alt="">
<div class="right">
<div class="top">我的音乐</div>
<div class="bottom">已收藏20首</div>
</div>
</div>
</div>
</div>
</div>
<Indicator
@ -165,6 +202,9 @@ @@ -165,6 +202,9 @@
</SlideRowList>
</div>
<Footer v-bind:init-tab="5"/>
<transition name="fade">
<div class="mask" v-if="baseActiveIndex === 1" @click="baseActiveIndex = 0"></div>
</transition>
</SlideItem>
<SlideItem style="min-width: 70vw; overflow:auto;">
<transition name="fade1">
@ -274,6 +314,7 @@ import Posters from '../../components/Posters' @@ -274,6 +314,7 @@ import Posters from '../../components/Posters'
import Footer from "../../components/Footer";
import Indicator from '../../components/Indicator'
import {nextTick} from 'vue'
import {mapState} from "vuex";
export default {
name: "Me",
@ -282,7 +323,6 @@ export default { @@ -282,7 +323,6 @@ export default {
return {
contentIndex: 0,
baseActiveIndex: 0,
desc: null,
tabContents: [],
indicatorFixed: false,
floatFixed: false,
@ -293,8 +333,8 @@ export default { @@ -293,8 +333,8 @@ export default {
header: null,
headerHeight: 0,
descHeight: 0,
videoSlideRowListHeight: 0,
defaultVideoSlideRowListHeight: 0
videoSlideHeight: 0,
maxSlideHeight: 0
},
videoItemHeight: 0,
startLocationY: 0,
@ -328,7 +368,7 @@ export default { @@ -328,7 +368,7 @@ export default {
},
},
pageSize: 15,
slideRowListHeight: 0,
initSlideHeight: 0,
loadings: {
loading0: false,
loading1: false,
@ -345,8 +385,11 @@ export default { @@ -345,8 +385,11 @@ export default {
return this.$store.state.bodyWidth
},
videoSlideRowListStyle() {
return {height: this.refs.videoSlideRowListHeight !== 0 ? this.refs.videoSlideRowListHeight + 'px' : 'calc(100vh - 14.6rem)'}
}
return {height: this.refs.videoSlideHeight !== 0 ? this.refs.videoSlideHeight + 'px' : 'calc(100vh - 14.6rem)'}
},
...mapState({
userinfo: 'userinfo',
})
},
watch: {
contentIndex(newVal, oldVal) {
@ -354,18 +397,24 @@ export default { @@ -354,18 +397,24 @@ export default {
},
},
mounted() {
this.slideRowListHeight = this.bodyHeight - 50 - 352 - 50
setTimeout(() => {
this.refs.header = this.$refs.header
this.refs.headerHeight = this.$refs.header.offsetHeight
this.refs.descHeight = this.$refs.desc.offsetHeight
this.refs.defaultVideoSlideRowListHeight = this.$refs.videoSlideRowList.wrapperHeight
this.refs.maxSlideHeight = this.$refs.videoSlideRowList.wrapperHeight
this.initSlideHeight = this.bodyHeight - 50 - this.refs.descHeight - 50
this.changeIndex(0, null)
})
this.videoItemHeight = this.bodyWidth / 3 * 1.2 + 2
// console.log('videoItemHeight',this.videoItemHeight)
},
methods: {
click(e) {
if (this.baseActiveIndex === 0) return
if (this.baseActiveIndex === 1) {
this.baseActiveIndex = 0
this.$stopPropagation(e)
}
},
async getScrollAreaHeight(index = this.contentIndex) {
let scrollAreaHeight = 0
if (index === 3) {
@ -386,6 +435,7 @@ export default { @@ -386,6 +435,7 @@ export default {
break
}
}
// console.log('scrollAreaHeight',scrollAreaHeight)
return scrollAreaHeight
},
async changeIndex(newVal, oldVal) {
@ -394,7 +444,7 @@ export default { @@ -394,7 +444,7 @@ export default {
if (newVal === 3) {
if (videoOb.video.total === -1) {
this.loadings['loading' + newVal] = true
let res = await this.$api.videos.collect({pageNo: this.videos.my.pageNo, pageSize: this.pageSize,})
let res = await this.$api.videos.collect({pageNo: this.videos.collect.pageNo, pageSize: this.pageSize,})
this.loadings['loading' + newVal] = false
if (res.code === this.SUCCESS_CODE) this.videos.collect = res.data
}
@ -408,11 +458,11 @@ export default { @@ -408,11 +458,11 @@ export default {
if (res.code === this.SUCCESS_CODE) this.videos.my = res.data
break
case 1:
res = await this.$api.videos.private({pageNo: this.videos.my.pageNo, pageSize: this.pageSize,})
res = await this.$api.videos.private({pageNo: this.videos.private.pageNo, pageSize: this.pageSize,})
if (res.code === this.SUCCESS_CODE) this.videos.private = res.data
break
case 2:
res = await this.$api.videos.like({pageNo: this.videos.my.pageNo, pageSize: this.pageSize,})
res = await this.$api.videos.like({pageNo: this.videos.like.pageNo, pageSize: this.pageSize,})
if (res.code === this.SUCCESS_CODE) this.videos.like = res.data
break
}
@ -421,28 +471,30 @@ export default { @@ -421,28 +471,30 @@ export default {
}
let scrollAreaHeight = await this.getScrollAreaHeight(newVal)
// debugger
if (oldVal !== null) {
let transformY = this.getTransform(this.$refs.scroll)
// console.log('transformY', transformY)
let screenSlideRowListHeight = this.slideRowListHeight + Math.abs(transformY)
// console.log('slideRowListHeight', slideRowListHeight)
let screenSlideHeight = this.initSlideHeight + Math.abs(transformY)
// console.log('screenSlideHeight', screenSlideHeight)
// console.log('scrollAreaHeight', scrollAreaHeight)
// debugger
if (scrollAreaHeight < screenSlideRowListHeight) {
this.refs.videoSlideRowListHeight = screenSlideRowListHeight
if (this.indicatorFixed) {
this.refs.videoSlideHeight = scrollAreaHeight > screenSlideHeight ? scrollAreaHeight : screenSlideHeight
if (scrollAreaHeight > this.refs.maxSlideHeight) {
this.refs.videoSlideHeight = this.refs.maxSlideHeight
}
if (scrollAreaHeight > screenSlideRowListHeight) {
this.refs.videoSlideRowListHeight = scrollAreaHeight
} else {
this.refs.videoSlideHeight = scrollAreaHeight
if (scrollAreaHeight > this.refs.maxSlideHeight) {
this.refs.videoSlideHeight = this.refs.maxSlideHeight
}
if (scrollAreaHeight > this.refs.defaultVideoSlideRowListHeight) {
this.refs.videoSlideRowListHeight = this.refs.defaultVideoSlideRowListHeight
}
} else {
if (scrollAreaHeight < this.refs.defaultVideoSlideRowListHeight) {
this.refs.videoSlideRowListHeight = scrollAreaHeight
if (scrollAreaHeight < this.refs.maxSlideHeight) {
this.refs.videoSlideHeight = scrollAreaHeight
} else {
this.refs.videoSlideRowListHeight = this.refs.defaultVideoSlideRowListHeight
this.refs.videoSlideHeight = this.refs.maxSlideHeight
}
}
},
@ -486,7 +538,7 @@ export default { @@ -486,7 +538,7 @@ export default {
let scrollAreaHeight = await this.getScrollAreaHeight()
let SlideItems = document.querySelectorAll('.SlideItem')
let SlideItem = SlideItems[this.contentIndex]
if (scrollAreaHeight - this.refs.videoSlideRowListHeight < SlideItem.scrollTop + 60) {
if (scrollAreaHeight - this.refs.videoSlideHeight < SlideItem.scrollTop + 60) {
this.loadMoreData()
}
}
@ -513,7 +565,7 @@ export default { @@ -513,7 +565,7 @@ export default {
//
if (touchMoveDistance > 0) {
//posterHeight30
if (this.refs.videoSlideRowListHeight > scrollAreaHeight && Math.abs(touchMoveDistance) > 20) {
if (this.refs.videoSlideHeight > scrollAreaHeight && Math.abs(touchMoveDistance) > 20) {
this.$refs.scroll.style.transition = 'all .2s'
this.$refs.scroll.style.transform = `translate3d(0,0,0)`
this.indicatorFixed = this.floatShowName = this.floatFixed = this.isScroll = false
@ -539,7 +591,7 @@ export default { @@ -539,7 +591,7 @@ export default {
SlideItem.scrollTop = Math.abs(pageMoveDistance) - this.refs.descHeight + this.floatHeight
}
if (scrollAreaHeight - this.refs.videoSlideRowListHeight < SlideItem.scrollTop + 60) {
if (scrollAreaHeight - this.refs.videoSlideHeight < SlideItem.scrollTop + 60) {
this.loadMoreData()
}
@ -550,10 +602,11 @@ export default { @@ -550,10 +602,11 @@ export default {
this.moveYDistance = -this.refs.descHeight + this.floatHeight
}
} else {
if (this.slideRowListHeight > this.refs.videoSlideRowListHeight) return
if (this.refs.defaultVideoSlideRowListHeight > this.refs.videoSlideRowListHeight) {
let endTransformY = Math.abs(canTransformY) - (this.refs.defaultVideoSlideRowListHeight - this.refs.videoSlideRowListHeight)
console.log('endTransformY',endTransformY)
if (this.initSlideHeight > this.refs.videoSlideHeight) return
if (this.refs.maxSlideHeight > this.refs.videoSlideHeight) {
let endTransformY = Math.abs(canTransformY) - (this.refs.maxSlideHeight - this.refs.videoSlideHeight)
// console.log('canTransformY', canTransformY)
// console.log('endTransformY', endTransformY)
let moveTransformY = Math.abs(pageMoveDistance) < Math.abs(endTransformY) ? pageMoveDistance : -endTransformY
this.$refs.scroll.style.transform = `translate3d(0,${moveTransformY}px,0)`
this.floatFixed = Math.abs(moveTransformY) > 100
@ -577,7 +630,7 @@ export default { @@ -577,7 +630,7 @@ export default {
let pageMoveDistance = this.moveYDistance + touchMoveDistance * 1.2
// console.log('end-pageMoveDistance', pageMoveDistance)
let endTransformY = Math.abs(canTransformY) - (this.refs.defaultVideoSlideRowListHeight - this.refs.videoSlideRowListHeight)
let endTransformY = Math.abs(canTransformY) - (this.refs.maxSlideHeight - this.refs.videoSlideHeight)
if (this.indicatorFixed) {
this.moveYDistance = -canTransformY
this.isScroll = true
@ -590,7 +643,7 @@ export default { @@ -590,7 +643,7 @@ export default {
this.floatShowName = this.floatFixed = this.isScroll = false
} else {
if (this.slideRowListHeight > this.refs.videoSlideRowListHeight) {
if (this.initSlideHeight > this.refs.videoSlideHeight) {
return this.moveYDistance = 0
}
let endTime = Date.now()
@ -659,7 +712,7 @@ export default { @@ -659,7 +712,7 @@ export default {
} else {
//
this.$refs.scroll.style.transition = 'all .3s'
if (this.refs.defaultVideoSlideRowListHeight > this.refs.videoSlideRowListHeight) {
if (this.refs.maxSlideHeight > this.refs.videoSlideHeight) {
this.$refs.scroll.style.transform = `translate3d(0,${-endTransformY}px,0)`
// this.floatShowName = this.floatFixed = true
this.floatFixed = Math.abs(endTransformY) > 100
@ -673,8 +726,8 @@ export default { @@ -673,8 +726,8 @@ export default {
}
}
} else {
if (this.refs.defaultVideoSlideRowListHeight > this.refs.videoSlideRowListHeight) {
let endTransformY = Math.abs(canTransformY) - (this.refs.defaultVideoSlideRowListHeight - this.refs.videoSlideRowListHeight)
if (this.refs.maxSlideHeight > this.refs.videoSlideHeight) {
let endTransformY = Math.abs(canTransformY) - (this.refs.maxSlideHeight - this.refs.videoSlideHeight)
this.moveYDistance = -endTransformY
} else {
this.moveYDistance = pageMoveDistance
@ -693,6 +746,10 @@ export default { @@ -693,6 +746,10 @@ export default {
//transformY
transformY = parseInt(transformY)
return transformY
},
filterAge(age) {
let date = new Date(age)
return new Date().getFullYear() - date.getFullYear()
}
}
}
@ -716,6 +773,17 @@ export default { @@ -716,6 +773,17 @@ export default {
background: $main-bg;
height: 100%;
width: 100%;
font-size: 1.4rem;
.mask{
background: #0000004f;
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 3;
}
.scroll {
@ -734,11 +802,13 @@ export default { @@ -734,11 +802,13 @@ export default {
}
.collect {
padding: .7rem;
.video {
background: $active-main-bg;
border-radius: .5rem;
margin: .7rem;
padding: 1rem;
margin-bottom: .7rem;
.top {
display: flex;
@ -803,7 +873,6 @@ export default { @@ -803,7 +873,6 @@ export default {
.audio {
background: $active-main-bg;
border-radius: .5rem;
margin: .7rem;
padding: 1rem;
.top {
@ -857,7 +926,6 @@ export default { @@ -857,7 +926,6 @@ export default {
}
.float {
position: fixed;
top: 0;
@ -916,17 +984,15 @@ export default { @@ -916,17 +984,15 @@ export default {
color: white;
height: 12rem;
background-image: url('../../assets/img/header-bg.png');
//background-image: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAQEBAQEBAPEBAPEBAPDw8QDw8NEA8OFRIWFhURFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGBAQGC0dHR0tLS0rKy0tLS0tLS0tKy0tKy0tLSstLS0tLS0tLSstLSstLS0tKy0tLS0tLS0tLisrN//AABEIAKgBLAMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAAAAwECBAUGB//EAD8QAAIBAgMFAwgIBQQDAAAAAAABAgMRBBIhBSIxQXFRYbEGEyMyUnKBkRWCkqGissHRFEJic/AkNIPhBzNT/8QAGAEBAQEBAQAAAAAAAAAAAAAAAAECAwT/xAAeEQEBAQEAAwEBAQEAAAAAAAAAARECEiExA0FRE//aAAwDAQACEQMRAD8A+QgUTJTPS4mRLpi4stF6hDETAiIRBpiAEwZcZoRaJBKCLZSbF7BYuMaXYmxewWGGqWCxewWGGqWCxewWLhpeULDLENEw1SwWLWCxcNVsRYvYLDCUmtw+KKIvivV+KFxZnPbpL6MiWRCLNEXQRYsyAaVUiLY+pwM5YiAuQyAJuRcLlbhUhci4XC6oSicpKQZ1aBaBMUTBA1aJKIXEtYJqSWWsSkBVEl7EqBUq1LVdBmQStHc1wSauiudLyhlG5QyBCspGUdlBxKEuJGUdlCw0JyhlHZSHEBOQMg3KGUaaVlIyjsoZSrrHjI7j6ozUuBt2gtx9UYsOtPiY/rpz8P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mN2G9SJzanF9WdPDLcj0OZV4vqW/Gefrfg/wD1/FkSJwT3PiyJGozSpi2XkUYpFQADNVlAAMO4AAAAABoAAB6AAAUBBIGRenroalTS4a9eFzCdfZdWm0lNJtN8UiVrmbcLw9PW8svCyyqMfnZal6OCbd3kte/q3fRX5HSn5qzSjHh7KJn5t8N3otPkSV1v55Pq1KMV3P72c/ajvO6vokte4ViMRFpyvJyUrK1rWMv8U+d+7Vm+Y499WzDCbmZ1u4iVZm9c8apSKqRn86DqsaY1Z+o1SXFX63MCqsmNZr9gY35m3w7npxXO4z6PXGLv1VjFHEvklfqdLBYxNapJrs1uY79e46flJuVzpQ31f2l4nUq1471mmy1TEwSu1f4I51bFO+7ouzLFGebb/F/Tmc/KvGo9bmGvLeYxzd+JmqPVnSuMjr4V7kehzKvrPqx+HqLKrmao9X1F+JzPbZhpbnxZMpGalLd+JLNSs2ezJMo2LZFxqzle4XF3Ai+JQBYmxzdUATYiwAAWCwAAWCwAAWAugAAIoAAA00MZJaPVD8RWzJW4czn2G0arXQG1E0VTGOzFyNM4GQAWGqAABosmFypITF6cuI+lO1zOmTGYXGmVUTJlc5VzBV7ipE5irCYZFi5PUkgEi8XoWzC0wuXU8V2yLlAGr4r3C5QBpgAAMNgAAAAAAAAAAAAAAAAAAAAAAAAACYAAAoAAAAAAAAAJgAACgAAAAAAAAAAAAJgAABj/2Q==');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
box-sizing: border-box;
}
.detail {
background: $main-bg;
padding: 0 20px;
padding: 0 2rem;
.head {
width: 100%;
@ -934,32 +1000,41 @@ export default { @@ -934,32 +1000,41 @@ export default {
justify-content: space-between;
align-items: center;
box-sizing: border-box;
transform: translateY(-20px);
transform: translateY(-2rem);
.head-image {
background: black;
padding: 2px;
padding: .3rem;
border-radius: 50%;
width: 80px;
height: 80px;
}
.my-buttons {
margin-left: 1rem;
flex: 1;
display: flex;
div {
font-size: 1.2rem;
display: flex;
align-items: center;
justify-content: center;
float: left;
border-radius: 2px;
border-radius: .2rem;
background: $second-btn-color;
margin-left: 5px;
padding: 0 10px;
height: 30px;
margin-left: .5rem;
padding: 0 1rem;
height: 3rem;
color: white;
&:nth-child(0) {
flex: 2;
}
&:nth-child(1) {
padding: 0 25px;
flex: 1;
padding: 0 2.5rem;
}
img {
@ -974,7 +1049,41 @@ export default { @@ -974,7 +1049,41 @@ export default {
.description {
font-size: 1.2rem;
color: white;
transform: translateY(-20px);
transform: translateY(-2rem);
.signature {
//color: $second-text-color;
color: white;
font-size: 1.3rem;
display: flex;
align-items: center;
margin-bottom: .5rem;
img {
height: 1.2rem;
margin-left: .6rem;
}
}
.more {
color: $second-text-color;
display: flex;
.item {
padding: .2rem .5rem;
border-radius: .2rem;
background: $second-btn-color-tran;
font-size: 1rem;
display: flex;
align-items: center;
margin-right: .5rem;
img {
height: 1rem;
margin-right: .2rem;
}
}
}
.number {
color: $second-text-color;
@ -984,27 +1093,61 @@ export default { @@ -984,27 +1093,61 @@ export default {
align-items: center;
img {
width: 18px;
margin-left: 5px;
width: 1.6rem;
margin-left: .5rem;
}
}
.heat {
margin-top: 1rem;
color: darkgray;
display: flex;
align-items: center;
.num {
color: white;
font-size: 1.8rem;
font-size: 1.4rem;
font-weight: bold;
margin-right: 3px;
margin-right: .3rem;
}
.text {
font-size: 1.2rem;
margin-right: 1rem;
}
}
}
.other {
display: flex;
margin-bottom: 1rem;
.item {
margin-right: 2.5rem;
display: flex;
img {
margin-right: .8rem;
border-radius: .4rem;
background: $second-btn-color-tran;
padding: .8rem;
height: 2.2rem;
}
.right {
display: flex;
justify-content: space-between;
flex-direction: column;
.top {
color: white;
font-size: 1.4rem;
margin-right: 10px;
}
.bottom {
color: $second-text-color;
font-size: 1.2rem;
}
}
}
}

702
src/pages/me/Me3.vue

@ -35,17 +35,22 @@ @@ -35,17 +35,22 @@
-
</div>
</div>
<div class="my-buttons ">
<div class="collect" @click="$nav('/edit-userinfo')">
<span class="mr1r">编辑资料</span>
<span class="f10p" style="color: darkgray">85%</span>
<div class="heat">
<div class="text">
<span>获赞</span>
<span class="num">18</span>
</div>
<div class="add-friend" @click="$nav('/find-acquaintance')">
<img src="../../assets/img/icon/add-white.png" alt="">
<span class="mr5p">熟人</span>
<div class="text">
<span>粉丝</span>
<span class="num">62</span>
</div>
<div class="text">
<span>关注</span>
<span class="num">8</span>
</div>
</div>
</div>
<div class="description">
<p class="name f22 mt1r mb1r">ttentau</p>
<div class="number mb1r">
@ -53,13 +58,34 @@ @@ -53,13 +58,34 @@
<span>抖音号605128307</span>
<img src="../../assets/img/icon/me/qrcode-gray.png" alt="" @click.stop="$nav('/my-card')">
</div>
<div class="signature f12 mb1r">
<span>填写个性签名更容易获得别人关注哦</span>
<div class="signature f12" @click="$nav('/edit-userinfo-item',{type:3})">
<template v-if="!userinfo.desc">
<span>点击添加介绍让大家认识你...</span>
<img src="../../assets/img/icon/me/write-gray.png" alt="">
</template>
<span v-else class="text">{{ userinfo.desc }}</span>
</div>
<div class="more">
<div class="age item" v-if="userinfo.birthday">
<img v-if="userinfo.sex === '女'" src="../../assets/img/icon/me/woman.png" alt="">
<img v-if="userinfo.sex === '男'" src="../../assets/img/icon/me/man.png" alt="">
<span>{{ filterAge(userinfo.birthday) }}</span>
</div>
<div class="heat">
<div class="text"><span class="num">8</span>获赞</div>
<div class="text"><span class="num">8</span>关注</div>
<div class="text"><span class="num">8</span>粉丝</div>
<div class="item" v-if="userinfo.location">
{{ userinfo.location }}
</div>
<div class="item" v-if="userinfo.school.name">
{{ userinfo.school.name }}
</div>
</div>
</div>
<div class="my-buttons">
<div @click="$nav('/edit-userinfo')">
<span class="mr1r">编辑资料</span>
</div>
<div class="add-friend" @click="$nav('/find-acquaintance')">
<span class="mr5p">添加朋友</span>
</div>
</div>
</div>
@ -78,31 +104,89 @@ @@ -78,31 +104,89 @@
v-model:active-index="contentIndex">
<SlideItem class="SlideItem"
@touchmove="move"
@scroll="scroll"
:style="isScroll?'overflow: auto;':''">
<Posters v-if="videos.my.total !== -1" :list="videos.my.list"></Posters>
<Loading v-else :is-full-screen="false"></Loading>
<no-more/>
<Loading v-if="loadings.loading0" :is-full-screen="false"></Loading>
<no-more v-else/>
</SlideItem>
<SlideItem class="SlideItem"
@touchmove="move"
@touchmove="'move'"
:style="isScroll?'overflow: auto;':''">
<Posters v-if="videos.private.total !== -1" :list="videos.private.list"></Posters>
<Loading v-else :is-full-screen="false"></Loading>
<no-more/>
<div class="notice">
<img src="../../assets/img/icon/me/lock-gray.png" alt="">
<span>只有你能看到设为私密的作品和日常</span>
</div>
<Posters v-if="videos.private.total !== -1" mode="private" :list="videos.private.list"></Posters>
<Loading v-if="loadings.loading1" :is-full-screen="false"></Loading>
<no-more v-else/>
</SlideItem>
<SlideItem class="SlideItem"
@touchmove="move"
:style="isScroll?'overflow: auto;':''">
<div class="notice">
<img src="../../assets/img/icon/me/lock-gray.png" alt="">
<span>只有你能看到自己的喜欢列表</span>
</div>
<Posters v-if="videos.like.total !== -1" :list="videos.like.list"></Posters>
<Loading v-else :is-full-screen="false"></Loading>
<no-more/>
<Loading v-if="loadings.loading2" :is-full-screen="false"></Loading>
<no-more v-else/>
</SlideItem>
<SlideItem class="SlideItem"
@touchmove="move"
:style="isScroll?'overflow: auto;':''">
<Posters v-if="videos.collect.total !== -1" :list="videos.collect.list"></Posters>
<Loading v-else :is-full-screen="false"></Loading>
<no-more/>
<div class="notice">
<img src="../../assets/img/icon/me/lock-gray.png" alt="">
<span>只有你能看到自己的收藏列表</span>
</div>
<div class="collect" ref="collect">
<div class="video" v-if=" videos.collect.video.list.length">
<div class="top">
<div class="left">
<img src="../../assets/img/icon/me/video-whitegray.png" alt="">
<span>视频</span>
</div>
<div class="right">
<span>全部</span>
<back direction="right"></back>
</div>
</div>
<div class="list">
<div class="item"
v-for="i in videos.collect.video.list.length>3?videos.collect.video.list.slice(0,3):videos.collect.video.list">
<img class="poster" :src="$imgPreview(i.poster)" alt="">
<div class="num">
<img class="love" src="../../assets/img/icon/love.svg" alt="">
<span>{{ $likeNum(i.likeNum) }}</span>
</div>
</div>
</div>
</div>
<div class="audio" v-if=" videos.collect.video.list.length">
<div class="top">
<div class="left">
<img src="../../assets/img/icon/me/music-whitegray.png" alt="">
<span>音乐</span>
</div>
<div class="right">
<span>全部</span>
<back direction="right"></back>
</div>
</div>
<div class="list">
<div class="item"
v-for="i in videos.collect.video.list.length>3?videos.collect.video.list.slice(0,3):videos.collect.video.list">
<img class="poster" :src="$imgPreview(i.poster)" alt="">
<div class="title">用户创作的原声用户创作的原声用户创作的原声
</div>
</div>
</div>
</div>
</div>
<Loading v-if="loadings.loading3" :is-full-screen="false"></Loading>
<no-more v-else/>
</SlideItem>
</SlideRowList>
</div>
@ -215,6 +299,8 @@ @@ -215,6 +299,8 @@
import Posters from '../../components/Posters'
import Footer from "../../components/Footer";
import Indicator from '../../components/Indicator'
import {nextTick} from 'vue'
import {mapState} from "vuex";
export default {
name: "Me",
@ -225,7 +311,6 @@ export default { @@ -225,7 +311,6 @@ export default {
baseActiveIndex: 0,
desc: null,
tabContents: [],
indicatorHeight: 42,
indicatorFixed: false,
floatFixed: false,
floatShowName: false,
@ -235,8 +320,8 @@ export default { @@ -235,8 +320,8 @@ export default {
header: null,
headerHeight: 0,
descHeight: 0,
videoSlideRowListHeight: 0,
defaultVideoSlideRowListHeight: 0
videoSlideHeight: 0,
maxSlideHeight: 0
},
videoItemHeight: 0,
startLocationY: 0,
@ -247,7 +332,8 @@ export default { @@ -247,7 +332,8 @@ export default {
videos: {
my: {
list: [],
total: -1
total: -1,
pageNo: 0
},
private: {
list: [],
@ -258,9 +344,23 @@ export default { @@ -258,9 +344,23 @@ export default {
total: -1
},
collect: {
video: {
list: [],
total: -1
total: -1,
},
audio: {
list: [],
total: -1,
}
},
},
pageSize: 15,
initSlideHeight: 0,
loadings: {
loading0: false,
loading1: false,
loading2: false,
loading3: false,
},
}
},
@ -272,8 +372,11 @@ export default { @@ -272,8 +372,11 @@ export default {
return this.$store.state.bodyWidth
},
videoSlideRowListStyle() {
return {height: this.refs.videoSlideRowListHeight !== 0 ? this.refs.videoSlideRowListHeight + 'px' : 'calc(100vh - 14.6rem)'}
}
return {height: this.refs.videoSlideHeight !== 0 ? this.refs.videoSlideHeight + 'px' : 'calc(100vh - 14.6rem)'}
},
...mapState({
userinfo: 'userinfo',
})
},
watch: {
contentIndex(newVal, oldVal) {
@ -281,69 +384,124 @@ export default { @@ -281,69 +384,124 @@ export default {
},
},
mounted() {
this.initSlideHeight = this.bodyHeight - 50 - 352 - 50
setTimeout(() => {
this.refs.header = this.$refs.header
this.refs.headerHeight = this.$refs.header.offsetHeight
this.refs.descHeight = this.$refs.desc.offsetHeight
this.refs.defaultVideoSlideRowListHeight = this.$refs.videoSlideRowList.wrapperHeight
// this.refs.videoSlideRowListHeight = this.$refs.videoSlideRowList.wrapperHeight
this.refs.maxSlideHeight = this.$refs.videoSlideRowList.wrapperHeight
this.changeIndex(0, null)
})
this.videoItemHeight = this.bodyWidth / 3 * 1.2 + 2
// console.log('videoItemHeight',this.videoItemHeight)
},
methods: {
async getScrollAreaHeight(index = this.contentIndex) {
let scrollAreaHeight = 0
if (index === 3) {
await nextTick(async () => {
scrollAreaHeight = this.$refs.collect.clientHeight + 60 + 40
})
} else {
scrollAreaHeight = Math.ceil(this.videos[Object.keys(this.videos)[index]].list.length / 3) * this.videoItemHeight
switch (index) {
case 0:
scrollAreaHeight += 60
break
case 1:
scrollAreaHeight += 60 + 40
break
case 2:
scrollAreaHeight += 60 + 40
break
}
}
// console.log('scrollAreaHeight',scrollAreaHeight)
return scrollAreaHeight
},
async changeIndex(newVal, oldVal) {
// console.log('oldVal',oldVal)
if (this.videos[Object.keys(this.videos)[newVal]].total === -1) {
if (this.loadings['loading' + newVal]) return
let videoOb = this.videos[Object.keys(this.videos)[newVal]]
if (newVal === 3) {
if (videoOb.video.total === -1) {
this.loadings['loading' + newVal] = true
let res = await this.$api.videos.collect({pageNo: this.videos.collect.pageNo, pageSize: this.pageSize,})
this.loadings['loading' + newVal] = false
if (res.code === this.SUCCESS_CODE) this.videos.collect = res.data
}
} else {
if (videoOb.total === -1) {
this.loadings['loading' + newVal] = true
let res
switch (newVal) {
case 0:
res = await this.$api.videos.my()
res = await this.$api.videos.my({pageNo: this.videos.my.pageNo, pageSize: this.pageSize,})
if (res.code === this.SUCCESS_CODE) this.videos.my = res.data
this.$console(this.videos)
break
case 1:
res = await this.$api.videos.private()
res = await this.$api.videos.private({pageNo: this.videos.private.pageNo, pageSize: this.pageSize,})
if (res.code === this.SUCCESS_CODE) this.videos.private = res.data
this.$console(this.videos)
break
case 2:
res = await this.$api.videos.like()
res = await this.$api.videos.like({pageNo: this.videos.like.pageNo, pageSize: this.pageSize,})
if (res.code === this.SUCCESS_CODE) this.videos.like = res.data
this.$console(this.videos)
break
case 3:
res = await this.$api.videos.collect()
if (res.code === this.SUCCESS_CODE) this.videos.collect = res.data
this.$console(this.videos)
break
}
this.loadings['loading' + newVal] = false
}
}
let posterHeight = Math.ceil(this.videos[Object.keys(this.videos)[newVal]].total / 3) * this.videoItemHeight
// console.log('posterHeight', posterHeight)
let scrollAreaHeight = await this.getScrollAreaHeight(newVal)
if (oldVal !== null) {
let transformY = this.getTransform(this.$refs.scroll)
// console.log('transformY', transformY)
let slideRowListHeight = this.bodyHeight - 50 - 352 - 50 + Math.abs(transformY)
// console.log('slideRowListHeight', slideRowListHeight)
let screenSlideHeight = this.initSlideHeight + Math.abs(transformY)
// console.log('screenSlideHeight', screenSlideHeight)
// console.log('scrollAreaHeight', scrollAreaHeight)
// debugger
if (posterHeight + 60 < slideRowListHeight) {
this.refs.videoSlideRowListHeight = slideRowListHeight
if (this.indicatorFixed) {
this.refs.videoSlideHeight = scrollAreaHeight > screenSlideHeight ? scrollAreaHeight : screenSlideHeight
if (scrollAreaHeight > this.refs.maxSlideHeight) {
this.refs.videoSlideHeight = this.refs.maxSlideHeight
}
if (posterHeight + 60 > slideRowListHeight) {
this.refs.videoSlideRowListHeight = posterHeight + 60
} else {
this.refs.videoSlideHeight = scrollAreaHeight
if (scrollAreaHeight > this.refs.maxSlideHeight) {
this.refs.videoSlideHeight = this.refs.maxSlideHeight
}
if (posterHeight + 60 > this.refs.defaultVideoSlideRowListHeight) {
this.refs.videoSlideRowListHeight = this.refs.defaultVideoSlideRowListHeight
}
} else {
if (posterHeight + 60 < this.refs.defaultVideoSlideRowListHeight) {
// this.$setCss(this.$refs.videoSlideRowList, 'height', posterHeight + 'px')
this.refs.videoSlideRowListHeight = posterHeight + 60
if (scrollAreaHeight < this.refs.maxSlideHeight) {
this.refs.videoSlideHeight = scrollAreaHeight
} else {
this.refs.videoSlideRowListHeight = this.refs.defaultVideoSlideRowListHeight
this.refs.videoSlideHeight = this.refs.maxSlideHeight
}
}
},
async loadMoreData() {
if (this.loadings['loading' + this.contentIndex]) return
let videoOb = this.videos[Object.keys(this.videos)[this.contentIndex]]
if (videoOb.total > videoOb.list.length) {
videoOb.pageNo++
this.loadings['loading' + this.contentIndex] = true
let res
switch (this.contentIndex) {
case 0:
res = await this.$api.videos.my({pageNo: videoOb.pageNo, pageSize: this.pageSize,})
break
case 1:
res = await this.$api.videos.private({pageNo: videoOb.pageNo, pageSize: this.pageSize,})
break
case 2:
res = await this.$api.videos.like({pageNo: videoOb.pageNo, pageSize: this.pageSize,})
break
case 3:
res = await this.$api.videos.collect({pageNo: videoOb.pageNo, pageSize: this.pageSize,})
break
}
this.loadings['loading' + this.contentIndex] = false
if (res.code === this.SUCCESS_CODE) {
videoOb.list = videoOb.list.concat(res.data.list)
}
}
},
@ -355,39 +513,68 @@ export default { @@ -355,39 +513,68 @@ export default {
move(e) {
(!this.isScroll) && e.preventDefault();
},
touchMove(e) {
//
let offsetTop = this.refs.descHeight - this.floatHeight
// console.log('pageY', e.touches[0].pageY)
// console.log('moveYDistance', this.moveYDistance)
let moveYDistance = e.touches[0].pageY - this.startLocationY
let distance = this.moveYDistance + moveYDistance * 1.2
// console.log('distance', distance)
//
if (distance > 0) {
async scroll() {
if (this.indicatorFixed) {
let scrollAreaHeight = await this.getScrollAreaHeight()
let SlideItems = document.querySelectorAll('.SlideItem')
let SlideItem = SlideItems[this.contentIndex]
if (scrollAreaHeight - this.refs.videoSlideHeight < SlideItem.scrollTop + 60) {
this.loadMoreData()
}
}
},
async touchMove(e) {
let canTransformY = this.refs.descHeight - this.floatHeight
let touchMoveDistance = e.touches[0].pageY - this.startLocationY
let pageMoveDistance = this.moveYDistance + touchMoveDistance * 1.2
// console.log('move-pageMoveDistance', pageMoveDistance)
// console.log('move-touchMoveDistance', touchMoveDistance)
//header
if (pageMoveDistance > 0) {
this.$refs.scroll.style.transform = `translate3d(0,0,0)`
if (distance < 400) {
// if (this.baseActiveIndex !== 0) return
// if (this.refs.header.getBoundingClientRect().top !== 0) return
if (pageMoveDistance < 400) {
this.refs.header.style.transition = 'all 0s'
this.refs.header.style.height = this.refs.headerHeight + (distance / 2) + 'px'
this.refs.header.style.height = this.refs.headerHeight + (pageMoveDistance / 2) + 'px'
} else {
this.startLocationY = e.touches[0].pageY
this.moveYDistance = 400
}
return
} else {
let scrollAreaHeight = await this.getScrollAreaHeight()
//
if (touchMoveDistance > 0) {
//posterHeight30
if (this.refs.videoSlideHeight > scrollAreaHeight && Math.abs(touchMoveDistance) > 20) {
this.$refs.scroll.style.transition = 'all .2s'
this.$refs.scroll.style.transform = `translate3d(0,0,0)`
this.indicatorFixed = this.floatShowName = this.floatFixed = this.isScroll = false
this.moveYDistance = 0
this.startLocationY = e.touches[0].pageY
this.changeIndex(this.contentIndex, this.contentIndex)
let SlideItems = document.querySelectorAll('.SlideItem')
SlideItems.forEach(SlideItem => {
SlideItem.style.overflow = 'auto'
SlideItem.scrollTop = 0
})
SlideItems.forEach(SlideItem => {
SlideItem.style.overflow = 'hidden'
})
return;
}
}
// console.log('s', e.touches[0].pageY - this.startLocationY)
// console.log('indicatorFixed', this.indicatorFixed)
if (this.indicatorFixed) {
let SlideItems = document.querySelectorAll('.SlideItem')
let SlideItem = SlideItems[this.contentIndex]
// console.log(tt.scrollTop)
if (!this.isScroll) {
SlideItem.style.overflow = 'auto'
SlideItem.scrollTop = Math.abs(distance) - this.refs.descHeight + this.floatHeight
SlideItem.scrollTop = Math.abs(pageMoveDistance) - this.refs.descHeight + this.floatHeight
}
if (scrollAreaHeight - this.refs.videoSlideHeight < SlideItem.scrollTop + 60) {
this.loadMoreData()
}
if (SlideItem.scrollTop === 0 && (e.touches[0].pageY - this.fixedLocationY) > 0) {
this.isScroll = this.indicatorFixed = false
SlideItem.style.overflow = 'hidden'
@ -395,64 +582,62 @@ export default { @@ -395,64 +582,62 @@ export default {
this.moveYDistance = -this.refs.descHeight + this.floatHeight
}
} else {
this.indicatorFixed = Math.abs(distance) > offsetTop
if (this.initSlideHeight > this.refs.videoSlideHeight) return
if (this.refs.maxSlideHeight > this.refs.videoSlideHeight) {
let endTransformY = Math.abs(canTransformY) - (this.refs.maxSlideHeight - this.refs.videoSlideHeight)
// console.log('endTransformY', endTransformY)
let moveTransformY = Math.abs(pageMoveDistance) < Math.abs(endTransformY) ? pageMoveDistance : -endTransformY
this.$refs.scroll.style.transform = `translate3d(0,${moveTransformY}px,0)`
this.floatFixed = Math.abs(moveTransformY) > 100
this.floatShowName = Math.abs(moveTransformY) > 150
} else {
this.indicatorFixed = Math.abs(pageMoveDistance) > canTransformY
this.floatFixed = Math.abs(pageMoveDistance) > 100
this.floatShowName = Math.abs(pageMoveDistance) > 150
this.$refs.scroll.style.transform = `translate3d(0,${this.indicatorFixed ? -canTransformY : pageMoveDistance}px,0)`
}
if (this.indicatorFixed) {
this.fixedLocationY = e.touches[0].pageY
}
if (this.refs.defaultVideoSlideRowListHeight > this.refs.videoSlideRowListHeight) {
let endTransformY = Math.abs(offsetTop) - (this.refs.defaultVideoSlideRowListHeight - this.refs.videoSlideRowListHeight)
this.$refs.scroll.style.transform = `translate3d(0,${
distance > -endTransformY ? distance : -endTransformY
}px,0)`
this.floatFixed = Math.abs(distance) > 100
this.floatShowName = Math.abs(distance) > 150
} else {
this.floatFixed = Math.abs(distance) > 100
this.floatShowName = Math.abs(distance) > 150
this.$refs.scroll.style.transform = `translate3d(0,${this.indicatorFixed ? -offsetTop : distance}px,0)`
}
}
},
touchEnd(e) {
// console.log('this.startLocationY', this.startLocationY)
// debugger
let moveYDistance = e.changedTouches[0].pageY - this.startLocationY
this.moveYDistance = this.moveYDistance + moveYDistance * 1.2//1.2
// console.log('end-moveYDistance', this.moveYDistance)
let canTransformY = this.refs.descHeight - this.floatHeight
let touchMoveDistance = e.changedTouches[0].pageY - this.startLocationY
let pageMoveDistance = this.moveYDistance + touchMoveDistance * 1.2
// console.log('end-pageMoveDistance', pageMoveDistance)
//header
if (this.moveYDistance > 0) {
// if (this.baseActiveIndex !== 0) return
let endTransformY = Math.abs(canTransformY) - (this.refs.maxSlideHeight - this.refs.videoSlideHeight)
if (this.indicatorFixed) {
this.moveYDistance = -canTransformY
this.isScroll = true
} else {
// debugger
if (pageMoveDistance > 0) {
this.refs.header.style.transition = 'all .3s'
this.refs.header.style.height = this.refs.headerHeight + 'px'
this.moveYDistance = 0
this.floatShowName = this.floatFixed = this.isScroll = false
return
}
} else {
// console.log('header-height', this.refs.descHeight - this.floatHeight)
// this.isScroll = Math.abs(this.moveYDistance) > this.refs.descHeight - this.floatHeight
//
//
if (!this.indicatorFixed) {
//
let distance = e.changedTouches[0].pageY - this.startLocationY
// console.log('end-distance', distance)
if (this.initSlideHeight > this.refs.videoSlideHeight) {
return this.moveYDistance = 0
}
let endTime = Date.now()
let gapTime = endTime - this.startTime
//
if (Math.abs(distance) < 20) gapTime = 1000
if (Math.abs(touchMoveDistance) < 20) gapTime = 1000
//header1/3
if (Math.abs(distance) > (this.refs.descHeight / 2)) gapTime = 50
if (Math.abs(touchMoveDistance) > (this.refs.descHeight / 2)) gapTime = 50
// console.log('', gapTime)
if (gapTime < 150) {
//
if (distance > 0) {
if (touchMoveDistance > 0) {
//
gapTime = endTime - this.startTime
if (gapTime < 100 && Math.abs(distance) > 100) {
if (gapTime < 100 && Math.abs(touchMoveDistance) > 100) {
//cancelAnimationFrametransition = 'all .3s'
this.$refs.scroll.style.transition = 'none'
let transformY = this.getTransform(this.$refs.scroll)
@ -490,17 +675,23 @@ export default { @@ -490,17 +675,23 @@ export default {
} else {
//
this.$refs.scroll.style.transition = 'all .3s'
this.$refs.scroll.style.transform = `translate3d(0,${distance > 0 ? 0 : -this.refs.descHeight}px,0)`
this.moveYDistance = distance > 0 ? 0 : -this.refs.descHeight
this.$refs.scroll.style.transform = `translate3d(0,${touchMoveDistance > 0 ? 0 : -this.refs.descHeight}px,0)`
this.moveYDistance = touchMoveDistance > 0 ? 0 : -this.refs.descHeight
}
this.moveYDistance = 0
this.indicatorFixed = this.floatShowName = this.floatFixed = this.isScroll = false
this.changeIndex(this.contentIndex, this.contentIndex)
let SlideItems = document.querySelectorAll('.SlideItem')
SlideItems.forEach(SlideItem => {
SlideItem.style.overflow = 'auto'
SlideItem.scrollTop = 0
})
SlideItems.forEach(SlideItem => {
SlideItem.style.overflow = 'hidden'
})
} else {
//
this.$refs.scroll.style.transition = 'all .3s'
let offsetTop = this.refs.descHeight - this.floatHeight
if (this.refs.defaultVideoSlideRowListHeight > this.refs.videoSlideRowListHeight) {
let endTransformY = Math.abs(offsetTop) - (this.refs.defaultVideoSlideRowListHeight - this.refs.videoSlideRowListHeight)
if (this.refs.maxSlideHeight > this.refs.videoSlideHeight) {
this.$refs.scroll.style.transform = `translate3d(0,${-endTransformY}px,0)`
// this.floatShowName = this.floatFixed = true
this.floatFixed = Math.abs(endTransformY) > 100
@ -510,21 +701,34 @@ export default { @@ -510,21 +701,34 @@ export default {
this.$refs.scroll.style.transform = `translate3d(0,${-this.refs.descHeight + this.floatHeight}px,0)`
this.indicatorFixed = this.floatShowName = this.floatFixed = this.isScroll = true
this.moveYDistance = -this.refs.descHeight + this.floatHeight
}
this.moveYDistance = pageMoveDistance
}
}
} else {
this.isScroll = true
if (this.refs.maxSlideHeight > this.refs.videoSlideHeight) {
let endTransformY = Math.abs(canTransformY) - (this.refs.maxSlideHeight - this.refs.videoSlideHeight)
this.moveYDistance = -endTransformY
} else {
this.moveYDistance = pageMoveDistance
}
}
}
}
this.changeIndex(this.contentIndex, this.contentIndex)
},
getTransform(el) {
let transform = el.style.transform
// console.log(transform)
if (!transform) return 0
// console.log('transform',transform)
let transformY = transform.substring(transform.indexOf('0px') + 5, transform.lastIndexOf('0px') - 4)
// console.log(transformY)
// console.log('transformY',transformY)
//transformY
transformY = parseInt(transformY)
return transformY
},
filterAge(age) {
let date = new Date(age)
return new Date().getFullYear() - date.getFullYear()
}
}
}
@ -548,12 +752,147 @@ export default { @@ -548,12 +752,147 @@ export default {
background: $main-bg;
height: 100%;
width: 100%;
font-size: 1.4rem;
.scroll {
.notice {
font-size: 1.2rem;
height: 4rem;
color: $second-text-color;
display: flex;
justify-content: center;
align-items: center;
img {
height: 1.2rem;
margin-right: .5rem;
}
}
.collect {
padding: .7rem;
.video {
background: $active-main-bg;
border-radius: .5rem;
padding: 1rem;
margin-bottom: .7rem;
.top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
.left {
display: flex;
align-items: center;
color: gainsboro;
img {
height: 2rem;
margin-right: .5rem;
}
}
.right {
display: flex;
align-items: center;
color: $second-text-color;
}
}
.list {
display: grid;
grid-template-columns: 33.33% 33.33% 33.33%;
.item {
height: calc(33.33vw * 1.3);
padding: .2rem;
overflow: hidden;
position: relative;
.poster {
border-radius: .4rem;
width: 100%;
height: 100%;
display: block;
}
.no-more {
.num {
color: white;
position: absolute;
bottom: .5rem;
left: .5rem;
display: flex;
align-items: center;
font-size: 1.4rem;
padding: 10px;
color: gray;
text-align: center;
.love {
width: 1.4rem;
height: 1.4rem;
margin-right: .5rem;
}
}
}
}
}
.audio {
background: $active-main-bg;
border-radius: .5rem;
padding: 1rem;
.top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
.left {
display: flex;
align-items: center;
color: gainsboro;
img {
height: 1.5rem;
margin-right: .5rem;
}
}
.right {
display: flex;
align-items: center;
color: $second-text-color;
}
}
.list {
display: grid;
grid-template-columns: 33.33% 33.33% 33.33%;
.item {
padding: .2rem;
overflow: hidden;
position: relative;
.poster {
border-radius: .4rem;
width: 100%;
height: calc((100vw - 3.4rem) / 3);
display: block;
}
.title {
margin-top: .5rem;
color: $second-text-color;
}
}
}
}
}
}
.float {
@ -624,7 +963,7 @@ export default { @@ -624,7 +963,7 @@ export default {
.detail {
background: $main-bg;
padding: 0 20px;
padding: 0 2rem;
.head {
width: 100%;
@ -632,47 +971,48 @@ export default { @@ -632,47 +971,48 @@ export default {
justify-content: space-between;
align-items: center;
box-sizing: border-box;
transform: translateY(-20px);
transform: translateY(-2rem);
.head-image {
background: black;
padding: 2px;
border-radius: 50%;
width: 80px;
height: 80px;
width: 8rem;
height: 8rem;
}
.my-buttons {
div {
font-size: 1.2rem;
.heat {
margin-top: 1rem;
width: calc(100% - 12rem);
color: $second-text-color;
display: flex;
align-items: center;
justify-content: center;
float: left;
border-radius: 2px;
background: $second-btn-color;
margin-left: 5px;
padding: 0 10px;
height: 30px;
color: white;
justify-content: space-between;
&:nth-child(1) {
padding: 0 25px;
.num {
margin-top: .5rem;
color: white;
font-size: 1.6rem;
font-weight: bold;
margin-right: 3px;
}
img {
padding: 0 .6rem;
height: 1.2rem;
.text {
font-size: 1.2rem;
margin-right: 10px;
display: flex;
align-items: center;
flex-direction: column;
}
}
}
}
.description {
font-size: 1.2rem;
color: white;
transform: translateY(-20px);
transform: translateY(-2rem);
.number {
color: $second-text-color;
@ -682,29 +1022,61 @@ export default { @@ -682,29 +1022,61 @@ export default {
align-items: center;
img {
width: 18px;
margin-left: 5px;
width: 1.6rem;
margin-left: .5rem;
}
}
}
.heat {
color: darkgray;
.signature {
color: $second-text-color;
display: flex;
align-items: center;
margin-bottom: .5rem;
.num {
color: white;
font-size: 1.8rem;
font-weight: bold;
margin-right: 3px;
img {
height: 1.2rem;
margin-left: .6rem;
}
}
.text {
font-size: 1.4rem;
margin-right: 10px;
.more {
color: $second-text-color;
display: flex;
.item {
padding: .2rem .5rem;
border-radius: .2rem;
background: $second-btn-color-tran;
font-size: 1rem;
display: flex;
align-items: center;
margin-right: .5rem;
img {
height: 1rem;
margin-right: .2rem;
}
}
}
.my-buttons {
display: flex;
justify-content: space-between;
div {
width: 49%;
font-size: 1.2rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: .2rem;
background: $second-btn-color;
height: 3rem;
color: white;
}
}
}
}

2
src/pages/me/userinfo/EditUserInfoItem.vue

@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
<div class="textarea-ctn">
<textarea name="" id="" cols="30" rows="10"
v-model="localUserinfo.desc"
placeholder="填写个人简介更容易获得别人关注哦"></textarea>
placeholder="你可以填写兴趣爱好、心情愿望,有趣的介绍能让被关注的概率变高噢!"></textarea>
</div>
</div>
</div>

2
src/router/index.js

@ -36,6 +36,7 @@ import MinorProtectionDetailSetting from "../pages/me/rightMenu/MinorProtection/ @@ -36,6 +36,7 @@ import MinorProtectionDetailSetting from "../pages/me/rightMenu/MinorProtection/
import TriggerTime from "../pages/me/rightMenu/MinorProtection/TriggerTime";
import Setting from "../pages/me/rightMenu/Setting";
import Me2 from "../pages/me/Me2";
import Login from "../pages/login/Login";
const routes = [
// {path: '', component: Music},
@ -76,6 +77,7 @@ const routes = [ @@ -76,6 +77,7 @@ const routes = [
{path: '/me/right-menu/minor-protection/detail-setting', component: MinorProtectionDetailSetting},
{path: '/me/right-menu/minor-protection/trigger-time', component: TriggerTime},
{path: '/me/right-menu/setting', component: Setting},
{path: '/login', component: Login},
]
export default VueRouter.createRouter({

10
src/store/index.js

@ -12,12 +12,12 @@ const store = Vuex.createStore({ @@ -12,12 +12,12 @@ const store = Vuex.createStore({
id: 1,
name: '',
account: '',
desc: '123',
sex: '',
birthday: '',
location: '',
desc: '',
sex: '',
birthday: '1992-03-09',
location: "中国-四川-成都",
school: {
name: 'asdasd',
name: '西南交通大学',
department: null,
joinTime: null,
education: null,

Loading…
Cancel
Save