当前位置:网站首页>Number of wechat applet custom input boxes
Number of wechat applet custom input boxes
2022-06-25 19:54:00 【JINYUBAOO】
One 、 Knowledge points used
1、 Wechat applet Number() and parseInt()
2、colorui Of var Components
3、wx.setStorageSync Save to local cache
Two 、 Key source code
<view class="action">
<button class="cu-btn bg-blue shadow" bindtap="numSteps" style="width:180rpx;"> next step </button>
</view>
<view class="cu-item {
{index>num?'':'text-blue'}}" wx:for="{
{numList}}" wx:key>
<text class="num {
{index==2?'err':''}}" data-index="{
{index + 1}}"></text>
{
{
item.name}}
</view>
The number will correspond to several steps
<view class="cu-bar bg-white solid-bottom">
<view class="action">
<text class="cuIcon-titles text-orange"></text> details
</view>
</view>
<view wx:for="{
{processnum}}" bindtap="tabSelect" data-id="{
{index}}">
<view class="cu-form-group">
<text class="input"> The first {
{
index+1}} A step </text>
</view>
...
<view class="cu-bar tabbar margin-bottom-xl bg-white">
<view class="action text-gray add-action">
<button class="cu-btn cuIcon-add bg-blue shadow" bindtap="add"></button>
Release
</view>
</view>
</view>
The number of steps is stored locally
processnum:
wx.setStorageSync('processnum', e.detail.value)
The basic source of the style used colourUI
But there will be another problem , In this way, the number of local saved steps will be judged by bit , So we also need to convert the string in the input box into the overall number for judgment .
```cpp
numSteps() {
this.setData({
//num: this.data.num == this.data.numList.length - 1 ? 0 : this.data.num + 1,
processnum : parseInt(wx.getStorageSync('processnum'))
})
console.log("processnum:",this.data.processnum)
},
Number(): Can be used to convert any data type to a numeric value ;
parseInt()、parseFloat(): Specifically used to convert strings to numeric values ;
边栏推荐
- JS get the parameters in the URL link
- 3、 Hikaricp source code analysis of connection acquisition process III
- DARKHOLE 2
- DataX script task development record
- 通过启牛学堂开的股票账户可以用吗?资金安全吗?
- Uni app through uni Navigateto failed to pass parameter (pass object)
- Applet request interface encapsulation
- On Oracle full stack virtual machine -- graalvm
- 一、HikariCP获取连接流程源码分析一
- Yaml configuration
猜你喜欢
Ali visual AI training camp -day03- construction of electronic photo album (face and expression recognition)
Gbpnzd firm offer for 14 months, simulation for 19 months, test stable
JVM | runtime data area (heap space)
Applet multi image to Base64 upload
LNMP compilation and installation
PHP Chinese regular
Combing the latest Data Mining Event Scheme!
Mail monitoring cloud script execution progress
Using flex to implement the Holy Grail layout is as simple as that
Uni app through uni Navigateto failed to pass parameter (pass object)
随机推荐
5、 Initialization analysis II of hikaricp source code analysis
Jsonp non homologous interaction (click trigger)
Vulnhub range the planes:earth
通过启牛学堂开的股票账户可以用吗?资金安全吗?
Can the stock account opened through qiniu school be used? Is the fund safe?
Apifox simple understanding -- the integrator of web side testing
Guangzhou Sinovel interactive VR panorama brings development to all walks of life
Processing method for uniapp or applet onload not receiving parameters
Is it safe for tongdaxin to open an account?
Alicloud centos8.0 installing mysql8
QQ robot official plug-in loading configuration method [beta2 version]
DARKHOLE 2
Install spoole
Convert word to PDF through libreoffice
JS get the parameters in the URL link
PostgreSQL division considerations
R language plot visualization: plot visualization of two-dimensional histogram contour (basic 2D histogram contour)
New features of php7
MySQL view explanation
Using flex to implement the Holy Grail layout is as simple as that