forked from nsjcy/frontEnd/nsjcy

liuwh
2020-04-01 de0151aaae18282e885e5ae2d84653d1131a65a4
SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js
@@ -14,10 +14,10 @@
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {},
  onLoad: function(options) {},
  // 输入框内容
  inputHandler: function (event) {
  inputHandler: function(event) {
    var type = event.currentTarget.dataset['type'];
    console.log(type)
    console.log(event.detail.value)
@@ -27,11 +27,23 @@
  },
  //登录
  simulationButton: function () {
  simulationButton: function() {
    const {
      companyAccount,
      companyPassword
    } = this.data;
    if (!companyAccount) {
      return wx.showToast({
        title: '账号不能为空',
        icon: 'none'
      })
    }
    if (!companyPassword) {
      return wx.showToast({
        title: '密码不能为空',
        icon: 'none'
      })
    }
    let that = this;
    wx.request({
      url: app.globalData.url + '/api/socialCompany/loginCheck',
@@ -40,14 +52,14 @@
        companyAccount,
        companyPassword
      },
      success: function (res) {
      success: function(res) {
        console.log(res)
        if (res.data.code == 0) {
          wx.showToast({
            title: '登录成功!',
            icon: 'success',
            duration: 1500,
            success: function () {
            success: function() {
              wx.setStorageSync('id', res.data.data.id)
              setTimeout(() => {
                wx.navigateTo({