国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 熱點 > 微信 > 正文

微信小程序實現提交input信息到后臺的方法示例

2024-07-22 01:19:12
字體:
來源:轉載
供稿:網友

本文實例講述了微信小程序實現提交input信息到后臺的方法。分享給大家供大家參考,具體如下:

wxml文件:

<!-- 用戶名事件綁定 --><view class="fl_form"><text>您的姓名</text><input type="text" placeholder='請輸入您的姓名' value="{{userName}}" bindblur='userNameInput'></input></view><!-- 所屬部門事件綁定 --><view class="fl_form"><text>所屬部門</text><input type="text" placeholder='請輸入所屬部門' value="{{userBranch}}" bindblur='userBranchInput'></input></view><!-- 聯系電話事件綁定 --><view class="fl_form"><text>聯系電話</text><input type="text" placeholder='請輸入聯系電話' value="{{userTell}}" bindblur='userTellInput'></input></view><!-- 日期選擇器 mode="date" --><view class="fl_form"><picker mode="date" value="{{date}}" start="{{date}}" end="2020-01-01" bindchange="bindDateChange"><view class="picker"><text>選擇日期</text> <text class="chosedate">{{date}}</text></view></picker></view><!-- 時間選擇器 mode="time" --><view class="fl_form newtime"><picker mode="time" value="{{startime}}" start="09:00" end="21:00" bindchange="starttime"><view class="picker"><text>開始時間</text> <text class="chosedate">{{starttime}}</text></view></picker><picker mode="time" value="{{endtime}}" start="09:00" end="21:00" bindchange="endtime"><view class="picker end"><text>結束時間</text> <text class="chosedate">{{endtime}}</text></view></picker></view><!-- 提交按鈕 --><button class="formbtn" bindtap='orderMeeting'>提交</button>

js代碼:

var util = require('../../utils/util.js') //引入微信自帶的日期格式化const app = getApp()Page({data: {date:util.formatDate(new Date), //格式化日期starttime: '9:00', //開始時間endtime: '21:00', //結束時間userName: '',userBranch: '',userTell: ''},bindDateChange: function (e) {this.setData({date: e.detail.value})},starttime: function (e) {this.setData({starttime: e.detail.value})},endtime: function (e) {this.setData({endtime: e.detail.value})},userNameInput: function (e) {// console.log(e.detail.value)設置用戶名this.setData({userName: e.detail.value})},userBranchInput: function (e) {//設置部門this.setData({userBranch: e.detail.value})},userTellInput: function (e) {//設置電話this.setData({userTell: e.detail.value})},orderMeeting: function () { //提交input信息到后臺var userName = this.data.userName;console.log(userName)var userBranch = this.data.userBranch;console.log(userBranch)var userTell = this.data.userTell;console.log(userTell)var date = this.data.date;console.log(userTell)}})            
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 大余县| 西贡区| 工布江达县| 扶余县| 分宜县| 泰和县| 称多县| 临猗县| 武城县| 梁平县| 墨玉县| 社旗县| 伊春市| 新宾| 屏东市| 左贡县| 上虞市| 阜宁县| 浦城县| 宣恩县| 扶余县| 柳河县| 呼玛县| 泗阳县| 靖安县| 红原县| 广水市| 建平县| 黄骅市| 彝良县| 元谋县| 巢湖市| 类乌齐县| 崇阳县| 喀什市| 社会| 右玉县| 东乌珠穆沁旗| 潞城市| 鄯善县| 林芝县|