123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- $(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,//结束年份
- });
- //点击input键盘弹出滚动区域translateY往上滚动;
- $(document).ready(function () {
- var clickQian = document.body.clientHeight;
- var switcha = true;
- var a = null;
- $("input[type='number']").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 - 180 + "px";
- $(".content")[0].style.transform = "translateY(-"+zimujpHeight+")";
- myScroll.refresh();
- switcha = false;
- },250);
- }
- });
- });
- //元素失去焦点隐藏软键盘
- $("#fzttForm").on("tap",function(e){
- if(e.target.nodeName != "INPUT"){
- $('input').blur();
- };
- });
- });
- /**
- * 保存
- * @param type
- */
- function saveFztt(type) {
- jQuery('#fzttForm').ajaxSubmit({
- dataType : 'json',
- data : {"mcid" : $("#mcid").val()},
- beforeSend:function() { //触发ajax请求开始时执行
- if(type==1){
- $(".sub").text("提交中……");
- $('.sub').attr('onclick','javascript:void(0)');//改变提交按钮上的文字并将按钮设置为不可点击
- }else{
- $(".subAdd").text("提交中……");
- $('.subAdd').attr('onclick','javascript:void(0)');//改变提交按钮上的文字并将按钮设置为不可点击
- }
- },
- success : function(msg, data) {
- // 保存成功
- if (msg.result=1) {
- alert("保存成功!");
- if (type == "1") {
- haifmp.loadMobilePage("haifmp", "hpSjlrFzttIndex.htm?mcid=" + $("#mcid").val());
- } else {
- haifmp.loadMobilePage("haifmp", "hpSjlrFzttEdit.htm?mcid=" + $("#mcid").val());
- }
- }else{
- if (type == "1") {
- alert(msg.msg);
- $('.sub').text('提交表单');
- $('.sub').attr('onclick','submitorder()');//改变提交按钮上的文字并将按钮设置为可点击
- } else {
- alert(msg.msg);
- $('.subAdd').text('提交表单');
- $('.subAdd').attr('onclick','submitorder()');//改变提交按钮上的文字并将按钮设置为可点击
- }
- }
- },
- error : function(data) {
- if(type=="1") {
- alert('网络繁忙,请稍后再试...');
- $('.sub').text('提交表单');
- $('.sub').attr('onclick','submitorder()');//改变提交按钮上的文字并将按钮设置为可点击
- }else {
- alert('网络繁忙,请稍后再试...');
- $('.subAdd').text('提交表单');
- $('.subAdd').attr('onclick','submitorder()');//改变提交按钮上的文字并将按钮设置为可点击
- }
-
- },
- complete: function(msg, data)
- {
- //ajax请求完成时执行
- if(msg.result==1)
- {
- if(type==1){
- $(".sub").text("提交中……");
- $('.sub').attr('onclick','javascript:void(0)');//改变提交按钮上的文字并将按钮设置为不可点击
- }else{
- $(".subAdd").text("提交中……");
- $('.subAdd').attr('onclick','javascript:void(0)');//改变提交按钮上的文字并将按钮设置为不可点击
- }
- }
- }
- });
- }
- /**
- * 返回
- */
- function backUrl() {
- haifmp.loadMobilePage("haifmp", "hpSjlrFzttIndex.htm?mcid=" + $("#mcid").val());
- }
|