123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <!-- DetailHeader.vue -->
- <template>
- <view class="ui-detail-header-wrapper">
- <title-header />
- <view class="div ui-detail-header">
- <text class="span iconfont" @click="goBack()"></text>
- <view class="div navbar-wrapper">
- <view class="div"
- v-for="(item, key) in data"
- :key="key"
- v-bind:class="{ navbar_active: key == index }"
- v-on:click="changeEvent(key)"
- >
- {{ item.name }}
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import TitleHeader from '../../TitleHeader'
- import { urlencode } from '@/util/common'
- import { header } from './static'
- import { mapState, mapMutations } from 'vuex'
- export default {
- data () {
- return {
- navHeight: 0,
- data: header
- }
- },
- components: {
- TitleHeader
- },
- mounted () {
- // #ifdef MP-WEIXIN
- this.navHeight = uni.getMenuButtonBoundingClientRect().top
- // #endif
- },
- computed: {
- ...mapState({
- index: state => state.pointsgoods.index
- })
- },
- created () {},
- methods: {
- ...mapMutations({
- changeIndex: 'changeIndex'
- }),
- changeEvent (index) {
- this.changeIndex(index)
- },
- goBack () {
- uni.navigateBack({delta:1})
- }
- }
- }
- </script>
- <style lang="scss">
- .ui-detail-header-wrapper{
- position: fixed;
- top: var(--status-bar-height);
- left: 0;
- right: 0;
- z-index: 10;
- }
- .ui-detail-header {
- padding: 0 0.45rem;
- background: rgba(255, 255, 255, 1);
- color: #55595f;
- font-size:$h2;
- width: auto;
- display: flex;
- justify-content: center;
- align-content: center;
- align-items: center;
- flex-basis: auto;
- .iconfont {
- width: 1.2rem;
- font-size:$h2;
- height: $headerHeight;
- line-height:$headerHeight;
- cursor: pointer;
- position: absolute;
- left: 0.45rem;
- bottom: 0;
- }
- .div.navbar-wrapper {
- line-height: $headerHeight;
- height: $headerHeight;
- .div {
- // line-height: 2.1rem;
- border-bottom: 0;
- display: inline-block;
- margin-right:2.4rem;
- color: #55595f;
- background-color: #fff;
- position: relative;
- &.navbar_active {
- color: $primaryColor;
- &::after{content:'';display: block;height: .1rem;width: 1rem;position: absolute;bottom:0;left:50%;margin-left:-.5rem;background: $primaryColor}
- }
- &:last-child {
- margin-right: 0;
- }
- &:focus {
- outline: none;
- }
- }
- }
- }
- </style>
|