增加组件接口
This commit is contained in:
@@ -35,7 +35,7 @@ Component({
|
||||
overlayStyle: {
|
||||
type: String,
|
||||
value: 'background-color: rgba(0, 0, 0, 0.7)'
|
||||
},
|
||||
},
|
||||
},
|
||||
attached(){
|
||||
debouncetimer = null
|
||||
@@ -56,26 +56,26 @@ Component({
|
||||
*/
|
||||
data: {
|
||||
show_page: false,
|
||||
// list: [],
|
||||
list: [{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
}],
|
||||
list: [],
|
||||
// list: [{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// }],
|
||||
cur: -1,
|
||||
keyword: '',
|
||||
item: {}
|
||||
@@ -119,16 +119,21 @@ Component({
|
||||
let that = this
|
||||
that.debounce(function(){
|
||||
that.setData({
|
||||
keyword: e.detail.value
|
||||
keyword: e.detail.value,
|
||||
cur: -1,
|
||||
item: {}
|
||||
})
|
||||
console.log(1)
|
||||
},200)
|
||||
if(e.detail.value){
|
||||
that.apiGetMbrand(e.detail.value)
|
||||
}
|
||||
},500)
|
||||
},
|
||||
bindSelectIndex(e){
|
||||
console.log(e)
|
||||
this.setData({
|
||||
cur: e.currentTarget.dataset.index
|
||||
})
|
||||
|
||||
},
|
||||
/**
|
||||
* 函数防抖
|
||||
@@ -150,5 +155,14 @@ Component({
|
||||
}, gapTime)
|
||||
})()
|
||||
},
|
||||
|
||||
//app/series/mbrand
|
||||
apiGetMbrand(keyword){
|
||||
_.apiQuery.getMbrand({keyword}).then(res => {
|
||||
this.setData({
|
||||
list: res.data.list
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user