小程序js傳值:
wx.request({ url: 'test.php', //僅為示例,并非真實的接口地址 method: "POST", header: { //傳輸接收數(shù)據(jù)的頭(?。。。? 'content-type': 'application/x-www-form-urlencoded' }, data: { x:'x' }, success: function (res) { console.log(res.data) if (res.data==1){ that.data.isCode=true wx.showToast({ title: '驗證碼', icon: 'success', duration: 2000 }) }else{ wx.showToast({ title: '驗證碼錯誤', icon: 'success', duration: 2000 }) } } })
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29