当前位置:网站首页>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 !
边栏推荐
猜你喜欢
![[official MySQL document] deadlock](/img/2d/04e97d696f20c2524701888ea9cd10.png)
[official MySQL document] deadlock

ArcGIS application (XXI) ArcMap method of deleting layer specified features

Vulnhub pyexp

PHP导出word方法(一mht)

Develop plug-ins for idea

Shutter widget: centerslice attribute

Why can't my MySQL container start

Socket TCP for network communication (I)

为什么我的mysql容器启动不了呢

shardingSphere分库分表<3>
随机推荐
Pki/ca and digital certificate
Redis
How to convert a numeric string to an integer
Visual studio 2022 downloading and configuring opencv4.5.5
Test classification in openstack
Unicode encoding table download
Quantitative calculation research
DEJA_VU3D - Cesium功能集 之 054-模拟火箭发射全过程
145. Post order traversal of binary tree
Pragma pack syntax and usage
SystemVerilog -- OOP -- copy of object
Solution to the second weekly test of ACM intensive training of Hunan Institute of technology in 2022
PHP导出word方法(一phpword)
Interview experience in summer camp of Central South University in 2022
PHP導出word方法(一mht)
1-1 token
Experience container in libvirt
[learning notes] DP status and transfer
Niuniu's team competition
Laravel time zone timezone