当前位置:网站首页>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 !
边栏推荐
- PHP導出word方法(一mht)
- error: expected reference but got (raw string)
- 2.9 overview of databinding knowledge points
- Talk about the state management mechanism in Flink framework
- Pragma pack syntax and usage
- OpenGL shader use
- 网络通讯之Socket-Tcp(一)
- 【mysql官方文档】死锁
- 023 ([template] minimum spanning tree) (minimum spanning tree)
- Solutions to the failure of installing electron
猜你喜欢
"Jianzhi offer 04" two-dimensional array search
(构造笔记)ADT与OOP
OpenGL draws colored triangles
PHP导出word方法(一phpword)
Shardingsphere sub database and sub table < 3 >
Introduction to the implementation principle of rxjs observable filter operator
Php Export word method (One MHT)
Download address and installation tutorial of vs2015
vulnhub之Nagini
PHP export word method (phpword)
随机推荐
023(【模板】最小生成树)(最小生成树)
Shutter widget: centerslice attribute
DEJA_VU3D - Cesium功能集 之 054-模拟火箭发射全过程
Pki/ca and digital certificate
Qt OpenGL 旋转、平移、缩放
Dart: view the dill compiled code file
Shutter: about inheritedwidget
(数据库提权——Redis)Redis未授权访问漏洞总结
4000字超详解指针
2.6 preliminary cognition of synergetic couroutines
Simple factory and factory method mode
347. Top k high frequency elements
Vulnhub's Nagini
win10 上PHP artisan storage:link 出现 symlink (): Protocol error的解决办法
Experience container in libvirt
Redis 笔记 01:入门篇
repo Manifest Format
4000 word super detailed pointer
Integer int compare size
(construction notes) grasp learning experience