浙江鸿友压缩机制造有限公司

新闻资讯
//读取超每每间可选
发布日期:2024-07-03 15:23    点击次数:51

//读取超每每间可选

团队先容作家:徐庆

团队:坚果派[1]

公众号:“大前端之旅”[2]

润开鸿生态时刻群众,华为HDE,CSDN博客群众,CSDN超等个体,CSDN特邀嘉宾,InfoQ签约作家,OpenHarmony布谈师,电子发热友群众博客,51CTO博客群众,擅长HarmonyOS/OpenHarmony利用配置、纯熟劳动卡片配置。宽待互助。

绪言:

诸君同学有段时刻莫得碰头 因为一直很忙是以就莫得去更新博客。最近有在学习这个鸿蒙的ark ui配置 因为鸿蒙不是发布了一个鸿蒙next的测试版块 来岁会初始纯血鸿蒙利用 是以我就念念提前给天下写一些博客著作

成果图

图片新闻资讯

image-20231206202427615

图片

image-20231206202438894反映数据成果

图片

image-20231206202449876使用土产货汇注劳动

图片

image-20231206202459875接口讲解:

接口是我土产货使用springboot 框架配合 hibernate 配合jpa写的一个后台劳动  :

固原市圣电壁纸有限公司客户端具体达成:
"requestPermissions": [  {    "name": "ohos.permission.INTERNET"  }]
如图

图片

image.png汇注肯求 用具类达成
import http from '@ohos.net.http';import Constants, { ContentType } from '../constant/Constants';import Logger from './Logger';import { NewsData } from '../viewmodel/NewsData';export function httpRequestGet(url: string) {  return httpRequest(url, http.RequestMethod.GET);}export function httpRequestPost(url: string, params?: NewsData) {  return httpRequest(url,首页-盛 泰依咖啡有限公司 http.RequestMethod.POST,
首页-盛 加玉咖啡有限公司 params);}function httpRequest(url: string,
白鸽磨料磨具有限公司 method: http.RequestMethod,params?: NewsData){  let httpRequest = http.createHttp();  let responseResult = httpRequest.request(url, {    method: method,    readTimeout: Constants.HTTP_READ_TIMEOUT,//读取超每每间 可选,默许为60000ms    header: {      'Content-Type': ContentType.JSON    },    connectTimeout: Constants.HTTP_READ_TIMEOUT,公司简介//贯穿超每每间  可选,默许为60000ms    extraData: params // 肯求参数  });  return responseResult.then((value: http.HttpResponse)=>{      Logger.error("肯求景况 --> "+value.responseCode)     if(value.responseCode===200){       Logger.error("肯求奏效");       let getresult = value.result;       Logger.error('肯求复返数据', JSON.stringify(getresult));       return getresult;     }  }).catch((err)=>{    return "";  });}
打印日记用具类达成 :
import hilog from '@ohos.hilog';class Logger {  private domain: number;  private prefix: string;  private format: string = '%{public}s, %{public}s';  /**   * constructor.   *   * @param Prefix Identifies the log tag.   * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF.   */  constructor(prefix: string = 'MyApp', domain: number = 0xFF00) {    this.prefix = prefix;    this.domain = domain;  }  debug(...args: string[]): void {    hilog.debug(this.domain, this.prefix, this.format, args);  }  info(...args: string[]): void {    hilog.info(this.domain, this.prefix, this.format, args);  }  warn(...args: string[]): void {    hilog.warn(this.domain, this.prefix, this.format, args);  }  error(...args: string[]): void {    hilog.error(this.domain, this.prefix, this.format, args);  }}export default new Logger('HTTPS', 0xFF00)
登录界面达成 :
/** * 创建东谈主:xuqing * 创建时刻:2023年8月2日08:38:50 * 类讲解: * * */import prompt from '@ohos.promptAction';import router from '@ohos.router';import CommonConstants from '../common/constant/CommonConstants';import StyleConstant from '../common/constant/StyleConstant';import { httpRequestGet }  from '../common/utils/OKhttpUtil';import CommonConstant from '../common/constant/CommonConstants';import  Logger from '../common/utils/Logger';@Extend(TextInput) function inputStyle () {  .placeholderColor($r('app.color.placeholder_color'))  .height($r('app.float.login_input_height'))  .fontSize($r('app.float.big_text_size'))  .backgroundColor($r('app.color.background'))  .width(CommonConstants.FULL_PARENT)  .padding({ left: CommonConstants.INPUT_PADDING_LEFT })  .margin({ top: $r('app.float.input_margin_top') })}@Extend(Line) function lineStyle () {  .width(CommonConstants.FULL_PARENT)  .height($r('app.float.line_height'))  .backgroundColor($r('app.color.line_color'))}@Extend(Text) function blueTextStyle () {  .fontColor($r('app.color.login_blue_text_color'))  .fontSize($r('app.float.small_text_size'))  .fontWeight(FontWeight.Medium)}@Extend(Text) function blackTextStyle () {  .fontColor($r('app.color.black_text_color'))  .fontSize($r('app.float.big_text_size'))  .fontWeight(FontWeight.Medium)}/** * Login page */@Entry@Componentstruct LoginPage {  @State account: string = '';  @State password: string = '';  @State isShowProgress: boolean = false;  private timeOutId = null;  @Builder imageButton(src: Resource) {    Button({ type: ButtonType.Circle, stateEffect: true }) {      Image(src)    }    .height($r('app.float.other_login_image_size'))    .width($r('app.float.other_login_image_size'))    .backgroundColor($r('app.color.background'))  } async  login() {    if (this.account === '' 


上一篇:没有了
下一篇:没有了