From 89e7ed902461f28d6a7dd3e6c927eaf40b154f5e Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 15 八月 2024 10:12:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 wechat_jiaxuan/pages/mine/mine.js |   80 ++++++++++++++++++++++++++--------------
 1 files changed, 52 insertions(+), 28 deletions(-)

diff --git a/wechat_jiaxuan/pages/mine/mine.js b/wechat_jiaxuan/pages/mine/mine.js
index 6a0cc07..7c1a7a4 100644
--- a/wechat_jiaxuan/pages/mine/mine.js
+++ b/wechat_jiaxuan/pages/mine/mine.js
@@ -1,4 +1,7 @@
-import { getMemberInfo, getDictData } from '../../api/index'
+import {
+  getMemberInfo,
+  getDictData
+} from '../../api/index'
 Page({
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
@@ -8,7 +11,7 @@
     clientTop: 0,
 
     member: {},
-    housetype: '',
+    houseType: {},
     IMG_LIUCHENG: '',
     MINE_BG: ''
   },
@@ -18,47 +21,75 @@
    */
   onLoad(options) {
     const res = wx.getMenuButtonBoundingClientRect()
-    this.setData({clientHeight: res.height})
-    this.setData({clientTop: res.top})
-
+    this.setData({
+      clientHeight: res.height
+    })
+    this.setData({
+      clientTop: res.top
+    })
+  },
+  onShow() {
     this.initData()
   },
   initData() {
     getMemberInfo().then(res => {
-      this.setData({member: res.data})
-      if(res.data.housetype){
-        const temp = res.data.housetype.split('-')
-        let houseType = {
-          val1: temp[0],
-          val2: temp[1],
-          val3: temp[2],
-          val4: temp[3],
-          val5: temp[4],
+      console.log('res', res);
+      if (res.code == 200) {
+        this.setData({
+          member: res.data
+        })
+        if (res.data.housetype) {
+          const temp = res.data.housetype.split('-')
+          let houseType = {
+            val1: temp[0],
+            val2: temp[1],
+            val3: temp[2],
+            val4: temp[3],
+            val5: temp[4],
+          }
+          this.setData({
+            houseType
+          })
+        }else{
+          this.setData({ houseType: {} })
         }
-        this.setData({houseType})
+      }else{
+        this.setData({ member: {}, houseType: {} })
       }
+
     })
     getDictData({
       code: 'WEIXIN_DEFAULT_IMGS',
       label: 'IMG_LIUCHENG'
     }).then(res => {
-      this.setData({ IMG_LIUCHENG: res.data.code })
+      this.setData({
+        IMG_LIUCHENG: res.data.code
+      })
     })
     getDictData({
       code: 'WEIXIN_DEFAULT_IMGS',
       label: 'MINE_BG'
     }).then(res => {
-      this.setData({ MINE_BG: res.data.code })
+      this.setData({
+        MINE_BG: res.data.code
+      })
     })
   },
   changePath(e) {
     // 椤甸潰璺宠浆
-    let temp = ['mysub', 'collect', 'favorite','index']
+    let temp = ['mysub', 'collect', 'favorite', 'index']
     const index = e.currentTarget.dataset.index
-    if(index == '4'){
-
+    if (index == '4') {
+      wx.navigateToMiniProgram({
+        appId: 'wx9910433b937fff92',
+        path: '',
+        envVersion: 'release',
+        extraData: {
+          origin: 'c'
+        }
+      })
     }
-    if(index == '5'){
+    if (index == '5') {
       wx.navigateTo({
         url: `/pages/sets/index`,
       })
@@ -71,13 +102,6 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
    */
   onReady() {
-
-  },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
-  onShow() {
 
   },
 

--
Gitblit v1.9.3