Commit bca64451 authored by rockyl's avatar rockyl

自适应模式默认改为单次

parent 61f81bd0
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"id":"engine","url_dbg":"engine.6dfbb029b1fcbba4c6deb9b2fbdff78afd6bd6a8.js","url":"engine.min.869aabd4ec73875809b60b2eeba9ebbe6e821a91.js"} {"id":"engine","url_dbg":"engine.1531e1ce239eefdc940cfc3ee5b6e31b7df98fd9.js","url":"engine.min.64c67f3bebea51c4d348989ff6bf86d17531bc85.js"}
\ No newline at end of file \ No newline at end of file
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
"pack:debug": "yarn build && yarn preprocess:debug", "pack:debug": "yarn build && yarn preprocess:debug",
"upload": "ali-oss-publish -c oss.config.js -e dist", "upload": "ali-oss-publish -c oss.config.js -e dist",
"publish": "rm -rf dist && yarn pack:debug && yarn pack:prod && yarn upload", "publish": "rm -rf dist && yarn pack:debug && yarn pack:prod && yarn upload",
"token": "uglifyjs -m -c -o px-token.min.js px-token.js",
"dts": "node scripts/declare.js src/index.ts" "dts": "node scripts/declare.js src/index.ts"
}, },
"author": "", "author": "",
......
function getPxToken(callback) {
if (window['ohjaiohdf']) {
var url = location.href;
if (url.indexOf('.com.cn/projectx') < 0) {
callback(null, 'test_token');
} else {
var xhr = new XMLHttpRequest();
xhr.open('get', 'getToken?_t=' + Date.now(), true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
var response = JSON.parse(xhr.response);
if (response.success) {
window.eval(response.data);
callback(null, window['ohjaiohdf']());
} else {
switch (response.code) {
case '100001':
callback('need login');
break;
case '100024':
callback('state invalid');
break;
default:
callback(response.code);
break;
}
}
}
};
xhr.onerror = function (e) {
failedCallback();
};
xhr.onloadend = function () {
if (xhr.status === 404) {
failedCallback();
}
};
xhr.send();
}
} else {
callback('need reload');
}
function failedCallback() {
callback('net error');
}
}
function getPxToken(n){if(window.ohjaiohdf)if(location.href.indexOf(".com.cn/projectx")<0)n(null,"test_token");else{var o=new XMLHttpRequest;o.open("get","getToken?_t="+Date.now(),!0),o.onreadystatechange=function(){if(4===o.readyState&&200===o.status){var e=JSON.parse(o.response);if(e.success)window.eval(e.data),n(null,window.ohjaiohdf());else switch(e.code){case"100001":n("need login");break;case"100024":n("state invalid");break;default:n(e.code)}}},o.onerror=function(e){t()},o.onloadend=function(){404===o.status&&t()},o.send()}else n("need reload");function t(){n("net error")}}
\ No newline at end of file
...@@ -111,7 +111,7 @@ class AdjustProxy { ...@@ -111,7 +111,7 @@ class AdjustProxy {
// autoHeight: false, // autoHeight: false,
alignEnabled: true, alignEnabled: true,
alignMode: ALIGN_MODE.ALWAYS, alignMode: ALIGN_MODE.ONCE,
}; };
private _host; private _host;
......
...@@ -22,6 +22,8 @@ export class Toast extends Node { ...@@ -22,6 +22,8 @@ export class Toast extends Node {
this.horizonCenter = 0; this.horizonCenter = 0;
this.verticalCenter = 0; this.verticalCenter = 0;
this['alignMode'] = 'always'
} }
async show(props: any = {}) { async show(props: any = {}) {
...@@ -87,6 +89,7 @@ export class Toast extends Node { ...@@ -87,6 +89,7 @@ export class Toast extends Node {
this._contentSample = new Node(); this._contentSample = new Node();
let bg = new Rect(); let bg = new Rect();
bg['alignMode'] = 'always'
bg.borderRadius = borderRadius; bg.borderRadius = borderRadius;
bg.percentWidth = 100; bg.percentWidth = 100;
bg.percentHeight = 100; bg.percentHeight = 100;
...@@ -94,6 +97,7 @@ export class Toast extends Node { ...@@ -94,6 +97,7 @@ export class Toast extends Node {
bg.alpha = bgAlpha; bg.alpha = bgAlpha;
this._contentSample.addChild(bg); this._contentSample.addChild(bg);
let lab = new Label(); let lab = new Label();
lab['alignMode'] = 'always'
lab.name = 'lab'; lab.name = 'lab';
lab.fillColor = labColor; lab.fillColor = labColor;
lab.size = labSize; lab.size = labSize;
...@@ -102,6 +106,7 @@ export class Toast extends Node { ...@@ -102,6 +106,7 @@ export class Toast extends Node {
} }
view = this._contentSample; view = this._contentSample;
} }
view['alignMode'] = 'always'
this._content = view; this._content = view;
this.addChild(view); this.addChild(view);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment