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.

61 line
1.3 KiB

  1. let config = require("../../config/config.js");
  2. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
  3. let app = getApp();
  4. const Http = require("../../utils/HttpBasics");
  5. const util = require("../../utils/util");
  6. const imgurl = require("../../utils/imgurl");
  7. Page({
  8. data: {
  9. mouldType: 0,
  10. mouldConfig:{},
  11. navigationBarHeight,
  12. data: {},
  13. couponId: null,
  14. orderId: "",
  15. day: "",
  16. hour: "",
  17. wmhome: imgurl.wmhome.url,
  18. minute: "",
  19. nodes: '',
  20. goHomeUrl: "",
  21. },
  22. onLoad(options) {
  23. this.setData({
  24. mouldType: app.globalData.mouldType,
  25. mouldConfig: app.globalData.mouldConfig,
  26. goHomeUrl: app.globalData.goHomeUrl,
  27. })
  28. let that = this;
  29. if (options.id){
  30. Http.get({
  31. url: config.api.bannerDetail,
  32. data: {
  33. id: options.id
  34. }
  35. }).then(res => {
  36. if(res.data.type==2){
  37. that.setData({
  38. nodes: res.data.html
  39. })
  40. }
  41. that.setData({
  42. data: res.data
  43. });
  44. }).catch(err => {
  45. wx.showToast({
  46. title: err.errMsg,
  47. icon: 'none',
  48. duration: 2000,
  49. mask: false
  50. });
  51. })
  52. }
  53. },
  54. goback: function () {
  55. let this_=this
  56. wx.switchTab({
  57. url: this_.data.goHomeUrl,
  58. })
  59. },
  60. });