mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-18 16:35:53 +08:00
·修改部分页面数据冗余
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<view class="cell-view"> {{ complainTopic }} </view>
|
||||
<u-icon style="margin-left: 20rpx" name="arrow-down"></u-icon>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="cell-item complain-content">
|
||||
<view class="cell-title title"> 投诉内容 </view>
|
||||
<view class="cell-view content">
|
||||
@@ -47,7 +47,8 @@
|
||||
<view class="cell-item">
|
||||
<view class="cell-title"> 投诉凭证 </view>
|
||||
<view class="cell-view">
|
||||
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" upload-text="" :show-progress="false" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5"></u-upload>
|
||||
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" upload-text="" :show-progress="false" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5">
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -65,8 +66,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
storage,
|
||||
action: upload,
|
||||
action: upload, //上传图片地址
|
||||
orderStatusList: {
|
||||
//订单状态列表
|
||||
UNDELIVERED: "待发货",
|
||||
UNPAID: "未付款",
|
||||
PAID: "已付款",
|
||||
@@ -77,45 +79,44 @@ export default {
|
||||
},
|
||||
complainValue: "", //投诉内容
|
||||
complainShow: false, //投诉主题开关
|
||||
complainTopic: "",
|
||||
// 投诉列表
|
||||
complainList: [],
|
||||
images: [],
|
||||
order: "",
|
||||
orderGoodsList: "",
|
||||
orderDetail: "",
|
||||
complainTopic: "", //投诉抱怨话题
|
||||
complainList: [], // 投诉列表
|
||||
images: [], //投诉内容图片
|
||||
order: "", //订单
|
||||
orderGoodsList: "", //订单商品
|
||||
orderDetail: "", //订单详情
|
||||
sn: "",
|
||||
skuId: "",
|
||||
skuId: "", //商品skuid
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
console.log(option);
|
||||
this.loadData(option.sn);
|
||||
this.sn = option.sn;
|
||||
this.skuId = option.skuId;
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getReasion();
|
||||
},
|
||||
methods: {
|
||||
onUploaded(lists) {
|
||||
console.log(lists);
|
||||
let images = [];
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 上传完成
|
||||
*/
|
||||
onUploaded(lists) {
|
||||
let images = [];
|
||||
lists.forEach((item) => {
|
||||
images.push(item.response.result);
|
||||
});
|
||||
|
||||
this.images = images;
|
||||
console.log(this.images);
|
||||
},
|
||||
// 提交
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
handleSumit() {
|
||||
// 循环出商品
|
||||
let goods = this.orderGoodsList.filter((item) => {
|
||||
return item.skuId == this.skuId;
|
||||
});
|
||||
|
||||
//数据赋值
|
||||
let data = {
|
||||
complainTopic: this.complainTopic, //投诉主题,
|
||||
content: this.complainValue, //投诉内容
|
||||
@@ -124,7 +125,6 @@ export default {
|
||||
orderSn: this.sn, //订单号
|
||||
skuId: this.skuId, //skuid
|
||||
};
|
||||
|
||||
addComplain(data).then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.showToast({
|
||||
@@ -142,6 +142,9 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取投诉原因
|
||||
*/
|
||||
getReasion() {
|
||||
getComplainReason().then((res) => {
|
||||
if (res.data.result.length >= 1) {
|
||||
@@ -153,10 +156,13 @@ export default {
|
||||
this.complainList.push(way);
|
||||
});
|
||||
this.complainTopic = res.data.result[0].reason;
|
||||
console.log(this.complainTopic);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载订单详情
|
||||
*/
|
||||
loadData(sn) {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
@@ -166,12 +172,14 @@ export default {
|
||||
this.order = order.order;
|
||||
this.orderGoodsList = order.orderItems;
|
||||
this.orderDetail = res.data.result;
|
||||
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认投诉
|
||||
*/
|
||||
confirmComplain(e) {
|
||||
console.log(e);
|
||||
this.complainTopic = e[0].label;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2,76 +2,28 @@
|
||||
<view class="wrapper">
|
||||
<view class="tips">我的投诉信息</view>
|
||||
<u-cell-group>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="detail.goodsName"
|
||||
title="投诉商品"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="statusData[detail.complainStatus]"
|
||||
title="投诉状态"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="detail.createTime"
|
||||
title="投诉时间"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="detail.complainTopic"
|
||||
title="投诉主题"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="detail.content"
|
||||
title="投诉内容"
|
||||
></u-cell-item>
|
||||
<view class="row" v-if="detail.orderComplaintImages">
|
||||
<u-image
|
||||
width="100rpx"
|
||||
height="100rpx"
|
||||
border-radius="10"
|
||||
style="margin: 0 10rpx"
|
||||
v-for="(item, index) in detail.orderComplaintImages"
|
||||
:key="index"
|
||||
:src="item"
|
||||
@click="preview(detail.orderComplaintImages, index)"
|
||||
/>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.goodsName" title="投诉商品"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="statusData[complainDetail.complainStatus]" title="投诉状态"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.createTime" title="投诉时间"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.complainTopic" title="投诉主题"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.content" title="投诉内容"></u-cell-item>
|
||||
<view class="row" v-if="complainDetail.orderComplaintImages">
|
||||
<u-image width="100rpx" height="100rpx" border-radius="10" style="margin: 0 10rpx" v-for="(item, index) in complainDetail.orderComplaintImages" :key="index" :src="item"
|
||||
@click="preview(complainDetail.orderComplaintImages, index)" />
|
||||
</view>
|
||||
</u-cell-group>
|
||||
<view class="tips">商家申诉信息</view>
|
||||
<u-cell-group>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="detail.appealTime || '暂无'"
|
||||
title="申诉时间"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="detail.appealContent || '暂无'"
|
||||
title="申诉内容"
|
||||
></u-cell-item>
|
||||
<view class="row" v-if="detail.appealImagesList">
|
||||
<u-image
|
||||
width="100rpx"
|
||||
height="100rpx"
|
||||
border-radius="10"
|
||||
style="margin: 0 10rpx"
|
||||
v-for="(item, index) in detail.appealImagesList"
|
||||
@click="preview(detail.appealImagesList, index)"
|
||||
:key="index"
|
||||
:src="item"
|
||||
/>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.appealTime || '暂无'" title="申诉时间"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.appealContent || '暂无'" title="申诉内容"></u-cell-item>
|
||||
<view class="row" v-if="complainDetail.appealImagesList">
|
||||
<u-image width="100rpx" height="100rpx" border-radius="10" style="margin: 0 10rpx" v-for="(item, index) in complainDetail.appealImagesList"
|
||||
@click="preview(complainDetail.appealImagesList, index)" :key="index" :src="item" />
|
||||
</view>
|
||||
</u-cell-group>
|
||||
<view class="tips">对话详情</view>
|
||||
<view class="speak-way" v-if="detail.orderComplaintCommunications">
|
||||
<view
|
||||
class="speak-msg seller"
|
||||
:key="i"
|
||||
v-for="(complaint, i) in detail.orderComplaintCommunications"
|
||||
>
|
||||
<view class="speak-way" v-if="complainDetail.orderComplaintCommunications">
|
||||
<view class="speak-msg seller" :key="i" v-for="(complaint, i) in complainDetail.orderComplaintCommunications">
|
||||
{{
|
||||
complaint.owner == "PLATFORM"
|
||||
? "平台"
|
||||
@@ -85,11 +37,7 @@
|
||||
<view class="speak-way" v-else>暂无对话</view>
|
||||
<view class="tips">平台仲裁</view>
|
||||
<u-cell-group>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
title="仲裁意见"
|
||||
:value="detail.arbitrationResult || '暂无'"
|
||||
></u-cell-item>
|
||||
<u-cell-item :arrow="false" title="仲裁意见" :value="complainDetail.arbitrationResult || '暂无'"></u-cell-item>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
@@ -99,8 +47,7 @@ import { getComplainDetail } from "@/api/after-sale";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
detail: "",
|
||||
|
||||
complainDetail: "", //投诉详情
|
||||
statusData: {
|
||||
NO_APPLY: "未申请",
|
||||
APPLYING: "申请中",
|
||||
@@ -110,10 +57,14 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
this.init(option.id);
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 点击图片放大或保存
|
||||
*/
|
||||
preview(urls, index) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
@@ -125,24 +76,29 @@ export default {
|
||||
},
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 初始化投诉详情
|
||||
*/
|
||||
init(id) {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
getComplainDetail(id).then((res) => {
|
||||
if (res.data.success) {
|
||||
this.detail = res.data.result;
|
||||
|
||||
this.complainDetail = res.data.result;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.row {
|
||||
display: flex;
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<view
|
||||
class="seller-view"
|
||||
v-for="(item, index) in complaionData"
|
||||
:key="index"
|
||||
>
|
||||
<view class="seller-view" v-for="(item, index) in complaionData" :key="index">
|
||||
<view class="seller-info u-flex u-row-between">
|
||||
<view class="seller-name">
|
||||
<view class="name">{{ item.storeName }}</view>
|
||||
@@ -14,12 +10,7 @@
|
||||
<u-line color="#DCDFE6"></u-line>
|
||||
<view class="goods-item-view">
|
||||
<view class="goods-img" @click="handleToGoods(item)">
|
||||
<u-image
|
||||
border-radius="6"
|
||||
width="131rpx"
|
||||
height="131rpx"
|
||||
:src="item.goodsImage"
|
||||
></u-image>
|
||||
<u-image border-radius="6" width="131rpx" height="131rpx" :src="item.goodsImage"></u-image>
|
||||
</view>
|
||||
<view class="goods-info" @click="handleToGoods(item)">
|
||||
<view class="goods-title u-line-2">{{ item.goodsName }}</view>
|
||||
@@ -37,34 +28,16 @@
|
||||
<view class="complain-speak"> {{ item.complainTopic }} </view>
|
||||
</view>
|
||||
<view class="complain-btn">
|
||||
<u-tag
|
||||
mode="plain"
|
||||
@click="handleClear(item)"
|
||||
class="complain-tag"
|
||||
text="撤销投诉"
|
||||
type="info"
|
||||
v-if="
|
||||
<u-tag mode="plain" @click="handleClear(item)" class="complain-tag" text="撤销投诉" type="info" v-if="
|
||||
item.complainStatus != 'EXPIRED' && item.complainStatus != 'CANCEL'
|
||||
"
|
||||
/>
|
||||
<u-tag
|
||||
mode="plain"
|
||||
@click="handleInfo(item)"
|
||||
class="complain-tag"
|
||||
text="投诉详情"
|
||||
type="info"
|
||||
/>
|
||||
" />
|
||||
<u-tag mode="plain" @click="handleInfo(item)" class="complain-tag" text="投诉详情" type="info" />
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="empty" style="margin-top: 40rpx">
|
||||
<u-empty text="暂无投诉列表" mode="list"></u-empty>
|
||||
</view>
|
||||
<u-modal
|
||||
show-cancel-button
|
||||
@confirm="handleClearConfirm"
|
||||
v-model="show"
|
||||
:content="content"
|
||||
></u-modal>
|
||||
|
||||
<u-empty v-if="empty" :style="{'marginTop':complaionDetail.total == 0 ? '200rpx':'0rpx'}" class="empty" style="" text="暂无投诉列表" mode="list"></u-empty>
|
||||
|
||||
<u-modal show-cancel-button @confirm="handleClearConfirm" v-model="show" :content="content"></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -87,38 +60,49 @@ export default {
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
// memberId: "",
|
||||
// memberName: "",
|
||||
},
|
||||
complaionData: [],
|
||||
complaionDetail: "", //返回的整个response
|
||||
complaionData: [], //投诉列表
|
||||
empty: false,
|
||||
rows: "",
|
||||
checkComplainData: "", //存储投诉信息
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
/**
|
||||
* 触底加载
|
||||
*/
|
||||
onReachBottom() {
|
||||
this.params.pageNumber++;
|
||||
this.init();
|
||||
if (
|
||||
this.complaionDetail &&
|
||||
this.complaionDetail.total < this.params.pageNumber * this.params.pageSize
|
||||
) {
|
||||
this.params.pageNumber++;
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 点击跳转到商品
|
||||
handleToGoods(val) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/goods?id=" + val.skuId+"&goodsId="+val.goodsId,
|
||||
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
|
||||
});
|
||||
},
|
||||
|
||||
// 撤销投诉
|
||||
/**
|
||||
* 点击撤销投诉
|
||||
*/
|
||||
handleClear(val) {
|
||||
console.log(val);
|
||||
this.show = true;
|
||||
this.rows = val;
|
||||
this.checkComplainData = val;
|
||||
},
|
||||
/**
|
||||
* 执行撤销
|
||||
*/
|
||||
handleClearConfirm() {
|
||||
clearComplain(this.rows.id).then((res) => {
|
||||
clearComplain(this.checkComplainData.id).then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.showToast({
|
||||
title: "撤销成功",
|
||||
@@ -131,19 +115,25 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
*/
|
||||
handleInfo(val) {
|
||||
uni.navigateTo({
|
||||
url: "./complainInfo?id=" + val.id,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 初始化投诉列表
|
||||
*/
|
||||
init() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
|
||||
getComplain(this.params).then((res) => {
|
||||
console.log(res);
|
||||
this.complaionDetail = res.data.result;
|
||||
if (res.data.result.records.length >= 1) {
|
||||
this.complaionData.push(...res.data.result.records);
|
||||
} else {
|
||||
@@ -185,4 +175,7 @@ export default {
|
||||
.complain-tag {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.empty {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user