You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
<!-- 这是一个商品展示的视图组件,绑定了点击事件'toProdPage', 点击该组件会触发跳转到商品详情页面的操作, 同时传递商品ID( 从item对象的prodId属性获取) 作为参数 -->
<view class='prod-items' bindtap='toProdPage' data-prodid="{{item.prodId}}">
<!-- 用于展示商品图片的容器视图 -->
<view class='hot-imagecont'>
<!-- 展示商品图片, 图片的路径从item对象的pic属性获取, 设置了对应的图片样式类'hotsaleimg' -->
<image src='{{item.pic}}' class='hotsaleimg' ></image>
</view>
<!-- 用于展示商品相关文本信息的容器视图 -->
<view class='hot-text'>
<!-- 展示商品名称, 商品名称数据从item对象的prodName属性获取 -->
<view class='hotprod-text'>{{item.prodName}}</view>
<!-- 当sts的值等于6时, 展示商品的评价数量以及好评率相关信息, 数据分别从item对象的prodCommNumber和positiveRating属性获取 -->
<view class='prod-info' wx:if='{{sts==6}}'>{{item.prodCommNumber}}评价 {{item.positiveRating}}%好评</view>
<!-- 用于展示商品价格等文本信息的容器视图 -->
<view class='prod-text-info'>
<!-- 用于展示价格相关内容的容器视图 -->
<view class='price'>
<!-- 当sts的值等于2时, 展示“限时价”的提示文本 -->
<text wx:if='{{sts==2}}' class='deadline-price'>限时价</text>
<!-- 展示人民币符号 -->
<text class='symbol'>¥</text>
<!-- 展示商品价格的整数部分, 这里调用了wxs模块中的parsePrice函数对item对象的price属性进行处理, 取处理结果的第一个元素作为整数部分展示 -->
<text class='big-num'>{{wxs.parsePrice(item.price)[0]}}</text>
<!-- 展示商品价格的小数部分, 同样通过wxs模块的parsePrice函数取第二个元素来展示 -->
<text class='small-num'>.{{wxs.parsePrice(item.price)[1]}}</text>
</view>
</view>
</view>
</view>
<!-- 引入wxs模块, 模块名为'wxs', 对应的wxs代码文件路径为'../../wxs/number.wxs', 这个模块可能包含了一些对数据进行处理的函数, 比如此处用到的parsePrice函数 -->
<wxs module="wxs" src="../../wxs/number.wxs" />