You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 anno fa
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. const reqInterface = require('../../../api/models');
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. message: false,
  8. modalContent: '本系统将会获取您的手机号和微信用户信息以用于联系以及显示头像和名称'
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad(options) {
  14. },
  15. /**
  16. * 生命周期函数--监听页面初次渲染完成
  17. */
  18. onReady() {
  19. },
  20. /**
  21. * 生命周期函数--监听页面显示
  22. */
  23. onShow() {
  24. },
  25. getUserProfile() {
  26. let self = this;
  27. wx.login({
  28. success: (res) => {
  29. console.log(res)
  30. reqInterface.Login({
  31. grantType: 'code',
  32. code: res.code,
  33. userType: 2
  34. }).then(res => {
  35. wx.setStorageSync('token', res.accessToken);
  36. wx.reLaunch({
  37. url: '/pages/home/index/index',
  38. })
  39. })
  40. },
  41. })
  42. },
  43. getMessage() {
  44. let self = this;
  45. wx.showModal({
  46. title: '登录须知',
  47. content: self.data.modalContent,
  48. confirmText: '我已知晓',
  49. showCancel: false
  50. })
  51. },
  52. /**
  53. * 生命周期函数--监听页面隐藏
  54. */
  55. onHide() {
  56. },
  57. /**
  58. * 生命周期函数--监听页面卸载
  59. */
  60. onUnload() {
  61. },
  62. /**
  63. * 页面相关事件处理函数--监听用户下拉动作
  64. */
  65. onPullDownRefresh() {
  66. },
  67. /**
  68. * 页面上拉触底事件的处理函数
  69. */
  70. onReachBottom() {
  71. },
  72. /**
  73. * 用户点击右上角分享
  74. */
  75. onShareAppMessage() {
  76. }
  77. })