文件
xionggeshop/public/assets/js/backend/shopro_huifu/config.js

51 行
1.9 KiB
JavaScript

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;
});