Skip to content

Commit

Permalink
1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tower1229 committed Nov 15, 2018
1 parent 3d67a0f commit 1d700bf
Show file tree
Hide file tree
Showing 11 changed files with 2,373 additions and 48 deletions.
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<preference name="smartUpdate" value="false"/>
<preference name="debug" value="true"/>
<preference name="softInputMode" value="auto"/>
<preference name="statusBarAppearance" value="false"/>
<preference name="statusBarAppearance" value="true"/>
<permission name="readPhoneState"/>
<permission name="camera"/>
<permission name="record"/>
Expand All @@ -28,7 +28,7 @@
<preference name="urlScheme" value="hybridstart" />
<preference name="querySchemes" value="hybridstart" />
<preference name="customRefreshHeader" value="UIPullRefreshFlash"/>
<preference name="backgroundMode" value="location | remote-notification"/>
<preference name="backgroundMode" value="remote-notification"/>
<access origin="*"/>
<feature name="bMap">
<param name="android_api_key" value="yTHKTQDYu0BMkLjlZG70LQkbARMmHT4q"/>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hybridstart",
"version": "1.2.2",
"version": "1.2.3",
"description": "A hybrid application development framework",
"main": "lib/index.js",
"directories": {
Expand Down
6 changes: 5 additions & 1 deletion sdk/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ define(function(require, exports, module) {
ele.removeAttribute('data-remote');
});
});

//沉浸式状态栏
let safeTop = api.safeArea.top;
if(safeTop && safeTop>24){
document.querySelector('.head').style.paddingTop = safeTop + 'px'
}

});
});
9 changes: 5 additions & 4 deletions sdk/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,7 @@ var apputil = (function(document, undefined) {
var left = config.left || 0,
top = config.top || 0,
width = config.width || 'auto',
height = config.height || 'auto',
bottomMargin = config.bottomMargin || 0;
height = config.height || 'auto';
if (!config.name) {
config.name = 'pop-' + config.url;
}
Expand All @@ -932,7 +931,10 @@ var apputil = (function(document, undefined) {
y: top,
w: width,
h: height,
marginBottom: bottomMargin
marginLeft: config.marginLeft,
marginTop: config.marginTop,
marginBottom: config.marginBottom,
marginRight: config.marginRight
},
customRefreshHeader: 'UIPullRefreshFlash',
useWKWebView: true,
Expand Down Expand Up @@ -1154,7 +1156,6 @@ var gh=((((ga*ga)>>>17)+ga*gb)>>>15)+gb*gb;var gl=(((gx&4294901760)*gx)|0)+(((gx
break;
default:
app.toast('服务端错误(' + status + ') code:' + code);
break;
}
};
var isEqual = function(o, x) {
Expand Down
2,322 changes: 2,321 additions & 1 deletion sdk/ui.css

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions sdk/ui.less
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ td, th { padding: 0;}
.row > [class*="span-"] {float: left; margin-right: @gridGutter; *margin-right: @gridGutter - 0.11%;}
.generate-row(@gridColumns);
.generate-row(@n, @i: 1) when (@i =< @n) {
.row > .span-@{i} {
.row > .span-@{i} {
width: (@i * 100% / @n) - @gridGutter;
}
.generate-row(@n, (@i + 1));
Expand All @@ -96,7 +96,7 @@ td, th { padding: 0;}
.full-row > [class*='span'] {float: left; }
.generate-full-row(@gridColumns);
.generate-full-row(@n, @i: 1) when (@i =< @n) {
.full-row > .span-@{i} {
.full-row > .span-@{i} {
width: @i * 100% / @n; *width: @i * 100% / @n - 0.11%;
}
.generate-full-row(@n, (@i + 1));
Expand All @@ -119,8 +119,8 @@ td, th { padding: 0;}
* Button
* --------------------------------------------------
*/
.btn { position: relative;overflow:hidden;font-size: @font-size; font-weight: normal; line-height: @btn-base-height;height: @btn-base-height; display: inline-block;
margin-bottom: 0; cursor: pointer; box-sizing: border-box;touch-action: manipulation;min-width: 4em;border-radius: @radius;
.btn { position: relative;overflow:hidden;font-size: @font-size; font-weight: normal; line-height: @btn-base-height;height: @btn-base-height; display: inline-block;
margin-bottom: 0; cursor: pointer; box-sizing: border-box;touch-action: manipulation;min-width: 4em;border-radius: @radius;
user-select: none; text-align: center; vertical-align: middle; white-space: nowrap; border: 0; padding: 0 1em; }
.btn > .ion{vertical-align: middle;font-size: 1.1em;}
.btn:active, .btn.active { outline: 0; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);}
Expand Down Expand Up @@ -177,7 +177,7 @@ input[type='submit'].btn-block, input[type='reset'].btn-block, input[type='butto
.card .item { padding-right: @space-sm; padding-left: @space-sm;}
.card .item:last-child {border-bottom: 0 !important;}
.card .item-body{margin-top: 0;}
@media screen and (-webkit-min-device-pixel-ratio: 2) {
@media screen and (-webkit-min-device-pixel-ratio: 2) {
.card .item:last-child:before { display: none !important; }
}
.card-head{
Expand Down Expand Up @@ -226,7 +226,7 @@ input[type='submit'].btn-block, input[type='reset'].btn-block, input[type='butto
* Items
* --------------------------------------------------
*/
.item { position: relative; z-index: 2; display: block; box-sizing: border-box; line-height: 1;
.item { position: relative; z-index: 2; display: block; box-sizing: border-box; line-height: 1;
padding: @space-sm * 1.2; border-bottom: 1px solid @border; overflow: hidden;}
.list .item:last-child{border-bottom: 0;}
/* active handle */
Expand All @@ -244,7 +244,7 @@ input[type='submit'].btn-block, input[type='reset'].btn-block, input[type='butto
-webkit-transition:all ease-out .5s;
}
.active .active-handle{transform:scale(1);-webkit-transform:scale(1);opacity: 0;}
@media screen and (-webkit-min-device-pixel-ratio: 2) {
@media screen and (-webkit-min-device-pixel-ratio: 2) {
.item{border-bottom:0; }
.item:before{
position: absolute;
Expand Down Expand Up @@ -332,7 +332,7 @@ input.item-note, input.item-note[readonly]{text-align: right;color:@gray;}
-webkit-box-flex: 1; -webkit-flex: 1; flex: 1; width: 100%;
-webkit-appearance: none; appearance: none;background-color:transparent;}
.item-input input:last-child,.item-input textarea:last-child{margin-right: 0;}
.item-input .btn .ion {font-size: 1.3em; position: static; display: inline-block; height: auto; text-align: center; -webkit-box-flex: 0;
.item-input .btn .ion {font-size: 1.3em; position: static; display: inline-block; height: auto; text-align: center; -webkit-box-flex: 0;
-webkit-flex: 0 0 2em; flex: 0 0 2em;}
.item-input .ion { min-width: 1em;}
.item-input .input, textarea {display: block; padding-top: 2px; padding-left: 0; vertical-align: middle; color: inherit;box-sizing:border-box;}
Expand All @@ -359,7 +359,7 @@ input[type='radio'][disabled], input[type='checkbox'][disabled], input[type='rad
.checkbox input:before{border-color: #ccc;box-sizing:border-box; display: table; width: 100%; height: 100%; content: ' ';
-webkit-transition: background-color 20ms ease-in-out; transition: background-color 20ms ease-in-out; border-width: 1px; border-style: solid; border-radius: 1.2em; background: @light;}
.checkbox input:after{position: absolute; top: 26%; left: 25%; display: table; width: .7em; height: .4em; content: ' ';
-webkit-transition: opacity 0.05s ease-in-out; transition: opacity 0.05s ease-in-out; -webkit-transform: rotate(-45deg);
-webkit-transition: opacity 0.05s ease-in-out; transition: opacity 0.05s ease-in-out; -webkit-transform: rotate(-45deg);
transform: rotate(-45deg); opacity: 0; border: 1px solid @light; border-top: 0; border-right: 0;}
.checkbox input:checked:before{ border-width: 2px;border-color: #ddd; background: #ddd;}
.checkbox input:disabled:before { border-color: #ddd;}
Expand Down Expand Up @@ -400,7 +400,7 @@ transform: rotate(-45deg); opacity: 0; border: 1px solid @light; border-top: 0;
* Radio Button Inputs
* --------------------------------------------------
*/
.item-radio input {position: relative; display: inline-block; width: 1.5em; height: 1.5em; border: 0; background: transparent;
.item-radio input {position: relative; display: inline-block; width: 1.5em; height: 1.5em; border: 0; background: transparent;
-webkit-appearance: none;vertical-align: middle;}
.item-radio input:before{ border-color: #ccc;box-sizing:border-box; display: block; width: 100%; height: 100%; content: ' ';
-webkit-transition: background-color 20ms ease-in-out; transition: background-color 20ms ease-in-out; border-width: 1px;
Expand Down Expand Up @@ -549,7 +549,7 @@ select[multiple],select[size]{height:auto}
.border-t {border-top: 1px solid @border;}
.border-b { border-bottom: 1px solid @border;}

@media (-webkit-min-device-pixel-ratio:2),(min-device-pixel-ratio:2) {
@media (-webkit-min-device-pixel-ratio:2),(min-device-pixel-ratio:2) {
.border-t,.border-b{position: relative;border:0;}
.border-t:before,.border-b:after{
position: absolute;
Expand Down Expand Up @@ -582,7 +582,7 @@ select[multiple],select[size]{height:auto}
.opc0 { opacity: 0 ; filter: alpha(opacity=0);}
.big{font-size:1.2em;}
.small{font-size:.8em;}
/*
/*
* Rect
*/
*[class*="rect-"]{position: relative;display: block; width: 100%;height: 0;overflow: hidden;}
Expand Down Expand Up @@ -745,8 +745,8 @@ a.bg-danger:hover{
background-color: @danger-dark;
}
/* 头部 */
.head { position: relative; height: .8rem;line-height: .8rem; color: @light; background: @primary;z-index: 99;}
.head .title { position: absolute; z-index: 0;bottom: 0; left: 0; width:100%; overflow: hidden;font-size: 1.2em;
.head { position: relative; height: .8rem;line-height: .8rem; color: @light; background: @primary;z-index: 99;padding-top:24px;}
.head .title { position: absolute; z-index: 0;bottom: 0; left: 0; width:100%; overflow: hidden;font-size: 1.2em;
text-align: center; white-space: nowrap; text-overflow: ellipsis;box-sizing: border-box;padding:0 13%;}
.head .btn { position: relative; z-index: 1; height: .8rem;line-height: inherit; min-width: initial; padding: 0 .5em;
border:0;background: none;box-shadow: none; vertical-align: top;color:inherit; }
Expand All @@ -757,7 +757,7 @@ border:0;background: none;box-shadow: none; vertical-align: top;color:inherit; }
.head .item-input-inset .btn:last-child {margin:0;padding:0 .7em;z-index: 9;}
/* 底部 */
.foot { position: relative; background:@light;overflow:hidden;z-index: 9; font-size: 0.9em; }
.tabs {overflow: visible; display: -webkit-box; display: -webkit-flex; display: flex;
.tabs {overflow: visible; display: -webkit-box; display: -webkit-flex; display: flex;
-webkit-box-orient: horizontal; }
.tabs .tab-item {position: relative; font-weight: 400; text-align: center; white-space: nowrap; text-decoration: none; text-overflow: ellipsis;
color: inherit;color:@gray-light;box-sizing:border-box;padding:.5em 0;-webkit-box-flex: 1; -webkit-flex: 1; flex: 1;overflow: hidden;}
Expand Down
6 changes: 3 additions & 3 deletions view/demo/img-view/temp.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
<div class="flex-1 flex-col scroll_cont" id="view">
<div class="p">
<div class="card">
<img data-remote="http://7xnt8z.com1.z0.glb.clouddn.com/view4.jpg" >
<img data-remote="http://static.refined-x.com/view4.jpg" >
</div>
<div class="card">
<img data-remote="http://7xnt8z.com1.z0.glb.clouddn.com/view5.jpg" >
<img data-remote="http://static.refined-x.com/view5.jpg" >
</div>
<div class="card">
<img data-remote="http://7xnt8z.com1.z0.glb.clouddn.com/view6.jpg" >
<img data-remote="http://static.refined-x.com/view6.jpg" >
</div>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions view/demo/index/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ define(function(require) {
set: function(){
$title.innerText = '会员中心';
$head.classList.add('member-head');
setTimeout(function(){
app.window.evaluate('', 'member', 'update()')
},0)
}
}
};
Expand Down
14 changes: 7 additions & 7 deletions view/demo/lazyload/temp.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h2>Here is title!</h2>
<div class="card">
<div class="item">
<div class="rect-50 m-b">
<img data-lazy="http://7xnt8z.com1.z0.glb.clouddn.com/view4.jpg" class="_full" alt="">
<img data-lazy="http://static.refined-x.com/view4.jpg" class="_full" alt="">
</div>
<h2>Here is title!</h2>
<div class="item-body">
Expand All @@ -48,7 +48,7 @@ <h2>Here is title!</h2>
<div class="card">
<div class="item">
<div class="rect-50 m-b">
<img data-lazy="http://7xnt8z.com1.z0.glb.clouddn.com/view5.jpg" class="_full" alt="">
<img data-lazy="http://static.refined-x.com/view5.jpg" class="_full" alt="">
</div>
<h2>Here is title!</h2>
<div class="item-body">
Expand All @@ -62,7 +62,7 @@ <h2>Here is title!</h2>
<div class="card">
<div class="item">
<div class="rect-50 m-b">
<img data-lazy="http://7xnt8z.com1.z0.glb.clouddn.com/view6.jpg" class="_full" alt="">
<img data-lazy="http://static.refined-x.com/view6.jpg" class="_full" alt="">
</div>
<h2>Here is title!</h2>
<div class="item-body">
Expand All @@ -76,7 +76,7 @@ <h2>Here is title!</h2>
<div class="card">
<div class="item">
<div class="rect-50 m-b">
<img data-lazy="http://7xnt8z.com1.z0.glb.clouddn.com/view7.jpg" class="_full" alt="">
<img data-lazy="http://static.refined-x.com/view7.jpg" class="_full" alt="">
</div>
<h2>Here is title!</h2>
<div class="item-body">
Expand All @@ -90,7 +90,7 @@ <h2>Here is title!</h2>
<div class="card">
<div class="item">
<div class="rect-50 m-b">
<img data-lazy="http://7xnt8z.com1.z0.glb.clouddn.com/view1.jpg" class="_full" alt="">
<img data-lazy="http://static.refined-x.com/view1.jpg" class="_full" alt="">
</div>
<h2>Here is title!</h2>
<div class="item-body">
Expand All @@ -104,7 +104,7 @@ <h2>Here is title!</h2>
<div class="card">
<div class="item">
<div class="rect-50 m-b">
<img data-lazy="http://7xnt8z.com1.z0.glb.clouddn.com/view2.jpg" class="_full" alt="">
<img data-lazy="http://static.refined-x.com/view2.jpg" class="_full" alt="">
</div>
<h2>Here is title!</h2>
<div class="item-body">
Expand All @@ -118,7 +118,7 @@ <h2>Here is title!</h2>
<div class="card">
<div class="item">
<div class="rect-50 m-b">
<img data-lazy="http://7xnt8z.com1.z0.glb.clouddn.com/view3.jpg" class="_full" alt="">
<img data-lazy="http://static.refined-x.com/view3.jpg" class="_full" alt="">
</div>
<h2>Here is title!</h2>
<div class="item-body">
Expand Down
6 changes: 3 additions & 3 deletions view/demo/slide/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ define(function(require) {
slide({
el: '#banner',
data: [{
src: 'http://7xnt8z.com1.z0.glb.clouddn.com/view0.jpg'
src: 'http://static.refined-x.com/view0.jpg'
}, {
src: 'http://7xnt8z.com1.z0.glb.clouddn.com/view1.jpg'
src: 'http://static.refined-x.com/view1.jpg'
}, {
src: 'http://7xnt8z.com1.z0.glb.clouddn.com/view2.jpg'
src: 'http://static.refined-x.com/view2.jpg'
}]
});

Expand Down
19 changes: 8 additions & 11 deletions view/member/index/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,23 @@ define(function(require) {
var comm = require('sdk/server');
require('sdk/common');
var $ = app.util;
var userData = comm.getUser();

//拉取个人信息
var showUser = function(reload) {
if (reload) {
userData = comm.getUser();
}
window.update = function(reload) {
var userData = comm.getUser();
if(userData){
if(userData.headImg){
$('#avat')[0].src = userData.headImg;
}
$('#usern')[0].innerText = (userData.nickName);
$('#score')[0].innerText = (userData.nowScore);
}

};
$('#avat')[0].addEventListener('touchend',function(){
app.openView(null,'member','setPersonal');
});

showUser();


});



});

0 comments on commit 1d700bf

Please sign in to comment.