From d9a89d83c2048a964f16ca179feb2b7f21b9d33a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 29 七月 2024 16:28:47 +0800
Subject: [PATCH] 提交

---
 wechat_jiaxuan/pages/index/index.js |   48 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index 2e777c9..927da79 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -12,6 +12,7 @@
   HYEventBus
 } = require('hy-event-store')
 const eventBus = new HYEventBus()
+const app = getApp()
 Page({
 
   /**
@@ -48,6 +49,11 @@
     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')
@@ -70,9 +76,6 @@
   onLoad(options) {
     const member = wx.getStorageSync('member')
     this.initDictData()
-    setTimeout(() => {
-      this.initData()
-    }, 1200)
   },
   changePath(e) {
     let index = e.currentTarget.dataset.type
@@ -212,12 +215,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
@@ -242,14 +249,27 @@
     })
   },
   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 {

--
Gitblit v1.9.3