From 7e7f901b2172281dc294dfbc67e6ad00625f09f4 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期一, 04 三月 2024 10:11:21 +0800 Subject: [PATCH] 合并代码 --- cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 43 insertions(+), 4 deletions(-) diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js b/cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js index 700a94f..4db5c09 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js @@ -7,14 +7,19 @@ 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: 'id', visible: true, align: 'center', valign: 'middle'}, {title: '省', field: 'province', visible: true, align: 'center', valign: 'middle',width:'20%', }, {title: '市', field: 'city', visible: true, align: 'center', valign: 'middle', @@ -24,7 +29,7 @@ }, {title: '积分类型', field: 'type', visible: true, align: 'center', valign: 'middle', formatter:function (data) { - return{1:"赠送积分", 2:"兑换商品",3:"完成课后练习",4:"观看教学视频"}[data] + return{1:"赠送积分", 2:"兑换商品",3:"完成课后练习",4:"观看教学视频",5:"启动游戏"}[data] } }, {title: '积分明细', field: 'integral', visible: true, align: 'center', valign: 'middle', @@ -74,6 +79,40 @@ 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(); + +} /** * 点击添加跨城站点管理 */ @@ -82,7 +121,7 @@ var index = layer.open({ type: 2, title: language==1?'赠送积分':(language==2?'Add':'Tambahkan'), - area: ['50%', '50%'], //宽高 + area: ['60%', '60%'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/tIntegral/tIntegral_add' -- Gitblit v1.7.1