# 本節知識點
- 1,反饋與建議的開發
- 2,頁面跳轉并攜帶參數的學習
- 3,文章詳情的開發
- 4,三方類庫的使用
# 課后作業
- 1,讀完botton相關的官方文檔
- 2,跟著老師獲取到用戶信息
- 3,實現首頁列表到詳情頁的跳轉
# 課程中用到的網址
- 1,botton組件官方文檔: https://developers.weixin.qq.com/miniprogram/dev/component/button.html
- 2,wx.navigateTo(Object object)頁面跳轉方法講解
https://developers.weixin.qq.com/miniprogram/dev/api/wx.navigateTo.html
- 3,文章詳情頁請求接口
https://30paotui.com/article/one?aid=0
# markdown三方類庫的使用
- 1,引入三方類庫代碼和pages文件同級
- 2,在文章詳情頁wxml里引入下面兩行代碼
```
<!--pages/detail/detail.wxml-->
<!--引入towxml模版入口文件,并使用模版-->
<import src="/towxml/entry.wxml" />
<template is="entry" data="{{...xiangqing}}" />
```
- 3,在文章詳情頁的js里,在網絡請求數據成功后使用如下方法
```
// pages/detail/detail.js
const Towxml = require('../../towxml/main'); //引入towxml庫
Page({
data: {},
onLoad: function (options) {
let aid = options.aid;
console.log("詳情頁接收到的aid的值:" + aid);
let that = this;
//請求文章詳情頁
wx.request({
url: "https://30paotui.com/article/one?aid=" + aid,
success: function (response) {
// console.log(response.data.data);
let content = response.data.data.content;
//將markdown內容轉換為towxml數據
//創建towxml對象,供小程序頁面使用
let towxml = new Towxml().toJson(content, 'markdown');
//設置文檔顯示主題,默認'light'
towxml.theme = 'main';
//設置數據
that.setData({
xiangqing: towxml
});
}
})
},
})
```
# 配套筆記
[012反饋與建議](http://www.hmoore.net/java-qiushi/xiaochengxu/853412)
[013頁面跳轉的實現&&014文章詳情頁的實現](http://www.hmoore.net/java-qiushi/xiaochengxu/895595)
# 視頻地址
加老師微信索要視頻資源。
最好跟著老師的教程敲代碼,如果實在敲不出來,加老師微信索要源碼。
# 老師微信
2501902696(備注小程序)

# 實例小程序
