123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
-
- Table.api.init({
- extend: {
- index_url: 'agent/index' + location.search,
- add_url: 'agent/add',
- edit_url: 'agent/edit',
- multi_url: 'agent/multi',
- import_url: 'agent/import',
- table: 'user',
- }
- });
- var table = $("#table");
-
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'usergroup.name', title: __('Usergroup.name'), operate: 'LIKE'},
- {field: 'intro_uid', title: __('Intro_uid')},
- {field: 'agent_id', title: __('Agent_id')},
- {field: 'yaoqingtime', title: __('Yaoqingtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'username', title: __('Username'), operate: 'LIKE'},
- {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
- {field: 'agentname', title: __('Agentname'), operate: 'LIKE'},
- {field: 'introcode', title: __('Introcode'), operate: 'LIKE'},
- {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
- {field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'gender', title: __('Gender'), searchList: {"-1":__('Gender -1'),"1":__('Gender 1'),"0":__('Gender 0')}, formatter: Table.api.formatter.normal},
- {field: 'userwallet.agentjewel', title: __('Userwallet.agentjewel'), operate:'BETWEEN'},
- {field: 'userwallet.status', title: __('Userwallet.status'), searchList: {"1":__('Userwallet.status 1'),"2":__('Userwallet.status 2')}, formatter: Table.api.formatter.status},
- {field: 'operate', title: __('Operate'), table: table,
- buttons:[
- {
- name:'updateagentjewel',
- text:'代理收益金币',
- title:'代理收益金币',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'agent/updateagentjewel/id/{ids}?dialog=1',
- target:'_self',
- },
- {
- name:'useragentjewellog',
- text:'收益明细',
- title:'收益明细',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'useragentjewellog/index/user_id/{ids}?dialog=1',
- target:'_self',
- },
- {
- name:'ribao',
- text:'日报',
- title:'日报',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'agent/ribao/authuid/{ids}?dialog=1',
- target:'_self',
- },
- {
- name:'all_user',
- text:'成员管理',
- title:'成员管理',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'agent/all_user/authuid/{ids}?dialog=1',
- target:'_self',
- },
- {
- name:'user_shouyi',
- text:'成员收入',
- title:'成员收入',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'agent/user_shouyi/authuid/{ids}?dialog=1',
- target:'_self',
- },
- ],
- events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
-
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- updateagentjewel: function () {
- Controller.api.bindevent();
- },
- ribao: function () {
- Controller.api.bindevent();
- },
- all_user: function () {
- Controller.api.bindevent();
- },
- user_shouyi: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
- $(document).on("change", "#c-group_id", function(){
- if($('#c-group_id').val() == 2){
- $('#paybox').show();
- }else{
- $('#paybox').hide();
- }
- });
- $(document).ready(function(){
- if($('#c-group_id').val() == 2){
- $('#paybox').show();
- }else{
- $('#paybox').hide();
- }
- })
|