Commit 14b31562 by zhangzhen

细节优化

parent 19ea526a
<template> <template>
<view class="home" @touchstart="onTouchStart" @touchend="onTouchEnd"> <view class="home" @touchstart="onTouchStart" @touchend="onTouchEnd">
<f-navbar :title="storeInfo.name" :isShowTransparentTitle="false" :isShowLeft="false" fontColor="#ffffff" <f-navbar :title="'凑角-'+storeInfo.name" :isShowTransparentTitle="false" :isShowLeft="false" fontColor="#ffffff"
:fontSize="38" bgColor="#e40583" :scrollTop="scrollTop" navbarType='5'></f-navbar> :fontSize="38" bgColor="#E40583" :scrollTop="scrollTop" navbarType='5'></f-navbar>
<view class="header-content" :style="{paddingTop:statusBarHeight+'px' }">
<image class="logo-bg" :src="assetsPath +'/logo.png'" mode="widthFix"></image>
</view>
<scroll-view :enable-flex="true" class="scroll-view" scroll-y="true" @scroll="onScroll"> <scroll-view :enable-flex="true" class="scroll-view" scroll-y="true" @scroll="onScroll">
<view class="content-box"> <view class="content-box">
<view class="header-content" :style="{paddingTop:statusBarHeight+'px' }"> <view class="black-header">
<image :src="assetsPath + '/banner.png'" mode="widthFix"></image>
</view> </view>
<view class="store-nav"> <view class="store-nav" :style="{background: storeNavBg}">
<view class="icon-box"> <view class="icon-box">
<image :src="assetsPath +'/logo_icon.png'" mode="widthFix"></image> <image :src="assetsPath +'/logo_icon.png'" mode="widthFix"></image>
</view> </view>
...@@ -20,7 +25,7 @@ ...@@ -20,7 +25,7 @@
<image class="bg-img" :src="assetsPath+ '/44@2x.png'" mode="scaleToFill"></image> <image class="bg-img" :src="assetsPath+ '/44@2x.png'" mode="scaleToFill"></image>
<view class="flex-between tips-box"> <view class="flex-between tips-box">
<view class="flex-col part-left"> <view class="flex-col part-left">
<view v-if="storeInfo && storeInfo.distance" class=" flex-row"> <view v-if="storeInfo && storeInfo.distance" class=" flex-row">
<text class="cuIcon-locationfill text-red text-dw"></text> <text class="cuIcon-locationfill text-red text-dw"></text>
<text>距您{{storeInfo.distance}}公里</text> <text>距您{{storeInfo.distance}}公里</text>
...@@ -295,7 +300,8 @@ ...@@ -295,7 +300,8 @@
list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23], list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
objListDate: [], objListDate: [],
timer2: null, timer2: null,
timerLocation: null timerLocation: null,
storeNavBg:'rgba(255, 255, 255, 1)'
} }
}, },
onShow() { onShow() {
...@@ -399,7 +405,6 @@ ...@@ -399,7 +405,6 @@
setTimeout(() => { setTimeout(() => {
uni.removeStorageSync('storeId'); uni.removeStorageSync('storeId');
let aaa = uni.getStorageSync('storeId') ? true : false; let aaa = uni.getStorageSync('storeId') ? true : false;
console.log(aaa, "是否删除数据")
this.onGetListStore() this.onGetListStore()
}, 10) }, 10)
...@@ -420,11 +425,8 @@ ...@@ -420,11 +425,8 @@
if (res.data.code == 200 && res.data.data.length) { if (res.data.code == 200 && res.data.data.length) {
let obj = {} let obj = {}
if (uni.getStorageSync("storeId")) { if (uni.getStorageSync("storeId")) {
console.log(1)
obj = res.data.data.find(item => item.id === uni.getStorageSync("storeId")); obj = res.data.data.find(item => item.id === uni.getStorageSync("storeId"));
// uni.removeStorageSync('storeId')
} else { } else {
console.log(2)
obj = res.data.data[0]; obj = res.data.data[0];
uni.setStorageSync("storeId", obj.id); uni.setStorageSync("storeId", obj.id);
} }
...@@ -580,12 +582,20 @@ ...@@ -580,12 +582,20 @@
}) })
}, },
onTouchStart() { onTouchStart() {
this.timer = null; this.timer = null;
this.show = true; this.show = true;
}, },
onScroll(e) { onScroll(e) {
this.scrollTop = e.target.scrollTop; this.scrollTop = e.target.scrollTop;
let n = 0;
if(this.scrollTop<=10){
n = 0
}else if(this.scrollTop>=50){
n=0.1
}else{
n = Number( this.scrollTop/500).toFixed(4)
}
this.storeNavBg =`rgba(255, 255, 255, ${1-n})`
if (!this.timer) { if (!this.timer) {
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
this.show = false; this.show = false;
...@@ -658,7 +668,10 @@ ...@@ -658,7 +668,10 @@
display: flex; display: flex;
flex: 1; flex: 1;
width: 100vw; width: 100vw;
.black-header{
width: 100%;
height: 340upx;
}
.content-box { .content-box {
position: absolute; position: absolute;
...@@ -673,31 +686,31 @@ ...@@ -673,31 +686,31 @@
} }
.header-content { .header-content {
position: fixed;
top: 0;
left: 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center;
width: 100%; width: 100%;
min-height: 280upx; min-height: 392upx;
backdrop-filter: blur(5px); background: linear-gradient(to right, #FB406F,#E40583);
background-color: #E40583; .logo-bg{
width: 380upx;
image { max-height: 280upx;
display: block;
width: 100%;
height: auto;
backdrop-filter: blur(5px);
} }
} }
.store-nav { .store-nav {
position: relative; position: relative;
display: flex; display: flex;
width: 94%; align-self: flex-end;
width: 698upx;
height: 220upx; height: 220upx;
background: #FFFFFF;
box-shadow: 0rpx 7rpx 18rpx 0rpx rgba(0, 0, 0, 0.302); box-shadow: 0rpx 7rpx 18rpx 0rpx rgba(0, 0, 0, 0.302);
border-radius: 29rpx 29rpx 29rpx 29rpx; border-radius: 29rpx 29rpx 29rpx 29rpx;
margin-top: -60upx;
z-index: 10; z-index: 10;
margin: 0 auto 24upx;
.icon-box { .icon-box {
position: absolute; position: absolute;
...@@ -851,7 +864,7 @@ ...@@ -851,7 +864,7 @@
width: 100%; width: 100%;
margin: 0 0 24upx; margin: 0 0 24upx;
padding-bottom: 24upx; padding-bottom: 24upx;
background-color: #ffffff;
.title { .title {
width: 94%; width: 94%;
margin: 12upx 0; margin: 12upx 0;
......
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