Files
lucky_shop/pages_tool/order/activist.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

152 lines
4.7 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" 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">{{ $lang('order.activist.status.success') }}</view>
<view class="status-name color-base-text" v-if="item.refund_status == 1">{{ $lang('order.activist.status.processing') }}</view>
<view class="status-name color-base-text" v-if="item.refund_status == -1">{{ $lang('order.activist.status.failed') }}</view>
</view>
<view class="goods-wrap">
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="imageError(index)" mode="aspectFill" :lazy-load="true" show-menu-by-longpress></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>{{ $lang('common.currencySymbol') }}{{ item.price }}</text>
<text class="num">×{{ item.num }}</text>
</view>
</view>
</view>
</view>
<view class="goods-btn">
<view class="btn-text">
<text>{{ $lang('order.activist.totalItems', { num: item.num }) }}</text>
<text>{{ $lang('order.activist.refundAmount', { currency: $lang('common.currencySymbol'), amount: 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)">{{ $lang('order.activist.checkDetail') }}</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('order.activist.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.$lang('order.activist.toast.cancelSuccess')
});
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>
::v-deep .fixed {
position: relative;
top: 0;
}
.cart-empty {
padding-top: 308rpx !important;
}
@import './public/css/activist.scss';
</style>