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
2470cdaa
Commit
2470cdaa
authored
Aug 30, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plus(9/5-权重高)
parent
5208abdd
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
76 deletions
+56
-76
userCenter.js
src/pages/userCenter/userCenter.js
+31
-38
userCenter.json
src/pages/userCenter/userCenter.json
+3
-1
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+4
-8
subPage.js
src/subPackage/page/pages/subPage/subPage.js
+14
-21
subPage.wxml
src/subPackage/page/pages/subPage/subPage.wxml
+4
-8
No files found.
src/pages/userCenter/userCenter.js
View file @
2470cdaa
...
...
@@ -15,14 +15,14 @@ wxService.page({
* 页面的初始数据
*/
data
:
{
pages
:[],
pages
:
[],
render
:
null
,
// 渲染页面数据对象(安全渲染)
renderPageOver
:
false
,
// 渲染页面结束
integralNum
:
0
,
couponNum
:
0
,
// isAllScreen: fullSucreen.isAllScreen
isAllScreen
:
config
.
isAllScreen
,
token
:
''
,
token
:
''
,
isAuthorization
:
false
,
pageId
:
3
,
baseUserInfo
:
null
,
...
...
@@ -34,7 +34,7 @@ wxService.page({
/**
* 生命周期函数--监听页面加载
*/
onLoad
()
{
onLoad
()
{
// 设置 导航栏背景颜色
// wxService.getNavBarBackGroundColor('#000000', '#ff0000')
this
.
setData
(
...
...
@@ -61,38 +61,38 @@ wxService.page({
* 监听子组件事件
* */
updatePage
(
ev
)
{
const
{
pageId
}
=
ev
.
detail
const
{
pageId
}
=
ev
.
detail
// this.setData({
// pages: [],
// pageId
// },()=>{
// this.initPage(pageId)
// })
wxService
.
router
(
`/subPackage/page/pages/subPage/subPage`
).
search
({
pageId
})
wxService
.
router
(
`/subPackage/page/pages/subPage/subPage`
).
search
({
pageId
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
onShow
()
{
// 取会员卡号
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
cardMember
=
wx
.
getStorageSync
(
'_cardMember'
)
// 登录接口返回err
const
reLoginErrFlag
=
wx
.
getStorageSync
(
'reLoginErr'
)
if
(
baseUserInfo
&&
!
reLoginErrFlag
){
if
(
baseUserInfo
&&
!
reLoginErrFlag
)
{
this
.
setData
({
token
:
wx
.
getStorageSync
(
'token'
),
baseUserInfo
,
cardMember
,
isAuthorization
:
false
},
()
=>
{
},
()
=>
{
// 积分数量
// this.getMemberPointInfo()
// 优惠券数量
// this.getMemberCouponInfo()
})
}
else
if
(
!
baseUserInfo
&&
reLoginErrFlag
)
{
else
if
(
!
baseUserInfo
&&
reLoginErrFlag
)
{
this
.
setData
({
isAuthorization
:
true
})
...
...
@@ -121,7 +121,7 @@ wxService.page({
// })
// }
// 获取手机信息
wxService
.
getSystemInfo
().
then
(
res
=>
{
wxService
.
getSystemInfo
().
then
(
res
=>
{
this
.
setData
({
outoHeigth
:
res
.
windowHeight
})
...
...
@@ -136,7 +136,7 @@ wxService.page({
},
// page 信息
initPage
(
pageId
){
initPage
(
pageId
)
{
this
.
setData
({
products
:
[]
})
...
...
@@ -145,9 +145,9 @@ wxService.page({
})
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
wxService
.
post
(
`/merchant/modelPage/mainSetting?brandId=
${
app
.
globalData
.
brandId
}
`
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
this
.
setData
({
pageBackgroundColor
:
data
.
page
.
backgroundColor
||
0
})
...
...
@@ -160,31 +160,14 @@ wxService.page({
this
.
setData
({
currHomePageId
:
data
.
page
.
pageId
})
// tabBar
// const currentTabBar = data.paragraphs.filter(item=> item.type == 5)
// let currentTabBarRedirectIdArr = []
// currentTabBar.forEach(tab=> {
// tab.tabBar.images.forEach(item=> {
// if(item.link){
// currentTabBarRedirectIdArr.push(item.redirectId-0)
// console.log('-link--',item.link.type, item.redirectId)
// } else if(item.row){
// console.log('-row--')
// }
// })
// })
// const {currHomePageId} = this.data
// let isCurrentBar = currentTabBarRedirectIdArr.includes(currHomePageId)
// console.log('-roaaaaaw--',currentTabBarRedirectIdArr, isCurrentBar)
// 段落
const
products
=
data
.
paragraphs
const
filterResult
=
products
.
map
((
res
,
index
)
=>
{
const
filterResult
=
products
.
map
((
res
,
index
)
=>
{
return
{
...
res
,
index
...
res
,
index
}
}).
filter
(
item
=>
{
}).
filter
(
item
=>
{
// wx.hideLoading()
})
...
...
@@ -205,16 +188,26 @@ wxService.page({
* @param isLastPage
* @param now
*/
renderPageFunc
({
products
})
{
let
productData
=
handlerDataOnPage
.
handlerArray
(
products
)
renderPageFunc
({
products
})
{
// 9 plus(9/5-权重高)
let
newProducts
=
[...
products
]
let
typeArr
=
[]
newProducts
.
map
(
item
=>
typeArr
.
push
(
item
.
type
))
if
(
typeArr
.
includes
(
9
)
&&
typeArr
.
includes
(
5
))
{
newProducts
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
==
5
)
{
newProducts
.
splice
(
index
,
1
)
}
})
}
// let productData = handlerDataOnPage.handlerArray(products)
let
productData
=
handlerDataOnPage
.
handlerArray
(
newProducts
)
logger
.
log
(
'productData.keysNum'
,
productData
.
keysNum
(),
productData
)
this
.
setData
({
...
productData
},()
=>
{
},
()
=>
{
wx
.
hideLoading
()
})
},
/**
...
...
src/pages/userCenter/userCenter.json
View file @
2470cdaa
...
...
@@ -13,6 +13,7 @@
"bannerAd"
:
"/component/bannerAd/bannerAd"
,
"attention"
:
"/component/attention/attention"
,
"guide-page-modal"
:
"/component/guidePageModal/guidePageModal"
,
"bottom-tabs"
:
"/component/bottomTabs/bottomTabs"
"bottom-tabs"
:
"/component/bottomTabs/bottomTabs"
,
"plus"
:
"/component/plus/plus"
}
}
\ No newline at end of file
src/pages/userCenter/userCenter.wxml
View file @
2470cdaa
...
...
@@ -14,12 +14,8 @@
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<
!--<
view class="" wx:if="{{pItem.type == 5}}">
<view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs tab-bar="{{pItem.tabBar}}" />
</view>-->
<view class="" wx:if="{{ pItem.type == 9 ? pItem.type == 9 : pItem.type == 5}}">
<!-- <attention wx:if="{{pItem.type == 9}}" /> wx:else -->
<bottom-tabs currHome-pageId="{{currHomePageId}}" bind:updatePage="updatePage" tab-bar="{{pItem.tabBar}}" />
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" />
...
...
@@ -30,9 +26,9 @@
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<!--
<view class="" wx:if="{{pItem.type == 9}}">
<
attention
/>
</view>
-->
<view class="" wx:if="{{pItem.type == 9}}">
<
plus sku-list="{{pItem.plus}}"
/>
</view>
</block>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}' />
...
...
src/subPackage/page/pages/subPage/subPage.js
View file @
2470cdaa
...
...
@@ -140,22 +140,6 @@ wxService.page({
this
.
setData
({
currHomePageId
:
data
.
page
.
pageId
})
// tabBar
// const currentTabBar = data.paragraphs.filter(item=> item.type == 5)
// let currentTabBarArr =[]
// currentTabBar.forEach(tab=> {
// currentTabBarArr = tab.tabBar.images
// console.log('---', currentTabBarArr)
// currentTabBarArr.forEach(item=> {
// if(item.link){
// console.log('-link--',item.link.type, item.link.url)
// } else if(item.row){
// console.log('-row--')
// }
// })
// })
// 段落
const
products
=
data
.
paragraphs
const
filterResult
=
products
.
map
((
res
,
index
)
=>
{
...
...
@@ -183,15 +167,25 @@ wxService.page({
* @param isLastPage
* @param now
*/
renderPageFunc
({
products
})
{
let
productData
=
handlerDataOnPage
.
handlerArray
(
products
)
renderPageFunc
({
products
})
{
// 9 plus(9/5-权重高)
let
newProducts
=
[...
products
]
let
typeArr
=
[]
newProducts
.
map
(
item
=>
typeArr
.
push
(
item
.
type
))
if
(
typeArr
.
includes
(
9
)
&&
typeArr
.
includes
(
5
))
{
newProducts
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
==
5
)
{
newProducts
.
splice
(
index
,
1
)
}
})
}
// let productData = handlerDataOnPage.handlerArray(products)
let
productData
=
handlerDataOnPage
.
handlerArray
(
newProducts
)
logger
.
log
(
'productData.keysNum'
,
productData
.
keysNum
(),
productData
)
this
.
setData
({
...
productData
},()
=>
{
},
()
=>
{
wx
.
hideLoading
()
})
}
})
\ No newline at end of file
src/subPackage/page/pages/subPage/subPage.wxml
View file @
2470cdaa
...
...
@@ -14,12 +14,8 @@
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<
!--<
view class="" wx:if="{{pItem.type == 5}}">
<view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs tab-bar="{{pItem.tabBar}}" />
</view>-->
<view class="" wx:if="{{ pItem.type == 9 ? pItem.type == 9 : pItem.type == 5}}">
<!-- <attention wx:if="{{pItem.type == 9}}" /> wx:else -->
<bottom-tabs currHome-pageId="{{currHomePageId}}" bind:updatePage="updatePage" tab-bar="{{pItem.tabBar}}" />
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" />
...
...
@@ -30,9 +26,9 @@
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<!--
<view class="" wx:if="{{pItem.type == 9}}">
<
attention
/>
</view>
-->
<view class="" wx:if="{{pItem.type == 9}}">
<
plus sku-list="{{pItem.plus}}"
/>
</view>
</block>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}' />
...
...
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