东风启辰小程序端
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. // pages/star/star.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. imgUrl: app.globalData.urlStatic,//图片路径
  9. maskShow: false,
  10. ruleShow:false,
  11. phonebol:false,//是否有手机号
  12. getNumber:null,//数字跳跃
  13. starNumber:4000,//开始人数
  14. stopNumber:0,//结束人数
  15. numList:[4,0,0,0],
  16. isbtn:true,//防重复点击
  17. },
  18. /**
  19. * 显示规则页
  20. */
  21. showRule:function(){
  22. this.setData({
  23. maskShow:true,
  24. ruleShow:true
  25. })
  26. },
  27. /**
  28. * 关闭规则页
  29. */
  30. hiddenRule:function(){
  31. this.setData({
  32. maskShow: false,
  33. ruleShow: false
  34. })
  35. },
  36. /**
  37. * 每日任务
  38. */
  39. everyDay:function(){
  40. if(this.data.isbtn){
  41. this.setData({isbtn: false})
  42. }else{
  43. return;
  44. }
  45. wx.navigateTo({url:'../everyday/everyday'})
  46. },
  47. /**
  48. * 星探任务
  49. */
  50. scout:function(){
  51. if(this.data.isbtn){
  52. this.setData({isbtn: false})
  53. }else{
  54. return;
  55. }
  56. this.phonebolb();
  57. },
  58. phonebolb:function(_phone){
  59. app.wxRequest(app.globalData.urlRoot + "userInfo/getCertificationInfo", {}, res => {
  60. if (res.code == 200) {
  61. app.globalData.certificationState = res.data.certificationState;
  62. wx.navigateTo({
  63. url: '/pages/scout/scout'
  64. })
  65. } else if (res.code == -307){
  66. wx.navigateTo({
  67. url: '/pages/mobileVerification/mobileVerification'
  68. })
  69. } else if (res.code == -308) {
  70. wx.navigateTo({
  71. url: '/pages/scout/register/register'
  72. })
  73. }else{
  74. this.setData({isbtn: true})
  75. }
  76. }, this);
  77. },
  78. /**
  79. * 生命周期函数--监听页面加载
  80. */
  81. onLoad: function (options) {
  82. // app.wxRequest(app.globalData.urlRoot + "/admin/certificationNoCar/getCertificationNoCarList", {
  83. // adminState: 0, page:1,count:10
  84. // }, res => {
  85. // console.log(res)
  86. // }, this);
  87. // app.wxRequest(app.globalData.urlRoot + "/admin/certificationNoCar/auditRefuse", { id:4 }, res => {
  88. // console.log(res)
  89. // }, this,"POST");
  90. // app.wxRequest(app.globalData.urlRoot + "/admin/certificationNoCar/auditPass", { id:4 }, res => {
  91. // console.log(res)
  92. // }, this,"POST");
  93. },
  94. /**
  95. * 生命周期函数--监听页面初次渲染完成
  96. */
  97. onReady: function () {
  98. this.setData({
  99. starNumber:4000
  100. })
  101. if (app.globalData.openid) {
  102. this.gettime();
  103. } else {
  104. app.globalData.openidSuccessFuc = this.gettime;
  105. }
  106. },
  107. gettime(){
  108. app.wxRequest(app.globalData.urlRoot + "userInfo/getCertificationCount", {}, res => {
  109. console.log(res)
  110. if (res.code == 200) {
  111. this.setData({
  112. stopNumber: res.data.total
  113. })
  114. if(this.data.stopNumber<10000){
  115. this.setData({
  116. numList: [4,0,0,0]
  117. })
  118. }else{
  119. this.setData({
  120. numList: [0,4,0,0,0]
  121. })
  122. }
  123. this.getNumber=setInterval(this.vCodeDownTime,20);
  124. }
  125. }, this);
  126. },
  127. vCodeDownTime(){
  128. var numb = this.data.starNumber;
  129. numb=Math.floor(this.data.starNumber+(this.data.stopNumber-4000)/80);
  130. if(numb>=this.data.stopNumber){
  131. numb=this.data.stopNumber;
  132. clearInterval(this.getNumber);
  133. }
  134. this.setData({
  135. starNumber: numb,
  136. numList:numb.toString().split("")
  137. })
  138. },
  139. getPhone (e) {
  140. console.log(e.detail)
  141. if (e.detail.errMsg=='getPhoneNumber:ok'){
  142. if(this.data.isbtn){
  143. this.setData({isbtn: false})
  144. }else{
  145. return;
  146. }
  147. app.getMobile(e.detail.encryptedData, e.detail.iv,res=>{
  148. if (res.code == 200) {
  149. if (res.data.result == 0) {
  150. this.phonebolb(res.data.decodeData.phoneNumber);
  151. app.globalData.userMobile = res.data.decodeData.phoneNumber;
  152. } else {
  153. this.setData({ isbtn: true })
  154. wx.showToast({ title: '获取失败', icon: "none" })
  155. }
  156. } else {
  157. this.setData({ isbtn: true })
  158. wx.showToast({ title: res.msg, icon: "none" })
  159. }
  160. },this)
  161. }
  162. },
  163. /**
  164. * 生命周期函数--监听页面显示
  165. */
  166. onShow: function () {
  167. console.log(app.globalData.userMobile)
  168. if(app.globalData.userMobile==null){
  169. this.setData({phonebol: true})
  170. }else{
  171. this.setData({phonebol: false})
  172. }
  173. this.setData({isbtn: true})
  174. // wx.navigateTo({
  175. // url: '../scout/register/register'
  176. // })
  177. },
  178. /**
  179. * 生命周期函数--监听页面隐藏
  180. */
  181. onHide: function () {
  182. },
  183. /**
  184. * 生命周期函数--监听页面卸载
  185. */
  186. onUnload: function () {
  187. },
  188. /**
  189. * 页面相关事件处理函数--监听用户下拉动作
  190. */
  191. onPullDownRefresh: function () {
  192. },
  193. /**
  194. * 页面上拉触底事件的处理函数
  195. */
  196. onReachBottom: function () {
  197. },
  198. /**
  199. * 用户点击右上角分享
  200. */
  201. onShareAppMessage: function () {
  202. return app.sharePack();
  203. }
  204. })