Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
4 changed files
with
29 additions
and
10 deletions
| @@ -89,6 +89,15 @@ export class KVStoreHelper { | @@ -89,6 +89,15 @@ export class KVStoreHelper { | ||
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | + deleteAll() { | ||
| 93 | + this.kvManager?.deleteKVStore(AppUtils.getPackageName(getContext()), KVStoreHelper._default_store_id) | ||
| 94 | + .then(() => { | ||
| 95 | + Logger.error(TAG, 'deleteAll success') | ||
| 96 | + }).catch((e: object) => { | ||
| 97 | + Logger.error(TAG, 'deleteAll error: ' + JSON.stringify(e)) | ||
| 98 | + }) | ||
| 99 | + } | ||
| 100 | + | ||
| 92 | private checkStoreCreated() { | 101 | private checkStoreCreated() { |
| 93 | if (!this.kvManager) { | 102 | if (!this.kvManager) { |
| 94 | this.createKVManager() | 103 | this.createKVManager() |
| @@ -124,7 +124,7 @@ export struct CardAdvGanMiComponent { | @@ -124,7 +124,7 @@ export struct CardAdvGanMiComponent { | ||
| 124 | }) | 124 | }) |
| 125 | 125 | ||
| 126 | // 更多按钮 | 126 | // 更多按钮 |
| 127 | - commonButton(this.advExtraData) | 127 | + this.commonButton() |
| 128 | 128 | ||
| 129 | } | 129 | } |
| 130 | .width(CommonConstants.FULL_WIDTH) | 130 | .width(CommonConstants.FULL_WIDTH) |
| @@ -134,19 +134,19 @@ export struct CardAdvGanMiComponent { | @@ -134,19 +134,19 @@ export struct CardAdvGanMiComponent { | ||
| 134 | }) | 134 | }) |
| 135 | 135 | ||
| 136 | } | 136 | } |
| 137 | -} | ||
| 138 | 137 | ||
| 139 | -/* | 138 | + /* |
| 140 | 标题样式 | 139 | 标题样式 |
| 141 | */ | 140 | */ |
| 142 | -@Builder | ||
| 143 | -function commonButton(advExtraData: AdvExtraData) { | 141 | + @Builder |
| 142 | + commonButton() { | ||
| 144 | 143 | ||
| 145 | 144 | ||
| 146 | Row() { | 145 | Row() { |
| 147 | Row() { | 146 | Row() { |
| 148 | Blank() | 147 | Blank() |
| 149 | - Text(advExtraData.itemMore.title == null ? $r('app.string.look_more') : advExtraData.itemMore.title) | 148 | + Text(this.advExtraData.itemMore == undefined ? $r('app.string.look_more') : |
| 149 | + this.advExtraData.itemMore.title == undefined ? $r('app.string.look_more') : this.advExtraData.itemMore.title) | ||
| 150 | .fontColor('#222222') | 150 | .fontColor('#222222') |
| 151 | .fontSize('14fp') | 151 | .fontSize('14fp') |
| 152 | Image($r('app.media.icon_comp_more_right_red')).width(16).height(16) | 152 | Image($r('app.media.icon_comp_more_right_red')).width(16).height(16) |
| @@ -158,11 +158,14 @@ function commonButton(advExtraData: AdvExtraData) { | @@ -158,11 +158,14 @@ function commonButton(advExtraData: AdvExtraData) { | ||
| 158 | .borderRadius(3) | 158 | .borderRadius(3) |
| 159 | .padding({ top: 10, bottom: 10, }) | 159 | .padding({ top: 10, bottom: 10, }) |
| 160 | .onClick(() => { | 160 | .onClick(() => { |
| 161 | + if (this.advExtraData.itemMore != undefined) { | ||
| 161 | let matInfo: CompAdvMatInfoBean = { | 162 | let matInfo: CompAdvMatInfoBean = { |
| 162 | - linkUrl: advExtraData.itemMore.linkUrl, | ||
| 163 | - linkType: advExtraData.itemMore.linkType | 163 | + linkUrl: this.advExtraData.itemMore.linkUrl, |
| 164 | + linkType: this.advExtraData.itemMore.linkType | ||
| 164 | } as CompAdvMatInfoBean; | 165 | } as CompAdvMatInfoBean; |
| 165 | ProcessUtils.openAdvDetail(matInfo) | 166 | ProcessUtils.openAdvDetail(matInfo) |
| 167 | + } | ||
| 168 | + | ||
| 166 | }) | 169 | }) |
| 167 | }.width('100%').padding({ | 170 | }.width('100%').padding({ |
| 168 | left: $r('app.float.card_comp_pagePadding_lf'), | 171 | left: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -170,4 +173,6 @@ function commonButton(advExtraData: AdvExtraData) { | @@ -170,4 +173,6 @@ function commonButton(advExtraData: AdvExtraData) { | ||
| 170 | 173 | ||
| 171 | }) | 174 | }) |
| 172 | 175 | ||
| 176 | + } | ||
| 173 | } | 177 | } |
| 178 | + |
| @@ -143,7 +143,7 @@ export struct Card9Component { | @@ -143,7 +143,7 @@ export struct Card9Component { | ||
| 143 | // 标题 | 143 | // 标题 |
| 144 | Image($r("app.media.timeAxis")) | 144 | Image($r("app.media.timeAxis")) |
| 145 | .width(9) | 145 | .width(9) |
| 146 | - .height(9) | 146 | + .height(6) |
| 147 | .margin({ right: 5 }) | 147 | .margin({ right: 5 }) |
| 148 | .fillColor(item.newsTitleColor) | 148 | .fillColor(item.newsTitleColor) |
| 149 | 149 |
| 1 | -import { SPHelper } from 'wdKit/Index'; | 1 | +import { KVStoreHelper, SPHelper } from 'wdKit/Index'; |
| 2 | import { HostEnum, HostManager, HttpUrlUtils } from 'wdNetwork/Index'; | 2 | import { HostEnum, HostManager, HttpUrlUtils } from 'wdNetwork/Index'; |
| 3 | 3 | ||
| 4 | @CustomDialog | 4 | @CustomDialog |
| @@ -86,11 +86,16 @@ export struct EnvironmentCustomDialog { | @@ -86,11 +86,16 @@ export struct EnvironmentCustomDialog { | ||
| 86 | Button('确认') | 86 | Button('确认') |
| 87 | .margin({ top: 20 }) | 87 | .margin({ top: 20 }) |
| 88 | .onClick(() => { | 88 | .onClick(() => { |
| 89 | + new Promise<void>(() => { | ||
| 89 | // HttpUrlUtils.hostUrl = this.currentEnvironment | 90 | // HttpUrlUtils.hostUrl = this.currentEnvironment |
| 90 | SPHelper.default.saveSync('hostUrl', this.currentEnvironment); | 91 | SPHelper.default.saveSync('hostUrl', this.currentEnvironment); |
| 92 | + // 清首页缓存 | ||
| 93 | + KVStoreHelper.default.deleteAll() | ||
| 94 | + // TODO 清sp相关 | ||
| 91 | this.controller.close() | 95 | this.controller.close() |
| 92 | this.confirm() | 96 | this.confirm() |
| 93 | }) | 97 | }) |
| 98 | + }) | ||
| 94 | }.height(261).backgroundColor(Color.White).borderRadius(6).width('74%') | 99 | }.height(261).backgroundColor(Color.White).borderRadius(6).width('74%') |
| 95 | 100 | ||
| 96 | } | 101 | } |
-
Please register or login to post a comment