Skip to content

Commit

Permalink
检查更新改为跳转应用市场 (mgz0227#195)
Browse files Browse the repository at this point in the history
* 检查更新改为跳转应用市场

* 样式调整

* Revert "样式调整"

This reverts commit ed2ceb8.
  • Loading branch information
yindushenwen authored Jul 18, 2024
1 parent 6473597 commit 9afc613
Showing 1 changed file with 57 additions and 27 deletions.
84 changes: 57 additions & 27 deletions entry/src/main/ets/pages/view/myCenter/aboutUs/aboutUsPage.ets
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { dataItem } from 'ets/componets/dataList/dataItem'
import VersionUpdateCustomDialog from 'ets/componets/aboutUs/VersionUpdate'
import { dataItem } from 'ets/componets/dataList/dataItem';
import VersionUpdateCustomDialog from 'ets/componets/aboutUs/VersionUpdate';
import { router } from '@kit.ArkUI';
import { common, Want } from '@kit.AbilityKit';
import { BusinessError } from '@ohos.base';
import hilog from '@ohos.hilog';
import { productViewManager } from '@kit.StoreKit';

@Entry
@Component
Expand All @@ -20,20 +24,41 @@ struct AboutUsPage {
new dataItem("免责声明", 3),
new dataItem("崩溃日志", 4),
]

// 升级弹窗
dialogController: CustomDialogController = new CustomDialogController({
builder: VersionUpdateCustomDialog({}),
cornerRadius: 16,
gridCount: 3,
alignment: DialogAlignment.Center,
})
@State qqList: Array<string> = [
'QQ群1:2031546254',
'QQ群2:2031546254',
'QQ群3:2031546254',
'QQ群4:2031546254',
'QQ群5:2031546254',
]

firstUrl_list(value: number | string) {
switch (value) {
case 0:
// 升级弹窗
this.dialogController.open()
// this.dialogController.open()
// 跳转到应用市场
try {
const request: Want = {
parameters: {
bundleName: 'io.legado.app'
}
};
productViewManager.loadProduct(getContext(this) as common.UIAbilityContext, request, {
onError: (error: BusinessError) => {
hilog.info(0, 'TAG', `loadProduct onError. code is ${error.code}, message is ${error.message}`);
}
});
} catch (err) {
hilog.error(0, 'TAG', `loadProduct failed. code is ${err.code}, message is ${err.message}`);
}
break
case 1:
// 更新日志
Expand Down Expand Up @@ -108,12 +133,25 @@ struct AboutUsPage {

this.middleClick(this.first_list, "app.media.right", this.version, "first")

Row({ space: 16 }) {
this.middleBox(0,"app.media.official_website", "官网")
this.middleBox(1,"app.media.wechat_public_account", "公众号")
this.middleBox(2,"app.media.channel", "QQ频道")
this.middleBox(3,"app.media.QQ", "QQ群")
Grid() {
GridItem() {
this.middleBox(0, "app.media.official_website", "官网")
}

GridItem() {
this.middleBox(1, "app.media.wechat_public_account", "公众号")
}

GridItem() {
this.middleBox(2, "app.media.channel", "QQ频道")
}

GridItem() {
this.middleBox(3, "app.media.QQ", "QQ群")
}
}
.columnsTemplate('1fr 1fr 1fr 1fr')
.height(80)
// QQ群的半模态框 不知道绑定在哪里,鸿蒙官方怎么想的,非要绑定一个元素?
.bindSheet($$this.isShowQQ, this.QQDialog(), {
height: 300,
Expand All @@ -128,18 +166,18 @@ struct AboutUsPage {
this.middleClick(this.end_list, "app.media.right", null, "end")
}
.padding({
left:20,
right:20,
top:this.topRectHeight,
bottom:this.bottomRectHeight
left: 20,
right: 20,
top: this.topRectHeight,
bottom: this.bottomRectHeight
})
.height("100%")
.backgroundColor("rgb(245, 245, 245)")
}
}

@Builder
middleBox(index:number,image: string, text: string) {
middleBox(index: number, image: string, text: string) {
Column({ space: 2 }) {
Image($r(`${image}`)).size({ width: 24, height: 24 })
Text(text)
Expand All @@ -154,23 +192,23 @@ struct AboutUsPage {
.opacity(0.45)
}
.padding({
top:12,
bottom:12
top: 12,
bottom: 12
})
.width("20%")
.width("80%")
.height(70)
.borderRadius(12)
.backgroundColor(Color.White)
.onClick(() => {
switch (index){
switch (index) {
case 0:
break
case 1:
break
case 2:
break
case 3:
this.isShowQQ =true
this.isShowQQ = true
break
}
})
Expand Down Expand Up @@ -232,14 +270,6 @@ struct AboutUsPage {
.borderRadius(10)
}

@State qqList: Array<string> = [
'QQ群1:2031546254',
'QQ群2:2031546254',
'QQ群3:2031546254',
'QQ群4:2031546254',
'QQ群5:2031546254',
]

@Builder
QQDialog() {
Column() {
Expand Down

0 comments on commit 9afc613

Please sign in to comment.