当前位置:网站首页>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 !
边栏推荐
- Itext7 uses iexternalsignature container for signature and signature verification
- Redis 笔记 01:入门篇
- 4000 word super detailed pointer
- wpa_ cli
- Shutter: add gradient stroke to font
- Solution à la défaillance de l'installation d'Electron
- 111. Minimum depth of binary tree
- Qt OpenGL 旋转、平移、缩放
- 023 ([template] minimum spanning tree) (minimum spanning tree)
- Oracle advanced (I) realize DMP by expdp impdp command
猜你喜欢

PHP export word method (phpword)

OpenGL index cache object EBO and lineweight mode

Solve msvcp120d DLL and msvcr120d DLL missing

OPenGL 基本知识(根据自己理解整理)

Php Export word method (One MHT)

PHP导出word方法(一phpword)

Niuniu's team competition

Duplicate numbers in the array of sword finger offer 03

Unicode encoding table download

ES6 standard
随机推荐
Vulnhub pyexp
Solve msvcp120d DLL and msvcr120d DLL missing
Duplicate numbers in the array of sword finger offer 03
Niuniu's team competition
Solutions to the failure of installing electron
"Jianzhi offer 04" two-dimensional array search
init. RC service failed to start
(構造筆記)從類、API、框架三個層面學習如何設計可複用軟件實體的具體技術
[combinatorics] permutation and combination (summary of permutation and combination content | selection problem | set permutation | set combination)
Wechat applet - basic content
Master and backup role election strategy in kept
Dart: view the dill compiled code file
145. Post order traversal of binary tree
抓包整理外篇fiddler———— 会话栏与过滤器[二]
How to convert a numeric string to an integer
Integer int compare size
regular expression
OPenGL 基本知识(根据自己理解整理)
Socket TCP for network communication (I)
DEJA_VU3D - Cesium功能集 之 054-模拟火箭发射全过程