收藏
回答

showToast:fail parameter error: parameter.title?

 wx.request({

        url: apiUrl,

        header: {

          'content-type': 'application/x-www-form-urlencoded',

          'Cookie': 'PHPSESSID=' + wx.getStorageSync('pingshifen_PHPSESSID')

        },

        data: {

          method: 'pingshifen.student.bind',

          name: this.data.name,

          tel: this.data.tel,

          school: this.data.school,

          num: this.data.num,

          enter_year: this.data.year[this.data.yearIndex],

          user_type: this.data.role_list.selectedId,

        },

        method: 'POST',

        success: res => {

          wx.hideLoading()

          if (res.data.success == true{

            wx.showToast({

              title: res.data.message,

              icon:'success',

            })

            wx.setStorageSync('pingshifen_user_type', '1')

            wx.reLaunch({

              url: '/pages/index/index',

            })

          } else {

            wx.showToast({

              title: res.data.message,

              icon: 'none'

            })

          }

        },

        fail: res => {

          wx.hideLoading()

          wx.showToast({

            title: '绑定失败',

            icon:'none'

          })

        },

        conplete: res => {

          wx.hideLoading()

        }

      })

    }


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

2 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    2022-05-10

    你好,请按照错误提示修改,title需为string类型

    2022-05-10
    有用
    回复
  • a云墨
    a云墨
    2022-05-09

    2022-05-09
    有用
    回复
登录 后发表内容