From 138db89b3193d60850e203e1847e2f91d2b00ebc Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 07 八月 2024 18:19:47 +0800
Subject: [PATCH] lll
---
wechat_jiaxuan/pages/mine/mine.js | 65 ++++++++++++++++++++++----------
1 files changed, 44 insertions(+), 21 deletions(-)
diff --git a/wechat_jiaxuan/pages/mine/mine.js b/wechat_jiaxuan/pages/mine/mine.js
index f94275b..e1e31c0 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,55 +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(){
+ 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: 'trial',
- extraData: {
+ extraData: {
origin: 'c'
}
})
}
- if(index == '5'){
+ if (index == '5') {
wx.navigateTo({
url: `/pages/sets/index`,
})
--
Gitblit v1.9.3