亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

小程序?qū)崿F(xiàn)投票進(jìn)度條

 更新時(shí)間:2019年11月20日 11:58:19   作者:句點(diǎn)_a  
這篇文章主要為大家詳細(xì)介紹了小程序?qū)崿F(xiàn)投票進(jìn)度條,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了小程序投票進(jìn)度條的具體代碼,供大家參考,具體內(nèi)容如下

示例圖:

上代碼:

index.wxml:

<view class='clo_jdt'>
 <view style='width:{{width}}'></view>
 </view>
 <view>進(jìn)度
 <text>{{width}}</text>
 </view>
 <view>當(dāng)前票數(shù)
 <text>{{quorumvotes}}</text>
</view>

index.wxss

.clo_jdt {
 width: 100%;
 border: 1px solid #6c9c2c;
 height: 25px;
 border-radius: 10px;
}
 
.clo_jdt view { 
 background: #95ca0d;
 float: left;
 height: 100%;
 text-align: center;
 line-height: 150%;
 border-radius: 10px 0 0 10px;
}

index.js

Page({
 data: {
 quorumvotes: 50,//當(dāng)前票數(shù)
 width: "0%",//投票進(jìn)度
 votes: 500 //最多可投票數(shù)
 },
 
 onLoad: function() {
 //獲取總票數(shù)
 var votes = this.data.votes;
 //獲取當(dāng)前票數(shù)
 var quorumvotes = this.data.quorumvotes;
 //進(jìn)度
 var speed = quorumvotes/votes*100+"%";
 console.log(speed)
 this.setData({
 width: speed,
 });
 
})

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論