Commit 69315081 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents c0dbf0c2 be89f34a
...@@ -40,7 +40,7 @@ App({ ...@@ -40,7 +40,7 @@ App({
onShow: function (options = {}) { onShow: function (options = {}) {
console.log('app-onshow', options) console.log('app-onshow', options)
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const { registerTime ='' } = baseUserInfo.member const registerTime = baseUserInfo && baseUserInfo.member && baseUserInfo.member.registerTime || ''
// ios 兼容 是不是plus vip // ios 兼容 是不是plus vip
let currentEndTime = (new Date(registerTime.replace(/-/g, '/'))).getTime(); // 过期时间 let currentEndTime = (new Date(registerTime.replace(/-/g, '/'))).getTime(); // 过期时间
......
<!--component/bottomTabs/bottomTabs.wxml--> <!--component/bottomTabs/bottomTabs.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" /> <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}}"> <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"> <block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab"> <view class="tab">
<!--当前页面需要授权 未授权--> <!--当前页面需要授权 未授权-->
<view wx:if="{{tools.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab"> <view wx:if="{{utils.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab">
<view wx:if="{{!currentHasUserInfo}}" class="btn-tab"> <view wx:if="{{!currentHasUserInfo}}" class="btn-tab">
<button <button
bindgetuserinfo="_getUserInfo" bindgetuserinfo="_getUserInfo"
...@@ -18,13 +18,23 @@ ...@@ -18,13 +18,23 @@
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </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%;"> <button class='btn btn-primary' style="height: 100%;">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
</view> </view>
</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%"> <button class='btn btn-primary' style="height: 100%">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
...@@ -35,12 +45,47 @@ ...@@ -35,12 +45,47 @@
<view class="bottom-tab fixed-bottom0" wx:if="{{tabBar.num == 5}}"> <view class="bottom-tab fixed-bottom0" wx:if="{{tabBar.num == 5}}">
<block wx:for="{{tabs}}" wx:key="{{index}}" wx:for-item="tab"> <block wx:for="{{tabs}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab" data-item="{{tab}}" bindtap="handelToPage"> <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}}' /> <image class='tab-img' src='{{tab.activeImageUrl}}' />
</button> </button>
<button wx:else> <button wx:else>
<image class='tab-img' src='{{tab.imageUrl}}' /> <image class='tab-img' src='{{tab.imageUrl}}' />
</button> </button>-->
</view> </view>
</block> </block>
</view> </view>
......
...@@ -5,7 +5,7 @@ const envInfo = require('../../config/index').envInfo ...@@ -5,7 +5,7 @@ const envInfo = require('../../config/index').envInfo
Component({ Component({
properties: { properties: {
currentHasUserInfo:{ currentHasUserInfo: {
type: Boolean, type: Boolean,
type: false type: false
}, },
...@@ -59,21 +59,18 @@ Component({ ...@@ -59,21 +59,18 @@ Component({
currentPlusStyle: null currentPlusStyle: null
}, },
observers: { observers: {
'**': function(e) { '**': function (e) {
// 每次 setData 都触发 // 每次 setData 都触发
}, },
}, },
attached() { attached() {
const { isPlusVip, imageUrl } = app.globalData const { isPlusVip, imageUrl } = app.globalData
const { personData } = this.data const { personData } = this.data
this.setData({ this.setData({
personCenter: personData, personCenter: personData,
baseImgUrl: imageUrl, baseImgUrl: imageUrl,
isPlusVip, isPlusVip,
currentPlusStyle: isPlusVip ? personData.plus.filter(item=> item.purchased == 1)[0] : personData.plus.filter(item=> item.purchased == 0)[1] currentPlusStyle: isPlusVip ? personData.plus.filter(item => item.purchased == 1)[0] : personData.plus.filter(item => item.purchased == 0)[0]
},()=> {
console.log('aaaaaaaaaa', this.data.currentPlusStyle)
}) })
}, },
methods: { methods: {
......
...@@ -27,9 +27,26 @@ function formateUrl(url, BASE_IMG_URL){ ...@@ -27,9 +27,26 @@ function formateUrl(url, BASE_IMG_URL){
return 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 = { module.exports = {
formateUrl:formateUrl, formateUrl:formateUrl,
numberFormat: numberFormat, numberFormat: numberFormat,
date: date, date: date,
handerNickName: handerNickName handerNickName: handerNickName,
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