This commit is contained in:
Ling53666
2025-08-18 09:11:51 +08:00
commit 02554225da
2516 changed files with 133155 additions and 0 deletions

View File

@ -0,0 +1,58 @@
/* 评价盒子 */
.box {
width: 90%;
border: 1px solid #de868f;
border-radius: 20rpx;
margin-top: 20rpx;
}
/* 标题部分 */
.box1{
width: 100%;
height: 50px;
display: flex;
justify-content: space-between
}
.text{
display: inline-block;
font-weight: bold;
margin: 30rpx 0rpx 0rpx 30rpx;
}
.image{
width: 60px;
height: 60px;
position: relative;
left: 30rpx;
border-radius: 20px;
}
.text2{
position: relative;
}
.button {
background-color: #f3bfc1; /* Light pink background color */
color: #000000; /* Text color */
border-radius: 20px; /* Rounded edges */
font-size: 16px;
width: 90%;
height: 70%;
display:flex;
align-items: center;
justify-content: center;
}
.label {
color: #333;
}
.input-row {
display: flex;
flex-direction: column;
padding: 10px 0;
border-bottom: 1px solid #ddd;
margin-left: 20rpx;
}
.tijiao{
width: 100%;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
margin-top: 40rpx;
}

View File

@ -0,0 +1,87 @@
<view style="width:100%">
<!-- 通知栏 -->
<view style="width:100%">
<ant-notice
type="primary"
icon="https://files.superbed.cn/proxy/7569696d6e2732326a766d75726972337e7973337f7e787f726e337e7270327f2424247c242d2c297e2d252b782d2b252b7e252a782c7f2c2f2d252a7f7b292d7c792c7e7f2a7c33776d7a.png"
style="margin-bottom: 8px"
mode="link"
>
提交评价或建议,鼓励美甲师和商家做得更好~
</ant-notice>
</view>
<!-- 评价部分 -->
<view style="width:100%;display:flex; flex-direction: column;align-items: center">
<view class="box">
<!-- 标题栏 -->
<view class="box1">
<text class="text">您对美甲师满意吗?</text>
</view>
<view style="width:100%;height:70px">
<image class="image" mode="scaleToFill" src="{{manicuristAvatar}}" />
<text class="text2"style="left: 40rpx;
bottom: 70rpx;">{{manicuristName}}</text>
<text class="text2"style="right:120rpx;bottom:30rpx;font-size:12px;color:#cdd1d5;margin-left:10rpx">11月11日 16:37左右完成</text>
</view>
<view style="width:100%;height:30px">
<view style="margin-left:40rpx;margin-bottom:20rpx;width:300px">
<text style="margin-right:10rpx">总体</text>
<ant-rate
onChange="handleChangem"
defaultValue="{{0}}"
>
<ant-icon
slot="character"
type="StarOutline"
></ant-icon>
</ant-rate>
</view>
<!-- 店铺商品 -->
</view>
</view>
<view class="box">
<!-- 标题栏 -->
<view class="box1">
<text class="text">您对商品/商家满意吗?</text>
</view>
<view style="width:100%;height:70px">
<image class="image" mode="scaleToFill" src="{{businessAvatar}}" />
<text class="text2"style="left: 40rpx;
bottom: 50rpx;">{{businessName}}</text>
</view>
<view style="width:100%;height:30px">
<view style="margin-left:40rpx;margin-bottom:20rpx;width:300px">
<text style="margin-right:10rpx">总体</text>
<ant-rate
defaultValue="{{0}}"
onChange="handleChange"
>
<ant-icon
slot="character"
type="StarOutline"
></ant-icon>
</ant-rate>
</view>
</view>
<view style="margin-bottom:10rpx">
<textarea onInput="bindTextAreaBlur" auto-height placeholder="说说商品怎么样,给大家参考" />
</view>
<view class="section">
<view class="input-row">
<ant-uploader
onChange="onChange"
onUpload="{{onUpload ? onUpload : 'onUpload'}}"
uploadingText="上传中……"
uploadfailedText="上传失败"
></ant-uploader>
<text class="label">上传图片</text>
</view>
</view>
</view>
<view class="tijiao">
<view class="button" onTap="tijiao">提交</view>
</view>
</view>
</view>

View File

@ -0,0 +1,123 @@
import {url} from '../request'
Page({
data: {
},
onLoad(options) {
const businessName =options.businessName
const businessAvatar = options.businessAvatar
const manicuristName = options.manicuristName
const manicuristid = options.manicuristid
const manicuristAvatar = options.manicuristAvatar
const businessId =options.businessId
const orderid = options.orderid
console.log('======>jieshoude ',orderid,businessId,manicuristAvatar,businessAvatar,manicuristid,businessName,manicuristName,);
this.setData({
businessName:businessName,
businessAvatar:businessAvatar,
manicuristName:manicuristName,
manicuristid:manicuristid,
manicuristAvatar:manicuristAvatar,
businessId:businessId,
orderid:orderid,
})
console.log(this.data.manicuristAvatar,this.data.manicuristName);
},
bindTextAreaBlur(e) {
this.setData({
inputtext:e.detail.value
})
console.log(this.data.inputtext);
},
onUpload(file) {
return new Promise((resolve, reject) => {
console.log('上传文件路径:', file); // 确保文件路径正确
my.uploadFile({
url: url + '/api/file/upload/server/not_login',
fileType: 'image',
name: 'file',
filePath: file.path,
formData: {
biz: 'card',
},
success: res => {
resolve(file.path);
console.log('上传成功:', res);
const cunchu = JSON.parse(res.data)
this.setData({
zhengshu:`${'http://'}${cunchu.data}`,
})
console.log(this.data.zhengshu,'hhhhhhhhhhhhhhh');
},
fail: (err) => {
console.log('上传失败:', err);
reject();
},
});
});
},
// 星级改变
handleChange(value) {
console.log(value);
this.setData({
value:value,
});
},
handleChangem(value) {
console.log(value);
this.setData({
valuemeijiashi:value,
});
},
tijiao(){
my.getStorage({
key: 'userInfo',
success: (res) => {
const userInfo = res.data;
this.setData({
id: userInfo.id, // 获取 id
});
if (userInfo && userInfo.cookie) {
my.request({
url: url + '/api/level/add',
method: 'POST',
data: {
businessId: this.data.businessId,
manicuristId: this.data.manicuristid,
manicuristRating: this.data.valuemeijiashi,
orderId: this.data.orderid,
rating: this.data.value,
review: this.data.inputtext,
userId: this.data.id
},
headers: {
'content-type': 'application/json',
},
dataType: 'json',
success: (res) => {
console.log(res);
if (res.data.code === 0) {
console.log(res);
my.alert({content:'评价成功'})
my.navigateBack();
}
},
fail: (error) => {
my.alert({ content: '评价失败' });
},
});
} else {
my.alert({
content: '您未登录,请先登录。',
success: () => {
my.navigateTo({
url: '/pages/denglu/denglu',
});
},
});
}
},
});
},
});

View File

@ -0,0 +1,11 @@
{
"defaultTitle": "评价",
"usingComponents": {
"ant-checkbox": "antd-mini/es/Checkbox/index",
"ant-rate": "antd-mini/es/Rate/index",
"ant-icon": "antd-mini/es/Icon/index",
"ant-uploader": "antd-mini/es/ImageUpload/index",
"ant-notice": "antd-mini/es/NoticeBar/index"
},
"styleIsolation": "apply-shared"
}