C端小程序
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

73 linhas
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: wx.getStorageSync('imgurl').grade.url,
  10. actUrl: wx.getStorageSync('imgurl').act.url,
  11. gradeUrl: wx.getStorageSync('imgurl').grade.url,
  12. grade1Url: wx.getStorageSync('imgurl').grade1.url,
  13. grade2Url: wx.getStorageSync('imgurl').grade2.url,
  14. grade3Url: wx.getStorageSync('imgurl').grade3.url,
  15. growthbgUrl: wx.getStorageSync('imgurl').growthbg.url,
  16. },
  17. /**
  18. * 生命周期函数--监听页面加载
  19. */
  20. onLoad: function(options) {
  21. },
  22. /**
  23. * 生命周期函数--监听页面初次渲染完成
  24. */
  25. onReady: function() {
  26. },
  27. /**
  28. * 生命周期函数--监听页面显示
  29. */
  30. onShow: function() {
  31. let that = this;
  32. Http.get({
  33. url: config.api.scoreLevelInfo,
  34. data: {}
  35. })
  36. .then(res=>{
  37. // if true 则开启特享礼遇
  38. if (res.data.discountEnable) {
  39. that.setData({
  40. discountEnable: true
  41. })
  42. }
  43. else {
  44. that.setData({
  45. discountEnable: false
  46. })
  47. }
  48. that.setData({
  49. flags: 'have',
  50. rules: JSON.parse(res.data.score.rules).concat(JSON.parse(res.data.score.rules)[1].childs),
  51. levelList: res.data.levelList
  52. })
  53. })
  54. .catch(res=>{
  55. that.setData({
  56. flags: 'nothave'
  57. })
  58. })
  59. },
  60. // 点击跳转到我的特享优惠
  61. gotospecialcourtesy:function(){
  62. wx.navigateTo({
  63. url: '/pages/specialcourtesy/specialcourtesy',
  64. })
  65. }
  66. })