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.

64 lines
1.3 KiB

  1. const Http = require("../../utils/HttpBasics");
  2. const config = require("../../config/config");
  3. let app = getApp();
  4. const imgurl = require("../../utils/imgurl");
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. src: imgurl.grade.url,
  11. actUrl: imgurl.act.url,
  12. gradeUrl: imgurl.grade.url,
  13. grade1Url: imgurl.grade1.url,
  14. grade2Url: imgurl.grade2.url,
  15. grade3Url: imgurl.grade3.url,
  16. growthbgUrl: imgurl.growthbg.url,
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad: function(options) {
  22. },
  23. /**
  24. * 生命周期函数--监听页面初次渲染完成
  25. */
  26. onReady: function() {
  27. },
  28. /**
  29. * 生命周期函数--监听页面显示
  30. */
  31. onShow: function() {
  32. let that = this;
  33. Http.get({
  34. url: config.api.scoreLevelInfo,
  35. data: {}
  36. })
  37. .then(res=>{
  38. that.setData({
  39. flags: 'have',
  40. rules: JSON.parse(res.data.score.rules).concat(JSON.parse(res.data.score.rules)[1].childs),
  41. levelList: res.data.levelList
  42. })
  43. console.log(that.data.rules)
  44. })
  45. .catch(res=>{
  46. that.setData({
  47. flags: 'nothave'
  48. })
  49. })
  50. },
  51. // 点击跳转到我的特享优惠
  52. gotospecialcourtesy:function(){
  53. wx.navigateTo({
  54. url: '/pages/specialcourtesy/specialcourtesy',
  55. })
  56. }
  57. })