收藏
回答

系统错误:undefined 出现{deviceid: "undefined"}无法解决?

回答关注问题邀请回答
收藏

1 个回答

  • brave
    brave
    2020-07-28

    2020-07-28
    有用 2
    回复 8
    • brave
      brave
      2020-07-28
      代码都不贴一下,自己看看怎么传的值
      2020-07-28
      回复
    • 史努比
      史努比
      2020-07-28回复brave
      var t = new (require("index-model.js").Index)();
      getApp();
      Page({
          data: {
              currentTab: 0,
              tabTitles: [],
              currentType: 0,
              typeList: [],
              contentList: [],
              toBottom: !1,
              toTop: 0
          },
          getTabList: function(e) {
              var n = this, i = e.currentTarget.dataset.id;
              t.getRecycleBrand(i, function(e) {
                  t.getRecycleVersion(i, 0, function(t) {
                      n.setData({
                          typeList: e.list,
                          currentTab: i,
                          contentList: t.list,
                          currentType: 0,
                          toBottom: !1,
                          toTop: 0
                      });
                  });
              });
          },
          getTypeList: function(e) {
              var n = this, i = e.currentTarget.dataset.id, o = this.data.currentTab;
              t.getRecycleVersion(o, i, function(t) {
                  n.setData({
                      contentList: t.list,
                      currentType: i,
                      toBottom: !1,
                      toTop: 0
                  });
              });
          },
          toLower: function(t) {
              this.setData({
                  toBottom: !0
              });
          },
          linkToEvaluate: function(t) {
              var e = t.currentTarget.dataset.id;
              wx.navigateTo({
                  url: "../index/evaluate?versionid=" + e
              });
          },
          linkToSearch: function() {
              wx.navigateTo({
                  url: "../index/search"
              });
          },
          onLoad: function(e) {
              var n = this;
              console.log(e);
              var i = e.deviceid;
              t.getRecycleDevice(function(e) {
                  var o = e.list, a = o[0].id;
                  "" != i && (a = i), n.setData({
                      tabTitles: o,
                      currentTab: a
                  }), t.getRecycleBrand(a, function(e) {
                      n.setData({
                          typeList: e.list
                      }), t.getRecycleVersion(a, 0, function(t) {
                          n.setData({
                              contentList: t.list
                          });
                      });
                  });
              });
          },
          onPullDownRefresh: function() {
              wx.stopPullDownRefresh();
          }
      });
      2020-07-28
      回复
    • 史努比
      史努比
      2020-07-28
      这个是报错的代码
      2020-07-28
      回复
    • brave
      brave
      2020-07-28回复史努比
      不要这个页面的,是说上个页面,跳过来的代码咋写的,还有你这个代码一看就不是自己写的,买的代码?还是反编译的?
      2020-07-28
      回复
    • 史努比
      史努比
      2020-07-28
      }, util.getUserInfo = function(e) {
          var t = function() {
              console.log("start login");
              var t = {
                  sessionid: "",
                  wxInfo: "",
                  memberInfo: ""
              };
              wx.login({
                  success: function(n) {
                      util.request({
                          url: "auth/session/openid",
                          data: {
                              code: n.code
                          },
                          cachetime: 0,
                          success: function(n) {
                              n.data.errno || (t.sessionid = n.data.data.sessionid, wx.setStorageSync("userInfo", t),
                              wx.getUserInfo({
                                  success: function(n) {
                                      t.wxInfo = n.userInfo, wx.setStorageSync("userInfo", t), util.request({
                                          url: "auth/session/userinfo",
                                          data: {
                                              signature: n.signature,
                                              rawData: n.rawData,
                                              iv: n.iv,
                                              encryptedData: n.encryptedData
                                          },
                                          method: "POST",
                                          header: {
                                              "content-type": "application/x-www-form-urlencoded"
                                          },
                                          cachetime: 0,
                                          success: function(n) {
                                              n.data.errno || (t.memberInfo = n.data.data, wx.setStorageSync("userInfo", t)),
                                              "function" == typeof e && e(t);
                                          }
                                      });
                                  },
                                  fail: function() {
                                      "function" == typeof e && e(t);
                                  },
                                  complete: function() {}
                              }));
                          }
                      });
                  },
                  fail: function() {
                      wx.showModal({
                          title: "获取信息失败",
                          content: "请允许授权以便为您提供给服务",
                          success: function(e) {
                              e.confirm && util.getUserInfo();
                          }
                      });
                  }
              });
          }, n = wx.getStorageSync("userInfo");
          n.sessionid ? wx.checkSession({
              success: function() {
                  "function" == typeof e && e(n);
              },
              fail: function() {
                  n.sessionid = "", console.log("relogin"), wx.removeStorageSync("userInfo"), t();
              }
          }) : t();
      }, util.navigateBack = function(e) {
          var t = e.delta ? e.delta : 1;
          if (e.data) {
              var n = getCurrentPages(), a = n[n.length - (t + 1)];
              a.pageForResult ? a.pageForResult(e.data) : a.setData(e.data);
          }
          wx.navigateBack({
              delta: t,
              success: function(t) {
                  "function" == typeof e.success && e.success(t);
              },
              fail: function(t) {
                  "function" == typeof e.fail && e.function(t);
              },
              complete: function() {
                  "function" == typeof e.complete && e.complete();
              }
          });
      }, util.footer = function(e) {
          var t = e, n = getApp().tabBar;
          for (var a in n.list) n.list[a].pageUrl = n.list[a].pagePath.replace(/(\?|#)[^"]*/g, "");
          t.setData({
              tabBar: n,
              "tabBar.thisurl": t.__route__
          });
      }, util.message = function(e, t, n) {
          if (!e) return !0;
          if ("object" == (void 0 === e ? "undefined" : _typeof(e)) && (t = e.redirect, n = e.type,
          e = e.title), t) {
              var a = t.substring(0, 9), r = "", i = "";
              "navigate:" == a ? (i = "navigateTo", r = t.substring(9)) : "redirect:" == a ? (i = "redirectTo",
              r = t.substring(9)) : (r = t, i = "redirectTo");
          }
          console.log(r), n || (n = "success"), "success" == n ? wx.showToast({
              title: e,
              icon: "success",
              duration: 2e3,
              mask: !!r,
              complete: function() {
                  r && setTimeout(function() {
                      wx[i]({
                          url: r
                      });
                  }, 1800);
              }
          }) : "error" == n && wx.showModal({
              title: "系统信息",
              content: e,
              showCancel: !1,
              complete: function() {
                  r && wx[i]({
                      url: r
                  });
              }
          });
      }, util.user = util.getUserInfo, util.showLoading = function() {
          wx.getStorageSync("isShowLoading") && (wx.hideLoading(), wx.setStorageSync("isShowLoading", !1)),
          wx.showLoading({
              title: "加载中",
              complete: function() {
                  wx.setStorageSync("isShowLoading", !0);
              },
              fail: function() {
                  wx.setStorageSync("isShowLoading", !1);
              }
          });
      }, util.showImage = function(e) {
          var t = e ? e.currentTarget.dataset.preview : "";
          if (!t) return !1;
          wx.previewImage({
              urls: [ t ]
          });
      2020-07-28
      回复
    查看更多(3)
登录 后发表内容
问题标签