小程序swiper一個輪播顯示一個半內容且實現無縫滾動

效果圖:

?

?

wxml(無縫滾動:circular="true"):

<!--components/tool_version/tool_version.wxml-->
<view class="tool-version"><swiper class="tool-version-swiper" circular="true" loop="true" autoplay="true" interval="5000" duration="1000"><swiper-item class="tool-version-swiper-item swiper-item1" wx:for="{{allToolData}}" wx:for-item="item" wx:key="index"><view class="tool-version-item"><view class="tool-version-item-title"><view class="tool-verison-name {{versionClass[item.toolVersion]}}"> {{ versionName[item.toolVersion] }}</view><view class="tool-verison-price flex-center-between"><view class="tool-verison-basic-rate"> ¥{{ item.basicRate }}<text>/場</text></view><view class="tool-verison-original-price">原價{{ item.originalPrice }}/場</view></view></view><view class="tool-version-item-white"><view class="tool-version-item-cont"><view class="version-item-text flex-center-between"><view class="version-item-text-left">基礎費用</view><view class="version-item-text-right">{{ item.basicRate }}</view></view><view class="version-item-text flex-center-between"><view class="version-item-text-left">標準時長</view><view class="version-item-text-right">{{item.toolVersion === 1? "不限": item.standardDuration+'天'}}</view></view><view class="version-item-text flex-center-between"><view class="version-item-text-left">去版權logo</view><view class="version-item-text-right">{{item.toolVersion === 1? "無":item.toolVersion === 4? "有":'無(加' +item.removeCopyrightPrice+'元)'}}</view></view><view class="version-item-text flex-center-between"><view class="version-item-text-left">最大參與人數</view><view class="version-item-text-right">{{ item.maxNumberPeople }}人</view></view><view class="version-item-text flex-center-between"><view class="version-item-text-left">人數擴容</view><view class="version-item-text-right">{{item.toolVersion !== 1? '每增加100人增加'+item.numberPeopleExpansionPrice+'元' : "—"}}</view></view><view class="version-item-text flex-center-between"><view class="version-item-text-left">時長續約</view><view class="version-item-text-right">{{ item.basicRate }}</view></view></view></view></view></swiper-item></swiper>
</view>

wxss:?

.flex-center-between {display: flex;align-items: center;justify-content: space-between;
}
.tool-version-swiper {width: 100% !important;height: 730rpx;
}.tool-version-swiper-item {width: 493rpx !important;padding: 0 0 0 32rpx;
}.tool-version-item-title {width: 100%;height: 207rpx;background: linear-gradient(132deg, #EDF4FF 0%, #EBF8FF 100%);box-shadow: 0 8rpx 43rpx 0 rgba(17, 72, 129, 0.06);border-radius: 39rpx 0 0 0;position: relative;
}.tool-verison-name {font-size: 32rpx;font-family: SourceHanSansCN-Bold, SourceHanSansCN;font-weight: bold;color: #242424;line-height: 59rpx;letter-spacing: 3rpx;text-shadow: 0 8rpx 43rpx rgba(17, 72, 129, 0.06);position: absolute;left: 0;top: 0;padding: 13rpx 48rpx;box-shadow: 0 8rpx 43rpx 0 rgba(17, 72, 129, 0.06);border-radius: 41rpx 0 41rpx 0;
}/* 免費體驗版 */
.version-sty1 {background: #d3e4ff;color: rgba(36, 36, 36, 1);
}/* 基礎版 */
.version-sty2 {background: #a4c7ff;color: #0064ff;
}/* 專業版 */
.version-sty3 {background: #0064ff;color: #ffffff;
}/* 旗艦版 */
.version-sty4 {background: linear-gradient(270deg,#0064ff 0%,#006cff 62%,#00c1ff 100%);color: #fff;
}.tool-verison-price {padding: 115rpx 32rpx 33rpx 48rpx;
}.tool-verison-basic-rate {font-size: 40rpx;font-family: SourceHanSansCN-Bold, SourceHanSansCN;font-weight: bold;color: #242424;line-height: 59rpx;text-shadow: 0 8rpx 43rpx rgba(17, 72, 129, 0.06);
}.tool-verison-original-price {font-size: 20rpx;font-family: SourceHanSansCN-Medium, SourceHanSansCN;font-weight: 500;color: rgba(36, 36, 36, 0.6);line-height: 29rpx;letter-spacing: 1rpx;text-shadow: 0 8rpx 43rpx rgba(17, 72, 129, 0.06);text-decoration: line-through;
}.tool-version-item-white {width: 100%;background: #FFFFFF;box-shadow: 0 8rpx 43rpx 0 rgba(17, 72, 129, 0.06);
}.tool-version-item-cont {padding: 53rpx 48rpx 57rpx 48rpx;
}.version-item-text {font-size: 22rpx;font-family: SourceHanSansCN-Medium, SourceHanSansCN;font-weight: 500;color: #242424;line-height: 33rpx;letter-spacing: 1rpx;text-shadow: 0 8rpx 43rpx rgba(17, 72, 129, 0.06);
}.version-item-text:not(:last-child) {margin-bottom: 43rpx;
}.version-item-text-right {font-weight: bold;
}

js:


Page({/*** 頁面的初始數據*/data: {allToolData: [{basicRate: 0,durationRenewalPrice: null,isLogo: 0,isRefund: 0,maxNumberPeople: 50,numberPeopleExpansionPrice: null,originalPrice: 0,paySettings: null,removeCopyrightPrice: null,standardDuration: -1,toolApplicationId: "1",toolApplicationPriceId: "1",toolVersion: 1,},{basicRate: 188,durationRenewalPrice: 50,isLogo: 0,isRefund: 1,maxNumberPeople: 500,numberPeopleExpansionPrice: 50,originalPrice: 299,paySettings: "PC_WX_PAY,PC_ALI_PAY,H5_WX_PAY,H5_ALI_PAY",removeCopyrightPrice: 99,standardDuration: 3,toolApplicationId: "1",toolApplicationPriceId: "3671774911571386373",toolVersion: 2,},{basicRate: 188,durationRenewalPrice: 50,isLogo: 0,isRefund: 1,maxNumberPeople: 500,numberPeopleExpansionPrice: 50,originalPrice: 299,paySettings: "PC_WX_PAY,PC_ALI_PAY,H5_WX_PAY,H5_ALI_PAY",removeCopyrightPrice: 99,standardDuration: 3,toolApplicationId: "1",toolApplicationPriceId: "3671774911571386373",toolVersion: 2,},{basicRate: 288,durationRenewalPrice: 50,isLogo: 0,isRefund: 1,maxNumberPeople: 1500,numberPeopleExpansionPrice: 50,originalPrice: 499,paySettings: "PC_WX_PAY,PC_ALI_PAY,H5_WX_PAY,H5_ALI_PAY",removeCopyrightPrice: 99,standardDuration: 10,toolApplicationId: "1",toolApplicationPriceId: "3674643125091639300",toolVersion: 3,},{basicRate: 388,durationRenewalPrice: 50,isLogo: 1,isRefund: 1,maxNumberPeople: 5000,numberPeopleExpansionPrice: 50,originalPrice: 799,paySettings: "PC_WX_PAY,PC_ALI_PAY,H5_WX_PAY,H5_ALI_PAY",removeCopyrightPrice: null,standardDuration: 15,toolApplicationId: "1",toolApplicationPriceId: "3674643125091639301",toolVersion: 4,}],versionName: {1: "免費體驗版",2: "基礎版",3: "專業版",4: "旗艦版",},versionClass: {1: "version-sty1",2: "version-sty2",3: "version-sty3",4: "version-sty4",},},/*** 生命周期函數--監聽頁面加載*/onLoad(options) {},/*** 生命周期函數--監聽頁面初次渲染完成*/onReady() {},/*** 生命周期函數--監聽頁面顯示*/onShow() {},/*** 生命周期函數--監聽頁面隱藏*/onHide() {},/*** 生命周期函數--監聽頁面卸載*/onUnload() {},/*** 頁面相關事件處理函數--監聽用戶下拉動作*/onPullDownRefresh() {},/*** 頁面上拉觸底事件的處理函數*/onReachBottom() {},/*** 用戶點擊右上角分享*/onShareAppMessage() {}
})

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/41394.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/41394.shtml
英文地址,請注明出處:http://en.pswp.cn/news/41394.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

數模論文寫作細節要求

目錄 優秀論文必要條件 數學建模的基本思路 第一步&#xff1a;了解問題——查文獻、找數據 第二步&#xff1a;闡述要解決什么問題、用什么方法 其余步驟&#xff1a;給出數學模型、計算求解、對比結果與真實情況、應用于現實問題。 使用某種數學方法的理由和依據 創…

Python爬蟲性能優化:多進程協程提速實踐指南

各位大佬們我又回來了&#xff0c;今天我們來聊聊如何通過多進程和協程來優化Python爬蟲的性能&#xff0c;讓我們的爬蟲程序6到飛起&#xff01;我將會提供一些實用的解決方案&#xff0c;讓你的爬蟲速度提升到新的高度&#xff01; 1、多進程提速 首先&#xff0c;讓我們來看…

cs231n assignment2 q5 PyTorch on CIFAR-10

文章目錄 嫌啰嗦直接看源碼Q5 :PyTorch on CIFAR-10three_layer_convnet題面解析代碼輸出 Training a ConvNet題面解析代碼輸出 ThreeLayerConvNet題面解析代碼輸出 Train a Three-Layer ConvNet題面解析代碼輸出 Sequential API: Three-Layer ConvNet題面解析代碼輸出 CIFAR-1…

SpringBoot整合ArtemisMQ筆記

SpringBoot整合ArtemisMQ筆記 本案例是springboot2.4.2整合Apache ArtemisMQ, 發送jms信息和訂閱jms消息的代碼示例pom配置 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-artemis</artifactId><…

BT利器之wazuh

目錄 一、什么是wazuh 二、wazuh的安裝 1.倉庫安裝 2.虛擬機OVA安裝 3.其他安裝方式 三、淺析wazuh的規則、解碼器等告警原理以及主動響應 1.主動響應(active-response) 2.告警信息(alerts) 3.規則以及解碼器(rules and decoders) 3.1.規則 3.2.解碼器 4.linux后門r…

力扣75——圖深度優先搜索

總結leetcode75中的圖深度優先搜索算法題解題思路。 上一篇&#xff1a;力扣75——二叉搜索樹 力扣75——圖深度優先搜索 1 鑰匙和房間2 省份數量3 重新規劃路線4 除法求值1-4 解題總結 1 鑰匙和房間 題目&#xff1a; 有 n 個房間&#xff0c;房間按從 0 到 n - 1 編號。最初…

【Matter】基于Ubuntu 22.04搭建matter開發環境:chip-tool 配網之 matter-over-wifi

前言 主要是記錄一下學習過程&#xff0c;梳理下思路&#xff0c;拋轉~ 官方的開發環境&#xff0c;基于Linux版本&#xff0c;官方的環境是基于樹莓派環境的&#xff0c;原理其實也比較明了&#xff0c;目的也比較明確&#xff0c;就是達到Linux 主機和wifi 路由在同一局域網…

SpringBoot攜帶Jre綠色部署項目

文章目錄 SpringBoot攜帶Jre綠色部署運行項目1. 實現步驟2. 自測項目文件目錄及bat文件內容&#xff0c;截圖如下&#xff1a;2-1 項目文件夾列表&#xff1a;2-2. bat內容 3. 擴展&#xff1a; 1.6-1.8版本的jdk下載 SpringBoot攜帶Jre綠色部署運行項目 說明&#xff1a; 實…

256創作紀念日

不知不覺已經是寫博客的第256天了&#xff0c;從一個躺平的人變成一個為一件事能堅持并不斷去做是真的很爽&#xff0c;回過頭看看自己&#xff0c;寫了好多東西&#xff0c;也慢慢在成長&#xff0c;不再是以前那個只會玩的小孩了。 1、自我介紹 我是來自西安的一名準大三學…

Data Abstract for .NET and Delphi Crack

Data Abstract for .NET and Delphi Crack .NET和Delphi的數據摘要是一套或RAD工具&#xff0c;用于在.NET、Delphi和Mono中編寫多層解決方案。NET和Delphi的數據摘要是一個套件&#xff0c;包括RemObjects.NET和Delphi版本的數據摘要。RemObjects Data Abstract允許您創建訪問…

easyx圖形庫基礎4:貪吃蛇

貪吃蛇 一實現貪吃蛇&#xff1a;1.繪制網格&#xff1a;1.繪制蛇&#xff1a;3.控制蛇的默認移動向右&#xff1a;4.控制蛇的移動方向&#xff1a;5.生成食物6.判斷蛇吃到食物并且長大。7.判斷游戲結束&#xff1a;8.重置函數&#xff1a; 二整體代碼&#xff1a; 一實現貪吃蛇…

【golang】結構體及其方法的使用(struct)

函數是獨立的程序實體。我們可以聲明有名字的函數&#xff0c;也可以聲明沒名字的函數&#xff0c;還可以把它們當做普通的值傳來傳去。我們能把具有相同簽名的函數抽象成獨立的函數類型&#xff0c;以作為一組輸入、輸出&#xff08;或者說一類邏輯組件&#xff09;的代表。 …

爬蟲逆向實戰(八)--猿人學第十五題

一、數據接口分析 主頁地址&#xff1a;猿人學第十五題 1、抓包 通過抓包可以發現數據接口是api/match/15 2、判斷是否有加密參數 請求參數是否加密&#xff1f; 查看“載荷”模塊可以發現有一個m加密參數 請求頭是否加密&#xff1f; 無響應是否加密&#xff1f; 無cook…

CSS中的z-index屬性有什么作用?如何控制元素在層疊上下文中的顯示順序?

聚沙成塔每天進步一點點 ? 專欄簡介? z-index 屬性的作用及控制元素層疊順序作用 ? 控制元素層疊順序? 寫在最后 ? 專欄簡介 前端入門之旅&#xff1a;探索Web開發的奇妙世界 記得點擊上方或者右側鏈接訂閱本專欄哦 幾何帶你啟航前端之旅 歡迎來到前端入門之旅&#xff0…

管理類聯考——邏輯——真題篇——按知識分類——匯總篇——一、形式邏輯——選言——不相容選言——要么

第三節 不相容選言-要么-“要么A要么B”→A和B有且僅有一個 真題(2010-39)-不相容選言-要么-“要么A要么B”→A和B有且僅有一個 39.大小行星懸浮游在太陽系邊緣,極易受附近星體引力作用的影響。據研究人員計算,有時這些力量會將彗星從奧爾特星云拖出。這樣,它們更有可能…

WPF國際化的實現方法(WpfExtensions.Xaml)

https://blog.csdn.net/eyupaopao/article/details/120090431 resx資源文件實現 resx資源文件&#xff0c;實現的過程比第一種復雜&#xff0c;但resx文件本身編輯比較簡單&#xff0c;維護起來比較方便。需要用到的框架&#xff1a;WpfExtensions.Xaml 為每種語言添加.resx資…

Mac思維導圖軟件Xmind for Mac中文激活版

好的思維導圖軟件能幫助用戶更好的發揮創作能力&#xff0c;XMind是一款流行的思維導圖軟件&#xff0c;可以幫助用戶創建各種類型的思維導圖和概念圖。 多樣化的導圖類型&#xff1a;XMind提供了多種類型的導圖&#xff0c;如魚骨圖、樹形圖、機構圖等&#xff0c;可以滿足不同…

UI自動化測試常見的Exception

一. StaleElementReferenceException&#xff1a; - 原因&#xff1a;引用的元素已過期。原因是頁面刷新了&#xff0c;此時當然找不到之前頁面的元素。- 解決方案&#xff1a;不確定什么時候元素就會被刷新。頁面刷新后重新獲取元素的思路不變&#xff0c;這時可以使用python的…

ClickHouse(二十二):Clickhouse SQL DML操作及導入導出數據

進入正文前&#xff0c;感謝寶子們訂閱專題、點贊、評論、收藏&#xff01;關注IT貧道&#xff0c;獲取高質量博客內容&#xff01; &#x1f3e1;個人主頁&#xff1a;含各種IT體系技術&#xff0c;IT貧道_Apache Doris,大數據OLAP體系技術棧,Kerberos安全認證-CSDN博客 &…

GPT-5出世?OpenAI GPT-5商標已注冊

OpenAI的GPT已經成為了業界標桿&#xff0c;升級速度之快讓人瞠目&#xff0c;別人追GPT-3.5的時候GPT-4橫空出世&#xff0c;差距被拉開了&#xff0c;現在GPT-5就要來了。 據商標律師泄露的消息&#xff0c;OpenAI已于7月18日注冊了GPT-5商標。雖然注冊商標并不罕見&#xf…