Files
lucky_shop/pages_tool/order/refund_detail.vue
ZF sun 783c10fc62 refactor: 统一项目内国际化key的命名空间格式
本次提交对全项目的国际化调用进行了规范化重构:
1. 为中文/英文语言包新增了avatar和gender的别名映射,兼容旧有headImg/sex写法
2. 修正了lang.js中的注释路径错误
3. 将所有页面和组件内的$lang调用从短路径改为带业务模块前缀的完整命名空间路径,例如将$lang('title')改为$lang('article.list.title')
4. 优化了i18n-lazy.js的注释说明,补充了正确的key命名格式示例
5. 统一了分销、订单、会员等模块的国际化key层级,确保所有语言调用路径一致
2026-07-04 09:24:35 +08:00

273 lines
11 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view :style="themeColor">
<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">{{ $lang('order.refund_detail.statusTip.merchantReject') }}</view>
<view class="font-size-goods-tag color-tip">{{ $lang('order.refund_detail.statusTip.merchantAgree') }}</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">{{ $lang('order.refund_detail.statusTip.merchantConfirmReceive') }}</view>
<view class="font-size-goods-tag color-tip">{{ $lang('order.refund_detail.statusTip.merchantRejectReceive') }}</view>
</view>
</view>
<view class="history-wrap" @click="switchAction('consultrecord')">
<view>{{ $lang('order.refund_detail.consultRecord') }}</view>
<text class="iconfont icon-right"></text>
</view>
<view class="refund-address-wrap" v-if="detail.refund_status == 4">
<view class="header">{{ $lang('order.refund_detail.returnAddress.title') }}</view>
<view>
<text>{{ $lang('order.refund_detail.returnAddress.receiver') }}{{ detail.shop_contacts }}</text>
</view>
<view>
<text>{{ $lang('order.refund_detail.returnAddress.contact') }}{{ detail.shop_mobile }}</text>
</view>
<view>
<text class="address">{{ $lang('order.refund_detail.returnAddress.address') }}{{ detail.shop_address }}</text>
<view class="copy" @click="$util.copy(detail.shop_address)">{{ $lang('order.refund_detail.returnAddress.copy') }}</view>
</view>
</view>
<view class="refund-info">
<view class="header">{{ $lang('order.refund_detail.refundInfo.title') }}</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" show-menu-by-longpress></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">{{ $lang('order.refund_detail.refundInfo.refundMethod') }}{{ detail.refund_type == 1 ? $lang('order.refund_detail.refundInfo.refundOnly') : $lang('order.refund_detail.refundInfo.refundReturn') }}</view>
<view class="cell" v-if="detail.refund_status == 3">{{ $lang('order.refund_detail.refundInfo.refundChannel') }}{{ detail.refund_money_type == 1 ? $lang('order.refund_detail.refundInfo.originalRefund') : detail.refund_money_type == 2 ? $lang('order.refund_detail.refundInfo.offlineRefund') : $lang('order.refund_detail.refundInfo.balanceRefund') }}</view>
<view class="cell">{{ $lang('order.refund_detail.refundInfo.refundReason') }}{{ detail.refund_reason }}</view>
<view class="cell" v-if="detail.refund_status == 3 && detail.refund_real_money>0">{{ $lang('order.refund_detail.refundInfo.refundAmount') }}{{ $lang('common.currencySymbol') }}{{ detail.refund_real_money }}</view>
<view class="cell" v-else-if="detail.refund_apply_money>0">{{ $lang('order.refund_detail.refundInfo.refundAmount') }}{{ $lang('common.currencySymbol') }}{{ detail.refund_apply_money }}</view>
<view class="cell">{{ $lang('order.refund_detail.refundInfo.refundNo') }}{{ detail.refund_no }}</view>
<view class="cell">{{ $lang('order.refund_detail.refundInfo.applyTime') }}{{ $util.timeStampTurnTime(detail.refund_action_time) }}</view>
<view class="cell" v-if="detail.refund_time">{{ $lang('order.refund_detail.refundInfo.refundTime') }}{{ $util.timeStampTurnTime(detail.refund_time) }}</view>
<view class="cell" v-if="detail.refund_remark != ''">{{ $lang('order.refund_detail.refundInfo.refundRemark') }}{{ detail.refund_remark }}</view>
<view class="cell" v-if="detail.use_point>0">{{ $lang('order.refund_detail.refundInfo.refundPoint') }}{{ 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">{{ $lang('order.refund_detail.returnGoods.expressCompany') }}</view>
<view class="cont">
<input
type="text"
:placeholder="$lang('order.refund_detail.returnGoods.expressCompanyPlaceholder')"
class="input"
placeholder-class="input-placeholder color-tip"
v-model="formData.refund_delivery_name"
/>
</view>
</view>
<view class="item">
<view class="label">{{ $lang('order.refund_detail.returnGoods.expressNo') }}</view>
<view class="cont">
<input
type="text"
:placeholder="$lang('order.refund_detail.returnGoods.expressNoPlaceholder')"
class="input"
placeholder-class="input-placeholder color-tip"
v-model="formData.refund_delivery_no"
/>
</view>
</view>
<view class="item">
<view class="label">{{ $lang('order.refund_detail.returnGoods.expressRemark') }}</view>
<view class="cont">
<textarea
placeholder-class="color-tip font-size-tag"
:auto-height="true"
class="textarea"
:placeholder="$lang('order.refund_detail.returnGoods.expressRemarkPlaceholder')"
v-model="formData.refund_delivery_remark"
/>
</view>
</view>
</view>
<button type="primary" class="sub-btn" @click="refurnGoods">{{ $lang('common.submit') }}</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 ? $lang('order.refund_detail.record.buyer') : $lang('order.refund_detail.record.seller') }}</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('')">{{ $lang('order.refund_detail.record.backToDetail') }}</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';
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
};
},
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(this.$util.LOGIN_PAGE_URL, { 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: this.$lang('order.refund_detail.toast.noRefundInfo') });
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: this.$lang('order.refund_detail.toast.cancelSuccess') });
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: this.$lang('order.refund_detail.validate.pleaseInputExpressCompany') },
{ name: 'refund_delivery_no', checkType: 'required', errorMsg: this.$lang('order.refund_detail.validate.pleaseInputExpressNo') }
];
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>