Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A hands-on, project-driven guide to building WeChat Mini Programs from scratch—covering account setup, UI design, front-end components, and a Java/Spring backend—ideal for developers with some programming background who want to ship a complete mini program with real server integration.
【Book Arc】
- **Opening (~0%–3%)**: Registration and admin console basics—how to create a Mini Program account, configure server domains, and understand the four communication modes (HTTPS, WebSocket, upload, download). Sets up the operational foundation.
- **Early (~3%–13%)**: Development and debugging modes—local debugging, cloud server setup, and port mapping via tools like nat123, plus SSL configuration. Solves the "how do I test my backend locally" problem.
- **Early (~13%–23%)**: Project structure and UI design—the mandatory directory layout, page logic files, navigation bar rules, and WeChat's official design guidelines (touch targets, input optimization, loading feedback). Establishes the front-end architecture and UX standards.
- **Middle (~23%–32%)**: Core components and logic layer—deep dives into swiper, picker, canvas, map, and form components, plus the app/page lifecycle, data binding with `setData`, and conditional rendering with `wx:if`. This is the heart of front-end development.
- **Middle (~39%–48%)**: Backend setup and networking—building a Maven + Spring + SpringMVC + MyBatis environment, connecting to MySQL, and implementing request/upload/download APIs. Bridges the gap between mini program and server.
- **Late (~48%–end)**: Advanced features and full projects—WebSocket chat, template messages, customer service, sharing, and two complete case studies ("I Love Watching Movies" and "Daily Assistant") that walk through requirements, database design, and coding end-to-end.
【Key Takeaways】
- **Domain configuration is the first hurdle** (Opening): All server URLs must be ICP-filed for at least 24 hours, use port 80, and cannot be IP addresses—plan your hosting early to avoid blocking development.
- **Local debugging has limits** (Early): Without a real AppID, APIs like `wx.login` return mock data with identical formats but fake values; use port mapping (e.g., nat123) to test real ecosystem interactions.
- **Follow WeChat's UI conventions** (Early): Navigation bar colors, touch target sizes (7–9mm physical), and loading feedback patterns are specified—deviating from them hurts usability and may fail review.
- **Master the component library** (Early): Swiper for carousels, picker/picker-view for selectors, and canvas for drawing cover most common UI needs; picker-view offers full customization of columns and values.
- **Lifecycle and data flow are the backbone** (Early): `onLaunch`/`onShow`/`onHide` at the app level, `onLoad`/`onReady` at the page level, and `setData` for updates—global data lives in `app.globalData`, page data is isolated.
- **Backend is Java-centric** (Middle): The book uses Maven + Spring + SpringMVC + MyBatis with MySQL; you'll configure dependencies, deploy to Tomcat, and expose REST endpoints with `@ResponseBody` for JSON.
- **Watch the `this` context in callbacks** (Middle): Inside `wx.downloadFile` or similar APIs, `this` no longer refers to the page object—use `that = this` or arrow functions to call `setData` correctly.
- **WebSocket enables real-time features** (Late): Adding Spring WebSocket dependencies and handler classes on the server, paired with `wx.connectSocket` on the client, powers chat and live updates.
【Reading Tips】
- **Skim the first two chapters** if you're already familiar with WeChat's admin console; the debugging modes (local, cloud, port mapping) are worth a quick read but not deep study.
- **Deep-read Chapters 3–7** (structure, layout, components, logic layer): These are the fundamentals you'll use in every page you build. Pay special attention to `setData` and lifecycle functions.
- **Treat Chapter 8 (backend setup) as reference**: The Maven/Spring configuration is boilerplate—copy it when needed, but don't memorize. Focus on the request/upload/download patterns in Chapter 9.
- **Skip ahead to the two projects** (Chapters 13–14) if you learn by doing: They show how to combine front-end components, backend APIs, and database design into a working app.
- **Watch for the `this` pitfall** in all network callbacks—it's a common source of bugs; the book's `that = this` pattern is a practical fix worth adopting.
【Coverage Limits】
Excerpts do not cover payment integration, Bluetooth, or hardware APIs in detail, though the table of contents lists them. The guide focuses on the core development flow: setup, UI, components, backend, and networking.
{ if (!msg) return; if (getApp().settings['debug']) console.log(msg); let logs = wx.getStorageSync('logs') || []; logs.unshift(msg) wx.setStorageSync('logs',...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
微信小程序开发实战 (陈伟)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
微信小程序开发实战 (陈伟)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
微信小程序开发实战 (陈伟)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment