feat:设备使用记录

This commit is contained in:
houjunxiang
2026-03-05 16:54:47 +08:00
parent 749ac7f507
commit 9c88c45d66
357 changed files with 21486 additions and 5845 deletions

View File

@@ -22,7 +22,6 @@ const logCommand = (function () {
}
const logCommand = (id, cmds) => {
const mId = cmds.split(',')[0];
const mName = queryMethod(mId);
console.log(`=== callNative - componentId:${id}; method: ${mName}; cmds: ${cmds}`);
}
return logCommand;
@@ -214,7 +213,9 @@ const GBridge = {
},
perloadImage([url, id], callback) {
console.log('********************asda**********')
GCanvasModule.preLoadImage([url, id], function (image) {
console.log('********************asda2**********')
image.url = url;
image.id = id;
callback(image);

View File

@@ -1,5 +1,6 @@
let incId = 1;
import GBridge from '../bridge/bridge-weex.js'
const noop = function () { };
class GImage {
@@ -42,22 +43,29 @@ class GImage {
}
this._src = v;
GImage.GBridge.perloadImage([this._src, this._id], (data) => {
if (typeof data === 'string') {
data = JSON.parse(data);
}
if (data.error) {
var evt = { type: 'error', target: this };
this.onerror(evt);
} else {
this.complete = true;
this.width = typeof data.width === 'number' ? data.width : 0;
this.height = typeof data.height === 'number' ? data.height : 0;
var evt = { type: 'load', target: this };
this.onload(evt);
}
});
try {
GBridge.perloadImage([this._src, this._id], (data) => {
if (process.env.NODE_ENV === 'development') {
console.log('****GBridge.perloadImage****')
}
if (typeof data === 'string') {
data = JSON.parse(data);
}
if (data.error) {
var evt = { type: 'error', target: this };
this.onerror(evt);
} else {
this.complete = true;
this.width = typeof data.width === 'number' ? data.width : 0;
this.height = typeof data.height === 'number' ? data.height : 0;
var evt = { type: 'load', target: this };
this.onload(evt);
}
});
} catch (error) {
console.log('perloadImage fail', error)
}
}
addEventListener(name, listener) {