liyubing

feat(广告): 删除广告功能

... ... @@ -6,6 +6,9 @@
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
"@umeng/analytics@^1.0.19": "@umeng/analytics@1.0.19",
"@umeng/common@^1.0.21": "@umeng/common@1.0.21",
"libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": "libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon",
"wdConstant@../wdConstant": "wdConstant@../wdConstant",
"wdKit@../wdKit": "wdKit@../wdKit"
},
... ... @@ -16,6 +19,26 @@
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
"registryType": "ohpm"
},
"@umeng/analytics@1.0.19": {
"name": "@umeng/analytics",
"integrity": "sha512-0m9z5l8to+POjDl9UkCQC8s4P+e2E1OILwUglC7ME4QwqfH44e59GLJtQdwF0h6kwpsy3YBft4SoWK8MYbuP7g==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@umeng/analytics/-/analytics-1.0.19.har",
"registryType": "ohpm"
},
"@umeng/common@1.0.21": {
"name": "@umeng/common",
"integrity": "sha512-EbXsd4OoRisTQf5egNY/+z1D2bvrYw9VwC2xu3EJA9TiDPSbnaJZ5+yltA/Se6yZ4oCcFvq6e5/AAfPuumunbw==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@umeng/common/-/common-1.0.21.har",
"registryType": "ohpm",
"dependencies": {
"libcommon.so": "./src/main/cpp/types/libcommon"
}
},
"libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": {
"name": "libcommon.so",
"resolved": "../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon",
"registryType": "local"
},
"wdConstant@../wdConstant": {
"name": "wdconstant",
"resolved": "../wdConstant",
... ... @@ -24,7 +47,11 @@
"wdKit@../wdKit": {
"name": "wdkit",
"resolved": "../wdKit",
"registryType": "local"
"registryType": "local",
"dependencies": {
"@umeng/common": "^1.0.21",
"@umeng/analytics": "^1.0.19"
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -103,7 +103,7 @@ export struct CompParser {
ZhSingleColumn09({ compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({pageModel:this.pageModel,compDTO,compIndex})
AdvCardParser({pageModel:this.pageModel,compDTO})
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (!Number.isNaN(Number(compDTO.compStyle))) {
... ...
... ... @@ -21,29 +21,28 @@ import PageModel from '../../viewmodel/PageModel';
export struct AdvCardParser {
@State compDTO: CompDTO = {} as CompDTO;
pageModel: PageModel = new PageModel();
@State compIndex: number = 0;
build() {
this.contentBuilder(this.pageModel, this.compDTO, this.compIndex);
this.contentBuilder(this.pageModel, this.compDTO);
}
@Builder
contentBuilder(pageModel: PageModel, compDTO: CompDTO, compIndex: number) {
contentBuilder(pageModel: PageModel, compDTO: CompDTO) {
if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_5) { //三图广告
CardAdvThreeImageComponent({ pageModel, compDTO, compIndex })
CardAdvThreeImageComponent({ pageModel, compDTO })
} else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_6) { //小图广告
CardAdvSmallImageComponent({ pageModel, compDTO, compIndex })
CardAdvSmallImageComponent({ pageModel, compDTO })
} else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_7 ||
compDTO.matInfo.advSubType === CompStyle.Card_Adv_12) { // 长通栏广告 和 顶部长通栏广告
CardAdvLongImageComponent({ pageModel, compDTO, compIndex })
CardAdvLongImageComponent({ pageModel, compDTO })
} else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_8) { //大图广告
CardAdvBigImageComponent({ pageModel, compDTO, compIndex })
CardAdvBigImageComponent({ pageModel, compDTO })
} else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_9) { //视频广告
CardAdvVideoComponent({ pageModel, compDTO, compIndex })
CardAdvVideoComponent({ pageModel, compDTO })
} else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_10) { //展会广告
CardAdvVideoExComponent({ pageModel, compDTO, compIndex })
CardAdvVideoExComponent({ pageModel, compDTO})
} else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_11) { //冠名广告
CardAdvGanMiComponent({ pageModel, compDTO, compIndex })
CardAdvGanMiComponent({ pageModel, compDTO })
}
}
}
\ No newline at end of file
... ...
... ... @@ -17,7 +17,6 @@ const TAG: string = 'Card2Component';
@Component
export struct CardAdvBigImageComponent {
@State compDTO: CompDTO = {} as CompDTO
@State compIndex: number = 0;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
... ... @@ -42,7 +41,7 @@ export struct CardAdvBigImageComponent {
.borderColor($r('app.color.color_0D000000'))
.width(CommonConstants.FULL_WIDTH)
CardAdvBottom({pageModel:this.pageModel,compIndex:this.compIndex}).margin({
CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).margin({
top: 8,
})
}
... ...
import { CompDTO } from 'wdBean/Index';
import { Logger } from 'wdKit/Index';
import PageModel from '../../viewmodel/PageModel';
/**
... ... @@ -10,9 +12,8 @@ import PageModel from '../../viewmodel/PageModel';
*/
@Component
export struct CardAdvBottom {
pageModel: PageModel = new PageModel();
@State compIndex: number = 0;
@State compDTO: CompDTO = {} as CompDTO
build() {
... ... @@ -40,9 +41,28 @@ export struct CardAdvBottom {
}.width('100%').onClick(() => {
this.delComp()
})
}
/**
* 删除稿件
*/
private delComp() {
if (this.pageModel) {
// this.pageModel.compList.deleteItem(this.compIndex)
let a = this.compDTO;
let currentIndex = -1
for (let i = 0; i < this.pageModel.compList.size(); i++) {
let b = this.pageModel.compList.getData(i)
if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) {
currentIndex = i
break;
}
}
Logger.error("ZZZXXXXX","currentIndex====>"+currentIndex);
if (currentIndex >= 0) {
this.pageModel.compList.deleteItem(currentIndex)
}
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -24,7 +24,6 @@ export struct CardAdvGanMiComponent {
@State compDTO: CompDTO = {} as CompDTO
@State advExtraData: AdvExtraData = {} as AdvExtraData
@State advLength: number = 0;
@State compIndex: number = 0;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
... ... @@ -57,7 +56,7 @@ export struct CardAdvGanMiComponent {
.borderColor($r('app.color.color_0D000000'))
// 广告标签和删除功能
CardAdvTop({ pageModel: this.pageModel, compIndex: this.compIndex })
CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO })
}
.alignContent(Alignment.Top)
.width(CommonConstants.FULL_WIDTH)
... ...
... ... @@ -19,7 +19,6 @@ const TAG: string = 'Card2Component';
export struct CardAdvLongImageComponent {
@State compDTO: CompDTO = {} as CompDTO
@State haveTitle: boolean = true
@State compIndex: number = 0;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
... ... @@ -45,7 +44,7 @@ export struct CardAdvLongImageComponent {
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
CardAdvBottom({ pageModel: this.pageModel, compIndex: this.compIndex }).margin({
CardAdvBottom({ pageModel: this.pageModel, compDTO:this.compDTO }).margin({
top: 8,
})
}
... ...
... ... @@ -21,7 +21,6 @@ const TAG: string = 'CardAdvSmallImageComponent';
export struct CardAdvSmallImageComponent {
@State compDTO: CompDTO = {} as CompDTO
@State isBigThreeLine: boolean = false // 标题的行数大于等于3行 是true
@State compIndex: number = 0;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
... ... @@ -70,7 +69,7 @@ export struct CardAdvSmallImageComponent {
.margin({ left: 12 })
CardAdvBottom({pageModel:this.pageModel,compIndex:this.compIndex}).width('62%').id('bottom_adv').alignRules({
CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('62%').id('bottom_adv').alignRules({
bottom: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: VerticalAlign.Bottom },
right: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: HorizontalAlign.Start },
top: { anchor: this.isBigThreeLine ? 'title_name' : '', align: VerticalAlign.Bottom },
... ...
... ... @@ -20,7 +20,6 @@ const TAG: string = 'Card2Component';
@Component
export struct CardAdvThreeImageComponent {
@State compDTO: CompDTO = {} as CompDTO
@State compIndex: number = 0;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
... ... @@ -65,7 +64,7 @@ export struct CardAdvThreeImageComponent {
.margin({ top: 8 })
// 广告工具组件
CardAdvBottom({pageModel:this.pageModel,compIndex:this.compIndex}).width('100%').margin({ top: 8 })
CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('100%').margin({ top: 8 })
}
.width('100%')
.justifyContent(FlexAlign.Start)
... ...
import { CompDTO } from 'wdBean/Index';
import { Logger } from 'wdKit/Index';
import PageModel from '../../viewmodel/PageModel';
/**
... ... @@ -10,8 +12,8 @@ import PageModel from '../../viewmodel/PageModel';
*/
@Component
export struct CardAdvTop {
@State compIndex: number = 0;
pageModel: PageModel = new PageModel();
compDTO: CompDTO = {} as CompDTO
build() {
... ... @@ -50,10 +52,30 @@ export struct CardAdvTop {
left: 8,
right: 8
}).onClick(() => {
this.delComp()
})
}
/**
* 删除稿件
*/
private delComp() {
if (this.pageModel) {
this.pageModel.compList.deleteItem(this.compIndex)
let a = this.compDTO;
let currentIndex = -1
for (let i = 0; i < this.pageModel.compList.size(); i++) {
let b = this.pageModel.compList.getData(i)
if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) {
currentIndex = i
break;
}
}
})
Logger.error("ZZZXXXXX","currentIndex====>"+currentIndex);
if (currentIndex >= 0) {
this.pageModel.compList.deleteItem(currentIndex)
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -21,7 +21,6 @@ const TAG: string = 'Card2Component';
export struct CardAdvVideoComponent {
@State compDTO: CompDTO = {} as CompDTO
@State contentDTO: ContentDTO = {} as ContentDTO
@State compIndex: number = 0;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
... ... @@ -56,7 +55,7 @@ export struct CardAdvVideoComponent {
.width(CommonConstants.FULL_WIDTH)
.margin({ top: 8 })
CardAdvBottom({pageModel:this.pageModel,compIndex:this.compIndex}).margin({
CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).margin({
top: 8,
})
}
... ...
... ... @@ -20,7 +20,6 @@ const TAG: string = 'Card2Component';
export struct CardAdvVideoExComponent {
@State compDTO: CompDTO = {} as CompDTO
@State advExtraData: AdvExtraData = {} as AdvExtraData
@State compIndex: number = 0;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
... ... @@ -49,7 +48,7 @@ export struct CardAdvVideoExComponent {
.borderColor($r('app.color.color_0D000000'))
CardAdvTop({ pageModel: this.pageModel, compIndex: this.compIndex })
CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO })
}
.alignContent(Alignment.Top)
.width(CommonConstants.FULL_WIDTH)
... ...
... ... @@ -5,13 +5,40 @@
"lockfileVersion": 3,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@umeng/analytics@^1.0.19": "@umeng/analytics@1.0.19",
"@umeng/common@^1.0.21": "@umeng/common@1.0.21",
"libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": "libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon",
"wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit"
},
"packages": {
"@umeng/analytics@1.0.19": {
"name": "@umeng/analytics",
"integrity": "sha512-0m9z5l8to+POjDl9UkCQC8s4P+e2E1OILwUglC7ME4QwqfH44e59GLJtQdwF0h6kwpsy3YBft4SoWK8MYbuP7g==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@umeng/analytics/-/analytics-1.0.19.har",
"registryType": "ohpm"
},
"@umeng/common@1.0.21": {
"name": "@umeng/common",
"integrity": "sha512-EbXsd4OoRisTQf5egNY/+z1D2bvrYw9VwC2xu3EJA9TiDPSbnaJZ5+yltA/Se6yZ4oCcFvq6e5/AAfPuumunbw==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@umeng/common/-/common-1.0.21.har",
"registryType": "ohpm",
"dependencies": {
"libcommon.so": "./src/main/cpp/types/libcommon"
}
},
"libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": {
"name": "libcommon.so",
"resolved": "../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon",
"registryType": "local"
},
"wdKit@../../commons/wdKit": {
"name": "wdkit",
"resolved": "../../commons/wdKit",
"registryType": "local"
"registryType": "local",
"dependencies": {
"@umeng/common": "^1.0.21",
"@umeng/analytics": "^1.0.19"
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -6,6 +6,9 @@
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
"@umeng/analytics@^1.0.19": "@umeng/analytics@1.0.19",
"@umeng/common@^1.0.21": "@umeng/common@1.0.21",
"libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": "libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon",
"wdBean@../wdBean": "wdBean@../wdBean",
"wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
"wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
... ... @@ -20,6 +23,26 @@
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
"registryType": "ohpm"
},
"@umeng/analytics@1.0.19": {
"name": "@umeng/analytics",
"integrity": "sha512-0m9z5l8to+POjDl9UkCQC8s4P+e2E1OILwUglC7ME4QwqfH44e59GLJtQdwF0h6kwpsy3YBft4SoWK8MYbuP7g==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@umeng/analytics/-/analytics-1.0.19.har",
"registryType": "ohpm"
},
"@umeng/common@1.0.21": {
"name": "@umeng/common",
"integrity": "sha512-EbXsd4OoRisTQf5egNY/+z1D2bvrYw9VwC2xu3EJA9TiDPSbnaJZ5+yltA/Se6yZ4oCcFvq6e5/AAfPuumunbw==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@umeng/common/-/common-1.0.21.har",
"registryType": "ohpm",
"dependencies": {
"libcommon.so": "./src/main/cpp/types/libcommon"
}
},
"libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": {
"name": "libcommon.so",
"resolved": "../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon",
"registryType": "local"
},
"wdBean@../wdBean": {
"name": "wdbean",
"resolved": "../wdBean",
... ... @@ -33,7 +56,11 @@
"wdKit@../../commons/wdKit": {
"name": "wdkit",
"resolved": "../../commons/wdKit",
"registryType": "local"
"registryType": "local",
"dependencies": {
"@umeng/common": "^1.0.21",
"@umeng/analytics": "^1.0.19"
}
},
"wdNetwork@../../commons/wdNetwork": {
"name": "wdnetwork",
... ...
... ... @@ -12,13 +12,8 @@
"libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": "libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon",
"wdBean@../wdBean": "wdBean@../wdBean",
"wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
"wdHwAbility@../wdHwAbility": "wdHwAbility@../wdHwAbility",
"wdJsBridge@../../commons/wdJsBridge": "wdJsBridge@../../commons/wdJsBridge",
"wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
"wdLogin@../wdLogin": "wdLogin@../wdLogin",
"wdNetwork@../../commons/wdNetwork": "wdNetwork@../../commons/wdNetwork",
"wdRouter@../../commons/wdRouter": "wdRouter@../../commons/wdRouter",
"wdWebComponent@../../commons/wdWebComponent": "wdWebComponent@../../commons/wdWebComponent"
"wdNetwork@../../commons/wdNetwork": "wdNetwork@../../commons/wdNetwork"
},
"packages": {
"@ohos/axios@2.2.0": {
... ... @@ -63,24 +58,6 @@
"resolved": "../../commons/wdConstant",
"registryType": "local"
},
"wdHwAbility@../wdHwAbility": {
"name": "wdhwability",
"resolved": "../wdHwAbility",
"registryType": "local",
"dependencies": {
"wdConstant": "file:../../commons/wdConstant",
"wdLogin": "file:../../features/wdLogin",
"wdKit": "file:../../commons/wdKit",
"wdBean": "file:../../features/wdBean",
"wdNetwork": "file:../../commons/wdNetwork"
},
"packageType": "InterfaceHar"
},
"wdJsBridge@../../commons/wdJsBridge": {
"name": "wdjsbridge",
"resolved": "../../commons/wdJsBridge",
"registryType": "local"
},
"wdKit@../../commons/wdKit": {
"name": "wdkit",
"resolved": "../../commons/wdKit",
... ... @@ -90,19 +67,6 @@
"@umeng/analytics": "^1.0.19"
}
},
"wdLogin@../wdLogin": {
"name": "wdlogin",
"resolved": "../wdLogin",
"registryType": "local",
"dependencies": {
"wdConstant": "file:../../commons/wdConstant",
"wdKit": "file:../../commons/wdKit",
"wdWebComponent": "file:../../commons/wdWebComponent",
"wdBean": "file:../../features/wdBean",
"wdRouter": "file:../../commons/wdRouter",
"wdNetwork": "file:../../commons/wdNetwork"
}
},
"wdNetwork@../../commons/wdNetwork": {
"name": "wdnetwork",
"resolved": "../../commons/wdNetwork",
... ... @@ -112,30 +76,6 @@
"wdKit": "file:../wdKit",
"@ohos/axios": "^2.1.1"
}
},
"wdRouter@../../commons/wdRouter": {
"name": "wdrouter",
"resolved": "../../commons/wdRouter",
"registryType": "local",
"dependencies": {
"wdKit": "file:../wdKit",
"wdBean": "file:../../features/wdBean",
"wdNetwork": "file:../../commons/wdNetwork",
"wdConstant": "file:../../commons/wdConstant"
}
},
"wdWebComponent@../../commons/wdWebComponent": {
"name": "wdwebcomponent",
"resolved": "../../commons/wdWebComponent",
"registryType": "local",
"dependencies": {
"wdConstant": "file:../wdConstant",
"wdKit": "file:../wdKit",
"wdJsBridge": "file:../wdJsBridge",
"wdBean": "file:../../features/wdBean",
"wdRouter": "file:../wdRouter",
"wdNetwork": "file:../wdNetwork"
}
}
}
}
\ No newline at end of file
... ...