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
be89f34a
Commit
be89f34a
authored
Sep 12, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tab
parent
2eaa7d13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
8 deletions
+70
-8
bottomTabs.wxml
src/component/bottomTabs/bottomTabs.wxml
+52
-7
utils.wxs
src/wxs/utils.wxs
+18
-1
No files found.
src/component/bottomTabs/bottomTabs.wxml
View file @
be89f34a
<!--component/bottomTabs/bottomTabs.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<
wxs src="./handlerData.wxs" module="tools" /
>
<
!--<wxs src="./handlerData.wxs" module="tools" />--
>
<view class='bgc fixed-bottom0' style="background-image:url({{tabBar.num == 4 ? '': '/assets/imgs/7_1_0/bg.png'}});" wx:if="{{tabBar.num == 4}}">
<block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab">
<!--当前页面需要授权
切
未授权-->
<view wx:if="{{
too
ls.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab">
<!--当前页面需要授权
且
未授权-->
<view wx:if="{{
uti
ls.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab">
<view wx:if="{{!currentHasUserInfo}}" class="btn-tab">
<button
bindgetuserinfo="_getUserInfo"
...
...
@@ -18,13 +18,23 @@
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button>
</view>
<view wx:else class="btn-tab" data-item="{{tab}}" bindtap="handelToPage">
<view
wx:else
class="btn-tab"
data-item="{{tab}}"
bindtap="handelToPage"
>
<button class='btn btn-primary' style="height: 100%;">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button>
</view>
</view>
<view wx:else class="btn-tab" data-item="{{tab}}" bindtap="handelToPage">
<view
wx:else
class="btn-tab"
data-item="{{tab}}"
bindtap="handelToPage"
>
<button class='btn btn-primary' style="height: 100%">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button>
...
...
@@ -35,12 +45,47 @@
<view class="bottom-tab fixed-bottom0" wx:if="{{tabBar.num == 5}}">
<block wx:for="{{tabs}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab" data-item="{{tab}}" bindtap="handelToPage">
<button wx:if="{{currHomePageId == tab.redirectId}}">
<!--当前页面需要授权 且未授权-->
<view wx:if="{{utils.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab">
<view wx:if="{{!currentHasUserInfo}}" class="btn-tab">
<button
bindgetuserinfo="_getUserInfo"
data-jflag="false"
open-type='getUserInfo'
class='btn btn-primary'
hover-class="btn-hover"
style="height: 100%;"
>
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button>
</view>
<view
wx:else
class="btn-tab"
data-item="{{tab}}"
bindtap="handelToPage"
>
<button class='btn btn-primary' style="height: 100%;">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button>
</view>
</view>
<view
wx:else
class="btn-tab"
data-item="{{tab}}"
bindtap="handelToPage"
>
<button class='btn btn-primary' style="height: 100%">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button>
</view>
<!-- <button wx:if="{{currHomePageId == tab.redirectId}}">
<image class='tab-img' src='{{tab.activeImageUrl}}' />
</button>
<button wx:else>
<image class='tab-img' src='{{tab.imageUrl}}' />
</button>
</button>
-->
</view>
</block>
</view>
...
...
src/wxs/utils.wxs
View file @
be89f34a
...
...
@@ -27,9 +27,26 @@ function formateUrl(url, BASE_IMG_URL){
return url;
}
// 授权路径 我的/购物车/我的奖励/邀请好友/推广商品/我的地址/我的订单
function hanlerLinkNeedAuth(link){
var flag = false
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)
{
flag = true
}
return flag
}
module.exports = {
formateUrl:formateUrl,
numberFormat: numberFormat,
date: date,
handerNickName: handerNickName
handerNickName: handerNickName,
hanlerLinkNeedAuth: hanlerLinkNeedAuth
}
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