123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- $(function(){
- /* 滚轮 */
- var myScroll = new IScroll(".iscroll",{
- scrollbars: true,
- fadeScrollbars:true,
- scrollbars: 'custom',
- shrinkScrollbars:'clip',
- tap:true
- });
- setTimeout(function () {
- myScroll.refresh();
- }, 100);
-
- var theme="android-ics";
- $("#date").mobiscroll().date({
- lang: "zh",//显示中文
- theme: theme,//主题
- setText: '确定',//确认按钮名称
- cancelText: '取消',//取消按钮名称
- dateFormat: 'yy-mm-dd',// 日期格式
- dateOrder: 'yymmdd',//面板中日期排列格式
- display: 'bottom',//显示方式
- endYear:2050,//结束年份
- });
-
- $("#eph").bind("click", function() {
- var id = $("#id").val();
- if (id == "") {
- haifmp.loadMobilePage("haifmp", "getZzzqSearchDweb.htm?mcid=" + $("#mcid").val() + "&date=" + $("#date").val());
- }
- });
- //日期不能修改
- if ($("#id").val() != "" && $("#id").val() != "0"){
- $("#date" ).prop("disabled" , true);
- }
- var date = $("#date").val();
- var rq = date.split("-");
- var year = rq[0];
- var month = rq[1];
- var day = rq[2];
- var myDate = new Date();
- //获取当前年
- var y = myDate.getFullYear();
- //获取当前月
- var m = myDate.getMonth()+1;
- //获取当前日
- var d = myDate.getDate();
- //点击input键盘弹出滚动区域translateY往上滚动;
- $(document).ready(function () {
- var clickQian = document.body.clientHeight;
- var switcha = true;
- var a = null;
- $("input[type='text']").on("tap",function(){
- a = $(".content")[0].style.transform.split(',')[1].split(' ')[1].match(/\d+(\.\d+)?/)[0];
- if($("input[type='number']") && switcha){
- setTimeout(function(){
- var clickHou = document.body.clientHeight;
- var zimujpHeight = clickQian - clickHou - a - 218 + "px";
- $(".content")[0].style.transform = "translateY(-"+zimujpHeight+")";
- myScroll.refresh();
- switcha = false;
- },250);
- }
- });
- });
- //元素失去焦点隐藏软键盘
- $("#zzzqForm").on("tap",function(e){
- if(e.target.nodeName != "INPUT"){
- $('input').blur();
- };
- });
- });
- /**
- * 保存
- * @param type
- */
- function saveZzzq(type) {
- var dweb = $("#dweb").val();
- var eph = $("#eph").val();
- if (eph == "") {
- alert("请输入正确的耳牌号!");
- return false;
- } else {
- jQuery('#zzzqForm').ajaxSubmit({
- dataType : 'json',
- data : {"mcid" : $("#mcid").val(),
- "dweb" : dweb
- },
- success : function(data) {
- // 保存成功
- if (data.count > 0) {
- alert("保存成功!");
- if (type == "1") {
- haifmp.loadMobilePage("haifmp", "hpSjlrZzzqIndex.htm?mcid=" + $("#mcid").val());
- return;
- } else {
- haifmp.loadMobilePage("haifmp", "hpSjlrZzzqEdit.htm?mcid=" + $("#mcid").val());
- }
- }
- },
- error : function(data) {
- alert("保存失败!系统错误!");
- }
- });
- }
- }
- /**
- * 返回
- */
- function backUrl() {
- haifmp.loadMobilePage("haifmp", "hpSjlrZzzqIndex.htm?mcid=" + $("#mcid").val());
- }
|