# 本節知識點
- 1,訂單詳情頁的開發
- 2,微信小程序支付功能的實現
- 3,使用云開發實現支付功能
- 4,云函數的創建與上傳
- 5, 微信支付商戶號,和支付密匙的配置
# 實現小程序微信支付功能的必要條件
- 1,必須是非個人小程序
- 2,必須開通微信支付商戶號
# 本章效果圖

# 課后作業
- 1 ,跟著老師實現云開發支付功能
- 2 ,完成訂單詳情頁的開發
# 課程中用到的網址
- 1,微信官方: https://mp.weixin.qq.com/
- 2,在線視頻講解:[https://edu.csdn.net/course/detail/24770](https://edu.csdn.net/course/detail/24770)
- 3,云開發官方文檔:[https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)
- 4,云開發支付源碼:加老師微信(2501902696)獲取
- 5,訂單詳情頁源碼:加老師微信獲取
- 6,《微信支付商戶平臺-配置密鑰/API安全》:[https://www.jianshu.com/p/f0805f5792e3](https://www.jianshu.com/p/f0805f5792e3)
- 7,《微信小程序開發常見問題及解決方案》:[https://www.jianshu.com/p/07bf2e061cd5](https://www.jianshu.com/p/07bf2e061cd5)
# 本節資源
在線視頻:[https://edu.csdn.net/course/detail/24770](https://edu.csdn.net/course/detail/24770)
源碼下載:在我們商城小程序教程的第4章里有下面兩個代碼

# 代碼資源
商品下單
```
//下單
xiadan(event) {
wx.showLoading({
title: '正在下單',
});
let item = event.currentTarget.dataset.item
// 利用云開發新接口,調用云函數發起訂單
let id = item.goodid;
wx.cloud.callFunction({
name: 'pay',
data: {
type: 'unifiedorder',
data: {
goodId: id,
}
},
success(res) {
wx.hideLoading();
console.log("提交成功", res)
wx.navigateTo({
url: "../result/result?id=" + res.result.data.out_trade_no
});
},
fail(res) {
wx.hideLoading();
console.log("提交失敗", res)
}
});
}
```
# 零基礎入門小程序開發
如果你還不知道怎么注冊小程序,怎么使用小程序開發者工具,怎么獲取到自己的appid,怎么上線自己的小程序,請移步到老師的另外一門課程《零基礎10天實戰入門小程序開發》
筆記:[零基礎10天實戰入門小程序開發筆記](http://www.hmoore.net/java-qiushi/xiaochengxu)
**視頻:** [零基礎10天實戰入門小程序開發筆記視頻](https://edu.csdn.net/course/play/9531)
最好跟著老師的教程敲代碼,如果實在敲不出來,加老師微信索要源碼
# 老師微信
2501902696(備注小程序)