通过输入框写了数据到data的fitV里面,怎么在request里面发送 fitValue 变量呢? 后台能收到username,但是加上fitValue小程序就会报错
求大神指导怎么修改
thirdScriptError
fitValue is not defined; [Component] Event Handler Error @ pages/begin/begin#bound bindtest
ReferenceError: fitValue is not defined
data: {
fitValue: ‘’,
fitV:’’,
},
bindtest: function() {
wx.request({
url: ‘http://localhost:8080/JianShen/fitness’,
data: {
fitword: fitValue,(不知道怎么写)
username: ‘001’,
password: ‘abc’
},
method: ‘GET’,
header: {
‘content-type’: ‘application/json’ // 默认值
},
success: function(res) {
console.log(res.data);
},
fail: function(res) {
console.log("…fail…");
}
})
},
// 输入框
inputChange: function(e) {
this.setData({
fitValue: e.detail.value
})