Initial commit
This commit is contained in:
106
miniprogram/pages/order/comment/index.wxml
Normal file
106
miniprogram/pages/order/comment/index.wxml
Normal file
@@ -0,0 +1,106 @@
|
||||
<view class="comment-page">
|
||||
<!-- 导航栏 -->
|
||||
<t-navbar title="评价商品" left-arrow bind:left-click="onBack" />
|
||||
|
||||
<!-- 商品信息 -->
|
||||
<view class="product-info" wx:if="{{orderItem}}">
|
||||
<image class="product-image" src="{{orderItem.product.images[0] || '/assets/placeholder.png'}}" mode="aspectFill" />
|
||||
<view class="product-details">
|
||||
<view class="product-name">{{orderItem.product.name}}</view>
|
||||
<view class="product-spec" wx:if="{{orderItem.product_spec}}">{{orderItem.product_spec}}</view>
|
||||
<view class="product-price">
|
||||
<price price="{{orderItem.price}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 评分 -->
|
||||
<view class="rating-section">
|
||||
<view class="section-title">商品评分</view>
|
||||
<t-rate
|
||||
value="{{rating}}"
|
||||
size="60rpx"
|
||||
color="#ff6b35"
|
||||
bind:change="onRatingChange"
|
||||
allow-half="{{false}}"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 评论内容 -->
|
||||
<view class="content-section">
|
||||
<view class="section-title">评价内容</view>
|
||||
<t-textarea
|
||||
value="{{content}}"
|
||||
placeholder="请输入您的评价内容..."
|
||||
maxlength="{{maxContentLength}}"
|
||||
indicator="{{true}}"
|
||||
autosize="{{true}}"
|
||||
bind:change="onContentInput"
|
||||
t-class="comment-textarea"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 图片上传 -->
|
||||
<view class="images-section">
|
||||
<view class="section-title">上传图片(可选)</view>
|
||||
<view class="images-grid">
|
||||
<view
|
||||
class="image-item"
|
||||
wx:for="{{images}}"
|
||||
wx:key="index"
|
||||
bind:tap="onPreviewImage"
|
||||
data-index="{{index}}"
|
||||
>
|
||||
<image src="{{item}}" mode="aspectFill" class="uploaded-image" />
|
||||
<view
|
||||
class="delete-btn"
|
||||
bind:tap="onDeleteImage"
|
||||
data-index="{{index}}"
|
||||
catch:tap="true"
|
||||
>
|
||||
<t-icon name="close" size="24rpx" color="#fff" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="add-image-btn"
|
||||
wx:if="{{images.length < maxImages}}"
|
||||
bind:tap="onChooseImage"
|
||||
>
|
||||
<t-icon name="add" size="48rpx" color="#999" />
|
||||
<text class="add-text">添加图片</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="images-tip">最多可上传{{maxImages}}张图片</view>
|
||||
</view>
|
||||
|
||||
<!-- 匿名评论 -->
|
||||
<view class="anonymous-section">
|
||||
<view class="anonymous-item">
|
||||
<text class="anonymous-label">匿名评论</text>
|
||||
<t-switch
|
||||
value="{{isAnonymous}}"
|
||||
bind:change="onAnonymousChange"
|
||||
size="large"
|
||||
/>
|
||||
</view>
|
||||
<view class="anonymous-tip">开启后,您的用户名将不会显示</view>
|
||||
</view>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="submit-section">
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="large"
|
||||
loading="{{submitting}}"
|
||||
disabled="{{submitting}}"
|
||||
bind:tap="onSubmit"
|
||||
t-class="submit-btn"
|
||||
>
|
||||
{{submitting ? '提交中...' : '提交评价'}}
|
||||
</t-button>
|
||||
</view>
|
||||
|
||||
<!-- Toast -->
|
||||
<t-toast id="t-toast" />
|
||||
</view>
|
||||
Reference in New Issue
Block a user