优化积分配置

This commit is contained in:
gyq
2025-12-12 11:31:53 +08:00
parent 48c08abbb6
commit a0f5a41690
4 changed files with 33 additions and 19 deletions

View File

@@ -315,10 +315,12 @@ function submitHandle() {
data.goodsDescription = JSON.stringify(imgs.value);
}
await pointsGoodsPost(data);
uni.showToast({
title: '保存成功',
icon: 'none'
});
setTimeout(() => {
uni.showToast({
title: '保存成功',
icon: 'none'
});
}, 300);
setTimeout(() => {
uni.navigateBack();
}, 1000);

View File

@@ -163,10 +163,12 @@ async function submitQuntity() {
mask: true
});
await pointsGoodsPost(quantityItem.value);
uni.showToast({
title: '保存成功',
icon: 'none'
});
setTimeout(() => {
uni.showToast({
title: '保存成功',
icon: 'none'
});
}, 300);
pointsGoodsPageAjax();
showEdtorQuantity.value = false;
} catch (error) {

View File

@@ -193,10 +193,13 @@ async function checkoutAjax(couponCode) {
});
await goodsRecordCkecout(couponCode);
goodsRecordPageAjax();
uni.showToast({
title: '已核销',
icon: 'none'
});
setTimeout(() => {
uni.showToast({
title: '已核销',
icon: 'none'
});
}, 300);
} catch (error) {
console.log(error);
}

View File

@@ -103,14 +103,15 @@ import { filterNumberInput } from '@/utils/index.js';
import { pointsConfigPost, pointsConfigGet } from '@/http/api/market/point.js';
const formRef = ref(null);
const form = ref({
const formObj = {
enableRewards: 0,
consumeAmount: '', // 每消费xx元赠送1积分
minPaymentAmount: '', // 下单实付抵扣门槛
maxDeductionRatio: 100, // 下单最高抵扣比例
equivalentPoints: '', // 下单抵扣积分比例 1元=?积分
enablePointsMall: 0 // 开启积分商城
});
};
const form = ref({ ...formObj });
const rules = ref({
consumeAmount: [
@@ -209,10 +210,12 @@ function submitHandle() {
mask: true
});
await pointsConfigPost(form.value);
uni.showToast({
title: '保存成功',
icon: 'none'
});
setTimeout(() => {
uni.showToast({
title: '保存成功',
icon: 'none'
});
}, 300);
} catch (error) {
console.log(error);
}
@@ -229,7 +232,11 @@ async function pointsConfigGetAjax() {
mask: true
});
const res = await pointsConfigGet();
form.value = res;
if (res == null || !res) {
form.value = { ...formObj };
} else {
form.value = res;
}
} catch (error) {
console.log(error);
}