东风启辰小程序端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

158 行
3.5KB

  1. // pages/scout/scout.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. imgUrl: app.globalData.urlStatic,//图片路径
  9. maskShow: true,
  10. tipShow:true,
  11. iconShow:true,//是否有头像
  12. titleContent:'尊敬的启辰车主您好',
  13. userData:{
  14. avatarUrl: null,
  15. nickName: null,
  16. userLevel: 0
  17. },
  18. isbtn:true,//防重复点击
  19. maskid:0,//现实的弹窗
  20. },
  21. /**
  22. * 关闭提示弹窗
  23. */
  24. hiddenTip(){
  25. this.setData({
  26. maskShow: false,
  27. tipShow: false
  28. })
  29. },
  30. getUserWxMsg:function(e){//通过微信获取用户信息
  31. if (e.detail.errMsg == "getUserInfo:ok") {
  32. if(this.data.isbtn){
  33. this.setData({isbtn: false})
  34. }else{
  35. return;
  36. }
  37. this.data.userData.avatarUrl = e.detail.userInfo.avatarUrl;
  38. this.data.userData.nickName = e.detail.userInfo.nickName;
  39. this.data.userData.userLevel = 0;
  40. this.setData({
  41. userData: this.data.userData
  42. })
  43. app.submitUserMsg(e.detail.userInfo.avatarUrl, e.detail.userInfo.nickName);
  44. wx.navigateTo({
  45. url:'../poster/poster'
  46. })
  47. }
  48. },
  49. getUserInfo:function(e){//获取个人信息
  50. if(this.data.isbtn){
  51. this.setData({isbtn: false})
  52. }else{
  53. return;
  54. }
  55. app.wxRequest(app.globalData.urlRoot + 'userInfo/getUserInfo', {}, res => {
  56. if(res.code==200){
  57. // res.data.userLevel = 3;
  58. if (res.data) {
  59. this.data.userData.avatarUrl = res.data.avatarUrl;
  60. this.data.userData.nickName = res.data.nickName;
  61. this.data.userData.userLevel = res.data.userLevel;
  62. this.setData({
  63. userData: this.data.userData
  64. })
  65. wx.navigateTo({
  66. url:'../poster/poster'
  67. })
  68. }
  69. }else{
  70. this.setData({isbtn: true})
  71. }
  72. },this)
  73. },
  74. /**
  75. * 海报页
  76. */
  77. getPoster:function(){
  78. wx.navigateTo({
  79. url:'../poster/poster'
  80. })
  81. },
  82. /**
  83. * 生命周期函数--监听页面加载
  84. */
  85. onLoad: function (options) {
  86. },
  87. /**
  88. * 生命周期函数--监听页面初次渲染完成
  89. */
  90. onReady: function () {
  91. },
  92. /**
  93. * 生命周期函数--监听页面显示
  94. */
  95. onShow: function () {
  96. // app.globalData.certificationState=4;
  97. this.setData({maskid: app.globalData.certificationState})
  98. if(app.globalData.certificationState==1){
  99. this.setData({titleContent:'尊敬的启辰车主您好'})
  100. }else if(app.globalData.certificationState==2){
  101. this.setData({titleContent:'尊敬的合伙人您好'})
  102. }else if(app.globalData.certificationState==3){
  103. this.setData({titleContent:'尊敬的同事您好'})
  104. }else if(app.globalData.certificationState==4){
  105. this.setData({titleContent:'尊敬的星探顾问'})
  106. }
  107. if(app.globalData.userInfoData==null){
  108. this.setData({iconShow:true})
  109. }else{
  110. this.setData({iconShow:false})
  111. }
  112. this.setData({isbtn: true})
  113. // wx.navigateTo({
  114. // url: './share/share'
  115. // })
  116. },
  117. /**
  118. * 生命周期函数--监听页面隐藏
  119. */
  120. onHide: function () {
  121. },
  122. /**
  123. * 生命周期函数--监听页面卸载
  124. */
  125. onUnload: function () {
  126. },
  127. /**
  128. * 页面相关事件处理函数--监听用户下拉动作
  129. */
  130. onPullDownRefresh: function () {
  131. },
  132. /**
  133. * 页面上拉触底事件的处理函数
  134. */
  135. onReachBottom: function () {
  136. },
  137. /**
  138. * 用户点击右上角分享
  139. */
  140. onShareAppMessage: function () {
  141. return app.sharePack();
  142. }
  143. })