Commit 8ffa9ba7 authored by 刘玉宏's avatar 刘玉宏

111

parent bb5aae69
......@@ -69,3 +69,11 @@ export function sgyOrderGetStatus(data) {
data,
});
}
// 新增订单评价
export function evaluation(data) {
return request({
url: '/sgyrdd/evaluation/eval',
method: 'post',
data,
});
}
......@@ -2,76 +2,132 @@
<view class="container">
<Header title="评论"></Header>
<view class="content">
<wd-form ref="form" :model="model" :rules="rules" class="remake">
<text class="textarea">老凯里酸汤鱼</text>
<wd-form ref="form" :model="formdata" :rules="rules" class="remake">
<text class="textarea">{{ shopname }}</text>
<view class="itemPicker">
<view class="item01">
<text class="label">评分</text>
<wd-rate v-model="pinfen" active-color="#ff0000" size="50rpx" space="10px" />
<wd-rate
prop="merchantServices"
v-model="formdata.merchantServices"
active-color="#ff0000"
size="50rpx"
space="10px"
@change="handlemerchant"
/>
</view>
<view class="item02">
<text>非常满意</text>
<text>{{ merList[formdata.merchantServices] }}</text>
</view>
</view>
<wd-textarea v-model="pingjia" placeholder="亲,分享您的看法,给其他人一个参考哦!" />
<wd-textarea
prop="evaluation"
v-model="formdata.evaluation"
placeholder="亲,分享您的看法,给其他人一个参考哦!"
:rules="[{ required: true, message: '请填写你的评价' }]"
/>
<text class="textarea">上传图片/视频</text>
<wd-upload
class="wdUpload"
accept="media"
multiple
:file-list="fileList"
:action="action"
@change="handleChange"
:action="fileUPload"
@change="handleFile"
></wd-upload>
<view class="tuijian">
<!-- <view class="tuijian" v-if="show">
<view class="tjTitle">
<text class="textarea">我要推荐菜</text>
<text class="textRight">
查看全部(30)
<i></i>
<wd-icon name="arrow-right"></wd-icon>
</text>
</view>
<view class="itemtuijianList">
<wd-button type="success" plain classPrefix="fish" icon="kehuishouwu">
主要按钮
</wd-button>
</view>
</view>
<wd-cell title="开启折扣" title-width="100px" prop="switchVal" center>
<view style="text-align: left">
<wd-switch v-model="mode.switchVal" />
<wd-checkbox-group shape="button">
<wd-checkbox modelValue="jingmai" checked-color="#f00" shape="button"></wd-checkbox>
<wd-checkbox modelValue="asd" shape="button">沃特</wd-checkbox>
</wd-checkbox-group>
</view>
</view> -->
<wd-cell title="匿名评价" prop="isAnonymous" class="itemSwichval">
<wd-switch
size="48rpx"
active-color="#EC1B1B"
v-model="formdata.isAnonymous"
active-value="1"
inactive-value="0"
/>
</wd-cell>
</wd-form>
<wd-button type="error" block>发布</wd-button>
<wd-button type="error" block @click="handleSubmit">发布</wd-button>
</view>
</view>
</template>
<script setup lang="ts">
import Header from './components/Header/index.vue';
import { evaluation } from '@/api/order';
const form = ref();
/**
* options
*/
const shopname = ref<string>('');
onLoad((options) => {
shopname.value = options?.shopName;
formdata.orderNumber = options?.orderNumber;
});
const pinfen = ref<number>(0);
function changeValue({ pinfen }) {
console.log(pinfen);
}
const pingjia = ref<string>('');
const formdata = reactive<{
orderNumber: string;
evaluation: string;
images: string[];
isAnonymous: number;
descriptionMatches: number;
merchantServices: number;
}>({
orderNumber: '',
evaluation: '',
images: [],
isAnonymous: 0,
descriptionMatches: 0,
merchantServices: 0,
});
const action = ref<string>('/zhTuw2P8c29bc981a741931bdd86eb04dc1e8fd64865cb5/upload');
const rules = {};
/**
* 显示推荐菜
*/
const show = ref<boolean>(false);
/**
* 评分
*/
const merchantServices = ref<number>(0);
const merList = ref({
1: '非常差',
2: '差',
3: '一般',
4: '好',
5: '非常好',
});
const handlemerchant = (e) => {
merchantServices.value = e.value;
};
const fileList = ref([]);
/**
* 图片上传
*/
const fileUPload = ref<string>('/');
function handleChange({ files }) {
fileList.value = files;
}
const mode = reactive<{
switchVal: boolean;
}>({
switchVal: true,
});
function handleFile({ files }) {}
const handleSubmit = async () => {
const res = await evaluation();
console.log(formdata);
};
</script>
<style lang="scss" scoped>
.container {
......@@ -141,15 +197,32 @@ const mode = reactive<{
.tuijian {
margin-top: 72rpx;
.tjTitle {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 40rpx;
.textRight {
font-size: 24rpx;
}
}
}
.itemSwichval {
width: auto;
padding: 0;
margin-top: 72rpx;
:deep(.wd-cell__wrapper) {
padding: 0;
align-items: center;
}
}
}
.wd-cel {
--wot-size-side-padding: 0px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment