first commit
This commit is contained in:
Vendored
+93
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["custom-tab-bar/index"],{
|
||||
|
||||
/***/ "./node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=custom-tab-bar/index!./src/custom-tab-bar/index.tsx":
|
||||
/*!**********************************************************************************************************************!*\
|
||||
!*** ./node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=custom-tab-bar/index!./src/custom-tab-bar/index.tsx ***!
|
||||
\**********************************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": function() { return /* binding */ CustomTabBar; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
||||
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "./node_modules/@tarojs/taro/index.js");
|
||||
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/cjs/react-jsx-runtime.production.min.js");
|
||||
|
||||
|
||||
|
||||
|
||||
var TABS = [{
|
||||
pagePath: '/pages/index/index',
|
||||
text: '首页',
|
||||
icon: '🏠'
|
||||
}, {
|
||||
pagePath: '/pages/designList/index',
|
||||
text: '设计清单',
|
||||
icon: '📐'
|
||||
}, {
|
||||
pagePath: '/pages/orders/index',
|
||||
text: '订单',
|
||||
icon: '📦'
|
||||
}, {
|
||||
pagePath: '/pages/profile/index',
|
||||
text: '我的',
|
||||
icon: '👤'
|
||||
}];
|
||||
function CustomTabBar() {
|
||||
var _Taro$getCurrentInsta;
|
||||
var currentPath = "/".concat(((_Taro$getCurrentInsta = _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getCurrentInstance().router) === null || _Taro$getCurrentInsta === void 0 ? void 0 : _Taro$getCurrentInsta.path) || 'pages/index/index');
|
||||
var switchTab = function switchTab(url) {
|
||||
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().switchTab({
|
||||
url: url
|
||||
});
|
||||
};
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.View, {
|
||||
className: "custom-tab-bar",
|
||||
children: TABS.map(function (tab) {
|
||||
var isActive = currentPath === tab.pagePath;
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.View, {
|
||||
className: "tab-item ".concat(isActive ? 'active' : ''),
|
||||
onClick: function onClick() {
|
||||
return switchTab(tab.pagePath);
|
||||
},
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, {
|
||||
className: "tab-icon",
|
||||
children: tab.icon
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, {
|
||||
className: "tab-label",
|
||||
children: tab.text
|
||||
})]
|
||||
}, tab.pagePath);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/custom-tab-bar/index.tsx":
|
||||
/*!**************************************!*\
|
||||
!*** ./src/custom-tab-bar/index.tsx ***!
|
||||
\**************************************/
|
||||
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/runtime */ "./node_modules/@tarojs/runtime/dist/runtime.esm.js");
|
||||
/* harmony import */ var _node_modules_tarojs_taro_loader_lib_entry_cache_js_name_custom_tab_bar_index_index_tsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !!../../node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=custom-tab-bar/index!./index.tsx */ "./node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=custom-tab-bar/index!./src/custom-tab-bar/index.tsx");
|
||||
|
||||
|
||||
var inst = Component((0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__.createComponentConfig)(_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_custom_tab_bar_index_index_tsx__WEBPACK_IMPORTED_MODULE_0__["default"], 'custom-tab-bar/index'))
|
||||
|
||||
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_custom_tab_bar_index_index_tsx__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
},
|
||||
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
||||
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
||||
/******/ __webpack_require__.O(0, ["taro","vendors"], function() { return __webpack_exec__("./src/custom-tab-bar/index.tsx"); });
|
||||
/******/ var __webpack_exports__ = __webpack_require__.O();
|
||||
/******/ }
|
||||
]);
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"custom-tab-bar/index.js","mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChDA;AACA;AACA;AACA;AACA","sources":["webpack://smart-engraving-miniapp/./src/custom-tab-bar/index.tsx?65a5","webpack://smart-engraving-miniapp/._src_custom-tab-bar_index.tsx"],"sourcesContent":["import { View, Text } from '@tarojs/components';\nimport Taro from '@tarojs/taro';\nimport './index.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nvar TABS = [{\n pagePath: '/pages/index/index',\n text: '首页',\n icon: '🏠'\n}, {\n pagePath: '/pages/designList/index',\n text: '设计清单',\n icon: '📐'\n}, {\n pagePath: '/pages/orders/index',\n text: '订单',\n icon: '📦'\n}, {\n pagePath: '/pages/profile/index',\n text: '我的',\n icon: '👤'\n}];\nexport default function CustomTabBar() {\n var _Taro$getCurrentInsta;\n var currentPath = \"/\".concat(((_Taro$getCurrentInsta = Taro.getCurrentInstance().router) === null || _Taro$getCurrentInsta === void 0 ? void 0 : _Taro$getCurrentInsta.path) || 'pages/index/index');\n var switchTab = function switchTab(url) {\n Taro.switchTab({\n url: url\n });\n };\n return /*#__PURE__*/_jsx(View, {\n className: \"custom-tab-bar\",\n children: TABS.map(function (tab) {\n var isActive = currentPath === tab.pagePath;\n return /*#__PURE__*/_jsxs(View, {\n className: \"tab-item \".concat(isActive ? 'active' : ''),\n onClick: function onClick() {\n return switchTab(tab.pagePath);\n },\n children: [/*#__PURE__*/_jsx(Text, {\n className: \"tab-icon\",\n children: tab.icon\n }), /*#__PURE__*/_jsx(Text, {\n className: \"tab-label\",\n children: tab.text\n })]\n }, tab.pagePath);\n })\n });\n}","import { createComponentConfig } from '@tarojs/runtime'\nimport component from \"!!../../node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=custom-tab-bar/index!./index.tsx\"\nvar inst = Component(createComponentConfig(component, 'custom-tab-bar/index'))\n\nexport default component\n"],"names":[],"sourceRoot":""}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
<import src="../base.wxml"/>
|
||||
<template is="taro_tmpl" data="{{root:root}}" />
|
||||
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/@tarojs/webpack5-runner/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[4]!./src/custom-tab-bar/index.scss ***!
|
||||
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.custom-tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 120rpx;
|
||||
background: #ffffff;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-justify-content: space-around;
|
||||
-ms-flex-pack: distribute;
|
||||
justify-content: space-around;
|
||||
-webkit-align-items: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
border-top: 3rpx dashed #A0C4FF;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-flex-direction: column;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
-webkit-align-items: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-justify-content: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
padding: 10rpx 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tab-icon {
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 4rpx;
|
||||
-webkit-transition: -webkit-transform 0.2s;
|
||||
transition: -webkit-transform 0.2s;
|
||||
transition: transform 0.2s;
|
||||
transition: transform 0.2s, -webkit-transform 0.2s;
|
||||
}
|
||||
|
||||
.tab-item.active .tab-icon {
|
||||
-webkit-transform: scale(1.15);
|
||||
-ms-transform: scale(1.15);
|
||||
transform: scale(1.15);
|
||||
}
|
||||
|
||||
.tab-label {
|
||||
font-size: 20rpx;
|
||||
color: #b08d8d;
|
||||
-webkit-transition: color 0.2s;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.tab-item.active .tab-label {
|
||||
color: #ff9a9e;
|
||||
font-weight: 600;
|
||||
}
|
||||
Reference in New Issue
Block a user