wxml部分
js部分
establishBindSubmit: function (e) {
let that = this
let values = e.detail.value
var deptsName = [];
var depts = [];
for (var i = 0; i < values.itemDeptList.length; i++) {
var d = values.itemDeptList[i].split(’#’);
deptsName = deptsName .concat(d[1])
depts = depts .concat(d[0]) }
}
deptsName是分类名称,depts是分类id。
打印出来
console.log(depts,deptsName)
[“15”, “49”, “48”, “50”, “47”], [“酒水饮料”, “粮油调味”, “休闲零食”, “日化用品”, “百货家电”]