当前位置:网站首页>Self made pop-up input box, input text, and click to complete the event.
Self made pop-up input box, input text, and click to complete the event.
2022-07-03 12:16:00 【favoritecode】
Sometimes after clicking an event , Users are required to input text such as reasons , At this time, you need a pop-up box to input text . This is the effect :
wxml:
<view class="reasonBackground" hidden="{
{hidden}}">
<view class="reasonFrame">
<view class="word"> Please enter the reason :</view>
<form bindsubmit="formSubmit" bindreset="cancel" >
<view class="resonFrame">
<textarea name="notGroupGoReason" maxlength="60"/>
<view class="confirmFrame">
<button formType="reset"> take eliminate </button>
<button form-type="submit"> indeed set </button>
</view>
</view>
</form>
</view>
</view>
{ {hidden}} The initial value of true
Page({
data: {
hidden: true
},
onLoad: function (options) {
var that = this
var hidden = that.data.hidden
that.setData({
hidden
})
}
})
Click on notGroupGo Pop up box after pressing key
notGroupGo: function () {
var that = this
that.setData({
hidden: false
})
},
Click OK to leave the page or hide the pop-up frame
formSubmit: function(e){
var notGroupGoReason = e.detail.value.notGroupGoReason
console.log("notGroupGoReason:",notGroupGoReason)
var goodsid = app.globalData.goodsInfo._id
var db = wx.cloud.database()
db.collection('goodsList').doc(goodsid).update({
data: {
state: 3,
notGroupGoReason,
}
})
.then(res => {
wx.showToast({
title: ' complete ',
icon: 'success',
duration: 2000
})
setTimeout(function () {
wx.hideToast()
wx.navigateBack({
delta: 1,
})
}, 1500)
})
.catch(console.error)
}
And cancellation :
cancel:function(){
var that = this
that.setData({
hidden: true
})
},
Pay attention to the use of hiding and displaying , It's best to use animation effects , But I will not , If you can tell me , Thank you very much !
边栏推荐
- New features of ES6
- PHP export word method (one MHT)
- OpenGL 着色器使用
- Integer string int mutual conversion
- [combinatorics] permutation and combination (summary of permutation and combination content | selection problem | set permutation | set combination)
- init. RC service failed to start
- 4000字超详解指针
- Interview experience in summer camp of Central South University in 2022
- 111. Minimum depth of binary tree
- Dart: about Libraries
猜你喜欢

OpenGL draws colored triangles
![[learning notes] DP status and transfer](/img/5e/59c64d2fe08b89fba2d7e1e6de2761.png)
[learning notes] DP status and transfer

Pki/ca and digital certificate

PHP export word method (one MHT)

MCDF Experiment 1

Integer int compare size

Vulnhub's Nagini

Itext7 uses iexternalsignature container for signature and signature verification

【附下载】密码获取工具LaZagne安装及使用

QT OpenGL rotate, pan, zoom
随机推荐
Simple factory and factory method mode
Adult adult adult
Unicode encoding table download
Develop plug-ins for idea
Swagger
Symlink(): solution to protocol error in PHP artisan storage:link on win10
为什么我的mysql容器启动不了呢
PHP export word method (one MHT)
在网上炒股开户可以吗?资金安全吗?
(construction notes) learn the specific technology of how to design reusable software entities from three levels: class, API and framework
Dart: self study system
Fundamentals of concurrent programming (III)
PHP get the file list and folder list under the folder
OpenGL shader use
Dart: about Libraries
OpenGL index cache object EBO and lineweight mode
Vulnhub's Tomato (tomato)
[combinatorics] permutation and combination (example of permutation and combination)
(construction notes) ADT and OOP
Flutter Widget : KeyedSubtree