|
@@ -4,7 +4,8 @@ import {RegService} from '../../service/reg.service';
|
|
|
import {ModalService, ToastService} from 'ng-zorro-antd-mobile';
|
|
|
import {ConfigService} from '../../service/config.service';
|
|
|
import {ICompany, IPrize, IUser} from '../../model';
|
|
|
-import {Router} from '@angular/router';
|
|
|
+import {ActivatedRoute, Router} from '@angular/router';
|
|
|
+import {PostMsgService} from '../../service/post-msg.service';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-share-invite',
|
|
@@ -26,7 +27,9 @@ export class ShareInviteComponent implements OnInit {
|
|
|
private toast: ToastService,
|
|
|
public config: ConfigService,
|
|
|
private modal: ModalService,
|
|
|
- private router: Router
|
|
|
+ private router: Router,
|
|
|
+ public postMsgService: PostMsgService,
|
|
|
+ private activatedRoute: ActivatedRoute
|
|
|
) {
|
|
|
}
|
|
|
|
|
@@ -50,11 +53,12 @@ export class ShareInviteComponent implements OnInit {
|
|
|
|
|
|
// 申请企业列表
|
|
|
getList() {
|
|
|
- if (this.userInfo) {
|
|
|
+ const campaignId = localStorage.getItem('campaignId');
|
|
|
+ if (this.userInfo && campaignId) {
|
|
|
this.http.get(this.http.apis.findPageByParticipant, {
|
|
|
data: {
|
|
|
- campaignId: this.config.campaignId,
|
|
|
- participantId: this.userInfo?.participantId,
|
|
|
+ campaignId: campaignId,
|
|
|
+ participantId: this.userInfo.participantId,
|
|
|
status: '2'
|
|
|
},
|
|
|
success: (res: any) => {
|
|
@@ -70,16 +74,22 @@ export class ShareInviteComponent implements OnInit {
|
|
|
|
|
|
// 获取活动奖品列表
|
|
|
getProductList(total: number) {
|
|
|
- this.http.get(this.http.apis.productPage, {
|
|
|
- data: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 20,
|
|
|
- campaignId: this.config.campaignId
|
|
|
- },
|
|
|
- success: (res: any) => {
|
|
|
- this.prizeList = res.records.filter((item: IPrize) => item.meetCnt <= total).sort((a: any, b: any) => a.meetCnt - b.meetCnt);
|
|
|
+ setTimeout(() => {
|
|
|
+ const campaignId = localStorage.getItem('campaignId');
|
|
|
+ if (campaignId) {
|
|
|
+ this.http.get(this.http.apis.productPage, {
|
|
|
+ data: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ campaignId: campaignId
|
|
|
+ },
|
|
|
+ success: (res: any) => {
|
|
|
+ this.prizeList = res.records.filter((item: IPrize) => item.meetCnt <= total).sort((a: any, b: any) => a.meetCnt - b.meetCnt);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ }, 500);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
exit() {
|
|
@@ -94,4 +104,8 @@ export class ShareInviteComponent implements OnInit {
|
|
|
}
|
|
|
]);
|
|
|
}
|
|
|
+
|
|
|
+ share(type: string) {
|
|
|
+ this.postMsgService.share(type);
|
|
|
+ }
|
|
|
}
|