feat : 订单评价页面
This commit is contained in:
parent
1852c98463
commit
1ae26edd98
@ -77,7 +77,7 @@
|
||||
</button>
|
||||
</view>
|
||||
<view class="btn-group" v-if="item.status === '已完成'">
|
||||
<button class="cancel-btn" @click="cancelOrder">
|
||||
<button class="cancel-btn" @click="orderEvaluate">
|
||||
服务评价
|
||||
</button>
|
||||
<button class="yfd-btn" @click="cancelOrder">运费单</button>
|
||||
@ -221,6 +221,10 @@ export default {
|
||||
checkLogistics() {
|
||||
NavgateTo(`/packages/myOrders/logistics/index`);
|
||||
},
|
||||
|
||||
orderEvaluate(){
|
||||
NavgateTo(`/packages/myOrders/orderEvaluate/index`);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -146,8 +146,8 @@ export default {
|
||||
|
||||
// 地图显示区域
|
||||
points: [
|
||||
{ latitude: 39.915, longitude: 116.42 },
|
||||
{ latitude: 39.90469, longitude: 116.40717 },
|
||||
{ latitude: 39.876, longitude: 116.435 },
|
||||
{ latitude: 39.886, longitude: 116.395 },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
<button class="pay-btn" @click="gotoPayment">立即支付</button>
|
||||
</view>
|
||||
<view class="bottom-buttons" v-if="status === '已完成'">
|
||||
<button class="cancel-btn" @click="cancelOrder">服务评价</button>
|
||||
<button class="cancel-btn" @click="orderEvaluate">服务评价</button>
|
||||
<button class="yfd-btn" @click="cancelOrder">运费单</button>
|
||||
<button class="pay-btn" @click="gotoPayment">立即支付</button>
|
||||
</view>
|
||||
@ -263,6 +263,10 @@ export default {
|
||||
checkLogistics() {
|
||||
NavgateTo(`/packages/myOrders/logistics/index`);
|
||||
},
|
||||
|
||||
orderEvaluate(){
|
||||
NavgateTo(`/packages/myOrders/orderEvaluate/index`);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
202
packages/myOrders/orderEvaluate/index.css
Normal file
202
packages/myOrders/orderEvaluate/index.css
Normal file
@ -0,0 +1,202 @@
|
||||
page {
|
||||
background-color: #f0f2f5;
|
||||
min-height: 100vh;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
/* 商品图片区域 */
|
||||
.goods-scroll {
|
||||
width: 96%;
|
||||
white-space: nowrap;
|
||||
margin-bottom: 30rpx;
|
||||
padding: 20rpx 15rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.goods-item {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
margin-right: 16rpx;
|
||||
border-radius: 8rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.goods-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* 订单编号 */
|
||||
.order-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.order-label {
|
||||
font-size: 26rpx;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
.order-value {
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* 评分区域 */
|
||||
.rating{
|
||||
width: 460rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 0 0 20rpx 180rpx;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
|
||||
.rating-section {
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
height: 80vh;
|
||||
}
|
||||
|
||||
.rating-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.rating-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.rating-label {
|
||||
width: 160rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 评价输入 */
|
||||
.comment-section {
|
||||
padding: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
border-top: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.comment-input {
|
||||
width: 100%;
|
||||
min-height: 100rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* 图片上传 */
|
||||
.upload-section {
|
||||
/* background-color: #FFFFFF; */
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 40rpx;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.upload-btn {
|
||||
display: flex;
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
padding: 15rpx;
|
||||
background-color: #f6f6f6;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.upload-icon {
|
||||
width: 60rpx;
|
||||
height: 50rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.upload-text {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
|
||||
.upload-count {
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.image-list {
|
||||
display: flex;
|
||||
/* flex-wrap: wrap; */
|
||||
}
|
||||
|
||||
.image-item {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.uploaded-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: -10rpx;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delete-icon {
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 提交按钮 */
|
||||
.submit-btn {
|
||||
width: 90%;
|
||||
height: 98rpx;
|
||||
background-color: #ff4117;
|
||||
border-radius: 49rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 20rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.btn-text {
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
font-weight: bold;
|
||||
}
|
||||
179
packages/myOrders/orderEvaluate/index.vue
Normal file
179
packages/myOrders/orderEvaluate/index.vue
Normal file
@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 商品图片区域 -->
|
||||
<scroll-view class="goods-scroll" scroll-x>
|
||||
<view class="goods-list">
|
||||
<view class="goods-item" v-for="(item, index) in goods" :key="index">
|
||||
<image :src="item.image" class="goods-img"></image>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 评分区域 -->
|
||||
<view class="rating-section">
|
||||
<!-- 订单编号 -->
|
||||
<view class="order-info">
|
||||
<text class="order-label">订单编号</text>
|
||||
<text class="order-value">38757328485</text>
|
||||
</view>
|
||||
<view class="rating">
|
||||
<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="http://localhost:8080/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>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 商品列表
|
||||
goods: [
|
||||
{ image: "http://localhost:8080/order_index1.png" },
|
||||
{ image: "http://localhost:8080/order_index2.png" },
|
||||
{ image: "http://localhost:8080/order_index3.png" },
|
||||
{ image: "http://localhost:8080/order_index4.png" },
|
||||
{ image: "http://localhost:8080/order_index5.png" },
|
||||
{ image: "http://localhost:8080/order_index1.png" },
|
||||
{ image: "http://localhost:8080/order_index2.png" },
|
||||
{ image: "http://localhost:8080/order_index3.png" },
|
||||
{ image: "http://localhost:8080/order_index4.png" },
|
||||
{ image: "http://localhost:8080/order_index5.png" },
|
||||
],
|
||||
// 评分数据
|
||||
qualityRating: 5,
|
||||
speedRating: 0,
|
||||
serviceRating: 0,
|
||||
// 评价内容
|
||||
comment: "",
|
||||
// 图片列表
|
||||
imageList: [],
|
||||
};
|
||||
},
|
||||
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;
|
||||
}
|
||||
// 这里添加提交评价的API调用逻辑
|
||||
uni.showToast({
|
||||
title: "评价提交成功",
|
||||
icon: "success",
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("./index.css");
|
||||
</style>
|
||||
0
packages/myOrders/selfPickUpSite/index.css
Normal file
0
packages/myOrders/selfPickUpSite/index.css
Normal file
0
packages/myOrders/selfPickUpSite/index.vue
Normal file
0
packages/myOrders/selfPickUpSite/index.vue
Normal file
0
packages/myOrders/submitOrder/index.css
Normal file
0
packages/myOrders/submitOrder/index.css
Normal file
0
packages/myOrders/submitOrder/index.vue
Normal file
0
packages/myOrders/submitOrder/index.vue
Normal file
18
pages.json
18
pages.json
@ -761,6 +761,24 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "物流跟踪"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "orderEvaluate/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评价"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "submitOrder/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "提交订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "selfPickUpSite/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择自提点"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user