feat(agent): 分销商详情改为在后台独立新页面选项卡中打开
这个提交包含在:
@@ -232,12 +232,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
|
||||
function onDetail(id) {
|
||||
Fast.api.open(`shopro/commission/agent/detail/id/${id}?id=${id}`, "详情", {
|
||||
callback() {
|
||||
getData()
|
||||
}
|
||||
})
|
||||
function onDetail(id, row) {
|
||||
const url = `shopro/commission/agent/detail/id/${id}?id=${id}`;
|
||||
const title = (row && row.user && row.user.nickname)
|
||||
? `分销商详情 - ${row.user.nickname}`
|
||||
: `分销商详情 #${id}`;
|
||||
if (typeof Backend !== 'undefined' && Backend.api && typeof Backend.api.addtabs === 'function') {
|
||||
Backend.api.addtabs(url, title);
|
||||
} else if (top && top.Backend && top.Backend.api && typeof top.Backend.api.addtabs === 'function') {
|
||||
top.Backend.api.addtabs(url, title);
|
||||
} else if (Fast && Fast.api && typeof Fast.api.addtabs === 'function') {
|
||||
Fast.api.addtabs(url, title);
|
||||
} else {
|
||||
window.location.href = Fast.api.fixurl(url);
|
||||
}
|
||||
}
|
||||
|
||||
const identity = reactive({
|
||||
@@ -402,11 +410,32 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
const detail = {
|
||||
setup() {
|
||||
|
||||
const queryAgentId = (typeof Config !== 'undefined' && (Config.id || Config.agent_id || Config.user_id))
|
||||
? (Config.id || Config.agent_id || Config.user_id)
|
||||
: (new URLSearchParams(location.search).get('id') || (location.pathname.match(/\/id\/(\d+)/i) || [])[1] || Fast.api.query('id'));
|
||||
|
||||
const state = reactive({
|
||||
id: new URLSearchParams(location.search).get('id'),
|
||||
id: queryAgentId,
|
||||
data: {},
|
||||
})
|
||||
|
||||
function onBack() {
|
||||
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 {
|
||||
window.history.back();
|
||||
}
|
||||
}
|
||||
|
||||
function getDetail() {
|
||||
Fast.api.ajax({
|
||||
url: `shopro/commission/agent/detail/id/${state.id}`,
|
||||
@@ -658,6 +687,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
onChangeTab,
|
||||
pagination,
|
||||
countCommission,
|
||||
onBack,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,6 +214,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
});
|
||||
}
|
||||
|
||||
function onOpenAgentDetail(id) {
|
||||
const url = `shopro/commission/agent/detail/id/${id}?id=${id}`;
|
||||
const title = `分销商详情 #${id}`;
|
||||
if (typeof Backend !== 'undefined' && Backend.api && typeof Backend.api.addtabs === 'function') {
|
||||
Backend.api.addtabs(url, title);
|
||||
} else if (top && top.Backend && top.Backend.api && typeof top.Backend.api.addtabs === 'function') {
|
||||
top.Backend.api.addtabs(url, title);
|
||||
} else if (Fast && Fast.api && typeof Fast.api.addtabs === 'function') {
|
||||
Fast.api.addtabs(url, title);
|
||||
} else {
|
||||
window.location.href = Fast.api.fixurl(url);
|
||||
}
|
||||
}
|
||||
|
||||
const log = reactive({
|
||||
tabActive: 'money',
|
||||
data: [],
|
||||
@@ -286,6 +300,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
onSave,
|
||||
onChangeParentUser,
|
||||
onRecharge,
|
||||
onOpenAgentDetail,
|
||||
log,
|
||||
getLog,
|
||||
pagination,
|
||||
|
||||
在新工单中引用
屏蔽一个用户