鸿蒙的基本项目_tabbar,首页,购物车,我的

news2025/2/9 10:52:42

以上效果,由四个ets文件实现,分别是容器页面。首页,购物车,我的。

页面里的数据,我是用json-server进行模拟的数据。

一、容器页面

使用组件Tabs和Tabcontent结合。

import Home from "./Home";
import ShoppingCar from "./ShoppingCar";
import My from "./My";

@Entry
@Component
struct TabsExample {

  // 定义变量,表示当前选中的下标
  @State currentIndex:number = 0;

  @State arr:Array<Object> =[
    {
      icon:"/imgs/home.png",
      selectedIcon:"/imgs/home2.png",
      text:"首页"
    },
    {
      icon:"/imgs/gouwuche.png",
      selectedIcon:"/imgs/gouwuche2.png",
      text:"购物车"
    },
    {
      icon:"/imgs/wode.png",
      selectedIcon:"/imgs/wode2.png",
      text:"我的"
    }
  ]

  build() {
    Column() {
      Tabs({ barPosition: BarPosition.End }) {
        ForEach(this.arr,(item,idx)=>{
          TabContent() {
            if(this.currentIndex==0){
              Home()
            }else if(this.currentIndex==1){
              ShoppingCar()
            }else{
              My()
            }
          }.tabBar({
            icon: (this.currentIndex==idx)?item.selectedIcon:item.icon,
            text:item.text
          })
        })

      }
      .width(360)
      .height("100%")
      .onChange((idx)=>{
        this.currentIndex = idx;
      })

    }.width('100%')
  }
}

二、首页

import http from '@ohos.net.http';
import router from '@ohos.router';

interface IBook{
  id:string,
  name:string,
  author:string,
  publish:string,
  img:string
}

@Entry
@Component
  // 对外开放
export default struct Home {

  @State books:Array<IBook> = [];

  @State imgs: Array<string> = [];
  scroller: Scroller = new Scroller()

  // 创建http的请求对象
  httpRequest = http.createHttp();

  // 获取轮播图数据
  getBanners(){

    this.httpRequest.request("http://localhost:3000/bannerImgs",(err,data)=>{
      if(!err){
        this.imgs = JSON.parse(data.result as string);
        this.initScroll();
      }
    })
  }

  // 获取书籍信息
  getBooks(){
    //发送请求
    this.httpRequest.request("http://localhost:3000/books",(err,data)=>{
      if(!err){
        // console.log("data",data)
        //   data对象的result属性是数据
        //   console.log("data.result",data.result)
        //   JSON.parse():把字符串转成json对象。
        this.books = JSON.parse(data.result as string);
      }
    })
  }

  // aboutToAppear():这个生命周期钩子函数的调用时机:当本页面(组件)加载时,
  aboutToAppear(){
    this.getBooks();
    this.getBanners();
  }

  // 自行实现轮播图功能:
  initScroll(){
    let index = 0;
    let maxIndex = this.imgs.length-1;
    setInterval(()=>{
      index++;
      if(index>maxIndex){
        index = 0;
      }
      this.scroller.scrollTo({
        xOffset:index*400,
        yOffset:0,
        animation:{
          duration:1000,
          curve:Curve.Linear
        }
      })
    },2000)
  }

  build() {
    // 最外层使用弹性盒布局,纵向分为三部分:搜索框,滚动容器,底部。
    Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceBetween }) {
      // 1、搜索框
      Search({ placeholder: '请输入您要搜索的内容', icon: "imgs/search01.png" })
        .searchButton('搜索')
        .textAlign(TextAlign.Center)
        .width("100%")
        .height(60)
        .backgroundColor('#F5F5F5')
        .placeholderColor(Color.Grey)
        .placeholderFont({ size: 20, weight: 400 })
        .textFont({ size: 30, weight: 400 })
        .onSubmit(()=>{
          console.log("onSubmit")
          router.pushUrl({
            url:"pages/SearchPage"
          })
        })

      Scroll() {
        Column() {
          // 1)、轮播图
          List({scroller:this.scroller}){
            ForEach(this.imgs,(item)=>{
              ListItem(){
                Image(item)
                  .width(400)
                  .height("100%")
              }
            })
          }
          .width("100%")
          .height(250)
          .listDirection(Axis.Horizontal)

          Swiper(){
            ForEach(this.imgs,(item)=>{
                Image(item)
                  .width(400)
                  .height("100%")
            })
          }

          // 2)、导航
          Grid() {
            GridItem() {
              Column() {
                Image("https://m.360buyimg.com/mobilecms/s120x120_jfs/t1/178015/31/13828/6862/60ec0c04Ee2fd63ac/ccf74d805a059a44.png")
                  .width(40)
                  .height(40)
                Text("京东超市")
              }
            }

            GridItem() {
              Column() {
                Image("https://m.360buyimg.com/mobilecms/s120x120_jfs/t1/178015/31/13828/6862/60ec0c04Ee2fd63ac/ccf74d805a059a44.png")
                  .width(40)
                  .height(40)
                Text("京东超市")
              }
            }

            GridItem() {
              Column() {
                Image("https://m.360buyimg.com/mobilecms/s120x120_jfs/t1/178015/31/13828/6862/60ec0c04Ee2fd63ac/ccf74d805a059a44.png")
                  .width(40)
                  .height(40)
                Text("京东超市")
              }
            }

            GridItem() {
              Column() {
                Image("https://m.360buyimg.com/mobilecms/s120x120_jfs/t1/178015/31/13828/6862/60ec0c04Ee2fd63ac/ccf74d805a059a44.png")
                  .width(40)
                  .height(40)
                Text("京东超市")
              }
            }

            GridItem() {
              Column() {
                Image("https://m.360buyimg.com/mobilecms/s120x120_jfs/t1/178015/31/13828/6862/60ec0c04Ee2fd63ac/ccf74d805a059a44.png")
                  .width(40)
                  .height(40)
                Text("京东超市")
              }
            }

            GridItem() {
              Column() {
                Image("https://m.360buyimg.com/mobilecms/s120x120_jfs/t1/178015/31/13828/6862/60ec0c04Ee2fd63ac/ccf74d805a059a44.png")
                  .width(40)
                  .height(40)
                Text("京东超市")
              }
            }

            GridItem() {
              Column() {
                Image("https://m.360buyimg.com/mobilecms/s120x120_jfs/t1/178015/31/13828/6862/60ec0c04Ee2fd63ac/ccf74d805a059a44.png")
                  .width(40)
                  .height(40)
                Text("京东超市")
              }
            }

            GridItem() {
              Column() {
                Image("https://m.360buyimg.com/mobilecms/s120x120_jfs/t1/178015/31/13828/6862/60ec0c04Ee2fd63ac/ccf74d805a059a44.png")
                  .width(40)
                  .height(40)
                Text("京东超市")
              }
            }

          }
          .columnsTemplate('1fr 1fr 1fr 1fr')
          .rowsTemplate('1fr 1fr')
          .columnsGap(10)
          .width('100%')
          .backgroundColor(0xededed)
          .height(180)

          // 3)、列表
          Column(){
            ForEach(this.books,(item)=>{
              Row(){
                Image(item.img).width(120).height(120).margin(20).onClick(()=>{
                  // 跳转到详情页面的同时,传递了参数:bookid
                  router.pushUrl({
                    url:"pages/Detail",
                    params:{
                      bookid:item.id
                    }
                  })
                })
                Column(){
                  Text(item.name).fontSize(22).width("100%").margin(10)
                  Text(item.author).fontSize(22).width("100%").margin(10)
                  Text(item.publish).fontSize(22).width("100%")
                }
                .width(200)
                .height("100%")
              }
              .width("95%")
              .height(140)
              .margin(10)
              .backgroundColor(0xdddddd)
              .borderRadius(10)
              .margin(10)
            })
          }.width("100%")

        }.width("100%")
      }
      .width("100%")
      .height("100%")
      .align(Alignment.TopStart)

    }
    .width("100%")
    .height("100%")
  }
}

三、购物车

import router from '@ohos.router';
import http from '@ohos.net.http';
import {storage} from "../utils/globalData"

// 自定义类型:商品类型

interface IBook{
  isChecked?:boolean,
  id:string,
  name:string,
  price:number,
  count:number,
  smallJi?:number,
  limit?:number
}

@Entry
@Component
export default struct ShoppingCar {

  // 定义状态
  // 购物车的商品
  @State bookList:Array<IBook> = []
  // 全选复选框的数据
  @State isAllChecked:boolean = false;
  // 定义一个状态,表示当前是否登录
  @State isLogin:boolean = storage.get("username");

  //获取购物车数据:
  getCarts(){
    const httpCreate = http.createHttp();
    httpCreate.request(`http://localhost:3000/carts`,(err,data)=>{
      if(!err){
       this.bookList = JSON.parse(data.result as string);
      }
    })
  }

  // 开闭原则:对扩展开放,对修改(逻辑)关闭。进一步解释,最好程序写成可配置的(数据就是配置项)。
  // 页面(组件)加载完毕
  aboutToAppear(){
    // 如果没有登录,则不获取购物车的数据
    if(this.isLogin){
      this.getCarts();
    }
  }

  // 更新数量
  updateCount(item){
    const httpCreate = http.createHttp();
    httpCreate.request(`http://localhost:3000/carts/${item.id}`,{
      method:http.RequestMethod.PUT,
      extraData:{
        name:item.name,
        price:item.price,
        count:item.count,
        smallJi:item.smallJi
      }
    },(err,data)=>{
      if(!err){
        //更新数量功后,重新获取最新数据
        this.getCarts();
      }
    })
  }

  // 定义加号按钮的功能
  addCount(item:IBook){
    //   点击加号按钮
    if(item.limit && item.count==item.limit){ //做限购的处理
      return;
    }
    item.count++;
    item.smallJi = item.count*item.price;
    console.log("item.count",item.count);
    this.bookList = [...this.bookList];
    this.updateCount(item);
  }

  // 定义减号按钮的功能
  subCount(item:IBook){
    //   点击减号按钮
    if(item.count==1){
      return;
    }
    item.count--;
    item.smallJi = item.count*item.price;
    console.log("item.count",item.count);
    this.bookList = [...this.bookList];
    this.updateCount(item);
  }

  // 全选功能
  checkAll(){
    // 当界面上的复选框选中状态发生变化时,数据跟着变化
    this.isAllChecked = !this.isAllChecked;
    //让其它商品的选中状态跟着同步发生变化
    this.bookList.forEach(item=>item.isChecked = this.isAllChecked);

    this.bookList = [...this.bookList];
  }

  // 反向控制全选框
  backCheckAll(item:IBook){
    console.log(item.name+"的复选框被点了")
    item.isChecked = !item.isChecked;
    // console.log("item.isChecked",item.isChecked)
    // 数组的api:every 表示 当数组的每一项如果都符合回调函数里写的条件时,every的返回值是true;否则,返回false。
    // if(this.bookList.every(item=>item.isChecked==true)===true){
    //   this.isAllChecked= true;
    // }else{
    //   this.isAllChecked = false;
    // }
    this.isAllChecked = this.bookList.every(item=>item.isChecked==true);
    this.bookList = [...this.bookList];
  }

  // 总计
  totalMoney(){
    // let money = 0;
    // this.bookList.forEach(item=>{
    //   if(item.isChecked){
    //     money+=item.smallJi;
    //   }
    // })
    // return money;
    //
    return this.bookList.reduce((preValue,item)=>{return preValue+(item.isChecked?item.smallJi:0)},0)
  }

  // 删除购物车的商品
  deleteGoods(id){

    const httpCreate = http.createHttp();
    httpCreate.request(`http://localhost:3000/carts/${id}`,{
      method:http.RequestMethod.DELETE
    },(err,data)=>{
      if(!err){
        //删除成功后,重新获取最新数据
        this.getCarts();
      }
    })

  }

  // UI的描述
  build() {
    Column(){
      // 本页面的标签
      Row() {
        Image($r("app.media.back")).width(50).height(30).margin(20).onClick(()=>{
          router.back();
        })
        Blank().width(60)
        Text("购物车")
          .fontSize(30)
          .width("100%")
          .height(60)
      }
      if(!this.isLogin){
        Column(){
          Text("亲,您还没有登录").fontSize(30).fontColor(Color.Red);
          Button("请登录").onClick(()=>{
            router.replaceUrl({
              url:"pages/Login",
              params:{
                from:"pages/Index",
                data:1
              }
            })
          })
        }
      }else{
        // 购物车的标题行
        Row(){
          Checkbox()
            .select(this.isAllChecked)
            .onClick(()=>{
              this.checkAll();
            })
          Text("名称")
            .width(80)
          Text("价格")
            .width(40)
          Text("数量")
            .width(96)
            .textAlign(TextAlign.Center)
          Text("小计")
            .width(60)
            .textAlign(TextAlign.Center)
          Text("删除")
            .width(60)
            .textAlign(TextAlign.Center)
        }
        .width("100%")
        .height(60)
        .backgroundColor(0xededed)

        // 购物车中的数据的显示
        ForEach(this.bookList,(item,idx)=>{
          Row(){
            Checkbox().select(item.isChecked)
              .onClick(()=>{
                this.backCheckAll(item);
              })
            Text(item.name)
              .width(65)
            Text(item.price.toString())
              .width(50)
              .textAlign(TextAlign.Center)

            Counter() {
              Text(this.bookList[idx].count.toString())
            }.margin(10)
            .onInc(() => {
              this.addCount(item);
            })
            .onDec(() => {
              this.subCount(item);
            })
            // 小计
            Text((this.bookList[idx].smallJi).toString()).width(55)
            Image("/imgs/delete.png").width(40).height(40).onClick(()=>{
              this.deleteGoods(item.id)
            })
          }
          .width("100%")
          .height(60)
        })
        Divider().strokeWidth(10)
        Text(`总计:${this.totalMoney()}`)
      }
    }
    .width("100%")
    .height("100%")

  }
}

四、我的


import {storage} from "../utils/globaldata"

import router from '@ohos.router'
@Entry
@Component
export default struct My {

  //页面创建加载完毕
  aboutToAppear(){
    console.log("My:aboutToAppear")
  }
  // 页面显示
  onPageShow(){
    console.log("My:onPageShow")
  }
  // 页面隐藏
  onPageHide(){
    console.log("My:onPageHide")
  }
  // 销毁
  aboutToDisappear(){
    console.log("My:aboutToDisappear")
  }

  toLogin(){
    router.replaceUrl({
      url:"pages/Login",
      params:{
        from:"pages/Index",
        data:2
      }
    })
  }

  logout(){
    storage.delete("username");
    router.pushUrl({
      url:"pages/Index"
    })
  }

  build() {
    Scroll() {
      Column() {
        Row(){
          Image($r("app.media.back")).width(50).height(30).margin(20).onClick(()=>{
            router.back();
          })
          Button("去注册").onClick(()=>{
            router.pushUrl({
              url:"pages/Reg"
            })
          })
          Button("去登录").onClick(()=>{
           this.toLogin()
          })
          Button("退出登录").onClick(()=>{
            this.logout()
          })
          Button("修改密码").onClick(()=>{
            router.pushUrl({
              url:"pages/Password"
            })
          })
        }.width("100%").height(60)
        Row() {
          Image("/imgs/1.jpg").width(140).height(140).borderRadius(70).onClick(()=>{
            this.toLogin();
          })
        }.width("100%")
        .height(200)
        .margin({
          top: 50
        })
        .justifyContent(FlexAlign.Center)
        // 如果当前处于登录状态(是否保存着有用户名)
        if(storage.get('username')){
          Text(storage.get('username')).fontSize(30)
          Text(storage.get('phone')).fontSize(30).margin(10)
        }

        Blank().height(20)
        Divider().strokeWidth(2).backgroundColor(0xededed)

        Blank().height(20)
        Grid() {
          GridItem() {
            Text("待付款")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }

          GridItem() {
            Text("我的订单")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }

          GridItem() {
            Text("店铺关注")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }
        }
        .columnsTemplate('1fr 1fr 1fr')
        .rowsTemplate('1fr 1fr')
        .columnsGap(10)
        .rowsGap(10)
        .width('95%')
        .height(110)
        .backgroundColor(Color.White)
        .borderRadius(10)


        Blank().height(20)
        Divider().strokeWidth(2).backgroundColor(0xededed)
        Blank().height(20)

        Grid() {
          GridItem() {
            Text("优惠券")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }

          GridItem() {
            Text("我的足迹")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }

          GridItem() {
            Text("我的收藏")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }

          GridItem() {
            Text("浏览记录")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }

          GridItem() {
            Text("我的常卖")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }

          GridItem() {
            Text("我的推荐")
              .fontSize(20)
              .width(90)
              .height(90)
              .backgroundColor(0xededed)
              .borderRadius(10)
              .textAlign(TextAlign.Center)
          }
        }
        .columnsTemplate('1fr 1fr 1fr')
        .rowsTemplate('1fr 1fr')
        .columnsGap(10)
        .rowsGap(10)
        .width('95%')
        .height(220)
        .backgroundColor(Color.White)
        .borderRadius(10)

      }
      .align(Alignment.Start)
    }.height("100%")
    .width("100%")
  }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1335826.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

并发编程——3.细说线程

这篇文章我们来详细的说一下并发编程中的线程及其相关的内容 目录 1.线程的创建 1.1通过继承Thread 1.2通过实现Runnable接口的方式 1.3使用FutureTask方式&#xff08;实现Callable接口的方式&#xff09; 1.4三种方式的区别 2.线程的原理 3.线程的常用方法 3.1start…

音频修复增强软件iZotope RX 10 mac特点介绍

iZotope RX 10 mac是一款音频修复和增强软件。 iZotope RX 10 mac软件特点 声音修复&#xff1a;iZotope RX 10可以去除不良噪音、杂音、吱吱声等&#xff0c;使音频变得更加清晰干净。 音频增强&#xff1a;iZotope RX 10支持对音频进行音量调节、均衡器、压缩器、限制器等处…

【JavaScript】异步解决方案的发展历程

✨ 专栏介绍 在现代Web开发中&#xff0c;JavaScript已经成为了不可或缺的一部分。它不仅可以为网页增加交互性和动态性&#xff0c;还可以在后端开发中使用Node.js构建高效的服务器端应用程序。作为一种灵活且易学的脚本语言&#xff0c;JavaScript具有广泛的应用场景&#x…

LabVIEW 通信应用程序框架概述

概述 人和机器对可靠、无处不在且价格实惠的无线数据连接的不断需求给无线行业带来了巨大的压力。业界一致认为&#xff0c;下一代无线网络 (5G) 需要在 2020 年之前将容量提高一千倍&#xff0c;而成本不会相应增加。为了应对这一技术挑战&#xff0c;无线研究人员需要跳出框…

一体机定制_工控触控一体机安卓主板方案

工控一体机是一种集成化的硬件方案&#xff0c;采用了联发科MT8768八核芯片和12nm制程工艺。该芯片拥有2.0GHz的主频和IMG PowerVR GE8320图形处理GPU&#xff0c;具备强大的视频处理能力&#xff0c;并且兼容大部分的视频格式和解码能力。工控一体机搭载了Android 9.0操作系统…

【Python3】\u字符与中文字串互转

小水。 encode和decode&#xff1a; str没有decode函数&#xff0c;但对应的有encode函数&#xff0c;该函数作用是转码为bytes对象bytes通过decode函数转换回对应的str对于一些偏激的(可以用过分来形容)的字符串&#xff0c;例如一二三\\u56db\\u4e94\\u516d&#xff0c;是有…

20231225在WIN10下使用SSH连接Ubuntu20.04.6

20231225在WIN10下使用SSH连接Ubuntu20.04.6 2023/12/25 23:03 https://jingyan.baidu.com/article/5552ef479e1856108ffbc9e3.html Win10怎么开启SSH功能 Win10怎么开启SSH功能,下面就一起来看看吧! 工具/原料 华硕天选4 Windows10 方法/步骤 点击左下角的开始菜单,打开Wind…

电脑如何把多张图片压缩?一键批量压缩图片

大家在日常工作和学习中是不是经常使用图片&#xff0c;有些高清的图片体积就会比较大&#xff0c;在传输和储存时就非常的不方便&#xff0c;碰到这样的情况只需要通过图片压缩就可以解决&#xff0c;但是如果是处理的图片比较多&#xff0c;一张张的压缩就会特别麻烦&#xf…

6 UVM Object

uvm_object类是所有uvm层次类的基类&#xff0c;如uvm_report_object、uvm_component、uvm_transaction、uvm_sequence_item、uvm_sequence等。它在定义一组方法&#xff08;如create, copy, print, clone, compare, record等&#xff09;方面起着重要作用。 6.1 UVM Utility …

我在 VSCode 插件里接入了 ChatGPT,解决了Bug无法定位的难题

作为一名软件开发者&#xff0c;我时常面临着代码中Bug的定位和解决问题。这个过程往往既费时又充满挑战。然而&#xff0c;最近我在我的VSCode插件中接入了ChatGPT&#xff0c;这个决定彻底改变了我处理Bug的方式。 Bug&#xff1a;开发者的噩梦 在开发过程中&#xff0c;遇…

《Spring Cloud学习笔记:Nacos配置管理 OpenFeign LoadBalancer Getway》

基于Feign的声明式远程调用&#xff08;代码更优雅&#xff09;&#xff0c;用它来去代替我们之前的RestTemplate方式的远程调用 1. Nacos配置管理 Nacos除了可以做注册中心&#xff0c;同样也可以做配置管理来使用。 利用Nacos实现统一配置管理以及配置的热更新&#xff1a;…

86% 的网络攻击是通过加密渠道进行

自 2022 年以来&#xff0c;HTTPS 威胁增长了 24%&#xff0c;凸显了针对加密通道的网络犯罪策略的复杂性。 制造业连续第二年成为最常受到攻击的行业&#xff0c;教育和政府组织的攻击同比增幅最高。此外&#xff0c;包括恶意 Web 内容和恶意软件负载在内的恶意软件继续主导其…

AcWing算法进阶课-1.17.1费用流

算法进阶课整理 CSDN个人主页&#xff1a;更好的阅读体验 原题链接 题目描述 给定一个包含 n n n 个点 m m m 条边的有向图&#xff0c;并给定每条边的容量和费用&#xff0c;边的容量非负。 图中可能存在重边和自环&#xff0c;保证费用不会存在负环。 求从 S S S 到 …

geyser互通服基岩版进不去

Java版需要在服务器安全组开通TCP端口&#xff08;如果有宝塔&#xff0c;也需要开通&#xff09; geyser下载好的安装运行也需要开通端口&#xff0c;但是它是UDP的&#xff08;但是我同时也开启了TCP&#xff0c;可能不需要&#xff1f; Java 版玩家隧道 Java 版玩家使用 T…

Cloudstack多个管理服务器节点

https://docs.cloudstack.apache.org/en/4.18.0.0/adminguide/reliability.html 参考翻译&#xff1a; 代理上支持多个管理服务器 在具有多个管理服务器的Cloudstack环境中&#xff0c;可以根据算法配置代理&#xff0c;将其连接到哪个管理服务器。这对于内部负载均衡器或高可…

渗透测试——1.3计算机网络基础

一、黑客术语 1、肉鸡&#xff1a;被黑客攻击电脑&#xff0c;可以受黑客控制不被发现 2、端口&#xff08;port&#xff09;&#xff1a;数据传输的通道 3、弱口令&#xff1a;强度不高&#xff0c;容易被猜到的口令、密码 4、客户端&#xff1a;请求申请电脑&#xff08;…

web前端项目-七彩夜空烟花【附源码】

web前端项目-七彩动态夜空烟花【附源码】 本项目仅使用了HTML&#xff0c;代码简单&#xff0c;实现效果绚丽&#xff0c;且本项目代码直接运行即可实现&#xff0c;无需图片素材&#xff0c;接下来让我们一起实现一场美丽的烟花秀叭 运行效果&#xff1a;鼠标点击和移动可控制…

Linux服务器流量监控、统计、限制、实时流量,按小时查询、按天数查询、按月数查询、按周数查询、查询TOP10等等各种纬度统计

Linux服务器流量监控、统计、限制、实时流量,按小时查询、按天数查询、按月数查询、按周数查询、查询TOP10等等各种纬度统计。 ServerStatus-V 是一个酷炫高逼格的云探针、云监控、服务器云监控、多服务器探针。使用方便,信息直观。ServerStatus-V 是 ServerStatus 中文版 项…

k8s 组件

k8s: kubernets:8个字母省略&#xff0c;就是k8s. 自动部署&#xff0c;自动扩展和管理容器化的应用程序的一个开源系统。 k8s是负责自动化运维管理多个容器化程序的集群&#xff0c;是一个功能强大的容器编排工具。 以分布式和集群化的方式进行容器管理。 1.20面试版本 …

如何使用 Matplotlib 绘制 3D 圣诞树

系列文章目录 前言 转自&#xff1a;How to draw a 3D Christmas Tree with Matplotlib | by Timur Bakibayev, Ph.D. | Analytics Vidhya | Mediumhttps://medium.com/analytics-vidhya/how-to-draw-a-3d-christmas-tree-with-matplotlib-aabb9bc27864 因为我们把圣诞树安装…