账户中心 退出系统
5.0 版本 3.0 版本
使用手册 模板中心 账户中心 合作 · 服务
快速开始
框架介绍版权要求
更新日志
常见问题
框架部署目录结构
版本差别V5 vs V3
皮肤说明
nvue 说明
数据转换格式问题
页面布局 ( 13 )
页面组件 独创 · 好用
全屏加载 + 挂件
自定义头部返回 · 主页
自定义头部动态变化
自定义头部双击回顶部
返回顶部组件组件模式
自定义底部详情模式
自定义 tabbar凸出按钮
吸顶元素插槽实现
动态吸顶逻辑演示
iPhone 底部适配自动适配
小程序胶囊按钮躲避
下拉选择筛选 · 排序
框架基础 ( 7 )
文本相关尺寸及修饰
定位样式absolute · fixed
手势操作触屏 · 缩放
内置图标
按钮样式
常用标题更多 · 换一批
动画效果
Grace.JS ( 16 )
工具介绍
网络请求
页面跳转
数据缓存
图片操作
设备信息
消息提示
头部导航 动态设置
底部导航 动态设置
元素选择 尺寸获取
字符常用
数组操作
随机数据
日期时间
延时循环
对象操作
请求工具库 ( 7 )
工具库介绍
GET 请求
POST 请求
upload 上传
签名验证
用户登录检查
后端代码 php 版本示例
常用组件 ( 18 )
图片组件等比缩放
排序按钮
搜索组件
徽章角标
标签组件
功能标签选择 · 删除
星级组件
倒计时组件
城市选择
地区联动省市区三级
链接组件
为空展示
多图选择
多图上传
头像群组
数值动画
PK 投票
抽奖转盘
常用布局 ( 10 )
Flex布局必备技能
宫格布局默认5格
普通表格
数据表格
横向公告
时间轴布局
步骤展示
骨架加载
瀑布流布局
启动页广告全屏轮播形式
列表布局 ( 8 )
列表布局样式模式
滑动列表
可选列表
全选列表
树状列表
排序列表竖向拖拽
卡片列表
名片卡片
切换布局 ( 8 )
切换导航单行
切换导航多行
局部选项卡
全屏选项卡布局原理
分段切换
折叠面板
竖向切换导航适配
分类切换
滚动 · 轮播 ( 6 )
滚动区域原生 scroll-view
滚动公告基于 swiper
无缝滚动横向文本形式
无缝滚动横向卡片形式
竖向公告顺序卡片形式
轮播组件
刷新加载 ( 5 )
下拉刷新基于页面组件
加载更多基于页面组件
刷新和加载基于页面组件
刷新和加载自定义组合
刷新和加载原生组合模式
弹层 · 对话框 ( 6 )
遮罩弹层 popup
顶部消息框
模态对话框
底部操作表
右侧菜单
弹出菜单 popup menu
表单相关 ( 12 )
表单元素 form 布局
表单验证
字数限制
动态表单 添加删除元素
分步提交
步进器
数字键盘
滑动解锁
进度滑块 单滑块
区间滑块 双滑块
功能标签 选择 · 删除
点选按钮
日期时间 ( 6 )
日历日期 带有农历及时间
日期区间 日历形式
日期时间 picker 模式
时间段选择 picker 模式
日程日历 日程 · 提醒
横向日历 布局模式
文章相关 ( 10 )
文章列表 基础用法
文章列表 切换模式
文章列表 全屏选项卡模式
编辑器 自主研发 · 多端兼容
文章详情 编辑器解析
富文本 字符串转数组
展开阅读
评论布局
评论提交
底部分享
媒体播放 ( 2 )
音乐播放器
视频播放器
地图使用 ( 3 )
位置标注
地图周边
拖拽定位
用户模板 ( 8 )
用户登录
短信登录
短信验证
个人中心
头像剪裁
证件上传
会员排行榜
手写签名
电商常用 ( 10 )
商品列表
商品详情
订单中心
购物车模板
排序与筛选
地址列表
地址添加
抽奖模板
分类图标
优惠券组件
即时通讯 ( 3 )
消息展示组件
消息输入组件
消息列表展示
二维码及条码 ( 3 )
二维码生成
条形码生成
海报模板
商品详情

手册版本 V5.0

模板介绍

01. 提供基础的商品详情布局(轮播图、详情介绍内容、分享按钮等);

02. 提供了详情和评论切换功能;

03. 提供商品购买前的属性、数量相关功能;

兼容平台

H5APP小程序NVUE
✔✔✔✔

模板代码

UNI 普通版本
NVUE 版本
<template>
	<view>
		<!-- 轮播图  -->
		<view>
			<gui-swiper :swiperItems="swiperItems" 
			:spacing="0" :padding="0" borderRadius="0rpx" 
			:width="750" :height="330"></gui-swiper>
			</swiper>
		</view>
		<!-- 商品标题 分享按钮 -->
		<view class="gui-padding gui-margin-top gui-flex gui-rows gui-space-between gui-align-items-center">
			<text class="gui-h5 gui-block-text product-name gui-block-text">{{product.name}}</text>
			<view class="product-share" @tap="share">
				<text class="product-share gui-icons gui-color-orange">&#xe622;</text>
			</view>
		</view>
		<view class="gui-common-line gui-margin-top"></view>
		<!-- 价格 -->
		<view class="gui-padding" style="margin-top:10rpx;">
			<view class="gui-flex gui-rows gui-nowrap gui-align-items-center">
				<text class="product-price">¥{{product.price}}</text>
				<text class="gui-text gui-color-gray gui-line-through" style="margin-left:30rpx;">¥{{product.priceMarket}}</text>
			</view>
			<view class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between">
				<text class="gui-text-small gui-color-gray">运费 ¥0.00</text>
				<text class="gui-text-small gui-color-gray">已售 21008 件</text>
				<text class="gui-text-small gui-color-gray">浏览 36万次</text>
			</view>
		</view>
		<view class="gui-common-line gui-margin-top"></view>
		<!-- 切换导航 -->
		<view class="gui-padding gui-margin-top">
			<gui-switch-navigation :items="navItems" lineHeight="80rpx" :isCenter="true" 
			:size="200" activeLineBg="linear-gradient(to right, #FF7900, #FF7900)" textAlign="center"
			activeColor="#FF7900" activeLineWidth="200rpx" activeLineHeight="2rpx" 
			:margin="10" @change="navChange"></gui-switch-navigation>
		</view>
		<!-- 详情 请根据项目情况自行改进 可以使用 富文本-->
		<view class="gui-padding gui-margin-top" v-if="active == 0">
			<image style="width:690rpx;"
			:src="item" mode="widthFix" v-for="(item,index) in product.imgs" :key="index"></image>
		</view>
		<!-- 评论 请复制我们提供的评论布局来实现 -->
		<view class="gui-padding gui-margin-top" v-if="active == 1">
			<text class="gui-text-small gui-color-gray gui-text-center gui-block-text">请复制我们提供的评论布局来实现</text>
		</view>
		
		<!-- 底部 -->
		<view class="product-footer gui-bg-white gui-border-t">
			<!-- 属性选择 -->
			<scroll-view class="product-attr" 
			:scroll-y="true" v-if="attrShow">
				<view class="gui-flex gui-rows gui-space-between">
					<text class="gui-text gui-color-gray">选择颜色</text>
					<text class="gui-color-gray gui-h5 gui-icons" @tap="closeAttr">&#xe632;</text>
				</view>
				<view class="gui-margin-top">
					<gui-stags :tags="colors" @change="colorChange"></gui-stags>
				</view>
				<view class="gui-margin-top">
					<text class="gui-text gui-color-gray">选择尺寸</text>
				</view>
				<view class="gui-margin-top">
					<gui-stags :tags="sizes" @change="sizeChange"></gui-stags>
				</view>
				<view class="gui-margin-top">
					<text class="gui-text gui-color-gray">购买数量</text>
				</view>
				<view class="gui-margin-top">
					<gui-step-box :value="1" @change="numberChange"></gui-step-box>
				</view>
			</scroll-view>
			<!-- 底部按钮栏 -->
			<view class="gui-flex gui-rows gui-space-between gui-align-items-center gui-border-t">
				<!-- 2个底部按钮 -->
				<view class="gui-footer-icon-buttons" style="margin-left:30rpx;" hover-class="gui-tap" @tap="goHome">
					<text class="gui-footer-icon-buttons-icon gui-block-text gui-icons gui-primary-color">&#xe63b;</text>
					<text class="gui-footer-icon-buttons-text gui-block-text gui-icons gui-primary-color">首页</text>
				</view>
				<view class="gui-footer-icon-buttons" hover-class="gui-tap" @tap="kf">
					<text class="gui-footer-icon-buttons-icon gui-block-text gui-icons gui-primary-color">&#xe626;</text>
					<text class="gui-footer-icon-buttons-text gui-block-text gui-icons gui-primary-color">按钮</text>
				</view>
				<!-- 2个大按钮 -->
				<view class="gui-flex1 gui-footer-large-buttons gui-flex gui-rows gui-nowrap gui-justify-content-end">
					<view class=" gui-footer-large-button gui-text-center gui-bg-add-card" @tap="addtocard" 
					style="border-bottom-left-radius:50rpx; border-top-left-radius:50rpx;" hover-class="gui-tap">
						<text class="gui-text gui-color-white gui-footer-large-button-text gui-block-text gui-text-center">加入购物车</text>
					</view>
					<view class="gui-footer-large-button gui-text-center gui-bg-buy" @tap="buynow" 
					style="border-bottom-right-radius:50rpx; border-top-right-radius:50rpx;" hover-class="gui-tap">
						<text class="gui-text gui-color-white gui-footer-large-button-text gui-block-text gui-text-center">立即购买</text>
					</view>
				</view>
			</view>
			<gui-iphone-bottom></gui-iphone-bottom>
		</view>
		<!-- 底部占位 -->
		<view style="height:120rpx;"></view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			// 轮播图 
			swiperItems : [
			{
				img : 'https://cmsuse.oss-cn-beijing.aliyuncs.com/g5/1.png',
				url : '',
				opentype : 'navigate'
			},
			{
				img : 'https://cmsuse.oss-cn-beijing.aliyuncs.com/g5/2.png',
				url : '',
				opentype : 'navigate'
			}],
			// 商品信息
			product : {
				name: "小米 MIX3 一面科技 一面艺术 ( 磁动力滑盖全面屏 | 故宫特别版 )",
				logo : "../../static/logo.png",
				price : 3188,
				priceMarket : 3200,
				imgs : [
					'https://img30.360buyimg.com/sku/jfs/t21838/18/2275707529/311540/cba1d04c/5b4f155fNac3aa2f0.jpg',
					'https://img30.360buyimg.com/sku/jfs/t22021/327/2281785192/48707/57806074/5b4f1579Nae7adb49.jpg',
					'https://img30.360buyimg.com/sku/jfs/t21682/256/2344553276/204456/cf7a2ddb/5b4ffbbfN48c54307.jpg'
				]
			},
			// 切换导航
			navItems : [{id:0, name:'商品详情'}, {id:1, name:'相关评论'}],
			// 切换索引
			active   : 0,
			// 属性选择
			attrShow : false,
			colors   : [ 
				{id:1,text:"红色",checked:false},
				{id:2,text:"黑色",checked:false},
				{id:3,text:"蓝色",checked:false}
			],
			sizes   : [
				{id:1,text:"10 cm",checked:false},
				{id:2,text:"20 cm",checked:false},
				{id:3,text:"40 cm",checked:false}
			],
			// 属性记录
			attrRes : {color:null, size:null, number:1}
		}
	},
	methods: {
		// 分享
		share: function(){uni.showToast({title:'请自行完善分享代码', icon: "none"});},
		// 导航切换
		navChange : function(e){ this.active = e; },
		// 返回首页
		goHome : function () {uni.switchTab({ url:"首页路径" });},
		// 返回首页
		kf : function () {uni.showToast({title:'请自行完善分享代码', icon: "none"});},
		// 加入购物车
		addtocard : function () {
			// 选择属性
			this.selectAttr();
		},
		// 购买 
		buynow : function () {
			// 选择属性
			this.selectAttr();
		},
		// 属性选择
		selectAttr : function () {
			// 未选择属性弹出选择
			if(!this.attrShow){
				this.attrShow = true;
				return ;
			}
			// 已选择属性进行订单提交
			// 属性在 attrRes 变量内保存
			if(this.attrRes.color == null || this.attrRes.size == null){
				uni.showToast({icon:"none", title:"请选择属性"});
			}
			console.log('请完善提交代码');
		},
		colorChange  : function (e) {
			this.attrRes.color = e.text;
		},
		sizeChange   : function (e) {
			this.attrRes.size = e.text;
		},
		numberChange : function (e) {
			this.attrRes.number = e[0];
		},
		closeAttr : function () {
			this.attrShow = false;
		}
	}
}
</script>
<style scoped>
.product-name{width:560rpx; line-height:50rpx;}
.product-share{width:80rpx; height:80rpx; text-align:center; font-size:50rpx; color:#FF7900; line-height:80rpx;}
.product-price{color:#FF7900; line-height:60rpx; font-size:30rpx; font-weight:bold;}
.gui-common-line{height:18rpx;}
.product-footer{position:fixed; z-index:99; left:0; bottom:0; width:750rpx;}
.product-attr{width:700rpx; margin:25rpx; height:580rpx;}
</style>