index.js 710 B

123456789101112131415161718192021222324252627282930313233
  1. const app = getApp()
  2. const httpUtils = require('../../utils/http.js')
  3. const ui = require('../../utils/ui.js')
  4. Page({
  5. data: {
  6. phone: ''
  7. },
  8. getInputName(e){
  9. this.setData({
  10. phone: e.detail.value
  11. })
  12. },
  13. toSubmit() {
  14. let phoneNumber = this.data.phone;
  15. let obj = {
  16. url: '/phoneInfo',
  17. data: {
  18. phone: phoneNumber,
  19. openId: wx.getStorageSync('openId')
  20. }
  21. }
  22. httpUtils.request(obj).then(res=>{
  23. console.log(res)
  24. wx.setStorageSync('token', res.data.data.token)
  25. wx.setStorageSync('phone', phoneNumber)
  26. wx.switchTab({
  27. url: '/pages/list/index',
  28. })
  29. }).catch(err=>{
  30. console.log('ERROR')
  31. });
  32. }
  33. })