From 4a0a8994121e968a01ef626153d6a7e53a8a0311 Mon Sep 17 00:00:00 2001 From: zhengshuiqi Date: Sat, 17 Dec 2022 10:26:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=B9=BF=E5=91=8A=E5=88=A4=E6=96=AD=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 44 +++++++++++++++++++++++++++++++++++++------ pages/login/index.vue | 10 ++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 9c65823..3bf6280 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -12,6 +12,8 @@ export default { data() { return { + // register 自定义登录字段 + register: -1, typee: '', mycurrent: 0, isScrollShow: false, @@ -580,8 +582,15 @@ } if (item.zone_code == 'HOMEAD') { item.blocks.map(item1 => { + console.log(item1); + console.log(res); console.log('HOMEAD=================================='); // console.log(this.Swiper_H) + if (res.error != 0) { + uni.navigateTo({ + url: '../login/index' + }) + } }) } if (item.zone_code == 'BANNER1') { @@ -608,7 +617,7 @@ } } if (item.zone_code == 'LIST1') { - console.log(item.zone_more_link) + // console.log(item.zone_more_link) const i = item.zone_more_link.indexOf('gid=') // console.log(i) const ids = item.zone_more_link.substring(i + 4, item @@ -1007,13 +1016,32 @@ let data = { _action: 'getinfo' } + let that = this defaultRequest(data).then(res => { - ////console.log(res,'用户信息') + console.log(res,'用户信息') if (res.error == -1) { uni.setStorageSync('isLogin', 0) } else if (res.error == 0) { uni.setStorageSync('isLogin', 1) } + that.register = res.error + console.log(that.register); + }) + }, + // 小广告判断登录 + registers() { + let data = { + _action: 'getinfo' + } + defaultRequest(data).then(res => { + console.log(res,'用户信息') + if (res.error == -1) { + uni.navigateTo({ + url: '../login/index' + }) + } else if (res.error == 0) { + + } }) }, @@ -1326,10 +1354,14 @@ - - - + + + + + + { @@ -342,6 +343,15 @@ }, 1000); this.configuration() + // IOS&Android判断 + let systemInfo = uni.getSystemInfoSync(); + if (systemInfo.platform === 'android') { + // 安卓 + console.log(安卓); + } else if (systemInfo.platform === 'ios') { + // IOS + console.log(IOS); + } } }