certification.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. const app = getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. userInfo:{},
  8. hasUserInfo:false,
  9. canIUse:wx.canIUse('button.open-type.getUserInfo'),
  10. listData:[
  11. {
  12. text:'"分类"频道展示',
  13. background:"#f1f1f1"
  14. },
  15. {
  16. text: '提现金额增至15万元',
  17. background: "#f6f6f6"
  18. },
  19. {
  20. text: '创建产品库',
  21. background: "#f1f1f1"
  22. },
  23. {
  24. text: '参加平台活动',
  25. background: "#f6f6f6"
  26. },
  27. {
  28. text: '黑名单数增至320',
  29. background: "#f1f1f1"
  30. },
  31. {
  32. text: '拍品预展功能',
  33. background: "#f6f6f6"
  34. },
  35. {
  36. text: '专属认证标记',
  37. background: "#f1f1f1"
  38. },
  39. {
  40. text: '增加点赞次数',
  41. background: "#f6f6f6"
  42. },
  43. ]
  44. },
  45. /**
  46. * 生命周期函数--监听页面加载
  47. */
  48. onLoad: function (options) {
  49. if(app.globalData.userInfo){
  50. this.setData({
  51. userInfo:app.globalData.userInfo,
  52. hasUserInfo:true
  53. })
  54. }else if (this.data.canIUse) {
  55. app.userInfoReadyCallback = res => {
  56. this.setData({
  57. userInfo: res.userInfo,
  58. hasUserInfo: true
  59. })
  60. }
  61. }else{
  62. wx.getUserInfo({
  63. success: res => {
  64. app.globalData.userInfo = res.userInfo
  65. this.setData({
  66. userInfo: res.userInfo,
  67. hasUserInfo: true
  68. })
  69. }
  70. })
  71. }
  72. },
  73. /**
  74. * 生命周期函数--监听页面初次渲染完成
  75. */
  76. onReady: function () {
  77. },
  78. /**
  79. * 生命周期函数--监听页面显示
  80. */
  81. onShow: function () {
  82. },
  83. /**
  84. * 生命周期函数--监听页面隐藏
  85. */
  86. onHide: function () {
  87. },
  88. /**
  89. * 生命周期函数--监听页面卸载
  90. */
  91. onUnload: function () {
  92. },
  93. /**
  94. * 页面相关事件处理函数--监听用户下拉动作
  95. */
  96. onPullDownRefresh: function () {
  97. },
  98. /**
  99. * 页面上拉触底事件的处理函数
  100. */
  101. onReachBottom: function () {
  102. }
  103. })