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
c1f36c5f
Commit
c1f36c5f
authored
Aug 29, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_7.1.0' into feature-zyw-sc
parents
c18a7dae
5fae665e
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
412 additions
and
122 deletions
+412
-122
bottomTabs.js
src/component/bottomTabs/bottomTabs.js
+72
-3
bottomTabs.wxml
src/component/bottomTabs/bottomTabs.wxml
+2
-2
picNav.js
src/component/picNav/picNav.js
+96
-29
tabSort.js
src/component/tabSort/tabSort.js
+76
-3
tabSort.wxml
src/component/tabSort/tabSort.wxml
+1
-0
userCenter.js
src/pages/userCenter/userCenter.js
+13
-1
userCenter.json
src/pages/userCenter/userCenter.json
+2
-1
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+2
-49
project.config.json
src/project.config.json
+3
-2
subPage.js
src/subPackage/page/pages/subPage/subPage.js
+18
-2
subPage.json
src/subPackage/page/pages/subPage/subPage.json
+10
-1
subPage.wxml
src/subPackage/page/pages/subPage/subPage.wxml
+34
-22
common.js
src/utils/common.js
+83
-7
No files found.
src/component/bottomTabs/bottomTabs.js
View file @
c1f36c5f
...
...
@@ -69,9 +69,78 @@ Component({
* 组件的方法列表
*/
methods
:
{
handelToPage
(
e
){
const
{
route
}
=
e
.
currentTarget
.
dataset
wxService
.
router
(
route
)
handelToPage
(
event
){
const
ev
=
event
.
currentTarget
.
dataset
;
let
curItemType
=
ev
.
item
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
console
.
log
(
'curItemType'
,
curItemType
,
curItemType
.
link
.
type
)
// 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
)
{
// 触发父组件更新页面
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
})
}
else
if
(
curItemType
.
link
.
type
==
3
)
{
// 预览
wx
.
previewImage
({
current
:
`
${
app
.
globalData
.
imageUrl
}
/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
urls
:
[
`
${
app
.
globalData
.
imageUrl
}
/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
})
}
else
if
(
curItemType
.
link
.
type
==
4
)
{
wxService
.
router
(
`/
${
currentClickType
}
`
)
}
else
if
(
curItemType
.
link
.
type
==
5
)
{
if
(
currentClickType
==
1
)
{
wxService
.
openCard
()
}
else
if
(
currentClickType
==
2
)
{
wxService
.
openCard
()
}
}
else
if
(
curItemType
.
link
.
type
==
6
)
{
wxService
.
router
(
`/
${
currentClickType
}
`
)
}
else
if
(
curItemType
.
link
.
type
==
7
)
{
// 集点详情
console
.
log
(
'pointPath'
,
currentClickType
)
wxService
.
router
(
`
${
currentClickType
}
`
)
}
}
else
if
(
curItemType
.
row
)
{
let
rowObj
=
JSON
.
parse
(
curItemType
.
row
)
let
currentClickRow
=
app
.
globalData
.
commonFunc
.
getLinkRow
(
rowObj
.
type
,
rowObj
)
console
.
log
(
'bacccccccccc'
,
currentClickRow
)
if
(
rowObj
.
type
==
1
)
{
}
else
if
(
rowObj
.
type
==
2
)
{
}
else
if
(
rowObj
.
type
==
3
)
{
}
else
if
(
rowObj
.
type
==
4
)
{
}
else
if
(
rowObj
.
type
==
5
)
{
}
else
if
(
rowObj
.
type
==
6
)
{
}
else
if
(
rowObj
.
type
==
7
)
{
}
else
if
(
rowObj
.
type
==
8
)
{
// 商品
wxService
.
router
(
`/pages/productDetail/productDetail?productId=
${
currentClickRow
}
`
)
}
else
if
(
rowObj
.
type
==
9
)
{
// 分类
wxService
.
router
(
`/subPackage/page/pages/categoryPro/categoryPro?
${
currentClickRow
}
`
)
}
}
}
}
})
src/component/bottomTabs/bottomTabs.wxml
View file @
c1f36c5f
...
...
@@ -11,7 +11,7 @@
<block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab">
<view
class="tab"
data-
route="{{tab.route
}}"
data-
item="{{tab
}}"
bindtap="handelToPage"
>
<image class='tab-img' wx:if="{{currentRoute == tab.route}}" src='{{tab.activeImageUrl}}' />
...
...
@@ -21,7 +21,7 @@
</view>
<view class="bottom-tab fixed-bottom0" style="height: 108rpx;" wx:if="{{tabBar.num == 5}}">
<block wx:for="{{tabs}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab" data-
route="{{tab.route
}}" bindtap="handelToPage">
<view class="tab" data-
item="{{tab
}}" bindtap="handelToPage">
<image class='tab-img' wx:if="{{currentRoute == tab.route}}" src='{{tab.activeImageUrl}}' />
<image class='tab-img' wx:else src='{{tab.imageUrl}}' />
</view>
...
...
src/component/picNav/picNav.js
View file @
c1f36c5f
...
...
@@ -43,68 +43,135 @@ Component({
})
},
preview
(
e
)
{
const
{
appid
,
path
,
link
,
item
}
=
e
.
currentTarget
.
dataset
const
ev
=
e
.
currentTarget
.
dataset
let
curItemType
=
ev
.
item
console
.
log
(
'ev'
,
curItemType
)
const
{
memberActivateStatus
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 获取当前帐号信息
const
accountInfo
=
utils
.
getAccountInfo
()
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 2019.06.14
let
currentClickType
=
app
.
globalData
.
commonFunc
.
getLink
(
item
.
link
.
type
,
item
)
if
(
link
.
type
==
1
)
{
// 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
)
{
// userInfo 不存在 授权弹框
this
.
setData
({
isAuthorization
:
true
})
return
false
}
else
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
)
{
wxService
.
openCard
()
return
false
}
if
(
link
.
type
==
2
)
{
if
(
curItemType
.
link
.
type
==
2
)
{
// 触发父组件更新页面
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
})
}
else
if
(
link
.
type
==
3
)
{
}
else
if
(
curItemType
.
link
.
type
==
3
)
{
// 预览
wx
.
previewImage
({
current
:
`
${
app
.
globalData
.
imageUrl
}
/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
urls
:
[
`
${
app
.
globalData
.
imageUrl
}
/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
})
}
else
if
(
link
.
type
==
4
)
{
wxService
.
router
(
`
${
currentClickType
}
`
)
}
else
if
(
link
.
type
==
5
)
{
}
else
if
(
curItemType
.
link
.
type
==
4
)
{
wxService
.
router
(
`/
${
currentClickType
}
`
)
}
else
if
(
curItemType
.
link
.
type
==
5
)
{
if
(
currentClickType
==
1
)
{
wxService
.
openCard
()
}
else
if
(
currentClickType
==
2
)
{
// wxService.openCard()
if
(
userInfo
&&
userInfo
.
member
&&
userInfo
.
member
.
mobile
&&
!
userInfo
.
memberActivateStatus
)
{
// 手机号存在 但未激活 跳转激活领卡页面 老用户
this
.
setData
({
isAuthorizationActiveText
:
'新激活领卡'
,
isAuthorization
:
true
,
isAuthorizationType
:
3
},
()
=>
{
return
false
})
}
else
{
wxService
.
openCard
()
}
}
}
else
if
(
link
.
type
==
6
){
wxService
.
router
(
`
${
currentClickType
}
`
)
}
else
if
(
link
.
type
==
7
){
}
else
if
(
curItemType
.
link
.
type
==
6
)
{
wxService
.
router
(
`/
${
currentClickType
}
`
)
}
else
if
(
curItemType
.
link
.
type
==
7
)
{
// 集点详情
let
pointPath
=
currentClickType
&&
currentClickType
.
split
(
'?'
)[
0
]
let
pointIdParams
=
currentClickType
&&
currentClickType
.
split
(
'?'
)[
1
]
let
pointId
=
pointIdParams
.
split
(
'='
)[
1
]
wxService
.
router
(
`
${
pointPath
}
`
).
search
({
id
:
pointId
})
console
.
log
(
'pointPath'
,
currentClickType
)
wxService
.
router
(
`
${
currentClickType
}
`
)
}
}
else
if
(
curItemType
.
row
)
{
let
rowObj
=
JSON
.
parse
(
curItemType
.
row
)
let
currentClickRow
=
app
.
globalData
.
commonFunc
.
getLinkRow
(
rowObj
.
type
,
rowObj
)
if
(
rowObj
.
type
==
1
)
{
}
else
if
(
rowObj
.
type
==
2
)
{
}
else
if
(
rowObj
.
type
==
3
)
{
}
else
if
(
rowObj
.
type
==
4
)
{
}
else
if
(
rowObj
.
type
==
5
)
{
}
else
if
(
rowObj
.
type
==
6
)
{
}
else
if
(
rowObj
.
type
==
7
)
{
}
else
if
(
rowObj
.
type
==
8
)
{
// 商品
wxService
.
router
(
`/pages/productDetail/productDetail?productId=
${
currentClickRow
}
`
)
}
else
if
(
rowObj
.
type
==
9
)
{
// 分类
wxService
.
router
(
`/subPackage/page/pages/categoryPro/categoryPro?
${
currentClickRow
}
`
)
}
}
// 2019.06.14
// let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
// if (link.type == 1) {
// // 触发父组件更新页面 外部小程序
// this.setData({
// isAuthorization: false
// })
// return false
// } else if (!userInfo) {
// // userInfo 不存在 授权弹框
// this.setData({
// isAuthorization: true
// })
// return false
// }
// if (link.type == 2) {
// // 触发父组件更新页面
// wxService.nextTick(() => {
// this.triggerEvent('updatePage', { pageId: currentClickType.url })
// })
// } else if (link.type == 3) {
// // 预览
// wx.previewImage({
// current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接
// urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
// })
// } else if (link.type == 4) {
// wxService.router(`${currentClickType}`)
// } else if (link.type == 5) {
// if (currentClickType == 1) {
// wxService.openCard()
// } else if (currentClickType == 2) {
// // wxService.openCard()
// if (userInfo && userInfo.member && userInfo.member.mobile && !userInfo.memberActivateStatus) {
// // 手机号存在 但未激活 跳转激活领卡页面 老用户
// this.setData({
// isAuthorizationActiveText: '新激活领卡',
// isAuthorization: true,
// isAuthorizationType: 3
// }, () => {
// return false
// })
// } else {
// wxService.openCard()
// }
// }
// } else if(link.type == 6){
// wxService.router(`${currentClickType}`)
// } else if(link.type == 7){
// // 集点详情
// let pointPath = currentClickType && currentClickType.split('?')[0]
// let pointIdParams = currentClickType && currentClickType.split('?')[1]
// let pointId = pointIdParams.split('=')[1]
// wxService.router(`${pointPath}`).search({ id: pointId })
// }
},
activeTocard
(
e
)
{
if
(
e
.
detail
)
{
...
...
src/component/tabSort/tabSort.js
View file @
c1f36c5f
...
...
@@ -9,7 +9,7 @@ Component({
* 组件的属性列表
*/
properties
:
{
categoryType
:{
categoryType
:
{
type
:
Object
,
value
:
null
}
...
...
@@ -23,6 +23,7 @@ Component({
data
:
{
// currentTab: 0,
currentTab
:
99
,
isAuthorization
:
false
,
// false 不显示 true 显示
},
/**
* 组件的方法列表
...
...
@@ -37,9 +38,12 @@ Component({
// 设置tab active
switchNav
(
event
)
{
const
ev
=
event
.
currentTarget
.
dataset
;
console
.
log
(
'ev'
,
ev
)
let
cur
=
ev
.
current
let
redirectid
=
ev
.
redirectid
console
.
log
(
'redirectid'
,
redirectid
)
let
curItemType
=
ev
.
item
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 切换 active
if
(
this
.
data
.
currentTab
==
cur
)
{
return
false
}
else
{
...
...
@@ -47,6 +51,75 @@ Component({
currentTab
:
cur
,
})
}
// 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
)
{
// 触发父组件更新页面
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updatePage'
,
{
pageId
:
currentClickType
.
url
})
})
}
else
if
(
curItemType
.
link
.
type
==
3
)
{
// 预览
wx
.
previewImage
({
current
:
`
${
app
.
globalData
.
imageUrl
}
/
${
currentClickType
.
imageUrl
}
`
,
// 当前显示图片的http链接
urls
:
[
`
${
app
.
globalData
.
imageUrl
}
/
${
currentClickType
.
link
.
url
}
`
]
// 需要预览的图片http链接列表
})
}
else
if
(
curItemType
.
link
.
type
==
4
)
{
wxService
.
router
(
`/
${
currentClickType
}
`
)
}
else
if
(
curItemType
.
link
.
type
==
5
)
{
if
(
currentClickType
==
1
)
{
wxService
.
openCard
()
}
else
if
(
currentClickType
==
2
)
{
wxService
.
openCard
()
}
}
else
if
(
curItemType
.
link
.
type
==
6
)
{
wxService
.
router
(
`/
${
currentClickType
}
`
)
}
else
if
(
curItemType
.
link
.
type
==
7
)
{
// 集点详情
console
.
log
(
'pointPath'
,
currentClickType
)
wxService
.
router
(
`
${
currentClickType
}
`
)
}
}
else
if
(
curItemType
.
row
)
{
let
rowObj
=
JSON
.
parse
(
curItemType
.
row
)
let
currentClickRow
=
app
.
globalData
.
commonFunc
.
getLinkRow
(
rowObj
.
type
,
rowObj
)
console
.
log
(
'bacccccccccc'
,
currentClickRow
)
if
(
rowObj
.
type
==
1
)
{
}
else
if
(
rowObj
.
type
==
2
)
{
}
else
if
(
rowObj
.
type
==
3
)
{
}
else
if
(
rowObj
.
type
==
4
)
{
}
else
if
(
rowObj
.
type
==
5
)
{
}
else
if
(
rowObj
.
type
==
6
)
{
}
else
if
(
rowObj
.
type
==
7
)
{
}
else
if
(
rowObj
.
type
==
8
)
{
// 商品
wxService
.
router
(
`/pages/productDetail/productDetail?productId=
${
currentClickRow
}
`
)
}
else
if
(
rowObj
.
type
==
9
)
{
// 分类
wxService
.
router
(
`/subPackage/page/pages/categoryPro/categoryPro?
${
currentClickRow
}
`
)
}
}
},
switchTab
(
event
)
{
var
cur
=
event
.
detail
.
current
...
...
src/component/tabSort/tabSort.wxml
View file @
c1f36c5f
...
...
@@ -12,6 +12,7 @@
style="width:{{navItemWidth}}%"
data-current="{{idx}}"
data-redirectId="{{navItem.redirectId}}"
data-item ="{{navItem}}"
bindtap="switchNav"
>
<view>{{navItem.title}}</view>
...
...
src/pages/userCenter/userCenter.js
View file @
c1f36c5f
...
...
@@ -156,7 +156,19 @@ wxService.page({
})
// tabBar
const
currentTabBar
=
data
.
paragraphs
.
filter
(
item
=>
item
.
type
==
5
)
console
.
log
(
'---'
,
currentTabBar
)
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
)
=>
{
...
...
src/pages/userCenter/userCenter.json
View file @
c1f36c5f
...
...
@@ -13,6 +13,6 @@
"bannerAd"
:
"/component/bannerAd/bannerAd"
,
"attention"
:
"/component/attention/attention"
,
"guide-page-modal"
:
"/component/guidePageModal/guidePageModal"
,
"bottom-tabs"
:
"
./../..
/component/bottomTabs/bottomTabs"
"bottom-tabs"
:
"/component/bottomTabs/bottomTabs"
}
}
\ No newline at end of file
src/pages/userCenter/userCenter.wxml
View file @
c1f36c5f
...
...
@@ -19,7 +19,7 @@
</view>-->
<view class="" wx:if="{{ pItem.type == 9 ? pItem.type == 9 : pItem.type == 5}}">
<!-- <attention wx:if="{{pItem.type == 9}}" /> wx:else -->
<bottom-tabs tab-bar="{{pItem.tabBar}}" />
<bottom-tabs
bind:updatePage="updatePage"
tab-bar="{{pItem.tabBar}}" />
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" />
...
...
@@ -34,54 +34,7 @@
<attention/>
</view>-->
</block>
<!--
<tab-sort/>
<view class="page-bgc">
<image-swiper/>
<announcement/>
<icon-swiper/>
<pic-nav/>
</view>
<view class="person-hot border_box">
<text class="person-text">- 人气热卖</text>
<span class="hot border_box">HOT -</span>
</view>
<hot-item/>
<attention/>
<bannerAd/>-->
<!-- <block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view class="pd1530" wx:if="{{pItem.type == 1}}">
<image-swiper bind:updatePage="updatePage" image-data="{{pItem.rotationchart.images}}" />
</view>
<view class="pd1530" wx:if="{{pItem.type == 2}}">
<person-center
base-user-info="{{baseUserInfo}}"
person-data="{{pItem.customer}}"
integral-num="{{integralNum}}"
coupon-num="{{couponNum}}"
token="{{token}}"
/>
</view>
<view class="pd1520" wx:if="{{pItem.type == 3}}">
<pic-nav bind:updatePage="updatePage" pic-nav="{{pItem.navigation.images}}" />
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bind:updatePage="updatePage" bottom="{{pItem.bottom}}" />
</view>
</block>-->
</view>
<
!--<authorization-modal isAuthorization='{{isAuthorization}}' />--
>
<
authorization-modal isAuthorization='{{isAuthorization}}' /
>
<guide-page-modal show="{{guidePageModalShow}}" />
src/project.config.json
View file @
c1f36c5f
...
...
@@ -39,7 +39,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
25
,
"current"
:
13
,
"list"
:
[
{
"id"
:
-1
,
...
...
@@ -123,7 +123,8 @@
"id"
:
13
,
"name"
:
"subPage"
,
"pathName"
:
"subPackage/page/pages/subPage/subPage"
,
"query"
:
"pageId=4"
"query"
:
"pageId=14"
,
"scene"
:
null
},
{
"id"
:
14
,
...
...
src/subPackage/page/pages/subPage/subPage.js
View file @
c1f36c5f
...
...
@@ -74,9 +74,9 @@ wxService.page({
})
if
(
wx
.
getStorageSync
(
'_baseUserInfo'
)){
// 积分数量
this
.
getMemberPointInfo
()
//
this.getMemberPointInfo()
// 优惠券数量
this
.
getMemberCouponInfo
()
//
this.getMemberCouponInfo()
}
},
// 查询积分信息
...
...
@@ -134,6 +134,22 @@ wxService.page({
wx
.
setNavigationBarTitle
({
title
:
data
.
page
.
title
})
// 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
)
=>
{
...
...
src/subPackage/page/pages/subPage/subPage.json
View file @
c1f36c5f
...
...
@@ -5,6 +5,14 @@
"person-center"
:
"/component/personCenter/personCenter"
,
"pic-nav"
:
"/component/picNav/picNav"
,
"bottom"
:
"/component/bottom/bottom"
,
"authorization-modal"
:
"/component/authorization-modal/authorization-modal"
"authorization-modal"
:
"/component/authorization-modal/authorization-modal"
,
"tab-sort"
:
"/component/tabSort/tabSort"
,
"announcement"
:
"/component/announcement/announcement"
,
"icon-swiper"
:
"/component/iconSwiper/iconSwiper"
,
"hot-item"
:
"/component/hotItem/hotItem"
,
"bannerAd"
:
"/component/bannerAd/bannerAd"
,
"attention"
:
"/component/attention/attention"
,
"guide-page-modal"
:
"/component/guidePageModal/guidePageModal"
,
"bottom-tabs"
:
"/component/bottomTabs/bottomTabs"
}
}
\ No newline at end of file
src/subPackage/page/pages/subPage/subPage.wxml
View file @
c1f36c5f
<!--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 bind:updatePage="updatePage" 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="pd1520" wx:if="{{pItem.type == 3}}">
<pic-nav bind:updatePage="updatePage" pic-nav="{{pItem.navigation.images}}" />
</view>
<!-- 底部 -->
<view class='user-center' style="background: {{pageBackgroundColor == 1? '#eee': '#fff'}};min-height: {{outoHeigth}}px">
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部左划 5 底部 Tab 6 公告 7 分类 8 关注公众号 9 plus(9/5-权重高)-->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view wx:if="{{pItem.type == 1}}">
<image-swiper image-data="{{pItem.rotationchart.images}}" />
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<person-center person-data="{{pItem.customer}}" />
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" />
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bind:updatePage="updatePage" bottom="{{pItem.bottom}}"/>
<bottom bottom="{{pItem.bottom}}" />
</view>
<!--<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 bind:updatePage="updatePage" tab-bar="{{pItem.tabBar}}" />
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" />
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<tab-sort category-type="{{pItem.categoryType}}" />
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<!-- <view class="" wx:if="{{pItem.type == 9}}">
<attention/>
</view>-->
</block>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
<authorization-modal isAuthorization='{{isAuthorization}}' />
<guide-page-modal show="{{guidePageModalShow}}" />
src/utils/common.js
View file @
c1f36c5f
...
...
@@ -28,7 +28,7 @@ HandlerLink.prototype = {
let
res
=
this
.
currentLinkType
(
type
,
item
)
return
res
},
currentLinkType
(
type
,
item
=
{})
{
currentLinkType
(
type
,
item
=
{})
{
// 1. 外部小程序_url 2. 内部动态页面_pageId 3.预览 4. 内部页面 5. 卡券__1_卡包 2_激活领卡
if
(
type
==
1
)
{
wx
.
navigateToMiniProgram
({
...
...
@@ -36,10 +36,10 @@ HandlerLink.prototype = {
appId
:
item
.
link
.
appid
,
path
:
`
${
item
.
link
.
url
}
`
,
success
:
e
=>
{
console
.
log
(
'type=1'
,
e
)
console
.
log
(
'type=1'
,
e
)
},
fail
:
e
=>
{
console
.
log
(
'type=1'
,
e
)
console
.
log
(
'type=1'
,
e
)
},
complete
:
e
=>
{
console
.
log
(
e
)
...
...
@@ -54,24 +54,26 @@ HandlerLink.prototype = {
return
`
${
item
.
link
.
url
}
`
}
else
if
(
type
==
5
)
{
let
currentOpen
=
''
if
(
item
.
link
.
url
==
1
)
{
if
(
item
.
link
.
url
==
1
)
{
// 卡包
currentOpen
=
1
return
currentOpen
// wxService.openCardList()
}
else
if
(
item
.
link
.
url
==
2
)
{
}
else
if
(
item
.
link
.
url
==
2
)
{
// 激活领卡--开卡
currentOpen
=
2
currentOpen
=
2
return
currentOpen
// wxService.openCard()
}
}
else
if
(
type
==
6
)
{
}
else
if
(
type
==
6
)
{
// 跳转路径中包括http的跳转到h5页面中,用web-view去加载h5页面
if
(
/http/gi
.
test
(
item
.
link
.
url
))
{
const
enCodeUrl
=
encodeURIComponent
(
item
.
link
.
url
)
return
`/subPackage/page/pages/h5/h5page?url=
${
enCodeUrl
}
`
}
return
`/
${
item
.
link
.
url
}
`
}
else
if
(
type
==
7
)
{
return
`
${
item
.
link
.
url
}
`
}
}
}
...
...
@@ -81,6 +83,79 @@ const getLink = function (type, id, name) {
return
handlerLink
.
init
.
apply
(
handlerLink
,
arguments
)
}
const
getLinkRow
=
function
(
type
,
item
)
{
const
handlerLinkRow
=
new
HandlerLinkRow
()
return
handlerLinkRow
.
init
.
apply
(
handlerLinkRow
,
arguments
)
}
const
HandlerLinkRow
=
function
()
{
}
HandlerLinkRow
.
prototype
=
{
init
(
type
,
item
=
{})
{
let
res
=
this
.
currentLinkRowType
(
type
,
item
)
return
res
},
currentLinkRowType
(
type
,
item
=
{})
{
// 1 外部小程序链接 2 配置页面 3 弹出图片 4 小程序内部功能列表 5 微信卡券 6 H5链接 7 小程序内部页面 8 商品 9 分类
console
.
log
(
'commonType'
,
type
)
if
(
type
==
1
)
{
wx
.
navigateToMiniProgram
({
// 跳转外部小程序
appId
:
item
.
link
.
appid
,
path
:
`
${
item
.
link
.
url
}
`
,
success
:
e
=>
{
console
.
log
(
'type=1'
,
e
)
},
fail
:
e
=>
{
console
.
log
(
'type=1'
,
e
)
},
complete
:
e
=>
{
console
.
log
(
e
)
},
})
return
''
}
else
if
(
type
==
2
)
{
return
item
.
link
}
else
if
(
type
==
3
)
{
return
item
}
else
if
(
type
==
4
)
{
return
`
${
item
.
link
.
url
}
`
}
else
if
(
type
==
5
)
{
let
currentOpen
=
''
if
(
item
.
link
.
url
==
1
)
{
// 卡包
currentOpen
=
1
return
currentOpen
// wxService.openCardList()
}
else
if
(
item
.
link
.
url
==
2
)
{
// 激活领卡--开卡
currentOpen
=
2
return
currentOpen
// wxService.openCard()
}
}
else
if
(
type
==
6
)
{
// 跳转路径中包括http的跳转到h5页面中,用web-view去加载h5页面
if
(
/http/gi
.
test
(
item
.
link
.
url
))
{
const
enCodeUrl
=
encodeURIComponent
(
item
.
link
.
url
)
return
`/subPackage/page/pages/h5/h5page?url=
${
enCodeUrl
}
`
}
return
`/
${
item
.
link
.
url
}
`
}
else
if
(
type
==
7
)
{
return
`
${
item
.
link
.
url
}
`
}
else
if
(
type
==
8
)
{
console
.
log
(
'----'
,
item
)
return
`
${
item
.
url
}
`
}
else
if
(
type
==
9
)
{
console
.
log
(
'----'
,
item
.
name
)
return
`id=
${
item
.
url
}
&name=
${
item
.
name
}
`
}
}
}
const
getUrlParam
=
function
(
name
,
url
)
{
if
(
!
url
)
{
return
null
...
...
@@ -124,6 +199,7 @@ class Parmas {
module
.
exports
=
{
getLink
:
getLink
,
getLinkRow
:
getLinkRow
,
parmas
:
new
Parmas
(),
getUrlParam
:
getUrlParam
,
handlerLink
:
new
HandlerLink
(),
...
...
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