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

【鸿蒙开发】饿了么页面练习

0. 整体结构

整体划分3部分。店铺部分,购物车部分,金额统计部分。使用 Stack 把3部分堆叠

0.1 整体页面 Index.ets

修改 Index.ets ,使用堆叠布局,并居底部对齐

import { ElShop } from '../components/ElShop'
import { ElShoppingCart } from '../components/ElShoppingCart'
import { ElSubtotal } from '../components/ElSubtotal'@Entry
@Component
struct Index {build() {Column() {Stack({ alignContent: Alignment.Bottom }) {ElShop()ElShoppingCart()ElSubtotal()}}.width("100%").height("100%")}
}

0.2 创建 ElShop 组件

创建 ElShop 店铺部分组件

@Component
export struct ElShop {build() {Column() {}.width("100%").height("100%").backgroundColor(Color.Red)}
}

0.3 创建 ElShoppingCart 组件 

创建购物车部分组件

@Component
export struct ElShoppingCart {build() {Column() {}.width("100%").height(300).backgroundColor(Color.Green)}
}

0.4 创建 ElSubtotal 组件 

创建金额统计部分组件

@Component
export struct ElSubtotal {build() {Column() {}.width("100%").height(80).backgroundColor(Color.Blue)}
}

0.5 创建 model

创建 models 文件夹,创建 Product.ets 文件

export class Product {id: number = 0name: string = ""positive_reviews: string = ""food_label_list: string[] = []price: number = 0picture: string = ""description: string = ""tag: string = ""monthly_sales: number = 0
}export class SelectedProduct extends Product {count: number = 0
}export class Category {id: number = 0name: string = ""foods: Product[] = []
}

1. 店铺部分

1.1 修改 ElShop 组件

划分 header,tabbar,body 三部分

Column [ ElShopHeader,ElShopTabbar,ElShopBody ]

import { ElShopHeader } from './ElShopHeader'
import { ElShopTabbar } from './ElShopTabbar'
import { ElShopBody } from './ElShopBody'@Component
export struct ElShop {build() {Column() {ElShopHeader()ElShopTabbar()ElShopBody()}.width("100%").height("100%").backgroundColor(Color.White)}
}

1.2 创建 ElShopHeader 组件

Row [ 返回图标,(搜索图标,文字),消息图标,喜欢图标,加号图标 ]

@Component
export struct ElShopHeader {build() {Row() {Image($r("app.media.left")).width(20).height(20).fillColor("#191919")Row() {Image($r('app.media.search')).width(14).aspectRatio(1).fillColor('#555').margin({ right: 5 })Text('搜一搜').fontSize(12).fontColor('#555')}.width(150).height(30).backgroundColor('#eee').borderRadius(15).padding({ left: 5, right: 5 })Image($r('app.media.message')).width(20).fillColor("#191919")Image($r('app.media.favor')).width(20).fillColor("#191919")Image($r("app.media.add")).width(20).fillColor("#191919")}.width('100%').height(60).backgroundColor('#fbfbfb').padding(10).justifyContent(FlexAlign.SpaceAround)}
}

1.3 创建 ElShopTabbar 组件

Row [ 点餐,评价,商家 ]

每一个tab用 @Builder 函数创建

@Component
export struct ElShopTabbar {@BuilderTabItem(active: boolean, title: string, subtitle?: string) {Column() {Text() {Span(title)if (subtitle) {Span(' ' + subtitle).fontSize(10).fontColor(active ? '#000' : '#666')}}.layoutWeight(1).fontColor(active ? '#000' : '#666').fontWeight(active ? FontWeight.Bold : FontWeight.Normal)Column().width(20).height(3).borderRadius(5).backgroundColor(active ? '#02B6FD' : 'transparent')}.alignItems(HorizontalAlign.Center).padding({ left: 15, right: 15 })}build() {Row() {this.TabItem(true, '点餐')this.TabItem(false, '评价', '196')this.TabItem(false, '商家')}.width("100%").height(40).justifyContent(FlexAlign.Start).backgroundColor('#fbfbfb')}
}

1.4 创建 ElShopBody 组件

这里分为左边分类列表,右边商品列表

Row [ 分类列表,商品列表 ]

import { ElShopCategory } from './ElShopCategory'
import { ElShopProduct } from './ElShopProduct'@Component
export struct ElShopBody {build() {Row() {ElShopCategory()ElShopProduct()}.width('100%').layoutWeight(1).alignItems(VerticalAlign.Top)}
}

1.5 创建 ElShopCategory 组件

分类列表,每一项是分类文字

import { Category } from '../models/Product'@Component
export struct ElShopCategory {@State categoryList: Category[] = [{ id: 1, name: '必点招牌', foods: [] },{ id: 2, name: '超值套餐', foods: [] },{ id: 3, name: '杂粮主食', foods: [] },]@State categoryIndex: number = 0build() {Column() {ForEach(this.categoryList, (item: Category, index: number) => {Text(item.name).width('100%').height(40).textAlign(TextAlign.Center).fontSize(12).backgroundColor(this.categoryIndex === index ? '#fff' : 'transparent').onClick(() => {this.categoryIndex = index})})}.width(90).height('100%').backgroundColor('#eee')}
}

1.6 创建 ElShopProduct 组件

商品列表,每一项是商品项

import { ElProductItem } from './ElProductItem'@Component
export struct ElShopProduct {build() {List({ space: 20 }) {ForEach([1, 2, 3, 4, 5, 6, 7, 8, 9], () => {ListItem() {ElProductItem()}})}.layoutWeight(1).backgroundColor('#fff').padding({ left: 10, right: 10 })}
}

1.7 创建 ElProductItem 组件

商品的每一项

Row [ 图片,内容 ]

@Component
export struct ElProductItem {build() {Row() {Image('https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F67ba10b0-b4a0-4dd7-b343-31830e01b616%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1711612969&t=b2102c0d151f8225ba531caadf26dd6f').width(60).aspectRatio(1).borderRadius(8)Column({ space: 5 }) {Text('猪脚+肉卷+鸡蛋').fontSize(14).textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)Text('用料:猪脚,肉卷,鸡蛋').fontSize(12).fontColor('#999').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)Row() {Text() {Span('¥ ').fontColor('#FF4B33').fontSize(10)Span('38.65').fontColor('#FF4B33').fontWeight(FontWeight.Bold)}// 商品数量操作}.justifyContent(FlexAlign.SpaceBetween).width('100%')}.layoutWeight(1).alignItems(HorizontalAlign.Start).justifyContent(FlexAlign.SpaceBetween).padding({ left: 10, right: 10 }).height(60)}.alignItems(VerticalAlign.Top)}
}

2. 金额统计部分

2.1 修改 ElSubtotal 组件

Row [ 购物车图标,金额文字,结算按钮 ]

@Component
export struct ElSubtotal {build() {Row() {Badge({count: 1,position: BadgePosition.RightTop,style: { badgeSize: 20 }}) {Image($r("app.media.shopping_cart_icon"))}.width(50).height(50).margin({ right: 10 })Column() {Text() {Span('¥').fontSize(14)Span('0').fontSize(24)}Text('另需配送费约 ¥3.3').fontSize(12).fontColor('#999')}.layoutWeight(1).alignItems(HorizontalAlign.Start)Button('去结算').fontSize(18).backgroundColor('#02B6FD').padding({ left: 30, right: 30 })}.width('100%').height(80).padding(10).alignItems(VerticalAlign.Center).backgroundColor(Color.White).border({color: "#f5f5f5",width: {top: "1"}})}
}

3. 购物车部分

给购物车内容的外层嵌套一个透明的遮罩

外层遮罩 Column [ Colunm( 标题,已选商品列表 ) ]

3.1 修改 ElShoppingCart 组件

import { ElProductItem } from './ElProductItem'@Component
export struct ElShoppingCart {build() {Column() {Column() {Row() {Text('已选商品').fontSize(13).fontWeight(600)Row() {Image($r("app.media.delete")).height(14).fillColor('#999').margin({ right: 5 })Text('清空').fontSize(13).fontColor('#999')}}.width('100%').justifyContent(FlexAlign.SpaceBetween).padding(15)List({ space: 20 }) {ForEach([1, 2, 3, 4], () => {ListItem() {ElProductItem()}})}.divider({strokeWidth: 1,color: '#ddd'}).padding({ left: 15, right: 15, bottom: 100 })}.backgroundColor('#fff').borderRadius({topLeft: 16,topRight: 16})}.width('100%').height('100%').justifyContent(FlexAlign.End).backgroundColor('rgba(0,0,0,0.5)')}
}

3.2 修改购物车显示隐藏

当点击底部统计部分才显示购物车部分

修改 Index.ets ,添加 showShoppingCart 属性

@Entry
@Component
struct Index {@State showShoppingCart: boolean = falsebuild() {Column() {Stack({ alignContent: Alignment.Bottom }) {ElShop()if (this.showShoppingCart) {ElShoppingCart()}ElSubtotal({ showShoppingCart: $showShoppingCart })}}.width("100%").height("100%")}
}

修改 ElSubtotal 金额统计部分组件,接受 showShoppingCart 属性

@Link showShoppingCart: boolean

修改 ElSubtotal 组件,添加点击事件修改 showShoppingCart 值

.onClick(() => {this.showShoppingCart = !this.showShoppingCart
})

 

4. 渲染商品数据

4.1 安装 live-server

使用 npm 全局安装 live-server 包

npm i live-server -g

在 elshop.json 文件夹启动 live-server

live-server

4.2 安装 axios

在项目中安装 axios

ohpm install @ohos/axios

4.3 获取 elshop.json 数据

修改 Index.ets,获取json数据

@Entry
@Component
struct Index {@State showShoppingCart: boolean = false@Provide categoryList: Category[] = []@Provide categoryIndex: number = 0aboutToAppear() {this.getData()}async getData() {const res = await axios.get("http://127.0.0.1:8080/elshop.json")const category = res.data.category.map(item => {const foods = item.foods.map(food => {return { ...food, count: 0 }})return { ...item, foods }})this.categoryList = category}
}

4.4 修改 ElShopCategory 组件

修改从祖先组件获取分类数据

@Component
export struct ElShopCategory {@Consume categoryIndex: number@Consume categoryList: Category[]
}

 4.5 修改 ElShopProduct 组件

修改从祖先组件获取分类数据,循环分类下的商品,并把 product 传给 ElProductItem 组件

import { Category, SelectedProduct } from '../models/Product'
import { ElProductItem } from './ElProductItem'@Component
export struct ElShopProduct {@Consume categoryIndex: number@Consume categoryList: Category[]build() {List({ space: 20 }) {ForEach(this.categoryList[this.categoryIndex]?.foods ?? [], (product: SelectedProduct) => {ListItem() {ElProductItem({ product })}})}.layoutWeight(1).backgroundColor('#fff').padding({ left: 10, right: 10 })}
}

 4.6 修改 ElProductItem 组件

修改 ElProductItem 组件,接收 product 数据

import { SelectedProduct } from '../models/Product'@Component
export struct ElProductItem {product: SelectedProductbuild() {Row() {Image(this.product.picture).width(60).aspectRatio(1).borderRadius(8)Column({ space: 5 }) {Text(this.product.name).fontSize(14).textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)Text(this.product.description).fontSize(12).fontColor('#999').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)Row() {Text() {Span('¥ ').fontColor('#FF4B33').fontSize(10)Span(this.product.price.toString()).fontColor('#FF4B33').fontWeight(FontWeight.Bold)}// 商品数量操作}.justifyContent(FlexAlign.SpaceBetween).width('100%')}.layoutWeight(1).alignItems(HorizontalAlign.Start).justifyContent(FlexAlign.SpaceBetween).padding({ left: 10, right: 10 }).height(60)}.alignItems(VerticalAlign.Top)}
}

5. 商品数量操作

5.1 创建 utils/productUtil.ets 文件

为了持久化保存已选择的商品,把选中的商品保存到 AppStorage 中

  • 声明保存到 AppStoreage 的 key
  • 添加已选的商品 addProduct
  • 删除已选的商品 removeProduct
  • 清空已选的商品 cleartAllProduct
import { Product, SelectedProduct } from '../models/Product'export const SHOPPING_CART_KEY = "SHOPPING_CART"// 添加商品
export const addProduct = (product: Product) => {const products = JSON.parse(AppStorage.Get<string>(SHOPPING_CART_KEY) || '[]') as SelectedProduct[]const selectedProduct = products.find(item => item.id === product.id)if (selectedProduct) {selectedProduct.count++} else {products.push({ ...product, count: 1 })}AppStorage.Set<string>(SHOPPING_CART_KEY, JSON.stringify(products))
}// 删除商品
export const removeProduct = (id: number) => {const products = JSON.parse(AppStorage.Get<string>(SHOPPING_CART_KEY) || '[]') as SelectedProduct[]const index = products.findIndex(item => item.id === id)const selectedProduct = products[index]if (selectedProduct && selectedProduct.count > 0) {selectedProduct.count--if (selectedProduct.count <= 0) {products.splice(index, 1)}}AppStorage.Set<string>(SHOPPING_CART_KEY, JSON.stringify(products))
}// 清空商品
export const clearAllProduct = () => {AppStorage.Set<string>(SHOPPING_CART_KEY, "[]")
}

5.2 修改 Index.ets 文件

在 Index.ets 页面初始化持久化的数据

import { SHOPPING_CART_KEY } from '../utils/productUtil'PersistentStorage.PersistProp(SHOPPING_CART_KEY,"[]")

添加持久化的json数据属性,并监听更新变化

  @StorageLink(SHOPPING_CART_KEY)@Watch("update")productListJson: string = "[]"@Provide selectedProductList: SelectedProduct[] = []update() {this.selectedProductList = JSON.parse(this.productListJson)}

5.3 修改 ElShoppingCart 组件

接收已选中商品数据 selectedProductList

export struct ElShoppingCart {@Consume selectedProductList: SelectedProduct[]
}

并修改列表渲染,把 product 传给 ElProductItem 组件

List({ space: 20 }) {ForEach(this.selectedProductList, (product: SelectedProduct) => {ListItem() {ElProductItem({ product })}})
}

 给清空按钮添加事件

.onClick(() => {clearAllProduct()
})

5.4 创建 ElProductCount 商品数量组件

import { SelectedProduct } from '../models/Product'@Component
export struct ElProductCount {product: SelectedProductbuild() {Row({ space: 8 }) {Image($r('app.media.minus_circle')).width(14).aspectRatio(1).fillColor("#02B6FD")Text('0').fontSize(14)Image($r('app.media.plus_circle')).width(14).aspectRatio(1).fillColor("#02B6FD")}}
}

5.5 修改 ElProductItem 组件

在金额旁边添加数量组件

ElProductCount({ product:this.product })

5.6 修改 ElProductCount 组件

  • 接收 product 数据
  • 接收 selectedProductList 数据
  • 获取该商品的数量
  • 给图标绑定添加商品,删除商品的事件
import { SelectedProduct } from '../models/Product'
import { addProduct, removeProduct } from '../utils/productUtil'@Component
export struct ElProductCount {@Consume selectedProductList: SelectedProduct[]product: SelectedProductgetCount() {const selectedProduct = this.selectedProductList.find(item => item.id === this.product.id)return selectedProduct?.count || 0}build() {Row({ space: 8 }) {Image($r('app.media.minus_circle')).width(14).aspectRatio(1).fillColor("#02B6FD").onClick(() => {removeProduct(this.product.id)})Text(`${this.getCount()}`).fontSize(14)Image($r('app.media.plus_circle')).width(14).aspectRatio(1).fillColor("#02B6FD").onClick(() => {addProduct(this.product)})}}
}

5.7 修改 ElSubtotal 组件

  • 接收已选中商品 selectedProductList
  • 添加商品总数据方法
  • 添加商品总金额方法
@Component
export struct ElSubtotal {@Link showShoppingCart: boolean@Consume selectedProductList: SelectedProduct[]getTotalCount() {return this.selectedProductList.reduce((count, item) => {return count + item.count}, 0)}getTotalPrice() {return this.selectedProductList.reduce((price, item) => {return price + (item.count * item.price * 100)}, 0) / 100}
}

6. 文件

elshop.json文件

https://download.csdn.net/download/d312697510/89141677

icon图标

https://download.csdn.net/download/d312697510/89141683

git仓库地址

https://github.com/webdq/ElShop

相关文章:

【鸿蒙开发】饿了么页面练习

0. 整体结构 整体划分3部分。店铺部分&#xff0c;购物车部分&#xff0c;金额统计部分。使用 Stack 把3部分堆叠 0.1 整体页面 Index.ets 修改 Index.ets &#xff0c;使用堆叠布局&#xff0c;并居底部对齐 import { ElShop } from ../components/ElShop import { ElShopp…...

鸿蒙开发学习笔记第一篇--TypeScript基础语法

目录 前言 一、ArkTS 二、基础语法 1.基础类型 1.布尔值 2.数字 3.字符串 4.数组 5.元组 6.枚举 7.unkown 8.void 9.null和undefined 10.联合类型 2.条件语句 1.if语句 1.最简单的if语句 2.if...else语句 3.if...else if....else 语句 2.switch语句 5.函数…...

Java基础知识总结(55)

&#xff08;2&#xff09; ArrayList和LinkedList的区别 1、ArrayList和LinkedList都实现了List接口2、ArrayList和LinkedList都是非线程安全的&#xff0c;因此在多线程环境下可能会出现出现不同步的情况3、ArrayList底层实现是数组&#xff0c;LinkedList底层实现是双向链表…...

python爬虫 - 爬取微博热搜数据

文章目录 python爬虫 -爬取微博热搜数据1. 第一步&#xff1a;安装requests库和BeautifulSoup库2. 第二步&#xff1a;获取爬虫所需的header和cookie3. 第三步&#xff1a;获取网页4. 第四步&#xff1a;解析网页5. 第五步&#xff1a;分析得到的信息&#xff0c;简化地址6. 第…...

Pytorch-张量形状操作

&#x1f606;&#x1f606;&#x1f606;感谢大家的观看&#x1f606;&#x1f606; &#x1f339; reshape 函数 transpose 和 permute 函数 view 和 contigous 函数 squeeze 和 unsqueeze 函数 在搭建网络模型时&#xff0c;掌握对张量形状的操作是非常重要的&#xff…...

k8s的service为什么不能ping通?——所有的service都不能ping通吗

点击阅读原文 前提&#xff1a;kube-proxy使用iptables模式 Q service能不能ping通&#xff1f; A: 不能&#xff0c;因为k8s的service禁止了icmp协议 B: 不能&#xff0c;因为clusterIP是一个虚拟IP&#xff0c;只是用于配置netfilter规则&#xff0c;不会实际绑定设备&…...

[Linux] 权限控制命令 chmod、chown和chgrp

文章目录 chmodchownchgrp chmod 在Linux系统中&#xff0c;root用户可以使用chmod命令来修改文件的权限&#xff0c;并且root用户也可以授权普通用户来执行chmod命令。要将权限授予普通用户修改一个文件的权限&#xff0c;可以使用以下步骤&#xff1a; 使用root用户登录到L…...

RNN知识体系构筑:详尽阐述其理论基础、技术架构及其在处理序列数据挑战中的创新应用

一、为什么需要RNN 尽管神经网络被视为一种强大且理论上能够近似任何连续函数的模型&#xff0c;尤其当训练数据充足时&#xff0c;它们能够在输入空间中的某个点( x )映射到输出空间的特定值( y )&#xff0c;然而&#xff0c;这并不能完全解释为何在众多应用场景中&#xff…...

LeetCode 1702.修改后的最大二进制字符串:脑筋急转弯(构造,贪心)

【LetMeFly】1702.修改后的最大二进制字符串&#xff1a;脑筋急转弯&#xff08;构造&#xff0c;贪心&#xff09; 力扣题目链接&#xff1a;https://leetcode.cn/problems/maximum-binary-string-after-change/ 给你一个二进制字符串 binary &#xff0c;它仅有 0 或者 1 组…...

图片像素轻松缩放自如,支持批量将多张jpg图片像素放大,高效掌握图片的像素

在这个数字化时代&#xff0c;图片已经成为我们生活中不可或缺的一部分。然而&#xff0c;你是否曾遇到过需要放大图片像素却担心失去细节和质量的问题&#xff1f;现在&#xff0c;一款全新的图片缩放工具诞生了&#xff0c;它能够让你轻松将多张JPG图片像素放大&#xff0c;同…...

FILE类与IO流

目录 File类的实例化与常用方法 File类的理解 文件路径的表示方式&#xff1a; API的使用 IO流概述与流的分类 I/O流中的是Input/Output的缩写 IO流的分类&#xff08;不同角度&#xff09; Java程序中的IO流涉及40多个&#xff0c;但实际上都是由4个抽象类衍生出来的。 F…...

基于java+springboot+vue实现的智慧党建系统(文末源码+Lw+ppt)23-58

摘 要 当今社会进入了科技进步、经济社会快速发展的新时代。国际信息和学术交流也不断加强&#xff0c;计算机技术对经济社会发展和人民生活改善的影响也日益突出&#xff0c;人类的生存和思考方式也产生了变化。传统智慧党建管理采取了人工的管理方法&#xff0c;但这种管…...

HiveSQL基础Day03

回顾总结 hive表的类型 &#xff1a;内部表和外部表 删除内部表会删除表的所有数据 删除外部表只会删除表的元数据&#xff0c;hdfs上的行数据会保留 表的分区和分桶 本质都是对表数据的拆分存储 分区的方式 是通过创建不同的目录来拆分数据 &#xff0c;根据数据本身的内容最为…...

houdini 学习过程

1.基础界面操作了解 当初通过 朱峰上的界面 工具栏操作入门的&#xff0c;现在B站上应该也比较多 houdini pdf早期的 2.节点操作 B站视频 教程 3.vex B站捷佳 4.BILIBILI ENTAGMA CGWIKI YOUTUBE 5.节点功能的深入&#xff0c;属性了解&#xff0c;或其它节点扩充 常用&…...

Angular学习第四天--问题记录及父子组件问题

问题一、 拉取完项目&#xff0c;使用npm install命令的时候遇到的。 解决办法&#xff1a; 在查找网上五花八门的解决方案之后&#xff0c;发现都不能解决。 我的解决办法是&#xff1a; 1. 把package-lock.json给删掉&#xff1b; 2. 把package.json中公司自己库的包给删除掉…...

如何拿捏2024年的B端设计?(附工具推荐)

伴随着2019年前的互联网人口红利时代结束&#xff0c;科技行业的基本面发生了巨大的变化&#xff0c;以普通消费者为目标的C端需求大幅萎缩&#xff0c;面向企业的B端需求成为行业热点。 在2024年的今天&#xff0c;设计师应该如何理解B端设计的实质&#xff0c;并真正驾驭B端产…...

【蓝桥杯】2024年第15届真题题目

试题 A: 握手问题 本题总分&#xff1a; 5 分 【问题描述】 小蓝组织了一场算法交流会议&#xff0c;总共有 50 人参加了本次会议。在会议上&#xff0c; 大家进行了握手交流。按照惯例他们每个人都要与除自己以外的其他所有人进 行一次握手&#xff08;且仅有一次&a…...

LLM生成模型在生物单细胞single cell的应用:scGPT

参考&#xff1a; https://github.com/bowang-lab/scGPT https://www.youtube.com/watch?vXhwYlgEeQAs 相关算法&#xff1a; 主要是把单细胞测序出来的基因表达量的拼接起来构建成的序列&#xff0c;这里不是用的基因的ATCG&#xff0c;是直接用的基因名称 训练数据&#x…...

力扣15题. 三数之和

题目&#xff1a; 给你一个整数数组 nums &#xff0c;判断是否存在三元组 [nums[i], nums[j], nums[k]] 满足 i ! j、i ! k 且 j ! k &#xff0c;同时还满足 nums[i] nums[j] nums[k] 0 。请 你返回所有和为 0 且不重复的三元组。 注意&#xff1a;答案中不可以包含重复…...

项目经理好还是产品经理好?入行必读!

在现代项目管理领域&#xff0c;产品经理Product Manager和项目经理Project Manager&#xff0c;两者虽都是PM&#xff0c;但两者在实际操作中却有着显著的区别&#xff0c;在各自的领域中承担着不同的岗位职责和工作。 项目经理跟产品经理两个证都挺受市场欢迎的&#xff0c;…...

Elastic安装后 postman对elasticsearch进行测试

一、创建索引和mapping //id 字段自增id //good_sn 商品SKU //good_name 商品名称 //good_introduction 商品简介 //good_descript 商品详情 PUT http://IP:9200/shop { "mappings":{ "good":{ "properties":{ …...

JPA (Java Persistence API)

一、Jpa的介绍 JPA &#xff0c;是一套Sun公司Java官方制定的ORM 规范。 ORM&#xff0c;即 对象关系映射 &#xff08;Object Relational Mapping&#xff09;&#xff0c;是一种程序技术&#xff0c;用于 在关系数据库和业务实体对象之间做映射 。ORM 框架的存在&#xff0c;…...

实战要求下,如何做好资产安全信息管理

文章目录 一、资产安全信息管理的重要性二、资产安全信息管理的痛点三、如何做好资产安全信息管理1、提升资产安全信息自动化、集约化管理能力&#xff0c;做到资产全过程管理2、做好资产的安全风险识别3、做好互联网暴露面的测绘与管空4、做好资产安全信息的动态稽核管理 “摸…...

[matlab]matcaffe在matlab2023a安装和配置过程

测试环境&#xff1a; caffe-windows-cpu-py35-matlab2018b-vs2015-20220321 matlab2023a 注意&#xff1a;由于matlab新版本不允许添加特殊目录&#xff0c;比如有和private目录&#xff0c;添加后也会警告&#xff0c;但是可以忽略。因此可以使用我研发的matlab环境添加工具…...

【word2pdf】Springboot word转pdf(自学使用)

文章目录 概要整体介绍具体实现官网pom文件增加依赖 遇到的问题本地运行OK&#xff0c;发布到Linux报错还是本地OK&#xff0c;但是Linux能运行的&#xff0c;但是中文乱码 小结 概要 Springboot word 转 pdf 整体介绍 搜了一下&#xff0c;发现了能实现功能的方法有四种 U…...

3_2Linux中内核级加强型火墙的管理

### 一.Selinux的功能 ### 观察现象 ①当Selinux未开启时 在/mnt中建立文件被移动到/var/ftp下可以被vsftpd服务访问 匿名用户可以通过设置后上传文件 当使用ls -Z /var/ftp查看文件时显示"?" ps auxZ | grep vsftpd 时显示&#xff1a; - root 8546 0.0 0.0 26952 …...

PCB工艺规范及PCB设计安规原则

一、目的 规范产品的PCB工艺设计&#xff0c;规定PCB工艺设计的相关参数&#xff0c;使得PCB的设计满足可生产性、可测试性、安规、EMC、EMI等的技术规范要求&#xff0c;在产品设计过程中构建产品的工艺、技术、质量、成本优势。 二、适用范围 本规范适用于所有电了产品的PCB工…...

Qt for Android 开发环境

在搭建环境时开始感觉还挺顺利的&#xff0c;从 Qt 配置的环境里面看并没有什么问题&#xff0c;可真正编译程序的时候发现全是错误。 最开始的时候安装了 JDK21 最新版本&#xff0c;然后根据 JDK21 安装 ndk, build-tools, Platform-Tools 和 Gradle&#xff0c;但是不管这么…...

【题解】BC64 牛牛的快递(C++)

#include <iostream> #include<string> #include<math.h> using namespace std;int main() {int c0;string b;float a;cin>>a>>b;if(a>1)c20ceil(a-1);elsec20;if(b"y")c5;cout<<c; }在C中&#xff0c;ceil() 函数用于返回大…...

C++(运算符重载+赋值拷贝函数+日期类的书写)

目录 运算符重载运算赋值重载和运算赋重载前置和后置<,<,>,>,,!运算符重载日期类的实现<<流插入和>>流提取的运算符重载总结 运算符重载 C为了增强代码的可读性引入了运算符重载&#xff0c;运算符重载是具有特殊函数名的函数&#xff0c;也具有其 返回…...

可以做线路板网站的背景图/海外广告联盟平台推广

实例&#xff1a; <div data-role"collapsible" data-collapsed"false"> <h1>点击我 - 我可以折叠!</h1> <p>Im 现在我默认是展开的。</p> </div>data-role"collapsible" 折叠块标志 data-collapsed"…...

网站建设如何吸引投资/服务营销理论

如果你要买一辆车而且你的首要目标是性能或者更具体的说是原始动力&#xff0c;那么在4缸发动机和8缸发动机之间选择的话&#xff0c;答案很显然&#xff0c;因为越大越好。通常而言&#xff0c;当我们看计算机配置列表或者产品宣传的时候&#xff0c;64位的性能也比32位有优势…...

秀米排版编辑器 wordpress/百度指数搜索榜

下载软件SSHSecureShellClient的最新版本安装到windows系统中&#xff0c;linux中不必安装任何软件。 软件下载地址&#xff1a;http://down.51cto.com/data/412860装好这个软件后就可以开始实现文件的传送了&#xff0c;步骤如下&#xff1a;1.在windows中启动SSHSecureShellC…...

国外网站博客网站也可以做引流/seo网站排名优化快速排

下面是mongodb的一些基本概念&#xff1a; 文档是MongoDB中数据的基本单元&#xff0c;类似关系数据库中的行。集合&#xff0c;是存储文档的容器&#xff0c;类似关系数据库中的表。MongoDB的单个实例容纳多个数据库&#xff0c;每个数据库都有自己的集合和权限。每一个文档都…...

孔为民医生个人网站/网站关键词排名优化方法

原文发布时间为&#xff1a;2009-08-26 —— 来源于本人的百度文章 [由搬家工具导入]方法一&#xff1a;按照XML的结构一步一步的构建XML文档. 通过.Net FrameWork SDK中的命名空间"System.Xml"中封装的各种类来实现的方法二&#xff1a;直接定影XML文档&#xff…...

阿里云网站建设官方自营店/武汉网站设计公司

扫盲 Linux&#xff06;UNIX 命令行——从“电传打字机”聊到“shell 脚本编程” 本文目标读者 虽然本文的标题号称是【扫盲】&#xff0c;但俺相信&#xff1a;即使是一些 POSIX 系统的命令行【老手】&#xff0c;对本文中介绍的某些概念&#xff0c;可能也会有【欠缺】。  …...