抖音c端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 2 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. const navigationBarHeight = (getApp().statusBarHeight + 50) + '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. mouldType: 0,
  10. navigationBarHeight,
  11. data: {
  12. bgColor:"#fff"
  13. },
  14. wmhome: imgurl.wmhome.url,
  15. couponId: null,
  16. orderId: "",
  17. day: "",
  18. hour: "",
  19. minute: "",
  20. nodes: '',
  21. id:'',
  22. },
  23. onLoad(options){
  24. this.setData({
  25. mouldType: app.globalData.mouldType
  26. })
  27. console.log(options)
  28. if(options&&options.id){
  29. this.setData({
  30. id:options.id
  31. })
  32. this.topicShow(options.id)
  33. }
  34. },
  35. goback: function () {
  36. tt.reLaunch({
  37. url: '/index/index',
  38. })
  39. },
  40. topicShow(id){
  41. let that = this;
  42. Http.get({
  43. url: config.api.topicFindById,
  44. data: {
  45. id: id
  46. }
  47. }).then(res => {
  48. console.log(res)
  49. if (res&&res.data) {
  50. that.setData({
  51. data: res.data
  52. });
  53. /**
  54. * 获取屏幕的高度
  55. *
  56. */
  57. let query = tt.createSelectorQuery();
  58. query.select('.coupons').boundingClientRect();
  59. query.selectViewport().scrollOffset();
  60. query.exec((res) => {
  61. let listHeight = res[0].height; // 获取list高度
  62. let windowHeight = tt.getSystemInfoSync().windowHeight;
  63. if (windowHeight >= listHeight){
  64. that.setData({
  65. winHeight:'100%'
  66. })
  67. }
  68. })
  69. }
  70. }).catch(err => {
  71. tt.showToast({
  72. title: err.errMsg,
  73. icon: 'none',
  74. duration: 2000,
  75. mask: false
  76. });
  77. })
  78. },
  79. gotoDetail:function(e){
  80. if (e.currentTarget.dataset.type == 9){
  81. console.log("平团")
  82. tt.navigateTo({
  83. url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${e.currentTarget.dataset.couponchannelid}`,
  84. })
  85. }else{
  86. console.log("优惠卷")
  87. tt.navigateTo({
  88. url: `/pages/coupon/detail/index?couponChannelId=${e.currentTarget.dataset.couponchannelid}&couponId=${e.currentTarget.dataset.couponid}`,
  89. })
  90. }
  91. },
  92. onShareAppMessage: function (options) {
  93. var that = this;
  94. var shareObj = {
  95. title: "专题活动",
  96. path: `/pages/main/index?id=${that.data.id}&type=td`,
  97. success: function (res) {
  98. if (res.errMsg == 'shareAppMessage:ok') { }
  99. },
  100. fail: function (error) {
  101. if (res.errMsg == 'shareAppMessage:fail cancel') { } else if (res.errMsg == 'shareAppMessage:fail') { }
  102. }
  103. };
  104. console.log(shareObj)
  105. // 返回shareObj
  106. return shareObj;
  107. }
  108. });