Commit b58834b4 by 高淑倩

授权:点击TAB我的/点击购物车

parent fa7b95fd
...@@ -21,6 +21,11 @@ Component({ ...@@ -21,6 +21,11 @@ Component({
type: String, type: String,
value: '' value: ''
} }
},
attached() {
this.setData({
baseImgUrl: app.globalData.imageUrl
})
}, },
ready() { ready() {
this.setData({ this.setData({
...@@ -33,7 +38,8 @@ Component({ ...@@ -33,7 +38,8 @@ Component({
data: { data: {
currentRoute: '', currentRoute: '',
tabs: [], tabs: [],
type: 1 type: 1,
baseImgUrl: ''
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
......
<!--component/bottomTabs/bottomTabs.wxml--> <!--component/bottomTabs/bottomTabs.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<wxs src="./handlerData.wxs" module="tools" />
<view class='bgc fixed-bottom0' style="background-color:#FFF;background-image:url({{tabBar.num == 4 ? '': '/assets/imgs/7_1_0/bg.png'}});" wx:if="{{tabBar.num == 4}}"> <view class='bgc fixed-bottom0' style="background-color:#FFF;background-image:url({{tabBar.num == 4 ? '': '/assets/imgs/7_1_0/bg.png'}});" wx:if="{{tabBar.num == 4}}">
<!--<view class='bgc fixed-bottom0' style="background-color:#FFF;background-image:url({{tabBar.num == 4 ? '': '/assets/imgs/7_1_0/bg.png'}});{{tabBar.num == 4 ? 'height: 108rpx':'height: 144rpx'}}" wx:if="{{tabBar.num == 4}}">--> <!--<view class='bgc fixed-bottom0' style="background-color:#FFF;background-image:url({{tabBar.num == 4 ? '': '/assets/imgs/7_1_0/bg.png'}});{{tabBar.num == 4 ? 'height: 108rpx':'height: 144rpx'}}" wx:if="{{tabBar.num == 4}}">-->
<block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab"> <block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab" data-item="{{tab}}" bindtap="handelToPage"> <view class="tab">
<!-- <view wx:if="{{tab.desc == '个人中心'}}"> <!--当前页面需要授权 切未授权-->
<view wx:if="{{tools.hanlerLinkNeedAuth(tab.link.url)}}">
<view wx:if="{{!currentHasUserInfo}}"> <view wx:if="{{!currentHasUserInfo}}">
<button <button
bindgetuserinfo="_getUserInfo" bindgetuserinfo="_getUserInfo"
...@@ -12,20 +15,20 @@ ...@@ -12,20 +15,20 @@
class='btn btn-primary' class='btn btn-primary'
hover-class="btn-hover" hover-class="btn-hover"
> >
<image class='tab-img' src='{{currHomePageId == tab.redirectId ? "{{tab.activeImageUrl}}": "{{tab.imageUrl}}"}}' /> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button>
</view>
<view wx:else data-item="{{tab}}" bindtap="handelToPage">
<button>
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
</view> </view>
<view wx:else>3</view>
</view> </view>
<view wx:else> <view wx:else data-item="{{tab}}" bindtap="handelToPage">
22 <button>
</view>--> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
<button wx:if="{{currHomePageId == tab.redirectId}}"> </button>
<image class='tab-img' src='{{tab.activeImageUrl}}' /> </view>
</button>
<button wx:else>
<image class='tab-img' src='{{tab.imageUrl}}' />
</button>
</view> </view>
</block> </block>
</view> </view>
......
function hanlerLinkNeedAuth(link){
console.log('linkwwwwwwwwwww', link)
var flag = false
if(link.indexOf('pages/my/my') > -1 || link.indexOf('pages/cart/cart') > -1 ){
flag = true
}
console.log('flag', flag)
return flag
}
module.exports = {
hanlerLinkNeedAuth: hanlerLinkNeedAuth
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment