for(var i = 0 ;i < that.data.towsClass.length;i++){
console.log('I第'+i)
console.log(that.data.towsClass[i].towsName)
console.log(that.data.listData.length)
for(var j = 0; j < that.data.listData.length;j++){
console.log('J第'+j)
console.log(that.data.listData[j].towsName)
console.log(that.data.towsClass[i].id)
let a = that.data.listData[j].towsName
let b = that.data.towsClass[i].id
let c = that.data.towsClass[i].towsName
console.log(a)
console.log(b)
console.log(c)
if (Number(a) == Number(b)) {
listData[j].towsName = c
that.setData({
listData
})
console.log('更改成功')
}
}
}
VM185:1 thirdScriptError
listData is not defined;at api request success callback function
ReferenceError: listData is not defined
at success (http://127.0.0.1:46289/appservice/pages/checkoutlist/checkoutlist.js:61:19)
at Function.o.<computed> (WAService.js:1:1116874)
at WAService.js:1:102889
at C (WAService.js:1:422326)
at i.<anonymous> (WAService.js:1:741526)
at i.emit (WAService.js:1:444906)
at Rs (WAService.js:1:742134)
at WAService.js:1:743355
at WAService.js:1:455576
at n (http://127.0.0.1:46289/appservice/__dev__/asdebug.js:1:3068)