feat(withdraw): 落地方案B一体化商城余额提现与手续费内扣模式,完善多端打款退款与对账闭环

这个提交包含在:
chen
2026-09-20 14:35:38 +08:00
父节点 bee5288e88
当前提交 2b7c34c7f7
共有 65 个文件被更改,包括 3554 次插入 和 579 次删除

查看文件

@@ -97,23 +97,31 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}, function (ret, res) { })
}
function openTab(url, title, icon) {
if (top && top.Backend && top.Backend.api && typeof top.Backend.api.addtabs === 'function') {
top.Backend.api.addtabs(url, title, icon);
} else if (typeof Backend !== 'undefined' && Backend.api && typeof Backend.api.addtabs === 'function') {
Backend.api.addtabs(url, title, icon);
} else if (Fast && Fast.api && typeof Fast.api.addtabs === 'function') {
Fast.api.addtabs(url, title, icon);
} else if (top && top.Fast && top.Fast.api && typeof top.Fast.api.addtabs === 'function') {
top.Fast.api.addtabs(url, title, icon);
} else {
window.location.href = Fast.api.fixurl(url);
}
}
function onAdd() {
Fast.api.open(`shopro/goods/goods/select?data_type=score_shop`, "选择商品", {
callback(data) {
Fast.api.open(`shopro/app/score_shop/add?type=add&goods_id=${data.id}&title=${data.title}`, "添加", {
callback() {
getData()
}
})
if (data && data.id) {
openTab(`shopro/app/score_shop/add?type=add&goods_id=${data.id}&title=${encodeURIComponent(data.title || '')}&ref=addtabs`, `添加兑换商品 - ${data.title || data.id}`, "fa fa-plus");
}
}
})
}
function onEdit(item) {
Fast.api.open(`shopro/app/score_shop/edit?type=edit&goods_id=${item.id}&title=${item.title}`, "编辑", {
callback() {
getData()
}
})
openTab(`shopro/app/score_shop/edit/goods_id/${item.id}?type=edit&goods_id=${item.id}&title=${encodeURIComponent(item.title || '')}&ref=addtabs`, `编辑兑换商品 - ${item.title || item.id}`, "fa fa-pencil");
}
function onDelete(id) {
Fast.api.ajax({
@@ -164,10 +172,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
const { reactive, onMounted } = Vue
const addEdit = {
setup() {
let searchParams = new URLSearchParams(location.search);
let pathMatches = location.pathname.match(/goods_id\/(\d+)/);
let goodsIdFromPath = pathMatches ? pathMatches[1] : '';
const state = reactive({
type: new URLSearchParams(location.search).get('type'),
goods_id: new URLSearchParams(location.search).get('goods_id'),
title: new URLSearchParams(location.search).get('title'),
type: searchParams.get('type') || (location.pathname.includes('/edit') ? 'edit' : 'add'),
goods_id: searchParams.get('goods_id') || goodsIdFromPath,
title: searchParams.get('title') || '',
})
const goods = reactive({
@@ -184,10 +196,42 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
goods.skus = res.data.skus;
goods.sku_prices = res.data.sku_prices;
goods.score_sku_prices = res.data.score_sku_prices;
if (res.data.goods && res.data.goods.title) {
state.title = res.data.goods.title;
}
return false
}, function (ret, res) { })
}
function closeCurrentTab() {
if (parent && parent.Layer && typeof parent.Layer.getFrameIndex === 'function') {
try {
var index = parent.Layer.getFrameIndex(window.name);
if (index) {
parent.Layer.close(index);
return true;
}
} catch (e) {}
}
if (top && top.Backend && top.Backend.api && typeof top.Backend.api.closetabs === 'function') {
top.Backend.api.closetabs();
return true;
} else if (typeof Backend !== 'undefined' && Backend.api && typeof Backend.api.closetabs === 'function') {
Backend.api.closetabs();
return true;
} else if (window.history.length > 1) {
window.history.back();
return true;
} else {
window.location.href = Fast.api.fixurl('shopro/app/score_shop');
return false;
}
}
function onCancel() {
closeCurrentTab();
}
function onConfirm() {
let cleanedPrices = (goods.score_sku_prices || []).map(item => {
let clone = { ...item };
@@ -212,18 +256,39 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
type: 'POST',
data: submitForm,
}, function (ret, res) {
Fast.api.close()
try {
var iframes = top && top.$ ? top.$("iframe[src*='shopro/app/score_shop']") : null;
if (iframes && iframes.length) {
iframes.each(function () {
try {
if (this.contentWindow && this.contentWindow !== window) {
if (typeof this.contentWindow.location.reload === 'function') {
this.contentWindow.location.reload();
}
}
} catch (err) {}
});
}
} catch (e) {}
setTimeout(() => {
closeCurrentTab();
}, 300);
return false;
}, function (ret, res) { })
}
onMounted(() => {
getSkus()
if (state.goods_id) {
getSkus()
}
})
return {
state,
goods,
onConfirm
onConfirm,
onCancel
}
}
}

查看文件

@@ -281,26 +281,28 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
})
}
function openTab(url, title, icon) {
if (top && top.Backend && top.Backend.api && typeof top.Backend.api.addtabs === 'function') {
top.Backend.api.addtabs(url, title, icon);
} else if (typeof Backend !== 'undefined' && Backend.api && typeof Backend.api.addtabs === 'function') {
Backend.api.addtabs(url, title, icon);
} else if (Fast && Fast.api && typeof Fast.api.addtabs === 'function') {
Fast.api.addtabs(url, title, icon);
} else if (top && top.Fast && top.Fast.api && typeof top.Fast.api.addtabs === 'function') {
top.Fast.api.addtabs(url, title, icon);
} else {
window.location.href = Fast.api.fixurl(url);
}
}
function onAdd() {
Fast.api.open("shopro/goods/goods/add?type=add", "添加", {
callback() {
getData()
}
})
openTab("shopro/goods/goods/add?type=add&ref=addtabs", "添加商品", "fa fa-plus");
}
function onEdit(id) {
Fast.api.open(`shopro/goods/goods/edit?type=edit&id=${id}`, "编辑", {
callback() {
getData()
}
})
openTab(`shopro/goods/goods/edit/id/${id}?type=edit&id=${id}&ref=addtabs`, `编辑商品 #${id}`, "fa fa-pencil");
}
function onCopy(id) {
Fast.api.open(`shopro/goods/goods/add?type=copy&id=${id}`, "复制", {
callback() {
getData()
}
})
openTab(`shopro/goods/goods/add?type=copy&id=${id}&ref=addtabs`, `复制商品 #${id}`, "fa fa-copy");
}
function onDelete(id) {
Fast.api.ajax({
@@ -386,8 +388,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
const { proxy } = getCurrentInstance();
const state = reactive({
type: new URLSearchParams(location.search).get('type'),
id: new URLSearchParams(location.search).get('id'),
type: new URLSearchParams(location.search).get('type') || (location.pathname.indexOf('add') !== -1 ? 'add' : 'edit'),
id: new URLSearchParams(location.search).get('id') || (location.pathname.match(/\/id\/(\d+)/) ? location.pathname.match(/\/id\/(\d+)/)[1] : ''),
activeStep: 0,
tempData: {
isStockWarning: false,
@@ -470,6 +472,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
$editor.summernote('code', form.model.content);
}
}
$editor.next('.note-editor').find('.note-editable').css({
'min-height': '600px',
'height': '620px'
});
return;
}
@@ -481,8 +487,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
if ($editor.next('.note-editor').length === 0 && typeof $.fn.summernote !== 'undefined') {
var options = (window.Config && window.Config.summernote) || {};
$editor.summernote($.extend(true, {
height: parseInt(options.height || 300),
minHeight: parseInt(options.minHeight || 250),
height: parseInt(options.height || 620),
minHeight: parseInt(options.minHeight || 550),
lang: 'zh-CN',
dialogsInBody: true
}, $editor.data("summernote-options") || {}));
@@ -490,6 +496,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
$editor.summernote('code', form.model.content);
}
}
if ($editor.next('.note-editor').length > 0) {
$editor.next('.note-editor').find('.note-editable').css({
'min-height': '600px',
'height': '620px'
});
}
}, 150);
}
@@ -1020,13 +1032,68 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
type: 'POST',
data: submitForm
}, function (ret, res) {
Fast.api.close()
// 1. 如果是在弹窗中打开,调用弹窗关闭
if (parent && parent.Layer && typeof parent.Layer.getFrameIndex === 'function') {
try {
var index = parent.Layer.getFrameIndex(window.name);
if (index) {
Fast.api.close();
return false;
}
} catch (e) {}
}
// 2. 如果是在 Tab 选项卡中打开:刷新商品列表并关闭当前选项卡
try {
if (top && top.window) {
var goodsIframes = top.window.$("iframe[src*='shopro/goods/goods']");
goodsIframes.each(function () {
try {
if (this.contentWindow && this.contentWindow !== window) {
if (typeof this.contentWindow.location.reload === 'function') {
this.contentWindow.location.reload();
}
}
} catch (err) {}
});
}
} catch (e) {}
setTimeout(() => {
if (top && top.Backend && top.Backend.api && typeof top.Backend.api.closetabs === 'function') {
top.Backend.api.closetabs();
} else if (typeof Backend !== 'undefined' && Backend.api && typeof Backend.api.closetabs === 'function') {
Backend.api.closetabs();
} else {
window.location.href = Fast.api.fixurl('shopro/goods/goods');
}
}, 300);
return false;
}, function (ret, res) { })
}
}, 500)
}
function onCancel() {
if (parent && parent.Layer && typeof parent.Layer.getFrameIndex === 'function') {
try {
var index = parent.Layer.getFrameIndex(window.name);
if (index) {
parent.Layer.close(index);
return;
}
} catch (e) {}
}
if (top && top.Backend && top.Backend.api && typeof top.Backend.api.closetabs === 'function') {
top.Backend.api.closetabs();
} else if (typeof Backend !== 'undefined' && Backend.api && typeof Backend.api.closetabs === 'function') {
Backend.api.closetabs();
} else {
window.history.back();
}
}
onBeforeMount(() => {
getCategorySelect(true)
getServiceSelect()
@@ -1069,7 +1136,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
onAddParams,
onDeleteParams,
onSuccess,
onConfirm
onConfirm,
onCancel
}
}
}

查看文件

@@ -62,7 +62,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{ label: '区县代平级奖', value: 'county_peer' },
{ label: '酒道馆加权奖', value: 'venue_share' },
{ label: '区县加权奖', value: 'county_share' },
{ label: '每日贡献dmepa', value: 'madow_share' },
{ label: '每日获得dmepa', value: 'madow_share' },
{ label: '消费补贴发放', value: 'voucher_grant' },
{ label: '消费补贴到账', value: 'voucher_release' },
]

查看文件

@@ -561,7 +561,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
const assetUnit = computed(() => {
const map = {
money: '元',
madow: '颗',
madow: '枚',
score: '积分',
voucher: '元'
};