本文實(shí)例講述了微信小程序?qū)崿F(xiàn)提交input信息到后臺(tái)的方法。分享給大家供大家參考,具體如下:
讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:域名申請(qǐng)、網(wǎng)絡(luò)空間、營(yíng)銷軟件、網(wǎng)站建設(shè)、迭部網(wǎng)站維護(hù)、網(wǎng)站推廣。
wxml文件:
<!-- 用戶名事件綁定 --> <view class="fl_form"> <text>您的姓名</text> <input type="text" placeholder='請(qǐng)輸入您的姓名' value="{{userName}}" bindblur='userNameInput'></input> </view> <!-- 所屬部門(mén)事件綁定 --> <view class="fl_form"> <text>所屬部門(mén)</text> <input type="text" placeholder='請(qǐng)輸入所屬部門(mén)' value="{{userBranch}}" bindblur='userBranchInput'></input> </view> <!-- 聯(lián)系電話事件綁定 --> <view class="fl_form"> <text>聯(lián)系電話</text> <input type="text" placeholder='請(qǐng)輸入聯(lián)系電話' 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> <!-- 時(shí)間選擇器 mode="time" --> <view class="fl_form newtime"> <picker mode="time" value="{{startime}}" start="09:00" end="21:00" bindchange="starttime"> <view class="picker"> <text>開(kāi)始時(shí)間</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>結(jié)束時(shí)間</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', //開(kāi)始時(shí)間 endtime: '21:00', //結(jié)束時(shí)間 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)設(shè)置用戶名 this.setData({ userName: e.detail.value }) }, userBranchInput: function (e) { //設(shè)置部門(mén) this.setData({ userBranch: e.detail.value }) }, userTellInput: function (e) { //設(shè)置電話 this.setData({ userTell: e.detail.value }) }, orderMeeting: function () { //提交input信息到后臺(tái) 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) } })
希望本文所述對(duì)大家微信小程序開(kāi)發(fā)有所幫助。
文章題目:微信小程序?qū)崿F(xiàn)提交input信息到后臺(tái)的方法示例
文章出自:http://chinadenli.net/article30/gjsgso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、品牌網(wǎng)站制作、網(wǎng)站制作、全網(wǎng)營(yíng)銷推廣、動(dòng)態(tài)網(wǎng)站、服務(wù)器托管
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)