| | |
| | | data: { |
| | | src: app.globalData.imgUrl + '/image/bg1.jpg', |
| | | logo: app.globalData.imgUrl + '/image/logo.png', |
| | | companyAccount: 'admin456', |
| | | companyPassword: 'admin' |
| | | companyAccount: '', |
| | | companyPassword: '' |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | 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) |
| | |
| | | }, |
| | | |
| | | //登录 |
| | | 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', |
| | |
| | | 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({ |