|
|
@@ -28,6 +28,7 @@ import { resourceManager } from '@kit.LocalizationKit';
|
|
|
import { systemShare } from '@kit.ShareKit';
|
|
|
import { uniformTypeDescriptor } from '@kit.ArkData';
|
|
|
import { hilog } from '@kit.PerformanceAnalysisKit';
|
|
|
+import { DialogHelper } from '@pura/harmony-dialog';
|
|
|
|
|
|
|
|
|
const TAG = 'NewIndex'; // 日志标签
|
|
|
@@ -174,13 +175,39 @@ struct NewIndex{
|
|
|
ScreenUtil.setScreenSize();
|
|
|
this.bundleName = AppUtil.getBundleName()
|
|
|
this.versionName = AppUtil.getVersionName();
|
|
|
- // await ImageKnife.getInstance().initFileCache(this.context, 256, 256 * 1024 * 1024)
|
|
|
+ // await ImageKnife.getInstance().initFileCache(this.context, 256, 256 * 1024 * 1024)
|
|
|
this.isShowSponsorship = Utility.isOpenTime()
|
|
|
let themeColor = PreferencesUtil.getStringSync('THEME_COLOR', CommonConstants.DEFAULT_THEME_COLOR);
|
|
|
hilog.info(0x0000, 'Heanup', '当前 NewIndex themeColor:'+themeColor);
|
|
|
AppStorage.setOrCreate('themeColor', themeColor);
|
|
|
this.themeColor=themeColor
|
|
|
|
|
|
+ // ====== 本地会员同步提醒逻辑 ======
|
|
|
+ let isLogin = PreferencesUtil.getBooleanSync('isLogin', false);
|
|
|
+ console.log('Heanup isLogin:'+isLogin)
|
|
|
+ console.log('Heanup Utility.isNobleForOld():'+Utility.isNobleForOld())
|
|
|
+
|
|
|
+ if (!isLogin && Utility.isNobleForOld()) {
|
|
|
+ setTimeout(() => {
|
|
|
+ DialogHelper.showCustomContentDialog({
|
|
|
+ dialogId: 'syncNobleDialog',
|
|
|
+ title: '会员同步提示',
|
|
|
+ contentBuilder: () => {
|
|
|
+ this.syncNobleDialogContentBuilder();
|
|
|
+ },
|
|
|
+ buttons: [
|
|
|
+ { value: '暂不登录' },
|
|
|
+ {
|
|
|
+ value: '去登录',
|
|
|
+ action: () => {
|
|
|
+ router.pushUrl({ url: 'pages/UserCenter', params: { fromSyncNoble: true } });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+ // ====== 本地会员同步提醒逻辑 END ======
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -299,20 +326,20 @@ struct NewIndex{
|
|
|
Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
Row() {
|
|
|
// 菜单图标
|
|
|
- if (typeof item.img === 'object' && item.img !== null && (item.img as sysResource).type === 'symbol') {
|
|
|
- SymbolGlyph((item.img as sysResource).value as Resource)
|
|
|
- // .size({ width: 22, height: 22 })
|
|
|
- .fontSize(22)
|
|
|
- .fontColor([this.themeColor])
|
|
|
- .alignSelf(ItemAlign.Center)
|
|
|
- .margin({ left: 2 })
|
|
|
- }else {
|
|
|
- Image(item.img as Resource)
|
|
|
- .height(22)
|
|
|
- .alignSelf(ItemAlign.Center)
|
|
|
- .fillColor(this.themeColor)
|
|
|
- .margin({ left: 2 })
|
|
|
- }
|
|
|
+ if (typeof item.img === 'object' && item.img !== null && (item.img as sysResource).type === 'symbol') {
|
|
|
+ SymbolGlyph((item.img as sysResource).value as Resource)
|
|
|
+ // .size({ width: 22, height: 22 })
|
|
|
+ .fontSize(22)
|
|
|
+ .fontColor([this.themeColor])
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
+ .margin({ left: 2 })
|
|
|
+ }else {
|
|
|
+ Image(item.img as Resource)
|
|
|
+ .height(22)
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
+ .fillColor(this.themeColor)
|
|
|
+ .margin({ left: 2 })
|
|
|
+ }
|
|
|
|
|
|
// 菜单标题
|
|
|
Text(item.title)
|
|
|
@@ -669,4 +696,14 @@ struct NewIndex{
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
+ /*** 本地会员同步弹窗内容Builder */
|
|
|
+ @Builder
|
|
|
+ syncNobleDialogContentBuilder(): void {
|
|
|
+ Text('检测到您是本地会员,为保障权益请登录账号,会员权益将自动同步到您的账号。')
|
|
|
+ .fontSize(16)
|
|
|
+ .fontColor('#222')
|
|
|
+ .width('100%')
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .padding(16)
|
|
|
+ }
|
|
|
}
|