forked from EastWorld/wechat-app-mall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
适配IphoneX底部安全区域,解决按钮被遮挡问题;Tabbar中购物车Icon添加数量显示Badge。Fit in the safe a…
…rea at the bottom of IphoneX to solve the problem of blocking the button; Add the number of shopping cart Icon in Tabbar to display Badge.
- Loading branch information
Showing
9 changed files
with
64 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// 显示购物车tabBar的Badge | ||
function showTabBarBadge(){ | ||
wx.getStorage({ | ||
key: 'shopCarInfo', | ||
success: function (res) { | ||
if (res.data.shopNum > 0) { | ||
wx.setTabBarBadge({ | ||
index: 1, | ||
text: `${res.data.shopNum}` | ||
}); | ||
} else { | ||
wx.removeTabBarBadge({ | ||
index: 1 | ||
}); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
module.exports = { | ||
showTabBarBadge: showTabBarBadge | ||
} |