From f7c7592487ffdf191cf2c0bded358568eb65f837 Mon Sep 17 00:00:00 2001 From: tower1229 Date: Wed, 9 May 2018 17:12:01 +0800 Subject: [PATCH] 1.2.2 --- package.json | 2 +- sdk/common.js | 12 +--- sdk/core.js | 23 +++++-- sdk/modules/validform/validform.js | 23 +++---- view/common/chooseList/content.html | 21 +++--- view/common/chooseList/content.js | 29 ++++---- view/common/chooseList/script.js | 7 +- view/common/chooseList/temp.html | 2 +- view/demo/ajax/script.js | 1 - view/demo/chooseList/script.js | 5 +- view/demo/index/content.html | 2 +- view/demo/list2detail/content.js | 100 ++++++++++++++-------------- view/demo/list2detail/detail.js | 51 +++++++------- view/demo/tabList/content.js | 6 +- view/demo/tabList/script.js | 13 ++-- view/demo/validform/script.js | 5 +- view/member/login/script.js | 92 +++++++++++-------------- 17 files changed, 192 insertions(+), 202 deletions(-) diff --git a/package.json b/package.json index 1efbef3..9cda8b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hybridstart", - "version": "1.2.1", + "version": "1.2.2", "description": "A hybrid application development framework", "main": "lib/index.js", "directories": { diff --git a/sdk/common.js b/sdk/common.js index f25f875..b5b32ea 100644 --- a/sdk/common.js +++ b/sdk/common.js @@ -132,17 +132,7 @@ define(function(require, exports, module) { }); } } - if (platform === 'ios') { - if (parseFloat(version) >= 9) { - $body.on('click', '.item-radio', function() { - var $view = $(this).parent(); - $view.css('visibility', 'hidden'); - setTimeout(function() { - $view.css('visibility', 'visible'); - }, 0); - }); - } - } + //自动加载data-src app.window.on('resume', function(){ $.each($('[data-src]'), function(i, ele){ diff --git a/sdk/core.js b/sdk/core.js index 72ec6cc..7ce4d3f 100644 --- a/sdk/core.js +++ b/sdk/core.js @@ -957,8 +957,11 @@ var apputil = (function(document, undefined) { z: 0 } }, config || {}); + //IOS不允许传递包含function的对象 + var cbTemp = opt.callback; + delete opt.callback; api.animation(opt, function(ret, err) { - typeof opt.callback === 'function' && opt.callback(ret, err); + typeof cbTemp === 'function' && cbTemp(ret, err); }); return opt.name; } @@ -1166,10 +1169,11 @@ var gh=((((ga*ga)>>>17)+ga*gb)>>>15)+gb*gb;var gl=(((gx&4294901760)*gx)|0)+(((gx //返回结果处理 var tempSucc = opt.success; + var tempErr = opt.error; var handleError = function(res, err) { if (!res) { - if (typeof(opt['error']) === 'function') { - opt['error'](err); + if (typeof(tempErr) === 'function') { + tempErr(err); } else { app.loading.hide(); catchAjaxError(err.code, err.statusCode); @@ -1191,11 +1195,15 @@ var gh=((((ga*ga)>>>17)+ga*gb)>>>15)+gb*gb;var gl=(((gx&4294901760)*gx)|0)+(((gx if(opt.snapshoot && !fromSnap){ app.storage.val(urlkey, res); } - tempSucc(res); + typeof(tempSucc)==='function' && tempSucc(res); } } //清理数据 delete opt.success; + delete opt.error; + delete opt.callback; + delete opt.beforeCheck; + delete opt.beforeSubmit; delete opt.type; delete opt.tiptype; delete opt.tipSweep; @@ -1280,8 +1288,13 @@ var gh=((((ga*ga)>>>17)+ga*gb)>>>15)+gb*gb;var gl=(((gx&4294901760)*gx)|0)+(((gx values: opt.data }; } - //console.log(JSON.stringify(opt)) + // var aaaaalist = []; + // for(var x in opt){ + // aaaaalist.push(x) + // } + // console.log(aaaaalist.join(' ')) api.ajax(opt, function(res, err) { + //console.log(JSON.stringify(res)) handleRes(res); handleError(res, err); }); diff --git a/sdk/modules/validform/validform.js b/sdk/modules/validform/validform.js index e4faba9..ef52b57 100644 --- a/sdk/modules/validform/validform.js +++ b/sdk/modules/validform/validform.js @@ -542,8 +542,8 @@ define('validform', function(require, exports, module) { return true; } }; - if (ajaxsetup.success) { - var temp_suc = ajaxsetup.success; + if (ajaxsetup.callback) { + var temp_suc = ajaxsetup.callback; ajaxsetup.success = function(data) { localconfig.success(data); temp_suc(data, inputobj); @@ -672,8 +672,8 @@ define('validform', function(require, exports, module) { sweep: settings.tipSweep }, "byajax"); - if (ajaxsetup.success) { - var temp_suc = ajaxsetup.success; + if (ajaxsetup.callback) { + var temp_suc = ajaxsetup.callback; ajaxsetup.success = function(data) { settings.callback && settings.callback(data); curform[0].validform_ajax = null; @@ -748,14 +748,13 @@ define('validform', function(require, exports, module) { } }; ajaxsetup = $.extend({}, localconfig, ajaxsetup); - setTimeout(function(){ - try{ - curform[0].validform_ajax = ajaxRequest(ajaxsetup); - }catch(e){ - //ios报错兼容 - curform[0].validform_ajax = {abort:null}; - } - },100) + try{ + curform[0].validform_ajax = ajaxRequest(ajaxsetup); + }catch(e){ + //ios报错兼容 + console.log('validform.js:' + e.message); + curform[0].validform_ajax = {abort:null}; + } return null; } else { if (!settings.postonce) { diff --git a/view/common/chooseList/content.html b/view/common/chooseList/content.html index adbfc5e..d427f34 100644 --- a/view/common/chooseList/content.html +++ b/view/common/chooseList/content.html @@ -15,17 +15,20 @@ -