Commit 5fa46b19 by Chao Sun

打包配置修改

parent 44e6aacc
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"build": { "build": {
"builder": "@angular-devkit/build-angular:browser", "builder": "@angular-devkit/build-angular:browser",
"options": { "options": {
"outputPath": "dist/questionnair", "outputPath": "dist/questionnaire",
"index": "src/index.html", "index": "src/index.html",
"main": "src/main.ts", "main": "src/main.ts",
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
"src/styles.css" "src/styles.css"
], ],
"scripts": [], "scripts": [],
"es5BrowserSupport": true "es5BrowserSupport": true,
"baseHref": "/questionnaire/",
"deployUrl": "/questionnaire/"
}, },
"configurations": { "configurations": {
"production": { "production": {
......
...@@ -24,6 +24,7 @@ import { Page15Component } from './page15/page15.component' ...@@ -24,6 +24,7 @@ import { Page15Component } from './page15/page15.component'
import { Page16Component } from './page16/page16.component' import { Page16Component } from './page16/page16.component'
import { Page17Component } from './page17/page17.component' import { Page17Component } from './page17/page17.component'
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
...@@ -47,7 +48,7 @@ import { Page17Component } from './page17/page17.component' ...@@ -47,7 +48,7 @@ import { Page17Component } from './page17/page17.component'
Page17Component Page17Component
], ],
imports: [BrowserModule, AppRoutingModule, HttpClientModule], imports: [BrowserModule, AppRoutingModule, HttpClientModule],
providers: [CommonService, LocalStorage], providers: [CommonService, LocalStorage,{provide: LocationStrategy, useClass: HashLocationStrategy}],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule {} export class AppModule {}
...@@ -105,6 +105,7 @@ export class AskComponent implements OnInit { ...@@ -105,6 +105,7 @@ export class AskComponent implements OnInit {
this.curPage = 0 this.curPage = 0
return return
} }
const answerParam = { const answerParam = {
survey: { survey: {
customerId: this.commonService.getQueryString('customerId'), customerId: this.commonService.getQueryString('customerId'),
...@@ -117,7 +118,6 @@ export class AskComponent implements OnInit { ...@@ -117,7 +118,6 @@ export class AskComponent implements OnInit {
// console.log(res) // console.log(res)
}) })
} }
// console.log(this.nextBtn)
} }
getAllAnswer(e) { getAllAnswer(e) {
this.allAnswers[this.curPage] = e this.allAnswers[this.curPage] = e
...@@ -138,21 +138,9 @@ export class AskComponent implements OnInit { ...@@ -138,21 +138,9 @@ export class AskComponent implements OnInit {
} }
setCurPageData() { setCurPageData() {
// console.log(this.allAnswers) // console.log(this.allAnswers)
if (this.curPage < 16) {
//判断当前页是否有答案
if (
this.curPage == 0 ||
this.allAnswers[this.curPage] ||
this.curPage == 5 ||
this.curPage == 9
) {
this.nextBtn = true;
}else{
this.nextBtn = false;
}
}
const thePateData = this.allQues[this.curPage] const thePateData = this.allQues[this.curPage]
// console.log('thePateData------', this.curPage, thePateData)
this.curPageData = thePateData this.curPageData = thePateData
const page2Answer = this.allAnswers[1] const page2Answer = this.allAnswers[1]
if (this.curPage == 2) { if (this.curPage == 2) {
...@@ -161,6 +149,7 @@ export class AskComponent implements OnInit { ...@@ -161,6 +149,7 @@ export class AskComponent implements OnInit {
thePateData thePateData
) )
} }
//第4页
if (this.curPage == 4) { if (this.curPage == 4) {
this.filterPage5( this.filterPage5(
page2Answer.questions[0].options[0].optionId, page2Answer.questions[0].options[0].optionId,
...@@ -191,6 +180,20 @@ export class AskComponent implements OnInit { ...@@ -191,6 +180,20 @@ export class AskComponent implements OnInit {
this.allQues[this.curPage] this.allQues[this.curPage]
) )
} }
if (this.curPage < 16) {
//判断当前页是否有答案
if (
this.curPage == 0 ||
this.allAnswers[this.curPage] ||
this.curPage == 5 ||
this.curPage == 9
) {
this.nextBtn = true;
}else{
this.nextBtn = false;
}
}
// console.log('thePateData------', this.curPage, thePateData)
} }
filterPage2(optionId, thePateData) { filterPage2(optionId, thePateData) {
......
...@@ -75,12 +75,15 @@ export class CommonService { ...@@ -75,12 +75,15 @@ export class CommonService {
} }
getQueryString(name) { getQueryString(name) {
const gitUrlParam = window.location.search; const after = window.location.hash.split('?')[1];
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); if (after) {
const r = decodeURIComponent(gitUrlParam).substr(1).match(reg); const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
if (r != null) { const r = after.match(reg);
return r[2]; if (r != null) {
return decodeURIComponent(r[2]);
} else {
return null;
}
} }
return null;
} }
} }
...@@ -18,20 +18,21 @@ ...@@ -18,20 +18,21 @@
</div> </div>
</div> </div>
</div> </div>
<div class="toastWrapper toast" *ngIf="isShow"> <div class="toastWrapper toast" *ngIf="isShow" (click)="closeToast();">
<div class="toastContent city">
<div class="live">所在地区</div> </div>
<div class="province"> <div class="toastContent city" *ngIf="isShow">
<span>{{ this.provinceName }}</span> <div class="live">所在地区</div>
</div> <div class="province">
<ul class="city"> <span>{{ this.provinceName }}</span>
<li
*ngFor="let city of this.cityList"
(click)="closeToast(); selectCity(city); getAnswer(city)"
>
{{ city.cityName }}
</li>
</ul>
</div> </div>
<ul class="city">
<li
*ngFor="let city of this.cityList"
(click)="closeToast(); selectCity(city); getAnswer(city)"
>
{{ city.cityName }}
</li>
</ul>
</div> </div>
</div> </div>
...@@ -2,4 +2,7 @@ ...@@ -2,4 +2,7 @@
<div class="title"> <div class="title">
<img src="assets/images/bg_17.png" /> <img src="assets/images/bg_17.png" />
</div> </div>
<div class="footer" style="margin-top: 20%;" (click)="getHref()">
<div>我知道了</div>
</div>
</div> </div>
...@@ -12,4 +12,7 @@ export class Page17Component implements OnInit { ...@@ -12,4 +12,7 @@ export class Page17Component implements OnInit {
ngOnInit() { ngOnInit() {
// console.log(this.curPageData) // console.log(this.curPageData)
} }
getHref(){
window.location.href = 'https://' + window.location.host+ '/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