东风启辰小程序端
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.

5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. authenticationStatus:false,
  21. authenticationShow:false
  22. },
  23. /**
  24. * 关闭提示弹窗
  25. */
  26. hiddenTip(){
  27. this.setData({
  28. maskShow: false,
  29. tipShow: false
  30. })
  31. },
  32. getUserWxMsg:function(e){//通过微信获取用户信息
  33. if (e.detail.errMsg == "getUserInfo:ok") {
  34. if(this.data.isbtn){
  35. this.setData({isbtn: false})
  36. }else{
  37. return;
  38. }
  39. this.data.userData.avatarUrl = e.detail.userInfo.avatarUrl;
  40. this.data.userData.nickName = e.detail.userInfo.nickName;
  41. this.data.userData.userLevel = 0;
  42. this.setData({
  43. userData: this.data.userData
  44. })
  45. app.submitUserMsg(e.detail.userInfo.avatarUrl, e.detail.userInfo.nickName);
  46. wx.navigateTo({
  47. url:'../poster/poster'
  48. })
  49. }
  50. },
  51. getUserInfo:function(e){//获取个人信息
  52. if(this.data.isbtn){
  53. this.setData({isbtn: false})
  54. }else{
  55. return;
  56. }
  57. app.wxRequest(app.globalData.urlRoot + 'userInfo/getUserInfo', {}, res => {
  58. if(res.code==200){
  59. // res.data.userLevel = 3;
  60. if (res.data) {
  61. this.data.userData.avatarUrl = res.data.avatarUrl;
  62. this.data.userData.nickName = res.data.nickName;
  63. this.data.userData.userLevel = res.data.userLevel;
  64. this.setData({
  65. userData: this.data.userData
  66. })
  67. wx.navigateTo({
  68. url:'../poster/poster'
  69. })
  70. }
  71. }else{
  72. this.setData({isbtn: true})
  73. }
  74. },this)
  75. },
  76. /**
  77. * 海报页
  78. */
  79. getPoster:function(){
  80. if (this.data.authenticationStatus) {
  81. wx.navigateTo({
  82. url: '../poster/poster'
  83. })
  84. }else{
  85. this.setData({
  86. authenticationShow:true
  87. })
  88. }
  89. },
  90. // getCertificationInfo: function () {//查询认证状态
  91. // app.wxRequest(app.globalData.urlRoot + 'userInfo/getCertificationInfo', {}, res => {
  92. // if (res.code == 200 && res.data && res.data.agentDetail) {
  93. // this.data.authenticationStatus = true;
  94. // }
  95. // }, this)
  96. // },
  97. /**
  98. * 生命周期函数--监听页面加载
  99. */
  100. onLoad: function (options) {
  101. app.globalData.nowPage = 2;
  102. },
  103. /**
  104. * 生命周期函数--监听页面初次渲染完成
  105. */
  106. onReady: function () {
  107. },
  108. /**
  109. * 生命周期函数--监听页面显示
  110. */
  111. onShow: function () {
  112. // if (app.globalData.openid) {
  113. // this.getCertificationInfo();
  114. // } else {
  115. // app.globalData.openidSuccessFuc = this.getCertificationInfo;
  116. // }
  117. if (app.globalData.authenticationStatus && app.globalData.authenticationStatus.agentDetail){
  118. this.data.authenticationStatus = true;
  119. this.setData({
  120. authenticationShow:false
  121. })
  122. }
  123. // app.globalData.certificationState=2;
  124. this.setData({maskid: app.globalData.certificationState})
  125. if(app.globalData.certificationState==1){
  126. this.setData({titleContent:'尊敬的启辰车主您好'})
  127. }else if(app.globalData.certificationState==2){
  128. this.setData({titleContent:'尊敬的合伙人您好'})
  129. }else if(app.globalData.certificationState==3){
  130. this.setData({titleContent:'尊敬的同事您好'})
  131. }else if(app.globalData.certificationState==4){
  132. this.setData({titleContent:'尊敬的星探顾问'})
  133. }
  134. if(app.globalData.userInfoData==null){
  135. this.setData({iconShow:true})
  136. }else{
  137. this.setData({iconShow:false})
  138. }
  139. this.setData({isbtn: true})
  140. // wx.navigateTo({
  141. // url: './share/share'
  142. // })
  143. },
  144. /**
  145. * 生命周期函数--监听页面隐藏
  146. */
  147. onHide: function () {
  148. },
  149. /**
  150. * 生命周期函数--监听页面卸载
  151. */
  152. onUnload: function () {
  153. },
  154. /**
  155. * 页面相关事件处理函数--监听用户下拉动作
  156. */
  157. onPullDownRefresh: function () {
  158. },
  159. /**
  160. * 页面上拉触底事件的处理函数
  161. */
  162. onReachBottom: function () {
  163. },
  164. /**
  165. * 用户点击右上角分享
  166. */
  167. onShareAppMessage: function () {
  168. return app.sharePack();
  169. },
  170. changeAuthenticationShow:function(){
  171. this.setData({
  172. authenticationShow: !this.data.authenticationShow
  173. })
  174. },
  175. enterMsg: function () {//去补充资料
  176. wx.navigateTo({
  177. url: '/pages/supplement/supplement',
  178. })
  179. }
  180. })