123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
-
- Table.api.init({
- extend: {
- index_url: 'user/user/index',
-
-
-
- multi_url: 'user/user/multi',
- table: 'user',
- }
- });
- var table = $("#table");
-
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'user.id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id'), sortable: true},
-
- {field: 'username', title: __('Username'), operate: 'LIKE'},
-
-
- {field: 'mobile', title: __('手机号'), operate: 'LIKE'},
-
- {field: 'gender', title: __('性别'), formatter:Table.api.formatter.normal, searchList:{1:'男',0:'女'}},
- {field: 'avatar_new', title: __('头像'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
- {field: 'real_image', title: __('认证照片'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
-
-
-
-
-
-
-
-
-
-
-
-
-
- {field: 'maxsuccessions', title: __('Maxsuccessions'), visible: false, operate: 'BETWEEN', sortable: true},
-
-
-
-
- {field: 'image_audit', title: __('审核状态'), formatter: Table.api.formatter.status, searchList: {0: __('待审核'), 1: __('通过'), 2: __('驳回')}},
-
-
- {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
- buttons:[
- {
- name:'image_audit',
- text:'通过',
- title:'通过审核',
- confirm:'确定通过审核?',
- url:'user/head/audit/audit/1',
- classname: 'btn btn-xs btn-success btn-ajax',
- visible:function (row){
- if(row.image_audit == 0){
- return true;
- }
- },
- success:function (){
- table.bootstrapTable('refresh');
- }
- },
- {
- name:'image_audit',
- text:'驳回',
- title:'驳回审核',
-
-
-
- classname: 'btn btn-xs btn-danger btn-click',
- visible:function (row){
- if(row.image_audit == 0){
- return true;
- }
- },
-
-
-
- click: function (e, row) {
- Layer.prompt({
- title: "驳回理由",
- success: function (layero) {
- $("input", layero).prop("placeholder", "填写驳回理由");
- }
- }, function (value) {
- Fast.api.ajax({
- url: "user/head/audit/audit/" + 2 + "/ids/" + row.id,
- data:{
- 'avatar_reason':value
- }
- }, function (data, ret) {
- console.log(1);
- $(".btn-refresh").trigger("click");
- Layer.closeAll();
- });
- });
- return false;
- }
- },
- ]
- }
- ]
- ]
- });
-
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- },
- custom: function (value, row, index) {
-
- return '<a class="btn-change text-success" data-url="user/user/change" data-confirm="确认切换状态?" data-id="' + row.id + '"><i class="fa ' + (row.is_recommend == '0' ? 'fa-toggle-on fa-flip-horizontal text-gray' : 'fa-toggle-on') + ' fa-2x"></i></a>';
- },
- }
- };
- return Controller;
- });
|