收藏
回答

各位帮我看看啊,这是什么情况?

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.(http://127.0.0.1:31020/appservice/__dev__/asdebug.js:1:28236)

    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


最后一次编辑于  2019-10-04
回答关注问题邀请回答
收藏

4 个回答

  • Hanks🇨🇳
    Hanks🇨🇳
    2019-10-04

    把你代码,弄个代码片段发出来,你就发两行,谁能帮你看,帮你改?先学会问问题呀

    2019-10-04
    赞同
    回复 4
    • wei
      wei
      2019-10-04
      var app = getApp();

      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"
      };
      }
      });
      2019-10-04
      回复
    • wei
      wei
      2019-10-04
      是这个吗?
      2019-10-04
      回复
    • Hanks🇨🇳
      Hanks🇨🇳
      2019-10-04回复wei
      你这个uid 是i.memberInfo 里边的,你的i.memberInfo是不是null呢?还有,你这个代码是扒的别人的吧,导入进来你得导入全了啊,顺杆爬,找出来哪些没有引入
      2019-10-04
      回复
    • wei
      wei
      2019-10-04回复Hanks🇨🇳
      恩是别人的,之前在虚拟主机上,支付不行,没出现别的问题,这次用云服务 然后搭建的宝塔 现在就出现这个问题了~~小哥有QQ吗,可以帮看看吗?
      2019-10-04
      回复
  • o0o有脾气的酸奶
    o0o有脾气的酸奶
    2019-10-04

    pages/article/index.js 第105行  变量未定义,所有没有uid属性

    比如 a.uid,a如果未定义,就会报这个错

    2019-10-04
    赞同
    回复 1
    • wei
      wei
      2019-10-04
      小哥帮看看 怎么改?
      2019-10-04
      回复
  • 少年啦
    少年啦
    2019-10-04

    不是告诉你问题了,uid没有定义

    2019-10-04
    赞同
    回复 1
    • wei
      wei
      2019-10-04
      我是 小白,不懂,小哥,这个要怎么改一下才可以用呢?
      2019-10-04
      回复
  • Gavin²⁰¹⁹
    Gavin²⁰¹⁹
    2019-10-04

    Cannot read property 'uid' of undefined,空值

    2019-10-04
    赞同
    回复 1
    • wei
      wei
      2019-10-04
      我是 小白,不懂,小哥,这个要怎么改一下才可以用呢?
      2019-10-04
      回复
登录 后发表内容
问题标签