This commit is contained in:
Taric Xin
2021-12-16 19:40:21 +08:00
parent 0084570fd8
commit 75c541d74b
20 changed files with 567 additions and 197 deletions

View File

@ -61,14 +61,17 @@ export class UserCenterComponentsDriverComponent implements OnInit {
return false;
}
if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) {
this.service.msgSrv.error('手机格式错误');
return false;
}
this.service.request(this.service.$api_add_salesman, { ids: [item.id], salesmanMobile: this.promotersTelephone }).subscribe(res => {
if (res) {
this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功');
}
this.st.load();
});
this.service
.request(this.service.$api_add_user_salesman, { userId: item.userId, mobile: this.promotersTelephone })
.subscribe(res => {
if (res) {
this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功');
}
this.st.load();
});
return;
}
});