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
d4b8fd3d
Commit
d4b8fd3d
authored
Sep 12, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片导航授权页面
parent
3b72bd32
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
17 deletions
+72
-17
picNav.js
src/component/picNav/picNav.js
+38
-2
picNav.wxml
src/component/picNav/picNav.wxml
+26
-12
picNav.wxss
src/component/picNav/picNav.wxss
+5
-1
utils.wxs
src/wxs/utils.wxs
+3
-2
No files found.
src/component/picNav/picNav.js
View file @
d4b8fd3d
...
...
@@ -10,7 +10,7 @@ Component({
* 组件的属性列表
*/
properties
:
{
currentHasUserInfo
:{
currentHasUserInfo
:
{
type
:
Boolean
,
type
:
false
},
...
...
@@ -23,6 +23,41 @@ Component({
this
.
setData
({
baseImgUrl
:
app
.
globalData
.
imageUrl
})
const
{
picNav
}
=
this
.
data
picNav
.
forEach
(
item
=>
{
// 存在 row 处理数据 8 商品 9 分类
let
newRow
=
null
if
(
item
.
link
)
{
if
(
item
.
link
.
type
==
2
){
// 父组件 更新
const
urls
=
getCurrentPages
()
const
currentPath
=
urls
[
0
]
const
pageId
=
item
.
link
.
url
console
.
log
(
'currentPath'
,
currentPath
.
route
,
item
.
link
.
url
)
item
.
link
.
newPath
=
`/
${
currentPath
.
route
}
`
}
return
}
else
if
(
item
.
row
)
{
newRow
=
JSON
.
parse
(
item
.
row
)
if
(
newRow
.
type
==
8
)
{
newRow
.
newPath
=
'/pages/productDetail/productDetail'
}
else
if
(
newRow
.
type
==
9
)
{
newRow
.
newPath
=
'/subPackage/page/pages/categoryPro/categoryPro'
}
else
{
newRow
.
newPath
=
''
}
// item.row = JSON.stringify(newRow)
item
.
row
=
newRow
}
})
this
.
setData
({
picNav
},
()
=>
{
console
.
log
(
'wwwwpicNav'
,
this
.
data
.
picNav
)
})
},
ready
()
{
},
/**
* 组件的初始数据
...
...
@@ -88,7 +123,8 @@ Component({
wxService
.
router
(
`
${
currentClickType
}
`
)
}
}
else
if
(
curItemType
.
row
)
{
let
rowObj
=
JSON
.
parse
(
curItemType
.
row
)
// let rowObj = JSON.parse(curItemType.row)
let
rowObj
=
curItemType
.
row
let
currentClickRow
=
app
.
globalData
.
commonFunc
.
getLinkRow
(
rowObj
.
type
,
rowObj
)
if
(
rowObj
.
type
==
1
)
{
}
...
...
src/component/picNav/picNav.wxml
View file @
d4b8fd3d
...
...
@@ -7,8 +7,17 @@
wx:for-item="item"
class="nav-block"
>
<view wx:if="{{item.link ? utils.hanlerLinkNeedAuth(typeOf(item.link.newPath) != undefined ? item.link.newPath : item.link.url) : utils.hanlerLinkNeedAuth(item.row.newPath ? item.row.newPath : item.row.url)}}">
<button
wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
data-jflag="false"
open-type='getUserInfo'
class='btn btn-primary btn-vip-code'
hover-class="btn-hover"
style="height:100%"
>
<image
wx:if="{{currentHasUserInfo}}"
class="pic-img"
style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
...
...
@@ -19,17 +28,10 @@
bindload="imageLoad"
bindtap='preview'
/>
</button>
<button
wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
data-jflag="false"
open-type='getUserInfo'
class='btn btn-primary df'
hover-class="btn-hover"
style="height:100%"
>
<image
wx:if="{{currentHasUserInfo}}"
class="pic-img"
style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
...
...
@@ -40,8 +42,20 @@
bindload="imageLoad"
bindtap='preview'
/>
</button>
</view>
<view wx:else>
<image
class="pic-img"
style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
data-appid="{{item.link.appid}}"
data-path="{{item.link.url}}"
data-link="{{item.link}}"
data-item="{{item}}"
bindload="imageLoad"
bindtap='preview'
/>
</view>
</view>
</view>
src/component/picNav/picNav.wxss
View file @
d4b8fd3d
...
...
@@ -14,8 +14,11 @@
overflow: hidden;
box-sizing: border-box;
flex-direction: row;
align-items: center;
/* align-items: center; */
}
.nav-block {
flex: 1
}
.btn-vip-code {
display: flex;
}
\ No newline at end of file
src/wxs/utils.wxs
View file @
d4b8fd3d
...
...
@@ -30,16 +30,17 @@ function formateUrl(url, BASE_IMG_URL){
// 授权路径 我的/购物车/我的奖励/邀请好友/推广商品/我的地址/我的订单
function hanlerLinkNeedAuth(link){
var flag = false
if(typeof(link) != undefined && link) {
if(link.indexOf('pages/my/my') > -1 ||
link.indexOf('pages/cart/cart') > -1 ||
link.indexOf('subPackage/page/pages/orderBenefit/orderBenefit') > -1 ||
link.indexOf('subPackage/page/pages/myInvite/myInvite') > -1 ||
link.indexOf('pages/extendProduct/extendProduct') > -1 ||
link.indexOf('pages/myAddress/myAddress') > -1 ||
link.indexOf('pages/order/order') > -1)
{
link.indexOf('pages/order/order') > -1) {
flag = true
}
}
return flag
}
...
...
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