From 997036b27927bcc1e9207a40b7a69c106a10f30c Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 31 七月 2024 15:49:52 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia
---
wechat_jiaxuan/pages/index/index.js | 79 ++++++++++++++++++++++++---------------
1 files changed, 48 insertions(+), 31 deletions(-)
diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index a871c96..0e303f8 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -8,10 +8,8 @@
getZhongTaiVideoPage,
getZhongTaiProductNewsPage
} from '../../api/index'
-const {
- HYEventBus
-} = require('hy-event-store')
-const eventBus = new HYEventBus()
+import { eventBus } from '../../utils/eventBus'
+const app = getApp()
Page({
/**
@@ -48,31 +46,29 @@
HOME_CLASS_B2: '',
HOME_CLASS_C: '',
},
+ onLoadLogin(options){
+ // 宸茬粡鐧诲綍锛屽彲浠ヨ蛋渚濊禆token鐨勯�昏緫浜�
+ console.log('棣栭〉鐨刼nLoadLogin',options,`{"token":"${app.globalData.token}"}`);
+ this.initData()
+ },
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 member = wx.getStorageSync('member')
this.initDictData()
- setTimeout(() => {
- this.initData()
- }, 1200)
},
changePath(e) {
let index = e.currentTarget.dataset.type
@@ -212,12 +208,16 @@
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
@@ -226,9 +226,13 @@
})
},
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) {
@@ -238,18 +242,31 @@
} = 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 {
@@ -275,8 +292,8 @@
wx.navigateTo({
url: '/pages/webView/index',
success: function (res) {
- res.eventChannel.emit('data', {
- link: item.content
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
+ link: item.openContent || item.content
});
}
})
--
Gitblit v1.9.3