| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <!--components/addCartModel/addCartModel.wxml-->
- <view class="modal-container {{visible ? 'modal-show' : ''}}">
- <view class="modal-mask" bindtap="handleClose"></view>
- <view class="modal-content">
- <!-- 头部关闭按钮 -->
- <view class="modal-header">
- <text class="title">选择规格</text>
- <text class="close-btn" bindtap="handleClose">×</text>
- </view>
-
- <!-- 商品信息 -->
- <view class="product-info">
- <image class="product-image" src="{{product.prodPicList[0].picUrl}}" mode="aspectFill"></image>
- <view class="product-detail">
- <view class="prodName">{{product.prodName}}</view>
- <view class="product-attr">
- <text class="price">¥{{product.price || 100}}</text>
- <text class="stock">剩余:{{product.stock || 100}}</text>
- </view>
- </view>
- </view>
- <!-- 数量选择 -->
- <view class="quantity-section">
- <view class="quantity-title">购买数量</view>
- <view class="quantity-control">
- <text class="btn-minus" bindtap="decreaseQuantity" disabled="{{quantity <= 1}}">-</text>
- <input class="quantity-input" type="number" value="{{quantity}}" disabled />
- <text class="btn-plus" bindtap="increaseQuantity" disabled="{{quantity >= product.stock}}">+</text>
- </view>
- </view>
-
- <!-- 规格选择 -->
- <view class="spec-section" wx:for="{{product.prodAttrList}}" wx:key="name">
- <view class="spec-title">{{item.prodName}}</view>
- <view class="spec-options">
- <view
- class="spec-option {{isSpecSelected(index, optionIndex) ? 'selected' : ''}}"
- wx:for="{{item.options}}"
- wx:key="value"
- bindtap="selectSpec"
- data-spec-index="{{index}}"
- data-option-index="{{optionIndex}}"
- >
- {{item}}
- </view>
- </view>
- </view>
-
-
- <!-- 底部按钮 -->
- <view class="footer">
- <button class="add-btn" bindtap="handleAddToCart">加入购物车</button>
- </view>
- </view>
- </view>
|