diff --git a/App.vue b/App.vue index 89c817f..4b9896a 100644 --- a/App.vue +++ b/App.vue @@ -82,9 +82,9 @@ font-size: 35rpx; } // #ifdef MP-WEIXIN - // @font-face { - // font-family: 'YouSheBiaoTiHei'; - // src: url('https://naweigetetest2.hschool.com.cn/dyqc/YouSheBiaoTiHei.ttf') format('truetype'); - // } + @font-face { + font-family: 'YouSheBiaoTiHei'; + src: url('https://naweigetetest2.hschool.com.cn/dyqc/YouSheBiaoTiHei.ttf') format('truetype'); + } // #endif \ No newline at end of file diff --git a/pages/activity/index.vue b/pages/activity/index.vue index 6980b21..c3d6b6e 100644 --- a/pages/activity/index.vue +++ b/pages/activity/index.vue @@ -250,7 +250,7 @@ .box { background-color: #F1F2F8; background-image: url("https://naweigetetest2.hschool.com.cn/dyqc/bgx2.png"); - background-size: 750rpx 797rpx; + background-size: 100%; background-repeat: no-repeat; } @@ -338,8 +338,12 @@ } } .center { - width: 690rpx; - margin-bottom: 200rpx; + width: 690rpx; + margin-bottom: 200rpx; + position: fixed; + margin-top: 130rpx; + height: 100%; + overflow-y: auto; .list { width: 690rpx; background: #FFFFFF; diff --git a/pages/center/detail.vue b/pages/center/detail.vue index 787a94c..b03e9b9 100644 --- a/pages/center/detail.vue +++ b/pages/center/detail.vue @@ -207,7 +207,7 @@ 分 享 发 布 - + @@ -378,11 +378,11 @@ overlayShow() { const token = uni.getStorageSync('token') if (token) { - // this.overlay = true - uni.showToast({ - title: '开发中,暂未开放', - icon: 'none' - }); + this.overlay = true + // uni.showToast({ + // title: '开发中,暂未开放', + // icon: 'none' + // }); } else { uni.showToast({ title: '请登录', diff --git a/pages/center/index.vue b/pages/center/index.vue index d528f0c..bc78cd2 100644 --- a/pages/center/index.vue +++ b/pages/center/index.vue @@ -984,7 +984,7 @@ width: 750rpx; background-color: #f7f7f7; background-image: url("https://naweigetetest2.hschool.com.cn/dyqc/bgx2.png"); - background-size: 750rpx 797rpx; + background-size: 100%; background-repeat: no-repeat; } diff --git a/pages/index/index.vue b/pages/index/index.vue index 8afd00d..616afd1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -574,7 +574,7 @@ export default { width: 750rpx; background-color: #f7f7f7; background-image: url("https://naweigetetest2.hschool.com.cn/dyqc/bgx2.png"); - background-size: 750rpx 797rpx; + background-size: 100%; .group { width: 690rpx; diff --git a/pages/my/index.vue b/pages/my/index.vue index c06e9ba..2d818f2 100644 --- a/pages/my/index.vue +++ b/pages/my/index.vue @@ -76,8 +76,7 @@ --> - - + @@ -159,7 +158,7 @@ @@ -466,6 +465,12 @@ export default { url: "/pages/center/detail?id=" + id, }); }, + iszhuliren() { + uni.showToast({ + title: '开发中,暂未开放', + icon: 'none' + }); + }, callPhone(phone) { console.log(phone) uni.showToast({ @@ -666,33 +671,70 @@ export default { //小程序静默登录 miniLogin() { let _this = this; - uni.login({ - provider: 'weixin', - success: function (res) { - console.log('res.code', res.code) - _this.getOpenidByCode(res.code) - _this.code = res.code - uni.setStorageSync('code', res.code) - }, - fail: function (error) { - console.log('authError', error); + uni.getProvider({ + service: 'oauth', + success: function(res) { + console.log(res) + if (~res.provider.indexOf('weixin')) { + uni.login({ + provider: 'weixin', + success: function (res) { + console.log('res.code', res.code) + _this.getOpenidByCode(res.code,1) + _this.code = res.code + uni.setStorageSync('code', res.code) + }, + fail: function (error) { + console.log('authError', error); + } + }) + } else { + uni.login({ + provider: 'toutiao', + success: function (res) { + console.log('res.code', res.code) + _this.getOpenidByCode(res.code,2) + _this.code = res.code + uni.setStorageSync('code', res.code) + }, + fail: function (error) { + console.log('authError', error); + } + }) + } } - }) + }); + }, //根据code获取openid - getOpenidByCode(code) { + getOpenidByCode(code,val) { let _this = this; - uni.$u.http.post('/api/user/getOpenid ', { - code: code, - }).then(res => { - if (res.code == 1) { - _this.openidInfo = res.data; - uni.setStorageSync('openidInfo', res.data) - // _this.$api.setCache('openidInfo', res.data); - } - }).catch(error => { - console.log('获取openid失败:', error); - }) + if (val == 1) { + uni.$u.http.post('/api/user/getOpenid ', { + code: code, + }).then(res => { + if (res.code == 1) { + _this.openidInfo = res.data; + uni.setStorageSync('openidInfo', res.data) + // _this.$api.setCache('openidInfo', res.data); + } + }).catch(error => { + console.log('获取openid失败:', error); + }) + }else{ + uni.$u.http.post('/api/user/getTtOpenid ', { + code: code, + }).then(res => { + if (res.code == 1) { + _this.openidInfo = res.data; + uni.setStorageSync('openidInfo', res.data) + // _this.$api.setCache('openidInfo', res.data); + } + }).catch(error => { + console.log('获取openid失败:', error); + }) + } + }, // 获取手机号 getPhoneNumber(e) { @@ -937,7 +979,7 @@ export default { min-height: 100vh; background-color: #F1F2F8; background-image: url("https://naweigetetest2.hschool.com.cn/dyqc/bgx2.png"); - background-size: 750rpx 797rpx; + background-size: 100%; background-repeat: no-repeat; }