Commit 1446374f by Chao Sun

海报详情跳转bug修复

parent 5af53ab5
<!--The content below is only a placeholder and can be replaced.--> <!--The content below is only a placeholder and can be replaced.-->
<router-outlet></router-outlet> <router-outlet></router-outlet>
<ydlife-guide-page *ngIf="shareGuidePageEnable"></ydlife-guide-page> <ydlife-guide-page *ngIf="shareGuidePageEnable"></ydlife-guide-page>
<ydlife-alert *ngIf="isNeedAlert" [dialogInfo]="dialogInfo" (popInfo)="getPopInfo()"></ydlife-alert>
\ No newline at end of file
import {Component, OnDestroy, OnInit} from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import {AuthService} from "./auth/auth.service"; import { AuthService } from "./auth/auth.service";
import {LifeCommonService} from "./common/life-common.service"; import { LifeCommonService } from "./common/life-common.service";
import {Subscription} from "rxjs/index"; import { Subscription } from "rxjs/index";
declare var wx: any; declare var wx: any;
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
...@@ -11,6 +11,9 @@ declare var wx: any; ...@@ -11,6 +11,9 @@ declare var wx: any;
export class AppComponent implements OnInit, OnDestroy { export class AppComponent implements OnInit, OnDestroy {
shareGuidePageEnable: boolean; shareGuidePageEnable: boolean;
subscription: Subscription; subscription: Subscription;
currentVersion: any;
isNeedAlert: boolean;
dialogInfo: any;
constructor(private authService: AuthService, private lifeCommonService: LifeCommonService) { constructor(private authService: AuthService, private lifeCommonService: LifeCommonService) {
this.subscription = lifeCommonService.shareStatus$.subscribe(status => { this.subscription = lifeCommonService.shareStatus$.subscribe(status => {
...@@ -25,6 +28,8 @@ export class AppComponent implements OnInit, OnDestroy { ...@@ -25,6 +28,8 @@ export class AppComponent implements OnInit, OnDestroy {
this.getWxConfig(); this.getWxConfig();
} }
}); });
this.getVersion();
} }
ngOnDestroy() { ngOnDestroy() {
...@@ -48,4 +53,40 @@ export class AppComponent implements OnInit, OnDestroy { ...@@ -48,4 +53,40 @@ export class AppComponent implements OnInit, OnDestroy {
}); });
} }
// 关闭弹窗
getPopInfo() {
this.isNeedAlert = false;
let { search, href } = window.location;
href = href.replace(/&?t_reload=(\d+)/g, '');
window.location.href = href + (search ? '&' : '?') + 't_reload=' + new Date().getTime();
localStorage.setItem('Version', this.currentVersion)
}
getVersion() {
this.authService.currentVersionQuery().subscribe((res) => {
if (res['data']['currentVersion']) {
this.currentVersion = res['data']['currentVersion'];
}
//如果本地没有版本号刷新并设置缓存
if (!localStorage.getItem('Version')) {
this.isNeedAlert = true;
this.dialogInfo = {
title: null,
content: { value: '检测到新版本', align: 'center' },
footer: [{ value: '更新', routerLink: '', className: 'weui-dialog__btn_primary' }],
};
} else {
const Version = localStorage.getItem('Version');
//如果缓存有版本号对比本地和接口版本
if (Version != this.currentVersion) {
this.isNeedAlert = true;
this.dialogInfo = {
title: null,
content: { value: '检测到新版本', align: 'center' },
footer: [{ value: '更新', routerLink: '', className: 'weui-dialog__btn_primary' }],
};
}
}
})
}
} }
import {Injectable}from '@angular/core'; import { Injectable } from '@angular/core';
import { import {
CanActivate, Router, CanActivate, Router,
ActivatedRouteSnapshot, ActivatedRouteSnapshot,
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
NavigationExtras, NavigationExtras,
CanLoad, Route CanLoad, Route
} from '@angular/router'; } from '@angular/router';
import {AuthService}from './auth.service'; import { AuthService } from './auth.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
...@@ -18,7 +18,6 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad { ...@@ -18,7 +18,6 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad {
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
let url: string = state.url; let url: string = state.url;
return this.checkLogin(url); return this.checkLogin(url);
} }
...@@ -28,7 +27,6 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad { ...@@ -28,7 +27,6 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad {
canLoad(route: Route): boolean { canLoad(route: Route): boolean {
let url = `/${route.path}`; let url = `/${route.path}`;
return this.checkLogin(url); return this.checkLogin(url);
} }
...@@ -43,4 +41,5 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad { ...@@ -43,4 +41,5 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad {
this.router.navigate(['/login']); this.router.navigate(['/login']);
return false; return false;
} }
} }
import {Injectable} from '@angular/core'; import { Injectable } from '@angular/core';
import {Observable, of, throwError} from 'rxjs'; import { Observable, of, throwError } from 'rxjs';
import {environment} from '../../environments/environment'; import { environment } from '../../environments/environment';
import {HttpClient, HttpErrorResponse} from '@angular/common/http'; import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import {catchError} from 'rxjs/internal/operators'; import { catchError } from 'rxjs/internal/operators';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
...@@ -14,22 +14,22 @@ export class AuthService { ...@@ -14,22 +14,22 @@ export class AuthService {
private API = environment.BACKEND_URL_CONFIG_VALUE; private API = environment.BACKEND_URL_CONFIG_VALUE;
isLoggedIn = false; isLoggedIn = false;
// store the URL so we can redirect after logging in // store the URL so we can redirect after logging in
redirectUrl: string; redirectUrl: string;
// 经纪人登陆 // 经纪人登陆
login(loginInfo): Observable<any> { login(loginInfo): Observable<any> {
const api = this.API + '/practitioner/practitionerLogin'; const api = this.API + '/practitioner/practitionerLogin';
return this.http.post(api, JSON.stringify(loginInfo)); return this.http.post(api, JSON.stringify(loginInfo));
} }
// 发送验证码 // 发送验证码
verificationCode(verticalCode) { verificationCode(verticalCode) {
const url = this.API + '/verificationCode'; const url = this.API + '/verificationCode';
return this.http return this.http
.post(url, JSON.stringify(verticalCode)); .post(url, JSON.stringify(verticalCode));
} }
// 校验验证码 // 校验验证码
compare(compareCode) { compare(compareCode) {
const url = this.API + '/checkVerificationCode'; const url = this.API + '/checkVerificationCode';
return this.http return this.http
...@@ -58,7 +58,7 @@ export class AuthService { ...@@ -58,7 +58,7 @@ export class AuthService {
return this.http.post(url, JSON.stringify(postUrl)); return this.http.post(url, JSON.stringify(postUrl));
} }
// 获取错误详情 // 获取错误详情
private handleError(error: HttpErrorResponse) { private handleError(error: HttpErrorResponse) {
if (error.error instanceof ErrorEvent) { if (error.error instanceof ErrorEvent) {
console.error('An error occurred:', error.error.message); console.error('An error occurred:', error.error.message);
...@@ -70,4 +70,9 @@ export class AuthService { ...@@ -70,4 +70,9 @@ export class AuthService {
return throwError( return throwError(
'Something bad happened; please try again later.'); 'Something bad happened; please try again later.');
} }
currentVersionQuery() {
const url = this.API + '/metadata/currentVersionQuery';
return this.http.get(url);
}
} }
...@@ -2,16 +2,17 @@ ...@@ -2,16 +2,17 @@
<!--BEGIN dialog1--> <!--BEGIN dialog1-->
<div class="js_dialog" id="iosDialog1"> <div class="js_dialog" id="iosDialog1">
<div class="weui-mask"></div> <div class="weui-mask"></div>
<div class="weui-dialog"> <div class="weui-dialog" style="width: 70%;">
<div class="weui-dialog__hd" *ngIf="dialogInfo.title"><strong <div class="weui-dialog__hd" *ngIf="dialogInfo.title"><strong
class="weui-dialog__title">{{dialogInfo.title}}</strong></div> class="weui-dialog__title">{{dialogInfo.title}}</strong></div>
<div class="weui-dialog__bd" [ngStyle]="{'text-align':dialogInfo.content.align}">{{dialogInfo.content.value}} <div class="weui-dialog__bd" [ngStyle]="{'text-align':dialogInfo.content.align}">{{dialogInfo.content.value}}
</div> </div>
<div class="weui-dialog__ft"> <div class="weui-dialog__ft" style="line-height: normal;min-height: auto;width: 30%;margin: 0 auto 10px auto;">
<a href="javascript:;" class="weui-dialog__btn" [ngClass]="footer.className" <a href="javascript:;" class="weui-dialog__btn" [ngClass]="footer.className"
*ngFor="let footer of dialogInfo.footer" (click)="sendInfo()">{{footer.value}}</a> style="width: 75%;background: red;color: #fff;border-radius: 10px;padding:5px 10px;font-weight: normal;"
*ngFor="let footer of dialogInfo.footer" (click)="sendInfo()">{{footer.value}}</a>
</div> </div>
</div> </div>
</div> </div>
<!--END dialog1--> <!--END dialog1-->
</div> </div>
\ No newline at end of file
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
class="announcement_type">【{{announcementLists?.announcementTypeName}}】</span><span class="announcement_type">【{{announcementLists?.announcementTypeName}}】</span><span
[innerHtml]="announcementLists?.title |safeHtml"></span></div> [innerHtml]="announcementLists?.title |safeHtml"></span></div>
<div [innerHtml]="announcementLists?.content | safeHtml" class="announcement_content"></div> <div [innerHtml]="announcementLists?.content | safeHtml" class="announcement_content"></div>
<div class="announcement_at">上海银盾保险经纪有限公司 &nbsp;&nbsp;{{announcementLists?.announcementAt}}</div> <!-- <div class="announcement_at">上海银盾保险经纪有限公司 &nbsp;&nbsp;{{announcementLists?.announcementAt}}</div> -->
</div> </div>
</div> </div>
\ No newline at end of file
<div class="fileUploadLists"> <div class="fileUploadLists">
<ul class="left"> <div class="nav">
<li *ngFor="let categoryItem of categoryList" (click)="switchCategory(categoryItem.dropOptionOrder)" <ul class="left">
[ngClass]="{'actived':selectedCategoryId===categoryItem.dropOptionOrder}"> <li *ngFor="let categoryItem of categoryList" (click)="switchCategory(categoryItem.id)"
{{categoryItem.dropOptionName}} [ngClass]="{'actived':selectedCategoryId===categoryItem.id}">
</li> {{categoryItem.dropOptionName}}
</ul> </li>
</ul>
</div>
<div class="contentList"> <div class="contentList">
<ul> <ul>
<li *ngFor="let fileUploadItem of fileUploadItemList"> <li *ngFor="let fileUploadItem of fileUploadItemList">
......
...@@ -3,48 +3,41 @@ ...@@ -3,48 +3,41 @@
ul { ul {
list-style: none; list-style: none;
} }
.left{ .nav{
display: flex; overflow: hidden;
padding: 10px 2px; width: 100%;
// border-bottom: 3px #3784ca solid; overflow-x: auto;
background: #f0f0f0; .left{
margin-bottom: 10px; padding: 10px 2px;
li{ background: #f0f0f0;
width: 19%; margin-bottom: 10px;
border: 1px #a9aabb solid; float: left;
text-align: center; width: 120%;
font-size: 14px;
height: 30px; height: 30px;
line-height: 30px; overflow: hidden;
border-radius: 20px; overflow-x: auto;
margin: 0px 2px; list-style: none;
} li{
li.actived{ border: 1px #a9aabb solid;
background-color: #ff5a32; text-align: center;
color: #fff; font-size: 14px;
border: 1px #f0f0f0 solid; height: 30px;
line-height: 30px;
border-radius: 20px;
margin: 0px 2px;
float: left;
width: 15.2%;
}
li.actived{
background-color: #ff5a32;
color: #fff;
border: 1px #f0f0f0 solid;
}
} }
// li:before {
// content: "";
// display: block;
// position: absolute;
// left: 22px;
// top: 42px;
// width: 60%;
// height: 1px;
// background: hsla(0,0%,86%,.4);
// }
// li.actived:after {
// content: "";
// position: absolute;
// left: 0;
// top: 0;
// width: 6px;
// height: 100%;
// font-size: 0;
// background-color: #ec2d37;
// }
} }
.nav::-webkit-scrollbar{
opacity: 0;
}
.contentList{ .contentList{
background-color: #fff; background-color: #fff;
-webkit-box-flex: 1; -webkit-box-flex: 1;
......
import {Component, OnInit} from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {LifeCommonService} from "../../common/life-common.service"; import { LifeCommonService } from "../../common/life-common.service";
import {MyService} from "../my.service"; import { MyService } from "../my.service";
import {ActivatedRoute} from "@angular/router"; import { ActivatedRoute } from "@angular/router";
@Component({ @Component({
selector: 'ydlife-file-upload', selector: 'ydlife-file-upload',
...@@ -12,8 +12,8 @@ export class FileUploadComponent implements OnInit { ...@@ -12,8 +12,8 @@ export class FileUploadComponent implements OnInit {
fileUploadItemList: Array<any>; fileUploadItemList: Array<any>;
// 判断是文件下载还是教育培训 // 判断是文件下载还是教育培训
type: string; type: string;
categoryList:Array<any>; categoryList: Array<any>;
selectedCategoryId:number; selectedCategoryId: number;
constructor(private myService: MyService, private activatedRoute: ActivatedRoute) { constructor(private myService: MyService, private activatedRoute: ActivatedRoute) {
} }
...@@ -21,16 +21,16 @@ export class FileUploadComponent implements OnInit { ...@@ -21,16 +21,16 @@ export class FileUploadComponent implements OnInit {
this.type = this.activatedRoute.snapshot.data[0]['type']; this.type = this.activatedRoute.snapshot.data[0]['type'];
this.dropOptionsQuery(); this.dropOptionsQuery();
if (this.type === 'fileUpload') { if (this.type === 'fileUpload') {
this.fileUpload(3,0, 19,'yd_download_file_type',this.selectedCategoryId); this.fileUpload(3, 0, 19, 'yd_download_file_type', this.selectedCategoryId);
} else if (this.type === 'training') { } else if (this.type === 'training') {
this.fileUpload(3, 0, 23,'yd_trainning_file_type',this.selectedCategoryId); this.fileUpload(3, 0, 23, 'yd_trainning_file_type', this.selectedCategoryId);
} }
} }
// 文件下载 // 文件下载
fileUpload(itemType, itemId, fileCategory,code,mdDropOptionId) { fileUpload(itemType, itemId, fileCategory, code, mdDropOptionId) {
this.myService.filePath(itemType, itemId, fileCategory,code,mdDropOptionId).subscribe(res => { this.myService.filePath(itemType, itemId, fileCategory, code, mdDropOptionId).subscribe(res => {
if (res['success']) { if (res['success']) {
this.fileUploadItemList = res['data']['fileUploadItemList']; this.fileUploadItemList = res['data']['fileUploadItemList'];
} }
...@@ -39,26 +39,26 @@ export class FileUploadComponent implements OnInit { ...@@ -39,26 +39,26 @@ export class FileUploadComponent implements OnInit {
//培训资料分类 //培训资料分类
dropOptionsQuery() { dropOptionsQuery() {
const code = this.type === 'fileUpload'?'yd_download_file_type':'yd_trainning_file_type' const code = this.type === 'fileUpload' ? 'yd_download_file_type' : 'yd_trainning_file_type'
this.myService.dropOptionsQuery({ code: code }).subscribe(res => { this.myService.dropOptionsQuery({ code: code }).subscribe(res => {
if (res['success']) { if (res['success']) {
this.categoryList = res['data']['dropMasterInfoList'][0]['dropOptionsInfoList']; this.categoryList = res['data']['dropMasterInfoList'][0]['dropOptionsInfoList'];
if (this.categoryList.length > 0) { if (this.categoryList.length > 0) {
this.selectedCategoryId = this.categoryList[0].dropOptionOrder; this.selectedCategoryId = this.categoryList[0].id;
this.switchCategory(this.selectedCategoryId) this.switchCategory(this.selectedCategoryId)
} }
}else{ } else {
this.categoryList = []; this.categoryList = [];
} }
}) })
} }
switchCategory(e){ switchCategory(e) {
this.selectedCategoryId = e; this.selectedCategoryId = e;
if (this.type === 'fileUpload') { if (this.type === 'fileUpload') {
this.fileUpload(3,0, 19,'yd_download_file_type',this.selectedCategoryId); this.fileUpload(3, 0, 19, 'yd_download_file_type', this.selectedCategoryId);
} else if (this.type === 'training') { } else if (this.type === 'training') {
this.fileUpload(3, 0, 23,'yd_trainning_file_type',this.selectedCategoryId); this.fileUpload(3, 0, 23, 'yd_trainning_file_type', this.selectedCategoryId);
} }
} }
} }
<ul class="left"> <div class="nav">
<li *ngFor="let categoryItem of importantAnnouncementLists" (click)="switchCategory(categoryItem.id)" <ul class="left">
[ngClass]="{'actived':selectedCategoryId===categoryItem.id}"> <li *ngFor="let categoryItem of importantAnnouncementLists" (click)="switchCategory(categoryItem.id)"
{{categoryItem.dropOptionName}} [ngClass]="{'actived':selectedCategoryId===categoryItem.id}">
</li> {{categoryItem.dropOptionName}}
</ul> </li>
</ul>
</div>
<div #hide class="materialContainer"> <div #hide class="materialContainer">
<div class="materialItem" *ngFor="let announcementInfo of announcementLists;index as i" <div class="materialItem" *ngFor="let announcementInfo of announcementLists;index as i"
[routerLink]="['/importantAnnouncement',announcementInfo.id]"> [routerLink]="['/importantAnnouncement',announcementInfo.id]">
......
.left{ .nav{
display: flex; overflow: hidden;
padding: 10px 2px; width: 100%;
// border-bottom: 3px #3784ca solid; overflow-x: auto;
background: #f0f0f0; .left{
margin-bottom: 10px; padding: 10px 2px;
list-style: none; background: #f0f0f0;
li{ margin-bottom: 10px;
width: 19%; float: left;
border: 1px #a9aabb solid; width: 120%;
text-align: center;
font-size: 14px;
height: 30px; height: 30px;
line-height: 30px; overflow: hidden;
border-radius: 20px; overflow-x: auto;
margin: 0px 2px; list-style: none;
} li{
li.actived{ border: 1px #a9aabb solid;
background-color: #ff5a32; text-align: center;
color: #fff; font-size: 14px;
border: 1px #f0f0f0 solid; height: 30px;
line-height: 30px;
border-radius: 20px;
margin: 0px 2px;
float: left;
width: 15.2%;
}
li.actived{
background-color: #ff5a32;
color: #fff;
border: 1px #f0f0f0 solid;
}
} }
} }
.nav::-webkit-scrollbar{
opacity: 0;
}
.materialContainer{ .materialContainer{
.materialItem{ .materialItem{
padding: 5px 10px; padding: 5px 10px;
......
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import {ActivatedRoute} from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import {environment} from '../../../environments/environment'; import { environment } from '../../../environments/environment';
import {LifeCommonService} from '../../common/life-common.service'; import { LifeCommonService } from '../../common/life-common.service';
import {MyService} from '../my.service'; import { MyService } from '../my.service';
import {Buffer} from 'buffer'; import { Buffer } from 'buffer';
declare var QRCode: any; declare var QRCode: any;
import * as uuid from 'uuid'; import * as uuid from 'uuid';
...@@ -30,17 +30,18 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -30,17 +30,18 @@ export class MkMaterialDetailComponent implements OnInit {
qrcodePadding = 5; qrcodePadding = 5;
rightWidth = 5; rightWidth = 5;
bottomHeight = 5; bottomHeight = 5;
posterType: number;
constructor(private activateRoute: ActivatedRoute, constructor(private activateRoute: ActivatedRoute,
private lifeCommonService: LifeCommonService, private lifeCommonService: LifeCommonService,
private myService: MyService) { private myService: MyService) {
} }
ngOnInit() { ngOnInit() {
this.materialItemId = this.activateRoute.snapshot.paramMap.get('itemId'); this.materialItemId = this.activateRoute.snapshot.paramMap.get('itemId');
this.materialItemType = this.activateRoute.snapshot.queryParams['itemType']; this.materialItemType = this.activateRoute.snapshot.queryParams['itemType'];
this.lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null; this.lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
this.posterQuery(this.materialItemId, this.materialItemType); this.posterType = this.activateRoute.snapshot.queryParams['posterType'];
this.posterQuery(this.posterType, this.materialItemType);
} }
async canvasPic() { async canvasPic() {
...@@ -66,7 +67,7 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -66,7 +67,7 @@ export class MkMaterialDetailComponent implements OnInit {
if (this.lifeCustomerInfo.practitionerBasicInfo.headImagePath) { if (this.lifeCustomerInfo.practitionerBasicInfo.headImagePath) {
avatarImg.src = this.lifeCustomerInfo.practitionerBasicInfo.headImagePath + '?v=' + new Date().getTime(); avatarImg.src = this.lifeCustomerInfo.practitionerBasicInfo.headImagePath + '?v=' + new Date().getTime();
} else { } else {
avatarImg.src = `${environment.ORIGINNAME}/assets/img/meng.png?v=${new Date().getTime()}`; avatarImg.src = `assets/images/meng.png?v=${new Date().getTime()}`;
} }
// 这里的第一张图片就是可以是你们的海报 这里注意绘制的顺序 我们要手动控制 // 这里的第一张图片就是可以是你们的海报 这里注意绘制的顺序 我们要手动控制
img.src = this.productPosterPath; img.src = this.productPosterPath;
...@@ -86,7 +87,12 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -86,7 +87,12 @@ export class MkMaterialDetailComponent implements OnInit {
// 这里的image只能在onload里面绘制 在外面就会被覆盖了 因为优先加载完毕就会优先绘制 然后就被之后绘制的海报背景遮挡了 // 这里的image只能在onload里面绘制 在外面就会被覆盖了 因为优先加载完毕就会优先绘制 然后就被之后绘制的海报背景遮挡了
const shareQr = new Image(); const shareQr = new Image();
// 设置base64编码格式值 // 设置base64编码格式值
shareQr.src = qrcodeUrl;
if (this.materialItemType == '5') {
shareQr.src = `assets/images/online.jpg`
} else {
shareQr.src = qrcodeUrl;
}
shareQr.onload = () => { shareQr.onload = () => {
const qrcodeBgX = document.body.clientWidth - (this.rightWidth + this.qrcodeBgWidth); const qrcodeBgX = document.body.clientWidth - (this.rightWidth + this.qrcodeBgWidth);
const qrcodeBgY = document.body.clientHeight - (this.bottomHeight + this.qrcodeBgWidth); const qrcodeBgY = document.body.clientHeight - (this.bottomHeight + this.qrcodeBgWidth);
...@@ -187,16 +193,17 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -187,16 +193,17 @@ export class MkMaterialDetailComponent implements OnInit {
}); });
} }
// 获取大图 // 获取大图
posterQuery(itemId, itemType) { posterQuery(itemId, itemType) {
this.myService.posterQuery({ this.myService.posterQuery({
id: this.posterType,
paginationInfo: { paginationInfo: {
noLimitFlag: 'CONFIRM' noLimitFlag: 'CONFIRM'
} }
}).subscribe(res => { }).subscribe(res => {
if (res['success']) { if (res['success']) {
const posterInfos = res['data']['posterInfos']; const posterInfos = res['data']['posterInfos'];
const posterInfo = posterInfos.filter(item => item.itemId == itemId && item.itemType == itemType).pop(); const posterInfo = posterInfos.filter(item => item.id == itemId && item.itemType == itemType).pop();
this.productPosterPath = posterInfo.productPosterPath + '?v=' + new Date().getTime(); this.productPosterPath = posterInfo.productPosterPath + '?v=' + new Date().getTime();
// 分享信息 // 分享信息
const shareCodeUuid = uuid.v4(); const shareCodeUuid = uuid.v4();
......
<ul class="left"> <div class='nav'>
<li *ngFor="let categoryItem of categoryList" (click)="switchCategory(categoryItem.dropOptionOrder)" <ul class="left">
[ngClass]="{'actived':selectedCategoryId===categoryItem.dropOptionOrder}"> <li *ngFor="let categoryItem of categoryList" (click)="switchCategory(categoryItem.id)"
{{categoryItem.dropOptionName}} [ngClass]="{'actived':selectedCategoryId===categoryItem.id}">
</li> {{categoryItem.dropOptionName}}
</ul> </li>
</ul>
</div>
<div class="materialContainer"> <div class="materialContainer">
<div class="materialItem" *ngFor="let posterInfo of posterInfos;index as i" <div class="materialItem" *ngFor="let posterInfo of posterInfos;index as i"
[routerLink]="['/material',posterInfo.itemId]" [queryParams]="{itemType:posterInfo.itemType}"> [routerLink]="['/material',posterInfo.itemId]"
[queryParams]="{itemType:posterInfo.itemType,posterType:posterInfo.id}">
<div> <div>
<img src="{{posterInfo.productPosterPath}}" alt="" class="img-responsive"> <img src="{{posterInfo.productPosterPath}}" alt="" class="img-responsive">
</div> </div>
......
.left{ .nav{
display: flex; overflow: hidden;
padding: 10px 2px; width: 100%;
// border-bottom: 3px #3784ca solid; overflow-x: auto;
background: #f0f0f0; .left{
margin-bottom: 10px; padding: 10px 2px;
list-style: none; background: #f0f0f0;
li{ margin-bottom: 10px;
width: 19%; float: left;
border: 1px #a9aabb solid; width: 120%;
text-align: center;
font-size: 14px;
height: 30px; height: 30px;
line-height: 30px; overflow: hidden;
border-radius: 20px; overflow-x: auto;
margin: 0px 2px; list-style: none;
} li{
li.actived{ border: 1px #a9aabb solid;
background-color: #ff5a32; text-align: center;
color: #fff; font-size: 14px;
border: 1px #f0f0f0 solid; height: 30px;
line-height: 30px;
border-radius: 20px;
margin: 0px 2px;
float: left;
width: 15.2%;
}
li.actived{
background-color: #ff5a32;
color: #fff;
border: 1px #f0f0f0 solid;
}
} }
} }
.nav::-webkit-scrollbar{
opacity: 0;
}
.materialContainer { .materialContainer {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
......
import {Component, OnInit} from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {Router} from "@angular/router"; import { Router } from "@angular/router";
import {MyService} from "../my.service"; import { MyService } from "../my.service";
@Component({ @Component({
selector: 'ydlife-mk-material', selector: 'ydlife-mk-material',
...@@ -9,8 +9,8 @@ import {MyService} from "../my.service"; ...@@ -9,8 +9,8 @@ import {MyService} from "../my.service";
}) })
export class MkMaterialComponent implements OnInit { export class MkMaterialComponent implements OnInit {
posterInfos: Array<any>; posterInfos: Array<any>;
categoryList:Array<any>; categoryList: Array<any>;
selectedCategoryId:number; selectedCategoryId: number;
constructor(private router: Router, private myService: MyService) { constructor(private router: Router, private myService: MyService) {
} }
...@@ -21,8 +21,8 @@ export class MkMaterialComponent implements OnInit { ...@@ -21,8 +21,8 @@ export class MkMaterialComponent implements OnInit {
posterQuery() { posterQuery() {
const param = { const param = {
mdDropOptionId:this.selectedCategoryId, mdDropOptionId: this.selectedCategoryId,
paginationInfo: {noLimitFlag: 'CONFIRM'} paginationInfo: { noLimitFlag: 'CONFIRM' }
} }
this.myService.posterQuery(param).subscribe(res => { this.myService.posterQuery(param).subscribe(res => {
if (res['success']) { if (res['success']) {
...@@ -33,20 +33,20 @@ export class MkMaterialComponent implements OnInit { ...@@ -33,20 +33,20 @@ export class MkMaterialComponent implements OnInit {
//海报分类 //海报分类
dropOptionsQuery() { dropOptionsQuery() {
this.myService.dropOptionsQuery({ code: 'yd_productbill_file_type'}).subscribe(res => { this.myService.dropOptionsQuery({ code: 'yd_productbill_file_type' }).subscribe(res => {
if (res['success']) { if (res['success']) {
this.categoryList = res['data']['dropMasterInfoList'][0]['dropOptionsInfoList']; this.categoryList = res['data']['dropMasterInfoList'][0]['dropOptionsInfoList'];
if (this.categoryList.length > 0) { if (this.categoryList.length > 0) {
this.selectedCategoryId = this.categoryList[0].dropOptionOrder; this.selectedCategoryId = this.categoryList[0].id;
this.posterQuery(); this.posterQuery();
} }
}else{ } else {
this.categoryList = []; this.categoryList = [];
} }
}) })
} }
switchCategory(e){ switchCategory(e) {
this.selectedCategoryId = e; this.selectedCategoryId = e;
this.posterQuery(); this.posterQuery();
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
display: flex; display: flex;
-webkit-box-align: center; -webkit-box-align: center;
align-items: center; align-items: center;
padding: 15px 0 15px 21px; padding: 10px 0 10px 21px;
width: 100%; width: 100%;
color: #fff; color: #fff;
background: linear-gradient(90deg, #494949, #393939); background: linear-gradient(90deg, #494949, #393939);
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
border-radius: 6px; border-radius: 6px;
} }
.brokerTag { .brokerTag {
margin-top: 10px; // margin-top: 10px;
display: flex; display: flex;
font-weight: normal; font-weight: normal;
font-size: 14px; font-size: 14px;
......
...@@ -47,17 +47,17 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit { ...@@ -47,17 +47,17 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
{ {
title: '营销工具', title: '营销工具',
content: [ content: [
{ no: 2, subtitle: 'AI咨询', icon: 'icon-ai', path: `https://${window.location.host}/questionnaire/#/index?campaign=AIRobot&task=AItask1`, routerLink: '' }, { no: 2, subtitle: 'AI保险医生', icon: 'icon-ai', path: `https://${window.location.host}/questionnaire/#/index?campaign=AIRobot&task=AItask1&customerId=${this.lifeCustomerInfo.customerId}`, routerLink: '' },
{ no: 1, subtitle: '獴哥咨询', icon: 'icon-btnconsult', path: `https://${window.location.host}/consulting`, routerLink: '' }, { no: 1, subtitle: '獴哥保险诊所', icon: 'icon-btnconsult', path: `https://${window.location.host}/consulting`, routerLink: '' },
{ no: 3, subtitle: '产品海报', icon: 'icon-wenjian', path: '', routerLink: 'material' }, { no: 4, subtitle: '银盾在线', icon: 'icon-zaixian', path: `https://${window.location.host}/index`, routerLink: '' },
{ no: 4, subtitle: '银盾在线', icon: 'icon-zaixian', path: `https://${window.location.host}/index`, routerLink: '' } { no: 12, subtitle: '我的保单', icon: 'icon-dailishangshenqing', path: '', routerLink: '' }
] ]
}, { }, {
title: '教育培训', title: '教育培训',
content: [ content: [
{ no: 5, subtitle: '保险ABC', icon: 'icon-xueshimao', path: `https://${window.location.host}/issue`, routerLink: '' }, { no: 5, subtitle: '保险ABC', icon: 'icon-xueshimao', path: `https://${window.location.host}/issue`, routerLink: '' },
{ no: 6, subtitle: '培训课件', icon: 'icon-jiaoyu', path: '', routerLink: 'training' }, { no: 6, subtitle: '培训课件', icon: 'icon-jiaoyu', path: '', routerLink: 'training' },
{ no: 7, subtitle: '文章分享', icon: 'icon-zhuanfaxian', path: `https://${window.location.host}/discovery`, routerLink: '' }, { no: 11, subtitle: '文件下载', icon: 'icon-xiazai1', path: 'https://www.ydinsurance.cn/?page_id=13957', routerLink: 'fileUpload' },
{ no: 8, subtitle: '', icon: '', path: '', routerLink: '' } { no: 8, subtitle: '', icon: '', path: '', routerLink: '' }
] ]
...@@ -66,8 +66,8 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit { ...@@ -66,8 +66,8 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
content: [ content: [
{ no: 9, subtitle: '执业分享', icon: 'icon-shenfenzheng', path: `https://${window.location.host}/brokerQry/#/brokerDetail/${this.lifeCustomerInfo.practitionerId}`, routerLink: '' }, { no: 9, subtitle: '执业分享', icon: 'icon-shenfenzheng', path: `https://${window.location.host}/brokerQry/#/brokerDetail/${this.lifeCustomerInfo.practitionerId}`, routerLink: '' },
{ no: 10, subtitle: '职业类别', icon: 'icon-zhiyeleibie', path: 'https://www.ydinsurance.cn/occupationQry/', routerLink: '' }, { no: 10, subtitle: '职业类别', icon: 'icon-zhiyeleibie', path: 'https://www.ydinsurance.cn/occupationQry/', routerLink: '' },
{ no: 11, subtitle: '文件下载', icon: 'icon-xiazai1', path: 'https://www.ydinsurance.cn/?page_id=13957', routerLink: 'fileUpload' }, { no: 7, subtitle: '文章分享', icon: 'icon-zhuanfaxian', path: `https://${window.location.host}/discovery`, routerLink: '' },
{ no: 12, subtitle: '', icon: '', path: '', routerLink: '' } { no: 3, subtitle: '产品海报', icon: 'icon-wenjian', path: '/salesDetail', routerLink: 'material' },
] ]
} }
...@@ -96,6 +96,9 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit { ...@@ -96,6 +96,9 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
// else if (item.no === 9) { // else if (item.no === 9) {
// this.shareIdCard(); // this.shareIdCard();
// } // }
else if (item.no === 12) {
this.router.navigate(['/salesDetail'], { queryParams: { type: this.performanceSelectedFlag } });
}
else { else {
this.isNeedAlert = true; this.isNeedAlert = true;
this.dialogInfo = { this.dialogInfo = {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div>投保人:{{salesDetailItem.holderName}}</div> <div>投保人:{{salesDetailItem.holderName}}</div>
<div class="price">¥{{salesDetailItem.referralAmount | number: "1.2-2"}}</div> <div class="price">¥{{salesDetailItem.referralAmount | number: "1.2-2"}}</div>
</div> </div>
<div class="line long_line">产品名称:{{salesDetailItem.productName}}</div> <div class="line long_line">{{salesDetailItem.productName}}</div>
<div class="line long_line"> <div class="line long_line">
<div>保单号:{{salesDetailItem.policyNo}}</div> <div>保单号:{{salesDetailItem.policyNo}}</div>
<div>{{(salesDetailItem.orderDate).substr(0,10)}}</div> <div>{{(salesDetailItem.orderDate).substr(0,10)}}</div>
......
...@@ -13,6 +13,7 @@ html, body { ...@@ -13,6 +13,7 @@ html, body {
overflow-x: hidden; overflow-x: hidden;
overflow-y: scroll; overflow-y: scroll;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
.img-responsive { .img-responsive {
......
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