Commit e9e29550 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents ed65be72 855d089f
......@@ -4,6 +4,9 @@ import { sgyOrderGetStatus } from './api/order';
import testJson from './static/json/test.json';
import { getToken } from './utils/auth';
import { setOrderDic } from './utils/orderDic';
// beforeMount(() => {
// if (!getToken()) signIn();
// });
onLaunch(() => {
if (!getToken()) signIn();
sgyOrderGetStatus().then((res) => {
......@@ -22,13 +25,19 @@ onHide(() => {
});
// 登录
const signIn = () => {
getTokenUser(testJson).then((res) => {
xma.xh.getUserProfile({
range: ['ACCOUNT', 'MOBILE', 'CITIZEN'],
async success(info) {
const info2 = JSON.stringify(info);
getTokenUser(info2).then((res) => {
const token = res.data.access_token;
const userInfo = res.data.user_info;
xma.setStorageSync('Authorization', token);
xma.setStorageSync('userInfo', userInfo);
console.log('登录...');
});
},
});
};
</script>
<style>
......
......@@ -79,7 +79,14 @@ export function applyForARefundApi(data) {
data,
});
}
// 新增订单评价
export function evaluation(data) {
return request({
url: '/sgyrdd/evaluation/eval',
method: 'post',
data,
});
}
export function afterSale(data) {
return request({
url: '/sgyrdd/sgyOrder/afterSales/getInfo',
......
......@@ -9,7 +9,8 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "小程序平台"
"navigationBarTitleText": "小程序平台",
"navigationStyle":"custom"
}
},
{
......
......@@ -322,6 +322,12 @@ const reset = () => {
cardData2.value = [];
show.value = false;
};
const toUse = () => {
xma.navigateTo({
url: '/pages/index/listFood?type=1',
});
};
// 商家列表分页-搜索列表
const getMerchantList = () => {
xma.showLoading({
......
......@@ -3,7 +3,7 @@
<Header title="售后详情"></Header>
<view class="content">
<view class="box box1">
<view class="box box1" v-if="afterSaleDetail">
<view class="money">
<view class="money_l">退款金额</view>
<view class="money_r">{{ afterSaleDetail.refundPrice }}</view>
......@@ -20,11 +20,11 @@
</view>
</view>
</view>
<view class="box">
<view class="box" v-if="orderItems">
<view class="goods">
<view class="g1">退款信息</view>
<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_info">
<view class="g2_name">{{ item.prodName }}</view>
......@@ -68,8 +68,8 @@ const getAterSaleDetail = async (id) => {
orderItems.value = res.data[0].orderItems;
};
onLoad((options) => {
// orderNumber.value = options.orderNumber;
getAterSaleDetail('NEONO-2024080113095213631');
orderNumber.value = options.orderNumber;
getAterSaleDetail(orderNumber.value);
});
</script>
......
......@@ -63,7 +63,13 @@
评价
</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
class="btn-error"
v-if="
......@@ -117,12 +123,15 @@ import { getOrderDic } from '@/utils/orderDic';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const stateList = ref();
onLoad(() => {
onLoad((options) => {
const orderDic = getOrderDic();
stateList.value = orderDic.reduce((obj, item) => {
obj[item.baseStatus] = item;
return obj;
}, {});
if (options.status) {
tab.value = options.status;
}
getList();
});
......@@ -152,7 +161,7 @@ const tabs = ref([
value: 'after_sales',
},
]);
const tab = ref('0');
const tab = ref('all');
onShow(() => {
if (pendingPaymentOrder.value) {
......@@ -230,6 +239,9 @@ const getList = async () => {
state.value = 'finished';
};
/**
* 切换状态栏
*/
const handleChange = (e) => {
tab.value = e.name;
initDataList();
......@@ -382,7 +394,7 @@ const handleQrcode = (item) => {
};
/**
* 售后详情
* 订单评价
*/
const handleRemark = (item) => {
xma.navigateTo({
......@@ -390,6 +402,12 @@ const handleRemark = (item) => {
});
};
const handleAfterSales = (item) => {
xma.navigateTo({
url: `/pages/order/afterSales?orderNumber=${item.orderNumber}`,
});
};
/**
* 申请退款
*/
......
......@@ -47,13 +47,14 @@
<view class="content-between" @tap="showPop = true">
<text>退款原因</text>
<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>
</view>
</view>
</view>
<view class="btn">提交</view>
<view class="btn" @tap="submit">提交</view>
</view>
</view>
<wd-popup
......@@ -88,7 +89,7 @@
placeholder-style="font-size:28rpx;color: #c0c4cc;"
></textarea>
</radio-group>
<view class="btn">确认</view>
<view class="btn" @tap="chooseReason">确认</view>
</view>
</wd-popup>
</template>
......@@ -121,7 +122,7 @@ function handleChange({ fileList: files }) {
}
const showPop = ref(false);
const selectType = ref(0);
const selectType = ref(null);
const reasonList = ref([
{
id: '0',
......@@ -149,6 +150,59 @@ function radioChange(evt) {
const { value } = evt.detail;
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>
<style lang="scss" scoped>
......
......@@ -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>
......@@ -2,8 +2,12 @@
<view class="container">
<Header title="我的券"></Header>
<view class="tab">
<view :class="currentTab == index ? 'tab-select' : 'tab-item'" @click="changeTab(index)"
v-for="(item, index) in tabList" :key="index">
<view
:class="currentTab == index ? 'tab-select' : 'tab-item'"
@click="changeTab(index)"
v-for="(item, index) in tabList"
:key="index"
>
{{ item }}
</view>
</view>
......@@ -15,8 +19,12 @@
<!-- 优惠券状态 -->
<view class="status">
<view :class="currenStatus == index ? 'status-select' : 'status-item'" @click="changeStatus(index)"
v-for="(item, index) in statusList" :key="index">
<view
:class="currenStatus == index ? 'status-select' : 'status-item'"
@click="changeStatus(index)"
v-for="(item, index) in statusList"
:key="index"
>
{{ item }}
</view>
</view>
......@@ -39,7 +47,11 @@
</view>
<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">
<text class="title">{{ item.couponName }}</text>
<view class="headbox">
......@@ -55,8 +67,11 @@
<view class="line"></view>
<view class="footbox" @click="handleChangeDetail(index)">
<text class="desc">详细信息</text>
<wd-icon :name="item.showDetail ? 'chevron-down' : 'chevron-right'" size="15px"
color="#9d9d9d"></wd-icon>
<wd-icon
:name="item.showDetail ? 'chevron-down' : 'chevron-right'"
size="15px"
color="#9d9d9d"
></wd-icon>
</view>
</view>
</view>
......
......@@ -26,6 +26,7 @@ export const request = ({ url, data = {}, header, method = 'GET' }) => {
duration: 1000,
icon: 'none',
});
return;
}
resolve(res.data);
},
......
......@@ -6013,7 +6013,7 @@ vary@~1.1.2:
vconsole@^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==
dependencies:
"@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