UNPKG

jdc_dkh_jxicustomer

Version:

JDC_dkh_jxicustomer ==== 产品经理:田宇,弥磊 设计:罗婷 交互:张钊

140 lines (137 loc) 5.24 kB
seajs.use(['//misc.360buyimg.com/virtuals/popui/2.1.6/js/pagination/pagination'], function() { $("#pagination").pagination({ total: 2000, pageSize: 10, // 每页显示的条目数 currentPage: 0, viewSize: 5, // 连续分页主体部分显示的分页条目数 edgeSize: 1, // 与起点的间隔 prevText: '&lt;', // “上一页”分页按钮上显示的文字 nextText: '&gt;', // “下一页”分页按钮上显示的文字 linkTo: 'javascript:;', // 分页的链接,默认是"#" ellipseText: '...', // 省略的页数用什么文字表示,默认是"..." callback: function(index, el) { console.log(index); console.log(el); state.page = index + 1; showOrder.getOrder(); } }); }) seajs.use('./../js/dialog', function(dialog) { $('.remove').on('click', function() { dialog.comfirmWithIcon({ title: '确认删除', content: '是否确认删除此次积分分配方式?', sure: function () { }, }) }) $('.edit').on('click', function() { dialog.deposit({ sure: function() { } }) var ipt=document.getElementById('ipt'); var ul=document.getElementById('chooseType'); var chat = $('.chat'); var lis=ul.children; ipt.onfocus=function(){ ul.style.display='block'; chat.removeClass('chat-down'); chat.addClass('chat-up'); } ipt.onblur=function(){ setTimeout(function(){ ul.style.display='none'; chat.removeClass('chat-up'); chat.addClass('chat-down'); },200) } //模拟option点击事件 $('ul').on('click', 'li', function() { ipt.value=this.innerText; }) // for(var i=0;i<lis.length;i++){ // lis[i].onclick=function(){ // ipt.value=this.innerText; // } // } $('ul').on("click", ".icon-bin",function() { var $this = $(this); var name = $this.siblings('a').html(); dialog.comfirmWithIcon({ title: '确认删除', content: `确认删除“${name}”吗?`, sure: function () { $this.parent().remove(); $('#ipt').val(''); } }) }) $('.add').on("click", function() { var $this = $(this); // var name = $this.siblings('a').html(); dialog.addText({ title: '添加积分类型', textContent: '输入积分类型名称', sure: function() { debugger var tar = $('#setType-inp').val(); var str = `<li><a href="javascript:;">${tar}</a> <span class="icon-bin"></span></li>`; $('#chooseType').append(str); $('#ipt').val(tar); } }) }) }) $('body').on('click', '.tabs', function () { $this = $(this); _name = $(this).attr('name'); $this.addClass('selected'); $this.siblings().removeClass('selected'); $('.tabs-container').hide(); $('.tabs-container[name='+ _name +']').show(); }) $('.deposit-immediately').on('click', function() { dialog.comfirmWithIcon({ title: '您还未设置支付密码', content: '请在设置支付密码后重新进行积分分配', sure: function () { if(dia) { dia.show(); } else { var dia = dialog.setPwd({ title: '设置支付密码', sure: function () { dialog.comfirmWithIcon({ title: '积分不足', hasCancel: false, content: '您的积分不足,请重新修改分配方式', sure: function () { dialog.inPwd({ title: '请输入支付密码', sure: function() { dialog.comfirmWithIcon({ title: '发放成功', hasCancel: false, content: '已成功向XXX名员工发放XXX积分。', sure: function () { }, }) } }) }, }) } }) } } }) }) $('.view').on('click', function() { dialog.viewFile({ title: '查看审批文件', content: '兑换通:春节福利 创建时间:2018-6-18 申请账号:采购员2 提交文件时间:2018-6-18' }) }) })