Commit 770786fa authored by zhipeng's avatar zhipeng

首页添加按钮跳转

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