|
|
|
@ -63,11 +63,22 @@ |
|
|
|
<text class="lf-iconfont icon-fabu lf-font-50"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="fixed-right1" v-if="showTotop"> |
|
|
|
<view class="fixed-right2" v-if="showTotop"> |
|
|
|
<view class="fixed-btn" hover-class="lf-opacity" @click="goTop()"> |
|
|
|
<text class="lf-iconfont icon-zhiding lf-font-50"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 悬浮购物车入口 --> |
|
|
|
<view class="fixed-right1"> |
|
|
|
<view class="fixed-cart" hover-class="lf-opacity" @click="$url('/pages/store/cart/cart')"> |
|
|
|
<text class="lf-iconfont icon-gouwulan icon-text"></text> |
|
|
|
<text class="tips">购物车</text> |
|
|
|
<block v-if="$isRight(car_num)"> |
|
|
|
<view class="angle-mark" v-if="car_num<99">{{car_num || 0}}</view> |
|
|
|
<view class="angle-mark" v-else>99+</view> |
|
|
|
</block> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view style="height: 30rpx;"></view> --> |
|
|
|
<lf-tabbar></lf-tabbar> |
|
|
|
</view> |
|
|
|
@ -99,7 +110,8 @@ |
|
|
|
scrollH: 0, |
|
|
|
nav_height: 0, |
|
|
|
isRefresher: true, |
|
|
|
pageSize: 10 |
|
|
|
pageSize: 10, |
|
|
|
car_num: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -113,9 +125,41 @@ |
|
|
|
onLoad(){ |
|
|
|
let info = uni.getSystemInfoSync(); |
|
|
|
this.scrollH = info.screenHeight; |
|
|
|
this.getHotActivity() |
|
|
|
this.getHotActivity(); |
|
|
|
this.getcarNum(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getcarNum() { |
|
|
|
this.$http |
|
|
|
.get({ |
|
|
|
api: 'api/shopping/cart/count', |
|
|
|
header: { |
|
|
|
Authorization: this.$cookieStorage.get('user_token') |
|
|
|
}, |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
if (res.data.code == 200) { |
|
|
|
if(res.data.data == null) { |
|
|
|
this.car_num = 0; |
|
|
|
}else { |
|
|
|
this.car_num = res.data.data; |
|
|
|
} |
|
|
|
} else { |
|
|
|
wx.showModal({ |
|
|
|
content: '请下拉页面刷新重试', |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
wx.stopPullDownRefresh(); |
|
|
|
wx.hideLoading(); |
|
|
|
wx.showModal({ |
|
|
|
content: '请求失败', |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
scroll (e) { |
|
|
|
//记录scroll 位置 |
|
|
|
this.oldScrollTop = e.detail.scrollTop; |
|
|
|
@ -395,6 +439,66 @@ |
|
|
|
</style> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.fixed-right1{ |
|
|
|
position: fixed; |
|
|
|
right: 32rpx; |
|
|
|
bottom: 450rpx; |
|
|
|
width: max-content; |
|
|
|
height: max-content; |
|
|
|
z-index: 9; |
|
|
|
.fixed-cart{ |
|
|
|
width: 110rpx; |
|
|
|
height: 110rpx; |
|
|
|
border-radius: 50%; |
|
|
|
background-color: #FFFFFF; |
|
|
|
border: 1rpx solid #DEDEDE; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
flex-direction: column; |
|
|
|
color: #333333; |
|
|
|
position: relative; |
|
|
|
margin-top: 30rpx; |
|
|
|
.icon-text{ |
|
|
|
font-size: 50rpx; |
|
|
|
line-height: 1; |
|
|
|
} |
|
|
|
.tips{ |
|
|
|
font-size: 20rpx; |
|
|
|
color: #333333; |
|
|
|
} |
|
|
|
.angle-mark{ |
|
|
|
position: absolute; |
|
|
|
right: 4rpx; |
|
|
|
top: 4rpx; |
|
|
|
width: 40rpx; |
|
|
|
height: 40rpx; |
|
|
|
background-color: #15716E; |
|
|
|
border-radius: 50%; |
|
|
|
font-size: 20rpx; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
color: #FFFFFF; |
|
|
|
} |
|
|
|
} |
|
|
|
.fixed-live{ |
|
|
|
background: #15716E; |
|
|
|
border-radius: 100rpx 5rpx 100rpx 100rpx; |
|
|
|
border: none; |
|
|
|
color: #FFFFFF; |
|
|
|
// animation: bounceIn 1s .2s ease both; |
|
|
|
backface-visibility:visible; |
|
|
|
transform-origin:center center; |
|
|
|
animation: demo 2s 0s infinite ease normal none ; |
|
|
|
// &>text:nth-child(1){ |
|
|
|
// animation: fadeInRightBig 1s .1s ease both; |
|
|
|
// } |
|
|
|
.tips{ |
|
|
|
color: #FFFFFF; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.tag-father { |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
@ -441,8 +545,8 @@ |
|
|
|
padding-bottom: constant(safe-area-inset-bottom); |
|
|
|
padding-bottom: env(safe-area-inset-bottom); |
|
|
|
.fixed-btn{ |
|
|
|
width: 100rpx; |
|
|
|
height: 100rpx; |
|
|
|
width: 110rpx; |
|
|
|
height: 110rpx; |
|
|
|
border-radius: 50%; |
|
|
|
background-color: #15716E; |
|
|
|
display: flex; |
|
|
|
@ -452,17 +556,17 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.fixed-right1{ |
|
|
|
.fixed-right2{ |
|
|
|
position: fixed; |
|
|
|
right: 32rpx; |
|
|
|
bottom: 320rpx; |
|
|
|
bottom: 440rpx; |
|
|
|
width: max-content; |
|
|
|
height: max-content; |
|
|
|
padding-bottom: constant(safe-area-inset-bottom); |
|
|
|
padding-bottom: env(safe-area-inset-bottom); |
|
|
|
.fixed-btn{ |
|
|
|
width: 100rpx; |
|
|
|
height: 100rpx; |
|
|
|
width: 110rpx; |
|
|
|
height: 110rpx; |
|
|
|
border-radius: 50%; |
|
|
|
background-color: #15716E; |
|
|
|
display: flex; |
|
|
|
|