| | |
| | | getZhongTaiVideoPage, |
| | | getZhongTaiProductNewsPage |
| | | } from '../../api/index' |
| | | const { |
| | | HYEventBus |
| | | } = require('hy-event-store') |
| | | const eventBus = new HYEventBus() |
| | | import { eventBus } from '../../utils/eventBus' |
| | | const app = getApp() |
| | | Page({ |
| | | |
| | |
| | | }, |
| | | onShow() { |
| | | let that = this |
| | | const member = wx.getStorageSync('member') |
| | | if (member && (member.authStatus == '1' || member.authStatus == '2')) { |
| | | setTimeout(() => { |
| | | getMemberInfo().then(res => { |
| | | this.setData({ |
| | | member: res.data |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | member |
| | | }) |
| | | } |
| | | eventBus.on("reloadHome", () => { |
| | | }, 500) |
| | | eventBus.once("reloadHome", () => { |
| | | console.log('reloadHome'); |
| | | this.onLoad() |
| | | this.initData() |
| | | }) |
| | | }, |
| | | onLoad(options) { |
| | |
| | | const { |
| | | videourl |
| | | } = e.currentTarget.dataset |
| | | wx.previewMedia({ |
| | | sources: [{ |
| | | url: videourl, |
| | | type: 'video' |
| | | }] |
| | | }) |
| | | let videoPlay = this.selectComponent('.videoPlay'); |
| | | if(videoPlay){ |
| | | videoPlay.startPlayVideo(videourl,this ); |
| | | } |
| | | // wx.previewMedia({ |
| | | // sources: [{ |
| | | // url: videourl, |
| | | // type: 'video' |
| | | // }] |
| | | // }) |
| | | }, |
| | | goserHeight: function (e) { |
| | | const serviceHeight = e.detail.height |
| | |
| | | }) |
| | | }, |
| | | bannerbindload(e) { |
| | | const height = e.detail.height |
| | | const { |
| | | height, |
| | | width |
| | | } = e.detail |
| | | let activeHeight = height * 670 / width |
| | | this.setData({ |
| | | bannerImgHeight: height |
| | | bannerImgHeight: activeHeight |
| | | }) |
| | | }, |
| | | consultbindload(e) { |
| | |
| | | } = e.detail |
| | | let activeHeight = height * 670 / width |
| | | this.setData({ |
| | | consultImgHeight: activeHeight |
| | | consultImgHeight: activeHeight + 100 |
| | | }) |
| | | }, |
| | | consultClick(e) { |
| | | const id = e.currentTarget.dataset.id |
| | | const item = e.currentTarget.dataset.id |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: id |
| | | id: item.id |
| | | }) |
| | | wx.navigateTo({ |
| | | url: '/pages/consult/detail?id=' + id |
| | | }) |
| | | if(item.contentType == 'link'){ |
| | | wx.navigateTo({ |
| | | url: '/pages/webView/index', |
| | | success: function(res) { |
| | | // 通过eventChannel向被打开页面传送数据 |
| | | res.eventChannel.emit('acceptDataFromOpenerPage', { link: item.content, title: item.title }) |
| | | } |
| | | }) |
| | | }else{ |
| | | wx.navigateTo({ |
| | | url: '/pages/consult/detail?id='+item.id, |
| | | }) |
| | | } |
| | | // wx.navigateTo({ |
| | | // url: '/pages/consult/detail?id=' + id |
| | | // }) |
| | | }, |
| | | bannerClick(e) { |
| | | const { |