Commit bb38e656 by 谢中龙

优化部分功能

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