feat: 初始化雄戈商城服务端代码与Webhook自动部署配置
这个提交包含在:
@@ -0,0 +1,50 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'form'], function ($, undefined, Backend, Form) {
|
||||
var Controller = {
|
||||
index: function () {
|
||||
new Vue({
|
||||
el: '#huifuConfigIndex',
|
||||
data: {
|
||||
form: {
|
||||
status: '1',
|
||||
env: 'test',
|
||||
miniprogram_channel: 'yansongda',
|
||||
sys_id: '',
|
||||
product_id: '',
|
||||
huifu_id: '',
|
||||
upper_huifu_id: '',
|
||||
merchant_private_key: '',
|
||||
huifu_public_key: '',
|
||||
time_expire: '',
|
||||
pay_scene: '',
|
||||
channel_no: '',
|
||||
goods_desc_tpl: '商城订单{order_sn}',
|
||||
notify_url: '',
|
||||
refund_notify_url_display: '',
|
||||
mini_program_app_id: '',
|
||||
onboard_required: '1',
|
||||
onboard_settle_cycle: 'D1',
|
||||
onboard_settle_batch_no: '300',
|
||||
onboard_notify_url: ''
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
$.getJSON('shopro_huifu/config/index', function (ret) {
|
||||
if (ret.code === 1 && ret.data) {
|
||||
vm.form = Object.assign(vm.form, ret.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
save: function () {
|
||||
var vm = this;
|
||||
$.post('shopro_huifu/config/save', { row: vm.form }, function (ret) {
|
||||
Backend.api.toastr[ret.code === 1 ? 'success' : 'error'](ret.msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
@@ -0,0 +1,161 @@
|
||||
define(['jquery', 'bootstrap', 'backend'], function ($, undefined, Backend) {
|
||||
|
||||
function withVue(callback) {
|
||||
if (typeof Vue !== 'undefined') {
|
||||
callback(Vue);
|
||||
return;
|
||||
}
|
||||
require.config({
|
||||
paths: {
|
||||
'vue': '../addons/shopro/libs/vue',
|
||||
'ELEMENT': '../addons/shopro/libs/element/element'
|
||||
},
|
||||
shim: {
|
||||
'ELEMENT': {
|
||||
deps: ['css!../addons/shopro/libs/element/element.css', 'vue']
|
||||
}
|
||||
}
|
||||
});
|
||||
require(['vue', 'ELEMENT'], function (Vue, ELEMENT) {
|
||||
Vue.use(ELEMENT);
|
||||
callback(Vue);
|
||||
});
|
||||
}
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
withVue(function (Vue) {
|
||||
new Vue({
|
||||
el: '#huifuOnboardIndex',
|
||||
data: {
|
||||
listData: [],
|
||||
loading: false,
|
||||
filterStatus: '',
|
||||
detailVisible: false,
|
||||
detailLoading: false,
|
||||
detailData: null,
|
||||
detailId: 0
|
||||
},
|
||||
computed: {
|
||||
previewList: function () {
|
||||
if (!this.detailData || !this.detailData.form) {
|
||||
return [];
|
||||
}
|
||||
var f = this.detailData.form;
|
||||
return [f.id_card_front_url, f.id_card_back_url, f.bank_card_url].filter(function (u) { return !!u; });
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList: function () {
|
||||
var vm = this;
|
||||
vm.loading = true;
|
||||
Fast.api.ajax({
|
||||
url: 'shopro_huifu/onboard/index',
|
||||
type: 'GET',
|
||||
data: { limit: 200, status: vm.filterStatus }
|
||||
}, function (ret, res) {
|
||||
vm.listData = (res.data && res.data.rows) || [];
|
||||
vm.loading = false;
|
||||
return false;
|
||||
}, function () {
|
||||
vm.loading = false;
|
||||
});
|
||||
},
|
||||
openDetail: function (id) {
|
||||
var vm = this;
|
||||
vm.detailId = id;
|
||||
vm.detailVisible = true;
|
||||
vm.detailLoading = true;
|
||||
vm.detailData = null;
|
||||
Fast.api.ajax({
|
||||
url: 'shopro_huifu/onboard/index',
|
||||
type: 'GET',
|
||||
data: { detail_id: id }
|
||||
}, function (ret, res) {
|
||||
vm.detailData = res.data || null;
|
||||
vm.detailLoading = false;
|
||||
return false;
|
||||
}, function () {
|
||||
vm.detailLoading = false;
|
||||
});
|
||||
},
|
||||
goAudit: function (url) {
|
||||
if (!url) return;
|
||||
Backend.api.addtabs(url, '业务审核');
|
||||
},
|
||||
submitRow: function (id) {
|
||||
var vm = this;
|
||||
Layer.confirm('确认资料无误并提交汇付进件?', function (index) {
|
||||
Layer.close(index);
|
||||
Fast.api.ajax({ url: 'shopro_huifu/onboard/submit/ids/' + id, type: 'POST' }, function () {
|
||||
vm.getList();
|
||||
if (vm.detailVisible && vm.detailId === id) {
|
||||
vm.openDetail(id);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
pollRow: function (id) {
|
||||
var vm = this;
|
||||
Fast.api.ajax({ url: 'shopro_huifu/onboard/poll/ids/' + id, type: 'POST' }, function () {
|
||||
vm.getList();
|
||||
if (vm.detailVisible && vm.detailId === id) {
|
||||
vm.openDetail(id);
|
||||
}
|
||||
});
|
||||
},
|
||||
retryRow: function (id) {
|
||||
var vm = this;
|
||||
Fast.api.ajax({ url: 'shopro_huifu/onboard/retry/ids/' + id, type: 'POST' }, function () {
|
||||
vm.getList();
|
||||
if (vm.detailVisible && vm.detailId === id) {
|
||||
vm.openDetail(id);
|
||||
}
|
||||
});
|
||||
},
|
||||
submitFromDetail: function () {
|
||||
if (this.detailId) {
|
||||
this.submitRow(this.detailId);
|
||||
}
|
||||
},
|
||||
pollFromDetail: function () {
|
||||
if (this.detailId) {
|
||||
this.pollRow(this.detailId);
|
||||
}
|
||||
},
|
||||
retryFromDetail: function () {
|
||||
if (this.detailId) {
|
||||
this.retryRow(this.detailId);
|
||||
}
|
||||
},
|
||||
statusText: function (status) {
|
||||
var map = {
|
||||
draft: '待后台审核',
|
||||
submitting: '提交中',
|
||||
basic_ok: '开户成功',
|
||||
busi_pending: '汇付审核中',
|
||||
approved: '已通过',
|
||||
rejected: '已驳回',
|
||||
failed: '失败'
|
||||
};
|
||||
return map[status] || status || '-';
|
||||
},
|
||||
roleText: function (role) {
|
||||
return role === 'regional_agent' ? '区域代理' : (role === 'promoter' ? '推广员' : role);
|
||||
},
|
||||
formatTime: function (ts) {
|
||||
if (!ts) return '-';
|
||||
var d = new Date(ts * 1000);
|
||||
var p = function (n) { return n < 10 ? '0' + n : n; };
|
||||
return d.getFullYear() + '-' + p(d.getMonth() + 1) + '-' + p(d.getDate()) + ' ' + p(d.getHours()) + ':' + p(d.getMinutes());
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户