Lonbon Smart Elderly Care Cloud Platform
website·Indexed 32 days ago
https://nbtest.lonbon.com/resource/notesDevelopment documentation and technical notes for the Lonbon smart elderly care ecosystem. Includes guides for the lonbon-map, lonbon-device, and lonbon-common-plus plugins, as well as implementation details for Vue, uni-app, and React integrations, micro-frontend architectures using JD MicroApp, and specialized components for elderly care management platforms.
What's inside Lonbon
- FormAdjust is a component built with sortablejs and jquery. It is designed to provide layout, sorting, and show/hide functionality for existing form elements. To use it, existing business forms must be slightly modified to comply with the component's structure requirements.
AI Operational Guidance System Technical Stack
The AI operational guidance system is built using the following technology stack:
- Language: Node.js, TypeScript
- Backend Framework: NestJS
- Crawler: PuppeteerJS
- AI Frameworks: LangGraphJS, LangChainJS
- Primary Database: PostgreSQL
- Vector Database: PGVector
- LLM: Configurable (defaulting to Tongyi Qianwen)
Implement Lonbon frontend coding standards
General coding rules to ensure maintainability and prevent style pollution. Key constraints include limiting loop nesting and restricting global variable usage.// 1. Style Isolation: Use 'scoped' attribute in Vue components or a unique root class. // 2. Loop Limit: Maximum 2 levels of for-loops; encapsulate deeper logic into methods. // 3. API Calls: Use async/await. A single method must not contain 2 or more API calls. // 4. Data Formatting: Do not format server values directly; assign to a new variable. // Example: item.timeStr = this.$transTime(item.time); // 5. Global State: // - window, localStorage, sessionStorage are FORBIDDEN for custom storage. // - Use window._globalProperties for global variables/methods. // - Use window.accountStorage for synchronous value passing (requires await).Install and set up better-mock for uni-app
To implement mock data in uni-app, use thebetter-mocklibrary. This allows frontend developers to interface with page APIs without waiting for the backend implementation to be completed.npm i better-mockIntegrate NetEase Yunxin for video calling
Integration workflow for NetEase Yunxin:
- Create an application in the console to obtain the
appKey. - Integrate the SDK into the client.
- Integrate the SDK into the server to generate
tokenfor authentication (can passnullduring testing). - Use
token,uid,channelName, andappKeyon the client to join a channel for video calling.
- Create an application in the console to obtain the
Migrate legacy table pages to lb-list-box
When migrating old page code to the
lb-list-boxcomponent, follow these technical requirements to ensure the layout renders correctly:- Input Wrapping: In the
search-fieldslot, wrap each search input/label pair in adivto prevent unexpected line breaks. - Table Height: Set the
heightattribute of theel-tableto100%to allow the component's flex layout to manage the vertical space. - Loading State: Move the
v-loadingdirective from the internal table to a higher-level element or directly onto thelb-list-boxcomponent.
- Input Wrapping: In the
Import Less files using absolute paths in Vue style blocks
When importing Less or other style files using absolute module paths within a<style>block in Vue, you must prefix the path with a tilde (~). This tells the loader to treat the path as a module resolution path rather than a relative file system path.@import '~@cms/components/common/less/flex.less';Fix missing npm command after NVM installation
If
npm -vreturns a 'command not found' error after installing Node.js via NVM (often caused by process locks during installation), you can manually install npm by following these steps:- Download the npm source files for the corresponding Node.js version.
- Extract the files into the NVM installation directory for that specific Node.js version.
- Place the extracted files into the
/node_modules/npm/directory within the Node.js version folder. - Copy the following four files from the npm
binfolder (npm.cmd,npm,npx.cmd, andnpx) directly into the root of the Node.js version folder in NVM.
Load and use the Plugin Center micro-component
ThepluginCentermicro-component provides access to hardware peripherals such as IC card readers, barcode scanners, and ID card readers.const pluginCenter = await loadMicroComponent({ component: 'pluginCenter' });Integrate video calling in WeChat Mini Programs
To implement video calling functionality within a WeChat Mini Program, you must use thelive-playerandlive-pushercomponents. Note that these components require specific category applications (permissions) to be approved by WeChat before they can be used in a production environment.Prevent race conditions in UI using Axios request cancellation
When implementing features like rapid table pagination or remote search inputs, asynchronous requests may resolve out of order (a slower first request finishing after a faster second request), leading to the UI rendering stale data. While debouncing, throttling, or full-screen loading overlays are common solutions, using Axios request cancellation allows for a better user experience by explicitly ending outdated requests. Note that cancelling a request only ends the client-side connection; it does not stop the server from processing the request or reduce server resource consumption.Manage SVN commits and branches for Lonbon
SVN commits must follow a specific format to link requirements and bugs. Development must occur in branches, not directly indev.Commit Formats: - Bug fix: fix:[#ReqID/(Front/Back)] #BugID description - Feature: feature:(Front/Back) #ReqID description - Refactor: refactor:(Front/Back) description Branching Rules: - Personal branches: /branches/own[Initials][Code] - Privatization branches: /tags/pvt_[ProjectInitials] - /dev: Used only for merging and packaging for tests.