起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2013|回复: 5

[处理中3] 提示owner未定义,有时提示'prototype'未定义

[复制链接]

93

主题

234

帖子

850

积分

高级会员

Rank: 4

积分
850
QQ
发表于 2017-11-12 22:58:23 | 显示全部楼层 |阅读模式
本帖最后由 dwqgdgz 于 2017-11-12 23:32 编辑

main下有多个 windowContainer 组件,这些组件下的窗口都都是能过

Model.prototype.tomessage = function(event){
  this.owner.send({return_str: "tomessage"});// 有时报错 owner未定义  是什么原因呢
};
能过以上的代码向 main 发送信息让main执行相关操作的
多次测试发现如果铛铛不能用的情况下就会报错,不登录铛铛就没试过报错的

报错后再打开原来那个子窗口就会提示如下:
Mismatched anonymous define() module: function (require){
require('$model/UI2/system/components/justep/model/model');
require('$model/UI2/system/components/justep/loadingBar/loadingBar');
require('$model/UI2/system/components/justep/button/button');
require('$model/UI2/system/components/justep/list/list');
require('$model/UI2/system/components/bootstrap/row/row');
require('$model/UI2/system/components/justep/panel/child');
require('$model/UI2/system/components/justep/windowDialog/windowDialog');
require('$model/UI2/system/components/justep/messageDialog/messageDialog');
require('$model/UI2/system/components/justep/panel/panel');
require('$model/UI2/system/components/justep/popOver/popOver');
require('$model/UI2/system/components/justep/button/checkbox');
require('$model/UI2/system/components/justep/row/row');
require('$model/UI2/system/components/justep/output/output');
require('$model/UI2/system/components/justep/titleBar/titleBar');
require('$model/UI2/system/components/justep/data/data');
require('$model/UI2/system/components/justep/window/window');
require('$model/UI2/system/components/justep/button/buttonGroup');
var __parent1=require('$model/UI2/system/lib/base/modelBase');
var __parent0=require('$model/UI2/shw/gwc');
var __result = __parent1._extend(__parent0).extend({
constructor:function(contextUrl){
this.__sysParam='true';
this.__contextUrl=contextUrl;
this.__id='';
this.__cid='ceUjYNj';
this._flag_='273411b6057927250996ba337364e8d3';
this.callParent(contextUrl);
var __Data__ = require("$UI/system/components/justep/data/data");new __Data__(this,{"autoLoad":true,"confirmDelete":false,"confirmRefresh":false,"defCols":{"fChoose":{"define":"fChoose","label":"选中","name":"fChoose","relation":"fChoose","type":"String"},"fConsistent":{"define":"fConsistent","label":"描述相符","name":"fConsistent","relation":"fConsistent","rules":{"number":true},"type":"Float"},"fFocusNumber":{"define":"fFocusNumber","label":"关注人数","name":"fFocusNumber","relation":"fFocusNumber","rules":{"integer":true},"type":"Integer"},"fGoodsNumber":{"define":"fGoodsNumber","label":"商品数量","name":"fGoodsNumber","relation":"fGoodsNumber","rules":{"integer":true},"type":"Integer"},"fLevel":{"define":"fLevel","label":"等级","name":"fLevel","relation":"fLevel","rules":{"integer":true},"type":"Integer"},"fService":{"define":"fService","label":"服务态度","name":"fService","relation":"fService","rules":{"number":true},"type":"Float"},"fShopId":{"define":"fShopId","label":"id","name":"fShopId","relation":"fShopId","type":"String"},"fShopImg":{"define":"fShopImg","label":"店
中间都是字段来的,发不了那么长省略...
{"define":"yyyymmdd_begin","name":"yyyymmdd_begin","relation":"yyyymmdd_begin","rules":{"datetime":true},"type":"DateTime"},"yyyymmdd_end":{"define":"yyyymmdd_end","name":"yyyymmdd_end","relation":"yyyymmdd_end","rules":{"datetime":true},"type":"DateTime"},"zt":{"define":"zt","name":"zt","relation":"zt","type":"String"}},"directDelete":false,"events":{"onCustomRefresh":"mssbCustomRefresh"},"idColumn":"ms_id","limit":50,"xid":"mssb"});
new __Data__(this,{"autoLoad":true,"confirmDelete":false,"confirmRefresh":false,"defCols":{"fShopId":{"define":"fShopId","name":"fShopId","relation":"fShopId","type":"String"},"fShopName":{"define":"fShopName","name":"fShopName","relation":"fShopName","type":"String"},"yhj_id":{"define":"yhj_id","name":"yhj_id","relation":"yhj_id","type":"String"},"yhj_je":{"define":"yhj_je","name":"yhj_je","relation":"yhj_je","rules":{"number":true},"type":"Decimal"},"yhj_name":{"define":"yhj_name","name":"yhj_name","relation":"yhj_name","type":"String"},"yhj_use_minje":{"define":"yhj_use_minje","name":"yhj_use_minje","relation":"yhj_use_minje","rules":{"number":true},"type":"Decimal"},"yhj_useid":{"define":"yhj_useid","name":"yhj_useid","relation":"yhj_useid","type":"String"}},"directDelete":false,"events":{},"idColumn":"yhj_useid","limit":-1,"xid":"yhj_use"});
}});
return __result;}
http://requirejs.org/docs/errors.html#mismatch

按确定后是一个空白页面,点别的页面正常,再点回来又提示: Cannot set property 'owner' of undefined

以上情况都是在打包后在公网上运行出现的,开发本机上却没试出这种情况来

发表于 2017-11-13 15:10:16 | 显示全部楼层
以上情况都是在打包后在公网上运行出现的,开发本机上却没试出这种情况来

公网上的运行版本  和 本地开发的运行版本一致吗??
请必须保证版本一致

建议debugger 跟一下!这个代码是如何调用的??this  表示的对象是什么??
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

93

主题

234

帖子

850

积分

高级会员

Rank: 4

积分
850
QQ
 楼主| 发表于 2017-11-13 16:02:15 | 显示全部楼层
Model.prototype.tomessage = function(event){
   this.owner.send({return_str: "tomessage"});// 有时报错 owner未定义  是什么原因呢
};
这是普通的事件代码,this是指本窗口吧,并不是每次都报错,并且在开发机上没试过报错。

公网是模式一打包的,局域网模式三自动更新,代码内容完全一致的
回复 支持 反对

使用道具 举报

发表于 2017-11-13 17:42:11 | 显示全部楼层
dwqgdgz 发表于 2017-11-13 16:02
Model.prototype.tomessage = function(event){
   this.owner.send({return_str: "tomessage"});// 有时报 ...

有时候出错,还不稳定重现是吗??
首先这页面必须是在windowDialog 或者 windowContainer 组件中才可以 调用的!  
如果是单独打开的!则无法调用
this.owner
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

93

主题

234

帖子

850

积分

高级会员

Rank: 4

积分
850
QQ
 楼主| 发表于 2017-11-13 18:19:44 | 显示全部楼层
windowContainer组件下 加载的页面里调用的 UI2下面的page例子里有这个调用方法
应该是没连上铛铛服务器时会出现这种情况
回复 支持 反对

使用道具 举报

发表于 2017-11-13 18:26:13 | 显示全部楼层
dwqgdgz 发表于 2017-11-13 18:19
windowContainer组件下 加载的页面里调用的 UI2下面的page例子里有这个调用方法
应该是没连上铛铛服务器时 ...

没连上铛铛服务器!不影响页面调用啊!这个只能自己 排查找原因了!
本地测试哪个页面都可以调用this.owner.send
除非你的页面不是wex5开发的,否则你试试吧!任何标准定义的方法了
Model.prototype.方法= function(){
   this.owner.send()
}
都可以调用的!
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-21 22:36 , Processed in 0.056049 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表