修改了主题切换的问题,但登录故障问题还有残留

This commit is contained in:
2026-07-28 09:35:23 +08:00
parent fa781cc6a6
commit d37a93ab9e
71 changed files with 2135 additions and 115 deletions
Vendored
+1 -1
View File
@@ -82,7 +82,7 @@ var react__WEBPACK_IMPORTED_MODULE_3___namespace_cache;
var config = {"pages":["pages/index/index","pages/product/index","pages/diy/index","pages/checkout/index","pages/designList/index","pages/orders/index","pages/profile/index","pages/service/index","pages/wordcloud/index","pages/orderDetail/index","pages/address/index","pages/settings/index","pages/agreement/index"],"window":{"backgroundTextStyle":"light","navigationStyle":"custom","backgroundColor":"#ffffff"},"tabBar":{"custom":true,"list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/designList/index","text":"设计清单"},{"pagePath":"pages/orders/index","text":"订单"},{"pagePath":"pages/profile/index","text":"我的"}]},"permission":{"scope.writePhotosAlbum":{"desc":"保存词云图片到相册"}}};
var config = {"pages":["pages/index/index","pages/product/index","pages/diy/index","pages/checkout/index","pages/designList/index","pages/orders/index","pages/profile/index","pages/service/index","pages/wordcloud/index","pages/orderDetail/index","pages/address/index","pages/settings/index","pages/agreement/index","pages/userDatabase/index"],"window":{"backgroundTextStyle":"light","navigationStyle":"custom","backgroundColor":"#ffffff"},"tabBar":{"custom":true,"list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/designList/index","text":"设计清单"},{"pagePath":"pages/orders/index","text":"订单"},{"pagePath":"pages/profile/index","text":"我的"}]},"permission":{"scope.writePhotosAlbum":{"desc":"保存词云图片到相册"}}};
_tarojs_runtime__WEBPACK_IMPORTED_MODULE_5__.window.__taroAppConfig = config
var inst = App((0,_tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_6__.createReactApp)(_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_app_app_tsx__WEBPACK_IMPORTED_MODULE_2__["default"], /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_3___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_3___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_3__, 2))), react_dom__WEBPACK_IMPORTED_MODULE_4__["default"], config))
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"pages":["pages/index/index","pages/product/index","pages/diy/index","pages/checkout/index","pages/designList/index","pages/orders/index","pages/profile/index","pages/service/index","pages/wordcloud/index","pages/orderDetail/index","pages/address/index","pages/settings/index","pages/agreement/index"],"window":{"backgroundTextStyle":"light","navigationStyle":"custom","backgroundColor":"#ffffff"},"tabBar":{"custom":true,"list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/designList/index","text":"设计清单"},{"pagePath":"pages/orders/index","text":"订单"},{"pagePath":"pages/profile/index","text":"我的"}]},"permission":{"scope.writePhotosAlbum":{"desc":"保存词云图片到相册"}}}
{"pages":["pages/index/index","pages/product/index","pages/diy/index","pages/checkout/index","pages/designList/index","pages/orders/index","pages/profile/index","pages/service/index","pages/wordcloud/index","pages/orderDetail/index","pages/address/index","pages/settings/index","pages/agreement/index","pages/userDatabase/index"],"window":{"backgroundTextStyle":"light","navigationStyle":"custom","backgroundColor":"#ffffff"},"tabBar":{"custom":true,"list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/designList/index","text":"设计清单"},{"pagePath":"pages/orders/index","text":"订单"},{"pagePath":"pages/profile/index","text":"我的"}]},"permission":{"scope.writePhotosAlbum":{"desc":"保存词云图片到相册"}}}
+150 -43
View File
@@ -58,31 +58,28 @@ function LoginGuard(props) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ ThemeToggle; }
/* harmony export */ });
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __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__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/cjs/react.production.min.js");
/* harmony import */ var _context_ThemeContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../context/ThemeContext */ "./src/context/ThemeContext.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/cjs/react-jsx-runtime.production.min.js");
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/cjs/react.production.min.js");
/* harmony import */ var _context_ThemeContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../context/ThemeContext */ "./src/context/ThemeContext.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/cjs/react-jsx-runtime.production.min.js");
function ThemeToggle() {
var _useThemeContext = (0,_context_ThemeContext__WEBPACK_IMPORTED_MODULE_2__.useThemeContext)(),
var _useThemeContext = (0,_context_ThemeContext__WEBPACK_IMPORTED_MODULE_1__.useThemeContext)(),
theme = _useThemeContext.theme,
toggleTheme = _useThemeContext.toggleTheme;
var handleToggle = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
var handleToggle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
// ThemeProvider 在 App.tsx 全局挂载,toggleTheme() 直接修改全局 state
// 不需要 eventCenter,所有页面会自动响应。
toggleTheme();
// 触发全局事件,让其他页面也能感知(切换tab后回来的页面会重新读取storage)
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().eventCenter.trigger('theme:change');
}, [toggleTheme]);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
className: "theme-toggle",
onClick: handleToggle,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
className: "theme-icon",
children: theme === 'light' ? '🌙' : '☀️'
})
@@ -102,13 +99,10 @@ function ThemeToggle() {
/* harmony export */ useThemeContext: function() { return /* binding */ useThemeContext; }
/* harmony export */ });
/* unused harmony export ThemeContext */
/* harmony import */ var F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/* harmony import */ var F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/cjs/react.production.min.js");
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/taro */ "./node_modules/@tarojs/taro/index.js");
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/store */ "./src/utils/store.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/cjs/react-jsx-runtime.production.min.js");
/* harmony import */ var _utils_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/store */ "./src/utils/store.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/cjs/react-jsx-runtime.production.min.js");
@@ -121,12 +115,12 @@ var ThemeContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createCont
function ThemeProvider(_ref) {
var children = _ref.children;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_utils_store__WEBPACK_IMPORTED_MODULE_2__.getTheme)()),
_useState2 = (0,F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_useState, 2),
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_utils_store__WEBPACK_IMPORTED_MODULE_1__.getTheme)()),
_useState2 = (0,F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState, 2),
theme = _useState2[0],
set = _useState2[1];
var setTheme = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (t) {
(0,_utils_store__WEBPACK_IMPORTED_MODULE_2__.setTheme)(t);
(0,_utils_store__WEBPACK_IMPORTED_MODULE_1__.setTheme)(t);
set(t);
}, []);
var toggleTheme = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
@@ -134,17 +128,11 @@ function ThemeProvider(_ref) {
setTheme(next);
}, [theme, setTheme]);
// 监听全局主题变化事件(用于已挂载但未重新渲染的页面)
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
var listener = function listener(next) {
return set(next);
};
_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().eventCenter.on('theme:change', listener);
return function () {
_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().eventCenter.off('theme:change', listener);
};
}, []);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ThemeContext.Provider, {
// eventCenter 监听已移除:ThemeContext 本身就在 App.tsx 全局挂载,
// 所有页面共用一个 state,无需再靠事件广播。
// 旧代码曾在此处监听 'theme:change' 并直接 set(参数),但 trigger 未传参数导致 theme 变成 undefined。
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(ThemeContext.Provider, {
value: {
theme: theme,
toggleTheme: toggleTheme,
@@ -185,7 +173,7 @@ var PRODUCTS = [{
price: 12,
leadTime: '3-5个工作日',
description: '精选优质纸张,封面采用高档PU材质,手感细腻。内页可定制横线、方格或空白三种版式。激光微雕工艺将名字或图案精准刻印在封面,永不褪色。小巧轻便,适合随身携带,无论是课堂笔记还是日常备忘,都是你的专属伴侣。',
images: ['/img/book_small/The1.png'],
images: ['/img/book_small/The1.jpg'],
mask: {
shape: 'rect',
width: 300,
@@ -200,7 +188,7 @@ var PRODUCTS = [{
price: 45,
leadTime: '3-5个工作日',
description: 'A4尺寸大开本,180°平摊设计,书写更自由。封面可选真皮、仿布纹或磨砂材质,激光微雕区域更大,适合呈现全班名字、团队口号或公司Logo等大篇幅内容。是毕业纪念、企业年会礼品的首选。',
images: ['/img/book_big/The1.png', '/img/book_big/The2.png'],
images: ['/img/book_big/The1.jpg', '/img/book_big/The2.jpg'],
mask: {
shape: 'rect',
width: 340,
@@ -229,7 +217,7 @@ var PRODUCTS = [{
price: 75,
leadTime: '7-10个工作日',
description: '精选天然楠竹,经多道工序打磨抛光,保留天然竹纹肌理。盒盖采用磁吸开合,内部设有分层隔板。激光微雕在竹面上呈现深浅不一的雕刻效果,融入墨香气质。适合书房案头、书法爱好者的文房伴侣。',
images: ['/img/penbox/The1.png', '/img/penbox/The2.png', '/img/penbox/The3.jpg'],
images: ['/img/penbox/The1.jpg', '/img/penbox/The2.jpg', '/img/penbox/The3.jpg'],
mask: {
shape: 'rect',
width: 320,
@@ -277,20 +265,25 @@ var getProductById = function getProductById(id) {
/* harmony export */ addAddress: function() { return /* binding */ addAddress; },
/* harmony export */ addDesign: function() { return /* binding */ addDesign; },
/* harmony export */ clearUserInfo: function() { return /* binding */ clearUserInfo; },
/* harmony export */ createUser: function() { return /* binding */ createUser; },
/* harmony export */ deleteAddress: function() { return /* binding */ deleteAddress; },
/* harmony export */ deleteUser: function() { return /* binding */ deleteUser; },
/* harmony export */ designToOrder: function() { return /* binding */ designToOrder; },
/* harmony export */ getAddressList: function() { return /* binding */ getAddressList; },
/* harmony export */ getDesignList: function() { return /* binding */ getDesignList; },
/* harmony export */ getOrderList: function() { return /* binding */ getOrderList; },
/* harmony export */ getTheme: function() { return /* binding */ getTheme; },
/* harmony export */ getUserInfo: function() { return /* binding */ getUserInfo; },
/* harmony export */ listAllUsers: function() { return /* binding */ listAllUsers; },
/* harmony export */ setDesignList: function() { return /* binding */ setDesignList; },
/* harmony export */ setTheme: function() { return /* binding */ setTheme; },
/* harmony export */ setUserInfo: function() { return /* binding */ setUserInfo; },
/* harmony export */ switchUser: function() { return /* binding */ switchUser; },
/* harmony export */ updateAddress: function() { return /* binding */ updateAddress; },
/* harmony export */ updateDesign: function() { return /* binding */ updateDesign; }
/* harmony export */ updateDesign: function() { return /* binding */ updateDesign; },
/* harmony export */ verifyAdminPassword: function() { return /* binding */ verifyAdminPassword; }
/* harmony export */ });
/* unused harmony exports getUserInfoRaw, setUserInfoRaw, setOrderList, setAddressList, getDefaultAddress */
/* unused harmony exports getUserInfoRaw, setUserInfoRaw, getUserInfoByOpenid, setOrderList, setAddressList, getDefaultAddress */
/* harmony import */ var F_weixin_wordc_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
/* harmony import */ var F_weixin_wordc_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "./node_modules/@tarojs/taro/index.js");
@@ -317,10 +310,38 @@ function key(scope) {
// ---------- 用户数据 ----------
var USER_REGISTRY_KEY = 'smart_user_registry';
var ADMIN_PASSWORD = 'zhihui2024';
// ---------- 用户注册表 ----------
function getUserRegistry() {
try {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync(USER_REGISTRY_KEY) || [];
} catch (_unused) {
return [];
}
}
function saveToRegistry(openid) {
var list = getUserRegistry();
if (!list.includes(openid)) {
list.push(openid);
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().setStorageSync(USER_REGISTRY_KEY, list);
}
}
function removeFromRegistry(openid) {
var list = getUserRegistry().filter(function (id) {
return id !== openid;
});
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().setStorageSync(USER_REGISTRY_KEY, list);
}
// ---------- 用户数据 ----------
function getUserInfoRaw() {
try {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync(USER_KEY);
} catch (_unused) {
} catch (_unused2) {
return null;
}
}
@@ -328,9 +349,22 @@ function setUserInfoRaw(info) {
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().setStorageSync(USER_KEY, info);
if (info !== null && info !== void 0 && info.openid) {
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().setStorageSync(ACTIVE_USER_KEY, info.openid);
// 为每个用户备份独立副本,方便切换账号时读取
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().setStorageSync("user_info_".concat(info.openid), info);
saveToRegistry(info.openid);
}
}
function getUserInfoByOpenid(openid) {
try {
var backup = _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync("user_info_".concat(openid));
if (backup) return backup;
} catch (_unused3) {}
var current = getUserInfoRaw();
if ((current === null || current === void 0 ? void 0 : current.openid) === openid) return current;
return null;
}
function clearUserInfo() {
// 仅退出登录,不删除用户数据
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().removeStorageSync(USER_KEY);
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().removeStorageSync(ACTIVE_USER_KEY);
}
@@ -341,12 +375,85 @@ function getUserInfo() {
return getUserInfoRaw();
}
// ---------- 用户数据库管理 ----------
function listAllUsers() {
var registry = getUserRegistry();
return registry.map(function (openid) {
var info = getUserInfoByOpenid(openid);
var dList = getDesignListFor(openid);
var oList = getOrderListFor(openid);
return {
openid: openid,
nickName: (info === null || info === void 0 ? void 0 : info.nickName) || '未知用户',
avatarUrl: (info === null || info === void 0 ? void 0 : info.avatarUrl) || '',
loginAt: (info === null || info === void 0 ? void 0 : info.loginAt) || 0,
designCount: dList.length,
orderCount: oList.length
};
});
}
function createUser(nickName, avatarUrl) {
var openid = 'mock_' + Date.now().toString(36) + '_' + Math.random().toString(36).slice(2, 6);
var info = {
openid: openid,
nickName: nickName || '微信用户',
avatarUrl: avatarUrl || '',
loginAt: Date.now()
};
setUserInfoRaw(info);
return info;
}
function switchUser(openid) {
var info = getUserInfoByOpenid(openid);
if (!info) return false;
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().setStorageSync(USER_KEY, info);
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().setStorageSync(ACTIVE_USER_KEY, openid);
return true;
}
function deleteUser(openid) {
// 删除该用户的所有数据
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().removeStorageSync("user_info_".concat(openid));
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().removeStorageSync("design_list_".concat(openid));
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().removeStorageSync("order_list_".concat(openid));
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().removeStorageSync("address_list_".concat(openid));
removeFromRegistry(openid);
// 如果删的是当前登录用户,清掉登录态
var current = getUserInfoRaw();
if ((current === null || current === void 0 ? void 0 : current.openid) === openid) {
clearUserInfo();
}
}
function verifyAdminPassword(password) {
return password === ADMIN_PASSWORD;
}
// ---------- 跨用户读取辅助函数 ----------
function keyFor(scope, openid) {
return "".concat(scope, "_").concat(openid);
}
function getDesignListFor(openid) {
try {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync(keyFor('design_list', openid)) || [];
} catch (_unused4) {
return [];
}
}
function getOrderListFor(openid) {
try {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync(keyFor('order_list', openid)) || [];
} catch (_unused5) {
return [];
}
}
// ---------- 设计清单 ----------
function getDesignList() {
try {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync(key('design_list')) || [];
} catch (_unused2) {
} catch (_unused6) {
return [];
}
}
@@ -383,7 +490,7 @@ function updateDesign(id, patch) {
function getOrderList() {
try {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync(key('order_list')) || [];
} catch (_unused3) {
} catch (_unused7) {
return [];
}
}
@@ -429,7 +536,7 @@ function designToOrder(designId) {
function getTheme() {
try {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync(THEME_KEY) || 'light';
} catch (_unused4) {
} catch (_unused8) {
return 'light';
}
}
@@ -442,7 +549,7 @@ function setTheme(theme) {
function getAddressList() {
try {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getStorageSync(key('address_list')) || [];
} catch (_unused5) {
} catch (_unused9) {
return [];
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 38 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 61 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 MiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 45 KiB

+16 -2
View File
@@ -222,11 +222,25 @@ function ProfilePage() {
return;
}
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().switchTab({
url: path
url: path,
fail: function fail(err) {
console.error('switchTab fail', err);
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
title: '跳转失败',
icon: 'none'
});
}
});
} else {
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
url: path
url: path,
fail: function fail(err) {
console.error('navigateTo fail', err);
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
title: '跳转失败',
icon: 'none'
});
}
});
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+8
View File
@@ -93,6 +93,14 @@ function SettingsPage() {
action: function action() {
return setShowEdit(true);
}
}, {
label: '账号管理',
icon: '🆔',
action: function action() {
return _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
url: '/pages/userDatabase/index'
});
}
}, {
label: '定制协议',
icon: '📋',
+1 -1
View File
File diff suppressed because one or more lines are too long
+317
View File
@@ -0,0 +1,317 @@
"use strict";
(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/userDatabase/index"],{
/***/ "./node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/userDatabase/index!./src/pages/userDatabase/index.tsx":
/*!******************************************************************************************************************************!*\
!*** ./node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/userDatabase/index!./src/pages/userDatabase/index.tsx ***!
\******************************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ UserDatabasePage; }
/* harmony export */ });
/* harmony import */ var F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_7__ = __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__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/cjs/react.production.min.js");
/* harmony import */ var _utils_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/store */ "./src/utils/store.ts");
/* harmony import */ var _components_ThemeToggle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/ThemeToggle */ "./src/components/ThemeToggle/index.tsx");
/* harmony import */ var _context_ThemeContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../context/ThemeContext */ "./src/context/ThemeContext.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/cjs/react-jsx-runtime.production.min.js");
function UserDatabasePage() {
var _getUserInfo;
var _useThemeContext = (0,_context_ThemeContext__WEBPACK_IMPORTED_MODULE_4__.useThemeContext)(),
theme = _useThemeContext.theme;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
_useState2 = (0,F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_useState, 2),
isUnlocked = _useState2[0],
setIsUnlocked = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
_useState4 = (0,F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_useState3, 2),
password = _useState4[0],
setPassword = _useState4[1];
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
_useState6 = (0,F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_useState5, 2),
pwdError = _useState6[0],
setPwdError = _useState6[1];
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]),
_useState8 = (0,F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_useState7, 2),
users = _useState8[0],
setUsers = _useState8[1];
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
_useState0 = (0,F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_useState9, 2),
showAdd = _useState0[0],
setShowAdd = _useState0[1];
var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
_useState10 = (0,F_weixin_wordc_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_useState1, 2),
newNick = _useState10[0],
setNewNick = _useState10[1];
var refresh = function refresh() {
return setUsers((0,_utils_store__WEBPACK_IMPORTED_MODULE_2__.listAllUsers)());
};
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
refresh();
}, []);
var handleUnlock = function handleUnlock() {
if ((0,_utils_store__WEBPACK_IMPORTED_MODULE_2__.verifyAdminPassword)(password)) {
setIsUnlocked(true);
setPwdError(false);
refresh();
} else {
setPwdError(true);
}
};
var handleSwitch = function handleSwitch(openid) {
if ((0,_utils_store__WEBPACK_IMPORTED_MODULE_2__.switchUser)(openid)) {
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
title: '切换成功',
icon: 'success'
});
refresh();
} else {
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
title: '切换失败',
icon: 'none'
});
}
};
var handleDelete = function handleDelete(openid) {
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showModal({
title: '确认删除',
content: '删除后将清空该用户所有数据,无法恢复',
confirmColor: '#e64340',
success: function success(res) {
if (res.confirm) {
(0,_utils_store__WEBPACK_IMPORTED_MODULE_2__.deleteUser)(openid);
refresh();
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
title: '已删除',
icon: 'success'
});
}
}
});
};
var handleCreate = function handleCreate() {
if (!newNick.trim()) {
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
title: '请输入昵称',
icon: 'none'
});
return;
}
(0,_utils_store__WEBPACK_IMPORTED_MODULE_2__.createUser)(newNick.trim());
setShowAdd(false);
setNewNick('');
refresh();
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
title: '创建成功',
icon: 'success'
});
};
var activeOpenid = ((_getUserInfo = (0,_utils_store__WEBPACK_IMPORTED_MODULE_2__.getUserInfo)()) === null || _getUserInfo === void 0 ? void 0 : _getUserInfo.openid) || '';
if (!isUnlocked) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "theme-".concat(theme),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-page",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_ThemeToggle__WEBPACK_IMPORTED_MODULE_3__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-lock-card dashed-card mt-20",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "star-badge"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-lock-icon",
children: "\uD83D\uDD10"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-lock-title",
children: "\u7BA1\u7406\u5458\u9A8C\u8BC1"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-lock-desc",
children: "\u8BF7\u8F93\u5165\u5BC6\u7801\u4EE5\u8BBF\u95EE\u7528\u6237\u6570\u636E\u5E93"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Input, {
className: "udb-password-input",
type: "text",
password: true,
placeholder: "\u8F93\u5165\u5BC6\u7801",
value: password,
onInput: function onInput(e) {
return setPassword(e.detail.value);
}
}), pwdError && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-error",
children: "\u5BC6\u7801\u9519\u8BEF\uFF0C\u8BF7\u91CD\u8BD5"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "btn-gradient udb-btn",
onClick: handleUnlock,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
children: "\u8FDB\u5165\u6570\u636E\u5E93"
})
})]
})]
})
});
}
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "theme-".concat(theme),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-page",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_ThemeToggle__WEBPACK_IMPORTED_MODULE_3__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "page-header dashed-card mt-20",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "star-badge"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "page-title",
children: "\u672C\u5730\u7528\u6237\u6570\u636E\u5E93"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-toolbar",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "btn-gradient udb-add-btn",
onClick: function onClick() {
return setShowAdd(true);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
children: "+ \u65B0\u5EFA\u8D26\u53F7"
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-table",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-row udb-header",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-col col-nick",
children: "\u6635\u79F0"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-col col-id",
children: "ID"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-col col-stats",
children: "\u8BBE\u8BA1/\u8BA2\u5355"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-col col-action",
children: "\u64CD\u4F5C"
})]
}), users.map(function (u) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-row ".concat(u.openid === activeOpenid ? 'active' : ''),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-col col-nick",
children: u.nickName
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-col col-id",
children: u.openid
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-col col-stats",
children: [u.designCount, " / ", u.orderCount]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-col col-action",
children: [u.openid !== activeOpenid && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-link",
onClick: function onClick() {
return handleSwitch(u.openid);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
children: "\u5207\u6362"
})
}), u.openid === activeOpenid && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-current",
children: "\u5F53\u524D"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-link udb-danger",
onClick: function onClick() {
return handleDelete(u.openid);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
children: "\u5220\u9664"
})
})]
})]
}, u.openid);
}), users.length === 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-empty",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
children: "\u6682\u65E0\u7528\u6237\u6570\u636E"
})
})]
}), showAdd && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "modal-overlay",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-add-card dashed-card",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "star-badge"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
className: "udb-add-title",
children: "\u65B0\u5EFA\u672C\u5730\u8D26\u53F7"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Input, {
className: "udb-add-input",
type: "text",
placeholder: "\u8BF7\u8F93\u5165\u6635\u79F0",
value: newNick,
onInput: function onInput(e) {
return setNewNick(e.detail.value);
}
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "udb-add-actions",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "btn-outline",
onClick: function onClick() {
return setShowAdd(false);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
children: "\u53D6\u6D88"
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
className: "btn-gradient",
onClick: handleCreate,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
children: "\u521B\u5EFA"
})
})]
})]
})
})]
})
});
}
/***/ }),
/***/ "./src/pages/userDatabase/index.tsx":
/*!******************************************!*\
!*** ./src/pages/userDatabase/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_pages_userDatabase_index_index_tsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !!../../../node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/userDatabase/index!./index.tsx */ "./node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/userDatabase/index!./src/pages/userDatabase/index.tsx");
var config = {"navigationBarTitleText":"用户数据库","backgroundColor":"#ffffff"};
var inst = Page((0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__.createPageConfig)(_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_pages_userDatabase_index_index_tsx__WEBPACK_IMPORTED_MODULE_0__["default"], 'pages/userDatabase/index', {root:{cn:[]}}, config || {}))
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_pages_userDatabase_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","common"], function() { return __webpack_exec__("./src/pages/userDatabase/index.tsx"); });
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
{"navigationBarTitleText":"用户数据库","backgroundColor":"#ffffff","usingComponents":{"comp":"../../comp"}}
+2
View File
@@ -0,0 +1,2 @@
<import src="../../base.wxml"/>
<template is="taro_tmpl" data="{{root:root}}" />
+246
View File
@@ -0,0 +1,246 @@
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** 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/pages/userDatabase/index.scss ***!
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
@charset "UTF-8";
.udb-page {
padding: 0 24rpx 40rpx;
min-height: 100vh;
}
/* 锁屏验证 */
.udb-lock-card {
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;
padding: 60rpx 40rpx;
text-align: center;
}
.udb-lock-icon {
font-size: 80rpx;
margin-bottom: 24rpx;
}
.udb-lock-title {
font-size: 36rpx;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 12rpx;
display: block;
}
.udb-lock-desc {
font-size: 26rpx;
color: var(--text-secondary);
margin-bottom: 32rpx;
display: block;
}
.udb-password-input {
width: 100%;
height: 80rpx;
background: var(--bg-input);
border: 2rpx solid var(--line-star);
border-radius: 16rpx;
padding: 0 24rpx;
font-size: 30rpx;
color: var(--text-primary);
text-align: center;
margin-bottom: 24rpx;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.udb-error {
font-size: 24rpx;
color: #e64340;
margin-bottom: 20rpx;
display: block;
}
.udb-btn {
width: 100%;
padding: 20rpx 0;
font-size: 30rpx;
}
/* 工具栏 */
.udb-toolbar {
margin: 20rpx 0;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.udb-add-btn {
padding: 14rpx 28rpx;
font-size: 26rpx;
}
/* 数据表格 */
.udb-table {
background: var(--bg-card);
border: var(--line-card);
border-radius: 24rpx;
overflow: hidden;
}
.udb-row {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
padding: 20rpx 16rpx;
border-bottom: 1rpx solid rgba(0, 0, 0, 0.04);
}
.udb-row:last-child {
border-bottom: none;
}
.udb-header {
background: var(--bg-input);
padding: 16rpx;
}
.udb-header .udb-col {
font-weight: 700;
font-size: 24rpx;
color: var(--text-primary);
}
.udb-col {
font-size: 24rpx;
color: var(--text-secondary);
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 6rpx;
}
.col-nick {
-webkit-flex: 0 0 22%;
-ms-flex: 0 0 22%;
flex: 0 0 22%;
}
.col-id {
-webkit-flex: 0 0 36%;
-ms-flex: 0 0 36%;
flex: 0 0 36%;
}
.col-stats {
-webkit-flex: 0 0 18%;
-ms-flex: 0 0 18%;
flex: 0 0 18%;
text-align: center;
}
.col-action {
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
gap: 12rpx;
}
.udb-row.active {
background: rgba(91, 140, 255, 0.06);
}
.udb-link {
padding: 6rpx 14rpx;
border-radius: 8rpx;
font-size: 22rpx;
color: var(--accent-blue);
background: rgba(91, 140, 255, 0.08);
}
.udb-danger {
color: #e64340;
background: rgba(230, 67, 64, 0.08);
}
.udb-current {
font-size: 22rpx;
color: var(--accent-blue);
font-weight: 600;
}
.udb-empty {
padding: 40rpx;
text-align: center;
color: var(--text-secondary);
font-size: 28rpx;
}
/* 弹窗 */
.udb-add-card {
padding: 48rpx 36rpx;
width: 80%;
}
.udb-add-title {
font-size: 32rpx;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 24rpx;
display: block;
text-align: center;
}
.udb-add-input {
width: 100%;
height: 80rpx;
background: var(--bg-input);
border: 2rpx solid var(--line-star);
border-radius: 16rpx;
padding: 0 24rpx;
font-size: 28rpx;
color: var(--text-primary);
margin-bottom: 32rpx;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.udb-add-actions {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
gap: 20rpx;
}
.udb-add-actions .btn-outline,
.udb-add-actions .btn-gradient {
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
padding: 18rpx 0;
text-align: center;
}
+2 -2
View File
@@ -7,9 +7,9 @@
"urlCheck": true,
"es6": false,
"enhance": true,
"postcss": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": false,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": false,