From 3ac33e0ea28357bac078ac93404ac02ad9a61738 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 23 七月 2024 18:01:06 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 wechat_staff/pages/index/index.js |  105 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 88 insertions(+), 17 deletions(-)

diff --git a/wechat_staff/pages/index/index.js b/wechat_staff/pages/index/index.js
index 3af582f..7e2e74e 100644
--- a/wechat_staff/pages/index/index.js
+++ b/wechat_staff/pages/index/index.js
@@ -1,4 +1,10 @@
-import { getDictData, getDailyUpdates, getZSZXCatalogs } from '../../api/index'
+import {
+  getDictData,
+  getDailyUpdates,
+  getZSZXCatalogs,
+  getZhongTaiVideoPage,
+  getCustomizedNewsList
+} from '../../api/index'
 Page({
   data: {
     searchValue: '',
@@ -7,12 +13,8 @@
 
     DailyUpdates: {}, //姣忔棩涓婃柊
     everydayTop: ['../../static/ic_top1@2x.png', '../../static/ic_top2@2x.png', '../../static/ic_top3@2x.png'],
-    bannerList: [
-      {imgurl: ''},
-      {imgurl: 'adsa.png'},
-      {imgurl: 'adsa.png'},
-      {imgurl: 'adsa.png'},
-    ],
+    serviceHeight: 0,
+    serviceList: [],
 
     bannerSwiperOption: {
       indicatorDots: true,
@@ -24,8 +26,12 @@
   },
   onLoad() {
     const res = wx.getMenuButtonBoundingClientRect()
-    this.setData({clientHeight: res.height})
-    this.setData({clientTop: res.top})
+    this.setData({
+      clientHeight: res.height
+    })
+    this.setData({
+      clientTop: res.top
+    })
 
     this.initData()
   },
@@ -34,36 +40,64 @@
     getDailyUpdates({
       fileType: '0'
     }).then(res => {
-      this.setData({ DailyUpdates: res.data })
+      this.setData({
+        DailyUpdates: res.data
+      })
     })
-    getZSZXCatalogs().then(res => { //蹇楄瑁呬慨
+    // 浜у搧瑙嗛
+    getZhongTaiVideoPage({
+      pageSize: 1,
+      pageNum: 1
+    }).then(res => {
+      if (res.data.records && res.data.records.length > 0) {
+        this.setData({
+          productVideo: res.data.records
+        })
+      }
+    })
+    //蹇楄瑁呬慨
+    getZSZXCatalogs().then(res => {
       this.setData({
         ZSZXCata: res.data || {}
+      })
+    })
+    // 瀹氬埗鏈嶅姟
+    getCustomizedNewsList().then(res => {
+      this.setData({
+        serviceList: res.data || []
       })
     })
     getDictData({
       code: 'WEIXIN_DEFAULT_IMGS',
       label: 'HOME_CLASS_A'
     }).then(res => {
-      this.setData({ HOME_CLASS_A: res.data.code })
+      this.setData({
+        HOME_CLASS_A: res.data.code
+      })
     })
     getDictData({
       code: 'WEIXIN_DEFAULT_IMGS',
       label: 'HOME_CLASS_B'
     }).then(res => {
-      this.setData({ HOME_CLASS_B: res.data.code })
+      this.setData({
+        HOME_CLASS_B: res.data.code
+      })
     })
     getDictData({
       code: 'WEIXIN_DEFAULT_IMGS',
       label: 'HOME_CLASS_B2'
     }).then(res => {
-      this.setData({ HOME_CLASS_B2: res.data.code })
+      this.setData({
+        HOME_CLASS_B2: res.data.code
+      })
     })
     getDictData({
       code: 'WEIXIN_DEFAULT_IMGS',
       label: 'HOME_CLASS_C'
     }).then(res => {
-      this.setData({ HOME_CLASS_C: res.data.code })
+      this.setData({
+        HOME_CLASS_C: res.data.code
+      })
     })
   },
   promotionClick() {
@@ -71,10 +105,47 @@
       url: '/pages/promotion/index',
     })
   },
+  jumpProVideo() {
+    wx.navigateTo({
+      url: '/pages/productVideo/index',
+    })
+  },
+  videoClick(e) {
+    const {
+      videourl
+    } = e.currentTarget.dataset
+    wx.previewMedia({
+      sources: [{
+        url: videourl,
+        type: 'video'
+      }]
+    })
+  },
+  seriveClick(e) {
+    const {
+      id,
+      title
+    } = e.currentTarget.dataset
+    if (title === '涓撳睘瀹㈡湇') {
+      wx.navigateTo({
+        url: `/pages/kefu/index?title=${title}&id=${id}`,
+      })
+    } else {
+      wx.navigateTo({
+        url: `/pages/kefu/service?title=${title}&id=${id}`,
+      })
+    }
+  },
+  goserHeight: function (e) {
+    const serviceHeight = e.detail.height
+    this.setData({
+      serviceHeight: serviceHeight
+    })
+  },
   changeStrategy(e) {
     let item = e.currentTarget.dataset.item
     wx.navigateTo({
-      url: `/pages/homeId/index?code=${item.code}&name=${item.name}` ,
+      url: `/pages/homeId/index?code=${item.code}&name=${item.name}`,
     })
   },
-})
+})
\ No newline at end of file

--
Gitblit v1.9.3