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.

gradeII.js 1.4 KiB

1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
  2. const Http = require("../../utils/HttpBasics");
  3. const config = require("../../config/config");
  4. let app = getApp();
  5. const imgurl = require("../../utils/imgurl");
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. navigationBarHeight,
  12. src: imgurl.grade.url,
  13. actUrl: imgurl.act.url,
  14. gradeUrl: imgurl.grade.url,
  15. grade1Url: imgurl.grade1.url,
  16. grade2Url: imgurl.grade2.url,
  17. grade3Url: imgurl.grade3.url,
  18. growthbgUrl: imgurl.growthbg.url,
  19. },
  20. /**
  21. * 生命周期函数--监听页面显示
  22. */
  23. onShow: function () {
  24. let that = this;
  25. Http.get({
  26. url: config.api.creditRules,
  27. data: {}
  28. })
  29. .then(res => {
  30. let childs = []
  31. JSON.parse(res.data.rules).forEach(item => {
  32. if (item.id == 2) {
  33. childs = item.childs
  34. }
  35. })
  36. that.setData({
  37. flags: 'have',
  38. rules: JSON.parse(res.data.rules),
  39. rules1: childs || [],
  40. levelList: res.data.levelList
  41. })
  42. console.log(that.data.rules)
  43. console.log(that.data.rules1)
  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. })