|
|
var $ = require('jquery'),
|
|
|
common = require('../../../common/common');
|
|
|
|
|
|
var ENUM = {
|
|
|
recommendOrderPage: ["否","是"]
|
|
|
};
|
|
|
|
|
|
var g = new common.grid({
|
|
|
el: '#payment-list',
|
|
|
columns: [
|
|
|
{display: "ID", name: "id"},
|
|
|
{display: '支付方式名称', name: "payName"},
|
|
|
{display: '推荐到确认订单页', render: function (item) {
|
|
|
var rop = ENUM.recommendOrderPage[item.recommendOrderPage];
|
|
|
return item.recommendOrderPage == 1 ? rop+"("+item.recommendWords+")" : rop;
|
|
|
}},
|
|
|
{display: "前端排序", name: "sortNumber"},
|
|
|
{display: "推荐语1", name: "recommendText1"},
|
|
|
{display: "推荐语2", name: "recommendText2"},
|
|
|
{display: '操作', render: function (item) {
|
|
|
var HtmArr = [];
|
|
|
HtmArr.push('<a href="javascript:" class="btn btn-info btn-xs edit-btn">编辑</a>');
|
|
|
if(item.status == 1){
|
|
|
HtmArr.push('<a href="javascript:" class="btn btn-danger btn-xs close-btn">关闭</a>');
|
|
|
}else{
|
|
|
HtmArr.push('<a href="javascript:" class="btn btn-success btn-xs open-btn">开启</a>');
|
|
|
}
|
|
|
return HtmArr.join('');
|
|
|
}}
|
|
|
]
|
|
|
});
|
|
|
|
|
|
g.init("/Payment/findPayManageList");
|
|
|
|
|
|
//编辑
|
|
|
$(document).on("click", ".edit-btn", function () {
|
|
|
new common.dialog({
|
|
|
title: "支付方式编辑",
|
|
|
width: "50%",
|
|
|
content: common.util.__template2($("#template").html(), {}),
|
|
|
button: [
|
|
|
{value: "确认", css:"btn-primary", callback: function () {
|
|
|
|
|
|
}},
|
|
|
{value: "取消", css:"btn-default"}
|
|
|
]
|
|
|
});
|
|
|
|
|
|
common.util.__ajax({
|
|
|
url: '/Payment/findPayInfoById',
|
|
|
data: {id: obj.id}
|
|
|
}, function () {
|
|
|
|
|
|
}, true)
|
|
|
});
|
|
|
|
|
|
//开启
|
|
|
$(document).on("click", ".open-btn", function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/Payment/openPayModeById',
|
|
|
data: {id: obj.id}
|
|
|
}, function () {
|
|
|
g.reload();
|
|
|
})
|
|
|
});
|
|
|
|
|
|
//关闭
|
|
|
$(document).on("click", ".close-btn", function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/Payment/closePayModeById',
|
|
|
data: {id: obj.id}
|
|
|
}, function () {
|
|
|
g.reload();
|
|
|
})
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|