Commit bb38e656 by 谢中龙

优化部分功能

parent 7739db9f
...@@ -28,7 +28,7 @@ Component({ ...@@ -28,7 +28,7 @@ Component({
baseImgUrl: app.globalData.imageUrl baseImgUrl: app.globalData.imageUrl
}) })
const { tabBar } = this.data const { tabBar } = this.data
let currentTab = tabBar.images let currentTab = tabBar.images;
currentTab.forEach(item => { currentTab.forEach(item => {
// 存在 row 处理数据 8 商品 9 分类 // 存在 row 处理数据 8 商品 9 分类
// 1. 外部小程序_url 2. 内部动态页面_pageId 3.预览 4. 内部页面 5. 卡券__1_卡包 2_激活领卡 // 1. 外部小程序_url 2. 内部动态页面_pageId 3.预览 4. 内部页面 5. 卡券__1_卡包 2_激活领卡
...@@ -41,7 +41,17 @@ Component({ ...@@ -41,7 +41,17 @@ Component({
const pageId = item.link.url const pageId = item.link.url
item.link.newPath = `/${currentPath.route}` item.link.newPath = `/${currentPath.route}`
} }
return //处理内部固定页时
if(item.link.type == 4){
const urls = getCurrentPages()
item.link.active = false;
const currentPath = urls[urls.length - 1];
//获取当前页面的路径
if(item.link.url.indexOf(currentPath.route) > -1){
item.link.active = true;
}
}
// return
} else if (item.row) { } else if (item.row) {
newRow = JSON.parse(item.row) newRow = JSON.parse(item.row)
if (newRow.type == 8) { if (newRow.type == 8) {
...@@ -52,7 +62,6 @@ Component({ ...@@ -52,7 +62,6 @@ Component({
item.row = newRow item.row = newRow
} }
}) })
// 当前匹配路径是否需要授权 true 需要 false 不需要 // 当前匹配路径是否需要授权 true 需要 false 不需要
currentTab.forEach(item => { currentTab.forEach(item => {
let checkUrl = '' let checkUrl = ''
......
...@@ -9,36 +9,19 @@ wx:if="{{tabBar.num == 4}}"> ...@@ -9,36 +9,19 @@ wx:if="{{tabBar.num == 4}}">
<!--当前页面需要授权 且未授权--> <!--当前页面需要授权 且未授权-->
<view wx:if="{{tab.needAuth}}" class="btn-tab"> <view wx:if="{{tab.needAuth}}" class="btn-tab">
<view wx:if="{{!currentHasUserInfo}}" class="btn-tab"> <view wx:if="{{!currentHasUserInfo}}" class="btn-tab">
<button <button bindgetuserinfo="_getUserInfo" data-jflag="false" open-type='getUserInfo' class='btn' hover-class="btn-hover" style="height: 100%;">
bindgetuserinfo="_getUserInfo" <image class='tab-img' src="{{utils.formateUrl(tab.link.type == 4 ? (tab.link.active ? tab.activeImageUrl : tab.imageUrl) : (currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl),baseImgUrl)}}" />
data-jflag="false"
open-type='getUserInfo'
class='btn'
hover-class="btn-hover"
style="height: 100%;"
>
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
</view> </view>
<view <view wx:else class="btn-tab" data-item="{{tab}}" bindtap="handelToPage">
wx:else
class="btn-tab"
data-item="{{tab}}"
bindtap="handelToPage"
>
<button class='btn' style="height: 100%;"> <button class='btn' style="height: 100%;">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(tab.link.type == 4 ? (tab.link.active ? tab.activeImageUrl : tab.imageUrl) : (currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl),baseImgUrl)}}" />
</button> </button>
</view> </view>
</view> </view>
<view <view wx:else class="btn-tab" data-item="{{tab}}" bindtap="handelToPage">
wx:else
class="btn-tab"
data-item="{{tab}}"
bindtap="handelToPage"
>
<button class='btn' style="height: 100%"> <button class='btn' style="height: 100%">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(tab.link.type == 4 ? (tab.link.active ? tab.activeImageUrl : tab.imageUrl) : (currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl),baseImgUrl)}}" />
</button> </button>
</view> </view>
</view> </view>
...@@ -50,36 +33,21 @@ wx:if="{{tabBar.num == 4}}"> ...@@ -50,36 +33,21 @@ wx:if="{{tabBar.num == 4}}">
<!--当前页面需要授权 且未授权--> <!--当前页面需要授权 且未授权-->
<view wx:if="{{tab.needAuth}}" class="btn-tab"> <view wx:if="{{tab.needAuth}}" class="btn-tab">
<view wx:if="{{!currentHasUserInfo}}" class="btn-tab"> <view wx:if="{{!currentHasUserInfo}}" class="btn-tab">
<button <button bindgetuserinfo="_getUserInfo" data-jflag="false" open-type='getUserInfo' class='btn' hover-class="btn-hover" style="height: 100%;">
bindgetuserinfo="_getUserInfo" <image class='tab-img'
data-jflag="false" src="{{utils.formateUrl(tab.link.type == 4 ? (tab.link.active ? tab.activeImageUrl : tab.imageUrl) : (currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl),baseImgUrl)}}" />
open-type='getUserInfo'
class='btn'
hover-class="btn-hover"
style="height: 100%;"
>
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
</view> </view>
<view <view
wx:else wx:else class="btn-tab" data-item="{{tab}}" bindtap="handelToPage">
class="btn-tab"
data-item="{{tab}}"
bindtap="handelToPage"
>
<button class='btn' style="height: 100%;"> <button class='btn' style="height: 100%;">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(tab.link.type == 4 ? (tab.link.active ? tab.activeImageUrl : tab.imageUrl) : (currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl),baseImgUrl)}}" />
</button> </button>
</view> </view>
</view> </view>
<view <view wx:else class="btn-tab" data-item="{{tab}}" bindtap="handelToPage">
wx:else
class="btn-tab"
data-item="{{tab}}"
bindtap="handelToPage"
>
<button class='btn' style="height: 100%"> <button class='btn' style="height: 100%">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(tab.link.type == 4 ? (tab.link.active ? tab.activeImageUrl : tab.imageUrl) : (currHomePageId == (tab.link.type == '2' ? tab.link.url : '0') ? tab.activeImageUrl: tab.imageUrl),baseImgUrl)}}" />
</button> </button>
</view> </view>
</view> </view>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
justify-content: center; justify-content: center;
/* box-shadow: 0px -4px 10px 0px rgba(232, 232, 232, 0.95); */ /* box-shadow: 0px -4px 10px 0px rgba(232, 232, 232, 0.95); */
padding-top: 20rpx; padding-top: 20rpx;
/* border-top: solid 2rpx #dddddd; */ border-top: solid 1rpx #dddddd;
} }
.pdt { .pdt {
padding-top: 50rpx; padding-top: 50rpx;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"useCompilerModule": false, "useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false "userConfirmedUseCompilerModuleSwitch": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
......
...@@ -323,14 +323,22 @@ wxService.page({ ...@@ -323,14 +323,22 @@ wxService.page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function (res) { onShareAppMessage: function (res) {
//修改为参数memberId //修改为参数memberId
const { memberId, member } = wx.getStorageSync('_baseUserInfo') let type = this.data.pageFrom;
const { memberId, member } = wx.getStorageSync('_baseUserInfo');
var path = `subPackage/page/pages/categoryPro/categoryPro?id=${this.data.form.mallCategoryId}`; var path = `subPackage/page/pages/categoryPro/categoryPro?id=${this.data.form.mallCategoryId}`;
if (memberId) { if (memberId) {
let m = Integer.digit(memberId, 10, 64); let m = Integer.digit(memberId, 10, 64);
path = `subPackage/page/pages/categoryPro/categoryPro?m=${m}&id=${this.data.form.mallCategoryId}`; path = `subPackage/page/pages/categoryPro/categoryPro?m=${m}&id=${this.data.form.mallCategoryId}`;
} }
if(type){
path = `${path}&type=${type}`
}
console.log(path)
return { return {
title: '我给你分享了一些商品,赶紧去看看吧~', title: '我给你分享了一些商品,赶紧去看看吧~',
path: path path: path
......
...@@ -31,6 +31,7 @@ view{ ...@@ -31,6 +31,7 @@ view{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
/* border-top: solid 1rpx #dddddd; */
} }
.bottom-order .order-btns{ .bottom-order .order-btns{
......
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