Authored by bevishuang

适配全面屏 --review by 鲍思思

... ... @@ -33,7 +33,8 @@ App({
udid: '',
unionType: '',
currentScene: 1001,
systemInfo: {}
systemInfo: {},
isFullSucreen: false, // 当前设备是否为 FullSucreen
},
reportData: {
awakeReported: false
... ... @@ -44,6 +45,12 @@ App({
verify.gen(); // 此处返回是是 Promise,需要调用接口的业务,最好在 then 里边执行
let sysInfo = wx.getSystemInfoSync();
if (sysInfo.screenHeight && sysInfo.safeArea) {
if(sysInfo.screenHeight > sysInfo.safeArea.bottom){
this.globalData.isFullSucreen = true
}
}
if (!sysInfo.screenHeight) {
sysInfo.screenHeight = sysInfo.windowHeight;
... ... @@ -51,6 +58,7 @@ App({
if (!sysInfo.screenWidth) {
sysInfo.screenWidth = sysInfo.windowWidth;
}
this.globalData.systemInfo = sysInfo;
if (options && options.query && options.query.union_type) {
... ... @@ -216,6 +224,10 @@ App({
this.globalData.openID = openid;
return openid;
},
getIsFullScreen: function() {
return this.globalData.isFullSucreen;
},
setOpenID: function(openID) {
if (openID) {
this.globalData.openID = openID;
... ...
... ... @@ -18,8 +18,8 @@ const config = {
client_type: 'miniapp',
private_key: 'b43890b0a296ff3c7b8c260ca763980b',
app_version: '6.7.0',
miniapp_version: '0.0.1',
app_build: '3000'
miniapp_version: '1.0.1',
app_build: '3001'
},
unionType: '', // 渠道号
MINI_APP_DOMAIN: 'miniapp.yohobuy.com',
... ...
... ... @@ -10,6 +10,7 @@ let router = global.router;
Page({
data: {
isFullSucreen: false,
tabSelected: 0,
refreshText: '下拉刷新',
footText: '内容加载中...',
... ... @@ -41,6 +42,10 @@ Page({
onLoad: function() {
yas = new Yas(app);
let that = this;
let isFullSucreen = app.getIsFullScreen();
this.setData({
isFullSucreen
})
setTimeout(function() {
... ...
... ... @@ -46,7 +46,7 @@
</view>
<!--我的限购码按钮-->
<view class='my-code-button' bindtap='navigateToHome'>
<view class='my-code-button {{isFullSucreen? "fix-full-my-code-button": ""}}' bindtap='navigateToHome'>
我的限购码
</view>
</view>
... ...
... ... @@ -233,3 +233,17 @@ page {
background-color: #fff;
border-top: 1rpx solid #E0E0E0;
}
.fix-full-my-code-button {
padding-bottom:50rpx!important;
}
/* .fix-full-my-code-button::after {
content:'';
position:fixed;
bottom: 0!important;
height: 68rpx!important;
width: 100%;
background: #fff;
} */
... ...
... ... @@ -2,6 +2,20 @@ Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
properties: { /* ... */ },
methods: { /* ... */ }
properties: {
},
data:{
isFullScreen: false
},
methods: { /* ... */ },
lifetimes: {
attached: function () {
// 在组件实例进入页面节点树时执行
let app = getApp();
let isFullScreen = app.getIsFullScreen();
this.setData({
isFullScreen
});
},
}
});
... ...
<view class="bottom-action" >
<view class="bottom-action {{isFullScreen ? 'fix-full-bottom-action':''}}" >
<slot></slot>
</view>
\ No newline at end of file
... ...
... ... @@ -11,3 +11,7 @@
border-top: 1rpx solid #E0E0E0
}
.fix-full-bottom-action {
padding-bottom:50rpx!important;
}
... ...
... ... @@ -15,6 +15,7 @@ Component({
},
data: {
count: 0,
isFullScreen: false
},
methods: {
_propertyChange(newVal) {
... ... @@ -22,5 +23,15 @@ Component({
count: newVal.length
});
}
},
lifetimes: {
attached: function () {
// 在组件实例进入页面节点树时执行
let app = getApp();
let isFullScreen = app.getIsFullScreen();
this.setData({
isFullScreen
});
},
}
});
... ...
<view class="bottom-assist-list">
<view class="bottom-assist-list {{isFullScreen?'fix-full-bottom-assist-list':''}}">
<view class="assist-title">当前已成功助力好友数:{{count}}/{{num}}</view>
<view class="avatar-list">
<view class="avatar-item" wx:for="{{list}}">
... ...
... ... @@ -13,6 +13,9 @@
background-color: rgba(0, 0, 0, 0.7);
text-align: center;
}
.fix-full-bottom-assist-list {
bottom: 150rpx!important;
}
.bottom-assist-list .assist-title {
color: #fff;
... ...
... ... @@ -90,6 +90,7 @@ const ASSIST_FAIL = 2;
Page(Object.assign({
data: {
isFullScreen: false,
bottomSrc: 'https://img11.static.yhbimg.com/yhb-img01/2019/08/20/16/01d8d8964fa9fb42fe83b1aa3d0e669f37.jpg',
productSkn: 0,
productName: '',
... ... @@ -147,6 +148,7 @@ Page(Object.assign({
let originUnionID = query.originUnionID ? query.originUnionID : '';
let uid = app.getUid();
let isFullScreen = app.getIsFullScreen();
let scene = '';
if (query && query.scene && query.scene.length === 32) {
... ... @@ -164,7 +166,8 @@ Page(Object.assign({
uid,
scene,
isGoApp,
appParameter
appParameter,
isFullScreen
});
let userInfo = app.getUserInfo();
... ...
... ... @@ -57,7 +57,7 @@
<image class="bottom-image" lazy-load bindtap="goYohobuy" src="{{bottomSrc}}"></image>
<view wx:if="{{showAssistList}}" style="height:70rpx;"></view>
<view style="height:100rpx;"></view>
<view style="height:{{isFullScreen ? 150 : 100}}rpx;"></view>
<assist-list wx:if="{{showAssistList}}" list="{{avatarList}}" num="{{assistLimit}}"></assist-list>
... ... @@ -67,13 +67,13 @@
<block wx:if="{{productSourceType === 1}}">
<action-bar wx:if="{{assistStatus === 1 || assistStatus === 3}}">
<view class="bottom1-action">
<view class="bottom1-action" bindtap="assistShare">
<block wx:if="{{offlineStatus === 1}}">
<button class="as-bottom ok1" bindtap="assistShare">{{isNew=='Y' ? '邀请新用户助力获取限购码' : '邀请好友助力获取限购码'}}
<text class="buy-tip"> (线下购买专用)</text></button>
</block>
<button wx:else class="as-bottom ok" bindtap="assistShare">{{isNew=='Y' ? '邀请新用户助力获取限购码' : '邀请好友助力获取限购码'}}</button>
<view class="help-wrapper" bindtap="goHelp">
<view class="help-wrapper" catchtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
</view>
... ... @@ -110,7 +110,7 @@
<action-bar wx:elif="{{assistStatus === 4}}">
<view class="bottom1-action">
<view class="as-bottom ok">已助力</view>
<view class="help-wrapper" bindtap="goHelp">
<view class="help-wrapper" catchtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
</view>
... ... @@ -265,7 +265,7 @@
<action-bar wx:if="{{queueStatus === 1}}">
<view class="bottom1-action">
<view class="as-bottom cancel">活动尚未开始</view>
<view class="help-wrapper" bindtap="goHelp">
<view class="help-wrapper" catchtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
</view>
... ... @@ -274,7 +274,7 @@
<action-bar wx:elif="{{queueStatus === 2}}">
<view class="bottom1-action">
<view class="as-bottom ok" bindtap="goQueueList">参加排队赢取限购码</view>
<view class="help-wrapper" bindtap="goHelp">
<view class="help-wrapper" catchtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
</view>
... ... @@ -287,7 +287,7 @@
<view class="as-bottom ok" bindtap="assistShare">{{isNew=='Y' ? '邀请新用户助力排队' : '邀请好友助力排队'}}</view>
</view>
<view class="help-wrapper" bindtap="goHelp">
<view class="help-wrapper" catchtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
</view>
... ... @@ -298,7 +298,7 @@
<view class="top-assist-action">
<view class="bottom1-action">
<view class="as-bottom ok" bindtap="goQueueList">排队已结束 查看详情</view>
<view class="help-wrapper" bindtap="goHelp">
<view class="help-wrapper" catchtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
</view>
... ... @@ -326,7 +326,7 @@
<action-bar wx:if="{{queueStatus === 1}}">
<view class="bottom1-action">
<view class="as-bottom cancel">活动尚未开始</view>
<view class="help-wrapper" bindtap="goHelp">
<view class="help-wrapper" catchtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
</view>
... ... @@ -360,7 +360,7 @@
<view class="as-bottom cancel width200">已助力</view>
<view style="width:10rpx;"></view>
<view class="as-bottom ok width200" bindtap="goQueueList">查看排队详情</view>
<view class="help-wrapper" bindtap="goHelp">
<view class="help-wrapper" catchtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
</view>
... ...