Commit 1f53e0a8 authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents 88dcf3d8 880987e5
...@@ -79,7 +79,14 @@ export function applyForARefundApi(data) { ...@@ -79,7 +79,14 @@ export function applyForARefundApi(data) {
data, data,
}); });
} }
// 新增订单评价
export function evaluation(data) {
return request({
url: '/sgyrdd/evaluation/eval',
method: 'post',
data,
});
}
export function afterSale(data) { export function afterSale(data) {
return request({ return request({
url: '/sgyrdd/sgyOrder/afterSales/getInfo', url: '/sgyrdd/sgyOrder/afterSales/getInfo',
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
{ {
"path": "pages/index/foodClassification", "path": "pages/index/foodClassification",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": "",
"enablePullDownRefresh": true
} }
}, },
{ {
...@@ -87,37 +88,32 @@ ...@@ -87,37 +88,32 @@
"style": { "style": {
"navigationBarTitleText": "美食评论" "navigationBarTitleText": "美食评论"
} }
} },
,
{ {
"path": "pages/order/refund", "path": "pages/order/refund",
"style": { "style": {
"navigationBarTitleText": "申请退款" "navigationBarTitleText": "申请退款"
} }
} },
,
{ {
"path": "pages/index/coupon", "path": "pages/index/coupon",
"style": { "style": {
"navigationBarTitleText": "优惠券详情", "navigationBarTitleText": "优惠券详情",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
} },
,
{ {
"path": "pages/storeEntry/index", "path": "pages/storeEntry/index",
"style": { "style": {
"navigationBarTitleText": "我的店铺" "navigationBarTitleText": "我的店铺"
} }
} },
,
{ {
"path": "pages/storeEntry/detail", "path": "pages/storeEntry/detail",
"style": { "style": {
"navigationBarTitleText": "商家入驻" "navigationBarTitleText": "商家入驻"
} }
} },
,
{ {
"path": "pages/order/afterSales", "path": "pages/order/afterSales",
"style": { "style": {
......
...@@ -129,8 +129,8 @@ const params = ref({ ...@@ -129,8 +129,8 @@ const params = ref({
size: 15, size: 15,
// lon, // lon,
// lat, // lat,
lon: 106.68650025025502, lon: '',
lat: 26.567192352601154, lat: '',
isEnd: false, isEnd: false,
}); });
const pics = ref(null); const pics = ref(null);
...@@ -221,6 +221,13 @@ function refresh() { ...@@ -221,6 +221,13 @@ function refresh() {
resolve(); resolve();
}); });
} }
onPullDownRefresh(() => {
refresh().then(() => {
getMerchantList().then(() => {
xma.stopPullDownRefresh();
});
});
});
// 根据父级分类id查询子分类列表 // 根据父级分类id查询子分类列表
const query = (parentId) => { const query = (parentId) => {
getByParentId(parentId).then((res) => { getByParentId(parentId).then((res) => {
...@@ -237,6 +244,7 @@ function jumpProductDetails(prodId) { ...@@ -237,6 +244,7 @@ function jumpProductDetails(prodId) {
} }
const prodSpecialFn = () => { const prodSpecialFn = () => {
prodSpecial({ categoryId: categoryId.value }).then((res) => { prodSpecial({ categoryId: categoryId.value }).then((res) => {
if (res.data.data) {
res.data.data = res.data.data.map((el) => { res.data.data = res.data.data.map((el) => {
if (el.labels && el.labels !== '') { if (el.labels && el.labels !== '') {
el.labels = el.labels.split(','); el.labels = el.labels.split(',');
...@@ -244,6 +252,7 @@ const prodSpecialFn = () => { ...@@ -244,6 +252,7 @@ const prodSpecialFn = () => {
return el; return el;
}); });
topDiscountedProducts.value = res.data.data; topDiscountedProducts.value = res.data.data;
}
}); });
}; };
const choice = (index) => { const choice = (index) => {
...@@ -295,13 +304,8 @@ const getMerchantList = () => { ...@@ -295,13 +304,8 @@ const getMerchantList = () => {
item.labels = item.labels.split(','); item.labels = item.labels.split(',');
} }
}); });
return new Promise((resolve) => {
cardData.value = cardData.value.concat(res.data.content); cardData.value = cardData.value.concat(res.data.content);
xma.hideLoading(); xma.hideLoading();
setTimeout(() => {
resolve();
}, 500);
});
}); });
}; };
function getLocationFn() { function getLocationFn() {
......
...@@ -2,76 +2,132 @@ ...@@ -2,76 +2,132 @@
<view class="container"> <view class="container">
<Header title="评论"></Header> <Header title="评论"></Header>
<view class="content"> <view class="content">
<wd-form ref="form" :model="model" :rules="rules" class="remake"> <wd-form ref="form" :model="formdata" :rules="rules" class="remake">
<text class="textarea">老凯里酸汤鱼</text> <text class="textarea">{{ shopname }}</text>
<view class="itemPicker"> <view class="itemPicker">
<view class="item01"> <view class="item01">
<text class="label">评分</text> <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>
<view class="item02"> <view class="item02">
<text>非常满意</text> <text>{{ merList[formdata.merchantServices] }}</text>
</view> </view>
</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> <text class="textarea">上传图片/视频</text>
<wd-upload <wd-upload
class="wdUpload" class="wdUpload"
accept="media" accept="media"
multiple multiple
:file-list="fileList" :action="fileUPload"
:action="action" @change="handleFile"
@change="handleChange"
></wd-upload> ></wd-upload>
<view class="tuijian">
<!-- <view class="tuijian" v-if="show">
<view class="tjTitle"> <view class="tjTitle">
<text class="textarea">我要推荐菜</text> <text class="textarea">我要推荐菜</text>
<text class="textRight"> <text class="textRight">
查看全部(30) 查看全部(30)
<i></i> <wd-icon name="arrow-right"></wd-icon>
</text> </text>
</view> </view>
<view class="itemtuijianList"> <view class="itemtuijianList">
<wd-button type="success" plain classPrefix="fish" icon="kehuishouwu"> <wd-checkbox-group shape="button">
主要按钮 <wd-checkbox modelValue="jingmai" checked-color="#f00" shape="button"></wd-checkbox>
</wd-button> <wd-checkbox modelValue="asd" shape="button">沃特</wd-checkbox>
</view> </wd-checkbox-group>
</view>
<wd-cell title="开启折扣" title-width="100px" prop="switchVal" center>
<view style="text-align: left">
<wd-switch v-model="mode.switchVal" />
</view> </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-cell>
</wd-form> </wd-form>
<wd-button type="error" block>发布</wd-button> <wd-button type="error" block @click="handleSubmit">发布</wd-button>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Header from './components/Header/index.vue'; 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); const formdata = reactive<{
function changeValue({ pinfen }) { orderNumber: string;
console.log(pinfen); evaluation: string;
} images: string[];
const pingjia = ref<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 }) { function handleFile({ files }) {}
fileList.value = files;
} const handleSubmit = async () => {
const mode = reactive<{ const res = await evaluation();
switchVal: boolean; console.log(formdata);
}>({ };
switchVal: true,
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
...@@ -141,15 +197,32 @@ const mode = reactive<{ ...@@ -141,15 +197,32 @@ const mode = reactive<{
.tuijian { .tuijian {
margin-top: 72rpx; margin-top: 72rpx;
.tjTitle { .tjTitle {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 40rpx; margin-bottom: 40rpx;
.textRight { .textRight {
font-size: 24rpx; 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> </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