收藏
回答

ide调试能正常获取数据库内容,但是发布手机后没响应

框架类型 问题类型 终端类型 微信版本 基础库版本
小程序 Bug 工具 最新 最新的
clickAction({ detail }) {
    const { index } = detail;
    this.setData({
      [`actions[${index}].loading`]: true
    });
    console.log(detail.index);
    if (detail.index === 0){
      var that = this;
      wx.request({
        url: 'httpS://hn2.api.okayapi.com/?&service=App.Table.FreeQuery&model_name=safe2&where=[["newID","LIKE","%配方库%"]]&page=1&perpage=500&order=["newID DESC"]&app_key=88DE9116279020C73DFC327&sign=DBEC0C74EAC74C64B9D741F98C78DD15',
        header: {
          'content-type': 'application/json' // 默认值
        },
        success: function (res) {
          console.log(res.data.data.list)
          that.setData({
            list1: res.data.data.list
          });
        }
      })
      console.log('ok')
      this.setData({
        classname: '配方库编号▼'
      })
    } else if (detail.index === 1) {
      var that = this;
      wx.request({
        url: 'httpS://hn2.api.okayapi.com/?&service=App.Table.FreeQuery&model_name=safe2&where=[["newID","LIKE","%辅料库%"]]&page=1&perpage=500&order=["newID DESC"]&app_key=88DE911C912A3CBB6279020C73DFC327&sign=DBEC0C74EAC74C678DD15',
        header: {
          'content-type': 'application/json' // 默认值
        },
        success: function (res) {
          console.log(res.data.data.list)
          that.setData({
            list1: res.data.data.list
          });
        }
      })
      this.setData({
        classname: '辅料库编号▼'
      });
    } else if (detail.index === 2) {
      var that = this;
      wx.request({
        url: 'httpS://hn2.api.okayapi.com/?&service=App.Table.FreeQuery&model_name=safe2&where=[["newID","LIKE","%成品库%"]]&page=1&perpage=500&order=["newID DESC"]&app_key=88DE911C912A3CBB6279020C73DFC327&sign=DBEC0C74EA1F98C78DD15',
        header: {
          'content-type': 'application/json' // 默认值
        },
        success: function (res) {
          console.log(res.data.data.list)
          that.setData({
            list1: res.data.data.list
          });
        }
      })
      this.setData({
        classname: '成品库编号▼'
      });
    } else if (detail.index === 3)  {
      this.getdata();
      this.setData({
        classname: '所有班组编号▼'
      });
    }
    setTimeout(() => {
      this.setData({
        [`show`]: false,
        [`actions[${index}].loading`]: false
      });
    }, 1500);
  },

if语句的判断有问题吗?classname赋值均能实现

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

1 个回答

登录 后发表内容