diff --git a/a.txt b/a.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniprogram/app.js b/miniprogram/app.js new file mode 100644 index 0000000000000000000000000000000000000000..7642c60e951b163002c015ae2252f353d0925e8e --- /dev/null +++ b/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/miniprogram/app.json b/miniprogram/app.json new file mode 100644 index 0000000000000000000000000000000000000000..b0a530f0c9311a76c6d1a4ed9a184aa1f2742958 --- /dev/null +++ b/miniprogram/app.json @@ -0,0 +1,26 @@ +{ + "pages": [ + "pages/index/index", + "pages/demo1/demo1", + "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" + ], + "window": { + "backgroundColor": "#F6F6F6", + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#F6F6F6", + "navigationBarTitleText": "云开发 QuickStart", + "navigationBarTextStyle": "black" + }, + "sitemapLocation": "sitemap.json", + "style": "v2" +} \ No newline at end of file diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss new file mode 100644 index 0000000000000000000000000000000000000000..df96b0e9516ae508a23ea450c0254a90111f0925 --- /dev/null +++ b/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: #f6f6f6; + display: flex; + flex-direction: column; + justify-content: flex-start; +} \ No newline at end of file diff --git a/miniprogram/components/cloudTipModal/index.js b/miniprogram/components/cloudTipModal/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f5ca0c16d5c19e5d13d04d563a4c1d4d1fa0f2d4 --- /dev/null +++ b/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/miniprogram/components/cloudTipModal/index.json b/miniprogram/components/cloudTipModal/index.json new file mode 100644 index 0000000000000000000000000000000000000000..4575d1b8fadae381488ab3296b7a2e699a700a0a --- /dev/null +++ b/miniprogram/components/cloudTipModal/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "component": true +} \ No newline at end of file diff --git a/miniprogram/components/cloudTipModal/index.wxml b/miniprogram/components/cloudTipModal/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..bcfa71c51e49c6efe2a4d4d91925b815e8a6f780 --- /dev/null +++ b/miniprogram/components/cloudTipModal/index.wxml @@ -0,0 +1,14 @@ + + + + + + 体验前需部署云资源 + 请开启调试器进入终端窗口,复制并运行以下命令 + + {{tipText}} + 复制 + + 已执行命令 + + diff --git a/miniprogram/components/cloudTipModal/index.wxss b/miniprogram/components/cloudTipModal/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..ae36531c2ecd58384da3e8c6fa2a7780233271f0 --- /dev/null +++ b/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/miniprogram/envList.js b/miniprogram/envList.js new file mode 100644 index 0000000000000000000000000000000000000000..9f2471780201a89e627f6295b82492b39a962b7a --- /dev/null +++ b/miniprogram/envList.js @@ -0,0 +1,6 @@ +const envList = [{"envId":"cloud1-0gpva2y43faf949c","alias":"cloud1"}] +const isMac = false +module.exports = { + envList, + isMac +} \ No newline at end of file diff --git a/miniprogram/images/arrow.svg b/miniprogram/images/arrow.svg new file mode 100644 index 0000000000000000000000000000000000000000..cd32a7dad2afd881fa44b342b521e417ca1965fa --- /dev/null +++ b/miniprogram/images/arrow.svg @@ -0,0 +1,11 @@ + + + ☀ iOS/☀ 图标/线型/icons_outlined_arrow@3x + + + + + + + + \ No newline at end of file diff --git a/miniprogram/images/database.png b/miniprogram/images/database.png new file mode 100644 index 0000000000000000000000000000000000000000..d0499c13aa782ee5a02b1d5a898aa1ae8d4b8e58 Binary files /dev/null and b/miniprogram/images/database.png differ diff --git a/miniprogram/images/deploy_step1.png b/miniprogram/images/deploy_step1.png new file mode 100644 index 0000000000000000000000000000000000000000..738b71cc85cf13c2fdb4447066500700de543aa7 Binary files /dev/null and b/miniprogram/images/deploy_step1.png differ diff --git a/miniprogram/images/deploy_step2.png b/miniprogram/images/deploy_step2.png new file mode 100644 index 0000000000000000000000000000000000000000..d77faab0204c33972ff7e46a872469685a8c7daf Binary files /dev/null and b/miniprogram/images/deploy_step2.png differ diff --git a/miniprogram/images/img b/miniprogram/images/img new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniprogram/pages/createCollection/index.js b/miniprogram/pages/createCollection/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d98a4ce7da0b928b41500f06da819ddf7f6f3020 --- /dev/null +++ b/miniprogram/pages/createCollection/index.js @@ -0,0 +1,10 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + +}); diff --git a/miniprogram/pages/createCollection/index.json b/miniprogram/pages/createCollection/index.json new file mode 100644 index 0000000000000000000000000000000000000000..8835af0699ccec004cbe685ef938cd2d63ea7037 --- /dev/null +++ b/miniprogram/pages/createCollection/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/pages/createCollection/index.wxml b/miniprogram/pages/createCollection/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..fcec8c8f4c051acb7de1c930c32752b8dca67cf1 --- /dev/null +++ b/miniprogram/pages/createCollection/index.wxml @@ -0,0 +1,7 @@ + + 功能介绍 + 集合为常用数据库中表的概念。云开发数据库支持自动备份、无损回档,并且QPS高达3千+。 + 如何体验 + 已自动创建名为“sales”的体验合集,可打开“云开发控制台>数据库>记录列表”中找到该集合。 + + diff --git a/miniprogram/pages/createCollection/index.wxss b/miniprogram/pages/createCollection/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..d89d5f0b147a1fb99d4cb661d8898fe7bcfa73f7 --- /dev/null +++ b/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/miniprogram/pages/demo1/demo1.js b/miniprogram/pages/demo1/demo1.js new file mode 100644 index 0000000000000000000000000000000000000000..14874ebb023181030e7d793bcfc8f07e1e5b4a04 --- /dev/null +++ b/miniprogram/pages/demo1/demo1.js @@ -0,0 +1,66 @@ +// pages/demo1/demo1.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/demo1/demo1.json b/miniprogram/pages/demo1/demo1.json new file mode 100644 index 0000000000000000000000000000000000000000..8835af0699ccec004cbe685ef938cd2d63ea7037 --- /dev/null +++ b/miniprogram/pages/demo1/demo1.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/pages/demo1/demo1.wxml b/miniprogram/pages/demo1/demo1.wxml new file mode 100644 index 0000000000000000000000000000000000000000..e7311ce3f8ae2718bb99defa0591b299187687a7 --- /dev/null +++ b/miniprogram/pages/demo1/demo1.wxml @@ -0,0 +1,2 @@ + +pages/demo1/demo1.wxml diff --git a/miniprogram/pages/demo1/demo1.wxss b/miniprogram/pages/demo1/demo1.wxss new file mode 100644 index 0000000000000000000000000000000000000000..157fd8fd468b782eb5ac0e063381409f03203467 --- /dev/null +++ b/miniprogram/pages/demo1/demo1.wxss @@ -0,0 +1 @@ +/* pages/demo1/demo1.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/deployService/index.js b/miniprogram/pages/deployService/index.js new file mode 100644 index 0000000000000000000000000000000000000000..133cd5d36ee19f777813ed8a45628e5fec2583cb --- /dev/null +++ b/miniprogram/pages/deployService/index.js @@ -0,0 +1,11 @@ +// miniprogram/pages/deployService/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + +}); diff --git a/miniprogram/pages/deployService/index.json b/miniprogram/pages/deployService/index.json new file mode 100644 index 0000000000000000000000000000000000000000..8835af0699ccec004cbe685ef938cd2d63ea7037 --- /dev/null +++ b/miniprogram/pages/deployService/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/pages/deployService/index.wxml b/miniprogram/pages/deployService/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..11469e30415dbb29e6295247a39f02a7f3690400 --- /dev/null +++ b/miniprogram/pages/deployService/index.wxml @@ -0,0 +1,3 @@ + + +nihao \ No newline at end of file diff --git a/miniprogram/pages/deployService/index.wxss b/miniprogram/pages/deployService/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniprogram/pages/getMiniProgramCode/index.js b/miniprogram/pages/getMiniProgramCode/index.js new file mode 100644 index 0000000000000000000000000000000000000000..75328ae703af7abaf6a21e4031dcbeac46912c45 --- /dev/null +++ b/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/miniprogram/pages/getMiniProgramCode/index.json b/miniprogram/pages/getMiniProgramCode/index.json new file mode 100644 index 0000000000000000000000000000000000000000..73fa86058f3e532de17a4114e03a8ab6c380c6c6 --- /dev/null +++ b/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/miniprogram/pages/getMiniProgramCode/index.wxml b/miniprogram/pages/getMiniProgramCode/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..df1b529abf6e19ba7d0f8035eed484284e5cedfd --- /dev/null +++ b/miniprogram/pages/getMiniProgramCode/index.wxml @@ -0,0 +1,11 @@ + + 可通过云函数免接口调用凭证,直接生成小程序码。 + 小程序码将展示在这里 + + + + 生成小程序码 + 清空 + 在”资源管理器>cloudfunctions>quickstartFunctions>getMiniProgramCode>index.js“找到获取小程序码函数,体验该能力 + + diff --git a/miniprogram/pages/getMiniProgramCode/index.wxss b/miniprogram/pages/getMiniProgramCode/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..3557c79f911a6f1aa427eb59869a62a31b04ccdb --- /dev/null +++ b/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/miniprogram/pages/getOpenId/index.js b/miniprogram/pages/getOpenId/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a8927bcec9b851ba380dfdaccb3d2d95652f816e --- /dev/null +++ b/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/miniprogram/pages/getOpenId/index.json b/miniprogram/pages/getOpenId/index.json new file mode 100644 index 0000000000000000000000000000000000000000..899024b7a20d70c8660652abe02857f98c42e3dd --- /dev/null +++ b/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/miniprogram/pages/getOpenId/index.wxml b/miniprogram/pages/getOpenId/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..6f011cc7304a08415d69f78968eb22d293b127db --- /dev/null +++ b/miniprogram/pages/getOpenId/index.wxml @@ -0,0 +1,8 @@ + + 无需维护鉴权机制及登录票据,仅一行代码即可获得。 + {{ openId ? openId : 'OpenID将展示在这里' }} + 获取OpenId + 清空 + 在”资源管理器>cloudfunctions>quickstartFunctions>getOpenId>index.js“找到获取openId函数,体验该能力 + + diff --git a/miniprogram/pages/getOpenId/index.wxss b/miniprogram/pages/getOpenId/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..596c65de7821e089230eff0983f567b83de6944a --- /dev/null +++ b/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/miniprogram/pages/index/bg.png b/miniprogram/pages/index/bg.png new file mode 100644 index 0000000000000000000000000000000000000000..5a11f5d606d6fd065433c4fdd7daf26333b63e6e Binary files /dev/null and b/miniprogram/pages/index/bg.png differ diff --git a/miniprogram/pages/index/img b/miniprogram/pages/index/img new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniprogram/pages/index/img.png b/miniprogram/pages/index/img.png new file mode 100644 index 0000000000000000000000000000000000000000..dc4c81e120e2a92a2f6484b72157a7e206c6debe Binary files /dev/null and b/miniprogram/pages/index/img.png differ diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a778310750a447109eeabe2f7b9d6248a527588b --- /dev/null +++ b/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/miniprogram/pages/index/index.json b/miniprogram/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..3ea14348dc51847524e79e41bd500edd1c4d5729 --- /dev/null +++ b/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/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..096e66cf9e99878f3d7dd923179e121b734ee8c6 --- /dev/null +++ b/miniprogram/pages/index/index.wxml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + 注册账号 忘记密码 + + + + diff --git a/miniprogram/pages/index/index.wxss b/miniprogram/pages/index/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99e64b59bd92af3918017343e2f6ecebf4f0e8f4 --- /dev/null +++ b/miniprogram/pages/index/index.wxss @@ -0,0 +1,97 @@ +.bg { + height: 100vh; + width: 100vw; + position: fixed; + background-image: url(https://i.loli.net/2021/10/22/GYrSU78WzZCXHDO.png); +} + +.block { + height: 60vh; + width: 80vw; + background-color: rgb(236, 229, 229); + margin-left: 10vw; + margin-top: 20vh; + border-radius: 40rpx; +} + + +.denglu { + height: 6vh; + width: 5vw; + background-color: rgb(162, 253, 26); + margin-top: 68vh; + border-radius: 40rpx; + font-weight: 100; +} + +.yonghuming { + height: 5vh; + width: 44vw; + + margin-left: 5vw; + + +} + +.kuangneizhaopian { + height: 29vh; + width: 60vw; + margin-left: 10vw; +} + +.ziseyuanbian1 { + border: 2rpx ; + border-radius: 40rpx; + width: 60vw; + margin: auto; + margin-top: 1vh; +} +.ziseyuanbian2{ + width: 60vw; + height: 6vh; + margin: auto; + margin-top: 1vh; +} +.tubiao1 { + align-items: center; + display: flex; + border: 2rpx solid; + color: purple; + border-radius: 40rpx; + height: 38px; + +} +.tubiao2{ + align-items: center; + display: flex; + border: 2rpx solid; + color: purple; + border-radius: 40rpx; + height: 38px; +} +.tubiao-1de{ + width: 8vw; + height: 4vh; + margin-left: 20px; +} + +.tubiao-2de{ + width: 8vw; + height: 4vh; + margin-left: 20px; +} + +.mima { + margin-left:5vw ; +} +.xiaoyuanquan{ + +} +.zhucezhanghao{ + color: purple; + margin-left: 85px; + margin-top: 8vh; +} +.checkbox{ + margin-left: 49px; +} \ No newline at end of file diff --git a/miniprogram/pages/index/lock_icon.png b/miniprogram/pages/index/lock_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce9a3122da4a2193b9e8d9bcdcd0229f3ea1e68a Binary files /dev/null and b/miniprogram/pages/index/lock_icon.png differ diff --git a/miniprogram/pages/index/user_icno.png b/miniprogram/pages/index/user_icno.png new file mode 100644 index 0000000000000000000000000000000000000000..def107a5107d486cd68b9cfd3f40499181dcb14c Binary files /dev/null and b/miniprogram/pages/index/user_icno.png differ diff --git a/miniprogram/pages/selectRecord/index.js b/miniprogram/pages/selectRecord/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fe00c3e6ca273ca9bbe273c1cfc4bd73ca5cb7b5 --- /dev/null +++ b/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/miniprogram/pages/selectRecord/index.json b/miniprogram/pages/selectRecord/index.json new file mode 100644 index 0000000000000000000000000000000000000000..a85acd96bde75d2a76b6d303043d5479e4fae5eb --- /dev/null +++ b/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/miniprogram/pages/selectRecord/index.wxml b/miniprogram/pages/selectRecord/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..78dd8fcbe1cb4942f209d3aa46915a57585db751 --- /dev/null +++ b/miniprogram/pages/selectRecord/index.wxml @@ -0,0 +1,22 @@ + + 体验查询记录能力,查询数据表中的销量数据。 + 销量数据将展示在这里 + + 地区销量统计 + + 地域 + 城市 + 销量 + + + + {{item.region}} + {{item.city}} + {{item.sales}} + + + 查询记录 + 清空 + 在”资源管理器>cloudfunctions>quickstartFunctions>selectRecord>index.js“找到查询记录函数,体验该能力 + + diff --git a/miniprogram/pages/selectRecord/index.wxss b/miniprogram/pages/selectRecord/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..76652f4accf5b1b2b35dc6d57b6c6801882fadc6 --- /dev/null +++ b/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/miniprogram/pages/sumRecord/index.js b/miniprogram/pages/sumRecord/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4ee28ce84d91195f5756513d256a57f70ce843c6 --- /dev/null +++ b/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/miniprogram/pages/sumRecord/index.json b/miniprogram/pages/sumRecord/index.json new file mode 100644 index 0000000000000000000000000000000000000000..b2e58f018178c5a5a71941f68012d1cdf81e7271 --- /dev/null +++ b/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/miniprogram/pages/sumRecord/index.wxml b/miniprogram/pages/sumRecord/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..467c63be7ee4dc202da1903e17bd3a0f547839e7 --- /dev/null +++ b/miniprogram/pages/sumRecord/index.wxml @@ -0,0 +1,21 @@ + + 常用数据库中的groupby操作,体验按地域聚合数据。 + 数据将展示在这里 + + 地区销量统计 + + 地域 + 城市 + 销量 + + + + {{item.region}} + {{item.city}} + {{item.sales}} + + + 聚合记录 + 在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数,体验该能力 + + diff --git a/miniprogram/pages/sumRecord/index.wxss b/miniprogram/pages/sumRecord/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..02d552765012931b291bd437cd42e24c2679cd29 --- /dev/null +++ b/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/miniprogram/pages/sumRecordResult/index.js b/miniprogram/pages/sumRecordResult/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d2dcc09252d178df47bfccae1dde3c7ec6c5bc03 --- /dev/null +++ b/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/miniprogram/pages/sumRecordResult/index.json b/miniprogram/pages/sumRecordResult/index.json new file mode 100644 index 0000000000000000000000000000000000000000..b2e58f018178c5a5a71941f68012d1cdf81e7271 --- /dev/null +++ b/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/miniprogram/pages/sumRecordResult/index.wxml b/miniprogram/pages/sumRecordResult/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..2e32aacf56d304674f21675496f4fcfa9d853040 --- /dev/null +++ b/miniprogram/pages/sumRecordResult/index.wxml @@ -0,0 +1,19 @@ + + 常用数据库中的groupby操作,体验按地域聚合数据。 + 数据将展示在这里 + + 地区销量统计 + + 地域 + 销量 + + + + {{item._id}} + {{item.sum}} + + + 返回上一步 + 在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数,体验该能力 + + diff --git a/miniprogram/pages/sumRecordResult/index.wxss b/miniprogram/pages/sumRecordResult/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..49ba9e3f2da222289bdfec6ce1e26025b38d02e0 --- /dev/null +++ b/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/miniprogram/pages/updateRecord/index.js b/miniprogram/pages/updateRecord/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e27c4c8b94ad4c62ec3e6ed37a35b9145a0fb57b --- /dev/null +++ b/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/miniprogram/pages/updateRecord/index.json b/miniprogram/pages/updateRecord/index.json new file mode 100644 index 0000000000000000000000000000000000000000..d7969cb39f0522486213475eb343c2a8f6652996 --- /dev/null +++ b/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/miniprogram/pages/updateRecord/index.wxml b/miniprogram/pages/updateRecord/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..4a62aa6ec998f167d273bebc510ac8b8150dd6e1 --- /dev/null +++ b/miniprogram/pages/updateRecord/index.wxml @@ -0,0 +1,21 @@ + + 体验更新字段记录能力,更新数据表中的销量数据。 + 数据将展示在这里 + + 地区销量统计 + + 地域 + 城市 + 销量 + + + + {{item.region}} + {{item.city}} + {{item.sales}} + + + 修改数据 + 在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数,体验该能力 + + diff --git a/miniprogram/pages/updateRecord/index.wxss b/miniprogram/pages/updateRecord/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..02d552765012931b291bd437cd42e24c2679cd29 --- /dev/null +++ b/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/miniprogram/pages/updateRecordResult/index.js b/miniprogram/pages/updateRecordResult/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a200e6e0cdd5203b619f16a78729efd8a4d45feb --- /dev/null +++ b/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/miniprogram/pages/updateRecordResult/index.json b/miniprogram/pages/updateRecordResult/index.json new file mode 100644 index 0000000000000000000000000000000000000000..d7969cb39f0522486213475eb343c2a8f6652996 --- /dev/null +++ b/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/miniprogram/pages/updateRecordResult/index.wxml b/miniprogram/pages/updateRecordResult/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..97ebbab69ed2479d1b2c9f8c23c60dd24e658847 --- /dev/null +++ b/miniprogram/pages/updateRecordResult/index.wxml @@ -0,0 +1,21 @@ + + 体验更新字段记录能力,更新数据表中的销量数据。 + 数据将展示在这里 + + 地区销量统计 + + 地域 + 城市 + 销量 + + + + {{item.region}} + {{item.city}} + + + + 更新 + 在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数,体验该能力 + + diff --git a/miniprogram/pages/updateRecordResult/index.wxss b/miniprogram/pages/updateRecordResult/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..95e89fab656e2ec58ee475b69917279feed2f6db --- /dev/null +++ b/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/miniprogram/pages/updateRecordSuccess/index.js b/miniprogram/pages/updateRecordSuccess/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b4ebffdb558bd8795fb813afe1a8da740f24e436 --- /dev/null +++ b/miniprogram/pages/updateRecordSuccess/index.js @@ -0,0 +1,16 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + goBack() { + wx.navigateBack({ + delta: 2 + }); + }, + +}); diff --git a/miniprogram/pages/updateRecordSuccess/index.json b/miniprogram/pages/updateRecordSuccess/index.json new file mode 100644 index 0000000000000000000000000000000000000000..d7969cb39f0522486213475eb343c2a8f6652996 --- /dev/null +++ b/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/miniprogram/pages/updateRecordSuccess/index.wxml b/miniprogram/pages/updateRecordSuccess/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..297640ce95050d87f53ea075117b7914c6eebfa9 --- /dev/null +++ b/miniprogram/pages/updateRecordSuccess/index.wxml @@ -0,0 +1,6 @@ + + + 地区销量统计更新成功 + 可在“云开发控制台>数据库>记录列表”中进行查看 + 我知道了 + diff --git a/miniprogram/pages/updateRecordSuccess/index.wxss b/miniprogram/pages/updateRecordSuccess/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9334db17bcf303d959fdac4e3832688754722e10 --- /dev/null +++ b/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/miniprogram/pages/uploadFile/index.js b/miniprogram/pages/uploadFile/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b1ba60e7daaee86f5924d1adcfc9c16874931f9e --- /dev/null +++ b/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/miniprogram/pages/uploadFile/index.json b/miniprogram/pages/uploadFile/index.json new file mode 100644 index 0000000000000000000000000000000000000000..50b16bd8bf5575daf00770916d334819374e7712 --- /dev/null +++ b/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/miniprogram/pages/uploadFile/index.wxml b/miniprogram/pages/uploadFile/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..2eecd5cb818de359f27abeba97122b1b94b40448 --- /dev/null +++ b/miniprogram/pages/uploadFile/index.wxml @@ -0,0 +1,15 @@ + + 多存储类型,仅需一个云函数即可完成上传。 + 上传的图片将展示在这里 + + + + 文件路径 + {{imgSrc}} + + + 上传一张图片 + 清空 + 在“资源管理器>miniprogram>pages>uploadFile>index.js”找到相应代码,体验该能力 + + diff --git a/miniprogram/pages/uploadFile/index.wxss b/miniprogram/pages/uploadFile/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c5c3b6a70aae535b94f9f54b077bc28e8ff41c2e --- /dev/null +++ b/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/miniprogram/sitemap.json b/miniprogram/sitemap.json new file mode 100644 index 0000000000000000000000000000000000000000..27b2b26d379bc328ebf87b99d643ac2d374e0730 --- /dev/null +++ b/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