Commit e9e29550 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents ed65be72 855d089f
...@@ -4,6 +4,9 @@ import { sgyOrderGetStatus } from './api/order'; ...@@ -4,6 +4,9 @@ import { sgyOrderGetStatus } from './api/order';
import testJson from './static/json/test.json'; import testJson from './static/json/test.json';
import { getToken } from './utils/auth'; import { getToken } from './utils/auth';
import { setOrderDic } from './utils/orderDic'; import { setOrderDic } from './utils/orderDic';
// beforeMount(() => {
// if (!getToken()) signIn();
// });
onLaunch(() => { onLaunch(() => {
if (!getToken()) signIn(); if (!getToken()) signIn();
sgyOrderGetStatus().then((res) => { sgyOrderGetStatus().then((res) => {
...@@ -22,12 +25,18 @@ onHide(() => { ...@@ -22,12 +25,18 @@ onHide(() => {
}); });
// 登录 // 登录
const signIn = () => { const signIn = () => {
getTokenUser(testJson).then((res) => { xma.xh.getUserProfile({
const token = res.data.access_token; range: ['ACCOUNT', 'MOBILE', 'CITIZEN'],
const userInfo = res.data.user_info; async success(info) {
xma.setStorageSync('Authorization', token); const info2 = JSON.stringify(info);
xma.setStorageSync('userInfo', userInfo); getTokenUser(info2).then((res) => {
console.log('登录...'); const token = res.data.access_token;
const userInfo = res.data.user_info;
xma.setStorageSync('Authorization', token);
xma.setStorageSync('userInfo', userInfo);
console.log('登录...');
});
},
}); });
}; };
</script> </script>
......
...@@ -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',
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "小程序平台" "navigationBarTitleText": "小程序平台",
"navigationStyle":"custom"
} }
}, },
{ {
......
...@@ -322,6 +322,12 @@ const reset = () => { ...@@ -322,6 +322,12 @@ const reset = () => {
cardData2.value = []; cardData2.value = [];
show.value = false; show.value = false;
}; };
const toUse = () => {
xma.navigateTo({
url: '/pages/index/listFood?type=1',
});
};
// 商家列表分页-搜索列表 // 商家列表分页-搜索列表
const getMerchantList = () => { const getMerchantList = () => {
xma.showLoading({ xma.showLoading({
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<Header title="售后详情"></Header> <Header title="售后详情"></Header>
<view class="content"> <view class="content">
<view class="box box1"> <view class="box box1" v-if="afterSaleDetail">
<view class="money"> <view class="money">
<view class="money_l">退款金额</view> <view class="money_l">退款金额</view>
<view class="money_r">{{ afterSaleDetail.refundPrice }}</view> <view class="money_r">{{ afterSaleDetail.refundPrice }}</view>
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
</view> </view>
</view> </view>
</view> </view>
<view class="box"> <view class="box" v-if="orderItems">
<view class="goods"> <view class="goods">
<view class="g1">退款信息</view> <view class="g1">退款信息</view>
<view class="g2" v-for="(item, index) in orderItems" :key="index"> <view class="g2" v-for="(item, index) in orderItems" :key="index">
<img :src="fileDomain + item.pic" /> <img :src="fileDomain + item.pic" mode="aspectFill" />
<view class="g2_item"> <view class="g2_item">
<view class="g2_info"> <view class="g2_info">
<view class="g2_name">{{ item.prodName }}</view> <view class="g2_name">{{ item.prodName }}</view>
...@@ -68,8 +68,8 @@ const getAterSaleDetail = async (id) => { ...@@ -68,8 +68,8 @@ const getAterSaleDetail = async (id) => {
orderItems.value = res.data[0].orderItems; orderItems.value = res.data[0].orderItems;
}; };
onLoad((options) => { onLoad((options) => {
// orderNumber.value = options.orderNumber; orderNumber.value = options.orderNumber;
getAterSaleDetail('NEONO-2024080113095213631'); getAterSaleDetail(orderNumber.value);
}); });
</script> </script>
......
...@@ -63,7 +63,13 @@ ...@@ -63,7 +63,13 @@
评价 评价
</view> </view>
<view class="btn-info" @tap="callShopPhone(item.shopTel)">联系商家</view> <view class="btn-info" @tap="callShopPhone(item.shopTel)">联系商家</view>
<view class="btn-error" v-if="item.status == 7">售后详情</view> <view
class="btn-error"
v-if="item.status === 'after_sales'"
@tap="handleAfterSales(item)"
>
售后详情
</view>
<view <view
class="btn-error" class="btn-error"
v-if=" v-if="
...@@ -117,12 +123,15 @@ import { getOrderDic } from '@/utils/orderDic'; ...@@ -117,12 +123,15 @@ import { getOrderDic } from '@/utils/orderDic';
const fileDomain = import.meta.env.VITE_APP_IMG_URL; const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const stateList = ref(); const stateList = ref();
onLoad(() => { onLoad((options) => {
const orderDic = getOrderDic(); const orderDic = getOrderDic();
stateList.value = orderDic.reduce((obj, item) => { stateList.value = orderDic.reduce((obj, item) => {
obj[item.baseStatus] = item; obj[item.baseStatus] = item;
return obj; return obj;
}, {}); }, {});
if (options.status) {
tab.value = options.status;
}
getList(); getList();
}); });
...@@ -152,7 +161,7 @@ const tabs = ref([ ...@@ -152,7 +161,7 @@ const tabs = ref([
value: 'after_sales', value: 'after_sales',
}, },
]); ]);
const tab = ref('0'); const tab = ref('all');
onShow(() => { onShow(() => {
if (pendingPaymentOrder.value) { if (pendingPaymentOrder.value) {
...@@ -230,6 +239,9 @@ const getList = async () => { ...@@ -230,6 +239,9 @@ const getList = async () => {
state.value = 'finished'; state.value = 'finished';
}; };
/**
* 切换状态栏
*/
const handleChange = (e) => { const handleChange = (e) => {
tab.value = e.name; tab.value = e.name;
initDataList(); initDataList();
...@@ -382,7 +394,7 @@ const handleQrcode = (item) => { ...@@ -382,7 +394,7 @@ const handleQrcode = (item) => {
}; };
/** /**
* 售后详情 * 订单评价
*/ */
const handleRemark = (item) => { const handleRemark = (item) => {
xma.navigateTo({ xma.navigateTo({
...@@ -390,6 +402,12 @@ const handleRemark = (item) => { ...@@ -390,6 +402,12 @@ const handleRemark = (item) => {
}); });
}; };
const handleAfterSales = (item) => {
xma.navigateTo({
url: `/pages/order/afterSales?orderNumber=${item.orderNumber}`,
});
};
/** /**
* 申请退款 * 申请退款
*/ */
......
...@@ -47,13 +47,14 @@ ...@@ -47,13 +47,14 @@
<view class="content-between" @tap="showPop = true"> <view class="content-between" @tap="showPop = true">
<text>退款原因</text> <text>退款原因</text>
<view class="rightbox"> <view class="rightbox">
<text>选择退款原因</text> <text v-if="selectType">{{ reasonList[selectType].name }}</text>
<text v-else>选择退款原因</text>
<wd-icon name="arrow-right" size="22px"></wd-icon> <wd-icon name="arrow-right" size="22px"></wd-icon>
</view> </view>
</view> </view>
</view> </view>
<view class="btn">提交</view> <view class="btn" @tap="submit">提交</view>
</view> </view>
</view> </view>
<wd-popup <wd-popup
...@@ -88,7 +89,7 @@ ...@@ -88,7 +89,7 @@
placeholder-style="font-size:28rpx;color: #c0c4cc;" placeholder-style="font-size:28rpx;color: #c0c4cc;"
></textarea> ></textarea>
</radio-group> </radio-group>
<view class="btn">确认</view> <view class="btn" @tap="chooseReason">确认</view>
</view> </view>
</wd-popup> </wd-popup>
</template> </template>
...@@ -121,7 +122,7 @@ function handleChange({ fileList: files }) { ...@@ -121,7 +122,7 @@ function handleChange({ fileList: files }) {
} }
const showPop = ref(false); const showPop = ref(false);
const selectType = ref(0); const selectType = ref(null);
const reasonList = ref([ const reasonList = ref([
{ {
id: '0', id: '0',
...@@ -149,6 +150,59 @@ function radioChange(evt) { ...@@ -149,6 +150,59 @@ function radioChange(evt) {
const { value } = evt.detail; const { value } = evt.detail;
selectType.value = value; selectType.value = value;
} }
const submit = async () => {
if (!selectType.value) {
return xma.showToast({
title: '请选择退款原因',
icon: 'none',
});
}
if (selectType.value === '4' && !otherReason.value) {
return xma.showToast({
title: '请输入其他原因',
icon: 'none',
});
}
xma.showLoading({
title: '提交中',
mask: true,
});
await applyForARefundApi({
orderNumber: orderNumber.value,
refundMemo:
selectType.value === 4 ? otherReason.value : reasonList.value[selectType.value].name,
imgs: fileList.value.map((item) => item.url),
});
setTimeout(() => {
xma.hideLoading();
setTimeout(() => {
xma.showToast({
title: '提交成功',
icon: 'success',
});
}, 500);
xma.redirectTo({
url: `/pages/order/order?status=after_sales`,
});
}, 1500);
};
const chooseReason = () => {
if (!selectType.value) {
return xma.showToast({
title: '请选择退款原因',
icon: 'none',
});
}
if (selectType.value === '4' && !otherReason.value) {
return xma.showToast({
title: '请输入其他原因',
icon: 'none',
});
}
showPop.value = false;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -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="tjTitle">
<text class="textarea">我要推荐菜</text>
<text class="textRight">
查看全部(30)
<i></i>
</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 class="tuijian" v-if="show">
<view style="text-align: left"> <view class="tjTitle">
<wd-switch v-model="mode.switchVal" /> <text class="textarea">我要推荐菜</text>
</view> <text class="textRight">
查看全部(30)
<wd-icon name="arrow-right"></wd-icon>
</text>
</view>
<view class="itemtuijianList">
<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-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>
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
<view class="container"> <view class="container">
<Header title="我的券"></Header> <Header title="我的券"></Header>
<view class="tab"> <view class="tab">
<view :class="currentTab == index ? 'tab-select' : 'tab-item'" @click="changeTab(index)" <view
v-for="(item, index) in tabList" :key="index"> :class="currentTab == index ? 'tab-select' : 'tab-item'"
@click="changeTab(index)"
v-for="(item, index) in tabList"
:key="index"
>
{{ item }} {{ item }}
</view> </view>
</view> </view>
...@@ -15,8 +19,12 @@ ...@@ -15,8 +19,12 @@
<!-- 优惠券状态 --> <!-- 优惠券状态 -->
<view class="status"> <view class="status">
<view :class="currenStatus == index ? 'status-select' : 'status-item'" @click="changeStatus(index)" <view
v-for="(item, index) in statusList" :key="index"> :class="currenStatus == index ? 'status-select' : 'status-item'"
@click="changeStatus(index)"
v-for="(item, index) in statusList"
:key="index"
>
{{ item }} {{ item }}
</view> </view>
</view> </view>
...@@ -39,7 +47,11 @@ ...@@ -39,7 +47,11 @@
</view> </view>
<view class="ticket-right"> <view class="ticket-right">
<image class="img" :src="iconUrl[item.status]" v-if="item.status == 0 || item.status == 2"></image> <image
class="img"
:src="iconUrl[item.status]"
v-if="item.status == 0 || item.status == 2"
></image>
<view class="head"> <view class="head">
<text class="title">{{ item.couponName }}</text> <text class="title">{{ item.couponName }}</text>
<view class="headbox"> <view class="headbox">
...@@ -55,8 +67,11 @@ ...@@ -55,8 +67,11 @@
<view class="line"></view> <view class="line"></view>
<view class="footbox" @click="handleChangeDetail(index)"> <view class="footbox" @click="handleChangeDetail(index)">
<text class="desc">详细信息</text> <text class="desc">详细信息</text>
<wd-icon :name="item.showDetail ? 'chevron-down' : 'chevron-right'" size="15px" <wd-icon
color="#9d9d9d"></wd-icon> :name="item.showDetail ? 'chevron-down' : 'chevron-right'"
size="15px"
color="#9d9d9d"
></wd-icon>
</view> </view>
</view> </view>
</view> </view>
...@@ -168,7 +183,7 @@ const getCouponList = async () => { ...@@ -168,7 +183,7 @@ const getCouponList = async () => {
}); });
couponData.value.push(...res.data.records); couponData.value.push(...res.data.records);
total.value = res.data.total; total.value = res.data.total;
} }
state.value = 'finished'; state.value = 'finished';
}; };
getCouponList(); getCouponList();
......
...@@ -26,6 +26,7 @@ export const request = ({ url, data = {}, header, method = 'GET' }) => { ...@@ -26,6 +26,7 @@ export const request = ({ url, data = {}, header, method = 'GET' }) => {
duration: 1000, duration: 1000,
icon: 'none', icon: 'none',
}); });
return;
} }
resolve(res.data); resolve(res.data);
}, },
......
...@@ -6013,7 +6013,7 @@ vary@~1.1.2: ...@@ -6013,7 +6013,7 @@ vary@~1.1.2:
vconsole@^3.15.1: vconsole@^3.15.1:
version "3.15.1" version "3.15.1"
resolved "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz#569a8ab15f353259527bbcf004f02946b4482cff" resolved "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz"
integrity sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g== integrity sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==
dependencies: dependencies:
"@babel/runtime" "^7.17.2" "@babel/runtime" "^7.17.2"
......
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