Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
4 changed files
with
53 additions
and
34 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,40 +134,45 @@ export struct CardAdvGanMiComponent { | @@ -134,40 +134,45 @@ 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() { | ||
| 147 | Row() { | 145 | Row() { |
| 148 | - Blank() | ||
| 149 | - Text(advExtraData.itemMore.title == null ? $r('app.string.look_more') : advExtraData.itemMore.title) | ||
| 150 | - .fontColor('#222222') | ||
| 151 | - .fontSize('14fp') | ||
| 152 | - Image($r('app.media.icon_comp_more_right_red')).width(16).height(16) | ||
| 153 | - Blank() | 146 | + Row() { |
| 147 | + Blank() | ||
| 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') | ||
| 151 | + .fontSize('14fp') | ||
| 152 | + Image($r('app.media.icon_comp_more_right_red')).width(16).height(16) | ||
| 153 | + Blank() | ||
| 154 | + | ||
| 155 | + } | ||
| 156 | + .width('100%') | ||
| 157 | + .backgroundColor('#F5F5F5') | ||
| 158 | + .borderRadius(3) | ||
| 159 | + .padding({ top: 10, bottom: 10, }) | ||
| 160 | + .onClick(() => { | ||
| 161 | + if (this.advExtraData.itemMore != undefined) { | ||
| 162 | + let matInfo: CompAdvMatInfoBean = { | ||
| 163 | + linkUrl: this.advExtraData.itemMore.linkUrl, | ||
| 164 | + linkType: this.advExtraData.itemMore.linkType | ||
| 165 | + } as CompAdvMatInfoBean; | ||
| 166 | + ProcessUtils.openAdvDetail(matInfo) | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + }) | ||
| 170 | + }.width('100%').padding({ | ||
| 171 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 172 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 154 | 173 | ||
| 155 | - } | ||
| 156 | - .width('100%') | ||
| 157 | - .backgroundColor('#F5F5F5') | ||
| 158 | - .borderRadius(3) | ||
| 159 | - .padding({ top: 10, bottom: 10, }) | ||
| 160 | - .onClick(() => { | ||
| 161 | - let matInfo: CompAdvMatInfoBean = { | ||
| 162 | - linkUrl: advExtraData.itemMore.linkUrl, | ||
| 163 | - linkType: advExtraData.itemMore.linkType | ||
| 164 | - } as CompAdvMatInfoBean; | ||
| 165 | - ProcessUtils.openAdvDetail(matInfo) | ||
| 166 | }) | 174 | }) |
| 167 | - }.width('100%').padding({ | ||
| 168 | - left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 169 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 170 | 175 | ||
| 171 | - }) | 176 | + } |
| 177 | +} | ||
| 172 | 178 | ||
| 173 | -} |
| @@ -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,10 +86,15 @@ export struct EnvironmentCustomDialog { | @@ -86,10 +86,15 @@ export struct EnvironmentCustomDialog { | ||
| 86 | Button('确认') | 86 | Button('确认') |
| 87 | .margin({ top: 20 }) | 87 | .margin({ top: 20 }) |
| 88 | .onClick(() => { | 88 | .onClick(() => { |
| 89 | - // HttpUrlUtils.hostUrl = this.currentEnvironment | ||
| 90 | - SPHelper.default.saveSync('hostUrl', this.currentEnvironment); | ||
| 91 | - this.controller.close() | ||
| 92 | - this.confirm() | 89 | + new Promise<void>(() => { |
| 90 | + // HttpUrlUtils.hostUrl = this.currentEnvironment | ||
| 91 | + SPHelper.default.saveSync('hostUrl', this.currentEnvironment); | ||
| 92 | + // 清首页缓存 | ||
| 93 | + KVStoreHelper.default.deleteAll() | ||
| 94 | + // TODO 清sp相关 | ||
| 95 | + this.controller.close() | ||
| 96 | + this.confirm() | ||
| 97 | + }) | ||
| 93 | }) | 98 | }) |
| 94 | }.height(261).backgroundColor(Color.White).borderRadius(6).width('74%') | 99 | }.height(261).backgroundColor(Color.White).borderRadius(6).width('74%') |
| 95 | 100 |
-
Please register or login to post a comment