本书共8章,第1章讲解微信小程序的入门知识,介绍微信小程序的特点和发展前景;第2章和第3章分别讲解微信小程序的页面制作和页面交互;第4章和第5章讲解微信小程序的常用API;第6章讲解综合项目"点餐"微信小程序;第7章讲解微信小程序开发进阶;第8章讲解基于uni-app开发的"短视频"微信小程序.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
# 微信小程序开发实战 第2版 — Reading Guide
## 【One-Line Pitch】
A hands-on, project-driven textbook that takes you from zero to building complete WeChat Mini Programs, covering page design, interaction logic, core APIs, and two full real-world projects. Ideal for beginners with basic web (HTML/CSS/JS) knowledge who want to learn by building rather than just reading.
## 【Book Arc】
- **Opening (~0%–10%)**: Introduces what WeChat Mini Programs are, their market position and growth stats, then walks through setting up the WeChat Developer Tool, project configuration, shortcuts, and managing team members — the essential groundwork before writing any code.
- **Early (~10%–25%)**: Dives into page construction with core components — `view`, `image`, `swiper`, `checkbox`, `radio`, and tabBar configuration — using small demos and a wedding invitation case to practice layout and styling with WXSS.
- **Early–Middle (~25%–42%)**: Moves into page interaction: event binding (`bind` vs `catch`, bubbling), handling user input, building a calculator app, fetching data with `wx.request`, and rendering lists with `wx:for` — the bridge between static pages and dynamic apps.
- **Middle (~42%–55%)**: Covers the first batch of common APIs: `wx.showLoading`/`wx.showToast` for feedback, WXS for data filtering, and a music player case demonstrating audio playback controls, progress tracking, and playlist management.
- **Late (~55%–75%)**: Continues with more APIs — user login flows, data caching, Tencent Map SDK integration, WebSocket for real-time chat — then ties everything together in a full "点餐" (food ordering) mini program with modules for merchant pages, menus, cart, and order management.
- **Ending (~75%–100%)**: Advanced topics: custom components, custom tabBar, Vant Weapp and WeUI component libraries, plus a uni-app based "短视频" (short video) project showing cross-platform development.
## 【Key Takeaways】
- **Mini Programs are lightweight, install-free apps inside WeChat** (Early): Users access them via search, QR code, or sharing — no download or uninstall needed. This distribution model is why they've grown to 450M+ daily active users across industries like education, media, and e-commerce.
- **The Developer Tool is your command center** (Early): Master project configuration, code compression options, domain validation settings, and keyboard shortcuts. The "不校验合法域名" checkbox is especially important during development to test APIs without HTTPS certificate hassles.
- **Components are the building blocks of pages** (Early): `view`, `image`, `swiper`, `checkbox`, `radio` each have specific attributes — e.g., `image` supports 5 scaling modes (`aspectFit`, `aspectFill`, `widthFix` etc.), and `swiper` enables auto-playing carousels with configurable intervals and indicators.
- **Events drive interactivity, and bubbling matters** (Early–Middle): Use `bind` for events that should propagate to parent components and `catch` to stop propagation. The `event.detail.value` pattern is the standard way to capture user input from form components.
- **`wx.request` + `wx:for` is the core data-display pattern** (Middle): Fetch data in `onLoad`, store it in page data, then loop-render with `wx:for` and `wx:key`. Always handle HTTP status codes and show loading/error feedback via `wx.showLoading` and `wx.showModal`.
- **WXS is a mini-program-specific scripting language** (Middle): It borrows JavaScript syntax but is distinct — primarily used as a "filter" to preprocess data before rendering in WXML, keeping presentation logic clean.
- **Real projects cement the fundamentals** (Late): The "点餐" case study walks through a complete flow — network request encapsulation, login, merchant pages, menu lists, shopping cart, and order confirmation — showing how individual APIs combine into a production-like app.
- **Component libraries accelerate development** (Ending): Vant Weapp and WeUI provide ready-made UI components, while custom components and custom tabBars give you control beyond the defaults. uni-app extends your skills to multi-platform development.
## 【Reading Tips】
- **Skim Chapter 1** if you're already familiar with web development — the key items are the Developer Tool settings (especially domain validation) and project structure. The market statistics and member management details are nice context but not critical.
- **Deep-read Chapters 2–3**: These are the foundation. Build the wedding invitation and calculator examples yourself — don't just read the code. Pay special attention to the `bind` vs `catch` distinction and the `wx:for` rendering pattern, as they appear in every subsequent chapter.
- **Treat Chapters 4–5 as a reference**: The API cases (music player, login, maps, chat) are best studied when you need that specific capability. The login flow and data caching sections are worth extra attention since they're needed in most real apps.
- **Chapter 6 is the payoff**: The "点餐" project ties everything together. If you're short on time, build this one fully — it covers request encapsulation, login, list rendering, cart logic, and order flows, which are the core skills for any mini program.
- **Watch for version notes**: The book references specific base library versions (e.g., 2.25.2) and tool settings that may have changed. If something doesn't work, check the current WeChat documentation rather than assuming the book is wrong.
## 【Coverage Limits】
This guide covers the book's first six chapters in detail (foundations through the "点餐" project). The advanced topics in Chapters 7–8 (custom components, Vant Weapp, uni-app, short video project) are summarized at a high level only, as the excerpts provide limited detail on those sections.
##
Excerpt 1
能力 配套丰富的教学资源,包括教学 PPT、教学大纲、源代码、教学设计等 教材服务热线:010-81055256 扫此二维码下载 反馈/投稿/推荐信箱:315@ptpress.com.cn 本书配套资源 人邮教育服务与资源下载社区:www.ryjiaoyu.com FM60602微信小程序开发实战(第2版).in...
View in text
Excerpt 2
在表 2-6中,color 类型表示颜色类型,可以设为十六进制颜色值、颜色名称、rgb( )、rgba( )等。面板指 示点为轮播图下方的小圆点,可以显示当前轮播图有几张图片。衔接滑动的作用是当轮播图滑动到最后一张 时,继续滑动可以返回第一张轮播图。 了解了swiper 组件的常用属性后,下面演示这些属性的使用。...
View in text
Excerpt 3
t: function (e) { 7 this.num2 = Number(e.detail.value) 8 }, 在上述代码中,第 1~2 行代码定义了两个属性 num1 和 num2,用于保存用户输入的第 1 个数字和第 2 个数字;第3~5行代码定义了num1Input( )事件处理函数,用于保存获取到...
View in text
Excerpt 4
区域:显示当前播放的音乐信息,并且提供了 3 个按钮,按钮的功能依次为“切换到播放列 表”“播放/暂停”“下一曲”。 在初始状态下,“音乐播放器”微信小程序默认显示第 1 个标签页,也就是“音乐推荐”标签页。通过 点击标签栏区域中的标签或者左右滑动内容区域可以切换标签页。 “播放器”标签页的页面效果如图4-2所示...
View in text
Excerpt 5
PI / 180 在上述代码中,D6、D30和D90表示角度分别为6°、30°和90°,但它们的值已经换算为弧度。 ③ 编写代码,绘制大刻度盘和小刻度盘,具体代码如下。 1 function drawDial(ctx, radius) { 2 原有代码…… 3 // 绘制大刻度盘 4 ctx.lineWidth...
View in text
Excerpt 6
ton> 在app.json文件中创建pages/list/list 页面,然后在pages/index/index.js 文件中编写navigateTo( )函数,实现 跳转到pages/list/list 页面,具体代码如下。 1 Page({ 2 navigateTo: function () { 3 wx...
View in text
Excerpt 7
query = wx.createSelectorQuery() 2 query.select('.food').boundingClientRect(rect => { 212 微信小程序开发实战(第 2 版) 11 color: #ff9c35; 12 } 在上述代码中,第 1~6 行代码设置了购物车图标的大...
View in text
Excerpt 8
24 }, () => { 25 wx.hideNavigationBarLoading() 26 options.fail() 27 }) 28 }, 29 }) 在上述代码中,第5行代码定义了 is_last 属性,表示是否到达底部,如果服务器返回的条数小于请求的 条数,说明已经到达底部;第 6 行代码定义了...
View in text
Tags
AI categories
ProgrammingWeb TechnologyMobile
Text Preview (First 20 pages)
Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
Generating text preview…
Loading comments...
Reply to Comment
Edit Comment