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
【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.
Excerpt 1
.4.1 小程序后台连接数据库 .........171 14.3 编码 .....................................................197 13.4.2 首页设计 .................................176 14.3.1 日历 .......
View in text
Excerpt 2
ge"> <!--页头--> <view class="page__hd"></view> <!--主体--> <view class="page__bd"></view> <!--没有页脚--> </view> 最后,在布局元素内部的组件元素使用“weui-”开头后接组件名称作为样式,例如 class= "we...
View in text
Excerpt 3
自定义处理的可能性,例如 要在小程序启动以后读取缓存内容,那么就可以在 onLaunch 函数中写入读取缓存的代码。 除了这些生命周期函数以外,还可以在 app 对象中加入任意自定义函数,这些自定义函数可以 通过 app 对象来调用。 另外一个实用的属性是 globalData,我们可以在 app 的 globa...
View in text
Excerpt 4
onseBody Person HelloWorld(@RequestParam(value="a") String x,@RequestParam(value="x") String b){ Person p=new Person(); p.setName("李雷 "); p.setSex("男"); retu...
View in text
Excerpt 5
说明 参数 说明 result 所扫描的内容 scanType 所扫描的类型 charSet 所扫描的字符集 path 当所扫的码为当前小程序的合法二维码时,会返回此字段,内容为二维码携带的 path 144 完 12.1 交互反馈 ▲图 12.3 属性和显示效果对照关系 12.1.3 操作菜单 通过调用接口 w...
View in text
Excerpt 6
例化 get 方法 HttpGet httpget = new HttpGet(url); //请求结果 CloseableHttpResponse response = null; String content =""; try { //执行 get 方法 response = httpclient.execu...
View in text
Excerpt 7
res){ console.log("请求成功"); fail: function() { // fail complete: function() { // complete } } 13.4.6 详情页后台实现 下面在后台添加一个处理方法来获取电影的详情数据。 首先在后台的 FilmService.java...
View in text
Excerpt 8
{ if (!msg) return; if (getApp().settings['debug']) console.log(msg); let logs = wx.getStorageSync('logs') || []; logs.unshift(msg) wx.setStorageSync('logs',...
View in text
Tags
AI categories
ProgrammingBackendWeb Technology
Publish Year: 2017
Language: Chinese
File Format: PDF
File Size: 5.3 MB
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…