wutong bf2c2f5fbf perf: 修改移动端包体积问题
- 删除未使用组件 primewind-sliderrange、u--image(主包无用组件)
- manifest 启用 lazyCodeLoading 组件按需注入
- 移除 serverInfo/evaluate 中对已删组件的失效引用
- 压缩 smartDevice 页图片(cat 缩略图降至 160px、hero 横幅降质量档),主包图片总量降至 200K 以下

Claude-Session: https://claude.ai/code/session_01Ya56EWbT3mBRNrtMv8pjNC
2026-07-10 10:39:11 +08:00

149 lines
4.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="container">
<!-- 评分区域 -->
<view class="rating-section">
<!-- 订单编号 -->
<view class="order-info">
<text class="order-label">订单编号</text>
<text class="order-value">{{ itemObj.order_no }}</text>
</view>
<view class="goods">
<view>
<image :src="itemObj.commodity_order_item_list[0].commodity_pic" class="goodsImg"></image>
</view>
<view class="rating">
<view>很差</view>
<view></view>
<view>一般</view>
<view>不错</view>
<view>满意</view>
</view>
</view>
<!-- 商品品质 -->
<view class="rating-item">
<text class="rating-label">商品品质</text>
<u-rate v-model="qualityRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 配送速度 -->
<view class="rating-item">
<text class="rating-label">配送速度</text>
<u-rate v-model="speedRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 快递员服务 -->
<view class="rating-item">
<text class="rating-label">快递员服务</text>
<u-rate v-model="serviceRating" size="40" active-color="#FFB400" inactive-color="#EEEEEE" gutter="60"></u-rate>
</view>
<!-- 评价输入 -->
<view class="comment-section">
<textarea class="comment-input" placeholder="展开说说对商品的想法吧…" v-model="comment"></textarea>
</view>
<!-- 图片上传 -->
<view class="upload-section">
<view class="image-list">
<view class="image-item" v-for="(img, index) in imageList" :key="index">
<image :src="img" class="uploaded-img"></image>
<view class="delete-btn" @click="deleteImage(index)">
<text class="delete-icon">×</text>
</view>
</view>
</view>
<view class="upload-btn" @click="chooseImage" v-if="imageList.length < 3">
<image src="https://static.hshuishang.com/myOrder/upload.png" class="upload-icon">
</image>
<view class="upload-text">上传图片</view>
<view class="upload-count">({{ imageList.length }}/3)</view>
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn" @click="submitEvaluate">
<text class="btn-text">提交</text>
</view>
</view>
</view>
</template>
<script>
import { picUrl, NavgateTo, request } from "../../../utils";
import { apiArr } from "../../../api/afterSale";
export default {
data() {
return {
// 评分数据
qualityRating: 0,
speedRating: 0,
serviceRating: 0,
// 评价内容
comment: "",
// 图片列表
imageList: [],
itemObj: {},
};
},
methods: {
// 选择图片
chooseImage() {
if (this.imageList.length >= 3) {
uni.showToast({
title: "最多上传3张图片",
icon: "none",
});
return;
}
uni.chooseImage({
count: 3 - this.imageList.length,
sizeType: ["original", "compressed"],
sourceType: ["album", "camera"],
success: (res) => {
this.imageList = this.imageList.concat(res.tempFilePaths);
},
});
},
// 删除图片
deleteImage(index) {
this.imageList.splice(index, 1);
},
// 提交评价
submitEvaluate() {
if (!this.comment.trim() && this.imageList.length === 0) {
uni.showToast({
title: "请至少填写评价内容或上传图片",
icon: "none",
});
return;
}
const params = {
order_id: this.itemObj.id,
goods_id: this.itemObj.commodity_order_item_list[0].goods_id,
user_id: uni.getStorageSync("userId"),
quality_score: this.qualityRating,
speed_score: this.speedRating,
service_score: this.serviceRating,
user_review: this.comment,
review_image: this.imageList,
}
request(apiArr.createReview, "POST", params).then((res) => {
uni.showToast({
title: "评价提交成功",
icon: "success",
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
},
},
onLoad(options) {
this.itemObj = JSON.parse(decodeURIComponent(options.item));
},
};
</script>
<style>
@import url("./index.css");
</style>