东风启辰小程序端
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 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. if (app.globalData.entered) {
  27. this.everyDay();
  28. }else{
  29. wx.navigateTo({
  30. url: '/pages/fragmentRule/fragmentRule'
  31. })
  32. }
  33. },
  34. /**
  35. * 关闭规则页
  36. */
  37. hiddenRule:function(){
  38. this.setData({
  39. maskShow: false,
  40. ruleShow: false
  41. })
  42. },
  43. /**
  44. * 每日任务
  45. */
  46. everyDay:function(){
  47. if(this.data.isbtn){
  48. this.setData({isbtn: false})
  49. }else{
  50. return;
  51. }
  52. wx.navigateTo({url:'../everyday/everyday'})
  53. },
  54. /**
  55. * 星探任务
  56. */
  57. scout:function(){
  58. if(this.data.isbtn){
  59. this.setData({isbtn: false})
  60. }else{
  61. return;
  62. }
  63. this.phonebolb();
  64. },
  65. phonebolb:function(_phone){
  66. app.wxRequest(app.globalData.urlRoot + "userInfo/getCertificationInfo", {}, res => {
  67. if (res.code == 200) {
  68. app.globalData.authenticationStatus = res.data;
  69. if (!app.globalData.certificationInfo) {
  70. app.globalData.certificationInfo = true;
  71. wx.setStorageSync("certificationInfo", true);
  72. }
  73. app.globalData.certificationState = res.data.certificationState;
  74. wx.navigateTo({
  75. url: '/pages/scout/scout'
  76. })
  77. } else if (res.code == -307){
  78. wx.navigateTo({
  79. url: '/pages/mobileVerification/mobileVerification'
  80. })
  81. } else if (res.code == -308) {
  82. wx.navigateTo({
  83. url: '/pages/scout/register/register'
  84. })
  85. }else{
  86. this.setData({isbtn: true})
  87. }
  88. }, this);
  89. },
  90. /**
  91. * 生命周期函数--监听页面加载
  92. */
  93. onLoad: function (options) {
  94. app.globalData.nowPage = 2;
  95. // app.wxRequest(app.globalData.urlRoot + "/admin/certificationNoCar/getCertificationNoCarList", {
  96. // adminState: 0, page:1,count:10
  97. // }, res => {
  98. // console.log(res)
  99. // }, this);
  100. // app.wxRequest(app.globalData.urlRoot + "/admin/certificationNoCar/auditRefuse", { id:4 }, res => {
  101. // console.log(res)
  102. // }, this,"POST");
  103. // app.wxRequest(app.globalData.urlRoot + "/admin/certificationNoCar/auditPass", { id:4 }, res => {
  104. // console.log(res)
  105. // }, this,"POST");
  106. },
  107. /**
  108. * 生命周期函数--监听页面初次渲染完成
  109. */
  110. onReady: function () {
  111. this.setData({
  112. starNumber:4000
  113. })
  114. if (app.globalData.openid) {
  115. this.gettime();
  116. } else {
  117. app.globalData.openidSuccessFuc = this.gettime;
  118. }
  119. },
  120. gettime(){
  121. app.wxRequest(app.globalData.urlRoot + "userInfo/getCertificationCount", {}, res => {
  122. console.log(res)
  123. if (res.code == 200) {
  124. if (res.data){
  125. this.setData({
  126. stopNumber: res.data.total ? res.data.total : '0000'
  127. })
  128. } else {
  129. this.setData({
  130. stopNumber: '0000'
  131. })
  132. }
  133. if (this.data.stopNumber < 10000) {
  134. this.setData({
  135. numList: [4, 0, 0, 0]
  136. })
  137. } else {
  138. this.setData({
  139. numList: [0, 4, 0, 0, 0]
  140. })
  141. }
  142. this.getNumber = setInterval(this.vCodeDownTime, 20);
  143. }
  144. }, this);
  145. },
  146. vCodeDownTime(){
  147. var numb = this.data.starNumber;
  148. numb=Math.floor(this.data.starNumber+(this.data.stopNumber-4000)/80);
  149. if(numb>=this.data.stopNumber){
  150. numb=this.data.stopNumber;
  151. clearInterval(this.getNumber);
  152. }
  153. this.setData({
  154. starNumber: numb,
  155. numList:numb.toString().split("")
  156. })
  157. },
  158. getPhone (e) {
  159. console.log(e.detail)
  160. if (e.detail.errMsg=='getPhoneNumber:ok'){
  161. if(this.data.isbtn){
  162. this.setData({isbtn: false})
  163. }else{
  164. return;
  165. }
  166. app.getMobile(e.detail.encryptedData, e.detail.iv,res=>{
  167. if (res.code == 200) {
  168. if (res.data.result == 0) {
  169. this.phonebolb(res.data.decodeData.phoneNumber);
  170. app.globalData.userMobile = res.data.decodeData.phoneNumber;
  171. } else {
  172. this.setData({ isbtn: true })
  173. wx.showToast({ title: '获取失败', icon: "none" })
  174. }
  175. } else {
  176. this.setData({ isbtn: true })
  177. wx.showToast({ title: res.msg, icon: "none" })
  178. }
  179. },this)
  180. }
  181. },
  182. /**
  183. * 生命周期函数--监听页面显示
  184. */
  185. onShow: function () {
  186. if(app.globalData.userMobile==null){
  187. this.setData({phonebol: true})
  188. }else{
  189. this.setData({phonebol: false})
  190. }
  191. this.setData({isbtn: true})
  192. },
  193. /**
  194. * 生命周期函数--监听页面隐藏
  195. */
  196. onHide: function () {
  197. },
  198. /**
  199. * 生命周期函数--监听页面卸载
  200. */
  201. onUnload: function () {
  202. },
  203. /**
  204. * 页面相关事件处理函数--监听用户下拉动作
  205. */
  206. onPullDownRefresh: function () {
  207. },
  208. /**
  209. * 页面上拉触底事件的处理函数
  210. */
  211. onReachBottom: function () {
  212. },
  213. /**
  214. * 用户点击右上角分享
  215. */
  216. onShareAppMessage: function () {
  217. return app.sharePack();
  218. }
  219. })