Ng4——Sass(查询列表)
/*获取次卡列表数据*/
getCardList(): void{
let sendData = {
};
let connect = this._api.getApi({
sendData: sendData,//组装前端传递参数
type: 'get',
apiUrl: XXXX
});
connect.then(res => {
if(res.data){
this.listData = res.data;
}
});
}
Ng4——Sass(删除一条或者多条数据)
/*删除事件*/
delCard(id: any): void{
layer.confirm('确定要删除该次卡?', index => {
let sendData = {
shopId: XXX,
cardId: id //组装前端传递参数
};
let connect = this._api.getApi({
sendData: sendData,
apiUrl: XXX,
type: 'form'
});
connect.then(res => {
if(res.data){
layer.msg('删除成功');
layer.close(index);
this.getCardList();
}
});
});
}
网友评论