Files
LinHelp/miniapp/miniprogram/pages/products/detail.wxml
2026-07-07 16:38:13 +08:00

35 lines
2.0 KiB
Plaintext

<view class="page" wx:if="{{product}}">
<view class="card">
<view class="section-title">{{product.name}}</view>
<view class="muted">{{product.description || '社区商品'}}</view>
</view>
<view class="card">
<view class="muted">规格</view>
<picker mode="selector" range="{{product.skus}}" range-key="skuName" value="{{skuIndex}}" bindchange="onSkuChange">
<view class="picker">{{product.skus[skuIndex].skuName}} / ¥{{product.skus[skuIndex].priceCent / 100}} / 库存 {{product.skus[skuIndex].stock}}</view>
</picker>
<view class="muted">数量</view>
<input class="input" type="number" value="{{form.quantity}}" bindinput="onQuantityChange" />
<view class="muted">配送方式</view>
<radio-group bindchange="onMethodChange">
<label class="radio"><radio value="IMMEDIATE" checked="{{form.deliveryMethod === 'IMMEDIATE'}}" />立即配送</label>
<label class="radio"><radio value="SCHEDULED" checked="{{form.deliveryMethod === 'SCHEDULED'}}" />预约配送</label>
<label class="radio"><radio value="SELF_PICKUP" checked="{{form.deliveryMethod === 'SELF_PICKUP'}}" />自提</label>
</radio-group>
<view wx:if="{{form.deliveryMethod !== 'SELF_PICKUP'}}">
<view class="muted">收货地址</view>
<picker mode="selector" range="{{addresses}}" range-key="detail" value="{{addressIndex}}" bindchange="onAddressChange">
<view class="picker">{{addresses[addressIndex] ? addresses[addressIndex].building + ' ' + addresses[addressIndex].room + ' ' + addresses[addressIndex].detail : '请选择地址'}}</view>
</picker>
</view>
<view wx:if="{{form.deliveryMethod === 'SCHEDULED'}}">
<view class="muted">预约时间</view>
<input class="input" placeholder="2026-07-07T18:30:00" bindinput="onScheduledTimeChange" />
</view>
<view class="muted">备注</view>
<textarea class="textarea" bindinput="onRemarkInput" />
<button class="primary" loading="{{submitting}}" bindtap="submit">提交订单</button>
</view>
</view>