文明问答
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
<template>
|
||||
<div class="AppAnswer">
|
||||
<div class="tab-wrapper">
|
||||
<div class="tab">
|
||||
<span :class="[component === 'List' ? 'active' : '']" @click="change('List')">问题</span>
|
||||
<span :class="[component === 'Ranking' ? 'active' : '']" @click="change('Ranking')">排行</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="AppAnswer-body">
|
||||
<component :is="component"></component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import List from './component/List'
|
||||
import Ranking from './component/Ranking'
|
||||
|
||||
export default {
|
||||
name: 'AppAnswer',
|
||||
@@ -15,20 +26,34 @@
|
||||
list: [],
|
||||
wxLogin: 0,
|
||||
current: 1,
|
||||
total: 0
|
||||
total: 0,
|
||||
component: 'List'
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
List,
|
||||
Ranking
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
getList () {
|
||||
|
||||
},
|
||||
handleDetail(id) {
|
||||
|
||||
handleDetail (id) {
|
||||
if (!this.user.token) this.wxLogin++
|
||||
else uni.navigateTo({url: './voteDetail?id=' + id})
|
||||
},
|
||||
|
||||
change (type) {
|
||||
this.component = type
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom () {
|
||||
this.getList()
|
||||
}
|
||||
@@ -38,6 +63,47 @@
|
||||
<style lang="scss" scoped>
|
||||
.AppAnswer {
|
||||
min-height: 100vh;
|
||||
background: #fff;
|
||||
background: #F3F5F9;
|
||||
|
||||
.tab-wrapper {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 11;
|
||||
background: #3975C6;
|
||||
}
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 112px;
|
||||
border-radius: 50px 50px 0 0;
|
||||
padding: 0 256px;
|
||||
background: #F3F5F9;
|
||||
|
||||
span {
|
||||
position: relative;
|
||||
line-height: 1;
|
||||
color: #999999;
|
||||
font-size: 40px;
|
||||
|
||||
&.active {
|
||||
color: #000000;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
z-index: 0;
|
||||
opacity: 0.8;
|
||||
left: 50%;
|
||||
width: 80px;
|
||||
height: 12px;
|
||||
background-image: linear-gradient(90deg, #46C0FF 0%, #0C85FF 100%);
|
||||
transform: translateX(-50%);
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user