| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <template>
- <!-- #ifdef APP-PLUS -->
- <view
- class="animated dialog_nav"
- :style="{ top: navH + 65 + 'rpx', marginTop: sysHeight }"
- :class="[goodList ? 'dialogIndex' : '', currentPage ? '' : '']"
- v-show="currentPage"
- >
- <!-- #endif -->
- <!-- #ifndef APP-PLUS -->
- <view
- class="animated dialog_nav"
- :style="{ top: navH + 15 + 'rpx' }"
- :class="[
- goodList ? 'dialogIndex' : '',
- goodsShow ? 'dialogGoods' : '',
- currentPage ? '' : '',
- ]"
- v-show="currentPage"
- >
- <!-- #endif -->
- <view
- class="dialog_nav_item"
- :class="item.after"
- v-for="(item, index) in selectNavList"
- :key="index"
- @click="linkPage(item.url)"
- >
- <text class="iconfont" :class="item.icon"></text>
- <text class="pl-20">{{ item.name }}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "homeIdex",
- props: {
- navH: {
- type: String | Number,
- default: "",
- },
- returnShow: {
- type: Boolean,
- default: true,
- },
- goodList: {
- type: Boolean,
- default: false,
- },
- currentPage: {
- type: Boolean,
- default: false,
- },
- goodsShow: {
- type: Boolean,
- default: false,
- },
- sysHeight: {
- type: String | Number,
- default: "",
- },
- },
- data: function () {
- return {
- selectNavList: [
- {
- name: this.$t(`首页`),
- icon: "icon-shouye8",
- url: "/pages/index/index",
- after: "dialog_after",
- },
- {
- name: this.$t(`搜索`),
- icon: "icon-sousuo6",
- url: "/pages/goods/goods_search/index",
- after: "dialog_after",
- },
- {
- name: this.$t(`购物车`),
- icon: "icon-gouwuche7",
- url: "/pages/order_addcart/order_addcart",
- after: "dialog_after",
- },
- {
- name: this.$t(`我的收藏`),
- icon: "icon-shoucang3",
- url: "/pages/users/user_goods_collection/index",
- after: "dialog_after",
- },
- {
- name: this.$t(`个人中心`),
- icon: "icon-gerenzhongxin1",
- url: "/pages/user/index",
- },
- ],
- };
- },
- methods: {
- linkPage(url) {
- if (
- [
- "/pages/goods_cate/goods_cate",
- "/pages/order_addcart/order_addcart",
- "/pages/user/index",
- "/pages/index/index",
- ].indexOf(url) == -1
- ) {
- uni.navigateTo({
- url: url,
- });
- } else {
- uni.switchTab({
- url: url,
- });
- }
- },
- },
- created() {},
- beforeDestroy() {},
- };
- </script>
- <style scoped lang="scss">
- .dialog_nav {
- position: absolute;
- /* #ifdef MP */
- left: 14rpx;
- /* #endif */
- /* #ifndef MP */
- right: -20rpx;
- /* #endif */
- width: 240rpx;
- background: #ffffff;
- box-shadow: 0px 0px 16rpx rgba(0, 0, 0, 0.08);
- z-index: 310;
- border-radius: 14rpx;
- &::before {
- content: "";
- width: 0;
- height: 0;
- border-left: 15rpx solid transparent;
- border-right: 15rpx solid transparent;
- border-bottom: 30rpx solid #fff;
- position: absolute;
- top: -30rpx;
- /* #ifdef APP-PLUS || H5 */
- right: 32rpx;
- /* #endif */
- /* #ifdef MP */
- left: 80rpx;
- /* #endif */
- border-bottom-color: #f2f2f2;
- }
- &::after {
- content: "";
- width: 0;
- height: 0;
- border-left: 15rpx solid transparent;
- border-right: 15rpx solid transparent;
- border-bottom: 30rpx solid #fff;
- position: absolute;
- top: -20rpx;
- /* #ifdef APP-PLUS || H5 */
- right: 32rpx;
- /* #endif */
- /* #ifdef MP */
- left: 80rpx;
- /* #endif */
- }
- &.dialogIndex {
- left: 14rpx;
- &::before {
- left: -160rpx !important;
- }
- }
- &.dialogGoods {
- &::before {
- left: -170rpx;
- }
- }
- }
- .dialog_nav_item {
- width: 100%;
- height: 84rpx;
- line-height: 84rpx;
- padding: 0 20rpx 0;
- box-sizing: border-box;
- border-bottom: #eee;
- font-size: 28rpx;
- color: #333;
- position: relative;
- display: flex;
- .iconfont {
- font-size: 32rpx;
- margin-right: 26rpx;
- }
- }
- .dialog_after {
- ::after {
- content: "";
- position: absolute;
- width: 90px;
- height: 1px;
- background-color: #eeeeee;
- bottom: 0;
- right: 0;
- }
- }
- </style>
|