C端小程序
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

93 linhas
2.2 KiB

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