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
a53ac418
Commit
a53ac418
authored
Sep 11, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片导航子页面跳转
parent
0c2bad3b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
187 additions
and
93 deletions
+187
-93
picNav.js
src/component/picNav/picNav.js
+4
-16
userCenter.js
src/pages/userCenter/userCenter.js
+4
-2
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+1
-1
subPage.js
src/subPackage/page/pages/subPage/subPage.js
+139
-58
subPage.json
src/subPackage/page/pages/subPage/subPage.json
+3
-1
subPage.wxml
src/subPackage/page/pages/subPage/subPage.wxml
+6
-8
subPage.wxss
src/subPackage/page/pages/subPage/subPage.wxss
+29
-7
wxService.js
src/utils/wxService.js
+1
-0
No files found.
src/component/picNav/picNav.js
View file @
a53ac418
...
...
@@ -55,27 +55,15 @@ Component({
const
ev
=
event
.
currentTarget
.
dataset
;
let
curItemType
=
ev
.
item
// 获取当前帐号信息
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
console
.
log
(
'curItemType'
,
curItemType
)
// link row
if
(
curItemType
.
link
)
{
let
currentClickType
=
app
.
globalData
.
commonFunc
.
getLink
(
curItemType
.
link
.
type
,
curItemType
)
if
(
curItemType
.
link
.
type
==
1
)
{
// 触发父组件更新页面 外部小程序
this
.
setData
({
isAuthorization
:
false
})
return
false
}
else
if
(
!
userInfo
)
{
this
.
setData
({
isAuthorization
:
true
})
return
false
}
else
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
)
{
wxService
.
openCard
()
return
false
}
if
(
curItemType
.
link
.
type
==
2
)
{
}
else
if
(
curItemType
.
link
.
type
==
2
)
{
// 触发父组件更新页面
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
...
...
src/pages/userCenter/userCenter.js
View file @
a53ac418
...
...
@@ -36,6 +36,7 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
()
{
console
.
log
(
'onlod'
,
this
.
options
)
this
.
setData
(
{
pages
:
[],
...
...
@@ -73,6 +74,7 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow
()
{
console
.
log
(
'user============='
,
this
.
options
)
// 取会员卡号
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
cardMember
=
wx
.
getStorageSync
(
'_cardMember'
)
...
...
@@ -270,9 +272,9 @@ wxService.page({
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
`pages/userCenter/userCenter?t=
${
tentacleId
}
`
;
console
.
log
(
path
)
console
.
log
(
'path'
,
path
)
return
{
path
:
path
path
:
`pages/userCenter/userCenter?t=
${
tentacleId
}
`
}
}
});
...
...
src/pages/userCenter/userCenter.wxml
View file @
a53ac418
...
...
@@ -9,7 +9,7 @@
<person-center base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/>
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"
bind:updatePage="updatePage"
/>
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" />
...
...
src/subPackage/page/pages/subPage/subPage.js
View file @
a53ac418
...
...
@@ -6,6 +6,8 @@ const envInfo = require('../../../../config/index').envInfo
let
renderPage
=
null
// 渲染页面数据对象(安全渲染)
let
handlerDataOnPage
=
null
let
config
=
require
(
'../../../../configScreen/configScreen'
);
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
const
logger
=
utils
.
logger
wxService
.
page
({
...
...
@@ -13,24 +15,28 @@ 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
,
// cardMember: null,
pageBackgroundColor
:
0
,
guidePageModalShow
:
false
,
currHomePageId
:
''
,
goHome
:
false
// 默认隐藏回到首页 不存在 5 tabBar 显示
skuVOList
:[]
},
/**
/**
* 生命周期函数--监听页面加载
*/
onLoad
()
{
onLoad
()
{
console
.
log
(
'onlod'
,
this
.
options
)
this
.
setData
(
{
pages
:
[],
...
...
@@ -39,7 +45,8 @@ wxService.page({
render
:
null
,
// 渲染页面数据对象(安全渲染)
isLastPage
:
false
,
// 页面段落加载完成
renderPageOver
:
false
,
// 渲染页面结束
// isAuthorization: true
// isAuthorization: true,
outoHeigth
:
500
,
},
()
=>
{
// this.loadMore()
...
...
@@ -48,47 +55,94 @@ wxService.page({
handlerDataOnPage
=
new
utils
.
HandlerDataOnPage
()
renderPage
=
require
(
'../../../../utils/renderPage'
).
getRenderPage
()
handlerDataOnPage
.
init
(
this
,
'pages'
)
this
.
initPage
(
this
.
data
.
pageId
)
},
/**
* 监听子组件事件
* */
* */
updatePage
(
ev
)
{
const
{
pageId
}
=
ev
.
detail
this
.
setData
({
pages
:
[],
pageId
},()
=>
{
this
.
initPage
(
pageId
)
})
const
{
pageId
}
=
ev
.
detail
// this.setData({
// pages: [],
// pageId
// },()=>{
// this.initPage(pageId)
// })
wxService
.
router
(
`/subPackage/page/pages/subPage/subPage`
).
search
({
pageId
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
console
.
log
(
'subbbbbbbbb'
,
this
.
data
.
currentHasUserInfo
)
const
{
pageId
}
=
this
.
options
this
.
setData
({
token
:
wx
.
getStorageSync
(
'token'
),
pages
:
[],
// 清空当前页
pageId
,
},()
=>
{
let
currentPageId
=
pageId
?
pageId
:
this
.
data
.
pageId
this
.
initPage
(
currentPageId
)
onShow
()
{
console
.
log
(
'user============='
,
this
.
options
)
// 取会员卡号
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
cardMember
=
wx
.
getStorageSync
(
'_cardMember'
)
// 登录接口返回err
const
reLoginErrFlag
=
wx
.
getStorageSync
(
'reLoginErr'
)
if
(
baseUserInfo
&&
!
reLoginErrFlag
)
{
this
.
setData
({
token
:
wx
.
getStorageSync
(
'token'
),
baseUserInfo
,
cardMember
,
isAuthorization
:
false
},
()
=>
{
// 积分数量
this
.
getMemberPointInfo
()
// 优惠券数量
this
.
getMemberCouponInfo
()
})
}
else
if
(
!
baseUserInfo
&&
reLoginErrFlag
)
{
this
.
setData
({
isAuthorization
:
true
})
}
else
{
this
.
setData
({
isAuthorization
:
true
})
}
// if (baseUserInfo){
// this.setData({
// token: wx.getStorageSync('token'),
// baseUserInfo,
// // cardMember,
// isAuthorization: false
// })
// // 积分数量
// this.getMemberPointInfo()
// // 优惠券数量
// this.getMemberCouponInfo()
// } else {
// this.setData({
// isAuthorization: true
// })
// }
// 获取plus购买信息
// this.getPlusPurchase()
// 获取手机信息
wxService
.
getSystemInfo
().
then
(
res
=>
{
this
.
setData
({
outoHeigth
:
res
.
windowHeight
})
})
if
(
wx
.
getStorageSync
(
'_baseUserInfo'
)){
// 积分数量
// this.getMemberPointInfo()
// 优惠券数量
// this.getMemberCouponInfo()
// 设置当前选中 Tab
if
(
typeof
this
.
getTabBar
===
'function'
&&
this
.
getTabBar
())
{
this
.
getTabBar
().
setData
({
selected
:
0
})
}
},
// 查询积分信息
getMemberPointInfo
(){
getMemberPointInfo
()
{
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
get
(
`/member/memberPoint/getMyPointInfo`
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
...
...
@@ -96,16 +150,16 @@ wxService.page({
integralNum
:
data
&&
data
.
point
||
0
})
}
}
}
})
},
// 查询优惠券数量
getMemberCouponInfo
(){
// 查询优惠券数量
getMemberCouponInfo
()
{
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/coupon/coupon/memberCouponCount`
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
const
{
result
,
data
}
=
res
&&
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
...
...
@@ -113,26 +167,25 @@ wxService.page({
couponNum
:
data
&&
data
[
1
]
||
0
})
}
}
else
{
wx
.
showToast
({
title
:
'请求失败'
,
icon
:
'none'
})
}
})
},
// page 信息
initPage
(
pageId
){
initPage
(
pageId
)
{
this
.
setData
({
products
:
[]
})
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/merchant/modelPage/getDetailById?pageId=
${
pageId
}
&brandId=
${
app
.
globalData
.
brandId
}
`
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
){
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
wxService
.
post
(
`/merchant/modelPage/mainSetting/mall?brandId=
${
app
.
globalData
.
brandId
}
`
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
this
.
setData
({
pageBackgroundColor
:
data
.
page
.
backgroundColor
||
0
})
// 动态设置title
wx
.
setNavigationBarTitle
({
title
:
data
.
page
.
title
...
...
@@ -142,13 +195,14 @@ wxService.page({
this
.
setData
({
currHomePageId
:
data
.
page
.
pageId
})
// 段落
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()
})
...
...
@@ -178,15 +232,6 @@ wxService.page({
newProducts
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
==
5
)
{
newProducts
.
splice
(
index
,
1
)
}
})
}
else
{
// 默认隐藏回到首页 不存在 5 tabBar 显示
newProducts
.
forEach
(
item
=>
{
if
(
item
.
type
!=
5
)
{
this
.
setData
({
goHome
:
true
})
}
})
}
// let productData = handlerDataOnPage.handlerArray(products)
...
...
@@ -198,5 +243,40 @@ wxService.page({
},
()
=>
{
wx
.
hideLoading
()
})
},
// 获取plus购买信息
// getPlusPurchase() {
// wxService.get(`/sale/premium/query`).then(res => {
// if(!res) return false
// const { result, data } = res.data
// if (result == 0) {
// this.setData({
// skuVOList: data
// })
// }
// }).finally(() => {
// })
// },
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
(
res
)
{
let
tentacleInfo
=
{
content
:
'首页'
,
title
:
'首页'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
HOME
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
`pages/userCenter/userCenter?t=
${
tentacleId
}
`
;
console
.
log
(
'path'
,
path
)
return
{
path
:
`pages/userCenter/userCenter?t=
${
tentacleId
}
`
}
}
});
}
})
\ No newline at end of file
src/subPackage/page/pages/subPage/subPage.json
View file @
a53ac418
...
...
@@ -12,6 +12,7 @@
"attention"
:
"/component/attention/attention"
,
"guide-page-modal"
:
"/component/guidePageModal/guidePageModal"
,
"bottom-tabs"
:
"/component/bottomTabs/bottomTabs"
,
"go-home"
:
"/component/goHome/goHome"
"authorization-modal"
:
"/component/authorization-modal/authorization-modal"
,
"plus"
:
"/component/plus/plus"
}
}
\ No newline at end of file
src/subPackage/page/pages/subPage/subPage.wxml
View file @
a53ac418
...
...
@@ -6,31 +6,29 @@
<image-swiper image-data="{{pItem.rotationchart.images}}" />
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<person-center person-data="{{pItem.customer}}"
/>
<person-center base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"
/>
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" />
<pic-nav pic-nav="{{pItem.navigation.images}}"
bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"
/>
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs currHomePageId="{{currHomePageId}}" currentHasUserInfo="{{currentHasUserInfo}}" tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/>
<bottom-tabs currHomePageId="{{currHomePageId}}"
bind:getAuth="_getUserInfo"
currentHasUserInfo="{{currentHasUserInfo}}" tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}"
/>
<announcement notice="{{pItem.notice}}"/>
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<tab-sort category-type="{{pItem.categoryType}}" />
<tab-sort category-type="{{pItem.categoryType}}"
bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"
/>
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<view class="" wx:if="{{pItem.type == 9}}">
<plus sku-list="{{
pItem.plus
}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}"/>
<plus sku-list="{{
skuVOList
}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}"/>
</view>
</block>
<!--goHome-->
<go-home wx:if="{{goHome}}"/>
</view>
<guide-page-modal show="{{guidePageModalShow}}" />
src/subPackage/page/pages/subPage/subPage.wxss
View file @
a53ac418
/* subPackage/page/pages/subPage/subPage.wxss */
@import './../../../../base/base.wxss';
page
{
background: #fff!important
;
page{
padding-bottom: 320rpx
;
}
.user-center{
/* margin-bottom: 120rpx; */
background: #fff;
box-sizing:border-box;
padding-bottom:120rpx;
box-sizing: border-box;
padding-bottom: 200rpx;
height: 100%;
}
.main-content{
margin-top: 18rpx;
}
.top-content,.bottom-content{
display: flex;
flex-direction: row;
...
...
@@ -39,3 +37,27 @@ page {
height: 32rpx;
vertical-align: middle;
}
.page-bgc {
background-color: rgba(255, 255, 255, 1);
}
.person-hot {
text-align: center;
padding: 17rpx 0;
}
.person-text {
height: 32rpx;
color: rgba(51, 51, 48, 1);
font-size: 23rpx;
text-align: left;
font-family: PingFangSC-Regular;
}
.hot {
height: 32rpx;
color: rgba(192, 154, 116, 1);
font-size: 23rpx;
text-align: left;
font-family: PingFangSC-Regular;
padding-left: 10rpx;
}
src/utils/wxService.js
View file @
a53ac418
...
...
@@ -257,6 +257,7 @@ class WXService extends Http {
//生成触点对象Id
getTentacleContent
(
tentacleInfo
)
{
console
.
log
(
'生成触点对象Id'
,
tentacleInfo
)
return
this
.
post
(
'/marketing/tentacleContent/getTentacleContent'
,
tentacleInfo
).
then
((
res
)
=>
{
let
data
=
res
.
data
.
data
return
Promise
.
resolve
(
data
);
...
...
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