This commit is contained in:
2025-10-27 15:55:29 +08:00
commit 6632080b83
513 changed files with 117442 additions and 0 deletions

View File

@@ -0,0 +1,152 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view class="activist-container">
<mescroll-uni ref="mescroll" @getData="getListData">
<block slot="list">
<view class="container">
<block v-if="refundList.length">
<view class="order-item" v-for="(item, index) in refundList" :key="index">
<view class="order-header">
<text class="status-num font-size-base">{{ item.order_no }}</text>
<view class="status-name" v-if="item.refund_status == 3">退款成功</view>
<view class="status-name color-base-text" v-if="item.refund_status == 1">退款中</view>
<view class="status-name color-base-text" v-if="item.refund_status == -1">退款失败</view>
</view>
<view class="goods-wrap">
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="imageError(index)" mode="aspectFill" :lazy-load="true"></image>
<view class="goods-info">
<view class="goods-name" @click="refundDetail(item.order_goods_id)">{{ item.sku_name }}</view>
<view class="goods-num">
<view class="num-text color-base-text">{{ item.refund_status_name }}</view>
<view class="num-price">
<text>{{ item.price }}</text>
<text class="num">×{{ item.num }}</text>
</view>
</view>
</view>
</view>
<view class="goods-btn">
<view class="btn-text">
<text>{{ item.num }}件商品</text>
<text>退款{{ item.refund_status == 3 ? item.refund_real_money : item.refund_apply_money }}</text>
</view>
<view class="order-action">
<view class="order-box-btn" @click="refundDetail(item.order_goods_id)">查看详情</view>
<block v-if="item.refund_action.length">
<view
class="order-box-btn"
@click="refundAction(actionItem.event, item)"
v-for="(actionItem, actionIndex) in item.refund_action"
:key="actionIndex"
>
{{ actionItem.title }}
</view>
</block>
</view>
</view>
</view>
</block>
<block v-else>
<view class="cart-empty" v-if="showEmpty"><ns-empty :isIndex="false" :text="$lang('emptyTips')"></ns-empty></view>
</block>
</view>
</block>
</mescroll-uni>
</view>
</template>
<script>
import refundMethod from './public/js/refundMethod.js';
export default {
data() {
return {
refundList: [],
showEmpty: false
};
},
mixins: [refundMethod],
onShow() {
if (!this.storeToken) {
this.$util.redirectTo('/pages/order/login', {
back: '/pages_tool/order/activist'
});
}
},
methods: {
getListData(mescroll) {
this.$api.sendRequest({
url: '/api/orderrefund/lists',
data: {
page: mescroll.num,
page_size: mescroll.size
},
success: res => {
this.showEmpty = true;
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) this.refundList = []; //如果是第一页需手动制空列表
this.refundList = this.refundList.concat(newArr);
},
fail: res => {
mescroll.endErr();
}
});
},
refundDetail(order_goods_id) {
this.$util.redirectTo('/pages_tool/order/refund_detail', {
order_goods_id
});
},
refundAction(event, data) {
switch (event) {
case 'orderRefundCancel': // 撤销维权
this.cancleRefund(data.order_goods_id, res => {
if (res.code >= 0) {
this.$util.showToast({
title: '撤销成功'
});
this.$refs.mescroll.refresh();
}
});
break;
case 'orderRefundDelivery': // 退款发货
this.$util.redirectTo('/pages_tool/order/refund_detail', {
order_goods_id: data.order_goods_id,
action: 'returngoods'
});
break;
case 'orderRefundAsk':
this.$util.redirectTo('/pages_tool/order/refund', {
order_goods_id: data.order_goods_id
});
break;
}
},
imageError(index) {
this.refundList[index].sku_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .fixed {
position: relative;
top: 0;
}
.cart-empty {
padding-top: 308rpx !important;
}
@import './public/css/activist.scss';
</style>

View File

@@ -0,0 +1,23 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
export default {
data() {
return {};
},
onLoad(option) {
if (option.order_id) {
this.$util.redirectTo('/pages/order/detail', {order_id: option.order_id}, 'redirectTo');
}
}
};
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,87 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<view>
<view class="page">
<block v-for="(item, index) in goodsList" :key="index">
<view class="eval-wrap">
<view class="eval-good">
<view class="good-box">
<image class="good_pic" :src="$util.img(item.sku_image, { size: 'mid' })" @error="imageError(index)" mode="widthFix" />
<view class="good_info font-size-base">{{ item.sku_name }}</view>
</view>
</view>
<view class="eval-star" v-if="!isEvaluate">
<view class="star-box">
<view class="star-title color-base-bg-before">描述相符</view>
<view class="rate-box"><sx-rate :value="goodsEvalList[index].scores" :index="index" @change="setStar" /></view>
<view class="grade-li">
<view class="icon iconfont" :class="
goodsEvalList[index].explain_type == '1'
? 'icon-haoping1 color-base-text'
: goodsEvalList[index].explain_type == '2'
? 'icon-zhongchaping color-base-text'
: goodsEvalList[index].explain_type == '3'
? 'icon-zhongchaping'
: ''
"></view>
<view class="font-size-tag color-base-text" v-if="goodsEvalList[index].explain_type == '1'">好评</view>
<view class="font-size-tag color-base-text" v-if="goodsEvalList[index].explain_type == '2'">中评</view>
<view class="font-size-tag color-base-text" v-if="goodsEvalList[index].explain_type == '3'">差评</view>
</view>
</view>
</view>
</view>
<view class="eval-text">
<view class="text-box">
<block v-if="!isEvaluate">
<textarea placeholder="请在此处输入您的评价" v-model="goodsEvalList[index].content" maxlength="200" />
<text class="maxSize">{{ goodsEvalList[index].content.length }}/200</text>
</block>
<block v-else>
<textarea placeholder="请在此处输入您的追评" v-model="goodsEvalList[index].again_content" maxlength="200" />
<text class="maxSize">{{ goodsEvalList[index].again_content.length }}/200</text>
</block>
<view class="other-info">
<view class="other-info-box" v-for="(i, t) in imgList[index]" :key="t">
<image :src="$util.img(i)" mode="aspectFill" @click="preview(i, index)"></image>
<view class="imgDel" @click="deleteImg(i, index ,t)"><text class=" icon iconfont icon-delete"></text></view>
</view>
<view class="other-info-box active" @click="addImg(index)" v-if="imgList[index].length < 6 || imgList[index].length == undefined">
<text class="icon iconfont icon-zhaoxiangji"></text>
<text>{{ imgList[index].length ? 6 - imgList[index].length : 0 }}/6</text>
</view>
</view>
</view>
</view>
</block>
</view>
<view class="eval-bottom" :class="{ 'safe-area': isIphoneX }">
<view class="all-election" @click="isAll()" v-if="!isEvaluate">
<view class="iconfont color-base-text" :class="isAnonymous ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
<text>匿名</text>
</view>
<view class="action-btn"><button type="primary" @click="save()">提交</button></view>
</view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</view>
</template>
<script>
import sxRate from '@/pages_tool/components/sx-rate/index.vue';
import evaluate from './public/js/evaluate.js';
export default {
components: {
sxRate
},
mixins: [evaluate],
};
</script>
<style lang="scss">
@import './public/css/evaluate.scss'
</style>

View File

@@ -0,0 +1,171 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<scroll-view class="order-nav" :scroll-x="true" :show-scrollbar="false">
<view v-for="(packageItem, packageIndex) in packageList" :key="packageIndex" class="uni-tab-item" @click="ontabtap(packageIndex)">
<text class="uni-tab-item-title" :class="packageIndex == currIndex ? 'uni-tab-item-title-active color-base-border color-base-text' : ''">
{{ packageItem.package_name }}
</text>
</view>
</scroll-view>
<view v-for="(packageItem, packageIndex) in packageList" :key="packageIndex" class="swiper-item" v-show="packageIndex == currIndex">
<view class="container">
<view class="goods-wrap">
<view class="body">
<view class="goods" v-for="(goodsItem, goodsIndex) in packageItem.goods_list" :key="goodsIndex">
<view class="goods-img" @click="toGoodsDetail(goodsItem.sku_id)">
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(packageIndex, goodsIndex)" mode="aspectFill"></image>
</view>
<view class="goods-info">
<view @click="toGoodsDetail(goodsItem.sku_id)" class="goods-name">{{ goodsItem.sku_name }}</view>
<view class="goods-sub-section">
<view>
<text>
<text class="iconfont icon-close"></text>
{{ goodsItem.num }}
</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="express-company-wrap" v-if="packageItem.delivery_type == 1">
<view class="company-logo"><image :src="$util.img(packageItem.express_company_image)"></image></view>
<view class="info">
<view class="company">
<text>承运公司 {{ packageItem.express_company_name }}</text>
</view>
<view class="no">
<text>
运单号
<text class="color-tip">{{ packageItem.delivery_no }}</text>
</text>
<text class="iconfont icon-fuzhi" @click="copyDeliveryNo(packageItem.delivery_no)"></text>
</view>
</view>
</view>
<view class="track-wrap" v-if="packageItem.delivery_type == 1">
<block v-if="packageItem.trace.success && packageItem.trace.list.length != 0">
<view
class="track-item"
v-for="(traceItem, traceIndex) in packageItem.trace.list"
:class="traceIndex == 0 ? 'active' : ''"
:key="traceIndex"
>
<view class="dot" :class="traceIndex == 0 ? 'color-base-bg' : ''"></view>
<view class="msg">
<view class="text" :class="traceIndex == 0 ? 'color-base-text' : ''">{{ traceItem.remark }}</view>
<view class="time" :class="traceIndex == 0 ? 'color-base-text' : ''">{{ traceItem.datetime }}</view>
</view>
</view>
</block>
<block v-else-if="packageItem.trace.success && packageItem.trace.list.length == 0">
<view class="fail-wrap font-size-base">{{ packageItem.trace.reason }}</view>
</block>
<block v-else>
<view class="fail-wrap font-size-base">{{ packageItem.trace.reason }}</view>
</block>
</view>
</view>
</view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
export default {
data() {
return {
orderId: '',
packageList: [],
isIphoneX: false,
currIndex: 0,
status: 0
};
},
onLoad(option) {
if (option.order_id) this.orderId = option.order_id;
},
onShow() {
// 判断登录
if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login');
} else {
this.getPackageInfo();
}
this.isIphoneX = this.$util.uniappIsIPhoneX();
},
methods: {
ontabtap(e) {
this.currIndex = e;
// let index = e.target.dataset.current || e.currentTarget.dataset.current;
// this.orderStatus = this.statusList[index].status;
// if (this.orderStatus == '') this.mergePayOrder = [];
// this.$refs.loadingCover.show();
// this.$refs.mescroll.refresh();
},
getPackageInfo() {
this.$api.sendRequest({
url: '/api/order/package',
data: {
order_id: this.orderId
},
success: res => {
if (res.code >= 0) {
this.packageList = res.data;
this.packageList.forEach(item => {
if (item.trace.list) {
item.trace.list = item.trace.list.reverse();
}
item.status = this.status++;
});
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
} else {
this.$util.showToast({
title: '未获取到订单信息!'
});
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
}, 1500);
}
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
toGoodsDetail(e) {
this.$util.redirectTo('/pages/goods/detail', { sku_id: e });
},
imageError(packageIndex, goodsIndex) {
this.packageList[packageIndex].goods_list[goodsIndex].sku_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
copyDeliveryNo(value){
this.$util.copy(value);
}
}
};
</script>
<style lang="scss">
@import './public/css/logistics.scss';
/deep/.uni-scroll-view ::-webkit-scrollbar {
/* 隐藏滚动条,但依旧具备可以滚动的功能 */
display: none;
width: 0;
height: 0;
color: transparent;
background: transparent;
}
/deep/::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
background: transparent;
}
</style>

View File

@@ -0,0 +1,110 @@
.activist-container {
width: 100vw;
height: 100vh;
}
.order-item {
margin: $margin-updown $margin-both;
padding: 26rpx 24rpx;
border-radius: 10rpx;
background: #fff;
display: flex;
flex-direction: column;
.order-header {
display: flex;
align-items: center;
padding-bottom: 26rpx;
border-bottom: 2rpx solid #f1f1f1;
.status-num {
font-size: $font-size-goods-tag;
color: $color-title;
}
.status-name {
flex: 1;
text-align: right;
font-size: $font-size-tag;
}
}
.goods-wrap {
display: flex;
padding: 27rpx 0;
box-sizing: border-box;
border-bottom: 2rpx solid #f7f7f7;
image {
width: 170rpx;
height: 170rpx;
display: flex;
align-items: center;
justify-content: center;
}
.goods-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: 15rpx;
.goods-name {
line-height: 38rpx;
font-size: $font-size-base;
color: $color-title;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.goods-num {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-top: 21rpx;
.num-text {
font-size: $font-size-tag;
line-height: 1;
}
.num-price {
display: flex;
flex-direction: column;
align-items: flex-end;
line-height: 1;
font-size: $font-size-tag;
.num {
color: $color-tip;
margin-top: 16rpx;
display: flex;
align-items: center;
}
}
}
}
}
.goods-btn {
display: flex;
flex-direction: column;
align-items: flex-end;
margin-top: 27rpx;
.btn-text {
font-size: $font-size-tag;
text {
&:nth-child(2) {
margin-left: 17rpx;
text {
font-size: $font-size-base;
}
}
}
}
.order-action {
display: flex;
margin-top: 24rpx;
.order-box-btn {
font-size: $font-size-goods-tag;
}
}
}
}

View File

@@ -0,0 +1,230 @@
.page {
padding-bottom: 100rpx;
}
.eval-good {
width: 100%;
padding: 0 30rpx;
box-sizing: border-box;
background: #ffffff;
.good-box {
width: 100%;
height: 100%;
padding: 30rpx 0;
border-bottom: 2rpx solid #f5f5f5;
box-sizing: border-box;
display: flex;
justify-content: space-between;
.good_pic {
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
box-sizing: border-box;
}
.good_info {
width: calc(100% - 200rpx);
height: 100%;
line-height: 1.3;
box-sizing: border-box;
}
}
}
.eval-text {
width: 100%;
padding: 0 $margin-both;
box-sizing: border-box;
padding-bottom: $padding;
margin-top: $margin-updown;
.text-box {
width: 100%;
height: 100%;
border-radius: $border-radius;
background: #ffffff;
padding-bottom: $padding;
box-sizing: border-box;
position: relative;
textarea {
width: 100%;
height: 190rpx;
padding: $padding;
box-sizing: border-box;
font-size: $font-size-tag;
}
}
.maxSize {
position: absolute;
right: 20rpx;
top: 160rpx;
color: #999;
font-size: $font-size-tag;
}
.other-info {
width: 100%;
padding: 0 $padding;
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
margin-top: $margin-updown;
}
.other-info-box {
width: 145rpx;
height: 145rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 30rpx;
margin-bottom: 30rpx;
position: relative;
image {
width: 100%;
border-radius: $border-radius;
}
.iconfont {
font-size: 60rpx;
color: #898989;
line-height: 1;
}
text {
line-height: 1;
}
.imgDel {
width: 40rpx;
height: 40rpx;
position: absolute;
right: -20rpx;
top: -20rpx;
display: flex;
justify-content: center;
align-items: center;
.iconfont {
font-size: $font-size-toolbar;
}
}
}
.other-info-box.active {
border: 1rpx dashed #898989;
}
.other-info-box.active:active {
background: rgba($color: #cccccc, $alpha: 0.6);
}
// .other-info-box:nth-child(4n) {
// margin-right: 0;
// }
}
.eval-star {
width: 100%;
background: #ffffff;
padding: 10rpx 30rpx;
box-sizing: border-box;
.star-box {
width: 100%;
height: 100%;
display: flex;
align-items: center;
.star-title {
height: 60rpx;
position: relative;
padding-right: $padding;
box-sizing: border-box;
line-height: 60rpx;
font-size: $font-size-base;
font-weight: bold;
}
.grade-li {
width: 30%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.icon-haoping1 {
font-size: $font-size-base;
margin-right: 10rpx;
}
.icon-haoping {
font-size: $font-size-base;
color: #999;
margin-right: 10rpx;
}
.icon-zhongchaping {
font-size: $font-size-base;
margin-right: 10rpx;
color: #ccc;
}
}
}
.eval-bottom {
position: fixed;
z-index: 5;
width: 100vw;
height: 100rpx;
background: #fff;
bottom: var(--window-bottom);
overflow: hidden;
display: flex;
justify-content: space-between;
&.safe-area {
padding-bottom: 68rpx !important;
}
.all-election {
height: 100rpx;
position: relative;
padding-left: 20rpx;
display: inline-block;
width: 30%;
& > .iconfont {
font-size: 45rpx;
position: absolute;
top: 50%;
left: 24rpx;
transform: translateY(-50%);
}
& > text {
margin-left: 56rpx;
line-height: 100rpx;
}
}
.action-btn {
flex: 1;
height: 100rpx;
line-height: 100rpx;
border-radius: 0;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
button {
width: 100%;
height: 80rpx;
line-height: 80rpx;
}
}
.action-btn.disabled:after {
content: '';
border: none;
}
}

View File

@@ -0,0 +1,242 @@
@mixin flex-row-center {
display: flex;
justify-content: center;
align-items: center;
}
@mixin wrap {
padding: 30rpx;
border-radius: $border-radius;
background: #fff;
position: relative;
width: calc(100% - 60rpx);
box-sizing: border-box;
}
.swiper-item {
padding-top: 94rpx;
height: 100%;
.container {
height: calc(100vh - 124rpx);
overflow-y: scroll;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 30rpx;
&.safearea {
padding: 68rpx;
}
}
padding-bottom: 30rpx;
padding-bottom: constant(safe-area-inset-bottom); /*兼容 IOS<11.2*/
padding-bottom: env(safe-area-inset-bottom); /*兼容 IOS>11.2*/
}
.order-nav {
width: 100vw;
// height: 60rpx;
flex-direction: row;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
background: #fff;
display: flex;
position: fixed;
left: 0;
z-index: 998;
.uni-tab-item {
display: inline-block;
padding: 30rpx 24rpx 0;
// height: 60rpx;
// line-height: 60rpx;
}
.uni-tab-item-title {
color: #555;
font-size: $font-size-toolbar;
display: block;
line-height: 1;
padding: 0 10rpx 30rpx;
flex-wrap: nowrap;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
text-align: center;
}
.uni-tab-item-title-active {
display: block;
border-bottom: 2rpx solid #ffffff;
padding: 0 10rpx 30rpx;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
}
.goods-wrap {
@include wrap;
margin-top: 20rpx;
padding: 30rpx;
.goods {
display: flex;
position: relative;
margin-bottom: 20rpx;
&:last-of-type {
margin-bottom: 0;
}
.goods-img {
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
}
}
.goods-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
max-width: calc(100% - 140rpx);
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
line-height: 1.5;
font-size: $font-size-base;
font-weight: 500;
}
.goods-sub-section {
width: 100%;
line-height: 1.3;
display: flex;
.goods-price {
font-weight: 700;
font-size: $font-size-activity-tag;
}
.unit {
font-weight: normal;
font-size: $font-size-tag;
margin-right: 2rpx;
}
view {
flex: 1;
line-height: 1.3;
&:last-of-type {
text-align: left;
.iconfont {
line-height: 1;
font-size: $font-size-tag;
}
}
}
}
}
}
}
.express-company-wrap {
@include wrap;
margin-top: 20rpx;
.company-logo {
width: 120rpx;
height: 120rpx;
margin-right: 20rpx;
float: left;
image {
width: 100%;
height: 100%;
}
}
.info {
flex: 1;
.company {
line-height: 1.5;
margin-top: 16rpx;
}
.no {
margin-top: 10rpx;
line-height: 1.5;
}
.icon-fuzhi {
font-size: $font-size-base;
line-height: 1;
margin-left: 6rpx;
}
}
}
.track-wrap {
@include wrap;
margin-top: 20rpx;
.track-item {
position: relative;
flex-wrap: wrap;
overflow: visible;
display: flex;
&:after {
content: '';
position: absolute;
z-index: 1;
pointer-events: none;
background-color: #e5e5e5;
width: 2rpx;
height: 150%;
top: 56rpx;
left: 20rpx;
bottom: -40rpx;
}
.dot {
margin: 34rpx 20rpx 0 10rpx;
width: 20rpx;
height: 20rpx;
border-radius: 10rpx;
background-color: #ccc;
z-index: 9;
}
.msg {
padding: 20rpx 0;
flex: 1;
.text {
line-height: 1.5;
font-size: $font-size-base;
}
.time {
color: $color-tip;
font-size: $font-size-activity-tag;
line-height: 1.3;
margin-top: 10rpx;
}
}
&:last-of-type:after {
content: unset;
}
}
}

View File

@@ -0,0 +1,246 @@
.refund-container {
width: 100vw;
height: 100vh;
}
.align-right {
text-align: right;
}
.goods-wrap {
margin: $margin-updown $margin-both;
padding: 30rpx;
border-radius: $border-radius;
background: #fff;
display: flex;
position: relative;
.goods-img {
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
border-radius: $border-radius;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.goods-info {
flex: 1;
position: relative;
max-width: calc(100% - 200rpx);
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
line-height: 1.5;
font-size: $font-size-base;
}
}
}
.refund-option {
margin: $margin-updown $margin-both;
border-radius: $border-radius;
background: #fff;
.option-item {
padding: $padding;
display: flex;
position: relative;
view {
flex: 1;
text {
display: block;
}
}
.icon-right {
position: absolute;
top: 50%;
transform: translateY(-50%);
color: #ddd;
right: 20rpx;
}
&:last-of-type {
border-top: 2rpx solid #f2f2f2;
}
}
}
.refund-form {
margin: $margin-updown $margin-both;
padding: $padding;
border-radius: $border-radius;
background: #fff;
.item-wrap {
display: flex;
position: relative;
line-height: 80rpx;
.label {
width: 142rpx;
padding-right: 5rpx;
line-height: 80rpx;
}
.cont {
flex: 1;
line-height: 80rpx;
text-align: right;
.refund-desc {
font-size: $font-size-base;
width: 100%;
line-height: 1;
min-height: 80rpx;
}
&.reason {
padding-right: 40rpx;
}
}
.label.active{
width: 100%;
}
.icon-right {
position: absolute;
top: 50%;
transform: translateY(-50%);
color: #ddd;
right: 0;
}
}
}
.textarea-box{
position: relative;
.mark{
width: 100%;
height: 100%;
position: absolute;
left: 0;
bottom: 0;
background: red;
}
}
.newText{
width: 100%;
min-height: 200rpx;
border-radius: $border-radius;
box-sizing: border-box;
margin-top: 10rpx;
}
.sub-btn {
position: fixed;
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
color: #fff;
bottom: 0;
&.safe-area {
margin-bottom: 48rpx !important;
}
}
.popup {
width: 100vw;
background: #fff;
border-top-left-radius: 24rpx;
border-top-right-radius: 24rpx;
.popup-header {
height: 90rpx;
display: flex;
align-items: center;
padding: 0 30rpx;
& > view {
flex: 1;
line-height: 1;
}
.tit {
font-size: $font-size-toolbar;
font-weight: 600;
}
.vice-tit {
margin-right: 20rpx;
}
}
.popup-footer {
height: 140rpx;
.confirm-btn {
height: 80rpx;
line-height: 80rpx;
color: #fff;
text-align: center;
margin: 20rpx;
border-radius: $border-radius;
&.color-base-bg{
color: var(--btn-text-color);
}
}
&.bottom-safe-area {
padding-bottom: 48rpx;
}
}
}
.refund-reason-popup {
height: 50vh;
display: flex;
flex-direction: column;
.icon-close {
font-size: 40rpx;
}
.popup-body {
flex: 1;
.scroll-view {
height: 100%;
}
.item {
display: flex;
padding: 0 30rpx;
position: relative;
height: 70rpx;
line-height: 70rpx;
.reason {
flex: 1;
height: 70rpx;
line-height: 70rpx;
}
& > .iconfont {
font-size: 40rpx;
position: absolute;
top: 50%;
right: 30rpx;
transform: translateY(-50%);
}
& > .icon-yuan_checkbox {
color: $color-tip;
}
}
}
}

View File

@@ -0,0 +1,327 @@
.detail-container {
width: 100vw;
height: 100vh;
}
.container {
transition: all 0.3s;
.hide {
transform: translateX(-100%);
}
}
.status-wrap {
padding: 20rpx;
background: #fff;
border-top: 1px solid #f5f5f5;
margin: 20rpx;
border-radius: $border-radius;
.status-name {
display: block;
font-size: $font-size-toolbar;
line-height: 70rpx;
height: 70rpx;
}
.refund-explain {
border-top: 1px dashed #eee;
padding-top: 20rpx;
}
}
.refund-address-wrap {
margin: 20rpx;
background: #fff;
padding: 20rpx;
border-radius: $border-radius;
.copy {
font-size: $font-size-activity-tag;
display: inline-block;
color: #666;
background: #fff;
line-height: 1;
padding: 6rpx 10rpx;
margin-left: 10rpx;
border-radius: 4rpx;
border: 1px solid #ddd;
}
}
.history-wrap {
margin: 20rpx;
background: #fff;
padding: 20rpx;
display: flex;
position: relative;
border-radius: $border-radius;
view {
flex: 1;
}
.icon-right {
position: absolute;
top: 50%;
transform: translateY(-50%);
color: #ddd;
right: 20rpx;
}
}
.refund-info {
margin: 20rpx;
background: #fff;
border-radius: $border-radius;
.header {
height: 90rpx;
line-height: 90rpx;
padding: 0 20rpx;
}
.body {
padding-bottom: 20rpx;
.goods-wrap {
display: flex;
position: relative;
padding: 20rpx;
background: #f5f5f5;
&:last-of-type {
margin-bottom: 0;
}
.goods-img {
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
}
}
.goods-info {
flex: 1;
position: relative;
max-width: calc(100% - 200rpx);
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
line-height: 1.5;
font-size: $font-size-base;
}
.goods-sub-section {
padding-top: 20rpx;
width: 100%;
line-height: 1.3;
display: flex;
.refund-price {
font-size: $font-size-base;
}
.unit {
font-weight: normal;
font-size: $font-size-tag;
margin-right: 2rpx;
}
}
}
}
.info {
margin-top: 20rpx;
.cell {
height: 50rpx;
line-height: 50rpx;
padding: 0 30rpx;
font-size: $font-size-tag;
color: $color-tip;
}
}
}
}
.action {
position: fixed;
z-index: 5;
left: 0;
bottom: 0;
width: 100vw;
height: 100rpx;
background: #fff;
box-shadow: 0 0px 10px rgba(0, 0, 0, 0.1);
text-align: right;
line-height: 100rpx;
&.bottom-safe-area {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.order-box-btn{
margin-right: $margin-both;
margin-left: 0;
}
.action-btn {
height: 70rpx;
line-height: 70rpx;
color: #fff;
padding: 0 40rpx;
display: inline-block;
text-align: center;
margin: 16rpx 20rpx 16rpx 0;
border-radius: $border-radius;
&.white {
height: 68rpx;
line-height: 68rpx;
color: #333;
border: 0.5px solid #999;
background: #fff;
}
}
}
.form-wrap {
background: #fff;
.item {
margin: 0 20rpx;
display: flex;
border-bottom: 1px solid #eee;
&:last-child {
border-bottom: none;
}
.label {
width: 140rpx;
line-height: 90rpx;
}
.cont {
flex: 1;
line-height: 90rpx;
.input,
.input-placeholder {
height: 90rpx;
line-height: 90rpx;
font-size: $font-size-base;
}
.textarea {
width: 100%;
padding: 26rpx 0;
line-height: 1.3;
font-size: $font-size-base;
}
}
}
}
.sub-btn {
margin-top: 20rpx;
}
.record-wrap {
.cont {
width: 100%;
background-color: #fff;
padding: 30rpx;
box-sizing: border-box;
margin-top: 20rpx;
.head {
display: flex;
flex-direction: column;
color: $color-title;
.time {
color: $color-tip;
font-size: $font-size-tag;
float: right;
}
}
.body {
padding-top: 20rpx;
.refund-action{
line-height: 1;
color: $color-title;
}
.desc {
margin-top: 10rpx;
color: $color-tip;
font-size: $font-size-tag;
}
}
}
.empty-box{
height: 168rpx;
}
}
.history-bottom {
position: fixed;
z-index: 5;
left: 0;
bottom: 0;
width: 100vw;
height: 100rpx;
background: #fff;
box-shadow: 0 0px 10px rgba(0, 0, 0, 0.1);
text-align: right;
display: flex;
&.bottom-safe-area {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
view {
flex: 1;
text-align: center;
line-height: 100rpx;
&:first-child {
border-right: 1px solid #eee;
}
.iconfont {
font-weight: bold;
margin-right: 10rpx;
font-size: $font-size-base;
line-height: 1;
}
}
button {
width: 50%;
height: 100%;
// position: absolute;
border: none;
z-index: 1;
padding: 0;
margin: 0;
background: none;
display: flex;
justify-content: center;
align-items: center;
&::after {
border: none !important;
}
.iconfont{
margin-right: 10rpx;
}
}
}

View File

@@ -0,0 +1,233 @@
export default {
data() {
return {
orderId: null,
orderNo: "",
isAnonymous: 1, //是否匿名发布 1.匿名0.公开
goodsList: [], //订单列表
goodsEvalList: [], //评价列表
imgList: [],
isEvaluate: 0, //判断是否为追评
flag: false, //防止重复点击 ,
evaluateConfig: {
evaluate_audit: 1,
evaluate_show: 0,
evaluate_status: 1
},
isIphoneX: false //判断手机是否是iphoneX以上
};
},
onLoad(options) {
//接收订单号,订单是否是追评等信息
options.order_id ? (this.orderId = options.order_id) : this.$util.redirectTo('/pages/order/list');
this.isIphoneX = this.$util.uniappIsIPhoneX();
if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login', {
back: '/pages_tool/order/evaluate?order_id=' + this.orderId
}, 'redirectTo');
}
this.getEvaluateConfig();
this.getOrderInfo();
},
onShow() {
//初始化重复点击
this.flag = false;
},
methods: {
//获取订单信息
getOrderInfo() {
//获取订单信息
let data = {
order_id: this.orderId
};
this.$api.sendRequest({
url: '/api/order/evluateinfo',
data: data,
success: res => {
if (res.code == 0) {
this.isEvaluate = res.data.evaluate_status
this.goodsList = res.data.list;
if (this.goodsList.length) {
this.orderNo = res.data.list[0].order_no;
}
if (this.isEvaluate) {
for (let i = 0; i < res.data.list.length; i++) {
let array = [];
this.imgList.push(array)
this.goodsEvalList.push({
order_goods_id: res.data.list[i].order_goods_id,
goods_id: res.data.list[i].goods_id,
sku_id: res.data.list[i].sku_id,
again_content: "",
again_images: ""
});
}
} else {
for (let i = 0; i < res.data.list.length; i++) {
let array = [];
this.imgList.push(array)
this.goodsEvalList.push({
content: '', // 评价内容
images: "", //图片数组
scores: 5, // 评分
explain_type: 1, // 评价类型
order_goods_id: res.data.list[i].order_goods_id,
goods_id: res.data.list[i].goods_id,
sku_id: res.data.list[i].sku_id,
sku_name: res.data.list[i].sku_name,
sku_price: res.data.list[i].price,
sku_image: res.data.list[i].sku_image
});
}
}
} else {
this.$util.showToast({
title: "未获取到订单数据"
})
setTimeout(() => {
this.$util.redirectTo('/pages/order/list', {}, "redirectTo");
}, 1000)
}
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
//监听评分变化
setStar(e) {
this.goodsEvalList[e.index].scores = e.value;
if (e.value >= 4) {
this.goodsEvalList[e.index].explain_type = 1;
} else if (1 < e.value && e.value < 4) {
this.goodsEvalList[e.index].explain_type = 2
} else {
this.goodsEvalList[e.index].explain_type = 3
}
},
//切换,是否匿名
isAll() {
this.isAnonymous ? this.isAnonymous = 0 : this.isAnonymous = 1
},
//添加图片
addImg(e) {
let size = this.imgList[e].length ? this.imgList[e].length : 0
this.$util.upload(6 - size, {
path: 'evaluateimg'
}, res => {
let arr = this.imgList[e]
arr = arr.concat(res);
this.imgList[e] = [];
this.$set(this.imgList, e, arr)
if (this.isEvaluate) {
this.goodsEvalList[e].again_images = this.imgList[e].toString()
} else {
this.goodsEvalList[e].images = this.imgList[e].toString()
}
});
},
//删除图片
deleteImg(i, index, j) {
this.imgList[index].splice(j, 1);
if (this.isEvaluate) {
this.goodsEvalList[index].again_images = this.imgList[index].toString()
} else {
this.goodsEvalList[index].images = this.imgList[index].toString()
}
},
// 图片预览
preview(i, j) {
let urls = this.imgList[j];
for (let k = 0; k < urls.length; k++) {
urls[k] = this.$util.img(urls[k])
}
uni.previewImage({
urls: urls,
current: i
});
},
//提交评价
save() {
if (this.evaluateConfig.evaluate_status == 0) {
this.$util.showToast({
title: "商家未开启商品评价功能"
});
return;
}
for (let i = 0; i < this.goodsEvalList.length; i++) {
if (this.isEvaluate) {
if (!this.goodsEvalList[i].again_content.trim().length) {
this.$util.showToast({
title: "商品的评价不能为空哦"
});
return;
}
} else {
if (!this.goodsEvalList[i].content.trim().length) {
this.$util.showToast({
title: "商品的评价不能为空哦"
});
return;
}
}
}
let goodsEvaluate = JSON.stringify(this.goodsEvalList)
let data = {
order_id: this.orderId,
goods_evaluate: goodsEvaluate,
};
if (!this.isEvaluate) {
data.order_no = this.orderNo;
data.member_name = this.memberInfo.nickname;
data.member_headimg = this.memberInfo.headimg;
data.is_anonymous = this.isAnonymous;
}
if (this.flag) return;
this.flag = true;
this.$api.sendRequest({
url: this.isEvaluate ? '/api/goodsevaluate/again' : '/api/goodsevaluate/add',
data: data,
success: res => {
if (res.code == 0) {
this.$util.showToast({
title: "评价成功"
});
setTimeout(() => {
this.$util.redirectTo('/pages/order/list', {}, "redirectTo");
}, 1000);
} else {
this.$util.showToast({
title: res.message
});
this.flag = false;
}
},
fail: res => {
this.flag = false;
}
});
},
imageError(index) {
this.goodsList[index].sku_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
getEvaluateConfig() {
this.$api.sendRequest({
url: '/api/goodsevaluate/config',
success: res => {
if (res.code == 0) {
var data = res.data;
this.evaluateConfig = data;
}
}
});
}
}
};

View File

@@ -0,0 +1,30 @@
export default {
methods: {
/**
* 撤销退款申请
* @param {Object} order_goods_id
* @param {Object} callback
*/
cancleRefund(order_goods_id, callback) {
uni.showModal({
content: '撤销之后本次申请将会关闭,如后续仍有问题可再次发起申请。',
cancelText: '暂不撤销',
cancelColor: '#898989',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/api/orderrefund/cancel',
data: {
order_goods_id
},
success: res => {
typeof callback == 'function' && callback(res);
}
})
}
}
})
},
}
}

306
pages_tool/order/refund.vue Normal file
View File

@@ -0,0 +1,306 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<view>
<scroll-view scroll-y="true" class="refund-container">
<view class="goods-wrap">
<view class="goods-img">
<image :src="$util.img(refund_data.order_goods_info.sku_image, { size: 'mid' })" @error="refund_data.order_goods_info.sku_image = $util.getDefaultImage().goods" mode="aspectFill" :lazy-load="true"/>
</view>
<view class="goods-info">
<view class="goods-name">{{ refund_data.order_goods_info.sku_name }}</view>
</view>
</view>
<view class="refund-option" v-show="!refund_type">
<view class="option-item" @click="selectRefundType(1)">
<view>
<text>退款无需退货</text>
<text class="font-size-goods-tag color-tip">没收到货或与卖家协商同意无需退货只退款</text>
</view>
<text class="iconfont icon-right"></text>
</view>
<view class="option-item" @click="selectRefundType(2)" v-if="refund_data.refund_type.length == 2">
<view>
<text>退货退款</text>
<text class="font-size-goods-tag color-tip">已收到货需退还收到的货物</text>
</view>
<text class="iconfont icon-right"></text>
</view>
</view>
<view v-show="refund_type">
<view class="refund-form">
<view class="item-wrap" @click="openPopup('refundReasonPopup')">
<view class="label">退款原因</view>
<view class="cont reason">
<text class="color-tip" v-if="!refund_reason.length">请选择</text>
<text class="color-tip" v-else>{{ refund_reason }}</text>
</view>
<text class="iconfont icon-right"></text>
</view>
<view class="item-wrap">
<view class="label">退款金额</view>
<view class="cont color-base-text">{{ $lang('common.currencySymbol') }}{{ refund_data.refund_money }}</view>
</view>
</view>
<view class="refund-form">
<view class="item-wrap"><view class="label active">退款说明</view></view>
<!-- #ifdef MP-WEIXIN -->
<textarea
v-if="!showText"
class="newText"
placeholder="请输入退款说明(选填)"
placeholder-class="color-tip font-size-tag"
:auto-height="true"
v-model="refund_remark"
/>
<!-- #endif -->
<!-- #ifdef H5 -->
<textarea
class="newText"
placeholder="请输入退款说明(选填)"
@blur="textBlur()"
placeholder-class="color-tip font-size-tag"
:auto-height="true"
v-model="refund_remark"
/>
<!-- #endif -->
</view>
<!-- <view class="sub-btn color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
<view class="sub-btn" :class="{ 'safe-area': isIphoneX }" @click="submit">
<button type="primary">{{ $lang('common.submit') }}</button>
</view>
</view>
<uni-popup ref="refundReasonPopup" type="bottom" @change="change()">
<view class="refund-reason-popup popup">
<view class="popup-header">
<view><text class="tit">退款原因</text></view>
<view class="align-right" @click="closePopup('refundReasonPopup')"><text class="iconfont icon-close"></text></view>
</view>
<view class="popup-body">
<scroll-view scroll-y="true" class="scroll-view" :class="{ 'safe-area': isIphoneX }">
<view class="reason-list">
<view class="item" v-for="(item, index) in refund_data.refund_reason_type" :key="index" @click="changeReason(item)">
<view class="reason">{{ item }}</view>
<view class="iconfont" :class="refund_reason == item ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
</view>
</view>
</scroll-view>
</view>
<view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
<view class="confirm-btn color-base-bg" @click="closePopup('refundReasonPopup')">确定</view>
</view>
</view>
</uni-popup>
</scroll-view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</view>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue';
export default {
components: {
uniPopup
},
data() {
return {
order_goods_id: '',
refund_type: '',
refund_reason: '',
refund_remark: '',
isIphoneX: false,
refund_data: {
refund_type: [],
order_goods_info: {
sku_image: ''
}
},
isSub: false,
showText: false //是否展示退款说明解决原生小程序textarea层级过高 popup不能遮挡的问题
};
},
onLoad(option) {
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
},
onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
if (this.storeToken) {
this.getRefundData();
} else {
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
}
},
methods: {
/**
* 显示弹出层
* @param {Object} ref
*/
openPopup(ref) {
this.$refs[ref].open();
},
/**
* 关闭弹出层
* @param {Object} ref
*/
closePopup(ref) {
this.$refs[ref].close();
},
textBlur() {
uni.pageScrollTo({
scrollTop: 0,
duration: 0
});
},
/**
* 选择退款方式
* @param {Object} type
*/
selectRefundType(type) {
this.refund_type = type;
},
getRefundData() {
this.$api.sendRequest({
url: '/api/orderrefund/refundData',
data: {
order_goods_id: this.order_goods_id
},
success: res => {
if (res.code >= 0) {
this.refund_data = res.data;
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
} else {
this.$util.showToast({ title: '未获取到该订单项退款信息' });
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
}, 1000);
}
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
submit() {
if (this.verify()) {
if (this.isSub) return;
this.isSub = true;
// #ifdef MP
this.subscribeMessage(() => {
this.$api.sendRequest({
url: '/api/orderrefund/refund',
data: {
order_goods_ids: this.order_goods_id,
refund_type: this.refund_type,
refund_reason: this.refund_reason,
refund_remark: this.refund_remark
},
success: res => {
this.$util.showToast({ title: res.message });
if (res.code >= 0) {
this.$util.redirectTo('/pages_tool/order/activist', {}, 'redirectTo');
} else {
this.isSub = false;
}
},
fail: res => {
this.isSub = false;
}
});
})
// #endif
// #ifndef MP-WEIXIN
this.$api.sendRequest({
url: '/api/orderrefund/refund',
data: {
order_goods_ids: this.order_goods_id,
refund_type: this.refund_type,
refund_reason: this.refund_reason,
refund_remark: this.refund_remark
},
success: res => {
this.$util.showToast({ title: res.message });
if (res.code >= 0) {
this.$util.redirectTo('/pages_tool/order/activist', {}, 'redirectTo');
} else {
this.isSub = false;
}
},
fail: res => {
this.isSub = false;
}
});
// #endif
}
},
verify() {
if (this.refund_reason == '') {
this.$util.showToast({ title: '请选择退款原因' });
return false;
}
return true;
},
changeReason(refund_reason) {
this.refund_reason = refund_reason;
},
change(e) {
if (e) this.showText = e.show;
},
/**
* 微信订阅消息
*/
subscribeMessage(callback){
this.$api.sendRequest({
url: '/weapp/api/weapp/messagetmplids',
data: {
keywords: 'ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE'
},
success: res => {
if (res.code == 0 && res.data.length) {
uni.requestSubscribeMessage({
tmplIds: res.data,
fail: (res) => {
console.log('fail', res)
},
complete: ()=> {
callback();
}
})
} else {
callback();
}
},
fail: res => {
callback();
}
})
}
}
};
</script>
<style lang="scss">
@import './public/css/refund.scss';
</style>
<style scoped>
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup {
z-index: 8;
}
</style>

View File

@@ -0,0 +1,312 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<view>
<scroll-view scroll-y="true" class="refund-container">
<view class="goods-wrap" v-for="(item,index) in refund_data.order_goods_info" :key="index">
<view class="goods-img">
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="item.sku_image = $util.getDefaultImage().goods" mode="aspectFill" :lazy-load="true"/>
</view>
<view class="goods-info">
<view class="goods-name">{{ item.sku_name }}</view>
</view>
</view>
<view>
<view class="refund-form">
<view class="item-wrap" @click="openPopup('refundReasonPopup')">
<view class="label">退款原因</view>
<view class="cont reason">
<text class="color-tip" v-if="!refund_reason.length">请选择</text>
<text class="color-tip" v-else>{{ refund_reason }}</text>
</view>
<text class="iconfont icon-right"></text>
</view>
<view class="item-wrap">
<view class="label">退款方式</view>
<view class="cont color-base-text" v-if="refund_type == 1">退款无需退货</view>
<view class="cont color-base-text" v-else>退货退款</view>
</view>
<view class="item-wrap">
<view class="label">退款金额</view>
<view class="cont color-base-text">{{ $lang('common.currencySymbol') }}{{ refund_data.refund_money }}</view>
</view>
</view>
<view class="refund-form">
<view class="item-wrap"><view class="label active">退款说明</view></view>
<!-- #ifdef MP-WEIXIN -->
<textarea
v-if="!showText"
class="newText"
placeholder="请输入退款说明(选填)"
placeholder-class="color-tip font-size-tag"
:auto-height="true"
v-model="refund_remark"
/>
<!-- #endif -->
<!-- #ifdef H5 -->
<textarea
class="newText"
placeholder="请输入退款说明(选填)"
@blur="textBlur()"
placeholder-class="color-tip font-size-tag"
:auto-height="true"
v-model="refund_remark"
/>
<!-- #endif -->
</view>
<!-- <view class="sub-btn color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
<view class="sub-btn" :class="{ 'safe-area': isIphoneX }" @click="submit">
<!-- <button type="primary">提交</button> -->
<button type="primary">{{ $lang('common.submit') }}</button>
</view>
</view>
<uni-popup ref="refundReasonPopup" type="bottom" @change="change()">
<view class="refund-reason-popup popup">
<view class="popup-header">
<view><text class="tit">退款原因</text></view>
<view class="align-right" @click="closePopup('refundReasonPopup')"><text class="iconfont icon-close"></text></view>
</view>
<view class="popup-body">
<scroll-view scroll-y="true" class="scroll-view" :class="{ 'safe-area': isIphoneX }">
<view class="reason-list">
<view class="item" v-for="(item, index) in refund_data.refund_reason_type" :key="index" @click="changeReason(item)">
<view class="reason">{{ item }}</view>
<view class="iconfont" :class="refund_reason == item ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
</view>
</view>
</scroll-view>
</view>
<view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
<view class="confirm-btn color-base-bg" @click="closePopup('refundReasonPopup')">确定</view>
</view>
</view>
</uni-popup>
</scroll-view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</view>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue';
export default {
components: {
uniPopup
},
data() {
return {
order_goods_id: '',
refund_type: '',
refund_reason: '',
refund_remark: '',
isIphoneX: false,
refund_data: {
refund_type: [],
order_goods_info: {
sku_image: ''
}
},
isSub: false,
showText: false //是否展示退款说明解决原生小程序textarea层级过高 popup不能遮挡的问题
};
},
onLoad(option) {
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
if (option.refund_type) this.refund_type = option.refund_type;
},
onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
if (this.storeToken) {
this.getRefundData();
} else {
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
}
},
methods: {
/**
* 显示弹出层
* @param {Object} ref
*/
openPopup(ref) {
this.$refs[ref].open();
},
/**
* 关闭弹出层
* @param {Object} ref
*/
closePopup(ref) {
this.$refs[ref].close();
},
textBlur() {
uni.pageScrollTo({
scrollTop: 0,
duration: 0
});
},
/**
* 选择退款方式
* @param {Object} type
*/
selectRefundType(type) {
this.refund_type = type;
},
getRefundData() {
this.$api.sendRequest({
url: '/api/orderrefund/refundDataBatch',
data: {
order_goods_ids: this.order_goods_id
},
success: res => {
if (res.code >= 0) {
this.refund_data = res.data;
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
} else {
this.$util.showToast({ title: '未获取到该订单项退款信息' });
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
}, 1000);
}
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
submit() {
if (this.verify()) {
if (this.isSub) return;
this.isSub = true;
// #ifdef MP
this.subscribeMessage(() => {
this.$api.sendRequest({
url: '/api/orderrefund/refund',
data: {
order_goods_ids: this.order_goods_id,
refund_type: this.refund_type,
refund_reason: this.refund_reason,
refund_remark: this.refund_remark
},
success: res => {
this.$util.showToast({ title: res.message });
if (res.code >= 0) {
uni.removeStorage({
key:'refund_goods_data',
success:res=>{
this.$util.redirectTo('/pages_tool/order/activist');
}
})
} else {
this.isSub = false;
}
},
fail: res => {
this.isSub = false;
}
});
})
// #endif
// #ifndef MP-WEIXIN
this.$api.sendRequest({
url: '/api/orderrefund/refund',
data: {
order_goods_ids: this.order_goods_id,
refund_type: this.refund_type,
refund_reason: this.refund_reason,
refund_remark: this.refund_remark
},
success: res => {
this.$util.showToast({ title: res.message });
if (res.code >= 0) {
uni.removeStorage({
key:'refund_goods_data',
success:res=>{
this.$util.redirectTo('/pages_tool/order/activist');
}
})
} else {
this.isSub = false;
}
},
fail: res => {
this.isSub = false;
}
});
// #endif
}
},
verify() {
if (this.refund_reason == '') {
this.$util.showToast({ title: '请选择退款原因' });
return false;
}
return true;
},
changeReason(refund_reason) {
this.refund_reason = refund_reason;
},
change(e) {
if (e) this.showText = e.show;
},
/**
* 微信订阅消息
*/
subscribeMessage(callback){
this.$api.sendRequest({
url: '/weapp/api/weapp/messagetmplids',
data: {
keywords: 'ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE'
},
success: res => {
if (res.code == 0 && res.data.length) {
uni.requestSubscribeMessage({
tmplIds: res.data,
fail: (res) => {
console.log('fail', res)
},
complete: ()=> {
callback();
}
})
} else {
callback();
}
},
fail: res => {
callback();
}
})
}
}
};
</script>
<style lang="scss">
@import './public/css/refund.scss';
</style>
<style scoped>
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup {
z-index: 8;
}
.sub-btn{
padding-top: 20rpx;
background-color: #FFFFFF;
}
</style>

View File

@@ -0,0 +1,277 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<scroll-view scroll-y="true" class="detail-container" :class="{ 'safe-area': isIphoneX }" v-if="detail">
<view v-show="action == ''">
<view class="status-wrap">
<view class="status-name">{{ detail.refund_status_name }}</view>
<view class="refund-explain" v-if="detail.refund_status == 1">
<view class="font-size-goods-tag color-tip">如果商家拒绝你可重新发起申请</view>
<view class="font-size-goods-tag color-tip">如果商家同意将通过申请并退款给你</view>
<!-- <view class="font-size-goods-tag color-tip">如果商家逾期未处理平台将自动通过申请并退款给你</view> -->
</view>
<view class="refund-explain" v-if="detail.refund_status == 5">
<view class="font-size-goods-tag color-tip">如果商家确认收货将会退款给你</view>
<view class="font-size-goods-tag color-tip">如果商家拒绝收货该次退款将会关闭你可以重新发起退款</view>
</view>
</view>
<view class="history-wrap" @click="switchAction('consultrecord')">
<view>协商记录</view>
<text class="iconfont icon-right"></text>
</view>
<view class="refund-address-wrap" v-if="detail.refund_status == 4">
<view class="header">退货地址</view>
<view>
<text>收货人{{ detail.shop_contacts }}</text>
</view>
<view>
<text>联系方式{{ detail.shop_mobile }}</text>
</view>
<view>
<text class="address">退货地址{{ detail.shop_address }}</text>
<view class="copy" @click="$util.copy(detail.shop_address)">复制</view>
</view>
</view>
<view class="refund-info">
<view class="header">退款信息</view>
<view class="body">
<!-- 商品信息 -->
<view class="goods-wrap">
<view class="goods-img" @click="refundDetail(detail)">
<image :src="$util.img(detail.sku_image, { size: 'mid' })" @error="imageError()" mode="aspectFill" :lazy-load="true"></image>
</view>
<view class="goods-info">
<view class="goods-name" @click="refundDetail(detail)">{{ detail.sku_name }}</view>
</view>
</view>
<!-- 退款信息 -->
<view class="info">
<view class="cell">退款方式{{ detail.refund_type == 1 ? '仅退款' : '退款退货' }}</view>
<view class="cell" v-if="detail.refund_status == 3">退款途径{{ detail.refund_money_type == 1 ? '原路退款' : detail.refund_money_type == 2 ? '线下退款' : '退款到余额' }}</view>
<view class="cell">退款原因{{ detail.refund_reason }}</view>
<view class="cell" v-if="detail.refund_status == 3 && detail.refund_real_money>0">退款金额{{ $lang('common.currencySymbol') }}{{ detail.refund_real_money }}</view>
<view class="cell" v-else-if="detail.refund_apply_money>0">退款金额{{ $lang('common.currencySymbol') }}{{ detail.refund_apply_money }}</view>
<view class="cell">退款编号{{ detail.refund_no }}</view>
<view class="cell">申请时间{{ $util.timeStampTurnTime(detail.refund_action_time) }}</view>
<view class="cell" v-if="detail.refund_time">退款时间{{ $util.timeStampTurnTime(detail.refund_time) }}</view>
<view class="cell" v-if="detail.refund_remark != ''">退款说明{{ detail.refund_remark }}</view>
<view class="cell" v-if="detail.use_point>0">退款积分{{ detail.use_point }}</view>
</view>
</view>
</view>
<view class="action" :class="{ 'bottom-safe-area': isIphoneX }" v-if="detail.refund_action.length">
<view class="order-box-btn" v-for="(actionItem, actionIndex) in detail.refund_action" :key="actionIndex" @click="refundAction(actionItem.event)">
{{ actionItem.title }}
</view>
</view>
</view>
<view v-show="action == 'returngoods'">
<view class="return-goods-container">
<view class="form-wrap">
<view class="item">
<view class="label">物流公司</view>
<view class="cont">
<input
type="text"
placeholder="请输入物流公司"
class="input"
placeholder-class="input-placeholder color-tip"
v-model="formData.refund_delivery_name"
/>
</view>
</view>
<view class="item">
<view class="label">物流单号</view>
<view class="cont">
<input
type="text"
placeholder="请输入物流单号"
class="input"
placeholder-class="input-placeholder color-tip"
v-model="formData.refund_delivery_no"
/>
</view>
</view>
<view class="item">
<view class="label">物流说明</view>
<view class="cont">
<textarea
placeholder-class="color-tip font-size-tag"
:auto-height="true"
class="textarea"
placeholder="选填"
v-model="formData.refund_delivery_remark"
/>
</view>
</view>
</view>
<button type="primary" class="sub-btn" @click="refurnGoods">提交</button>
</view>
</view>
<view v-show="action == 'consultrecord'">
<view class="record-wrap">
<view class="record-item" :class="logItem.action_way == 1 ? 'buyer' : ''" v-for="(logItem, logIndex) in detail.refund_log_list" :key="logIndex">
<view class="cont">
<view class="head">
<text>{{ logItem.action_way == 1 ? '买家' : '卖家' }}</text>
<text class="time">{{ $util.timeStampTurnTime(logItem.action_time) }}</text>
</view>
<view class="body">
<view class="refund-action">{{ logItem.action }}</view>
<view class="desc" v-if="logItem.desc != ''">{{ logItem.desc }}</view>
</view>
</view>
</view>
<view class="empty-box"></view>
</view>
<view class="history-bottom" :class="{ 'bottom-safe-area': isIphoneX }">
<!-- <ns-contact :niushop="{order_id: detail.order_id}">
<view>
<text class="iconfont icon-ziyuan"></text>
<text>联系客服</text>
</view>
</ns-contact> -->
<view @click="switchAction('')">返回详情</view>
</view>
</view>
</scroll-view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import refundMethod from './public/js/refundMethod.js';
import validate from 'common/js/validate.js';
import nsContact from '@/components/ns-contact/ns-contact.vue';
export default {
data() {
return {
order_goods_id: '',
detail: {
refund_action: []
},
isIphoneX: false,
action: '',
formData: {
refund_delivery_name: '',
refund_delivery_no: '',
refund_delivery_remark: ''
},
isSub: false
};
},
components: {
nsContact
},
mixins: [refundMethod],
onLoad(option) {
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
if (option.action) this.action = option.action;
this.isIphoneX = this.$util.uniappIsIPhoneX();
},
onShow() {
if (this.storeToken) {
this.getRefundDetail();
} else {
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund_detail?order_goods_id=' + this.order_goods_id });
}
},
methods: {
getRefundDetail() {
this.$api.sendRequest({
url: '/api/orderrefund/detail',
data: {
order_goods_id: this.order_goods_id
},
success: res => {
if (res.code >= 0) {
this.detail = res.data;
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
} else {
this.$util.showToast({ title: '未获取到该订单项退款信息' });
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
}, 1000);
}
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
refundAction(event) {
switch (event) {
case 'orderRefundCancel':
this.cancleRefund(this.detail.order_goods_id, res => {
if (res.code >= 0) {
this.$util.showToast({ title: '撤销成功' });
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
}, 1000);
}
});
break;
case 'orderRefundDelivery':
this.action = 'returngoods';
break;
case 'orderRefundAsk':
this.$util.redirectTo('/pages_tool/order/refund', { order_goods_id: this.detail.order_goods_id });
break;
}
},
refurnGoods() {
var rule = [
{ name: 'refund_delivery_name', checkType: 'required', errorMsg: '请输入物流公司' },
{ name: 'refund_delivery_no', checkType: 'required', errorMsg: '请输入物流单号' }
];
this.formData.order_goods_id = this.order_goods_id;
var checkRes = validate.check(this.formData, rule);
if (checkRes) {
if (this.isSub) return;
this.isSub = true;
this.$api.sendRequest({
url: '/api/orderrefund/delivery',
data: this.formData,
success: res => {
if (res.code == 0) {
this.action = '';
this.getRefundDetail();
} else {
this.$util.showToast({ title: res.message });
}
}
});
} else {
this.$util.showToast({ title: validate.error });
return false;
}
},
/**
* 切换操作
*/
switchAction(action) {
this.action = action;
},
imageError() {
this.detail.sku_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
refundDetail(e) {
this.$util.redirectTo('/pages/goods/detail', {
goods_id: e.goods_id
});
}
}
};
</script>
<style lang="scss">
@import './public/css/refund_detail.scss';
</style>

View File

@@ -0,0 +1,226 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view class="goods-select">
<view class="top">
<text class="color-base-text">{{refund_data.length}}</text>件商品
</view>
<view class="body">
<view class="item" v-for="(item,index) in refund_data" :key="index">
<view @click="single(index)" style="display:none">
<text v-if="item.judge" class="iconfont icon-yuan_checked color-base-text"></text>
<text v-else class="iconfont icon-yuan_checkbox"></text>
</view>
<image :src="$util.img(item.sku_image)" @error="error(index)"></image>
<view class="title">
<text>{{item.sku_name}}</text>
</view>
</view>
</view>
<view class="bottom-all">
<view >
<!-- @click="all"
<text v-if="judge" class="iconfont icon-yuan_checked color-base-text"></text>
<text v-else class="iconfont icon-yuan_checkbox"></text> -->
</view>
<view v-if="nexthover" class="next" @click="next">下一步</view>
<view v-else class="next nexthover">请选择商品</view>
</view>
<!-- <loading-cover ref="loadingCover"></loading-cover> -->
</view>
</template>
<script>
export default{
data(){
return{
refund_type:1,
refund_data:[],
judge:true,
order_goods_id:[],
nexthover:true
}
},
onLoad(option){
if(option.refund_type){
this.refund_type = option.refund_type;
this.getGoodsInfo()
} else{
uni.showToast({
title:'未查找到订单信息',
icon:'none'
})
setTimeout(()=>{
this.$util.redirectTo('/pages/order/list');
},1000)
}
},
methods:{
/**
* 处理商品选中数据
*/
getGoodsInfo(){
uni.getStorage({
key:'refund_goods_data',
success:res=>{
let refund_data = JSON.parse(res.data);
this.refund_data = [];
refund_data.forEach(item=>{
if(item.refund_status == 0){
item.judge = true;
this.refund_data.push(item);
}
})
}
})
},
/**
*单选事件
*/
single(key){
this.refund_data[key].judge = !this.refund_data[key].judge;
let allJudge = true;
this.refund_data.forEach((item)=>{
if(!item.judge){
allJudge = false;
}
})
this.judge = allJudge;
this.getOrderIdInfo();
this.$forceUpdate()
},
/**
* 全选选择
*/
all(){
this.judge = !this.judge;
this.refund_data.map(item=>{
item.judge = this.judge;
return item;
})
this.getOrderIdInfo();
this.$forceUpdate()
},
/**
* 获取选择的order_goods_id
*/
getOrderIdInfo(){
this.order_goods_id = [];
this.refund_data.forEach(item=>{
if(item.judge){
this.order_goods_id.push(item.order_goods_id)
}
})
if(this.order_goods_id.length == 0){
this.nexthover = false;
}else{
this.nexthover = true;
}
this.$forceUpdate();
},
/**
* 跳转退款界面
*/
next(){
this.refund_data.forEach(item=>{
this.order_goods_id.push(item.order_goods_id)
})
if(this.order_goods_id.length == 0){
this.getOrderIdInfo();
}
this.$util.redirectTo('/pages_tool/order/refund_batch', { order_goods_id: this.order_goods_id.join(), refund_type:this.refund_type });
},
/**
* 默认图片处理
*/
error(index){
this.refund_data[index].sku_image = this.$util.getDefaultImage().goods
this.$forceUpdate();
}
}
}
</script>
<style lang="scss" scoped>
.goods-select{
.top{
padding: 20rpx 30rpx;
box-sizing: border-box;
font-size: 28rpx;
background: #FFFFFF;
text{
font-size: 30rpx;
margin: 0 10rpx;
font-weight: bold;
}
}
.iconfont{
font-size: 40rpx;
}
.body{
margin: 30rpx;
border-radius: 10rpx;
background: #FFFFFF;
padding: 30rpx 0 0;
.item{
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx 30rpx;
image{
width: 180rpx;
height: 180rpx;
border-radius: 10rpx;
}
.title{
width: 368rpx;
height:180rpx;
font-size: 28rpx;
text{
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
}
}
}
}
.bottom-all{
padding-left: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: #FFFFFF;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
box-sizing: border-box;
.next{
padding: 16rpx 80rpx;
color: #FFFFFF;
background: #ff4544;
}
.nexthover{
background: #e7dcdc !important;
}
}
}
</style>

View File

@@ -0,0 +1,121 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<view>
<view class="refund-option">
<view class="option-item" @click="selectRefundType(1)">
<view>
<text>退款无需退货</text>
<text class="font-size-goods-tag color-tip">没收到货或与卖家协商同意无需退货只退款</text>
</view>
<text class="iconfont icon-right"></text>
</view>
<view class="option-item" @click="selectRefundType(2)" v-if="refund_data.order_status == 3">
<view>
<text>退货退款</text>
<text class="font-size-goods-tag color-tip">已收到货需退还收到的货物</text>
</view>
<text class="iconfont icon-right"></text>
</view>
</view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</view>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue';
export default {
components: {
uniPopup
},
data() {
return {
order_id: '',
isIphoneX: false,
refund_data: {},
};
},
onLoad(option) {
if (option.order_id) this.order_id = option.order_id;
},
onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
if (this.storeToken) {
this.getRefundData();
} else {
this.$util.redirectTo('/pages_tool/login/login', {
back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id
});
}
},
methods: {
/**
* 选择退款方式
* @param {Object} type
*/
selectRefundType(type) {
this.$util.redirectTo('/pages_tool/order/refund_goods_select', {
refund_type: type
});
},
/**
* 获取退款订单数据
*/
getRefundData() {
this.$api.sendRequest({
url: '/api/order/detail',
data: {
order_id: this.order_id
},
success: res => {
if (res.code >= 0) {
this.refund_data = res.data;
uni.setStorage({
key: 'refund_goods_data',
data: JSON.stringify(res.data.order_goods),
})
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
} else {
this.$util.showToast({
title: '未获取到该订单项退款信息'
});
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
}, 1000);
}
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
}
};
</script>
<style lang="scss">
@import './public/css/refund.scss';
</style>
<style scoped>
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup {
z-index: 8;
}
.sub-btn {
padding-top: 20rpx;
background-color: #FFFFFF;
}
</style>