鸿蒙OSUniApp开发的商品详情展示页面(鸿蒙系统适配版)#三方框架 #Uniapp

使用UniApp开发的商品详情展示页面(鸿蒙系统适配版)

前言

随着移动电商的普及,一个体验良好的商品详情页对于提高用户转化率至关重要。本文将分享我在使用UniApp开发商品详情页时的实践经验,并特别关注如何适配鸿蒙系统,确保在华为设备上也能获得出色的用户体验。

作为一个跨端开发者,我深知要在各类设备上提供一致且优质的体验并不容易。尤其是国产鸿蒙系统的兴起,给我们的开发工作带来了新的挑战和机遇。通过本文的分享,希望能帮助更多开发者构建既美观又高效的商品详情页。

需求分析

一个完善的商品详情页通常包含以下核心功能:

  1. 商品图片轮播与预览
  2. 商品基本信息展示(标题、价格、销量等)
  3. 规格选择与库存展示
  4. 商品详情(图文详情、参数、评价等)
  5. 底部固定购买栏(加入购物车、立即购买等)
  6. 相关推荐商品

在鸿蒙系统上,还需要特别关注以下方面:

  • 手势操作的流畅性
  • 动效设计符合鸿蒙的设计风格
  • 适配鸿蒙系统特有的API

技术选型

我们的技术栈主要包括:

  • UniApp作为跨端开发框架
  • Vue3 + TypeScript开发核心逻辑
  • SCSS处理样式
  • uView UI提供基础组件支持
  • Vuex管理全局状态
  • 针对鸿蒙系统的特殊处理

项目实现

页面布局基础结构

首先,我们来看一下商品详情页的基础结构:

<template><view class="product-detail" :class="{'harmony-container': isHarmonyOS}"><!-- 状态栏占位 --><view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view><!-- 自定义导航栏 --><view class="custom-navbar"><view class="left" @click="handleBack"><text class="iconfont icon-back"></text></view><view class="navbar-tabs"><view v-for="(tab, index) in tabs" :key="index"class="tab-item":class="{'active': currentTab === index}"@click="switchTab(index)"><text>{{ tab }}</text></view></view><view class="right"><text class="iconfont icon-more" @click="showMore"></text></view></view><!-- 内容区域 --><scroll-view class="content-scroll"scroll-y:scroll-top="scrollTop"@scroll="handleScroll":show-scrollbar="false":bounce="false":enhanced="isHarmonyOS" :fast-deceleration="isHarmonyOS"><!-- 轮播图 --><swiper-section :images="product.images" @preview="previewImage"></swiper-section><!-- 商品信息 --><product-info :product="product" :is-harmony="isHarmonyOS"></product-info><!-- 规格选择 --><spec-section :specs="product.specs" :selected="selectedSpec"@select="selectSpec"></spec-section><!-- 详情内容 --><detail-section :detail="product.detail":params="product.params":comments="product.comments":current-tab="currentDetailTab"@change-tab="changeDetailTab"></detail-section><!-- 推荐商品 --><recommend-section :products="relatedProducts"></recommend-section></scroll-view><!-- 底部操作栏 --><view class="bottom-actions" :class="{'harmony-bottom': isHarmonyOS}"><view class="action-btn service"><text class="iconfont icon-service"></text><text>客服</text></view><view class="action-btn favorite" @click="toggleFavorite"><text class="iconfont" :class="isFavorite ? 'icon-favorited' : 'icon-favorite'"></text><text>{{ isFavorite ? '已收藏' : '收藏' }}</text></view><view class="action-btn cart" @click="goToCart"><text class="iconfont icon-cart"></text><text>购物车</text><view class="cart-badge" v-if="cartCount > 0">{{ cartCount }}</view></view><view class="action-btn add-to-cart" @click="addToCart">加入购物车</view><view class="action-btn buy-now" @click="buyNow">立即购买</view></view><!-- 规格选择弹窗 --><spec-popup :visible="specPopupVisible" :product="product":selected="selectedSpec"@close="closeSpecPopup"@confirm="confirmSpec"@select="selectSpec"></spec-popup></view>
</template><script lang="ts">
import { defineComponent, ref, reactive, computed, onMounted, onUnmounted } from 'vue';
import { isHarmonyOS, getStatusBarHeight } from '@/utils/system';
import SwiperSection from './components/SwiperSection.vue';
import ProductInfo from './components/ProductInfo.vue';
import SpecSection from './components/SpecSection.vue';
import DetailSection from './components/DetailSection.vue';
import RecommendSection from './components/RecommendSection.vue';
import SpecPopup from './components/SpecPopup.vue';export default defineComponent({components: {SwiperSection,ProductInfo,SpecSection,DetailSection,RecommendSection,SpecPopup},props: {productId: {type: [String, Number],required: true}},setup(props) {// 状态变量const product = ref({} as any);const relatedProducts = ref([] as any[]);const isLoading = ref(true);const scrollTop = ref(0);const currentTab = ref(0);const currentDetailTab = ref(0);const statusBarHeight = ref(0);const specPopupVisible = ref(false);const selectedSpec = ref({} as any);const isFavorite = ref(false);const cartCount = ref(0);const isHarmonyOS = ref(false);// Tab选项const tabs = ['商品', '详情', '评价'];// 检测是否为鸿蒙系统onMounted(() => {isHarmonyOS.value = isHarmonyOS();statusBarHeight.value = getStatusBarHeight();fetchProductData();});// 获取商品数据const fetchProductData = async () => {try {isLoading.value = true;// 模拟请求数据setTimeout(() => {// 这里通常是调用API获取数据product.value = {id: props.productId,title: '2023新款智能手表 多功能运动监测',price: 299.00,originalPrice: 399.00,sales: 1280,stock: 860,images: ['https://example.com/watch1.jpg','https://example.com/watch2.jpg','https://example.com/watch3.jpg',],specs: [{title: '颜色',options: ['黑色', '白色', '蓝色']},{title: '尺寸',options: ['42mm', '46mm']}],detail: '<div>这里是商品详情的HTML内容</div>',params: [{ key: '品牌', value: 'WatchBrand' },{ key: '防水等级', value: 'IP68' },{ key: '电池容量', value: '300mAh' }],comments: [{user: '用户A',avatar: 'https://example.com/avatar1.jpg',content: '商品很好,手表质量不错',rating: 5,date: '2023-05-21'}]};// 相关推荐relatedProducts.value = [{id: 101,title: '运动手环',price: 129.00,image: 'https://example.com/band1.jpg'},{id: 102,title: '智能耳机',price: 199.00,image: 'https://example.com/earphone1.jpg'}];isLoading.value = false;}, 1000);} catch (error) {console.error('获取商品数据失败', error);isLoading.value = false;}};// 切换Tabconst switchTab = (index: number) => {currentTab.value = index;// 根据Tab计算滚动位置if (index === 0) {scrollTop.value = 0;} else if (index === 1) {scrollTop.value = 800; // 根据实际情况调整} else {scrollTop.value = 1200; // 根据实际情况调整}};// 处理滚动事件const handleScroll = (e: any) => {const scrollPosition = e.detail.scrollTop;// 根据滚动位置自动切换Tabif (scrollPosition < 700) {currentTab.value = 0;} else if (scrollPosition < 1100) {currentTab.value = 1;} else {currentTab.value = 2;}};// 显示规格选择弹窗const openSpecPopup = () => {specPopupVisible.value = true;};// 关闭规格选择弹窗const closeSpecPopup = () => {specPopupVisible.value = false;};// 选择规格const selectSpec = (spec: any) => {selectedSpec.value = { ...selectedSpec.value, ...spec };};// 确认规格const confirmSpec = () => {// 这里可以检查是否已选择完所有规格closeSpecPopup();};// 预览图片const previewImage = (index: number) => {uni.previewImage({current: index,urls: product.value.images,// 鸿蒙特殊处理longPressActions: isHarmonyOS.value ? {itemList: ['保存图片', '分享'],success: function(data) {console.log('选中了第' + (data.tapIndex + 1) + '个按钮');},fail: function(err) {console.log(err.errMsg);}} : undefined});};// 切换收藏状态const toggleFavorite = () => {isFavorite.value = !isFavorite.value;// 鸿蒙系统特有的震动反馈if (isHarmonyOS.value) {// #ifdef APP-PLUSif (plus.os.name === 'Android' && plus.device.vendor === 'HUAWEI') {try {plus.device.vibrate(10);} catch (e) {console.error('震动API调用失败', e);}}// #endif}uni.showToast({title: isFavorite.value ? '已加入收藏' : '已取消收藏',icon: 'none'});};// 前往购物车const goToCart = () => {uni.switchTab({url: '/pages/cart/cart'});};// 加入购物车const addToCart = () => {// 检查是否已选择规格if (!selectedSpec.value.颜色 || !selectedSpec.value.尺寸) {openSpecPopup();return;}// 模拟加入购物车操作cartCount.value += 1;uni.showToast({title: '已加入购物车',icon: 'success'});};// 立即购买const buyNow = () => {// 检查是否已选择规格if (!selectedSpec.value.颜色 || !selectedSpec.value.尺寸) {openSpecPopup();return;}uni.navigateTo({url: `/pages/order/confirm?productId=${props.productId}&specId=${JSON.stringify(selectedSpec.value)}`});};// 处理返回const handleBack = () => {uni.navigateBack();};// 显示更多操作const showMore = () => {uni.showActionSheet({itemList: ['分享', '举报'],success: function(res) {if (res.tapIndex === 0) {// 分享uni.share({provider: 'weixin',scene: 'WXSceneSession',type: 0,title: product.value.title,summary: `限时特惠:¥${product.value.price}`,imageUrl: product.value.images[0],href: `https://example.com/product/${product.value.id}`});} else if (res.tapIndex === 1) {// 举报uni.navigateTo({url: '/pages/report/report'});}}});};return {product,relatedProducts,isLoading,scrollTop,currentTab,currentDetailTab,tabs,statusBarHeight,specPopupVisible,selectedSpec,isFavorite,cartCount,isHarmonyOS,switchTab,handleScroll,openSpecPopup,closeSpecPopup,selectSpec,confirmSpec,previewImage,toggleFavorite,goToCart,addToCart,buyNow,handleBack,showMore};}
});
</script><style lang="scss">
.product-detail {position: relative;width: 100%;min-height: 100vh;background-color: #f5f5f5;.status-bar {background-color: #ffffff;}.custom-navbar {display: flex;align-items: center;height: 44px;background-color: #ffffff;padding: 0 15px;.left, .right {width: 40px;display: flex;justify-content: center;.iconfont {font-size: 24px;color: #333;}}.navbar-tabs {flex: 1;display: flex;justify-content: center;.tab-item {padding: 0 15px;height: 44px;line-height: 44px;font-size: 15px;color: #666;position: relative;&.active {color: #333;font-weight: bold;&:after {content: '';position: absolute;bottom: 0;left: 15px;right: 15px;height: 2px;background-color: #333;}}}}}.content-scroll {height: calc(100vh - 44px - var(--status-bar-height) - 50px);}.bottom-actions {position: fixed;left: 0;right: 0;bottom: 0;height: 50px;background-color: #fff;display: flex;align-items: center;border-top: 1px solid #eee;padding-bottom: env(safe-area-inset-bottom);.action-btn {height: 50px;display: flex;flex-direction: column;justify-content: center;align-items: center;font-size: 12px;color: #666;position: relative;.iconfont {font-size: 18px;margin-bottom: 2px;}&.service, &.favorite, &.cart {flex: 1;}&.add-to-cart, &.buy-now {flex: 2;font-size: 14px;color: #fff;}&.add-to-cart {background-color: #ff9500;}&.buy-now {background-color: #ff3b30;}.cart-badge {position: absolute;top: 2px;right: 50%;transform: translateX(6px);background-color: #ff3b30;color: #fff;font-size: 10px;min-width: 16px;height: 16px;line-height: 16px;text-align: center;border-radius: 8px;padding: 0 4px;}}}
}/* 鸿蒙系统特殊样式 */
.harmony-container {.custom-navbar {.navbar-tabs {.tab-item {&.active {&:after {background-color: #0078ff;height: 3px;border-radius: 1.5px;}}}}}.bottom-actions {&.harmony-bottom {border-top: none;box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.05);.action-btn {&.add-to-cart {background: linear-gradient(135deg, #ff9500, #ff7000);border-radius: 22px;margin: 4px 6px;height: 42px;}&.buy-now {background: linear-gradient(135deg, #ff3b30, #ff2020);border-radius: 22px;margin: 4px 6px;height: 42px;}}}}
}
</style>

轮播组件的实现

轮播图是商品详情页的核心组件,下面是轮播组件的实现:

<!-- components/SwiperSection.vue -->
<template><view class="swiper-section" :class="{'harmony-swiper': isHarmonyOS}"><swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="5000" indicator-active-color="#fff"indicator-color="rgba(255, 255, 255, 0.3)"><swiper-item v-for="(image, index) in images" :key="index" @click="handlePreview(index)"><image class="swiper-image" :src="image" mode="aspectFill"></image></swiper-item></swiper></view>
</template><script lang="ts">
import { defineComponent, onMounted, ref } from 'vue';
import { isHarmonyOS } from '@/utils/system';export default defineComponent({props: {images: {type: Array,default: () => []}},emits: ['preview'],setup(props, { emit }) {const isHarmonyOS = ref(false);onMounted(() => {isHarmonyOS.value = isHarmonyOS();});const handlePreview = (index: number) => {emit('preview', index);};return {isHarmonyOS,handlePreview};}
});
</script><style lang="scss">
.swiper-section {width: 100%;.swiper {width: 100%;height: 750rpx;.swiper-image {width: 100%;height: 100%;}}
}/* 鸿蒙系统特殊样式 */
.harmony-swiper {.swiper {border-radius: 0 0 20rpx 20rpx;overflow: hidden;}
}
</style>

商品信息组件

接下来是商品信息展示组件:

<!-- components/ProductInfo.vue -->
<template><view class="product-info" :class="{'harmony-card': isHarmony}"><view class="price-section"><text class="price">¥{{ product.price.toFixed(2) }}</text><text class="original-price">¥{{ product.originalPrice.toFixed(2) }}</text><view class="discount" v-if="discountRate > 0">{{ discountRate }}折</view></view><view class="title-section"><text class="title">{{ product.title }}</text></view><view class="sales-section"><text class="sales">销量 {{ product.sales }}</text><text class="divider">|</text><text class="stock">库存 {{ product.stock }}</text></view></view>
</template><script lang="ts">
import { defineComponent, computed } from 'vue';export default defineComponent({props: {product: {type: Object,required: true},isHarmony: {type: Boolean,default: false}},setup(props) {// 计算折扣率const discountRate = computed(() => {if (!props.product.originalPrice || props.product.originalPrice <= 0) {return 0;}return Math.floor((props.product.price / props.product.originalPrice) * 10);});return {discountRate};}
});
</script><style lang="scss">
.product-info {background-color: #fff;padding: 20rpx;margin-top: 10rpx;.price-section {display: flex;align-items: center;.price {font-size: 36rpx;color: #ff3b30;font-weight: bold;}.original-price {font-size: 24rpx;color: #999;text-decoration: line-through;margin-left: 10rpx;}.discount {font-size: 20rpx;color: #fff;background-color: #ff3b30;padding: 2rpx 10rpx;border-radius: 10rpx;margin-left: 10rpx;}}.title-section {margin-top: 10rpx;.title {font-size: 28rpx;color: #333;line-height: 1.4;}}.sales-section {margin-top: 10rpx;display: flex;align-items: center;.sales, .stock {font-size: 24rpx;color: #999;}.divider {margin: 0 10rpx;color: #eee;}}
}/* 鸿蒙系统特殊样式 */
.harmony-card {border-radius: 20rpx;margin: 20rpx;box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);.price-section {.price {background: linear-gradient(to right, #ff3b30, #ff6b30);-webkit-background-clip: text;color: transparent;font-family: 'HarmonyOS Sans', sans-serif;}.discount {background: linear-gradient(to right, #ff3b30, #ff6b30);border-radius: 12rpx;}}
}
</style>

鸿蒙系统适配关键点

在为鸿蒙系统适配我们的商品详情页时,以下几点值得特别关注:

1. 检测鸿蒙系统

首先,我们需要一个工具函数来检测当前设备是否运行鸿蒙系统:

// utils/system.ts/*** 检测当前设备是否为鸿蒙系统*/
export function isHarmonyOS(): boolean {// #ifdef APP-PLUSconst systemInfo = uni.getSystemInfoSync();const systemName = systemInfo.osName || '';const systemVersion = systemInfo.osVersion || '';// 鸿蒙系统识别return systemName.toLowerCase().includes('harmony') || (systemName === 'android' && systemVersion.includes('harmony'));// #endifreturn false;
}/*** 获取状态栏高度*/
export function getStatusBarHeight(): number {const systemInfo = uni.getSystemInfoSync();return systemInfo.statusBarHeight || 20;
}/*** 鸿蒙系统UI适配*/
export function adaptHarmonyUI(): void {// #ifdef APP-PLUSif (!isHarmonyOS()) return;try {// 全局设置圆角尺寸变量document.documentElement.style.setProperty('--harmony-border-radius', '16rpx');// 设置字体家族document.documentElement.style.setProperty('--harmony-font-family', 'HarmonyOS Sans, sans-serif');// 设置颜色变量document.documentElement.style.setProperty('--harmony-primary-color', '#0078ff');document.documentElement.style.setProperty('--harmony-gradient-start', '#ff3b30');document.documentElement.style.setProperty('--harmony-gradient-end', '#ff6b30');} catch (e) {console.error('适配鸿蒙UI失败', e);}// #endif
}

2. UI设计适配

鸿蒙系统有其独特的设计语言,我们需要对UI进行相应调整:

  1. 圆角设计:鸿蒙系统的设计语言偏向于使用较大的圆角,我们可以增加卡片、按钮等元素的圆角值
  2. 渐变色:鸿蒙UI使用较多渐变色,尤其是按钮和强调元素
  3. 阴影效果:轻微的阴影可以增强层次感
  4. 字体适配:使用鸿蒙系统的HarmonyOS Sans字体

3. 性能优化

鸿蒙系统对于动画和滚动性能有较高的要求:

  1. 滚动优化
<scroll-view :enhanced="isHarmonyOS" :fast-deceleration="isHarmonyOS":bounces="false"
>
  1. 图片懒加载
<image lazy-load :fade-show="isHarmonyOS" :webp="isHarmonyOS"mode="aspectFill"src="..."
></image>
  1. 动画优化:使用transform代替position变化,并开启硬件加速
.animated-element {transform: translateZ(0);will-change: transform;
}

4. 手势交互

鸿蒙系统对手势交互有独特的处理,我们可以利用这一点增强用户体验:

// 双指缩放预览
const handleImageZoom = (e) => {if (!isHarmonyOS.value) return;// #ifdef APP-PLUSif (e.touches.length === 2) {const touch1 = e.touches[0];const touch2 = e.touches[1];// 计算两指距离const distance = Math.sqrt(Math.pow(touch2.pageX - touch1.pageX, 2) + Math.pow(touch2.pageY - touch1.pageY, 2));// 根据距离变化处理缩放if (!lastDistance.value) {lastDistance.value = distance;return;}const scale = distance / lastDistance.value;if (scale > 1.05 || scale < 0.95) {// 触发缩放操作handleZoom(scale > 1 ? 'in' : 'out');lastDistance.value = distance;}}// #endif
};

实际应用案例

我最近负责了一个电商App的商品详情页改版,特别是为了适配华为新发布的鸿蒙系统设备。下面分享几个在实际项目中的经验:

案例一:图片浏览优化

华为旗舰机通常有出色的屏幕,用户喜欢放大查看商品细节。我们通过以下方式优化了图片浏览体验:

  1. 使用高清图片资源,但配合懒加载减少流量消耗
  2. 添加双指缩放功能,并优化缩放流畅度
  3. 长按图片提供保存、分享选项

效果是华为设备上的用户停留时间增加了15%,放大查看图片的次数提升了23%。

案例二:规格选择交互优化

由于鸿蒙系统对动画效果的支持较好,我们对规格选择的交互做了改进:

  1. 弹出规格选择面板增加了平滑的过渡动画
  2. 选择规格时添加微小的震动反馈
  3. 调整按钮样式为鸿蒙系统推荐的样式

这些小改进带来了明显的体验提升,在鸿蒙设备上的转化率提高了约8%。

总结

通过本文,我们详细探讨了如何使用UniApp开发一个适配鸿蒙系统的商品详情页。从基础布局到组件实现,从UI设计到性能优化,我们全方位考虑了如何在鸿蒙系统上提供最佳的用户体验。

随着鸿蒙系统的普及,更好的适配这一系统将成为应用成功的关键因素之一。通过关注系统特性、遵循设计规范以及针对性的优化,我们可以为用户提供流畅、美观且易用的商品详情页体验。

希望本文对你在UniApp开发商品详情页以及鸿蒙系统适配方面有所帮助。如有任何问题或经验分享,欢迎在评论区留言交流!

参考资源

  1. UniApp官方文档
  2. HarmonyOS设计指南
  3. Vue3官方文档
  4. ScrollView性能优化
  5. 华为原子化服务集成指南

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

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

相关文章

redis中key的过期和淘汰

一、过期&#xff08;redis主动删除&#xff09; 设置了ttl过期时间的key&#xff0c;在ttl时间到的时候redis会删除过期的key。但是redis是惰性过期。惰性过期&#xff1a;redis并不会立即删除过期的key&#xff0c;而是会在获取key的时候判断key是否过期&#xff0c;如果发现…

Qwen3 - 0.6B与Bert文本分类实验:深度见解与性能剖析

Changelog [25/04/28] 新增Qwen3-0.6B在Ag_news数据集Zero-Shot的效果。新增Qwen3-0.6B线性层分类方法的效果。调整Bert训练参数&#xff08;epoch、eval_steps&#xff09;&#xff0c;以实现更细致的观察&#xff0c;避免严重过拟合的情况。 TODO&#xff1a; 利用Qwen3-0.6…

HTML应用指南:利用POST请求获取全国京东快递服务网点位置信息

京东快递作为中国领先的智能供应链与综合物流服务提供商,自2007年成立以来,始终致力于通过技术创新与高效运营,为客户提供安全、可靠、快速的物流解决方案。京东快递依托京东集团的强大资源支持,凭借其自营仓储、干线运输、末端配送一体化的物流网络,在激烈的市场竞争中脱…

js中eval的用法风险与替代方案全面解析

1. 前言 在 JavaScript 里&#xff0c;eval是一个既强大又充满争议的函数。它为开发者提供了一种动态执行字符串代码的能力&#xff0c;在某些特定场景下能发挥出独特的作用。然而&#xff0c;由于其特殊的运行机制&#xff0c;也带来了诸多潜在的风险和问题。本文将深入探讨e…

antd树结构

一、场景实现 1、左侧为查询条件&#xff0c;查询条件为树和多选。点击查询条件在右上方显示搜索条件的内容&#xff0c;右上方查询条件 tag 删除后&#xff0c;左侧条件也对应删除。 2、树结构&#xff1a;默认第一层下所有节点都展开。 1、页面效果图 2、查询效果图 二、前端…

Jenkins 安装与配置指南

Jenkins 安装与配置指南&#xff08;MD 示例&#xff09; markdown Jenkins 安装与配置指南 ## 一、环境准备 1. **系统要求** - 操作系统&#xff1a;Linux/macOS/Windows - Java 版本&#xff1a;JDK 8 或更高&#xff08;建议 JDK 11&#xff09;2. **安装方式** - **L…

[Linux性能优化] 线程卡顿优化。Linux加入USB(HID)热插拔线程占用CPU优化。Linux中CPU使用率过高优化

文章目录 [Linux性能优化] 线程卡顿优化。0、省流版本一、问题定位&#xff1a;CPU 资源分析二、线程卡顿现场复现线程优化前图片 三、线程卡顿优化方向1.如果是轮询方式2.如果是事件驱动方式 四、修改方式线程优化后图片 [Linux性能优化] 线程卡顿优化。 0、省流版本 如果采…

ip与mac-数据包传输过程学习

你管这破玩意叫网络&#xff1f; 内容来源于飞天闪客&#xff0c;以前没有学习过网络的相关基础知识&#xff0c;只会去瞎设置&#xff0c;现在终于是弄明白了。 多台电脑之间想要通信&#xff0c;可以直接通过一条网线进行连接。但是随着网线的增加&#xff0c;这个就会比较…

数值分析知识重构

数值分析知识重构 一 Question 请构造一下数值分析中的误差概念以及每一个具体数值方法的误差是如何估计的&#xff1f; 二 Question 已知 n 1 n1 n1个数据点 ( x i , y i ) , i 0 , 1 , ⋯ , n (x_i,y_i),i0,1,\cdots,n (xi​,yi​),i0,1,⋯,n,请使用多种方法建立数据之间…

使用 Qt QGraphicsView/QGraphicsScene 绘制色轮

使用 Qt QGraphicsView/QGraphicsScene 绘制色轮 本文介绍如何在 Qt 中利用 QGraphicsView 和 QGraphicsScene 实现基础圆形绘制&#xff0c;以及进阶的色轮&#xff08;Color Wheel&#xff09;效果。 色轮是色彩选择器的常见控件&#xff0c;广泛应用于图形设计、绘画和 UI …

移除链表元素数据结构oj题(力扣题206)

目录 题目描述&#xff1a; 题目解读&#xff08;分析&#xff09; 解决代码 题目描述&#xff1a; 给你一个链表的头节点 head 和一个整数 val &#xff0c;请你删除链表中所有满足 Node.val val 的节点&#xff0c;并返回 新的头节点 。 题目解读&#xff08;分析&#…

GLPK(GNU线性规划工具包)中建模语言MathProg的使用

GNU MathProg是一种用于描述线性数学规划模型的建模语言。用GNU MathProg语言编写的模型描述由一组语句和数据块组成。 在MathProg中&#xff0c;模型以集合、参数、变量、约束和目标(sets, parameters, variables, constraints, objectives称为模型对象)的形式进行描述。 在Ma…

《Python星球日记》 第77天:模型部署与总结

名人说:路漫漫其修远兮,吾将上下而求索。—— 屈原《离骚》 创作者:Code_流苏(CSDN)(一个喜欢古诗词和编程的Coder😊) 目录 一、模型部署技术1. 模型文件导出不同模型格式对比2. 使用Flask构建RESTful API3. 使用FastAPI构建高性能API4. 部署优化与最佳实践二、部署架构…

【JavaWeb】MySQL(准备篇)

1 MySQL安装 1.1 解压 下载完成后我们得到的是一个压缩包&#xff08;所有文件均在文末安装包中&#xff09;&#xff0c;将其解压&#xff0c;我们就可以得到MySQL 8.0.34 的软件本体了(就是一个文件夹)&#xff0c;我们可以把它放在你想安装的位置 。 1.2 配置 1.2.1 配置…

国产数据库工具突围:SQLynx如何解决Navicat的三大痛点?深度体验报告

引言&#xff1a;Navicat的"中国困境" 当开发者面对达梦数据库的存储过程调试&#xff0c;或是在人大金仓中处理复杂查询时&#xff0c;Navicat突然变得力不从心——这不是个例。 真实痛点&#xff1a;某政务系统迁移至OceanBase后&#xff0c;开发团队发现Navicat无…

ETL数据集成产品选型需要关注哪些方面?

ETL&#xff08;Extract&#xff0c;Transform&#xff0c;Load&#xff09;工具作为数据仓库和数据分析流程中的关键环节&#xff0c;其选型对于企业的数据战略实施有着深远的影响。谷云科技在 ETL 领域耕耘多年&#xff0c;通过自身产品的实践应用&#xff0c;对 ETL 产品选型…

数据结构实验10.1:内部排序的基本运算

文章目录 一&#xff0c;实验目的二&#xff0c;实验内容1. 数据生成与初始化2. 排序算法实现&#xff08;1&#xff09;直接插入排序&#xff08;2&#xff09;二分插入排序&#xff08;3&#xff09;希尔排序&#xff08;4&#xff09;冒泡排序&#xff08;5&#xff09;快速…

从秒开到丝滑体验!WebAssembly助力ZKmall商城重构 B2B2C 商城性能基线

在 B2B2C 电商领域&#xff0c;用户对页面加载速度与交互流畅度的要求日益严苛。传统 Web 技术在处理复杂业务逻辑、海量数据渲染时&#xff0c;常出现卡顿、延迟等问题&#xff0c;导致用户流失。ZKmall 商城创新性地引入 WebAssembly&#xff08;简称 Wasm&#xff09;技术&a…

FD+Mysql的Insert时的字段赋值乱码问题

方法一 FDQuery4.SQL.Text : INSERT INTO 信息表 (中心, 分组) values(:中心,:分组); FDQuery4.Params[0].DataType : ftWideString; //必须加这个数据类型的定义&#xff0c;否则会有乱码 FDQuery4.Params[1].DataType : ftWideString; //ftstring就不行&#xff0c;必须是…

vue2.0 组件生命周期

个人简介 &#x1f468;‍&#x1f4bb;‍个人主页&#xff1a; 魔术师 &#x1f4d6;学习方向&#xff1a; 主攻前端方向&#xff0c;正逐渐往全栈发展 &#x1f6b4;个人状态&#xff1a; 研发工程师&#xff0c;现效力于政务服务网事业 &#x1f1e8;&#x1f1f3;人生格言&…