acdr-ui/dist/dev/mp-weixin/modules/mall/goods/components/detail/detail-navbar.js.map

1 line
8.9 KiB
Plaintext
Raw Normal View History

2024-09-19 07:20:14 +08:00
{"version":3,"file":"detail-navbar.js","sources":["../../../../../../../../src/modules/mall/goods/components/detail/detail-navbar.vue","../../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9tb2R1bGVzL21hbGwvZ29vZHMvY29tcG9uZW50cy9kZXRhaWwvZGV0YWlsLW5hdmJhci52dWU"],"sourcesContent":["<!-- 商品详情:商品/评价/详情的 nav -->\r\n<template>\r\n <su-fixed alway :bgStyles=\"{ background: '#fff' }\" :val=\"0\" noNav opacity :placeholder=\"false\">\r\n <su-status-bar />\r\n <view\r\n class=\"ui-bar ss-flex ss-col-center ss-row-between ss-p-x-20\"\r\n :style=\"[{ height: sys_navBar - sys_statusBar + 'px' }]\"\r\n >\r\n <!-- 左 -->\r\n <view class=\"icon-box ss-flex\">\r\n <view class=\"icon-button icon-button-left ss-flex ss-row-center\" @tap=\"onClickLeft\">\r\n <text class=\"sicon-back\" v-if=\"hasHistory\" />\r\n <text class=\"sicon-home\" v-else />\r\n </view>\r\n <view class=\"line\"></view>\r\n <view class=\"icon-button icon-button-right ss-flex ss-row-center\" @tap=\"onClickRight\">\r\n <text class=\"sicon-more\" />\r\n </view>\r\n </view>\r\n <!-- 中 -->\r\n <view class=\"detail-tab-card ss-flex-1\" :style=\"[{ opacity: state.tabOpacityVal }]\">\r\n <view class=\"tab-box ss-flex ss-col-center ss-row-around\">\r\n <view\r\n class=\"tab-item ss-flex-1 ss-flex ss-row-center ss-col-center\"\r\n v-for=\"item in state.tabList\"\r\n :key=\"item.value\"\r\n @tap=\"onTab(item)\"\r\n >\r\n <view class=\"tab-title\" :class=\"state.curTab === item.value ? 'cur-tab-title' : ''\">\r\n {{ item.label }}\r\n </view>\r\n <view v-show=\"state.curTab === item.value\" class=\"tab-line\"></view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef MP -->\r\n <view :style=\"[capsuleStyle]\"></view>\r\n <!-- #endif -->\r\n </view>\r\n </su-fixed>\r\n</template>\r\n\r\n<script setup>\r\nimport { reactive } from 'vue'\r\nimport { onPageScroll } from '@dcloudio/uni-app'\r\nimport sheep from '@/sheep'\r\nimport throttle from '@/sheep/helper/throttle.js'\r\nimport { showMenuTools, closeMenuTools } from '@/sheep/hooks/useModal'\r\n\r\nconst sys_statusBar = sheep.$platform.device.statusBarHeight\r\nconst sys_navBar = sheep.$platform.navbar\r\nconst capsuleStyle = {\r\n width: sheep.$platform.capsule.width + 'px',\r\n height: sheep.$platform.capsule.height + 'px',\r\n}\r\n\r\nconst state = reactive({\r\n tabOpacityVal: 0,\r\n curTab: 'goods',\r\n tabList: [\r\n {\r\n label: '商品',\r\n value: 'goods',\r\n to: 'detail-swiper-selector',\r\n },\r\n {\r\n label: '评价',\r\n value: 'comment',\r\n to: 'detail-comment-selector',\r\n },\r\n {\r\n label: '详情',\r\n value: 'detail',\r\n to: 'detail-content-selector',\r\n },\r\n ],\r\n})\r\nconst emits = defineEmits(['clickLeft'])\r\nconst hasHistory = sheep.$router.hasHistory()\r\n\r\nfunction onClickLeft() {\r\n if (hasHistory) {\r\n sheep.$router.back()\r\n } else {\r\n sheep.$router.go('/modules/mall/index/index')\r\n }\r\n emits('clickLeft')\r\n}\r\n\r\nfunction onClickRight() {\r\n showMenuTools()\r\n}\r\n\r\nconst commentCard = {\r\n top: 0,\r\n bottom: 0,\r\n}\r\n\r\nfunction getCommentCardNode() {\r\n return new Promise((res, rej) => {\r\n uni\r\n .createSelectorQuery()\r\n .select('.detail-comment-selector')\r\n .boundingClientRect((data) => {\r\n if (data) {\r\n commentCard.top = data.top\r\n commentCard.bottom = data.top + data.height\r\n res(data)\r\n } else {\r\n res(null)\r\n }\r\n })\r\n .exec()\r\n })\r\n}\r\n\r\nfunction onTab(tab) {\r\n let scrollTop = 0\r\n if (tab.value === 'comment') {\r\n scrollTop = commentCard.top - sys_navBar + 1\r\n } else if (tab.value === 'detail') {\r\n scrollTop = commentCard.bottom - sys_navB