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.

68 lines
1.5 KiB

  1. let config = require("../../config/config.js");
  2. let app = getApp();
  3. const Http = require("../../utils/HttpBasics");
  4. const util = require("../../utils/util");
  5. Page({
  6. data: {
  7. data: {
  8. bgColor:"#fff"
  9. },
  10. couponId: null,
  11. orderId: "",
  12. day: "",
  13. hour: "",
  14. minute: "",
  15. nodes: ''
  16. },
  17. onShow() {
  18. let that = this;
  19. that.topicShow()
  20. },
  21. topicShow(){
  22. let that = this;
  23. Http.get({
  24. url: config.api.topicShow,
  25. data: {
  26. token: app.globalData.token
  27. }
  28. }).then(res => {
  29. console.log(res)
  30. if (res&&res.data) {
  31. that.setData({
  32. data: res.data
  33. });
  34. /**
  35. * 获取屏幕的高度
  36. *
  37. */
  38. let query = wx.createSelectorQuery();
  39. query.select('.coupons').boundingClientRect();
  40. query.selectViewport().scrollOffset();
  41. query.exec((res) => {
  42. let listHeight = res[0].height; // 获取list高度
  43. let windowHeight = wx.getSystemInfoSync().windowHeight;
  44. if (windowHeight >= listHeight){
  45. that.setData({
  46. winHeight:'100%'
  47. })
  48. }
  49. })
  50. }
  51. }).catch(err => {
  52. wx.showToast({
  53. title: err.errMsg,
  54. icon: 'none',
  55. duration: 2000,
  56. mask: false
  57. });
  58. })
  59. },
  60. gotoactdetail:function(){
  61. let that = this;
  62. console.log(that.data.data.detail)
  63. wx.navigateTo({
  64. url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
  65. })
  66. }
  67. });