fix: 优化系统提示为中文 & 修复商品Banner图和商城相关问题
- 权益中心领取优惠券/任务奖励提示改为中文'领取成功' - 后端action端点返回中文消息(回收成功/发货申请成功/支付成功等) - 商城兑换成功提示改为'兑换成功'并优化加载闪烁 - 商城确认订单弹窗使用封面图 - 后台商品编辑/新增Banner图保存修复(|| undefined → || null)
This commit is contained in:
parent
8c5806b89a
commit
0374220d9d
|
|
@ -275,7 +275,7 @@
|
||||||
const res = await receiveTaskReward(item.id);
|
const res = await receiveTaskReward(item.id);
|
||||||
if (res.status == 1) {
|
if (res.status == 1) {
|
||||||
this.$c.toast({
|
this.$c.toast({
|
||||||
title: res.msg,
|
title: '领取成功',
|
||||||
duration: 500,
|
duration: 500,
|
||||||
success: () => {
|
success: () => {
|
||||||
this.getData()
|
this.getData()
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
<view class="rule-close" @click="$refs.orderPop.close()">✕</view>
|
<view class="rule-close" @click="$refs.orderPop.close()">✕</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-card">
|
<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>
|
style="width: 190rpx; height: 190rpx; border-radius: 10rpx; flex-shrink: 0;" mode="aspectFill"></image>
|
||||||
<view class="order-card-info">
|
<view class="order-card-info">
|
||||||
<text class="hang1" style="font-size: 28rpx; color: #333;">{{ orderData.goods.title }}</text>
|
<text class="hang1" style="font-size: 28rpx; color: #333;">{{ orderData.goods.title }}</text>
|
||||||
|
|
@ -152,6 +152,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { calcMallOrderMoney, createOrder, createMallOrder } from '@/common/server/order.js';
|
import { calcMallOrderMoney, createOrder, createMallOrder } from '@/common/server/order.js';
|
||||||
import { getGoodsDetail } from '@/common/server/goods.js';
|
import { getGoodsDetail } from '@/common/server/goods.js';
|
||||||
|
import RequestManager from '@/common/request.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
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() {
|
onBuy() {
|
||||||
const token = uni.getStorageSync('token');
|
const token = uni.getStorageSync('token');
|
||||||
if (!token) {
|
if (!token) {
|
||||||
|
|
@ -324,16 +355,17 @@ export default {
|
||||||
const status = await this.$platform.pay({ data: res.data.res }, this);
|
const status = await this.$platform.pay({ data: res.data.res }, this);
|
||||||
if (status == 'success') {
|
if (status == 'success') {
|
||||||
this.$c.msg('兑换成功');
|
this.$c.msg('兑换成功');
|
||||||
// 延迟刷新,避免与成功提示冲突
|
// 静默刷新,避免出现"加载中"提示
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.loadDetail();
|
this.silentLoadDetail();
|
||||||
}, 1600);
|
}, 1600);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 失败时立即刷新
|
// 兑换成功(积分/货币直接扣除,无需微信支付)
|
||||||
this.$c.msg(res.msg);
|
this.$c.msg('兑换成功');
|
||||||
|
// 静默刷新,避免出现"加载中"提示
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.loadDetail();
|
this.silentLoadDetail();
|
||||||
}, 1600);
|
}, 1600);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@
|
||||||
|
|
||||||
if (res.status == 1) {
|
if (res.status == 1) {
|
||||||
this.$c.toast({
|
this.$c.toast({
|
||||||
title: res.msg,
|
title: '领取成功',
|
||||||
duration: 500,
|
duration: 500,
|
||||||
success: () => {
|
success: () => {
|
||||||
this.$c.to({
|
this.$c.to({
|
||||||
|
|
@ -293,7 +293,7 @@
|
||||||
const res = await receiveTaskReward(item.id);
|
const res = await receiveTaskReward(item.id);
|
||||||
if (res.status == 1) {
|
if (res.status == 1) {
|
||||||
this.$c.toast({
|
this.$c.toast({
|
||||||
title: res.msg,
|
title: '领取成功',
|
||||||
duration: 500,
|
duration: 500,
|
||||||
success: () => {
|
success: () => {
|
||||||
this.getdata()
|
this.getdata()
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ export interface GoodsCreateRequest {
|
||||||
type: number
|
type: number
|
||||||
imgUrl: string
|
imgUrl: string
|
||||||
imgUrlDetail: string
|
imgUrlDetail: string
|
||||||
imgUrlBanner?: string
|
imgUrlBanner?: string | null
|
||||||
stock: number
|
stock: number
|
||||||
sort: number
|
sort: number
|
||||||
dailyLimit: number
|
dailyLimit: number
|
||||||
|
|
@ -99,12 +99,12 @@ export interface GoodsCreateRequest {
|
||||||
showIs: number
|
showIs: number
|
||||||
couponIs: number
|
couponIs: number
|
||||||
couponPro: number
|
couponPro: number
|
||||||
flwStartTime?: string
|
flwStartTime?: string | null
|
||||||
flwEndTime?: string
|
flwEndTime?: string | null
|
||||||
openTime?: string
|
openTime?: string | null
|
||||||
choujiangXianzhi?: number
|
choujiangXianzhi?: number
|
||||||
categoryId: number
|
categoryId: number
|
||||||
goodsDescribe?: string
|
goodsDescribe?: string | null
|
||||||
newIs: number
|
newIs: number
|
||||||
isShouZhe: number
|
isShouZhe: number
|
||||||
rageIs: number
|
rageIs: number
|
||||||
|
|
|
||||||
|
|
@ -615,7 +615,7 @@ const handleSubmit = async () => {
|
||||||
type: formData.type,
|
type: formData.type,
|
||||||
imgUrl: formData.imgUrl,
|
imgUrl: formData.imgUrl,
|
||||||
imgUrlDetail: formData.imgUrlDetail,
|
imgUrlDetail: formData.imgUrlDetail,
|
||||||
imgUrlBanner: formData.imgUrlBanner || undefined,
|
imgUrlBanner: formData.imgUrlBanner || null,
|
||||||
stock: formData.stock,
|
stock: formData.stock,
|
||||||
sort: formData.sort,
|
sort: formData.sort,
|
||||||
dailyLimit: formData.dailyLimit,
|
dailyLimit: formData.dailyLimit,
|
||||||
|
|
@ -625,12 +625,12 @@ const handleSubmit = async () => {
|
||||||
showIs: formData.showIs,
|
showIs: formData.showIs,
|
||||||
couponIs: formData.couponIs,
|
couponIs: formData.couponIs,
|
||||||
couponPro: formData.couponPro,
|
couponPro: formData.couponPro,
|
||||||
flwStartTime: formData.flwStartTime || undefined,
|
flwStartTime: formData.flwStartTime || null,
|
||||||
flwEndTime: formData.flwEndTime || undefined,
|
flwEndTime: formData.flwEndTime || null,
|
||||||
openTime: formData.openTime || undefined,
|
openTime: formData.openTime || null,
|
||||||
choujiangXianzhi: formData.choujiangXianzhi,
|
choujiangXianzhi: formData.choujiangXianzhi,
|
||||||
categoryId: formData.categoryId,
|
categoryId: formData.categoryId,
|
||||||
goodsDescribe: formData.goodsDescribe || undefined,
|
goodsDescribe: formData.goodsDescribe || null,
|
||||||
newIs: formData.newIs,
|
newIs: formData.newIs,
|
||||||
isShouZhe: formData.isShouZhe,
|
isShouZhe: formData.isShouZhe,
|
||||||
rageIs: formData.rageIs,
|
rageIs: formData.rageIs,
|
||||||
|
|
|
||||||
|
|
@ -617,7 +617,7 @@ const handleSubmit = async () => {
|
||||||
type: formData.type,
|
type: formData.type,
|
||||||
imgUrl: formData.imgUrl,
|
imgUrl: formData.imgUrl,
|
||||||
imgUrlDetail: formData.imgUrlDetail,
|
imgUrlDetail: formData.imgUrlDetail,
|
||||||
imgUrlBanner: formData.imgUrlBanner || undefined,
|
imgUrlBanner: formData.imgUrlBanner || null,
|
||||||
stock: formData.stock,
|
stock: formData.stock,
|
||||||
sort: formData.sort,
|
sort: formData.sort,
|
||||||
dailyLimit: formData.dailyLimit,
|
dailyLimit: formData.dailyLimit,
|
||||||
|
|
@ -627,12 +627,12 @@ const handleSubmit = async () => {
|
||||||
showIs: formData.showIs,
|
showIs: formData.showIs,
|
||||||
couponIs: formData.couponIs,
|
couponIs: formData.couponIs,
|
||||||
couponPro: formData.couponPro,
|
couponPro: formData.couponPro,
|
||||||
flwStartTime: formData.flwStartTime || undefined,
|
flwStartTime: formData.flwStartTime || null,
|
||||||
flwEndTime: formData.flwEndTime || undefined,
|
flwEndTime: formData.flwEndTime || null,
|
||||||
openTime: formData.openTime || undefined,
|
openTime: formData.openTime || null,
|
||||||
choujiangXianzhi: formData.choujiangXianzhi,
|
choujiangXianzhi: formData.choujiangXianzhi,
|
||||||
categoryId: formData.categoryId,
|
categoryId: formData.categoryId,
|
||||||
goodsDescribe: formData.goodsDescribe || undefined,
|
goodsDescribe: formData.goodsDescribe || null,
|
||||||
newIs: formData.newIs,
|
newIs: formData.newIs,
|
||||||
isShouZhe: formData.isShouZhe,
|
isShouZhe: formData.isShouZhe,
|
||||||
rageIs: formData.rageIs,
|
rageIs: formData.rageIs,
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ public class CouponController : ControllerBase
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = await _couponService.ClaimCouponAsync(userId.Value, request.Id);
|
var result = await _couponService.ClaimCouponAsync(userId.Value, request.Id);
|
||||||
return ApiResponse<ClaimCouponResponse>.Success(result);
|
return ApiResponse<ClaimCouponResponse>.Success(result, "领取成功");
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException ex)
|
catch (InvalidOperationException ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ public class TaskController : ControllerBase
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = await _taskService.ClaimTaskRewardAsync(userId.Value, request.TaskListId);
|
var result = await _taskService.ClaimTaskRewardAsync(userId.Value, request.TaskListId);
|
||||||
return ApiResponse<ClaimTaskRewardResponse>.Success(result);
|
return ApiResponse<ClaimTaskRewardResponse>.Success(result, "领取成功");
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException ex)
|
catch (InvalidOperationException ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ public class WarehouseController : ControllerBase
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = await _warehouseService.RecoveryPrizesAsync(userId.Value, request);
|
var result = await _warehouseService.RecoveryPrizesAsync(userId.Value, request);
|
||||||
return ApiResponse<RecoveryResultDto>.Success(result);
|
return ApiResponse<RecoveryResultDto>.Success(result, "回收成功");
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException ex)
|
catch (InvalidOperationException ex)
|
||||||
{
|
{
|
||||||
|
|
@ -171,7 +171,7 @@ public class WarehouseController : ControllerBase
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = await _warehouseService.SendPrizesAsync(userId.Value, request);
|
var result = await _warehouseService.SendPrizesAsync(userId.Value, request);
|
||||||
return ApiResponse<SendResultDto>.Success(result);
|
return ApiResponse<SendResultDto>.Success(result, "发货申请成功");
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException ex)
|
catch (InvalidOperationException ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user