feat: 初始化雄戈商城服务端代码与Webhook自动部署配置
这个提交包含在:
@@ -0,0 +1,21 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'form'], function ($, undefined, Backend, Form) {
|
||||
return {
|
||||
index: function () {
|
||||
new Vue({
|
||||
el: '#splitConfigIndex',
|
||||
data: { form: { split_enable: '0', split_mode: 'wechat', split_provider: 'auto', delay_acct_enable: '0', split_timing: 'payed', split_amount_source: 'mixed', split_max_rate: '30', platform_receiver_account: '', platform_huifu_id: '', platform_receiver_name: '平台' } },
|
||||
mounted() {
|
||||
Fast.api.ajax({ url: 'shopro/split/config/index', type: 'GET' }, (ret, res) => {
|
||||
this.form = Object.assign(this.form, res.data || {});
|
||||
return false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
Fast.api.ajax({ url: 'shopro/split/config/save', type: 'POST', data: { row: this.form } });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'form'], function ($, undefined, Backend, Form) {
|
||||
return {
|
||||
index: function () {
|
||||
new Vue({
|
||||
el: '#splitOrderIndex',
|
||||
data: { listData: [], loading: false },
|
||||
mounted() { this.getList(); },
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
Fast.api.ajax({ url: 'shopro/split/order/index', type: 'GET', data: { limit: 50, sort: 'id', order: 'desc' } }, (ret, res) => {
|
||||
this.listData = (res.data && res.data.rows) || [];
|
||||
this.loading = false;
|
||||
return false;
|
||||
}, () => { this.loading = false; });
|
||||
},
|
||||
retry(id) { Fast.api.ajax({ url: 'shopro/split/order/retry/ids/' + id, type: 'POST' }, () => this.getList()); },
|
||||
query(id) { Fast.api.ajax({ url: 'shopro/split/order/query/ids/' + id, type: 'POST' }, () => this.getList()); },
|
||||
statusText(s) { return { 0: '待分账', 1: '分账中', 2: '成功', 3: '部分成功', 4: '失败' }[s] || '-'; }
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'form'], function ($, undefined, Backend, Form) {
|
||||
var Controller = {
|
||||
index: function () {
|
||||
new Vue({
|
||||
el: '#splitReceiverIndex',
|
||||
data: { listData: [], loading: false },
|
||||
mounted() { this.getList(); },
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
Fast.api.ajax({ url: 'shopro/split/receiver/index', type: 'GET', data: { limit: 100 } }, (ret, res) => {
|
||||
this.listData = (res.data && res.data.rows) || [];
|
||||
this.loading = false;
|
||||
return false;
|
||||
}, () => { this.loading = false; });
|
||||
},
|
||||
openAdd() { Backend.api.open('shopro/split/receiver/add', '添加接收方', { callback: () => this.getList() }); },
|
||||
syncWx(id) { Fast.api.ajax({ url: 'shopro/split/receiver/syncWx/ids/' + id, type: 'POST' }, () => this.getList()); },
|
||||
wxStatusText(s) { return { 0: '待同步', 1: '已同步', 2: '失败' }[s] || '-'; },
|
||||
channelText(c) { return c === 'huifu' ? '汇付' : '微信'; },
|
||||
roleTypeText(type) {
|
||||
const map = {
|
||||
platform: '平台',
|
||||
promoter: '推广员',
|
||||
regional_agent: '区域公司',
|
||||
};
|
||||
return map[type] || type;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
add: function () { Form.api.bindevent($('form[role=form]')); }
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'form'], function ($, undefined, Backend, Form) {
|
||||
var Controller = {
|
||||
index: function () {
|
||||
new Vue({
|
||||
el: '#splitRuleIndex',
|
||||
data: { listData: [], loading: false },
|
||||
mounted() { this.getList(); },
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
Fast.api.ajax({ url: 'shopro/split/rule/index', type: 'GET', data: { limit: 100 } }, (ret, res) => {
|
||||
this.listData = (res.data && res.data.rows) || [];
|
||||
this.loading = false;
|
||||
return false;
|
||||
}, () => { this.loading = false; });
|
||||
},
|
||||
openEdit(id) { Backend.api.open('shopro/split/rule/edit/ids/' + id, '编辑规则', { callback: () => this.getList() }); },
|
||||
roleTypeText(type) {
|
||||
const map = {
|
||||
platform: '平台',
|
||||
promoter: '推广员',
|
||||
regional_agent: '区域公司',
|
||||
};
|
||||
return map[type] || type;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
edit: function () { Form.api.bindevent($('form[role=form]')); }
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户