当前位置: 首页> 财经> 创投人物 > 展厅设计公司展厅效果图_买一个域名多少钱_电商培训内容_搜索引擎网络排名

展厅设计公司展厅效果图_买一个域名多少钱_电商培训内容_搜索引擎网络排名

时间:2025/7/13 9:51:42来源:https://blog.csdn.net/qq_41733851/article/details/143336011 浏览次数:0次
展厅设计公司展厅效果图_买一个域名多少钱_电商培训内容_搜索引擎网络排名

效果如下:

实现代码如下,下面具体我都写了注释

import { router, window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
import { LogUtil } from '../../utils/logutil';@Component
@Entry
struct Splash {timeId?: number; // 定时器@State num: number = 5; // 倒计时build() {Stack() {// 背景图片Image($r('app.media.splash_bg')).size({ width: '100%', height: '100%' }).zIndex(-1); // 确保背景图片在最底层Column() {// 最右边显示Button('立即体验' + this.num).width('30%').height('6%').fontSize('16fp').margin({ top: '10%', right: '3%' }).alignSelf(ItemAlign.End) // 对齐到右侧.onClick(() => {LogUtil.info('点击立即体验');this.clearTimerAndNavigate();});}.size({ width: '100%', height: '100%' });}.size({ width: '100%', height: '100%' });}/*** 页面显示时,开始倒计时*/onPageShow() {this.setImmersive();this.countDown();LogUtil.info('开始倒计时了');}/*** 沉浸式状态栏*/private setImmersive() {window.getLastWindow(getContext()).then(win => {win.setWindowLayoutFullScreen(true);let area = win.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM);let height = area.topRect.height;let vpheight = px2vp(height);AppStorage.setOrCreate('topHeight', vpheight);win.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff' }); // 设置状态栏字体颜色});}/*** 把倒计时封装方法*/private countDown() {let timeId = setInterval(() => {this.num--;if (this.num === 0) {clearInterval(this.timeId);LogUtil.info('倒计时结束');this.navigateToNextPage(); // 跳转到下一页}}, 1000);this.timeId = timeId;}/*** 清除定时器并跳转下一页*/private clearTimerAndNavigate() {clearInterval(this.timeId);this.navigateToNextPage();}/*** 跳转下一页*/private navigateToNextPage() {router.pushUrl({ url: 'pages/login/Login' }).then(() => {console.info('成功跳转到第二页。');}).catch((err: BusinessError) => {console.error(`无法跳转到第二页。错误码为${err.code}, 错误消息 ${err.message}`);});}/*** 页面销毁时,清除定时器*/onDestroy() {this.num = 5;clearInterval(this.timeId);LogUtil.info('清除定时器');}
}

关键字:展厅设计公司展厅效果图_买一个域名多少钱_电商培训内容_搜索引擎网络排名

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: