聯(lián)系官方銷售客服
1835022288
028-61286886
<form bindsubmit="formSubmit" bindreset="formReset">
<view class="inputView" style='margin-left: 25px;margin-right: 25px;'>
<input class="input_name" name="name" placeholder="姓名" placeholder-style="color: #dbdbdb" />
</view>
<view class="inputView" style='margin-left: 25px;margin-right: 25px;'>
<input class="input_name" name="tel" placeholder="電話" placeholder-style="color: #dbdbdb" />
</view>
<button class='btn_sub' type="primary" formType="submit">提交領取禮包</button>
</form>
上面是小程序的表單視圖,按鈕觸發(fā)formSubmit方法
formSubmit:function(e){
var formData = e.detail.value;
console.log(formData)
wx.request({
url: 'https://abc.com/index.php?c=form_testform',
data: {
name: formData.name,
tel:formData.tel
},
header: {
'Content-Type': 'application/json'
},
success: function (res) {
console.log(res);
},
fail: function () {
console.log('request from fail')
},
})
}
以上是我寫的點擊事件觸發(fā)的方法,但是不行,之前都是直接往數(shù)據(jù)庫里面塞數(shù)據(jù),但是這樣不能自動推送郵件,想請問通過表單提交的接口方法應該如何實現(xiàn)?
默認表單名稱: " testform "
接口URL不對,還需要加識別參數(shù)
回復@可接二開、定制、使用解答
額我看您在之前的帖子里回復的就是這個接口啊
http://www.wendacms.com/9076.html
還有識別參數(shù)是什么,需要授權碼那些嗎?