| | |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TSite.close = function() { |
| | | parent.layer.close(window.parent.TSite.layerIndex); |
| | | } |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TSite.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键ID', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '省', field: 'insertTime', visible: true, align: 'center', valign: 'middle',width:'20%', |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '省', field: 'province', visible: true, align: 'center', valign: 'middle',width:'20%', |
| | | }, |
| | | {title: '市', field: 'name', visible: true, align: 'center', valign: 'middle', |
| | | {title: '市', field: 'city', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '姓名', field: 'insertUserId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'insertUser', visible: true, align: 'center', valign: 'middle', |
| | | {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '积分类型', field: 'province', visible: true, align: 'center', valign: 'middle', |
| | | {title: '积分类型', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return{1:"赠送积分", 2:"兑换商品",3:"完成课后练习",4:"观看教学视频",5:"启动游戏"}[data] |
| | | } |
| | | }, |
| | | {title: '积分明细', field: 'lineNum', visible: true, align: 'center', valign: 'middle', |
| | | {title: '积分明细', field: 'integral', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '变动类型', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | {title: '变动类型', field: 'category', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return{1:"增加", 2:"减少"}[data] |
| | | } |
| | | }, |
| | | {title: '时间', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | {title: '时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '备注', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle', |
| | | } |
| | | ]; |
| | | }; |
| | |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TSite.addSubmit = function () { |
| | | |
| | | var phonePattern = /^1[3-9]\d{9}$/; |
| | | if (!phonePattern.test($("#phone").val())) { |
| | | Feng.info("请输入合法手机号") |
| | | return ; |
| | | } |
| | | if ($("#phone").val()==""){ |
| | | Feng.error("请输入手机号!") |
| | | return; |
| | | } |
| | | if ($("#number").val()==""){ |
| | | Feng.error("请输入赠送积分!") |
| | | return; |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tIntegral/add", function(data){ |
| | | console.log("看看返回") |
| | | console.log(data) |
| | | if (data == 5001){ |
| | | Feng.error("不存在的手机号!") |
| | | }else{ |
| | | Feng.success("赠送成功!") |
| | | TSite.close(); |
| | | TSite.search(); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("phone",$("#phone").val()); |
| | | ajax.set("integral",$("#number").val()); |
| | | ajax.set("remark",$("#remark").val()); |
| | | ajax.start(); |
| | | |
| | | } |
| | | /** |
| | | * 点击添加跨城站点管理 |
| | | */ |
| | | TSite.openAddTSite = function () { |
| | | let language =1 |
| | | TSite.openAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'添加':(language==2?'Add':'Tambahkan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | title: language==1?'赠送积分':(language==2?'Add':'Tambahkan'), |
| | | area: ['60%', '60%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tSite/tSite_add' |
| | | content: Feng.ctxPath + '/tIntegral/tIntegral_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | |
| | | */ |
| | | TSite.search = function () { |
| | | var queryData = {}; |
| | | queryData['insertTime'] = $("#insertTime").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['insertUser'] = $("#insertUser").val(); |
| | | queryData['city'] = $("#city").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['category'] = $("#category").val(); |
| | | queryData['time'] = $("#time").val(); |
| | | TSite.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TSite.resetSearch = function () { |
| | | $("#insertTime").val(""); |
| | | $("#name").val(""); |
| | | $("#insertUser").val(""); |
| | | $("#city").val(""); |
| | | $("#state").val(""); |
| | | $("#name").val(''); |
| | | $("#phone").val(''); |
| | | $("#type").val(''); |
| | | $("#category").val(''); |
| | | $("#time").val(''); |
| | | TSite.search(); |
| | | }; |
| | | |