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
e15065d0
Commit
e15065d0
authored
Jun 14, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 动态子页面
parent
cd20156c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
327 additions
and
2 deletions
+327
-2
app.json
src/app.json
+8
-0
userCenter.json
src/pages/userCenter/userCenter.json
+2
-1
project.config.json
src/project.config.json
+7
-1
subPage.js
src/subPackage/page/pages/subPage/subPage.js
+207
-0
subPage.json
src/subPackage/page/pages/subPage/subPage.json
+10
-0
subPage.wxml
src/subPackage/page/pages/subPage/subPage.wxml
+31
-0
subPage.wxss
src/subPackage/page/pages/subPage/subPage.wxss
+62
-0
No files found.
src/app.json
View file @
e15065d0
...
@@ -14,6 +14,14 @@
...
@@ -14,6 +14,14 @@
"pages/integralMallDetail/integralMallDetail"
,
"pages/integralMallDetail/integralMallDetail"
,
"pages/activateCard/activateCardCallback"
"pages/activateCard/activateCardCallback"
],
],
"subPackages"
:
[
{
"root"
:
"subPackage/page"
,
"pages"
:
[
"pages/subPage/subPage"
]
}
],
"window"
:
{
"window"
:
{
"backgroundTextStyle"
:
"light"
,
"backgroundTextStyle"
:
"light"
,
"navigationBarBackgroundColor"
:
"#fff"
,
"navigationBarBackgroundColor"
:
"#fff"
,
...
...
src/pages/userCenter/userCenter.json
View file @
e15065d0
...
@@ -4,6 +4,6 @@
...
@@ -4,6 +4,6 @@
"image-swiper"
:
"/component/imageSwiper/imageSwiper"
,
"image-swiper"
:
"/component/imageSwiper/imageSwiper"
,
"person-center"
:
"/component/personCenter/personCenter"
,
"person-center"
:
"/component/personCenter/personCenter"
,
"pic-nav"
:
"/component/picNav/picNav"
,
"pic-nav"
:
"/component/picNav/picNav"
,
"authorization-modal"
:
"
./../..
/component/authorization-modal/authorization-modal"
"authorization-modal"
:
"/component/authorization-modal/authorization-modal"
}
}
}
}
\ No newline at end of file
src/project.config.json
View file @
e15065d0
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
"list"
:
[]
"list"
:
[]
},
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
1
2
,
"current"
:
1
3
,
"list"
:
[
"list"
:
[
{
{
"id"
:
-1
,
"id"
:
-1
,
...
@@ -116,6 +116,12 @@
...
@@ -116,6 +116,12 @@
"name"
:
"优惠券详情"
,
"name"
:
"优惠券详情"
,
"pathName"
:
"pages/couponDetail/couponDetail"
,
"pathName"
:
"pages/couponDetail/couponDetail"
,
"query"
:
"cardno=99411120228224638656"
"query"
:
"cardno=99411120228224638656"
},
{
"id"
:
13
,
"name"
:
"subPage"
,
"pathName"
:
"subPackage/page/pages/subPage/subPage"
,
"query"
:
""
}
}
]
]
}
}
...
...
src/subPackage/page/pages/subPage/subPage.js
0 → 100644
View file @
e15065d0
// subPackage/page/pages/subPage/subPage.js
// pages/userCenter.js
const
app
=
getApp
()
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
const
envInfo
=
require
(
'../../../../config/index'
).
envInfo
let
renderPage
=
null
// 渲染页面数据对象(安全渲染)
let
handlerDataOnPage
=
null
let
config
=
require
(
'../../../../configScreen/configScreen'
);
const
logger
=
utils
.
logger
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
pages
:[],
render
:
null
,
// 渲染页面数据对象(安全渲染)
renderPageOver
:
false
,
// 渲染页面结束
startX
:
0
,
startY
:
0
,
integralNum
:
0
,
couponNum
:
0
,
// isAllScreen: fullSucreen.isAllScreen
isAllScreen
:
config
.
isAllScreen
,
token
:
''
,
isAuthorization
:
false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
this
.
setData
(
{
pages
:
[],
groupLoadState
:
'complete'
,
// 活动分组加载标志
homeApiLoading
:
true
,
render
:
null
,
// 渲染页面数据对象(安全渲染)
isLastPage
:
false
,
// 页面段落加载完成
renderPageOver
:
false
,
// 渲染页面结束
// isAuthorization: true
},
()
=>
{
// this.loadMore()
}
)
handlerDataOnPage
=
new
utils
.
HandlerDataOnPage
()
renderPage
=
require
(
'../../../../utils/renderPage'
).
getRenderPage
()
handlerDataOnPage
.
init
(
this
,
'pages'
)
this
.
initPage
()
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
this
.
setData
({
token
:
wx
.
getStorageSync
(
'token'
)
})
if
(
wx
.
getStorageSync
(
'_baseUserInfo'
)){
// 积分数量
this
.
getMemberPointInfo
()
// 优惠券数量
this
.
getMemberCouponInfo
()
}
},
// 查询积分信息
getMemberPointInfo
(){
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
get
(
`/member/memberPoint/getMyPointInfo`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
integralNum
:
data
&&
data
.
point
||
0
})
}
}
})
},
// 查询优惠券数量
getMemberCouponInfo
(){
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/coupon/coupon/memberCouponCount`
).
then
(
res
=>
{
if
(
res
){
const
{
result
,
data
}
=
res
&&
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
couponNum
:
data
&&
data
[
1
]
||
0
})
}
}
else
{
wx
.
showToast
({
title
:
'请求失败'
,
icon
:
'none'
})
}
})
},
touchStart
(
e
)
{
this
.
setData
({
startX
:
e
.
changedTouches
[
0
].
clientX
,
startY
:
e
.
changedTouches
[
0
].
clientY
});
},
touchEnd
(
e
)
{
let
x
=
e
.
changedTouches
[
0
].
clientX
;
let
y
=
e
.
changedTouches
[
0
].
clientY
;
// endX, endY, startX, startY
const
{
startX
,
startY
}
=
this
.
data
let
isTouchLeft
=
utils
.
getTouchData
(
x
,
y
,
startX
,
startY
)
// 触发左划事件
if
(
isTouchLeft
==
'left'
)
{
const
{
appid
,
path
}
=
e
.
currentTarget
.
dataset
// 获取当前帐号信息
const
accountInfo
=
utils
.
getAccountInfo
()
// 是当前小程序 直接跳转
if
(
wx
.
getStorageSync
(
'_baseUserInfo'
)){
if
(
accountInfo
.
miniProgram
.
appId
==
appid
){
wxService
.
router
(
`
${
path
}
`
)
}
else
{
// 跳转其他小程序
wx
.
navigateToMiniProgram
({
appId
:
appid
,
path
:
`
${
path
}
`
,
success
:
e
=>
{
console
.
log
(
e
)
},
fail
:
e
=>
{
console
.
log
(
e
)
},
complete
:
e
=>
{
console
.
log
(
e
)
},
})
}
}
else
{
this
.
setData
({
isAuthorization
:
true
})
}
}
},
// page 信息
initPage
(){
this
.
setData
({
products
:
[]
})
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/merchant/modelPage/getDetailById?pageId=3&brandId=
${
app
.
globalData
.
brandId
}
`
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
){
// 动态设置title
wx
.
setNavigationBarTitle
({
title
:
data
.
page
.
title
})
// 段落
const
products
=
data
.
paragraphs
const
filterResult
=
products
.
map
((
res
,
index
)
=>
{
return
{
...
res
,
index
}
}).
filter
(
item
=>
{
// wx.hideLoading()
})
const
render
=
renderPage
.
initPaging
(
filterResult
).
initRenderData
(
products
)
this
.
data
.
render
=
render
const
renderData
=
render
.
next
()
this
.
data
.
renderPageOver
=
renderData
.
done
this
.
renderPageFunc
({
products
:
renderData
.
value
})
}
}).
finally
(()
=>
{
wx
.
hideLoading
();
})
},
/**
* 渲染数据(合并之前的数据)
* @param products 数组数据
* @param isLastPage
* @param now
*/
renderPageFunc
({
products
})
{
let
productData
=
handlerDataOnPage
.
handlerArray
(
products
)
logger
.
log
(
'productData.keysNum'
,
productData
.
keysNum
(),
productData
)
this
.
setData
({
...
productData
},()
=>
{
wx
.
hideLoading
()
})
}
})
\ No newline at end of file
src/subPackage/page/pages/subPage/subPage.json
0 → 100644
View file @
e15065d0
{
"navigationBarTitleText"
:
"广东7-Eleven会员专区"
,
"usingComponents"
:
{
"image-swiper"
:
"/component/imageSwiper/imageSwiper"
,
"person-center"
:
"/component/personCenter/personCenter"
,
"pic-nav"
:
"/component/picNav/picNav"
,
"authorization-modal"
:
"/component/authorization-modal/authorization-modal"
}
}
\ No newline at end of file
src/subPackage/page/pages/subPage/subPage.wxml
0 → 100644
View file @
e15065d0
<!--subPackage/page/pages/subPage/subPage.wxml-->
<view class='user-center'>
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部-->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<!--{{pItem.type}}-->
<!-- 轮播 -->
<view class="pd1530" wx:if="{{pItem.type == 1}}">
<image-swiper image-data="{{pItem.rotationchart.images}}" />
</view>
<!-- 个人中心 {{pItem.customer}}-->
<view class="pd1530" wx:if="{{pItem.type == 2}}">
<person-center person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view>
<!-- 图片导航 {{pItem.navigation.images}} pd1530-->
<view class="pd1530" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" />
</view>
<!-- 底部 -->
<view class="" wx:if="{{pItem.type == 4}}">
<view class='footer-content' style="background:{{pItem.bottom.color}};color:{{pItem.bottom.color}}" data-appid="{{pItem.bottom.link.appid}}" data-path="{{pItem.bottom.link.url}}" catchtouchstart='touchStart' catchtouchend="touchEnd">
<text class="footer-arrow" style="color:{{pItem.bottom.fontColor}}"><<</text>
<text class='footer-text' style="color:{{pItem.bottom.fontColor}}">{{pItem.bottom.title}}</text>
</view>
</view>
</block>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
src/subPackage/page/pages/subPage/subPage.wxss
0 → 100644
View file @
e15065d0
/* subPackage/page/pages/subPage/subPage.wxss */
@import './../../../../base/base.wxss';
page {
background: #fff!important;
}
.user-center{
/* margin-bottom: 120rpx; */
background: #fff;
box-sizing:border-box;
padding-bottom:120rpx;
}
.main-content{
margin-top: 18rpx;
}
.top-content,.bottom-content{
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
}
.top-content image{
width: 337rpx;
}
.top-left-img image{
height: 337rpx;
}
.top-right-img image{
height: 160rpx;
}
.bottom-content image{
width: 337rpx;
height: 160rpx;
}
.footer-content{
text-align: center;
background-color: #02bb70;
line-height: 100rpx;
position: fixed;
margin-top:20rpx;
bottom: 0;
width:100%;
}
.arrow-left {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
}
.footer-text{
color: #ffffff;
font-size: 32rpx;
font-weight: 700;
letter-spacing:2rpx;
/* font-family:"iconfont-711" !important; */
}
.footer-arrow {
position: absolute;
left: 50rpx;
color: #ffffff;
}
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