Commit 1c0fe008 by Sweet Zhang

修改智能AI跳转问题

parent 0590a808
...@@ -31,5 +31,15 @@ export class AppComponent implements OnInit { ...@@ -31,5 +31,15 @@ export class AppComponent implements OnInit {
}; };
sessionStorage.setItem('campaignInfo', JSON.stringify(campaignInfo)); sessionStorage.setItem('campaignInfo', JSON.stringify(campaignInfo));
} }
this.orderQuery(orderId);
}
// 查询是否已经支付成功
orderQuery(orderId) {
this.commonService.orderQuery(orderId).then(res => {
if (res['success']) {
sessionStorage.removeItem('campaignInfo');
}
});
} }
} }
import { Injectable } from '@angular/core'; import {Injectable} from '@angular/core';
import { environment } from './../environments/environment'; import {environment} from './../environments/environment';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import {HttpClient, HttpHeaders} from '@angular/common/http';
import { Subject } from "rxjs/index"; import {Subject} from "rxjs/index";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
...@@ -57,6 +57,20 @@ export class CommonService { ...@@ -57,6 +57,20 @@ export class CommonService {
} }
/** /**
* 查询订单
* @returns {Promise<TResult2|TResult1>}
*/
async orderQuery(orderId) {
const url = this.USER_API_URL + '/orderQuery';
const res = await this.obtainToken();
this.httpOptions.headers = this.httpOptions.headers.set('X-Authorization', res['data']['token']);
return this.http
.post(url, JSON.stringify({orderId: orderId}), this.httpOptions).toPromise().then(response => {
return response;
});
}
/**
* 获取TOKEN * 获取TOKEN
*/ */
obtainToken() { obtainToken() {
......
...@@ -426,4 +426,5 @@ export class LiveComponent implements OnInit { ...@@ -426,4 +426,5 @@ export class LiveComponent implements OnInit {
this.tipsFlag = false; this.tipsFlag = false;
}, 2000) }, 2000)
} }
} }
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CommonService } from '../common.service'; import { CommonService } from '../common.service';
import {environment} from "../../environments/environment";
@Component({ @Component({
selector: 'app-transit3', selector: 'app-transit3',
templateUrl: './transit3.component.html', templateUrl: './transit3.component.html',
...@@ -18,9 +19,9 @@ export class Transit3Component implements OnInit { ...@@ -18,9 +19,9 @@ export class Transit3Component implements OnInit {
getHref() { getHref() {
if (this.activityCode == 'mmh') { if (this.activityCode == 'mmh') {
window.location.href = 'https://' + window.location.host + '/questionnaire/#/specialMmh'; window.location.href = `${environment.hostName}/questionnaire/#/specialMmh`;
} else { } else {
window.location.href = 'https://' + window.location.host + '/member'; window.location.href = `${environment.hostName}/member`;
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment