person.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. const app = getApp()
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. hasUserInfo: false
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad: async function (options) {
  13. // let userInfo = await app.getWxUserInfo()
  14. // if (userInfo) {
  15. // this.setData({
  16. // userInfo: userInfo,
  17. // hasUserInfo: true,
  18. // })
  19. // }
  20. },
  21. /**
  22. * 生命周期函数--监听页面初次渲染完成
  23. */
  24. onReady: function () {
  25. },
  26. /**
  27. * 生命周期函数--监听页面显示
  28. */
  29. onShow: async function () {
  30. },
  31. /**
  32. * 生命周期函数--监听页面隐藏
  33. */
  34. onHide: function () {
  35. },
  36. /**
  37. * 生命周期函数--监听页面卸载
  38. */
  39. onUnload: function () {
  40. },
  41. /**
  42. * 页面相关事件处理函数--监听用户下拉动作
  43. */
  44. onPullDownRefresh: function () {
  45. },
  46. /**
  47. * 页面上拉触底事件的处理函数
  48. */
  49. onReachBottom: function () {
  50. },
  51. /**
  52. * 用户点击右上角分享
  53. */
  54. onShareAppMessage: function () {
  55. },
  56. getInfo: async function (e) {
  57. // const _self = this
  58. // let userInfo = e.detail.userInfo
  59. // console.log(userInfo);
  60. // userInfo['encryptedData'] = e.detail.encryptedData
  61. // userInfo['iv'] = e.detail.iv
  62. // let info = await app.wxLogin(userInfo);
  63. // _self.setData({
  64. // hasUserInfo: true,
  65. // userInfo: info,
  66. // })
  67. },
  68. getUserProfile: function(e){
  69. wx.getUserProfile({
  70. desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
  71. success: (res) => {
  72. console.log(res);
  73. // res.userInfo['encryptedData'] = res.encryptedData
  74. // res.userInfo['iv'] = res.iv
  75. let info = app.wxLogin(res.userInfo);
  76. this.setData({
  77. userInfo: res.userInfo,
  78. hasUserInfo: true
  79. })
  80. }
  81. })
  82. },
  83. gotoCollection: async function (e) {
  84. // const isAuth = await app.isAuth()
  85. // if (!isAuth) {
  86. // wx.redirectTo({
  87. // url: '/pages/prompt/prompt?page=pages/collection/collection',
  88. // })
  89. // return
  90. // }
  91. wx.navigateTo({
  92. url: '../collection/collection',
  93. })
  94. },
  95. gotoPersonInfo: function (e) {
  96. wx.navigateTo({
  97. url: '../personinfo/personinfo',
  98. })
  99. },
  100. gotoRecord: function (e) {
  101. wx.navigateTo({
  102. url: '../record/record',
  103. })
  104. },
  105. gotoResume:function(){
  106. wx.navigateTo({
  107. url: '../resume/resume?type=1',
  108. })
  109. }
  110. // getMobile: async function (params) {
  111. // console.log(params);
  112. // let _self = this
  113. // const data = {
  114. // encryptedData:params.detail.encryptedData,
  115. // iv: params.detail.iv
  116. // }
  117. // const userInfo = await app.getPhoneNumber(data)
  118. // console.log(userInfo)
  119. // let hasMobile = false
  120. // if (userInfo.mobile > 1) {
  121. // hasMobile:true
  122. // }
  123. // _self.setData({
  124. // hasMobile: hasMobile,
  125. // mobile: userInfo.mobile,
  126. // userInfo
  127. // })
  128. // },
  129. })