Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
王士厅
2024-05-27 11:10:09 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
9002e6ae4039db1e797f5d74e242478dcffa1f13
9002e6ae
2 parents
2693a9c0
2526a39c
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
268 additions
and
240 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card12Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card14Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card15Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card21Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/SearchContentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/utils/searchShowRed.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/ForgetPasswordPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
View file @
9002e6a
...
...
@@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
/**
* 大专题卡--CompStyle: 10
...
...
@@ -21,9 +22,7 @@ export struct Card10Component {
@State loadImg: boolean = false;
@ObjectLink compDTO: CompDTO
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.titleInit();
...
...
@@ -31,12 +30,9 @@ export struct Card10Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -45,10 +41,14 @@ export struct Card10Component {
if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG = 'Card11Component';
...
...
@@ -21,9 +22,7 @@ export struct Card11Component {
@State clicked: boolean = false;
@ObjectLink compDTO: CompDTO
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.titleInit();
...
...
@@ -31,12 +30,9 @@ export struct Card11Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -49,10 +45,14 @@ export struct Card11Component {
}
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card12Component.ets
View file @
9002e6a
...
...
@@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG = 'Card12Component';
...
...
@@ -20,9 +21,7 @@ export struct Card12Component {
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
aboutToAppear(): void {
this.titleInit();
...
...
@@ -30,12 +29,9 @@ export struct Card12Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -48,10 +44,14 @@ export struct Card12Component {
if (this.contentDTO.newsTitle) {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card14Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG = 'Card14Component';
...
...
@@ -22,9 +23,7 @@ export struct Card14Component {
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.titleInit();
...
...
@@ -33,12 +32,9 @@ export struct Card14Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -52,10 +48,14 @@ export struct Card14Component {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card15Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG: string = 'Card15Component';
...
...
@@ -26,9 +27,7 @@ export struct Card15Component {
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.titleInit();
...
...
@@ -37,12 +36,9 @@ export struct Card15Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -53,10 +49,14 @@ export struct Card15Component {
if (this.contentDTO.newsTitle) {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG = 'Card16Component';
...
...
@@ -27,9 +28,7 @@ export struct Card16Component {
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.titleInit();
...
...
@@ -38,12 +37,9 @@ export struct Card16Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -56,10 +52,14 @@ export struct Card16Component {
if (this.contentDTO.newsTitle) {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG = 'Card17Component';
...
...
@@ -22,9 +23,7 @@ export struct Card17Component {
@State clicked: boolean = false;
@ObjectLink compDTO: CompDTO
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
console.log('Card17Component', JSON.stringify(this.contentDTO))
...
...
@@ -34,22 +33,23 @@ export struct Card17Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
Column({ space: 8 }) {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
View file @
9002e6a
...
...
@@ -6,6 +6,7 @@ import { CarderInteraction } from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG = 'Card19Component';
...
...
@@ -20,9 +21,7 @@ export struct Card19Component {
@State contentDTO: ContentDTO = new ContentDTO()
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.titleInit();
...
...
@@ -31,12 +30,9 @@ export struct Card19Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -47,10 +43,14 @@ export struct Card19Component {
if (this.contentDTO.newsTitle) {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle=='null'?"":this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG = 'Card20Component';
...
...
@@ -21,9 +22,7 @@ export struct Card20Component {
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
aboutToAppear(): void {
this.titleInit();
...
...
@@ -31,12 +30,9 @@ export struct Card20Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -48,10 +44,14 @@ export struct Card20Component {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card21Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG: string = 'Card6Component-Card13Component';
...
...
@@ -22,9 +23,7 @@ export struct Card21Component {
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.titleInit();
...
...
@@ -33,12 +32,9 @@ export struct Card21Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -50,10 +46,14 @@ export struct Card21Component {
GridItem() {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
9002e6a
...
...
@@ -8,12 +8,9 @@ import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick';
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG: string = 'Card2Component'
interface textItem {
content: string,
isRed: boolean
}
/**
* 大图卡:
* compstyle:2
...
...
@@ -33,52 +30,17 @@ export struct Card2Component {
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.clicked = hasClicked(this.contentDTO.objectId)
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
// this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
// this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
// this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
const html: string = this.contentDTO.title;
const pattern = /<[a-z]+[1-6]?\b[^>]*>(.*?)<\/[a-z]+[1-6]?>/g;
const res: string[] = [];
let match: RegExpExecArray | null;
while ((match = pattern.exec(html)) !== null) {
const content: string = match[1].trim();
res.push(content);
}
let textArr: textItem[] = [];
this.formatTitle(html, res, 0, textArr);
this.textArr = textArr;
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
formatTitle(textStr: string, matchArr: string[], index: number, textArr: textItem[]) {
const item: string = matchArr[index];
const arr = textStr.split(item);
arr.forEach((str: string, ind: number) => {
if (ind === 0) {
textArr.push({
content: str.replaceAll('<em>', '').replaceAll('</em>', ''),
isRed: false
} as textItem)
textArr.push({
content: item,
isRed: true
})
} else if (ind === 1) {
this.formatTitle(str, matchArr, index + 1, textArr)
}
})
}
build() {
Column() {
...
...
@@ -119,10 +81,6 @@ export struct Card2Component {
Text() {
if (this.titleMarked) {
// Span(this.str01)
// Span(this.str02)
// .fontColor(0xED2800)
// Span(this.str03)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
View file @
9002e6a
...
...
@@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
/**
...
...
@@ -19,9 +20,7 @@ export struct Card3Component {
@State clicked: boolean = false;
@ObjectLink compDTO: CompDTO
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
this.titleInit();
...
...
@@ -29,12 +28,9 @@ export struct Card3Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -47,10 +43,14 @@ export struct Card3Component {
}
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG: string = 'Card4Component';
...
...
@@ -25,9 +26,7 @@ export struct Card4Component {
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
@ObjectLink compDTO: CompDTO
async aboutToAppear(): Promise<void> {
...
...
@@ -37,12 +36,9 @@ export struct Card4Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -57,10 +53,14 @@ export struct Card4Component {
}
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
View file @
9002e6a
...
...
@@ -5,6 +5,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG: string = 'Card5Component';
...
...
@@ -22,9 +23,7 @@ export struct Card5Component {
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
console.log('Card2Component', JSON.stringify(this.compDTO))
...
...
@@ -35,12 +34,9 @@ export struct Card5Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -69,10 +65,14 @@ export struct Card5Component {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
9002e6a
...
...
@@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Logger } from 'wdKit/Index';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG: string = 'Card6Component-Card13Component';
...
...
@@ -21,9 +22,7 @@ export struct Card6Component {
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
@ObjectLink compDTO: CompDTO
@State contentDTO: ContentDTO = new ContentDTO();
...
...
@@ -33,12 +32,9 @@ export struct Card6Component {
this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -70,10 +66,14 @@ export struct Card6Component {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
View file @
9002e6a
...
...
@@ -7,6 +7,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
/**
* 时间链卡--CompStyle: 09
...
...
@@ -22,9 +23,7 @@ export struct Card9Component {
// @State loadImg: boolean = true;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
pageShowTime:number = 0;
pageHideTime:number = 0;
...
...
@@ -48,12 +47,9 @@ export struct Card9Component {
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
}
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -62,10 +58,14 @@ export struct Card9Component {
if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) {
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/SearchContentComponent.ets
View file @
9002e6a
...
...
@@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG: string = 'Card4Component';
...
...
@@ -19,9 +20,7 @@ export struct SearchContentComponent {
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
@State textArr: textItem[] = []
async aboutToAppear(): Promise<void> {
...
...
@@ -30,9 +29,9 @@ export struct SearchContentComponent {
}
titleInit() {
this.str01 = this.contentDTO.contentText?.split('<em>')[0] || '';
this.str02 = this.contentDTO.contentText?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.contentText?.split('<em>')[1].split('</em>')[1] || '';
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
// this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
build() {
...
...
@@ -47,11 +46,15 @@ export struct SearchContentComponent {
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
// 命中内容
Text(this.contentDTO.contentText) {
Span(this.str01)
Span(this.str02)
Text() {
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(textItem.content)
}
})
}
.fontSize(13)
.width(CommonConstants.FULL_PARENT)
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/searchShowRed.ets
0 → 100644
View file @
9002e6a
export interface textItem {
content: string,
isRed: boolean
}
export interface titleInitRes {
titleMarked: boolean,
textArr: textItem[]
}
export class SearchShowRed {
// title: this.contentDTO.title
static titleInit(title: string) {
let titleMarked: boolean = false;
let textArr: textItem[] = [];
if (title?.includes('<em>') && title?.includes('</em>')) {
titleMarked = true;
const html: string = title;
const pattern = /<[a-z]+[1-6]?\b[^>]*>(.*?)<\/[a-z]+[1-6]?>/g;
const res: string[] = [];
let match: RegExpExecArray | null;
while ((match = pattern.exec(html)) !== null) {
const content: string = match[1].trim();
res.push(content);
}
SearchShowRed.formatTitle(html, res, 0, textArr);
}
const titleInitRes: titleInitRes = {
titleMarked,
textArr
}
return titleInitRes
}
private static formatTitle(textStr: string, matchArr: string[], index: number, textArr: textItem[]) {
const item: string = matchArr[index];
const arr = textStr.split(item);
arr.forEach((str: string, ind: number) => {
if (ind === 0) {
textArr.push({
content: str.replaceAll('<em>', '').replaceAll('</em>', ''),
isRed: false
} as textItem)
textArr.push({
content: item,
isRed: true
})
} else if (ind === 1) {
SearchShowRed.formatTitle(str, matchArr, index + 1, textArr)
}
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/ForgetPasswordPage.ets
View file @
9002e6a
...
...
@@ -22,7 +22,7 @@ struct ForgetPasswordPage {
@State isSubmit: boolean = false //是否可以提交 默认不可以
loginViewModel: LoginViewModel = new LoginViewModel()
@State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件
phone:string = (router.getParams() as Record<string, number>)['phone'] + "";
//登录 密码登录 填写手机号 点击忘记密码 带过来手机号
@State params:Record<string, number> = router.getParams() as Record<string, number>;
//登录 密码登录 填写手机号 点击忘记密码 带过来手机号
@State pageTitle:string = '找回密码';
@State codeStateSuccess:boolean=false
onCodeSend() {
...
...
@@ -31,6 +31,10 @@ struct ForgetPasswordPage {
}
}
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
...
...
@@ -80,9 +84,14 @@ struct ForgetPasswordPage {
}
aboutToAppear() {
if(StringUtils.isNotEmpty(this.phone) && this.phone.indexOf("****") === -1){
this.phoneContent = this.phone
let phone = ""
if(this.params){
phone = this.params['phone']+ ""
}
if(StringUtils.isNotEmpty(phone) && phone.indexOf("****") === -1){
this.phoneContent = phone
}
}
//发送验证码
...
...
Please
register
or
login
to post a comment