当前位置:网站首页>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 !
边栏推荐
- Shutter: add gradient stroke to font
- 4000字超详解指针
- 111. Minimum depth of binary tree
- OpenGL index cache object EBO and lineweight mode
- Differences between MySQL Union and union all
- Flutter Widget : Flow
- Niuniu's team competition
- PHP export word method (one MHT)
- previous permutation lintcode51
- PHP get the file list and folder list under the folder
猜你喜欢

2.7 overview of livedata knowledge points

网络通讯之Socket-Tcp(一)

C language improvement article (wchar_t) character type

AOSP ~ NTP (Network Time Protocol)

Shutter: add gradient stroke to font

Unicode encoding table download

If you can't learn, you have to learn. Jetpack compose writes an im app (I)

Duplicate numbers in the array of sword finger offer 03

ES6新特性

Swagger
随机推荐
实现验证码验证
Integer int compare size
OpenGL draws colored triangles
Vulnhub's Tomato (tomato)
手机号码变成空号导致亚马逊账号登陆两步验证失败的恢复网址及方法
DEJA_ Vu3d - cesium feature set 053 underground mode effect
Shutter: add gradient stroke to font
安裝electron失敗的解决辦法
Use of atomicinteger
102. Sequence traversal of binary tree
Pragma pack syntax and usage
(construction notes) learn the specific technology of how to design reusable software entities from three levels: class, API and framework
Niuniu's team competition
在网上炒股开户可以吗?资金安全吗?
OpenGL 着色器使用
Capturing and sorting out external Fiddler -- Conversation bar and filter [2]
(database authorization - redis) summary of unauthorized access vulnerabilities in redis
Unicode encoding table download
Optimize interface performance
previous permutation lintcode51