Share E-Book
Scan to open this page

Scan with your phone to open this page

Author王延平

No description

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# 21天精通微信小程序开发 — Reading Guide ## 【One-Line Pitch】 A structured 21-day, day-by-day tutorial for absolute beginners to learn WeChat Mini Program development from scratch — covering the framework architecture, WXML/WXSS styling, JavaScript fundamentals, and hands-on tooling — ideal for front-end developers and programming newcomers who want to enter the WeChat ecosystem. ## 【Book Arc】 - **Opening (~0%–10%)**: Introduces the philosophy and business context of WeChat Mini Programs — Zhang Xiaolong's "use-and-go" (用完即走) design values, the product's launch history, and why Mini Programs are neither pure H5 nor native apps. Sets expectations for what Mini Programs can and cannot do. - **Early (~10%–32%)**: Covers the technical architecture — the view layer vs. logic layer split, the four-file page structure (js/json/wxml/wxss), and why Mini Programs are not standard H5 (no DOM, no W3C compliance). Also walks through registration, WeChat certification, and the official developer tool's editing and debugging modes. - **Middle (~32%–48%)**: Dives into the framework itself — the app-level files (app.js, app.json, app.wxss), global configuration options like tabBar and networkTimeout, and the data-binding system that keeps the view and logic layers synchronized. - **Late (~48%–75%)**: Moves into the three core languages: WXML syntax and visual components, WXSS styling (box model, positioning, Flexbox), and JavaScript fundamentals (variables, data types, arrays, flow control) — all taught with Mini Program-specific examples. - **Ending (~75%–100%)**: Covers JavaScript advanced topics (OOP, functions, JSON, ES6 syntax), plus third-party visual development tools (Coolsite360, 即速应用) and community resources. Appendices serve as a reference for all components and APIs. ## 【Key Takeaways】 - **Mini Programs are not H5** (Early): They use a proprietary framework with no DOM, no Window/Document objects, and no support for jQuery or other web libraries — but they do reuse JavaScript, XML-like WXML, and CSS-like WXSS syntax, so front-end developers can ramp up quickly. - **The four-file page structure is mandatory** (Middle): Every page requires same-named .js, .json, .wxml, and .wxss files; the app root requires app.js, app.json, and app.wxss. This enforced separation of logic, config, structure, and style is the backbone of Mini Program development. - **Data binding keeps view and logic in sync** (Middle): The framework's core is a data-binding system — when you modify data in the logic layer, the bound view updates automatically. Understanding this model is essential before writing any real code. - **Configuration is done via JSON, not code** (Middle): app.json controls global settings like tabBar (2–5 tabs only), network timeouts, and window appearance; page-level .json files override global settings for individual pages. - **WXML and WXSS are simplified but powerful** (Late): WXML provides a custom tag library (view, scroll-view, swiper, form components, etc.), while WXSS inherits standard CSS with support for box model, positioning, float, and Flexbox — the layout skills transfer directly from web development. - **JavaScript is taught from the ground up** (Late): The book assumes no prior programming experience, covering variables, operators, data types, arrays, conditionals, and loops before moving to OOP, functions, JSON manipulation, and ES6 features like let/const and arrow functions. - **The official developer tool is your primary workspace** (Early): It offers edit and debug modes with a simulator, console, WXML inspector, AppData viewer, and Storage panel — plus keyboard shortcuts for efficient coding. Always verify on a real device, as the simulator may differ. - **Registration has real constraints** (Early): Mini Programs require an enterprise/government/organization account (no personal registration), and WeChat certification (300 RMB) is needed for advanced features like payment. Names and service categories are hard to change after approval. ## 【Reading Tips】 - **Skim the first two days** (~0%–10%) if you're already familiar with WeChat's ecosystem — the philosophy and history are interesting but not code-critical. Focus instead on the architecture explanation in Day 2. - **Deep-read Days 5–6** (framework and configuration) — this is where the mental model of Mini Programs clicks. Make sure you understand the four-file structure and data binding before moving on. - **Treat Days 12–13 (WXSS and Flexbox) as high-priority** — layout is where most beginners struggle. Practice the box model and Flex properties in the simulator until they feel natural. - **The JavaScript sections (Days 14–20) can be skimmed if you already know JS** — but pay attention to Mini Program-specific details like the wx object, Page() and App() functions, and how JSON is used for configuration. - **Use the appendices as a reference, not reading material** — they list all components and APIs (network, media, location, device, UI, open interfaces) and are best consulted when you need a specific feature. ## 【Coverage Limits】 The excerpts cover the book's structure, philosophy, architecture, tooling, and configuration in detail, but do not include full code examples for WXML components, WXSS styling, or JavaScript exercises — those sections are summarized from the table of contents and framework descriptions. ##
Excerpt 1
它又是完全融合了前面所述“道”层面的术。而这正是其最高妙之处,展示了张小龙及团队对商业、用户,以及产品深邃而精准的理解。 “好的产品应该是用完即走的”,“让商业化存在于无形之中”,这两点表面上看似乎有悖于常道,但却暗合了道家“无为而治”思想的最高境界。老子《道德经》曾说“无为而无不为”,“无为”并不是说不作为,而...
View in text
Excerpt 2
的榜单、搜索及社交产品与广告平台等方式被用户发现、下载、安装。而H5产品主要靠手机网站和社交平台的分享被用户发现和使用。 目前App获取用户的门槛很高,高门槛带来的好处是,用户的二次消费门槛变低了。H5在分发上的优点是用户发现和安装使用的门槛低,然而后续消费门槛却非常高。而这方面正好是App的优势。 事实上到目前...
View in text
Excerpt 3
更加容易,也能让营销成本变得更低。 (2)对用户来说,小程序因为它的即开即用特性,将会减轻手机的应用压力,避免资源浪费。微信小程序的审核机制会比App更为严格,应用程序将很难获取到用户的敏感权限,这将使用户使用手机更为安全,小程序的获取渠道将更多地集中在微信上,降低了用户获取应用的时间成本。 基于此,我们可以设想...
View in text
Excerpt 4
[pageName].json是页面的配置文件,用来设置页面的窗口内容,遵守JSON语法规范。 [pageName].wxml是页面的结构文件,用于页面可视化组件的组织和描述,语法结构类似于xml,与html格式有比较大的差别。 [pageName].wxss是页面的样式表文件,兼容CSS语法规范。 5.2 JS...
View in text
Excerpt 5
个元素,同时堆栈的大小减一。 小程序框架以堆栈的形式维护页面,遵守后进先出的原则,页面切换时,页面栈会有如表6-3所示。 表6-3 页面切换时页面栈的表现 页面路由方式 页面栈表现 初始化  新页面入栈 打开新页面  新页面入栈 页面重定向  当前页面出栈,新页面入栈 页面返回  页面不断出栈,直到目标返回页,新...
View in text
Excerpt 6
se只能跟在wx:if的后面,表示条件判断的一个分支,如果表达式为真则执行对应的渲染语句,例如: <! --index.wxml--> <view wx: if="{{length>7}}">1</view> <view wx: elif="{{length>4}}">4</view> <view wx: els...
View in text
Excerpt 7
提供了更多选择,而且更为精确、高质量地完成渲染任务。可以这么讲,WXML用于结构化内容,WXSS用于格式化结构化的内容。 WXSS与CSS语法的兼容度很高,所以本章内容学完后,也可以把收获应用于其他前端开发的领域里面去,如H5浏览器页面的开发。 本章要点 ● WXSS(CSS)基本语法 ● 选择器 ● 样式表的使...
View in text
Excerpt 8
iPhone6 Plus 1rpx=0.552px 1px=1.81rpx 小米5 1rpx=0.72px 1px=1.39rpx 根据750rpx的屏幕总宽度定义来看,微信的rpx是参考iPhone6屏幕的物理像素宽度定义的,开发微信小程序时设计师可以用iPhone6作为视觉稿的参考标准,单位换算起来比较简单、...
View in text
Tags
AI categories
ProgrammingMobileWeb Technology
ISBN: B071LDPYDH
Publish Year: 2017
Language: Chinese
File Format: EPUB
File Size: 3.5 MB