Commit 770786fa authored by zhipeng's avatar zhipeng

首页添加按钮跳转

parent b751c738
{
"name" : "小神仙妆造预约",
"appid" : "__UNI__085FC1A",
"appid" : "__UNI__B1817BB",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
......
......@@ -278,7 +278,7 @@
"pagePath": "pages/homeTwo",
"iconPath": "/static/tabbar/icon_tab_two.png",
"selectedIconPath": "/static/tabbar/icon_tab_two_s.png",
"text": "客片"
"text": "客片展示"
},
{
"pagePath": "pages/homeThree",
......
......@@ -8,18 +8,18 @@
</swiper-item>
</swiper>
<view class="banner__mask">
<view class="banner__title" v-if="list[bannercurrentIndex] && list[bannercurrentIndex].title">
<text class="banner__title-text">{{ list[bannercurrentIndex].title }}</text>
<view class="banner__title" v-if="bannerTitle">
<text class="banner__title-text">{{ bannerTitle }}</text>
</view>
</view>
<view class="entry-bar">
<view class="entry-item" hover-class="entry-item--hover" @click="goPhoto('服饰')">
<view class="entry-item" hover-class="entry-item-hover" @click="goPhotoCloth">
<text class="entry-item__text">服装展示</text>
<view class="entry-item__line entry-item__line--red"></view>
<view class="entry-item__line"></view>
</view>
<view class="entry-item" hover-class="entry-item--hover" @click="goPhoto('作品')">
<view class="entry-item" hover-class="entry-item-hover" @click="goPhotoWork">
<text class="entry-item__text">客拍展示</text>
<view class="entry-item__line entry-item__line--orange"></view>
<view class="entry-item__line"></view>
</view>
</view>
</view>
......@@ -42,6 +42,12 @@
this.isTrue = time1 < time2
this.getList()
},
computed: {
bannerTitle() {
const item = this.list[this.bannercurrentIndex]
return item && item.title ? item.title : ''
}
},
methods: {
getList() {
const params = {
......@@ -68,6 +74,12 @@
this.$wskj.redirectTo("/pages/homeFour")
}
},
goPhotoCloth() {
this.goPhoto('服装')
},
goPhotoWork() {
this.goPhoto('作品')
},
goPhoto(className) {
uni.setStorageSync('photoClassTarget', className)
uni.switchTab({
......@@ -113,19 +125,21 @@
right: 0;
bottom: 0;
z-index: 2;
padding: 160rpx 40rpx calc(48rpx + env(safe-area-inset-bottom));
padding: 160rpx 48rpx 120rpx;
background: linear-gradient(
180deg,
rgba(0, 0, 0, 0) 0%,
rgba(0, 0, 0, 0.22) 45%,
rgba(0, 0, 0, 0.58) 100%
rgba(0, 0, 0, 0.28) 48%,
rgba(0, 0, 0, 0.62) 100%
);
box-sizing: border-box;
pointer-events: none;
}
.banner__title {
padding: 0 8rpx;
padding: 0 4rpx;
text-align: center;
pointer-events: none;
}
.banner__title-text {
......@@ -140,49 +154,47 @@
.entry-bar {
position: absolute;
left: 40rpx;
top: 50%;
left: 0;
right: 0;
bottom: 36rpx;
z-index: 3;
transform: translateY(-50%);
display: flex;
flex-direction: column;
flex-direction: row;
align-items: center;
justify-content: center;
}
.entry-item {
padding: 12rpx 20rpx 12rpx 0;
padding: 14rpx 28rpx 18rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
align-items: center;
background: rgba(255, 255, 255, 0.1);
border-radius: 8rpx;
}
.entry-item + .entry-item {
margin-top: 44rpx;
margin-left: 32rpx;
}
.entry-item--hover {
.entry-item-hover {
opacity: 0.7;
}
.entry-item__text {
color: #ffffff;
font-size: 34rpx;
line-height: 48rpx;
color: rgba(255, 255, 255, 0.95);
font-size: 28rpx;
line-height: 40rpx;
font-weight: 400;
letter-spacing: 6rpx;
text-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.45);
letter-spacing: 8rpx;
text-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.35);
}
.entry-item__line {
width: 64rpx;
height: 4rpx;
margin-top: 14rpx;
}
.entry-item__line--red {
background: #e53935;
}
.entry-item__line--orange {
background: #ff8a00;
width: 48rpx;
height: 3rpx;
margin-top: 12rpx;
border-radius: 2rpx;
background: rgba(255, 255, 255, 0.55);
}
</style>
<template>
<view class='container'>
<view>
<u-navbar leftIconColor="#000000" title="客片"
<u-navbar leftIconColor="#000000" title="客片展示"
:titleStyle="{color: '#000000'}"
bgColor="#ffffff"
leftIcon=""
placeholder
>
<template slot="left"></template>
</u-navbar>
......@@ -20,7 +19,7 @@
:class="{ active: tabIndex === index }"
@click="onTabClick({ index: index })"
>
<text class="level-text">{{ item.name }}</text>
<text class="level-text">{{ displayClassName(item.name) }}</text>
<view class="level-line"></view>
</view>
</view>
......@@ -103,10 +102,24 @@
uni.removeStorageSync('photoClassTarget')
this.pendingClassName = String(target)
},
selectByName(name) {
displayClassName(name) {
const map = {
'服饰': '服装'
}
return map[name] || name
},
resolveClassName(name) {
const target = String(name || '').trim()
const alias = {
'服装': '服饰',
'服饰': '服饰'
}
return alias[target] || target
},
selectByName(name) {
const target = this.resolveClassName(name)
if (!target || !this.tablist.length) return false
const index = this.tablist.findIndex(item => item.name === target)
const index = this.tablist.findIndex(item => item.name === target || this.displayClassName(item.name) === String(name || '').trim())
this.pendingClassName = ''
if (index < 0) {
this.applyTab(0, true)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment