diff --git a/doc/project1 b/doc/project1
deleted file mode 160000
index 55dbf15..0000000
--- a/doc/project1
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 55dbf15bfa54f6acec84bbda291eea39ba2c5451
diff --git a/doc/project2/.eslintrc.js b/doc/project2/.eslintrc.js
new file mode 100644
index 0000000..115cc02
--- /dev/null
+++ b/doc/project2/.eslintrc.js
@@ -0,0 +1,31 @@
+/*
+ * Eslint config file
+ * Documentation: https://eslint.org/docs/user-guide/configuring/
+ * Install the Eslint extension before using this feature.
+ */
+module.exports = {
+ env: {
+ es6: true,
+ browser: true,
+ node: true,
+ },
+ ecmaFeatures: {
+ modules: true,
+ },
+ parserOptions: {
+ ecmaVersion: 2018,
+ sourceType: 'module',
+ },
+ globals: {
+ wx: true,
+ App: true,
+ Page: true,
+ getCurrentPages: true,
+ getApp: true,
+ Component: true,
+ requirePlugin: true,
+ requireMiniProgram: true,
+ },
+ // extends: 'eslint:recommended',
+ rules: {},
+}
diff --git a/doc/project2/.gitignore b/doc/project2/.gitignore
new file mode 100644
index 0000000..14ea590
--- /dev/null
+++ b/doc/project2/.gitignore
@@ -0,0 +1,14 @@
+# Windows
+[Dd]esktop.ini
+Thumbs.db
+$RECYCLE.BIN/
+
+# macOS
+.DS_Store
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+
+# Node.js
+node_modules/
diff --git a/doc/project2/README.md b/doc/project2/README.md
new file mode 100644
index 0000000..e097b0c
--- /dev/null
+++ b/doc/project2/README.md
@@ -0,0 +1,12 @@
+# 云开发 quickstart
+
+这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力:
+
+- 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库
+- 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理
+- 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码
+
+## 参考文档
+
+- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)
+
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/config.json b/doc/project2/cloudfunctions/quickstartFunctions/config.json
new file mode 100644
index 0000000..41a485c
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/config.json
@@ -0,0 +1,7 @@
+{
+ "permissions": {
+ "openapi": [
+ "wxacode.get"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/createCollection/index.js b/doc/project2/cloudfunctions/quickstartFunctions/createCollection/index.js
new file mode 100644
index 0000000..75a40b9
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/createCollection/index.js
@@ -0,0 +1,56 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+ env: cloud.DYNAMIC_CURRENT_ENV
+});
+
+const db = cloud.database();
+
+// 创建集合云函数入口函数
+exports.main = async (event, context) => {
+ try {
+ // 创建集合
+ await db.createCollection('sales');
+ await db.collection('sales').add({
+ // data 字段表示需新增的 JSON 数据
+ data: {
+ region: '华东',
+ city: '上海',
+ sales: 11
+ }
+ });
+ await db.collection('sales').add({
+ // data 字段表示需新增的 JSON 数据
+ data: {
+ region: '华东',
+ city: '南京',
+ sales: 11
+ }
+ });
+ await db.collection('sales').add({
+ // data 字段表示需新增的 JSON 数据
+ data: {
+ region: '华南',
+ city: '广州',
+ sales: 22
+ }
+ });
+ await db.collection('sales').add({
+ // data 字段表示需新增的 JSON 数据
+ data: {
+ region: '华南',
+ city: '深圳',
+ sales: 22
+ }
+ });
+ return {
+ success: true
+ };
+ } catch (e) {
+ // 这里catch到的是该collection已经存在,从业务逻辑上来说是运行成功的,所以catch返回success给前端,避免工具在前端抛出异常
+ return {
+ success: true,
+ data: 'create collection success'
+ };
+ }
+};
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/getMiniProgramCode/index.js b/doc/project2/cloudfunctions/quickstartFunctions/getMiniProgramCode/index.js
new file mode 100644
index 0000000..08e1a82
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/getMiniProgramCode/index.js
@@ -0,0 +1,20 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+ env: cloud.DYNAMIC_CURRENT_ENV
+});
+
+// 获取小程序二维码云函数入口函数
+exports.main = async (event, context) => {
+ // 获取小程序二维码的buffer
+ const resp = await cloud.openapi.wxacode.get({
+ path: 'pages/index/index'
+ });
+ const { buffer } = resp;
+ // 将图片上传云存储空间
+ const upload = await cloud.uploadFile({
+ cloudPath: 'code.png',
+ fileContent: buffer
+ });
+ return upload.fileID;
+};
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/getOpenId/index.js b/doc/project2/cloudfunctions/quickstartFunctions/getOpenId/index.js
new file mode 100644
index 0000000..94b7b94
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/getOpenId/index.js
@@ -0,0 +1,17 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+ env: cloud.DYNAMIC_CURRENT_ENV
+});
+
+// 获取openId云函数入口函数
+exports.main = async (event, context) => {
+ // 获取基础信息
+ const wxContext = cloud.getWXContext();
+
+ return {
+ openid: wxContext.OPENID,
+ appid: wxContext.APPID,
+ unionid: wxContext.UNIONID,
+ };
+};
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/index.js b/doc/project2/cloudfunctions/quickstartFunctions/index.js
new file mode 100644
index 0000000..d137f69
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/index.js
@@ -0,0 +1,25 @@
+const getOpenId = require('./getOpenId/index');
+const getMiniProgramCode = require('./getMiniProgramCode/index');
+const createCollection = require('./createCollection/index');
+const selectRecord = require('./selectRecord/index');
+const updateRecord = require('./updateRecord/index');
+const sumRecord = require('./sumRecord/index');
+
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+ switch (event.type) {
+ case 'getOpenId':
+ return await getOpenId.main(event, context);
+ case 'getMiniProgramCode':
+ return await getMiniProgramCode.main(event, context);
+ case 'createCollection':
+ return await createCollection.main(event, context);
+ case 'selectRecord':
+ return await selectRecord.main(event, context);
+ case 'updateRecord':
+ return await updateRecord.main(event, context);
+ case 'sumRecord':
+ return await sumRecord.main(event, context);
+ }
+};
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/package.json b/doc/project2/cloudfunctions/quickstartFunctions/package.json
new file mode 100644
index 0000000..4350dbb
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "quickstartFunctions",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "wx-server-sdk": "~2.4.0"
+ }
+}
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/selectRecord/index.js b/doc/project2/cloudfunctions/quickstartFunctions/selectRecord/index.js
new file mode 100644
index 0000000..c7848a7
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/selectRecord/index.js
@@ -0,0 +1,12 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+ env: cloud.DYNAMIC_CURRENT_ENV
+});
+const db = cloud.database();
+
+// 查询数据库集合云函数入口函数
+exports.main = async (event, context) => {
+ // 返回数据库查询结果
+ return await db.collection('sales').get();
+};
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/sumRecord/index.js b/doc/project2/cloudfunctions/quickstartFunctions/sumRecord/index.js
new file mode 100644
index 0000000..dfdc293
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/sumRecord/index.js
@@ -0,0 +1,18 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+ env: cloud.DYNAMIC_CURRENT_ENV
+});
+const db = cloud.database();
+const $ = db.command.aggregate;
+
+// 聚合记录云函数入口函数
+exports.main = async (event, context) => {
+ // 返回数据库聚合结果
+ return db.collection('sales').aggregate()
+ .group({
+ _id: '$region',
+ sum: $.sum('$sales')
+ })
+ .end();
+};
diff --git a/doc/project2/cloudfunctions/quickstartFunctions/updateRecord/index.js b/doc/project2/cloudfunctions/quickstartFunctions/updateRecord/index.js
new file mode 100644
index 0000000..2ce3ad0
--- /dev/null
+++ b/doc/project2/cloudfunctions/quickstartFunctions/updateRecord/index.js
@@ -0,0 +1,32 @@
+const cloud = require('wx-server-sdk');
+
+cloud.init({
+ env: cloud.DYNAMIC_CURRENT_ENV
+});
+const db = cloud.database();
+
+// 修改数据库信息云函数入口函数
+exports.main = async (event, context) => {
+ try {
+ // 遍历修改数据库信息
+ for (let i = 0; i < event.data.length; i++) {
+ await db.collection('sales').where({
+ _id: event.data[i]._id
+ })
+ .update({
+ data: {
+ sales: event.data[i].sales
+ },
+ });
+ }
+ return {
+ success: true,
+ data: event.data
+ };
+ } catch (e) {
+ return {
+ success: false,
+ errMsg: e
+ };
+ }
+};
diff --git a/doc/project2/miniprogram/app.js b/doc/project2/miniprogram/app.js
new file mode 100644
index 0000000..7642c60
--- /dev/null
+++ b/doc/project2/miniprogram/app.js
@@ -0,0 +1,19 @@
+// app.js
+App({
+ onLaunch: function () {
+ if (!wx.cloud) {
+ console.error('请使用 2.2.3 或以上的基础库以使用云能力');
+ } else {
+ wx.cloud.init({
+ // env 参数说明:
+ // env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源
+ // 此处请填入环境 ID, 环境 ID 可打开云控制台查看
+ // 如不填则使用默认环境(第一个创建的环境)
+ // env: 'my-env-id',
+ traceUser: true,
+ });
+ }
+
+ this.globalData = {};
+ }
+});
diff --git a/doc/project2/miniprogram/app.json b/doc/project2/miniprogram/app.json
new file mode 100644
index 0000000..e3f1444
--- /dev/null
+++ b/doc/project2/miniprogram/app.json
@@ -0,0 +1,39 @@
+{
+ "pages": [
+ "pages/login/login",
+ "pages/index/index",
+ "pages/getOpenId/index",
+ "pages/getMiniProgramCode/index",
+ "pages/deployService/index",
+ "pages/createCollection/index",
+ "pages/uploadFile/index",
+ "pages/selectRecord/index",
+ "pages/updateRecord/index",
+ "pages/updateRecordResult/index",
+ "pages/updateRecordSuccess/index",
+ "pages/sumRecord/index",
+ "pages/sumRecordResult/index",
+ "pages/school/school",
+ "pages/canteen/canteen"
+ ],
+ "window": {
+ "backgroundColor": "#F6F6F6",
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#F6F6F6",
+ "navigationBarTitleText": "云开发 QuickStart",
+ "navigationBarTextStyle": "black"
+ },
+ "sitemapLocation": "sitemap.json",
+ "style": "v2",
+ "plugins": {
+ "routePlan":{
+ "version": "1.0.19",
+ "provider": "wx50b5593e81dd937a"
+ }
+ },
+ "permission": {
+ "scope.userLocation": {
+ "desc": "你的位置信息将用于小程序定位"
+ }
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/app.wxss b/doc/project2/miniprogram/app.wxss
new file mode 100644
index 0000000..7a3d142
--- /dev/null
+++ b/doc/project2/miniprogram/app.wxss
@@ -0,0 +1,27 @@
+/**app.wxss**/
+.container {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ box-sizing: border-box;
+}
+
+button {
+ background: initial;
+}
+
+button:focus{
+ outline: 0;
+}
+
+button::after{
+ border: none;
+}
+
+
+page {
+ background: #ffffff;
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/components/cloudTipModal/index.js b/doc/project2/miniprogram/components/cloudTipModal/index.js
new file mode 100644
index 0000000..f5ca0c1
--- /dev/null
+++ b/doc/project2/miniprogram/components/cloudTipModal/index.js
@@ -0,0 +1,37 @@
+// miniprogram/components/cloudTipModal/index.js
+const { isMac } = require('../../envList.js');
+
+Component({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ tipText: isMac ? 'sh ./uploadCloudFunction.sh' : './uploadCloudFunction.bat'
+ },
+ properties: {
+ showUploadTipProps: Boolean
+ },
+ observers: {
+ showUploadTipProps: function(showUploadTipProps) {
+ this.setData({
+ showUploadTip: showUploadTipProps
+ });
+ }
+ },
+ methods: {
+ onChangeShowUploadTip() {
+ this.setData({
+ showUploadTip: !this.data.showUploadTip
+ });
+ },
+
+ copyShell() {
+ wx.setClipboardData({
+ data: this.data.tipText,
+ });
+ },
+ }
+
+});
diff --git a/doc/project2/miniprogram/components/cloudTipModal/index.json b/doc/project2/miniprogram/components/cloudTipModal/index.json
new file mode 100644
index 0000000..4575d1b
--- /dev/null
+++ b/doc/project2/miniprogram/components/cloudTipModal/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "component": true
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/components/cloudTipModal/index.wxml b/doc/project2/miniprogram/components/cloudTipModal/index.wxml
new file mode 100644
index 0000000..5611267
--- /dev/null
+++ b/doc/project2/miniprogram/components/cloudTipModal/index.wxml
@@ -0,0 +1,13 @@
+
+
+
+
+ 体验前需部署云资源
+ 请开启调试器进入终端窗口,复制并运行以下命令
+
+ {{tipText}}
+ 复制
+
+ 已执行命令
+
+
diff --git a/doc/project2/miniprogram/components/cloudTipModal/index.wxss b/doc/project2/miniprogram/components/cloudTipModal/index.wxss
new file mode 100644
index 0000000..ae36531
--- /dev/null
+++ b/doc/project2/miniprogram/components/cloudTipModal/index.wxss
@@ -0,0 +1,57 @@
+.install_tip_back {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background-color: rgba(0,0,0,0.4);
+ z-index: 1;
+}
+
+.install_tip_detail {
+ position: fixed;
+ background-color: white;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ top: 60%;
+ border-radius: 40rpx 40rpx 0 0;
+ padding: 50rpx;
+ z-index: 9;
+}
+
+.install_tip_detail_title {
+ font-weight: 400;
+ font-size: 40rpx;
+ text-align: center;
+}
+
+.install_tip_detail_tip {
+ font-size: 25rpx;
+ color: rgba(0,0,0,0.4);
+ margin-top: 20rpx;
+ text-align: center;
+}
+
+.install_tip_detail_shell {
+ margin: 70rpx 0;
+ display: flex;
+ justify-content: center;
+}
+
+.install_tip_detail_copy {
+ color: #546488;
+ margin-left: 10rpx;
+}
+
+.install_tip_detail_button {
+ color: #07C160;
+ font-weight: 500;
+ background-color: rgba(0,0,0,0.1);
+ width: 60%;
+ text-align: center;
+ height: 90rpx;
+ line-height: 90rpx;
+ border-radius: 10rpx;
+ margin: 0 auto;
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/envList.js b/doc/project2/miniprogram/envList.js
new file mode 100644
index 0000000..e9a169e
--- /dev/null
+++ b/doc/project2/miniprogram/envList.js
@@ -0,0 +1,6 @@
+const envList = [];
+const isMac = false;
+module.exports = {
+ envList,
+ isMac
+};
diff --git a/doc/project2/miniprogram/images/arrow.svg b/doc/project2/miniprogram/images/arrow.svg
new file mode 100644
index 0000000..cd32a7d
--- /dev/null
+++ b/doc/project2/miniprogram/images/arrow.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/doc/project2/miniprogram/images/database.png b/doc/project2/miniprogram/images/database.png
new file mode 100644
index 0000000..d0499c1
Binary files /dev/null and b/doc/project2/miniprogram/images/database.png differ
diff --git a/doc/project2/miniprogram/images/deploy_step1.png b/doc/project2/miniprogram/images/deploy_step1.png
new file mode 100644
index 0000000..738b71c
Binary files /dev/null and b/doc/project2/miniprogram/images/deploy_step1.png differ
diff --git a/doc/project2/miniprogram/images/deploy_step2.png b/doc/project2/miniprogram/images/deploy_step2.png
new file mode 100644
index 0000000..d77faab
Binary files /dev/null and b/doc/project2/miniprogram/images/deploy_step2.png differ
diff --git a/doc/project2/miniprogram/pages/canteen/canteen.js b/doc/project2/miniprogram/pages/canteen/canteen.js
new file mode 100644
index 0000000..cc723e2
--- /dev/null
+++ b/doc/project2/miniprogram/pages/canteen/canteen.js
@@ -0,0 +1,66 @@
+// pages/canteen/canteen.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/canteen/canteen.json b/doc/project2/miniprogram/pages/canteen/canteen.json
new file mode 100644
index 0000000..3928faa
--- /dev/null
+++ b/doc/project2/miniprogram/pages/canteen/canteen.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/canteen/canteen.wxml b/doc/project2/miniprogram/pages/canteen/canteen.wxml
new file mode 100644
index 0000000..39f0590
--- /dev/null
+++ b/doc/project2/miniprogram/pages/canteen/canteen.wxml
@@ -0,0 +1,2 @@
+
+食堂评价
diff --git a/doc/project2/miniprogram/pages/canteen/canteen.wxss b/doc/project2/miniprogram/pages/canteen/canteen.wxss
new file mode 100644
index 0000000..429f9e7
--- /dev/null
+++ b/doc/project2/miniprogram/pages/canteen/canteen.wxss
@@ -0,0 +1 @@
+/* pages/canteen/canteen.wxss */
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/createCollection/index.js b/doc/project2/miniprogram/pages/createCollection/index.js
new file mode 100644
index 0000000..d98a4ce
--- /dev/null
+++ b/doc/project2/miniprogram/pages/createCollection/index.js
@@ -0,0 +1,10 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+});
diff --git a/doc/project2/miniprogram/pages/createCollection/index.json b/doc/project2/miniprogram/pages/createCollection/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/doc/project2/miniprogram/pages/createCollection/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/createCollection/index.wxml b/doc/project2/miniprogram/pages/createCollection/index.wxml
new file mode 100644
index 0000000..fcec8c8
--- /dev/null
+++ b/doc/project2/miniprogram/pages/createCollection/index.wxml
@@ -0,0 +1,7 @@
+
+ 功能介绍
+ 集合为常用数据库中表的概念。云开发数据库支持自动备份、无损回档,并且QPS高达3千+。
+ 如何体验
+ 已自动创建名为“sales”的体验合集,可打开“云开发控制台>数据库>记录列表”中找到该集合。
+
+
diff --git a/doc/project2/miniprogram/pages/createCollection/index.wxss b/doc/project2/miniprogram/pages/createCollection/index.wxss
new file mode 100644
index 0000000..d89d5f0
--- /dev/null
+++ b/doc/project2/miniprogram/pages/createCollection/index.wxss
@@ -0,0 +1,29 @@
+page {
+ background-color: white;
+ padding-bottom: 50px;
+}
+
+.page {
+ padding: 0 32px;
+}
+
+.title {
+ margin-top: 16px;
+ font-size: 17px;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: #000000;
+}
+
+.info {
+ margin-top: 12px;
+ font-size: 17px;
+ font-family: PingFang SC;
+ font-weight: 400;
+ color: #000000;
+}
+
+.img {
+ margin-top: 16px;
+ width: 100%;
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/deployService/index.js b/doc/project2/miniprogram/pages/deployService/index.js
new file mode 100644
index 0000000..133cd5d
--- /dev/null
+++ b/doc/project2/miniprogram/pages/deployService/index.js
@@ -0,0 +1,11 @@
+// miniprogram/pages/deployService/index.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+});
diff --git a/doc/project2/miniprogram/pages/deployService/index.json b/doc/project2/miniprogram/pages/deployService/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/doc/project2/miniprogram/pages/deployService/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/deployService/index.wxml b/doc/project2/miniprogram/pages/deployService/index.wxml
new file mode 100644
index 0000000..476e764
--- /dev/null
+++ b/doc/project2/miniprogram/pages/deployService/index.wxml
@@ -0,0 +1,10 @@
+
+
+ 功能介绍
+ 云托管是全托管的容器服务,支持任何语言及框架运行,只需将已有业务代码打包上传,即可快速迁移。
+ 如何体验
+ 步骤一:切换按量付费,打开“云开发控制台>设置>环境设置”找到按量付费,点击切换。
+
+ 步骤二:开通云托管,体验相关能力
+
+
diff --git a/doc/project2/miniprogram/pages/deployService/index.wxss b/doc/project2/miniprogram/pages/deployService/index.wxss
new file mode 100644
index 0000000..aa739a0
--- /dev/null
+++ b/doc/project2/miniprogram/pages/deployService/index.wxss
@@ -0,0 +1,30 @@
+/* miniprogram/pages/deployService/index.wxss */
+page {
+ background-color: white;
+ padding-bottom: 50px;
+}
+
+.page {
+ padding: 0 32px;
+}
+
+.title {
+ margin-top: 16px;
+ font-size: 17px;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: #000000;
+}
+
+.info {
+ margin-top: 12px;
+ font-size: 17px;
+ font-family: PingFang SC;
+ font-weight: 400;
+ color: #000000;
+}
+
+.img {
+ margin-top: 16px;
+ width: 100%;
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/getMiniProgramCode/index.js b/doc/project2/miniprogram/pages/getMiniProgramCode/index.js
new file mode 100644
index 0000000..75328ae
--- /dev/null
+++ b/doc/project2/miniprogram/pages/getMiniProgramCode/index.js
@@ -0,0 +1,53 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ haveGetCodeSrc: false,
+ envId: '',
+ codeSrc: ''
+ },
+
+ onLoad(options) {
+ this.setData({
+ envId: options.envId
+ });
+ },
+
+ getCodeSrc() {
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.envId
+ },
+ data: {
+ type: 'getMiniProgramCode'
+ }
+ }).then((resp) => {
+ this.setData({
+ haveGetCodeSrc: true,
+ codeSrc: resp.result
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ },
+
+ clearCodeSrc() {
+ this.setData({
+ haveGetCodeSrc: false,
+ codeSrc: ''
+ });
+ }
+
+});
diff --git a/doc/project2/miniprogram/pages/getMiniProgramCode/index.json b/doc/project2/miniprogram/pages/getMiniProgramCode/index.json
new file mode 100644
index 0000000..73fa860
--- /dev/null
+++ b/doc/project2/miniprogram/pages/getMiniProgramCode/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "生成小程序码",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/getMiniProgramCode/index.wxml b/doc/project2/miniprogram/pages/getMiniProgramCode/index.wxml
new file mode 100644
index 0000000..df1b529
--- /dev/null
+++ b/doc/project2/miniprogram/pages/getMiniProgramCode/index.wxml
@@ -0,0 +1,11 @@
+
+ 可通过云函数免接口调用凭证,直接生成小程序码。
+ 小程序码将展示在这里
+
+
+
+ 生成小程序码
+ 清空
+ 在”资源管理器>cloudfunctions>quickstartFunctions>getMiniProgramCode>index.js“找到获取小程序码函数,体验该能力
+
+
diff --git a/doc/project2/miniprogram/pages/getMiniProgramCode/index.wxss b/doc/project2/miniprogram/pages/getMiniProgramCode/index.wxss
new file mode 100644
index 0000000..3557c79
--- /dev/null
+++ b/doc/project2/miniprogram/pages/getMiniProgramCode/index.wxss
@@ -0,0 +1,58 @@
+.tip {
+ font-size: 23rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: center;
+ margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: left;
+ margin-top: 30rpx;
+ margin-left: 20rpx;
+}
+
+.box_text {
+ background-color: white;
+ text-align: center;
+ padding: 300rpx 0;
+ margin-top: 30rpx;
+ color: rgba(0, 0, 0, 0.5);
+}
+
+.code_box {
+ text-align: center;
+ background-color: white;
+ margin-top: 30rpx;
+ padding: 17rpx 0;
+}
+
+.code_img {
+ width: 600rpx;
+ height: 600rpx;
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 20% auto 0 auto;
+ height: 80rpx;
+ color: white;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: #07c160;
+}
+
+.button_clear {
+ width: 300rpx;
+ text-align: center;
+ margin: 20% auto 0 auto;
+ height: 80rpx;
+ color: #07c160;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: rgba(0, 0, 0, 0.03);
+}
diff --git a/doc/project2/miniprogram/pages/getOpenId/index.js b/doc/project2/miniprogram/pages/getOpenId/index.js
new file mode 100644
index 0000000..a8927bc
--- /dev/null
+++ b/doc/project2/miniprogram/pages/getOpenId/index.js
@@ -0,0 +1,52 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ haveGetOpenId: false,
+ envId: '',
+ openId: ''
+ },
+
+ onLoad(options) {
+ this.setData({
+ envId: options.envId
+ });
+ },
+
+ getOpenId() {
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.envId
+ },
+ data: {
+ type: 'getOpenId'
+ }
+ }).then((resp) => {
+ this.setData({
+ haveGetOpenId: true,
+ openId: resp.result.openid
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ },
+
+ clearOpenId() {
+ this.setData({
+ haveGetOpenId: false,
+ openId: ''
+ });
+ }
+
+});
diff --git a/doc/project2/miniprogram/pages/getOpenId/index.json b/doc/project2/miniprogram/pages/getOpenId/index.json
new file mode 100644
index 0000000..899024b
--- /dev/null
+++ b/doc/project2/miniprogram/pages/getOpenId/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "获取OpenId",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/getOpenId/index.wxml b/doc/project2/miniprogram/pages/getOpenId/index.wxml
new file mode 100644
index 0000000..6f011cc
--- /dev/null
+++ b/doc/project2/miniprogram/pages/getOpenId/index.wxml
@@ -0,0 +1,8 @@
+
+ 无需维护鉴权机制及登录票据,仅一行代码即可获得。
+ {{ openId ? openId : 'OpenID将展示在这里' }}
+ 获取OpenId
+ 清空
+ 在”资源管理器>cloudfunctions>quickstartFunctions>getOpenId>index.js“找到获取openId函数,体验该能力
+
+
diff --git a/doc/project2/miniprogram/pages/getOpenId/index.wxss b/doc/project2/miniprogram/pages/getOpenId/index.wxss
new file mode 100644
index 0000000..596c65d
--- /dev/null
+++ b/doc/project2/miniprogram/pages/getOpenId/index.wxss
@@ -0,0 +1,46 @@
+.tip {
+ font-size: 23rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: center;
+ margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: left;
+ margin-top: 30rpx;
+ margin-left: 20rpx;
+}
+
+.box_text {
+ background-color: white;
+ text-align: center;
+ padding: 300rpx 0;
+ margin-top: 30rpx;
+ color: rgba(0, 0, 0, 0.5);
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: white;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: #07c160;
+}
+
+.button_clear {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: #07c160;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: rgba(0, 0, 0, 0.03);
+}
diff --git a/doc/project2/miniprogram/pages/index/index.js b/doc/project2/miniprogram/pages/index/index.js
new file mode 100644
index 0000000..807f628
--- /dev/null
+++ b/doc/project2/miniprogram/pages/index/index.js
@@ -0,0 +1,142 @@
+// index.js
+// const app = getApp()
+const { envList } = require('../../envList.js');
+
+Page({
+ data: {
+ showUploadTip: false,
+ powerList: [{
+ title: '云函数',
+ tip: '安全、免鉴权运行业务代码',
+ showItem: false,
+ item: [{
+ title: '获取OpenId',
+ page: 'getOpenId'
+ },
+ // {
+ // title: '微信支付'
+ // },
+ {
+ title: '生成小程序码',
+ page: 'getMiniProgramCode'
+ },
+ // {
+ // title: '发送订阅消息',
+ // }
+ ]
+ }, {
+ title: '数据库',
+ tip: '安全稳定的文档型数据库',
+ showItem: false,
+ item: [{
+ title: '创建集合',
+ page: 'createCollection'
+ }, {
+ title: '更新记录',
+ page: 'updateRecord'
+ }, {
+ title: '查询记录',
+ page: 'selectRecord'
+ }, {
+ title: '聚合操作',
+ page: 'sumRecord'
+ }]
+ }, {
+ title: '云存储',
+ tip: '自带CDN加速文件存储',
+ showItem: false,
+ item: [{
+ title: '上传文件',
+ page: 'uploadFile'
+ }]
+ }, {
+ title: '云托管',
+ tip: '不限语言的全托管容器服务',
+ showItem: false,
+ item: [{
+ title: '部署服务',
+ page: 'deployService'
+ }]
+ }],
+ envList,
+ selectedEnv: envList[0],
+ haveCreateCollection: false
+ },
+
+ onClickPowerInfo(e) {
+ const index = e.currentTarget.dataset.index;
+ const powerList = this.data.powerList;
+ powerList[index].showItem = !powerList[index].showItem;
+ if (powerList[index].title === '数据库' && !this.data.haveCreateCollection) {
+ this.onClickDatabase(powerList);
+ } else {
+ this.setData({
+ powerList
+ });
+ }
+ },
+
+ onChangeShowEnvChoose() {
+ wx.showActionSheet({
+ itemList: this.data.envList.map(i => i.alias),
+ success: (res) => {
+ this.onChangeSelectedEnv(res.tapIndex);
+ },
+ fail (res) {
+ console.log(res.errMsg);
+ }
+ });
+ },
+
+ onChangeSelectedEnv(index) {
+ if (this.data.selectedEnv.envId === this.data.envList[index].envId) {
+ return;
+ }
+ const powerList = this.data.powerList;
+ powerList.forEach(i => {
+ i.showItem = false;
+ });
+ this.setData({
+ selectedEnv: this.data.envList[index],
+ powerList,
+ haveCreateCollection: false
+ });
+ },
+
+ jumpPage(e) {
+ wx.navigateTo({
+ url: `/pages/${e.currentTarget.dataset.page}/index?envId=${this.data.selectedEnv.envId}`,
+ });
+ },
+
+ onClickDatabase(powerList) {
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.selectedEnv.envId
+ },
+ data: {
+ type: 'createCollection'
+ }
+ }).then((resp) => {
+ if (resp.result.success) {
+ this.setData({
+ haveCreateCollection: true
+ });
+ }
+ this.setData({
+ powerList
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ }
+});
diff --git a/doc/project2/miniprogram/pages/index/index.json b/doc/project2/miniprogram/pages/index/index.json
new file mode 100644
index 0000000..3ea1434
--- /dev/null
+++ b/doc/project2/miniprogram/pages/index/index.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/index/index.wxml b/doc/project2/miniprogram/pages/index/index.wxml
new file mode 100644
index 0000000..ecd65e4
--- /dev/null
+++ b/doc/project2/miniprogram/pages/index/index.wxml
@@ -0,0 +1,32 @@
+
+
+
+ 快速了解云开发
+
+ 免鉴权接口调用 免部署后台 高并发
+
+
+
+
+ {{power.title}}
+ {{power.tip}}
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+ 当前环境 {{ selectedEnv.alias }}
+
+
+
+
diff --git a/doc/project2/miniprogram/pages/index/index.wxss b/doc/project2/miniprogram/pages/index/index.wxss
new file mode 100644
index 0000000..6bcde3a
--- /dev/null
+++ b/doc/project2/miniprogram/pages/index/index.wxss
@@ -0,0 +1,94 @@
+/**index.wxss**/
+
+page {
+ padding-top: 54rpx;
+ background-color: #ffffff;
+ padding-bottom: 60rpx;
+}
+
+.title {
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: #000000;
+ font-size: 44rpx;
+ margin-bottom: 40rpx;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ font-family: PingFang SC;
+ font-weight: 400;
+ color: #888888;
+ margin-bottom: 28rpx;
+}
+
+.power {
+ margin-top: 30rpx;
+ border-radius: 5px;
+ background-color: white;
+ width: 93%;
+ padding-bottom: 1rpx;
+}
+
+.power_info {
+ display: flex;
+ padding: 30rpx 25rpx;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.power_info_more {
+ width: 30rpx;
+ height: 30rpx;
+ transform: rotate(90deg);
+}
+
+.power_info_less {
+ width: 30rpx;
+ height: 30rpx;
+ transform: rotate(270deg);
+}
+
+.power_info_text {
+ display: flex;
+ flex-direction: column;
+}
+
+.power_info_text_title {
+ margin-bottom: 10rpx;
+ font-weight: 400;
+ font-size: 35rpx;
+}
+
+.power_info_text_tip {
+ color: rgba(0, 0, 0, 0.4);
+ font-size: 25rpx;
+}
+
+.power_item {
+ padding: 30rpx 25rpx;
+ display: flex;
+ justify-content: space-between;
+}
+
+.power_item_title {
+ font-size: 30rpx;
+}
+
+.power_item_icon {
+ width: 30rpx;
+ height: 30rpx;
+}
+
+.line {
+ width: 95%;
+ margin: 0 auto;
+ height: 2rpx;
+ background-color: rgba(0, 0, 0, 0.1);
+}
+
+.environment {
+ color: rgba(0, 0, 0, 0.4);
+ font-size: 24rpx;
+ margin-top: 25%;
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/login/login.js b/doc/project2/miniprogram/pages/login/login.js
new file mode 100644
index 0000000..0a50e6e
--- /dev/null
+++ b/doc/project2/miniprogram/pages/login/login.js
@@ -0,0 +1,112 @@
+// pages/login/login.js
+var that;
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ userInfo:null,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad:function(options) {
+ that = this;
+ wx.getStorage({
+ key:'userInfo',
+ success(res){
+ // console.log('get storage success',JSON.parse(res.data))
+ that.setData({
+ userInfo:JSON.parse(res.data)
+ })
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow(){
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ },
+ bindGetUserInfo: function(e){
+ that = this;
+ if(e.detail.userInfo){
+ wx.setStorage({
+ data:JSON.stringify(e.detail.userInfo),
+ key:'userInfo',
+ success(res){
+ // console.log('set storage success:',res)
+ that.setData({
+ userInfo:JSON.parse(res.data)
+ })
+ }
+ })
+ wx.getStorage({
+ key:'userInfo',
+ success(res){
+ // console.log('get storage success',JSON.parse(res.data))
+ that.setData({
+ userInfo:JSON.parse(res.data)
+ })
+ }
+ })
+ }
+
+ },
+ goToSchool:function(options){
+
+ wx.navigateTo({
+ url: '../school/school'
+ })
+ },
+ goToCanteen:function(options){
+ wx.navigateTo({
+ url: '../canteen/canteen'
+ })
+ }
+})
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/login/login.json b/doc/project2/miniprogram/pages/login/login.json
new file mode 100644
index 0000000..3928faa
--- /dev/null
+++ b/doc/project2/miniprogram/pages/login/login.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/login/login.wxml b/doc/project2/miniprogram/pages/login/login.wxml
new file mode 100644
index 0000000..05a72ef
--- /dev/null
+++ b/doc/project2/miniprogram/pages/login/login.wxml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+ 欢迎您! {{userInfo.nickName}}
+
+
+
+
+ 微信登陆
+ 将获取您的信息,如头像、昵称等
+
+
+
diff --git a/doc/project2/miniprogram/pages/login/login.wxss b/doc/project2/miniprogram/pages/login/login.wxss
new file mode 100644
index 0000000..c99bb97
--- /dev/null
+++ b/doc/project2/miniprogram/pages/login/login.wxss
@@ -0,0 +1,49 @@
+/* pages/login/login.wxss */
+page {
+ background-color: rgb(255, 255, 255);
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+}
+.text_style{
+ margin-top: 40rpx;
+ height: 140rpx;
+ width: 100%;
+ background: #ffffff;
+ text-align: center;
+ font-size: 40rpx;
+ color: rgb(18, 18, 224);
+}
+.text_desc_style{
+ /* margin-top: 40rpx; */
+ height: 100rpx;
+ width: 100%;
+ background: #fff;
+ text-align: center;
+ font-size: 30rpx;
+ color: blue;
+}
+#userinfo{
+ width: 260rpx;
+ height:260rpx;
+ border-radius:50%;
+ display: flex;
+ overflow:hidden;
+ /* text-align: center; */
+ /* justify-content: center; */
+ margin-top: 50px;
+ margin-left: 120px;
+}
+.nickname_type{
+ width: 100%;
+ height: 200px;
+ display: flex;
+ /* align-items: center; */
+ justify-content: center;
+}
+.tapbtn1{
+ margin-top: 1%;
+}
+.tapbtn2{
+ margin-top: 5%;
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/school/school.js b/doc/project2/miniprogram/pages/school/school.js
new file mode 100644
index 0000000..e69de29
diff --git a/doc/project2/miniprogram/pages/school/school.json b/doc/project2/miniprogram/pages/school/school.json
new file mode 100644
index 0000000..3928faa
--- /dev/null
+++ b/doc/project2/miniprogram/pages/school/school.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/school/school.wxml b/doc/project2/miniprogram/pages/school/school.wxml
new file mode 100644
index 0000000..e69de29
diff --git a/doc/project2/miniprogram/pages/school/school.wxss b/doc/project2/miniprogram/pages/school/school.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/doc/project2/miniprogram/pages/selectRecord/index.js b/doc/project2/miniprogram/pages/selectRecord/index.js
new file mode 100644
index 0000000..fe00c3e
--- /dev/null
+++ b/doc/project2/miniprogram/pages/selectRecord/index.js
@@ -0,0 +1,53 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ haveGetRecord: false,
+ envId: '',
+ record: ''
+ },
+
+ onLoad(options) {
+ this.setData({
+ envId: options.envId
+ });
+ },
+
+ getRecord() {
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.envId
+ },
+ data: {
+ type: 'selectRecord'
+ }
+ }).then((resp) => {
+ this.setData({
+ haveGetRecord: true,
+ record: resp.result.data
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ },
+
+ clearRecord() {
+ this.setData({
+ haveGetRecord: false,
+ record: ''
+ });
+ }
+
+});
diff --git a/doc/project2/miniprogram/pages/selectRecord/index.json b/doc/project2/miniprogram/pages/selectRecord/index.json
new file mode 100644
index 0000000..a85acd9
--- /dev/null
+++ b/doc/project2/miniprogram/pages/selectRecord/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "查询记录",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/selectRecord/index.wxml b/doc/project2/miniprogram/pages/selectRecord/index.wxml
new file mode 100644
index 0000000..78dd8fc
--- /dev/null
+++ b/doc/project2/miniprogram/pages/selectRecord/index.wxml
@@ -0,0 +1,22 @@
+
+ 体验查询记录能力,查询数据表中的销量数据。
+ 销量数据将展示在这里
+
+ 地区销量统计
+
+ 地域
+ 城市
+ 销量
+
+
+
+ {{item.region}}
+ {{item.city}}
+ {{item.sales}}
+
+
+ 查询记录
+ 清空
+ 在”资源管理器>cloudfunctions>quickstartFunctions>selectRecord>index.js“找到查询记录函数,体验该能力
+
+
diff --git a/doc/project2/miniprogram/pages/selectRecord/index.wxss b/doc/project2/miniprogram/pages/selectRecord/index.wxss
new file mode 100644
index 0000000..76652f4
--- /dev/null
+++ b/doc/project2/miniprogram/pages/selectRecord/index.wxss
@@ -0,0 +1,83 @@
+.tip {
+ font-size: 23rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: center;
+ margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: left;
+ margin-top: 30rpx;
+ margin-left: 20rpx;
+}
+
+.box_text {
+ background-color: white;
+ text-align: center;
+ padding: 300rpx 0;
+ margin-top: 30rpx;
+ color: rgba(0, 0, 0, 0.5);
+}
+
+.code_box {
+ text-align: center;
+ background-color: white;
+ margin-top: 30rpx;
+ padding: 17rpx;
+}
+
+.code_box_title {
+ color: rgba(0, 0, 0, 0.5);
+ font-size: 26rpx;
+ margin-bottom: 20rpx;
+ text-align: left;
+}
+
+.code_box_record {
+ display: flex;
+}
+
+.code_box_record_title {
+ width: 33%;
+ font-size: 26rpx;
+ color: rgba(0, 0, 0, 0.5);
+ padding: 20rpx 0;
+}
+
+.code_box_record_detail {
+ width: 33%;
+ font-size: 26rpx;
+ padding: 20rpx 0;
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 20% auto 0 auto;
+ height: 80rpx;
+ color: white;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: #07c160;
+}
+
+.button_clear {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: #07c160;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: rgba(0, 0, 0, 0.03);
+}
+
+.line {
+ height: 1rpx;
+ width: 100%;
+ background-color: rgba(0, 0, 0, 0.1);
+}
diff --git a/doc/project2/miniprogram/pages/sumRecord/index.js b/doc/project2/miniprogram/pages/sumRecord/index.js
new file mode 100644
index 0000000..4ee28ce
--- /dev/null
+++ b/doc/project2/miniprogram/pages/sumRecord/index.js
@@ -0,0 +1,48 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ haveGetRecord: false,
+ envId: '',
+ record: ''
+ },
+
+ onLoad(options) {
+ this.setData({
+ envId: options.envId
+ });
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.envId
+ },
+ data: {
+ type: 'selectRecord'
+ }
+ }).then((resp) => {
+ this.setData({
+ record: resp.result.data
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ },
+
+ sumRecord() {
+ wx.navigateTo({
+ url: `/pages/sumRecordResult/index?envId=${this.data.envId}`,
+ });
+ },
+
+});
diff --git a/doc/project2/miniprogram/pages/sumRecord/index.json b/doc/project2/miniprogram/pages/sumRecord/index.json
new file mode 100644
index 0000000..b2e58f0
--- /dev/null
+++ b/doc/project2/miniprogram/pages/sumRecord/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "聚合记录",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/sumRecord/index.wxml b/doc/project2/miniprogram/pages/sumRecord/index.wxml
new file mode 100644
index 0000000..467c63b
--- /dev/null
+++ b/doc/project2/miniprogram/pages/sumRecord/index.wxml
@@ -0,0 +1,21 @@
+
+ 常用数据库中的groupby操作,体验按地域聚合数据。
+ 数据将展示在这里
+
+ 地区销量统计
+
+ 地域
+ 城市
+ 销量
+
+
+
+ {{item.region}}
+ {{item.city}}
+ {{item.sales}}
+
+
+ 聚合记录
+ 在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数,体验该能力
+
+
diff --git a/doc/project2/miniprogram/pages/sumRecord/index.wxss b/doc/project2/miniprogram/pages/sumRecord/index.wxss
new file mode 100644
index 0000000..02d5527
--- /dev/null
+++ b/doc/project2/miniprogram/pages/sumRecord/index.wxss
@@ -0,0 +1,83 @@
+.tip {
+ font-size: 23rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: center;
+ margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: left;
+ margin-top: 30rpx;
+ margin-left: 20rpx;
+}
+
+.box_text {
+ background-color: white;
+ text-align: center;
+ padding: 300rpx 0;
+ margin-top: 30rpx;
+ color: rgba(0, 0, 0, 0.5);
+}
+
+.code_box {
+ text-align: center;
+ background-color: white;
+ margin-top: 30rpx;
+ padding: 17rpx;
+}
+
+.code_box_title {
+ color: rgba(0, 0, 0, 0.5);
+ font-size: 26rpx;
+ margin-bottom: 20rpx;
+ text-align: left;
+}
+
+.code_box_record {
+ display: flex;
+}
+
+.code_box_record_title {
+ width: 33%;
+ font-size: 26rpx;
+ color: rgba(0, 0, 0, 0.5);
+ padding: 20rpx 0;
+}
+
+.code_box_record_detail {
+ width: 33%;
+ font-size: 26rpx;
+ padding: 20rpx 0;
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: white;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: #07c160;
+}
+
+.button_clear {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: #07c160;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: rgba(0, 0, 0, 0.03);
+}
+
+.line {
+ height: 1rpx;
+ width: 100%;
+ background-color: rgba(0, 0, 0, 0.1);
+}
diff --git a/doc/project2/miniprogram/pages/sumRecordResult/index.js b/doc/project2/miniprogram/pages/sumRecordResult/index.js
new file mode 100644
index 0000000..d2dcc09
--- /dev/null
+++ b/doc/project2/miniprogram/pages/sumRecordResult/index.js
@@ -0,0 +1,46 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ haveGetRecord: false,
+ envId: '',
+ record: ''
+ },
+
+ onLoad(options) {
+ this.setData({
+ envId: options.envId
+ });
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.envId
+ },
+ data: {
+ type: 'sumRecord'
+ }
+ }).then((resp) => {
+ this.setData({
+ record: resp.result.list
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ },
+
+ goBack() {
+ wx.navigateBack();
+ },
+
+});
diff --git a/doc/project2/miniprogram/pages/sumRecordResult/index.json b/doc/project2/miniprogram/pages/sumRecordResult/index.json
new file mode 100644
index 0000000..b2e58f0
--- /dev/null
+++ b/doc/project2/miniprogram/pages/sumRecordResult/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "聚合记录",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/sumRecordResult/index.wxml b/doc/project2/miniprogram/pages/sumRecordResult/index.wxml
new file mode 100644
index 0000000..2e32aac
--- /dev/null
+++ b/doc/project2/miniprogram/pages/sumRecordResult/index.wxml
@@ -0,0 +1,19 @@
+
+ 常用数据库中的groupby操作,体验按地域聚合数据。
+ 数据将展示在这里
+
+ 地区销量统计
+
+ 地域
+ 销量
+
+
+
+ {{item._id}}
+ {{item.sum}}
+
+
+ 返回上一步
+ 在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数,体验该能力
+
+
diff --git a/doc/project2/miniprogram/pages/sumRecordResult/index.wxss b/doc/project2/miniprogram/pages/sumRecordResult/index.wxss
new file mode 100644
index 0000000..49ba9e3
--- /dev/null
+++ b/doc/project2/miniprogram/pages/sumRecordResult/index.wxss
@@ -0,0 +1,73 @@
+.tip {
+ font-size: 23rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: center;
+ margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: left;
+ margin-top: 30rpx;
+ margin-left: 20rpx;
+}
+
+.box_text {
+ background-color: white;
+ text-align: center;
+ padding: 300rpx 0;
+ margin-top: 30rpx;
+ color: rgba(0, 0, 0, 0.5);
+}
+
+.code_box {
+ text-align: center;
+ background-color: white;
+ margin-top: 30rpx;
+ padding: 17rpx;
+}
+
+.code_box_title {
+ color: rgba(0, 0, 0, 0.5);
+ font-size: 26rpx;
+ margin-bottom: 20rpx;
+ text-align: left;
+}
+
+.code_box_record {
+ display: flex;
+ justify-content: space-between;
+}
+
+.code_box_record_title {
+ width: 33%;
+ font-size: 26rpx;
+ color: rgba(0, 0, 0, 0.5);
+ padding: 20rpx 0;
+}
+
+.code_box_record_detail {
+ width: 33%;
+ font-size: 26rpx;
+ padding: 20rpx 0;
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: #07c160;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: rgba(0, 0, 0, 0.03);
+}
+
+.line {
+ height: 1rpx;
+ width: 100%;
+ background-color: rgba(0, 0, 0, 0.1);
+}
diff --git a/doc/project2/miniprogram/pages/updateRecord/index.js b/doc/project2/miniprogram/pages/updateRecord/index.js
new file mode 100644
index 0000000..e27c4c8
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecord/index.js
@@ -0,0 +1,51 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ haveGetRecord: false,
+ envId: '',
+ record: ''
+ },
+
+ onLoad(options) {
+ this.setData({
+ envId: options.envId
+ });
+ },
+
+ onShow() {
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.envId
+ },
+ data: {
+ type: 'selectRecord'
+ }
+ }).then((resp) => {
+ this.setData({
+ record: resp.result.data
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ },
+
+ updateRecord() {
+ wx.navigateTo({
+ url: `/pages/updateRecordResult/index?envId=${this.data.envId}`,
+ });
+ },
+
+});
diff --git a/doc/project2/miniprogram/pages/updateRecord/index.json b/doc/project2/miniprogram/pages/updateRecord/index.json
new file mode 100644
index 0000000..d7969cb
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecord/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "更新记录",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/updateRecord/index.wxml b/doc/project2/miniprogram/pages/updateRecord/index.wxml
new file mode 100644
index 0000000..4a62aa6
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecord/index.wxml
@@ -0,0 +1,21 @@
+
+ 体验更新字段记录能力,更新数据表中的销量数据。
+ 数据将展示在这里
+
+ 地区销量统计
+
+ 地域
+ 城市
+ 销量
+
+
+
+ {{item.region}}
+ {{item.city}}
+ {{item.sales}}
+
+
+ 修改数据
+ 在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数,体验该能力
+
+
diff --git a/doc/project2/miniprogram/pages/updateRecord/index.wxss b/doc/project2/miniprogram/pages/updateRecord/index.wxss
new file mode 100644
index 0000000..02d5527
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecord/index.wxss
@@ -0,0 +1,83 @@
+.tip {
+ font-size: 23rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: center;
+ margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: left;
+ margin-top: 30rpx;
+ margin-left: 20rpx;
+}
+
+.box_text {
+ background-color: white;
+ text-align: center;
+ padding: 300rpx 0;
+ margin-top: 30rpx;
+ color: rgba(0, 0, 0, 0.5);
+}
+
+.code_box {
+ text-align: center;
+ background-color: white;
+ margin-top: 30rpx;
+ padding: 17rpx;
+}
+
+.code_box_title {
+ color: rgba(0, 0, 0, 0.5);
+ font-size: 26rpx;
+ margin-bottom: 20rpx;
+ text-align: left;
+}
+
+.code_box_record {
+ display: flex;
+}
+
+.code_box_record_title {
+ width: 33%;
+ font-size: 26rpx;
+ color: rgba(0, 0, 0, 0.5);
+ padding: 20rpx 0;
+}
+
+.code_box_record_detail {
+ width: 33%;
+ font-size: 26rpx;
+ padding: 20rpx 0;
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: white;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: #07c160;
+}
+
+.button_clear {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: #07c160;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: rgba(0, 0, 0, 0.03);
+}
+
+.line {
+ height: 1rpx;
+ width: 100%;
+ background-color: rgba(0, 0, 0, 0.1);
+}
diff --git a/doc/project2/miniprogram/pages/updateRecordResult/index.js b/doc/project2/miniprogram/pages/updateRecordResult/index.js
new file mode 100644
index 0000000..a200e6e
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecordResult/index.js
@@ -0,0 +1,78 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ haveGetRecord: false,
+ envId: '',
+ record: ''
+ },
+
+ onLoad(options) {
+ this.setData({
+ envId: options.envId
+ });
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.envId
+ },
+ data: {
+ type: 'selectRecord'
+ }
+ }).then((resp) => {
+ this.setData({
+ record: resp.result.data
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ },
+
+ updateRecord() {
+ wx.showLoading({
+ title: '',
+ });
+ wx.cloud.callFunction({
+ name: 'quickstartFunctions',
+ config: {
+ env: this.data.envId
+ },
+ data: {
+ type: 'updateRecord',
+ data: this.data.record
+ }
+ }).then((resp) => {
+ wx.navigateTo({
+ url: `/pages/updateRecordSuccess/index`,
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ this.setData({
+ showUploadTip: true
+ });
+ wx.hideLoading();
+ });
+ },
+
+ bindInput (e) {
+ const index = e.currentTarget.dataset.index;
+ const record = this.data.record;
+ record[index].sales = Number(e.detail.value);
+ this.setData({
+ record
+ });
+ },
+
+});
diff --git a/doc/project2/miniprogram/pages/updateRecordResult/index.json b/doc/project2/miniprogram/pages/updateRecordResult/index.json
new file mode 100644
index 0000000..d7969cb
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecordResult/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "更新记录",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/updateRecordResult/index.wxml b/doc/project2/miniprogram/pages/updateRecordResult/index.wxml
new file mode 100644
index 0000000..97ebbab
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecordResult/index.wxml
@@ -0,0 +1,21 @@
+
+ 体验更新字段记录能力,更新数据表中的销量数据。
+ 数据将展示在这里
+
+ 地区销量统计
+
+ 地域
+ 城市
+ 销量
+
+
+
+ {{item.region}}
+ {{item.city}}
+
+
+
+ 更新
+ 在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数,体验该能力
+
+
diff --git a/doc/project2/miniprogram/pages/updateRecordResult/index.wxss b/doc/project2/miniprogram/pages/updateRecordResult/index.wxss
new file mode 100644
index 0000000..95e89fa
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecordResult/index.wxss
@@ -0,0 +1,72 @@
+.tip {
+ font-size: 23rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: center;
+ margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: left;
+ margin-top: 30rpx;
+ margin-left: 20rpx;
+}
+
+.box_text {
+ background-color: white;
+ text-align: center;
+ padding: 300rpx 0;
+ margin-top: 30rpx;
+ color: rgba(0, 0, 0, 0.5);
+}
+
+.code_box {
+ text-align: center;
+ background-color: white;
+ margin-top: 30rpx;
+ padding: 17rpx;
+}
+
+.code_box_title {
+ color: rgba(0, 0, 0, 0.5);
+ font-size: 26rpx;
+ margin-bottom: 20rpx;
+ text-align: left;
+}
+
+.code_box_record {
+ display: flex;
+}
+
+.code_box_record_title {
+ width: 33%;
+ font-size: 26rpx;
+ color: rgba(0, 0, 0, 0.5);
+ padding: 20rpx 0;
+}
+
+.code_box_record_detail {
+ width: 33%;
+ font-size: 26rpx;
+ padding: 20rpx 0;
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 250rpx auto 0 auto;
+ height: 80rpx;
+ color: white;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: #07c160;
+}
+
+.line {
+ height: 1rpx;
+ width: 100%;
+ background-color: rgba(0, 0, 0, 0.1);
+}
diff --git a/doc/project2/miniprogram/pages/updateRecordSuccess/index.js b/doc/project2/miniprogram/pages/updateRecordSuccess/index.js
new file mode 100644
index 0000000..b4ebffd
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecordSuccess/index.js
@@ -0,0 +1,16 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ goBack() {
+ wx.navigateBack({
+ delta: 2
+ });
+ },
+
+});
diff --git a/doc/project2/miniprogram/pages/updateRecordSuccess/index.json b/doc/project2/miniprogram/pages/updateRecordSuccess/index.json
new file mode 100644
index 0000000..d7969cb
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecordSuccess/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "更新记录",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/updateRecordSuccess/index.wxml b/doc/project2/miniprogram/pages/updateRecordSuccess/index.wxml
new file mode 100644
index 0000000..297640c
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecordSuccess/index.wxml
@@ -0,0 +1,6 @@
+
+
+ 地区销量统计更新成功
+ 可在“云开发控制台>数据库>记录列表”中进行查看
+ 我知道了
+
diff --git a/doc/project2/miniprogram/pages/updateRecordSuccess/index.wxss b/doc/project2/miniprogram/pages/updateRecordSuccess/index.wxss
new file mode 100644
index 0000000..9334db1
--- /dev/null
+++ b/doc/project2/miniprogram/pages/updateRecordSuccess/index.wxss
@@ -0,0 +1,30 @@
+page {
+ text-align: center;
+}
+
+.icon {
+ margin: 80rpx 0 50rpx 0;
+}
+
+.title {
+ font-size: 42rpx;
+ font-weight: 600;
+ margin-bottom: 30rpx;
+}
+
+.info {
+ font-size: 36rpx;
+ width: 90%;
+ margin: 0 auto;
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 550rpx auto 0 auto;
+ height: 80rpx;
+ color: #07c160;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: rgba(0, 0, 0, 0.03);
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/uploadFile/index.js b/doc/project2/miniprogram/pages/uploadFile/index.js
new file mode 100644
index 0000000..b1ba60e
--- /dev/null
+++ b/doc/project2/miniprogram/pages/uploadFile/index.js
@@ -0,0 +1,58 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showUploadTip: false,
+ haveGetImgSrc: false,
+ envId: '',
+ imgSrc: ''
+ },
+
+ onLoad(options) {
+ this.setData({
+ envId: options.envId
+ });
+ },
+
+ uploadImg() {
+ wx.showLoading({
+ title: '',
+ });
+ // 让用户选择一张图片
+ wx.chooseImage({
+ count: 1,
+ success: chooseResult => {
+ // 将图片上传至云存储空间
+ wx.cloud.uploadFile({
+ // 指定上传到的云路径
+ cloudPath: 'my-photo.png',
+ // 指定要上传的文件的小程序临时文件路径
+ filePath: chooseResult.tempFilePaths[0],
+ config: {
+ env: this.data.envId
+ }
+ }).then(res => {
+ console.log('上传成功', res);
+ this.setData({
+ haveGetImgSrc: true,
+ imgSrc: res.fileID
+ });
+ wx.hideLoading();
+ }).catch((e) => {
+ console.log(e);
+ wx.hideLoading();
+ });
+ },
+ });
+ },
+
+ clearImgSrc() {
+ this.setData({
+ haveGetImgSrc: false,
+ imgSrc: ''
+ });
+ }
+
+});
diff --git a/doc/project2/miniprogram/pages/uploadFile/index.json b/doc/project2/miniprogram/pages/uploadFile/index.json
new file mode 100644
index 0000000..50b16bd
--- /dev/null
+++ b/doc/project2/miniprogram/pages/uploadFile/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "上传文件",
+ "usingComponents": {
+ "cloud-tip-modal": "/components/cloudTipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/miniprogram/pages/uploadFile/index.wxml b/doc/project2/miniprogram/pages/uploadFile/index.wxml
new file mode 100644
index 0000000..2eecd5c
--- /dev/null
+++ b/doc/project2/miniprogram/pages/uploadFile/index.wxml
@@ -0,0 +1,15 @@
+
+ 多存储类型,仅需一个云函数即可完成上传。
+ 上传的图片将展示在这里
+
+
+
+ 文件路径
+ {{imgSrc}}
+
+
+ 上传一张图片
+ 清空
+ 在“资源管理器>miniprogram>pages>uploadFile>index.js”找到相应代码,体验该能力
+
+
diff --git a/doc/project2/miniprogram/pages/uploadFile/index.wxss b/doc/project2/miniprogram/pages/uploadFile/index.wxss
new file mode 100644
index 0000000..c5c3b6a
--- /dev/null
+++ b/doc/project2/miniprogram/pages/uploadFile/index.wxss
@@ -0,0 +1,86 @@
+.tip {
+ font-size: 23rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: center;
+ margin: 30rpx auto 0 auto;
+}
+
+.top_tip {
+ font-size: 28rpx;
+ color: rgba(0, 0, 0, 0.5);
+ width: 90%;
+ text-align: left;
+ margin-top: 30rpx;
+ margin-left: 20rpx;
+}
+
+.box_text {
+ background-color: white;
+ text-align: center;
+ padding: 300rpx 0;
+ margin-top: 30rpx;
+ color: rgba(0, 0, 0, 0.5);
+}
+
+.code_box {
+ text-align: center;
+ background-color: white;
+ margin-top: 30rpx;
+ padding: 50rpx 0 17px 0;
+}
+
+.code_img {
+ width: 300rpx;
+ height: 300rpx;
+}
+
+.button {
+ width: 300rpx;
+ text-align: center;
+ margin: 20% auto 0 auto;
+ height: 80rpx;
+ color: white;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: #07c160;
+}
+
+.button_clear {
+ width: 300rpx;
+ text-align: center;
+ margin: 20% auto 0 auto;
+ height: 80rpx;
+ color: #07c160;
+ border-radius: 5px;
+ line-height: 80rpx;
+ background-color: rgba(0, 0, 0, 0.03);
+}
+
+.img_info {
+ padding-top: 16px;
+ width: 90%;
+ margin: 0 auto;
+ display: flex;
+ padding: 16rpx 0;
+ border-top: 0.5px solid #E5E5E5;
+ margin-top: 50rpx;
+}
+
+.img_info_title {
+ font-size: 14;
+ font-family: PingFang SC;
+ font-weight: 400;
+ color: #888888;
+ width: 72px;
+ margin-right: 32px;
+}
+
+.img_info_detail {
+ text-align: left;
+ font-size: 14;
+ font-family: PingFang SC;
+ font-weight: 400;
+ color: #000000;
+ width: 500rpx;
+}
diff --git a/doc/project2/miniprogram/sitemap.json b/doc/project2/miniprogram/sitemap.json
new file mode 100644
index 0000000..27b2b26
--- /dev/null
+++ b/doc/project2/miniprogram/sitemap.json
@@ -0,0 +1,7 @@
+{
+ "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+ "rules": [{
+ "action": "allow",
+ "page": "*"
+ }]
+}
\ No newline at end of file
diff --git a/doc/project2/project.config.json b/doc/project2/project.config.json
new file mode 100644
index 0000000..c46b368
--- /dev/null
+++ b/doc/project2/project.config.json
@@ -0,0 +1,79 @@
+{
+ "miniprogramRoot": "miniprogram/",
+ "cloudfunctionRoot": "cloudfunctions/",
+ "setting": {
+ "urlCheck": true,
+ "es6": true,
+ "enhance": true,
+ "postcss": true,
+ "preloadBackgroundData": false,
+ "minified": true,
+ "newFeature": true,
+ "coverView": true,
+ "nodeModules": false,
+ "autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
+ "uglifyFileName": false,
+ "checkInvalidKey": true,
+ "checkSiteMap": true,
+ "uploadWithSourceMap": true,
+ "compileHotReLoad": false,
+ "lazyloadPlaceholderEnable": false,
+ "useMultiFrameRuntime": true,
+ "useApiHook": true,
+ "useApiHostProcess": true,
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ },
+ "enableEngineNative": false,
+ "useIsolateContext": true,
+ "userConfirmedBundleSwitch": false,
+ "packNpmManually": false,
+ "packNpmRelationList": [],
+ "minifyWXSS": true,
+ "disableUseStrict": false,
+ "showES6CompileOption": false,
+ "useCompilerPlugins": false,
+ "minifyWXML": true
+ },
+ "appid": "wx514d5355fe8a8894",
+ "projectname": "quickstart-wx-cloud",
+ "libVersion": "2.14.1",
+ "cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
+ "condition": {
+ "search": {
+ "list": []
+ },
+ "conversation": {
+ "list": []
+ },
+ "plugin": {
+ "list": []
+ },
+ "game": {
+ "list": []
+ },
+ "miniprogram": {
+ "list": [
+ {
+ "id": -1,
+ "name": "db guide",
+ "pathName": "pages/databaseGuide/databaseGuide"
+ }
+ ]
+ }
+ },
+ "srcMiniprogramRoot": "miniprogram/",
+ "compileType": "miniprogram",
+ "packOptions": {
+ "ignore": [],
+ "include": []
+ },
+ "editorSetting": {
+ "tabIndent": "insertSpaces",
+ "tabSize": 4
+ }
+}
\ No newline at end of file
diff --git a/doc/project2/project.private.config.json b/doc/project2/project.private.config.json
new file mode 100644
index 0000000..9c4486c
--- /dev/null
+++ b/doc/project2/project.private.config.json
@@ -0,0 +1,60 @@
+{
+ "setting": {
+ "compileHotReLoad": true
+ },
+ "condition": {
+ "miniprogram": {
+ "list": [
+ {
+ "name": "db guide",
+ "pathName": "pages/databaseGuide/databaseGuide",
+ "query": ""
+ },
+ {
+ "name": "pages/getOpenId/index",
+ "pathName": "pages/getOpenId/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/deployService/index",
+ "pathName": "pages/deployService/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/selectRecord/index",
+ "pathName": "pages/selectRecord/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/sumRecordResult/index",
+ "pathName": "pages/sumRecordResult/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/updateRecord/index",
+ "pathName": "pages/updateRecord/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/updateRecordResult/index",
+ "pathName": "pages/updateRecordResult/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/updateRecordSuccess/index",
+ "pathName": "pages/updateRecordSuccess/index",
+ "query": "",
+ "scene": null
+ }
+ ]
+ }
+ },
+ "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+ "projectname": "project1"
+}
\ No newline at end of file
diff --git a/doc/project2/uploadCloudFunction.sh b/doc/project2/uploadCloudFunction.sh
new file mode 100644
index 0000000..df311b3
--- /dev/null
+++ b/doc/project2/uploadCloudFunction.sh
@@ -0,0 +1 @@
+${installPath} cloud functions deploy --e ${envId} --n quickstartFunctions --r --project ${projectPath}
\ No newline at end of file