index.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // page/findmore/index.js
  2. var businessT = require('../../tools/business-tool.js')
  3. var app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. service: [
  10. { img: '/icon/ad/qujianbu.png', title: '趣健步', msg: '微信步数领红包', id: '1' },
  11. { img: '/icon/ad/tuodan.png', title: '脱单请点我', msg: '领取一个优质对象', id: '2' },
  12. { img: '/icon/ad/nearjob.png', title: '附近的工作', msg: '走路上班回家吃饭', id: '3' },
  13. { img: '/icon/ad/banruoshangcheng.png', title: '般若商城', msg: '招财 姻缘 风水', id: '4' }
  14. ],
  15. },
  16. //跳转H5
  17. toweb: function (e) {
  18. wx: wx.navigateTo({
  19. url: '/page/home/webView/webView',
  20. success: function (res) { },
  21. fail: function (res) { },
  22. complete: function (res) { },
  23. })
  24. },
  25. //新鲜服务-跳转小程序
  26. goAdWx(e) {
  27. let id = e.currentTarget.dataset.id
  28. switch (id) {
  29. case "1": {
  30. wx.navigateToMiniProgram({
  31. appId: 'wxdb674acb1231c231',
  32. path: 'pages/index/index?channel=shanpin&ald_media_id=24879&ald_link_key=5024e38cd497a4ed',
  33. extraData: {
  34. },
  35. success(res) {
  36. // 打开成功
  37. wx.reportAnalytics('click_service', {
  38. service_title: '趣健步',
  39. });
  40. businessT.debugLog("跳转趣健步小程序成功")
  41. }
  42. });
  43. break
  44. }
  45. case "2": {
  46. wx.navigateToMiniProgram({
  47. appId: 'wx4882c703815c5602',
  48. path: '/pages/index/index?promotion=nZW2FKJWji&tl=&nc=',
  49. extraData: {
  50. },
  51. success(res) {
  52. // 打开成功
  53. wx.reportAnalytics('click_service', {
  54. service_title: '比心单身',
  55. });
  56. businessT.debugLog("跳转比心单身小程序成功")
  57. }
  58. });
  59. break
  60. }
  61. case "3": {
  62. wx.navigateToMiniProgram({
  63. appId: 'wx0fdd65237732c014',
  64. extraData: {
  65. },
  66. success(res) {
  67. // 打开成功
  68. wx.reportAnalytics('click_service', {
  69. service_title: '职友集',
  70. });
  71. businessT.debugLog("跳转职友集小程序成功")
  72. }
  73. });
  74. break
  75. }
  76. case "4": {
  77. wx.navigateToMiniProgram({
  78. appId: 'wx7ab08191e61478c5',
  79. extraData: {
  80. },
  81. success(res) {
  82. // 打开成功
  83. wx.reportAnalytics('click_service', {
  84. service_title: '般若商城',
  85. });
  86. businessT.debugLog("跳转般若商城小程序成功")
  87. }
  88. });
  89. break
  90. }
  91. }
  92. },
  93. /**
  94. * 生命周期函数--监听页面加载
  95. */
  96. onLoad: function (options) {
  97. },
  98. /**
  99. * 生命周期函数--监听页面初次渲染完成
  100. */
  101. onReady: function () {
  102. },
  103. /**
  104. * 生命周期函数--监听页面显示
  105. */
  106. onShow: function () {
  107. if (typeof this.getTabBar === 'function' &&
  108. this.getTabBar()) {
  109. this.getTabBar().setData({
  110. selected: 1
  111. })
  112. }
  113. },
  114. /**
  115. * 生命周期函数--监听页面隐藏
  116. */
  117. onHide: function () {
  118. },
  119. /**
  120. * 生命周期函数--监听页面卸载
  121. */
  122. onUnload: function () {
  123. },
  124. /**
  125. * 页面相关事件处理函数--监听用户下拉动作
  126. */
  127. onPullDownRefresh: function () {
  128. },
  129. /**
  130. * 页面上拉触底事件的处理函数
  131. */
  132. onReachBottom: function () {
  133. },
  134. /**
  135. * 用户点击右上角分享
  136. */
  137. onShareAppMessage: function () {
  138. }
  139. })