日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Taro +微信小程序实现 露出后一项的一小部分的swiper效果

發(fā)布時間:2024/5/15 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Taro +微信小程序实现 露出后一项的一小部分的swiper效果 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

實現(xiàn)可以露出下一張swiper 圖一部分的效果

1、vue文件

<template><viewclass="container":style="containerStyle"><!-- 頭部背景 --><viewclass="fixed-header"><NavBartitleTxt="":showLeft="false"bgColor="transparent"textColor="#FFFFFF"leftArrowColor="#FFFFFF"><template #left><view class="avator flex f-ai-c"><imageclass="index-icon":src="`${baseImgHost}/food-tips-icon.png`"mode="aspectFill"/><text class="fz-24 user-name">西門吹雪</text></view></template></NavBar><!-- <view></view> --><image:src="`${baseImgHost}/index-bg.png`"mode="aspectFill"class="index-bg"/></view><view class="relative-container"><BgTitleList:tabList="tabList"style="margin-top: 50rpx;"@bgTitleClick="bgTitleClickHandle"/><!-- 菜品列表 --><view class="food-list"><text class="fz-24 food-text two-line-words">{{ foodList.join('/') }}</text></view><!-- 菜品swiper --><swiper:indicator-dots="false":duration="500"class="swiper-container"next-margin="30rpx"><blockv-for="item in dataList":key="item.id"><swiper-item><view class="food-swiper"><image:src="item.food.imgUrl"class="food-img"mode="aspectFill"/><view class="energy-info-group flex f-jc-sb"><view class="energy-info flex f-d-c f-ai-c"><text class="value">{{ (+item.food.heat).toFixed(1) }}</text><text class="unit fz-28">熱量(Kcal)</text></view><view class="energy-info flex f-d-c f-ai-c"><text class="value">{{ (+item.food.protein).toFixed(1) }}</text><text class="unit fz-28">蛋白質(zhì)(g)</text></view><view class="energy-info flex f-d-c f-ai-c"><text class="value">{{ (+item.food.fat).toFixed(1) }}</text><text class="unit fz-28">脂肪(g)</text></view></view></view></swiper-item></block></swiper></view></view> </template>

2.樣式

page {overflow: scroll; } .container {padding: 0;box-sizing: border-box;.fixed-header {position: fixed;z-index: 99;top: 0;width: 100vw;height: 100vh;background: linear-gradient(180deg, #FFF1E3 0%, #FAFAFA 100%);.avator {.index-icon {width: 60rpx;height: 60rpx;margin-left: 36rpx;border-radius: 50%;}.user-name {margin-left: 22rpx;font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;color: #333333;}}.index-bg {width: 100vw;height: 332rpx;}}.relative-container {position: relative;z-index: 99;width: 100%;padding: 0 64rpx 40rpx;box-sizing: border-box;.food-list {height: 204rpx;margin-top: -25rpx;margin-bottom: 32rpx;box-sizing: border-box;padding: 80rpx 190rpx 30rpx 40rpx;background-image: url('../../images/canteen-mini/index-food-bg.png');background-size: contain;.food-text {font-family: PingFangSC-Regular, PingFang SC;line-height: 2;font-weight: 400;color: #613A15;}}// 這里開始是關(guān)鍵,上👆面的可以忽略.swiper-container {// swiper容器的寬度 等于: 100vw - (父padding-left + 父 padding-right) + swiper.next-margin + swiperItem.margin-rightwidth: calc(100vw - 128rpx + 30rpx + 30rpx);height: 732rpx;.food-swiper {height: 732rpx;margin-right: 30rpx;background-color: white;border-radius: 20rpx;.food-img {width: 100%;height: 560rpx;border-radius: 20rpx;}.energy-info-group {padding: 0 40rpx;margin-top: 28rpx;box-sizing: border-box;.energy-info {.value {font-size: 44rpx;font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;color: #333333;}.unit {font-family: PingFangSC-Light, PingFang SC;font-weight: 300;color: #999999;}}}}}} }

總結(jié)

以上是生活随笔為你收集整理的Taro +微信小程序实现 露出后一项的一小部分的swiper效果的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。