C端小程序
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.

94 lines
1.6 KiB

  1. const Http = require("../../utils/HttpBasics");
  2. const config = require("../../config/config");
  3. let app = getApp();
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. src:'./../../../assets/img/grade.png'
  10. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad: function(options) {
  15. },
  16. /**
  17. * 生命周期函数--监听页面初次渲染完成
  18. */
  19. onReady: function() {
  20. },
  21. /**
  22. * 生命周期函数--监听页面显示
  23. */
  24. onShow: function() {
  25. let that = this;
  26. Http.get({
  27. url: config.api.scoreLevelInfo,
  28. data: {
  29. appId: config.weapp.AppId,
  30. }
  31. })
  32. .then(res=>{
  33. console.log(res);
  34. that.setData({
  35. flags: 'have',
  36. logincount: res.data.score.loginCount,
  37. loginscoreNumber: res.data.score.loginScoreNumber,
  38. personscoreNumber: res.data.score.personScoreNumber,
  39. phonescoreNumber: res.data.score.phoneScoreNumber,
  40. wifiscoreNumber: res.data.score.wifiScoreNumber,
  41. wifinumber: res.data.score.wifiNumber,
  42. levelList: res.data.levelList
  43. })
  44. })
  45. .catch(res=>{
  46. that.setData({
  47. flags: 'nothave'
  48. })
  49. })
  50. },
  51. /**
  52. * 生命周期函数--监听页面隐藏
  53. */
  54. onHide: function() {
  55. },
  56. /**
  57. * 生命周期函数--监听页面卸载
  58. */
  59. onUnload: function() {
  60. },
  61. /**
  62. * 页面相关事件处理函数--监听用户下拉动作
  63. */
  64. onPullDownRefresh: function() {
  65. },
  66. /**
  67. * 页面上拉触底事件的处理函数
  68. */
  69. onReachBottom: function() {
  70. },
  71. /**
  72. * 用户点击右上角分享
  73. */
  74. onShareAppMessage: function() {
  75. }
  76. })