Commit ec04da04 by 高淑倩

pic

parent e084a999
...@@ -52,7 +52,7 @@ Component({ ...@@ -52,7 +52,7 @@ Component({
}) })
this.setData({ picNav }, () => { this.setData({ picNav }, () => {
console.log('ppp', this.data.picNav)
}) })
}, },
/** /**
......
...@@ -7,7 +7,11 @@ ...@@ -7,7 +7,11 @@
wx:for-item="item" wx:for-item="item"
class="nav-block" class="nav-block"
> >
<!--当前页面需要授权 且未授权--> <!-- false 不需要授权 -->
<!-- {{item.link ? item.link.url : item.row.newPath }}
{{ utils.hanlerLinkNoNeedAuth(item) }}
-->
<!-- 当前页面需要授权 且未授权-->
<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)}}"> <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 <button
wx:if="{{!currentHasUserInfo}}" wx:if="{{!currentHasUserInfo}}"
...@@ -19,7 +23,7 @@ ...@@ -19,7 +23,7 @@
style="height:100%" style="height:100%"
> >
<image <image
class="pic-img" class="pic-img hhh"
style="width: {{100}}%;height: {{100}}px;" style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}" src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
data-appid="{{item.link.appid}}" data-appid="{{item.link.appid}}"
...@@ -33,7 +37,7 @@ ...@@ -33,7 +37,7 @@
<image <image
wx:if="{{currentHasUserInfo}}" wx:if="{{currentHasUserInfo}}"
class="pic-img" class="pic-img yyyy"
style="width: {{100}}%;height: {{100}}px;" style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}" src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
data-appid="{{item.link.appid}}" data-appid="{{item.link.appid}}"
...@@ -46,7 +50,7 @@ ...@@ -46,7 +50,7 @@
</view> </view>
<view wx:else> <view wx:else>
<image <image
class="pic-img" class="pic-img ttt"
style="width: {{100}}%;height: {{100}}px;" style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}" src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
data-appid="{{item.link.appid}}" data-appid="{{item.link.appid}}"
......
...@@ -27,6 +27,11 @@ function formateUrl(url, BASE_IMG_URL){ ...@@ -27,6 +27,11 @@ function formateUrl(url, BASE_IMG_URL){
return url; return url;
} }
// 不需要授权页面 首页/种草列表/种草详情/分类/商品列表/商品详情
function hanlerLinkNoNeedAuth(item){
console.log('www', typeof(item.row && item.row.newPath) != undefined ? '1' : '2')
}
// 授权路径 我的/购物车/我的奖励/邀请好友/推广商品/我的地址/我的订单 // 授权路径 我的/购物车/我的奖励/邀请好友/推广商品/我的地址/我的订单
function hanlerLinkNeedAuth(link){ function hanlerLinkNeedAuth(link){
var flag = false var flag = false
...@@ -44,10 +49,12 @@ function hanlerLinkNeedAuth(link){ ...@@ -44,10 +49,12 @@ function hanlerLinkNeedAuth(link){
return flag return flag
} }
module.exports = { module.exports = {
formateUrl:formateUrl, formateUrl:formateUrl,
numberFormat: numberFormat, numberFormat: numberFormat,
date: date, date: date,
handerNickName: handerNickName, handerNickName: handerNickName,
hanlerLinkNeedAuth: hanlerLinkNeedAuth hanlerLinkNeedAuth: hanlerLinkNeedAuth,
hanlerLinkNoNeedAuth: hanlerLinkNoNeedAuth
} }
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