init commit
This commit is contained in:
14
public/assets/js/backend/wdsxh/points/config.js
Normal file
14
public/assets/js/backend/wdsxh/points/config.js
Normal file
@@ -0,0 +1,14 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
52
public/assets/js/backend/wdsxh/points/express.js
Normal file
52
public/assets/js/backend/wdsxh/points/express.js
Normal file
@@ -0,0 +1,52 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/points/express/index' + location.search,
|
||||
add_url: 'wdsxh/points/express/add',
|
||||
edit_url: 'wdsxh/points/express/edit',
|
||||
del_url: 'wdsxh/points/express/del',
|
||||
import_url: 'wdsxh/points/express/import',
|
||||
table: 'wdsxh_points_express',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
135
public/assets/js/backend/wdsxh/points/goods.js
Normal file
135
public/assets/js/backend/wdsxh/points/goods.js
Normal file
@@ -0,0 +1,135 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/points/goods/index' + location.search,
|
||||
add_url: 'wdsxh/points/goods/add',
|
||||
edit_url: 'wdsxh/points/goods/edit',
|
||||
del_url: 'wdsxh/points/goods/del',
|
||||
multi_url: 'wdsxh/points/goods/multi',
|
||||
import_url: 'wdsxh/points/goods/import',
|
||||
table: 'wdsxh_points_goods',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'weigh',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'points', title: __('Points'), operate: false},
|
||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||
{field: 'status', title: __('Status'), searchList: {"normal":__('Status normal'),"hidden":__('Status hidden')}, formatter: Table.api.formatter.status},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
recyclebin: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
'dragsort_url': ''
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: 'wdsxh/points/goods/recyclebin' + location.search,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), align: 'left'},
|
||||
{
|
||||
field: 'deletetime',
|
||||
title: __('Deletetime'),
|
||||
operate: 'RANGE',
|
||||
addclass: 'datetimerange',
|
||||
formatter: Table.api.formatter.datetime
|
||||
},
|
||||
{
|
||||
field: 'operate',
|
||||
width: '140px',
|
||||
title: __('Operate'),
|
||||
table: table,
|
||||
events: Table.api.events.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'Restore',
|
||||
text: __('Restore'),
|
||||
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
|
||||
icon: 'fa fa-rotate-left',
|
||||
url: 'wdsxh/points/goods/restore',
|
||||
refresh: true
|
||||
},
|
||||
{
|
||||
name: 'Destroy',
|
||||
text: __('Destroy'),
|
||||
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
|
||||
icon: 'fa fa-times',
|
||||
url: 'wdsxh/points/goods/destroy',
|
||||
refresh: true
|
||||
}
|
||||
],
|
||||
formatter: Table.api.formatter.operate
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
var form = $("form[role=form]");
|
||||
|
||||
// 先拦截提交按钮的点击事件(优先级最高)
|
||||
form.find("button[type='submit']").on("click", function(e) {
|
||||
var points = parseFloat($("#c-points").val());
|
||||
|
||||
if (isNaN(points) || points <= 0) {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
Layer.msg('积分必须大于0', {icon: 2, time: 2000});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// 绑定表单事件
|
||||
Form.api.bindevent(form);
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
81
public/assets/js/backend/wdsxh/points/order.js
Normal file
81
public/assets/js/backend/wdsxh/points/order.js
Normal file
@@ -0,0 +1,81 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/points/order/index' + location.search,
|
||||
table: 'wdsxh_points_order',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
|
||||
{field: 'goods_info.name', title: __('Goods_info.name'), operate: false},
|
||||
{field: 'goods_info.image', title: __('Goods_info.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'points', title: __('Goods_info.points'), operate: false},
|
||||
{field: 'number', title: __('Number')},
|
||||
{field: 'real_name', title: __('Real_name'), operate: 'LIKE'},
|
||||
{field: 'user_phone', title: __('User_phone'), operate: 'LIKE'},
|
||||
{field: 'user_address', title: __('User_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'state', title: __('State'), searchList: {"2":__('State 2'),"3":__('State 3'),"4":__('State 4')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'total_points', title: __('Total_points')},
|
||||
{field: 'redemption_time', title: __('Redemption_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,buttons:[
|
||||
{
|
||||
name: 'delivery',
|
||||
text:'发货',
|
||||
classname: 'btn btn-xs btn-primary btn-dialog bg-aqua',
|
||||
icon: 'fa',
|
||||
extend:'data-area=["80%","80%"]',
|
||||
url: 'wdsxh/points/order/delivery',
|
||||
visible:function(row){
|
||||
if(row['state']==2){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
refresh:true
|
||||
},
|
||||
{
|
||||
text:'订单详情',
|
||||
name: 'details',
|
||||
title: '订单详情',
|
||||
classname: 'btn btn-xs btn-primary btn-dialog bg-aqua',
|
||||
icon: 'fa',
|
||||
url: 'wdsxh/points/order/details',
|
||||
extend:'data-area=["95%","95%"]',
|
||||
},
|
||||
|
||||
]}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
delivery: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
98
public/assets/js/backend/wdsxh/points/ranking.js
Normal file
98
public/assets/js/backend/wdsxh/points/ranking.js
Normal file
@@ -0,0 +1,98 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/points/ranking/index' + location.search,
|
||||
table: 'wdsxh_user_wechat_points_log',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
commonSearch: false,
|
||||
visible: true,
|
||||
showToggle: false,
|
||||
showColumns: true,
|
||||
search:false,
|
||||
showExport: true,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('会员Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
|
||||
{field: 'level.name', title: __('Level.name'), operate: 'LIKE'},
|
||||
{field: 'wechat.points', title: __('Points'), operate: false},
|
||||
// {field: 'before', title: __('Before')},
|
||||
// {field: 'after', title: __('After')},
|
||||
// {field: 'memo', title: __('Memo'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons:[
|
||||
{
|
||||
name: 'list',
|
||||
text: __('积分日志'),
|
||||
title: __('积分日志'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: 'wdsxh/points/user_wechat_points_log/index?wechat_id={wechat_id}',
|
||||
callback: function (data) {
|
||||
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
|
||||
},
|
||||
visible: function (row) {
|
||||
//返回true时按钮显示,返回false隐藏
|
||||
return true;
|
||||
},
|
||||
extend: 'data-area=["70%","70%"]',
|
||||
},
|
||||
{
|
||||
name: 'agree',
|
||||
text: __('一键清零'),
|
||||
title: __('一键清零'),
|
||||
classname: 'btn btn-xs btn-info btn-magic btn-ajax',
|
||||
icon: 'fa fa-check',
|
||||
url: 'wdsxh/points/ranking/one_click_reset',
|
||||
confirm: '确认一键清零?操作后将清零',
|
||||
visible:function (row){
|
||||
if(row.wechat.points > 0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$("#table").bootstrapTable('refresh',{});
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Toastr.error(ret.msg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
one_click_reset: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
@@ -0,0 +1,50 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/points/user_wechat_points_log/index' + location.search,
|
||||
table: 'wdsxh_user_wechat_points_log',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
commonSearch: false,
|
||||
visible: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
search:false,
|
||||
showExport: false,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'points', title: __('Points')},
|
||||
{field: 'before', title: __('Before')},
|
||||
{field: 'after', title: __('After')},
|
||||
{field: 'memo', title: __('Memo'), operate: 'LIKE', table: table, class: 'autocontent'},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'change', title: __('Change'), searchList: {"1":__('Change 1'),"2":__('Change 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'source', title: __('Source'), searchList: {"1":__('Source 1'),"2":__('Source 2'),"3":__('Source 3'),"4":__('Source 4'),"5":__('Source 5')}, formatter: Table.api.formatter.normal},
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
Reference in New Issue
Block a user