From 7b950f425d01b74febcebb9a6506e1607c3a2a0f Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 06 八月 2024 09:44:21 +0800
Subject: [PATCH] ''

---
 wechat_jiaxuan/pages/index/index.js |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index cdc4ace..d6602fa 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -91,7 +91,7 @@
   onLoad(options) {
     console.log(options)
     this.initDictData()
-    this.initData()
+    // this.initData()
   },
   changePath(e) {
     let index = e.currentTarget.dataset.type
@@ -156,16 +156,16 @@
   initData() {
     // 杞挱
     getHomeBanner().then(res => {
-      this.setData({
-        bannerList: res.data
-      })
+      if(res.data){
+        this.setData({ bannerList: res.data })
+      }
     })
     // 浜у搧瑙嗛
     getZhongTaiVideoPage({
       pageSize: 1,
       pageNum: 1
     }).then(res => {
-      if (res.data.records && res.data.records.length > 0) {
+      if (res.data && res.data.records && res.data.records.length > 0) {
         this.setData({
           productVideo: res.data.records
         })
@@ -182,7 +182,7 @@
       pageSize: 6,
       pageNum: 1
     }).then(res => {
-      if (res.data) {
+      if (res.data && res.data.records) {
         this.setData({
           consultList: res.data.records
         })

--
Gitblit v1.9.3