Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
50e4e625
Commit
50e4e625
authored
Jun 05, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify: 适配
parent
470e3f0e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
10 deletions
+77
-10
app.js
src/app.js
+39
-4
configScreen.js
src/configScreen/configScreen.js
+13
-0
IntegralMall.wxml
src/pages/IntegralMall/IntegralMall.wxml
+1
-1
userCenter.js
src/pages/userCenter/userCenter.js
+5
-2
userCenter.json
src/pages/userCenter/userCenter.json
+1
-0
util.js
src/utils/util.js
+18
-3
No files found.
src/app.js
View file @
50e4e625
...
@@ -3,10 +3,35 @@ import { cEvent } from './utils/event.js'
...
@@ -3,10 +3,35 @@ import { cEvent } from './utils/event.js'
const
Promise
=
require
(
'lib/bluebird'
)
const
Promise
=
require
(
'lib/bluebird'
)
var
utils
=
require
(
'utils/util.js'
)
var
utils
=
require
(
'utils/util.js'
)
var
wxService
=
require
(
'utils/wxService'
)
var
wxService
=
require
(
'utils/wxService'
)
let
config
=
require
(
'./configScreen/configScreen'
);
const
envInfo
=
require
(
'config/index'
).
envInfo
const
envInfo
=
require
(
'config/index'
).
envInfo
App
({
App
({
onLaunch
:
function
(
e
)
{
onLaunch
:
function
(
e
)
{
// this.checkFullSucreen()
try
{
let
res
=
wx
.
getSystemInfoSync
();
config
.
pixelRate
=
res
.
windowWidth
/
750
;
config
.
platform
=
res
.
platform
;
config
.
statusBarHeight
=
res
.
statusBarHeight
;
if
(
res
.
platform
.
toLowerCase
()
==
'devtools'
)
{
config
.
capsuleHeight
=
44
;
}
if
(
res
.
platform
.
toLowerCase
()
==
'android'
)
{
config
.
capsuleHeight
=
48
;
}
config
.
titleHeight
=
(
config
.
capsuleHeight
+
config
.
statusBarHeight
)
/
config
.
pixelRate
;
if
(
res
.
statusBarHeight
>=
44
)
{
config
.
isHighHead
=
true
;
}
if
(
res
.
windowHeight
>
750
)
config
.
isAllScreen
=
true
;
config
.
systemHeight
=
res
.
windowHeight
;
console
.
log
(
'config'
,
config
)
}
catch
(
e
)
{
console
.
log
(
e
);
}
},
},
onShow
:
function
(
options
=
{})
{
onShow
:
function
(
options
=
{})
{
...
@@ -38,9 +63,6 @@ App({
...
@@ -38,9 +63,6 @@ App({
onHide
:
function
()
{
onHide
:
function
()
{
this
.
globalData
.
loginFirst
=
false
this
.
globalData
.
loginFirst
=
false
},
},
getUserInfo
()
{
getUserInfo
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
_baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
_baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
...
@@ -51,6 +73,18 @@ App({
...
@@ -51,6 +73,18 @@ App({
}
}
})
})
},
},
checkFullSucreen
()
{
const
self
=
this
wxService
.
getSystemInfo
().
then
(
res
=>
{
debugger
if
((
res
.
screenHeight
-
res
.
windowHeight
-
res
.
statusBarHeight
-
32
)
>
72
)
{
// 处理相关逻辑
self
.
globalData
.
isFullSucreen
=
true
// setGlobalData('fullScreen', true)
}
})
},
globalData
:
{
globalData
:
{
userInfo
:
null
,
userInfo
:
null
,
userBaseInfo
:
null
,
// openid
userBaseInfo
:
null
,
// openid
...
@@ -61,6 +95,7 @@ App({
...
@@ -61,6 +95,7 @@ App({
storeId
:
''
,
storeId
:
''
,
storeName
:
''
,
storeName
:
''
,
loginFirst
:
false
,
loginFirst
:
false
,
imageUrl
:
""
//图片地址
imageUrl
:
""
,
//图片地址
isFullSucreen
:
false
,
// 当前设备是否为 FullSucreen
}
}
})
})
src/configScreen/configScreen.js
0 → 100644
View file @
50e4e625
module
.
exports
=
{
pixelRate
:
0.5
,
//px与rpx换算关系
platform
:
'ios'
,
//操作平台 用于适配胶囊高度
capsuleHeight
:
40
,
//胶囊高度
statusBarHeight
:
20
,
//手机顶部状态栏高度
titleHeight
:
136
,
//整个导航头高度
systemHeight
:
0
,
//手机屏幕高度
isAllScreen
:
false
,
//是否是全面屏手机
isHighHead
:
false
,
//是否是刘海屏手机
};
\ No newline at end of file
src/pages/IntegralMall/IntegralMall.wxml
View file @
50e4e625
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<image src='/assets/imgs/qr-code.png'></image>
<image src='/assets/imgs/qr-code.png'></image>
</view>
</view>
<view class='coupon-info'>
<view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.
couponNam
e}}</view>
<view class='coupon-name fs-28'>{{item.
titl
e}}</view>
<view class='coupon-time fs-24'>{{item.startTime}}</view>
<view class='coupon-time fs-24'>{{item.startTime}}</view>
<view class='coupon-desc fs-24' data-id="{{item.id}}" bindtap="goCouponDetail">查看详情</view>
<view class='coupon-desc fs-24' data-id="{{item.id}}" bindtap="goCouponDetail">查看详情</view>
</view>
</view>
...
...
src/pages/userCenter/userCenter.js
View file @
50e4e625
...
@@ -5,6 +5,8 @@ const utils = require('../../utils/util')
...
@@ -5,6 +5,8 @@ const utils = require('../../utils/util')
const
envInfo
=
require
(
'../../config/index'
).
envInfo
const
envInfo
=
require
(
'../../config/index'
).
envInfo
let
renderPage
=
null
// 渲染页面数据对象(安全渲染)
let
renderPage
=
null
// 渲染页面数据对象(安全渲染)
let
handlerDataOnPage
=
null
let
handlerDataOnPage
=
null
let
config
=
require
(
'../../configScreen/configScreen'
);
const
logger
=
utils
.
logger
const
logger
=
utils
.
logger
wxService
.
page
({
wxService
.
page
({
...
@@ -18,7 +20,9 @@ wxService.page({
...
@@ -18,7 +20,9 @@ wxService.page({
startX
:
0
,
startX
:
0
,
startY
:
0
,
startY
:
0
,
integralNum
:
0
,
integralNum
:
0
,
couponNum
:
0
couponNum
:
0
,
// isAllScreen: fullSucreen.isAllScreen
isAllScreen
:
config
.
isAllScreen
},
},
/**
/**
...
@@ -60,7 +64,6 @@ wxService.page({
...
@@ -60,7 +64,6 @@ wxService.page({
this
.
getMemberPointInfo
()
this
.
getMemberPointInfo
()
// 优惠券数量
// 优惠券数量
this
.
getMemberCouponInfo
()
this
.
getMemberCouponInfo
()
},
},
// 查询积分信息
// 查询积分信息
getMemberPointInfo
(){
getMemberPointInfo
(){
...
...
src/pages/userCenter/userCenter.json
View file @
50e4e625
{
{
"disableScroll"
:
true
,
"navigationBarTitleText"
:
"广东7-Eleven会员专区"
,
"navigationBarTitleText"
:
"广东7-Eleven会员专区"
,
"usingComponents"
:
{
"usingComponents"
:
{
"image-swiper"
:
"/component/imageSwiper/imageSwiper"
,
"image-swiper"
:
"/component/imageSwiper/imageSwiper"
,
...
...
src/utils/util.js
View file @
50e4e625
...
@@ -62,11 +62,11 @@ function getTouchData(endX, endY, startX, startY) {
...
@@ -62,11 +62,11 @@ function getTouchData(endX, endY, startX, startY) {
}
}
/**
/**
*
全面屏
*
view宽高比
*/
*/
function
aspectRatio
(
h
,
w
)
{
function
aspectRatio
(
h
,
w
)
{
let
viewStyle
=
{}
let
viewStyle
=
{}
let
originalScale
=
h
/
w
// view宽高比
let
originalScale
=
h
/
w
wxService
.
getSystemInfo
().
then
(
res
=>
{
wxService
.
getSystemInfo
().
then
(
res
=>
{
let
windowscale
=
res
.
windowHeight
/
res
.
windowWidth
let
windowscale
=
res
.
windowHeight
/
res
.
windowWidth
if
(
originalScale
<
windowscale
){
if
(
originalScale
<
windowscale
){
...
@@ -80,6 +80,20 @@ function aspectRatio(h,w) {
...
@@ -80,6 +80,20 @@ function aspectRatio(h,w) {
return
viewStyle
;
return
viewStyle
;
}
}
/**
* 全面屏
*/
// function checkFullSucreen () {
// const self = this
// wxService.getSystemInfo().then(res => {
// debugger
// if ((res.screenHeight - res.windowHeight - res.statusBarHeight - 32) > 72) {
// // 处理相关逻辑
// self.globalData.isFullSucreen = true
// // setGlobalData('fullScreen', true)
// }
// })
// }
/**
/**
* 解析 url 参数
* 解析 url 参数
...
@@ -262,5 +276,6 @@ module.exports = {
...
@@ -262,5 +276,6 @@ module.exports = {
logger
:
new
Logger
(),
logger
:
new
Logger
(),
getTouchData
,
getTouchData
,
getAccountInfo
,
getAccountInfo
,
aspectRatio
aspectRatio
,
// checkFullSucreen
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment