小程序有个数据源匹配页面的BUG,前端页面没有显示数据,在下方打包了整个页面的demo
求助懂的朋友;应该要修改下js;
[JavaScript] 纯文本查看 复制代码 handleAllList: function() {
var t = this.data.info, a = this.data.allList;
if (!(a.length <= 0)) {
console.log(a), a.forEach(function(t) {
console.log(t);var a = 2;
t.son && 0 < t.son.length && t.son.forEach(function(t) {
1 == t.is_can && (a = 1);
}), t.isCan = a, console.log(a);
}), (a = a.filter(function(t) {
return 1 == t.isCan, console.log(a);
})).forEach(function(t) {
var a = [];
0 < t.son.length && t.son.forEach(function(t) {
1 == t.is_can && a.push(t);
}), t.son = a;
}), console.log(a);console.log(t);//此处不知为何a,t;都没了输出
var n = !1;
0 < a.length && (n = !0), this.setData({
oneList: a,
isListData: n
}), 0 < a.length && this.handleTwoList(t.oneIndex, t.twoIndex);//最后t.oneIndex, t.twoIndex这两个值输出也为空
}
},
[JavaScript] 纯文本查看 复制代码 handleTwoList: function(t, a) {
this.setData({
twoList: this.data.oneList[t].son
}), this.handleThreeList(a);
},
handleThreeList: function(t) {
var a = this.data.twoList, n = [], e = !1;
a[t].son && 0 < a[t].son.length && (n = this.data.twoList[t].son, e = !0), this.setData({
threeList: n,
isData: e
});
},
|