优化积分配置

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); data.goodsDescription = JSON.stringify(imgs.value);
} }
await pointsGoodsPost(data); await pointsGoodsPost(data);
uni.showToast({ setTimeout(() => {
title: '保存成功', uni.showToast({
icon: 'none' title: '保存成功',
}); icon: 'none'
});
}, 300);
setTimeout(() => { setTimeout(() => {
uni.navigateBack(); uni.navigateBack();
}, 1000); }, 1000);

View File

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

View File

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