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.

69 lines
1.3 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. // if true 则开启特享礼遇
  34. if (res.data.discountEnable) {
  35. that.setData({
  36. discountEnable: true
  37. })
  38. }
  39. else {
  40. that.setData({
  41. discountEnable: false
  42. })
  43. }
  44. that.setData({
  45. flags: 'have',
  46. rules: JSON.parse(res.data.score.rules).concat(JSON.parse(res.data.score.rules)[1].childs),
  47. levelList: res.data.levelList
  48. })
  49. })
  50. .catch(res=>{
  51. that.setData({
  52. flags: 'nothave'
  53. })
  54. })
  55. },
  56. // 点击跳转到我的特享优惠
  57. gotospecialcourtesy:function(){
  58. wx.navigateTo({
  59. url: '/pages/specialcourtesy/specialcourtesy',
  60. })
  61. }
  62. })