当前位置: 首页 > news >正文

自己怎样做网站显示危险万能浏览器手机版

自己怎样做网站显示危险,万能浏览器手机版,资源库最新版在线,上海快速建站提供商1.项目介绍 该项目是记录用户日常饮食情况#xff0c;以及针对不同食物摄入营养不同会有对应的营养摄入情况和日常运动消耗情况#xff0c;用户可以自己添加食品以及对应的热量。 1.1登陆页 1.2饮食统计页 1.3 食物列表页 2.登陆页 2.1自定义弹框 import preferences from oh…1.项目介绍 该项目是记录用户日常饮食情况以及针对不同食物摄入营养不同会有对应的营养摄入情况和日常运动消耗情况用户可以自己添加食品以及对应的热量。 1.1登陆页 1.2饮食统计页 1.3 食物列表页 2.登陆页 2.1自定义弹框 import preferences from ohos.data.preferences; import { CommonConstants } from ../constants/CommonConstants; import Logger from ./Logger;class PreferenceUtil{private pref: preferences.Preferencesasync loadPreference(context){try { // 加载preferencesthis.pref await preferences.getPreferences(context, CommonConstants.H_STORE)Logger.debug(加载Preferences[${CommonConstants.H_STORE}]成功)} catch (e) {Logger.debug(加载Preferences[${CommonConstants.H_STORE}]失败, JSON.stringify(e))}}async putPreferenceValue(key: string, value: preferences.ValueType){if (!this.pref) {Logger.debug(Preferences[${CommonConstants.H_STORE}]尚未初始化)return}try {// 写入数据await this.pref.put(key, value)// 刷盘await this.pref.flush()Logger.debug(保存Preferences[${key} ${value}]成功)} catch (e) {Logger.debug(保存Preferences[${key} ${value}]失败, JSON.stringify(e))}}async getPreferenceValue(key: string, defaultValue: preferences.ValueType){if (!this.pref) {Logger.debug(Preferences[${CommonConstants.H_STORE}]尚未初始化)return}try {// 读数据let value await this.pref.get(key, defaultValue)Logger.debug(读取Preferences[${key} ${value}]成功)return value} catch (e) {Logger.debug(读取Preferences[${key}]失败, JSON.stringify(e))}} }const preferenceUtil new PreferenceUtil()export default preferenceUtil as PreferenceUtilexport class CommonConstants {static readonly RDB_NAME: string HealthyLife.db; // db name// THOUSANDTHstatic readonly THOUSANDTH_15: string 1.5%; // ‘1.5%’static readonly THOUSANDTH_12: string 2.2%; // ‘2.2%’static readonly THOUSANDTH_33: string 3.3%; // ‘3.3%’static readonly THOUSANDTH_50: string 5%; // ‘5%’static readonly THOUSANDTH_66: string 6.6%; // ‘6.6%’static readonly THOUSANDTH_80: string 8%; // ‘8%’static readonly THOUSANDTH_100: string 10%; // ‘10%’static readonly THOUSANDTH_120: string 12%; // ‘12%’static readonly THOUSANDTH_160: string 16%; // ‘16%’static readonly THOUSANDTH_400: string 40%; // ‘40%’static readonly THOUSANDTH_420: string 42%; // ‘42%’static readonly THOUSANDTH_500: string 50%; // ‘50%’static readonly THOUSANDTH_560: string 56%; // ‘56%’static readonly THOUSANDTH_800: string 80%; // ‘80%’static readonly THOUSANDTH_830: string 83%; // ‘83%’static readonly THOUSANDTH_880: string 88%; // ‘88%’static readonly THOUSANDTH_900: string 90%; // ‘90%’static readonly THOUSANDTH_940: string 94%; // ‘90%’static readonly THOUSANDTH_1000: string 100%; // ‘100%’static readonly DEFAULT_2: number 2;static readonly DEFAULT_6: number 6;static readonly DEFAULT_8: number 8;static readonly DEFAULT_12: number 12;static readonly DEFAULT_10: number 10;static readonly DEFAULT_16: number 16;static readonly DEFAULT_18: number 18;static readonly DEFAULT_20: number 20;static readonly DEFAULT_24: number 24;static readonly DEFAULT_28: number 28;static readonly DEFAULT_32: number 32;static readonly DEFAULT_48: number 48;static readonly DEFAULT_56: number 56;static readonly DEFAULT_60: number 60;static readonly DEFAULT_100: number 100;static readonly DEFAULT_180: number 180;// fontWeightstatic readonly FONT_WEIGHT_400: number 400;static readonly FONT_WEIGHT_500: number 500;static readonly FONT_WEIGHT_600: number 600;static readonly FONT_WEIGHT_700: number 700;static readonly FONT_WEIGHT_900: number 900;// opacitystatic readonly OPACITY_4: number 0.4;static readonly OPACITY_6: number 0.6;// radiusstatic readonly BORDER_RADIUS_PERCENT_50: string 50%;// durationstatic readonly DURATION_1000: number 1000; // 1000msstatic readonly DURATION_800: number 800; // 700msstatic readonly DURATION_100: number 100; // 100ms// spacestatic readonly SPACE_2: number 2;static readonly SPACE_4: number 4;static readonly SPACE_6: number 6;static readonly SPACE_8: number 8;static readonly SPACE_10: number 10;static readonly SPACE_12: number 12;// global data keystatic readonly H_STORE: string HeimaHealthyStore;static readonly RECORD_DATE: string selectedDate;static readonly PACKAGE_NAME: string com.itheima.healthylife;static readonly ENTRY_ABILITY: string EntryAbility;/*** 当前用户推荐的每日摄入热量上限单位卡路里*/static readonly RECOMMEND_CALORIE: number 1962/*** 当前用户推荐的每日摄入碳水上限单位克*/static readonly RECOMMEND_CARBON: number 237/*** 当前用户推荐的每日摄入蛋白质上限单位克*/static readonly RECOMMEND_PROTEIN: number 68/*** 当前用户推荐的每日摄入脂肪上限单位克*/static readonly RECOMMEND_FAT: number 53 }import { CommonConstants } from ../../common/constants/CommonConstants CustomDialog export default struct UserPrivacyDialog {controller: CustomDialogControllerconfirm: () voidcancel: () voidbuild() {Column({space: CommonConstants.SPACE_10}){// 1.标题Text($r(app.string.user_privacy_title)).fontSize(20).fontWeight(CommonConstants.FONT_WEIGHT_700)// 2.内容Text($r(app.string.user_privacy_content))// 3.按钮Button($r(app.string.agree_label)).width(150).backgroundColor($r(app.color.primary_color)).onClick(() {this.confirm()this.controller.close()})Button($r(app.string.refuse_label)).width(150).backgroundColor($r(app.color.lightest_primary_color)).fontColor($r(app.color.light_gray)).onClick(() {this.cancel()this.controller.close()})}.width(100%).padding(10)} }import common from ohos.app.ability.common import router from ohos.router import PreferenceUtil from ../common/utils/PreferenceUtil import UserPrivacyDialog from ../view/welcome/UserPrivacyDialog Extend(Text) function opacityWhiteText(opacity: number, fontSize: number 10) {.fontSize(fontSize).opacity(opacity).fontColor(Color.White) } const PREF_KEY userPrivacyKey Entry Component struct WelcomePage {context getContext(this) as common.UIAbilityContextcontroller: CustomDialogController new CustomDialogController({builder: UserPrivacyDialog({confirm: () this.onConfirm(),cancel: () this.exitApp()})})async aboutToAppear(){// 1.加载首选项let isAgree await PreferenceUtil.getPreferenceValue(PREF_KEY, false)// 2.判断是否同意if(isAgree){// 2.1.同意跳转首页this.jumpToIndex()}else{// 2.2.不同意弹窗this.controller.open()}}jumpToIndex(){setTimeout(() {router.replaceUrl({url: pages/Index})}, 1000)}onConfirm(){// 1.保存首选项PreferenceUtil.putPreferenceValue(PREF_KEY, true)// 2.跳转到首页this.jumpToIndex()}exitApp(){// 退出APPthis.context.terminateSelf()}build() {Column({ space: 10 }) {Row() {Text(健康支持).opacityWhiteText(0.8, 12)Text(IPv6).opacityWhiteText(0.8).border({ style: BorderStyle.Solid, width: 1, color: Color.White, radius: 15 }).padding({ left: 5, right: 5 })Text(网络).opacityWhiteText(0.8, 12)}Text(减更多帮助更多用户实现身材管理).opacityWhiteText(0.6)Text(备****号).opacityWhiteText(0.4).margin({ bottom: 35 })}.width(100%).height(100%).backgroundColor($r(app.color.welcome_page_background))} }
http://www.hkea.cn/news/14504966/

相关文章:

  • 天津网络网站制作网络开发软件
  • 温州网站建设小公司北京列表网
  • 建站网站源码怎么在天猫注册开店铺
  • 青海省交通建设管理局网站网页升级中紧急自动转跳中
  • 网站建设自学建站视频教程wordpress头像代码
  • 宜兴市城乡建设局网站静态网站什么样
  • 金华app网站开发如何推广微信小程序
  • 湖北外贸网站建设费用营销策略ppt
  • 开通网站需要什么手续如何用dw制作网页文字链接
  • 微官网和微网站宁波seo怎么推广
  • 科技公司网站响应式素材网站有哪些
  • 微小店网站建设价格企业logo设计报价
  • 四平网络推广台州关键词优化价格
  • 做网站 斗地主网站开发品牌
  • eclipse sdk做网站做网站销售有前景
  • 建网站发信息做推广更新wordpress需要ftp
  • 公司网站建设比较好的公司常用的seo工具推荐
  • 青岛移动公司网站做外贸服装的网站
  • 网站招聘方案怎么做河南省十大互联网企业
  • 互联网企业网站设计聊城网站优化技术
  • 做网站建设公司企业设计师投稿网站
  • 设计有特色的网站百度软件下载安装
  • 同个网站可以做多个外链吗怎么找上海网站建设
  • 建个人网站一般多少钱重庆公司名字
  • 网站推广策划思路与执行网站建设雨点
  • 中国企业500强最新排名2021优化推广公司哪家好
  • 单职业传奇网站医院门户网站建设规划
  • 太原网站建设公司5858有免费的网站域名吗
  • 网站建设登录界面代码08系统iis信息管理器怎么建设网站
  • 如何建立自己免费网站前端一般怎样做网站