45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
apiready = function() {
|
|
var ctrl = {
|
|
newsId: null,
|
|
init: {},
|
|
bind: {},
|
|
}
|
|
|
|
ctrl.init = function() {
|
|
// 适配安卓状态栏
|
|
CommonModel.fitInStatusBar();
|
|
this.newsId = api.pageParam.id;
|
|
this.bind();
|
|
// this.getNews();
|
|
}
|
|
|
|
ctrl.bind = function() {
|
|
//点击返回按钮
|
|
$api.addEvt($api.dom("#back"), "touchend", function() {
|
|
api.closeWin();
|
|
})
|
|
//打开frame
|
|
//计算frame显示的位置和尺寸
|
|
var windowWidth = parseInt($api.cssVal($api.dom("body"), "width"));
|
|
var windowHeight = parseInt($api.cssVal($api.dom("body"), "height"));
|
|
var headerHeight = parseInt($api.cssVal($api.dom("#header"), "height"));
|
|
var frameX = 0;
|
|
var frameY = headerHeight;
|
|
var frameWidth = windowWidth;
|
|
var frameHeight = windowHeight - headerHeight;
|
|
api.openFrame({
|
|
name: 'newsFrame',
|
|
url: 'https://www.dianwutong.com/app/news.do?id=' + this.newsId,
|
|
rect: {
|
|
x: frameX,
|
|
y: frameY,
|
|
w: frameWidth,
|
|
h: frameHeight
|
|
},
|
|
});
|
|
|
|
}
|
|
|
|
ctrl.init();
|
|
}
|