VM662:1 thirdScriptError
Cannot read property 'uid' of undefined; [Component] Event Handler Error @ weixinmao_jz/pages/article/index#bound toOrder
TypeError: Cannot read property 'uid' of undefined
at ge.toOrder (http://127.0.0.1:31020/appservice/weixinmao_jz/pages/article/index.js:105:35)
at Object.r.safeCallback (WAService.js:1:1139522)
at WAService.js:1:1314709
at r (WAService.js:1:1265851)
at WAService.js:1:1265973
at WAService.js:1:435971
at n (http://127.0.0.1:31020/appservice/__dev__/asdebug.js:1:27894)
at e.exports.
at http://127.0.0.1:31020/appservice/__dev__/asdebug.js:1:1846
at Array.forEach (<anonymous>)
console.error @ VM662:1
errorReport @ WAService.js:1
thirdErrorReport @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
r.safeCallback @ WAService.js:1
r.call @ WAService.js:1
message @ WAService.js:1
r.safeCallback @ WAService.js:1
(anonymous) @ WAService.js:1
r @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
n @ VM677 asdebug.js:1
(anonymous) @ VM677 asdebug.js:1
(anonymous) @ VM677 asdebug.js:1
_ws.onmessage @ VM677 asdebug.js:1
把你代码,弄个代码片段发出来,你就发两行,谁能帮你看,帮你改?先学会问问题呀
Page({
data: {
autoplay: !0,
interval: 3e3,
duration: 1e3,
listid: "",
totalprice: 0,
id: 0
},
onLoad: function(a) {
if (wx.setNavigationBarTitle({
title: "服务列表-" + wx.getStorageSync("companyinfo").name
}), 0 < this.data.id) this.data.id; else {
a.id;
this.data.id = a.id;
}
var t = this;
t.setData({
isshow: !0
}), app.util.request({
url: "entry/wxapp/getarticle",
data: {
id: this.data.id
},
success: function(a) {
a.data.message.errno || (a.data.data.intro.maincolor || (a.data.data.intro.maincolor = "#09ba07"),
wx.setNavigationBarColor({
frontColor: "#ffffff",
backgroundColor: a.data.data.intro.maincolor,
animation: {
duration: 400,
timingFunc: "easeIn"
}
}), t.setData({
category: a.data.data.category,
article: a.data.data.article,
activeCategoryId: a.data.data.activeCategoryId,
totalprice: 0,
intro: a.data.data.intro,
isshow: !1
}));
},
complete: function() {
wx.hideNavigationBarLoading(), wx.stopPullDownRefresh();
}
});
},
radioChange: function(a) {
var t = this, i = a.detail.value.split("@");
console.log(i), t.data.listid = i[1], t.data.totalprice = i[0], t.setData({
totalprice: t.data.totalprice
});
},
SelectChange: function(a) {
var t = this;
console.log(a.detail.value);
var i, e = a.detail.value, o = 0, n = "";
if (0 < e.length) {
for (var r = 0; r < e.length; r++) i = e[r].split("@"), o += parseFloat(i[0]), n = n + i[1] + "@";
console.log(n);
}
t.data.listid = n, t.data.totalprice = o, t.setData({
totalprice: o
});
},
tabClick: function(a) {
var t = a.currentTarget.id, i = this;
app.util.request({
url: "entry/wxapp/getsecondlist",
data: {
pid: t
},
success: function(a) {
a.data.message.errno || i.setData({
article: a.data.data,
activeCategoryId: t
});
}
});
},
toNewsDetail: function(a) {
var t = a.currentTarget.dataset.id;
wx.navigateTo({
url: "/weixinmao_jz/pages/newsdetail/index?id=" + t
});
},
toOrder: function(a) {
var t = this;
if (0 != t.data.totalprice) {
var i = wx.getStorageSync("userInfo"), e = a.detail.formId;
console.log(t.data.listid);
var o = {
sessionid: i.sessionid,
listid: t.data.listid,
uid: i.memberInfo.uid,
form_id: e
};
app.util.request({
url: "entry/wxapp/newsaveorder",
data: o,
success: function(a) {
if (0 != a.data.errno) return wx.hideLoading(), void wx.showModal({
title: "失败",
content: "提交失败",
showCancel: !1
});
if (0 != a.data.data.error) return wx.hideLoading(), void wx.showModal({
title: "失败",
content: "提交失败",
showCancel: !1
});
var t = a.data.data.orderid;
wx.showToast({
title: "提交成功",
icon: "success",
duration: 2e3,
success: function(a) {
console.log(a), wx.navigateTo({
url: "/weixinmao_jz/pages/done/index?orderid=" + t
});
}
});
}
});
} else wx.showModal({
title: "提示",
content: "请选择服务项目",
showCancel: !1
});
},
onReady: function() {},
onShow: function() {},
onHide: function() {},
onUnload: function() {},
onPullDownRefresh: function() {
wx.showNavigationBarLoading(), wx.hideNavigationBarLoading(), wx.stopPullDownRefresh();
},
onReachBottom: function() {
wx.showNavigationBarLoading(), wx.hideNavigationBarLoading(), wx.stopPullDownRefresh();
},
onShareAppMessage: function() {
return {
title: "我要下单-" + wx.getStorageSync("companyinfo").name,
path: "/weixinmao_jz/pages/article/index"
};
}
});
pages/article/index.js 第105行 变量未定义,所有没有uid属性
比如 a.uid,a如果未定义,就会报这个错
不是告诉你问题了,uid没有定义
Cannot read property 'uid' of undefined,空值