Browse Source

熟人页面

pull/19/head
zyronon 4 years ago
parent
commit
fe9ce7786e
  1. 2
      src/App.vue
  2. 14
      src/components/Indicator.vue
  3. 21
      src/components/Mask.vue
  4. 29
      src/components/NoMore.vue
  5. 2
      src/components/Posters.vue
  6. 2
      src/components/Search.vue
  7. 10
      src/components/slide/SlideRowList.vue
  8. 4
      src/main.js
  9. 2
      src/pages/me/Me.vue
  10. 133
      src/pages/people/FindAcquaintance.vue

2
src/App.vue

@ -36,7 +36,7 @@ export default {
'/find-acquaintance', '/find-acquaintance',
'/service-protocol', '/service-protocol',
'/address-list', '/address-list',
'', '/video-detail',
'', '',
]; ];
const toDepth = routeDeep.indexOf(to.path) const toDepth = routeDeep.indexOf(to.path)

14
src/components/Indicator.vue

@ -36,6 +36,11 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
//slidListslidListindicator
name: {
type: String,
default: () => ''
},
}, },
data() { data() {
return { return {
@ -48,8 +53,8 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {
this.initTabs() this.initTabs()
bus.on('move', this.move) bus.on(this.name + 'move', this.move)
bus.on('end', this.end) bus.on(this.name + 'end', this.end)
}, },
methods: { methods: {
changeIndex(index) { changeIndex(index) {
@ -95,10 +100,11 @@ export default {
.indicator-ctn { .indicator-ctn {
width: 100%; width: 100%;
height: 6rem;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
z-index: 999; z-index: 2;
background: $main-bg; background: $main-bg;
.tabs { .tabs {
@ -107,7 +113,7 @@ export default {
font-weight: bold; font-weight: bold;
.tab { .tab {
height: 40px; height: 5.5rem;
width: 45%; width: 45%;
display: flex; display: flex;
justify-content: center; justify-content: center;

21
src/components/Mask.vue

@ -0,0 +1,21 @@
<template>
<div class="Mask"></div>
</template>
<script>
export default {
name: "Mask",
}
</script>
<style scoped lang="scss">
.Mask {
z-index: 2;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #000000bb;
}
</style>

29
src/components/NoMore.vue

@ -0,0 +1,29 @@
<template>
<div class="NoMore">
{{ notice }}
</div>
</template>
<script>
export default {
name: "NoMore",
props: {
notice: {
type: String,
default: '暂时没有更多了'
}
},
}
</script>
<style scoped lang="scss">
@import "../assets/scss/index";
.NoMore {
font-size: 1.2rem;
height: 6rem;
display: flex;
align-items: center;
justify-content: center;
color: $second-text-color;
}
</style>

2
src/components/Posters.vue

@ -1,6 +1,6 @@
<template> <template>
<div class="posters"> <div class="posters">
<div class="poster-item" v-for="i in list" @click="$nav('/VideoDetail')"> <div class="poster-item" v-for="i in list" @click="$nav('/video-detail')">
<img class="poster" src="../assets/img/poster/2.jpg" alt=""> <img class="poster" src="../assets/img/poster/2.jpg" alt="">
<div class="num"> <div class="num">
<img class="love" src="../assets/img/icon/love.svg" alt=""> <img class="love" src="../assets/img/icon/love.svg" alt="">

2
src/components/Search.vue

@ -2,7 +2,7 @@
<div class="search"> <div class="search">
<img src="../assets/img/icon/pause.svg" alt=""> <img src="../assets/img/icon/pause.svg" alt="">
<input type="text" :placeholder="placeholder" v-model="value"> <input type="text" :placeholder="placeholder" v-model="value">
<img v-if="modelValue.length" class="close" src="../assets/img/icon/close.svg" @click="clear"> <img v-if="value.length" class="close" src="../assets/img/icon/close.svg" @click="clear">
</div> </div>
</template> </template>

10
src/components/slide/SlideRowList.vue

@ -20,7 +20,6 @@
</div> </div>
<div class="loading" :style="loadingStyle">AA</div> <div class="loading" :style="loadingStyle">AA</div>
</div> </div>
<slot name="indicator"></slot>
<div id="base-slide-list" ref="slideList" <div id="base-slide-list" ref="slideList"
:style="{'flex-direction':'row',marginTop:indicatorFixed?'42px':'0'}" :style="{'flex-direction':'row',marginTop:indicatorFixed?'42px':'0'}"
@touchstart="touchStart($event)" @touchstart="touchStart($event)"
@ -61,6 +60,10 @@ export default {
type: Number, type: Number,
default: () => 0 default: () => 0
}, },
name: {
type: String,
default: () => ''
},
}, },
computed: { computed: {
toolbarStyle() { toolbarStyle() {
@ -137,7 +140,6 @@ export default {
await this.checkChildren(true) await this.checkChildren(true)
this.showIndicator && this.initTabs() this.showIndicator && this.initTabs()
this.changeIndex(true) this.changeIndex(true)
console.log(this.$slots.indicator)
}, },
methods: { methods: {
changeIndex(init = false, index = null, e) { changeIndex(init = false, index = null, e) {
@ -215,7 +217,7 @@ export default {
// //
if (this.currentSlideItemIndex === this.slideItems.length - 1 && this.isDrawRight) return if (this.currentSlideItemIndex === this.slideItems.length - 1 && this.isDrawRight) return
bus.emit('move', { bus.emit(this.name + 'move', {
x: {distance: this.moveXDistance, isDrawRight: this.isDrawRight}, x: {distance: this.moveXDistance, isDrawRight: this.isDrawRight},
}) })
@ -269,7 +271,7 @@ export default {
this.resetConfig() this.resetConfig()
this.$attrs['onUpdate:active-index'] && this.$emit('update:active-index', this.currentSlideItemIndex) this.$attrs['onUpdate:active-index'] && this.$emit('update:active-index', this.currentSlideItemIndex)
this.$attrs['onEnd'] && this.$emit('end') this.$attrs['onEnd'] && this.$emit('end')
bus.emit('end', this.currentSlideItemIndex) bus.emit(this.name + 'end', this.currentSlideItemIndex)
}, },
resetConfig() { resetConfig() {
this.isCanRightWiping = false this.isCanRightWiping = false

4
src/main.js

@ -16,6 +16,8 @@ import store from "./store";
import globalMethods from './utils/global-methods' import globalMethods from './utils/global-methods'
import SlideRowList from "./components/slide/SlideRowList"; import SlideRowList from "./components/slide/SlideRowList";
import SlideColumnList from "./components/slide/SlideColumnList"; import SlideColumnList from "./components/slide/SlideColumnList";
import Mask from "./components/Mask";
import NoMore from "./components/NoMore";
const mixin = { const mixin = {
methods: { methods: {
@ -32,6 +34,8 @@ app.component('SlideColumnList', SlideColumnList)
app.component('SlideItem', SlideItem) app.component('SlideItem', SlideItem)
app.component('Video1', Video) app.component('Video1', Video)
app.component('Footer', Footer) app.component('Footer', Footer)
app.component('Mask', Mask)
app.component('NoMore', NoMore)
app.mixin(mixin) app.mixin(mixin)
app.use(router) app.use(router)
app.use(store) app.use(store)

2
src/pages/me/Me.vue

@ -59,12 +59,14 @@
</div> </div>
<div ref="content" style="margin-bottom: 60px;"> <div ref="content" style="margin-bottom: 60px;">
<Indicator <Indicator
name="videoList"
:fixed="indicatorFixed" :fixed="indicatorFixed"
tabStyleWidth="33%" tabStyleWidth="33%"
:tabTexts="['作品','私密','喜欢']" :tabTexts="['作品','私密','喜欢']"
v-model:active-index="contentIndex"> v-model:active-index="contentIndex">
</Indicator> </Indicator>
<SlideRowList <SlideRowList
name="videoList"
@end="end" @end="end"
:indicator-fixed="indicatorFixed" :indicator-fixed="indicatorFixed"
v-model:active-index="contentIndex"> v-model:active-index="contentIndex">

133
src/pages/people/FindAcquaintance.vue

@ -1,26 +1,31 @@
<template> <template>
<div class="FindAcquaintance"> <div class="FindAcquaintance">
<div class="header"> <div class="header">
<img src="../../assets/img/icon/back.png" alt="" class="back"> <img src="../../assets/img/icon/back.png" alt="" class="back" @click="$back">
<Indicator <Indicator
style="width: 50%;"
tabStyleWidth="40%" tabStyleWidth="40%"
:tabTexts="['熟人列表','发现熟人']" :tabTexts="['熟人列表','发现熟人']"
v-model:active-index="currentSlideItemIndex"> v-model:active-index="currentSlideItemIndex">
</Indicator> </Indicator>
<img src="../../assets/img/icon/back.png" alt="" class="option"> <img src="../../assets/img/icon/back.png" alt="" class="option" @click="moreOptionDialog = true">
</div> </div>
<SlideRowList v-model:active-index="currentSlideItemIndex"> <SlideRowList v-model:active-index="currentSlideItemIndex" :style="{opacity : moreOptionDialog ? .5:1}">
<SlideItem> <SlideItem>
<Search class="vue"></Search> <Search placeholder="搜索用户备注或名字" class="mr20p ml20p mt10p"></Search>
<div class="title">我的好友互相关注</div>
<People v-for="item in list " :people="item"></People> <People v-for="item in list " :people="item"></People>
<NoMore></NoMore>
</SlideItem> </SlideItem>
<SlideItem> <SlideItem>
<Search class="vue"></Search> <Search :key="1"></Search>
<Search class="vue" @click="findAddressListDialog = true"></Search>
</SlideItem> </SlideItem>
</SlideRowList> </SlideRowList>
<div v-if="findAddressListDialog" class="dialog find-address-list">
<div class="content">
<transition name="fade">
<div v-if="findAddressListDialog" class="dialog find-address-list" @click="findAddressListDialog = false">
<div class="content" @click.stop="null">
<div class="body"> <div class="body">
<div> <div>
<img src="../../assets/img/icon/head-image.jpeg" alt=""> <img src="../../assets/img/icon/head-image.jpeg" alt="">
@ -37,6 +42,28 @@
</div> </div>
</div> </div>
</div> </div>
</transition>
<transition name="fade">
<Mask v-if="moreOptionDialog" @click="moreOptionDialog = false"></Mask>
</transition>
<transition name="from-bottom">
<div class="more-option-dialog" v-if="moreOptionDialog">
<div class="row">
<span>站外好友口令</span>
</div>
<div class="row">
<span>扫一扫加好友</span>
</div>
<div class="row" style="border-bottom: none;">
<span>面对面加好友</span>
</div>
<div class="space"></div>
<div class="row" @click="moreOptionDialog = false">
取消
</div>
</div>
</transition>
</div> </div>
</template> </template>
<script> <script>
@ -54,6 +81,7 @@ export default {
data() { data() {
return { return {
findAddressListDialog: false, findAddressListDialog: false,
moreOptionDialog: true,
indicatorFixed: false, indicatorFixed: false,
currentSlideItemIndex: 1, currentSlideItemIndex: 1,
list: [ list: [
@ -85,6 +113,16 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
@import "../../assets/scss/index"; @import "../../assets/scss/index";
.from-bottom-enter-active,
.from-bottom-leave-active {
transition: transform 0.2s ease;
}
.from-bottom-enter-from,
.from-bottom-leave-to {
transform: translate3d(0, 50vh, 0);
}
.FindAcquaintance { .FindAcquaintance {
position: fixed; position: fixed;
left: 0; left: 0;
@ -93,53 +131,27 @@ export default {
top: 0; top: 0;
color: white; color: white;
.content {
}
.header { .header {
height: 6rem;
font-size: 1.4rem;
padding: 0 2rem;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
}
.indicator-ctn {
width: 50%;
top: 0;
left: 0;
right: 0;
z-index: 999;
background: $main-bg;
.tabs {
display: flex;
justify-content: space-between;
font-weight: bold;
.tab {
height: 40px;
width: 45%;
display: flex;
justify-content: center;
align-items: center; align-items: center;
color: gray; border-bottom: 1px solid $line-color;
transition: color .3s;
&.active { img {
color: white; height: 2rem;
}
} }
} }
.indicator { .title {
height: 2px; margin-left: 2rem;
background: gold; margin-top: 2rem;
width: 45%; color: $second-text-color;
position: relative; font-size: 1.2rem;
transition: all .3s;
}
} }
.dialog { .dialog {
z-index: 10; z-index: 10;
position: absolute; position: absolute;
@ -215,5 +227,36 @@ export default {
} }
} }
.more-option-dialog {
z-index: 9;
position: fixed;
width: 100%;
max-height: 50vh;
overflow: auto;
bottom: 0;
background: white;
box-sizing: border-box;
border-radius: 5px 5px 0 0;
.space {
height: 1rem;
background: whitesmoke;
}
.row {
font-size: 1.6rem;
color: black;
background: white;
box-sizing: border-box;
padding: 1.8rem;
width: 100%;
//border-bottom: 1px solid ghostwhite;
border-bottom: 1px solid gainsboro;
text-align: center;
}
}
} }
</style> </style>

Loading…
Cancel
Save