Commit 5fa46b19 by Chao Sun

打包配置修改

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