Commit f93ab19e by Chao Sun

添加百度统计和token

parent dacf3870
...@@ -58,15 +58,19 @@ export class CommonService { ...@@ -58,15 +58,19 @@ export class CommonService {
return this.http.post(url, JSON.stringify(ticketObj), this.httpOptions).toPromise(); return this.http.post(url, JSON.stringify(ticketObj), this.httpOptions).toPromise();
} }
provinceqry(objParam){ async provinceqry(objParam){
const url = this.USER_API_URL + '/partner/provinceqry'; const url = this.USER_API_URL + '/partner/provinceqry';
const res = await this.obtainToken();
this.httpOptions.headers = this.httpOptions.headers.set('X-Authorization', res['data']['token']);
return this.http.post(url,JSON.stringify(objParam),this.httpOptions).pipe(res => { return this.http.post(url,JSON.stringify(objParam),this.httpOptions).pipe(res => {
return res; return res;
}) })
} }
getCityqry(objParam){ async getCityqry(objParam){
const url = this.USER_API_URL + '/partner/cityqry'; const url = this.USER_API_URL + '/partner/cityqry';
const res = await this.obtainToken();
this.httpOptions.headers = this.httpOptions.headers.set('X-Authorization', res['data']['token']);
return this.http return this.http
.post(url,JSON.stringify(objParam),this.httpOptions) .post(url,JSON.stringify(objParam),this.httpOptions)
.pipe(res => { .pipe(res => {
......
...@@ -75,65 +75,64 @@ export class Page3Component implements OnInit { ...@@ -75,65 +75,64 @@ export class Page3Component implements OnInit {
} }
addChild() { addChild() {
this.addChildCount-- // this.addChildCount--
if (this.addChildCount >= 0) { // if (this.addChildCount >= 0) {
this.curPageData['questions'][this.curQuesLen++] = { // this.curPageData['questions'][this.curQuesLen++] = {
questionId: 4, // questionId: 4,
questionName: `孩子${this.addChildCount == 1 ? '1' : '2'}年龄`, // questionName: `孩子${this.addChildCount == 1 ? '1' : '2'}年龄`,
optionType: 1, // optionType: 1,
questionOrder: 4, // questionOrder: 4,
options: [ // options: [
{ // {
optionId: 22, // optionId: 22,
optionName: '95后', // optionName: '95后',
optionOrder: 1, // optionOrder: 1,
customerInput: null // customerInput: null
}, // },
{ // {
optionId: 23, // optionId: 23,
optionName: '90后', // optionName: '90后',
optionOrder: 2, // optionOrder: 2,
customerInput: null // customerInput: null
}, // },
{ // {
optionId: 24, // optionId: 24,
optionName: '85后', // optionName: '85后',
optionOrder: 3, // optionOrder: 3,
customerInput: null // customerInput: null
}, // },
{ // {
optionId: 25, // optionId: 25,
optionName: '80后', // optionName: '80后',
optionOrder: 4, // optionOrder: 4,
customerInput: null // customerInput: null
}, // },
{ // {
optionId: 26, // optionId: 26,
optionName: '75后', // optionName: '75后',
optionOrder: 5, // optionOrder: 5,
customerInput: null // customerInput: null
}, // },
{ // {
optionId: 27, // optionId: 27,
optionName: '70后', // optionName: '70后',
optionOrder: 6, // optionOrder: 6,
customerInput: null // customerInput: null
}, // },
{ // {
optionId: 28, // optionId: 28,
optionName: '65后', // optionName: '65后',
optionOrder: 7, // optionOrder: 7,
customerInput: null // customerInput: null
}, // },
{ // {
optionId: 29, // optionId: 29,
optionName: '60后', // optionName: '60后',
optionOrder: 8, // optionOrder: 8,
customerInput: null // customerInput: null
} // }
] // ]
} // }
} // }
// console.log(this.curPageData['questions'])
} }
} }
...@@ -10,4 +10,13 @@ ...@@ -10,4 +10,13 @@
<body> <body>
<app-root></app-root> <app-root></app-root>
</body> </body>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?36b1eb7eec3b5dac9f97d887092b5b27";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</html> </html>
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