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