From 3508c76f824c6632b47aff17b1ec2f2a11c504fc Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 01 八月 2024 14:31:12 +0800
Subject: [PATCH] lll
---
wechat_jiaxuan/pages/index/index.js | 48 ++++++++++++++++++++++++------------------------
1 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index 927da79..097386a 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -8,10 +8,7 @@
getZhongTaiVideoPage,
getZhongTaiProductNewsPage
} from '../../api/index'
-const {
- HYEventBus
-} = require('hy-event-store')
-const eventBus = new HYEventBus()
+import { eventBus } from '../../utils/eventBus'
const app = getApp()
Page({
@@ -55,30 +52,22 @@
this.initData()
},
onShow() {
- let that = this
const member = wx.getStorageSync('member')
- if (member && (member.authStatus == '1' || member.authStatus == '2')) {
- getMemberInfo().then(res => {
- this.setData({
- member: res.data
- })
- })
- } else {
- this.setData({
- member
- })
- }
- eventBus.on("reloadHome", () => {
+ this.setData({ member })
+
+ eventBus.once("reloadHome", () => {
console.log('reloadHome');
this.onLoad()
+ this.initData()
})
},
onLoad(options) {
- const member = wx.getStorageSync('member')
this.initDictData()
+ this.initData()
},
changePath(e) {
let index = e.currentTarget.dataset.type
+ const member = this.data.member
let that = this
switch (index) {
case '0':
@@ -99,9 +88,16 @@
})
break;
case '2':
- wx.navigateTo({
- url: '/pages/design/design'
- })
+ if(member && member.phone){
+ wx.navigateTo({
+ url: '/pages/design/design'
+ })
+ }else{
+ wx.navigateTo({
+ url: '/pages/auth/auth',
+ })
+ }
+
// wx.navigateTo({
// url: '/pages/wonderful_activity/index',
// success: function(res) {
@@ -233,9 +229,13 @@
})
},
bannerbindload(e) {
- const height = e.detail.height
+ const {
+ height,
+ width
+ } = e.detail
+ let activeHeight = height * 670 / width
this.setData({
- bannerImgHeight: height
+ bannerImgHeight: activeHeight
})
},
consultbindload(e) {
@@ -245,7 +245,7 @@
} = e.detail
let activeHeight = height * 670 / width
this.setData({
- consultImgHeight: activeHeight
+ consultImgHeight: activeHeight + 100
})
},
consultClick(e) {
--
Gitblit v1.9.3