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.

89 lines
1.4 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(JSON.parse(res.data.score.rules));
  34. that.setData({
  35. flags: 'have',
  36. rules: JSON.parse(res.data.score.rules),
  37. levelList: res.data.levelList
  38. })
  39. })
  40. .catch(res=>{
  41. that.setData({
  42. flags: 'nothave'
  43. })
  44. })
  45. },
  46. /**
  47. * 生命周期函数--监听页面隐藏
  48. */
  49. onHide: function() {
  50. },
  51. /**
  52. * 生命周期函数--监听页面卸载
  53. */
  54. onUnload: function() {
  55. },
  56. /**
  57. * 页面相关事件处理函数--监听用户下拉动作
  58. */
  59. onPullDownRefresh: function() {
  60. },
  61. /**
  62. * 页面上拉触底事件的处理函数
  63. */
  64. onReachBottom: function() {
  65. },
  66. /**
  67. * 用户点击右上角分享
  68. */
  69. onShareAppMessage: function() {
  70. }
  71. })