fix: 优化系统提示为中文 & 修复商品Banner图和商城相关问题

- 权益中心领取优惠券/任务奖励提示改为中文'领取成功'
- 后端action端点返回中文消息(回收成功/发货申请成功/支付成功等)
- 商城兑换成功提示改为'兑换成功'并优化加载闪烁
- 商城确认订单弹窗使用封面图
- 后台商品编辑/新增Banner图保存修复(|| undefined → || null)
This commit is contained in:
zpc 2026-03-12 20:56:34 +08:00
parent 8c5806b89a
commit 0374220d9d
9 changed files with 60 additions and 28 deletions

View File

@ -275,7 +275,7 @@
const res = await receiveTaskReward(item.id);
if (res.status == 1) {
this.$c.toast({
title: res.msg,
title: '领取成功',
duration: 500,
success: () => {
this.getData()

View File

@ -95,7 +95,7 @@
<view class="rule-close" @click="$refs.orderPop.close()"></view>
</view>
<view class="order-card">
<image :src="orderData.goods.imgurl_detail || orderData.goods.imgurl"
<image :src="orderData.goods.imgurl"
style="width: 190rpx; height: 190rpx; border-radius: 10rpx; flex-shrink: 0;" mode="aspectFill"></image>
<view class="order-card-info">
<text class="hang1" style="font-size: 28rpx; color: #333;">{{ orderData.goods.title }}</text>
@ -152,6 +152,7 @@
<script>
import { calcMallOrderMoney, createOrder, createMallOrder } from '@/common/server/order.js';
import { getGoodsDetail } from '@/common/server/goods.js';
import RequestManager from '@/common/request.js';
export default {
data() {
@ -237,6 +238,36 @@ export default {
}
},
// ""
async silentLoadDetail() {
try {
const detailRes = await RequestManager.get('/goods_detail', { goods_id: this.goodsId }, false);
if (detailRes.status == 1 && detailRes.data) {
this.goodsInfo = detailRes.data.goods || detailRes.data;
}
} catch (e) {
console.log('静默刷新商品详情失败', e);
}
const token = uni.getStorageSync('token');
if (token) {
try {
const res = await RequestManager.post('/mall_ordermoney', {
prize_num: 1,
goods_id: this.goodsId,
num: 1,
}, false);
if (res.status == 1) {
this.orderData = res.data;
if (res.data.goods) {
this.goodsInfo = { ...this.goodsInfo, ...res.data.goods };
}
}
} catch (e) {
console.log('静默刷新支付信息失败', e);
}
}
},
onBuy() {
const token = uni.getStorageSync('token');
if (!token) {
@ -324,16 +355,17 @@ export default {
const status = await this.$platform.pay({ data: res.data.res }, this);
if (status == 'success') {
this.$c.msg('兑换成功');
//
// ""
setTimeout(() => {
this.loadDetail();
this.silentLoadDetail();
}, 1600);
}
} else {
//
this.$c.msg(res.msg);
// /
this.$c.msg('兑换成功');
// ""
setTimeout(() => {
this.loadDetail();
this.silentLoadDetail();
}, 1600);
}
}

View File

@ -268,7 +268,7 @@
if (res.status == 1) {
this.$c.toast({
title: res.msg,
title: '领取成功',
duration: 500,
success: () => {
this.$c.to({
@ -293,7 +293,7 @@
const res = await receiveTaskReward(item.id);
if (res.status == 1) {
this.$c.toast({
title: res.msg,
title: '领取成功',
duration: 500,
success: () => {
this.getdata()

View File

@ -89,7 +89,7 @@ export interface GoodsCreateRequest {
type: number
imgUrl: string
imgUrlDetail: string
imgUrlBanner?: string
imgUrlBanner?: string | null
stock: number
sort: number
dailyLimit: number
@ -99,12 +99,12 @@ export interface GoodsCreateRequest {
showIs: number
couponIs: number
couponPro: number
flwStartTime?: string
flwEndTime?: string
openTime?: string
flwStartTime?: string | null
flwEndTime?: string | null
openTime?: string | null
choujiangXianzhi?: number
categoryId: number
goodsDescribe?: string
goodsDescribe?: string | null
newIs: number
isShouZhe: number
rageIs: number

View File

@ -615,7 +615,7 @@ const handleSubmit = async () => {
type: formData.type,
imgUrl: formData.imgUrl,
imgUrlDetail: formData.imgUrlDetail,
imgUrlBanner: formData.imgUrlBanner || undefined,
imgUrlBanner: formData.imgUrlBanner || null,
stock: formData.stock,
sort: formData.sort,
dailyLimit: formData.dailyLimit,
@ -625,12 +625,12 @@ const handleSubmit = async () => {
showIs: formData.showIs,
couponIs: formData.couponIs,
couponPro: formData.couponPro,
flwStartTime: formData.flwStartTime || undefined,
flwEndTime: formData.flwEndTime || undefined,
openTime: formData.openTime || undefined,
flwStartTime: formData.flwStartTime || null,
flwEndTime: formData.flwEndTime || null,
openTime: formData.openTime || null,
choujiangXianzhi: formData.choujiangXianzhi,
categoryId: formData.categoryId,
goodsDescribe: formData.goodsDescribe || undefined,
goodsDescribe: formData.goodsDescribe || null,
newIs: formData.newIs,
isShouZhe: formData.isShouZhe,
rageIs: formData.rageIs,

View File

@ -617,7 +617,7 @@ const handleSubmit = async () => {
type: formData.type,
imgUrl: formData.imgUrl,
imgUrlDetail: formData.imgUrlDetail,
imgUrlBanner: formData.imgUrlBanner || undefined,
imgUrlBanner: formData.imgUrlBanner || null,
stock: formData.stock,
sort: formData.sort,
dailyLimit: formData.dailyLimit,
@ -627,12 +627,12 @@ const handleSubmit = async () => {
showIs: formData.showIs,
couponIs: formData.couponIs,
couponPro: formData.couponPro,
flwStartTime: formData.flwStartTime || undefined,
flwEndTime: formData.flwEndTime || undefined,
openTime: formData.openTime || undefined,
flwStartTime: formData.flwStartTime || null,
flwEndTime: formData.flwEndTime || null,
openTime: formData.openTime || null,
choujiangXianzhi: formData.choujiangXianzhi,
categoryId: formData.categoryId,
goodsDescribe: formData.goodsDescribe || undefined,
goodsDescribe: formData.goodsDescribe || null,
newIs: formData.newIs,
isShouZhe: formData.isShouZhe,
rageIs: formData.rageIs,

View File

@ -178,7 +178,7 @@ public class CouponController : ControllerBase
}
var result = await _couponService.ClaimCouponAsync(userId.Value, request.Id);
return ApiResponse<ClaimCouponResponse>.Success(result);
return ApiResponse<ClaimCouponResponse>.Success(result, "领取成功");
}
catch (InvalidOperationException ex)
{

View File

@ -86,7 +86,7 @@ public class TaskController : ControllerBase
}
var result = await _taskService.ClaimTaskRewardAsync(userId.Value, request.TaskListId);
return ApiResponse<ClaimTaskRewardResponse>.Success(result);
return ApiResponse<ClaimTaskRewardResponse>.Success(result, "领取成功");
}
catch (InvalidOperationException ex)
{

View File

@ -106,7 +106,7 @@ public class WarehouseController : ControllerBase
}
var result = await _warehouseService.RecoveryPrizesAsync(userId.Value, request);
return ApiResponse<RecoveryResultDto>.Success(result);
return ApiResponse<RecoveryResultDto>.Success(result, "回收成功");
}
catch (InvalidOperationException ex)
{
@ -171,7 +171,7 @@ public class WarehouseController : ControllerBase
}
var result = await _warehouseService.SendPrizesAsync(userId.Value, request);
return ApiResponse<SendResultDto>.Success(result);
return ApiResponse<SendResultDto>.Success(result, "发货申请成功");
}
catch (InvalidOperationException ex)
{