//html
<view class="show-popup" hidden="{
{hideShopPopup}}">
<view class="popup-mask" bindtap="closePopupTap"></view>
<view class="popup-contents">
<view class="pop-goods-info">
<view class="pop-img-box">
<image src="https://shop.linkeddream.com{
{goodList.showimages[0]}}" class="goods-thumbnail" />
</view>
<view class="pop-goods-des">
<view class="pop-goods-title">{
{
goodList.name}}</view>
<view class="pop-goods-price">¥ {
{
skushownewprice}} 库存{
{
skushowstock}}件</view>
<!-- <view class="pop-goods-price" wx:if="{
{shopType =='pingtuan'}}">¥ {
{
selectptPrice}}</view> -->
</view>
<view class="pop-goods-close" bindtap="closePopupTap"></view>
</view>
<view class="size-label-box">
<block wx:for="{
{goodList.showsku}}" wx:for-item="property" wx:for-index="idx" wx:key="id">
<view class="label">{
{
property.name}}</view>
<view class="label-item-box">
<view wx:for="{
{property.values}}" class="label-item {
{item.active ? 'active' : '' }}" wx:key="id" bindtap="labelItemTap" data-propertyindex="{
{idx}}" data-propertyid="{
{property.id}}" data-propertyname="{
{property.name}}" data-propertychildindex="{
{index}}"
data-propertychildid="{
{item.id}}" data-propertychildname="{
{item.name}}">
<!-- 这里踩过一次坑,代码写的没有问题,然后鼠标点击后一直不显示选中的高亮,折腾了大半天才发现在js中循环遍历添加完状态后,没有重新去给数组赋值setData -->
{
{
item.name}}
</view>
</view>
</block>
</view>
<view class="buy-num-box">
<view class="num-label">购买数量</view>
<view class="num-box">
<view class="num-jian {
{buyNumber == buyNumMin ? 'hui': ''}}" bindtap="numJianTap">-</view>
<view class="num-input">
<input type="number" value="{
{buyNumber}}" disabled/>
</view>
<view class="num-jia {
{buyNumber== buyNumMax ? 'hui': ''}}" bindtap="numJiaTap">+</view>
</view>
</view>
<v
小程序规格选择弹窗,默认显示选中的规格,点击切换别的规格,踩过的坑,分享下经验!
最新推荐文章于 2024-07-10 21:32:33 发布