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.

80 line
1.7 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. const imgurl = require("../../utils/imgurl");
  6. Page({
  7. data: {
  8. data: {
  9. bgColor:"#fff"
  10. },
  11. wmhome: imgurl.wmhome.url,
  12. couponId: null,
  13. orderId: "",
  14. day: "",
  15. hour: "",
  16. minute: "",
  17. nodes: ''
  18. },
  19. onLoad(options){
  20. console.log(options)
  21. if(options&&options.id){
  22. this.setData({
  23. id:options.id
  24. })
  25. this.topicShow(options.id)
  26. }
  27. },
  28. goback: function () {
  29. wx.switchTab({
  30. url: '/pages/main/index',
  31. })
  32. },
  33. topicShow(id){
  34. let that = this;
  35. Http.get({
  36. url: config.api.topicFindById,
  37. data: {
  38. id: id
  39. }
  40. }).then(res => {
  41. console.log(res)
  42. if (res&&res.data) {
  43. that.setData({
  44. data: res.data
  45. });
  46. /**
  47. * 获取屏幕的高度
  48. *
  49. */
  50. let query = wx.createSelectorQuery();
  51. query.select('.coupons').boundingClientRect();
  52. query.selectViewport().scrollOffset();
  53. query.exec((res) => {
  54. let listHeight = res[0].height; // 获取list高度
  55. let windowHeight = wx.getSystemInfoSync().windowHeight;
  56. if (windowHeight >= listHeight){
  57. that.setData({
  58. winHeight:'100%'
  59. })
  60. }
  61. })
  62. }
  63. }).catch(err => {
  64. wx.showToast({
  65. title: err.errMsg,
  66. icon: 'none',
  67. duration: 2000,
  68. mask: false
  69. });
  70. })
  71. },
  72. gotoactdetail:function(){
  73. let that = this;
  74. console.log(that.data.data.detail)
  75. wx.navigateTo({
  76. url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
  77. })
  78. }
  79. });