C端小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

73 行
1.6 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. onLoad(options){
  18. console.log(options)
  19. if(options&&options.id){
  20. this.setData({
  21. id:options.id
  22. })
  23. this.topicShow(options.id)
  24. }
  25. },
  26. topicShow(id){
  27. let that = this;
  28. Http.get({
  29. url: config.api.topicFindById,
  30. data: {
  31. id: id
  32. }
  33. }).then(res => {
  34. console.log(res)
  35. if (res&&res.data) {
  36. that.setData({
  37. data: res.data
  38. });
  39. /**
  40. * 获取屏幕的高度
  41. *
  42. */
  43. let query = wx.createSelectorQuery();
  44. query.select('.coupons').boundingClientRect();
  45. query.selectViewport().scrollOffset();
  46. query.exec((res) => {
  47. let listHeight = res[0].height; // 获取list高度
  48. let windowHeight = wx.getSystemInfoSync().windowHeight;
  49. if (windowHeight >= listHeight){
  50. that.setData({
  51. winHeight:'100%'
  52. })
  53. }
  54. })
  55. }
  56. }).catch(err => {
  57. wx.showToast({
  58. title: err.errMsg,
  59. icon: 'none',
  60. duration: 2000,
  61. mask: false
  62. });
  63. })
  64. },
  65. gotoactdetail:function(){
  66. let that = this;
  67. console.log(that.data.data.detail)
  68. wx.navigateTo({
  69. url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
  70. })
  71. }
  72. });