From 1d226ec5ce0a84c33729ef83a9b15d5913d70e9c Mon Sep 17 00:00:00 2001 From: yma16 <17685043634@163.com> Date: Mon, 1 Aug 2022 21:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/app.js | 70 +++++- miniprogram/app.json | 22 +- miniprogram/app.wxss | 7 +- miniprogram/pages/blog/blog.js | 66 ++++++ .../index.json => blog/blog.json} | 0 miniprogram/pages/blog/blog.wxml | 2 + miniprogram/pages/blog/blog.wxss | 1 + miniprogram/pages/createCollection/index.js | 10 - miniprogram/pages/createCollection/index.wxml | 7 - miniprogram/pages/createCollection/index.wxss | 29 --- miniprogram/pages/deployService/index.js | 11 - miniprogram/pages/deployService/index.wxml | 10 - miniprogram/pages/deployService/index.wxss | 30 --- miniprogram/pages/future/future.js | 66 ++++++ .../index.json => future/future.json} | 0 miniprogram/pages/future/future.wxml | 2 + miniprogram/pages/future/future.wxss | 1 + miniprogram/pages/getMiniProgramCode/index.js | 53 ----- .../pages/getMiniProgramCode/index.json | 6 - .../pages/getMiniProgramCode/index.wxml | 11 - .../pages/getMiniProgramCode/index.wxss | 58 ----- miniprogram/pages/getOpenId/index.js | 52 ----- miniprogram/pages/getOpenId/index.json | 6 - miniprogram/pages/getOpenId/index.wxml | 8 - miniprogram/pages/getOpenId/index.wxss | 46 ---- miniprogram/pages/home/home.js | 130 +++++++++++ miniprogram/pages/home/home.json | 8 + miniprogram/pages/home/home.wxml | 42 ++++ miniprogram/pages/home/home.wxss | 152 ++++++++++++ miniprogram/pages/homeContent/homeContent.js | 84 +++++++ .../pages/homeContent/homeContent.json | 5 + .../pages/homeContent/homeContent.wxml | 8 + .../pages/homeContent/homeContent.wxss | 8 + miniprogram/pages/index/index.js | 219 ++++++++---------- miniprogram/pages/index/index.wxml | 17 +- miniprogram/pages/index/index.wxss | 37 ++- miniprogram/pages/life/life.js | 66 ++++++ miniprogram/pages/life/life.json | 3 + miniprogram/pages/life/life.wxml | 2 + miniprogram/pages/life/life.wxss | 1 + miniprogram/pages/selectRecord/index.js | 53 ----- miniprogram/pages/selectRecord/index.json | 6 - miniprogram/pages/selectRecord/index.wxml | 22 -- miniprogram/pages/selectRecord/index.wxss | 83 ------- miniprogram/pages/sumRecord/index.js | 48 ---- miniprogram/pages/sumRecord/index.json | 6 - miniprogram/pages/sumRecord/index.wxml | 21 -- miniprogram/pages/sumRecord/index.wxss | 83 ------- miniprogram/pages/sumRecordResult/index.js | 46 ---- miniprogram/pages/sumRecordResult/index.json | 6 - miniprogram/pages/sumRecordResult/index.wxml | 19 -- miniprogram/pages/sumRecordResult/index.wxss | 73 ------ miniprogram/pages/updateRecord/index.js | 51 ---- miniprogram/pages/updateRecord/index.json | 6 - miniprogram/pages/updateRecord/index.wxml | 21 -- miniprogram/pages/updateRecord/index.wxss | 83 ------- miniprogram/pages/updateRecordResult/index.js | 78 ------- .../pages/updateRecordResult/index.json | 6 - .../pages/updateRecordResult/index.wxml | 21 -- .../pages/updateRecordResult/index.wxss | 72 ------ .../pages/updateRecordSuccess/index.js | 16 -- .../pages/updateRecordSuccess/index.json | 6 - .../pages/updateRecordSuccess/index.wxml | 6 - .../pages/updateRecordSuccess/index.wxss | 30 --- miniprogram/pages/uploadFile/index.js | 58 ----- miniprogram/pages/uploadFile/index.json | 6 - miniprogram/pages/uploadFile/index.wxml | 15 -- miniprogram/pages/uploadFile/index.wxss | 86 ------- miniprogram/towxml | 1 + project.config.json | 6 +- 70 files changed, 875 insertions(+), 1515 deletions(-) create mode 100644 miniprogram/pages/blog/blog.js rename miniprogram/pages/{createCollection/index.json => blog/blog.json} (100%) create mode 100644 miniprogram/pages/blog/blog.wxml create mode 100644 miniprogram/pages/blog/blog.wxss delete mode 100644 miniprogram/pages/createCollection/index.js delete mode 100644 miniprogram/pages/createCollection/index.wxml delete mode 100644 miniprogram/pages/createCollection/index.wxss delete mode 100644 miniprogram/pages/deployService/index.js delete mode 100644 miniprogram/pages/deployService/index.wxml delete mode 100644 miniprogram/pages/deployService/index.wxss create mode 100644 miniprogram/pages/future/future.js rename miniprogram/pages/{deployService/index.json => future/future.json} (100%) create mode 100644 miniprogram/pages/future/future.wxml create mode 100644 miniprogram/pages/future/future.wxss delete mode 100644 miniprogram/pages/getMiniProgramCode/index.js delete mode 100644 miniprogram/pages/getMiniProgramCode/index.json delete mode 100644 miniprogram/pages/getMiniProgramCode/index.wxml delete mode 100644 miniprogram/pages/getMiniProgramCode/index.wxss delete mode 100644 miniprogram/pages/getOpenId/index.js delete mode 100644 miniprogram/pages/getOpenId/index.json delete mode 100644 miniprogram/pages/getOpenId/index.wxml delete mode 100644 miniprogram/pages/getOpenId/index.wxss create mode 100644 miniprogram/pages/home/home.js create mode 100644 miniprogram/pages/home/home.json create mode 100644 miniprogram/pages/home/home.wxml create mode 100644 miniprogram/pages/home/home.wxss create mode 100644 miniprogram/pages/homeContent/homeContent.js create mode 100644 miniprogram/pages/homeContent/homeContent.json create mode 100644 miniprogram/pages/homeContent/homeContent.wxml create mode 100644 miniprogram/pages/homeContent/homeContent.wxss create mode 100644 miniprogram/pages/life/life.js create mode 100644 miniprogram/pages/life/life.json create mode 100644 miniprogram/pages/life/life.wxml create mode 100644 miniprogram/pages/life/life.wxss delete mode 100644 miniprogram/pages/selectRecord/index.js delete mode 100644 miniprogram/pages/selectRecord/index.json delete mode 100644 miniprogram/pages/selectRecord/index.wxml delete mode 100644 miniprogram/pages/selectRecord/index.wxss delete mode 100644 miniprogram/pages/sumRecord/index.js delete mode 100644 miniprogram/pages/sumRecord/index.json delete mode 100644 miniprogram/pages/sumRecord/index.wxml delete mode 100644 miniprogram/pages/sumRecord/index.wxss delete mode 100644 miniprogram/pages/sumRecordResult/index.js delete mode 100644 miniprogram/pages/sumRecordResult/index.json delete mode 100644 miniprogram/pages/sumRecordResult/index.wxml delete mode 100644 miniprogram/pages/sumRecordResult/index.wxss delete mode 100644 miniprogram/pages/updateRecord/index.js delete mode 100644 miniprogram/pages/updateRecord/index.json delete mode 100644 miniprogram/pages/updateRecord/index.wxml delete mode 100644 miniprogram/pages/updateRecord/index.wxss delete mode 100644 miniprogram/pages/updateRecordResult/index.js delete mode 100644 miniprogram/pages/updateRecordResult/index.json delete mode 100644 miniprogram/pages/updateRecordResult/index.wxml delete mode 100644 miniprogram/pages/updateRecordResult/index.wxss delete mode 100644 miniprogram/pages/updateRecordSuccess/index.js delete mode 100644 miniprogram/pages/updateRecordSuccess/index.json delete mode 100644 miniprogram/pages/updateRecordSuccess/index.wxml delete mode 100644 miniprogram/pages/updateRecordSuccess/index.wxss delete mode 100644 miniprogram/pages/uploadFile/index.js delete mode 100644 miniprogram/pages/uploadFile/index.json delete mode 100644 miniprogram/pages/uploadFile/index.wxml delete mode 100644 miniprogram/pages/uploadFile/index.wxss create mode 160000 miniprogram/towxml diff --git a/miniprogram/app.js b/miniprogram/app.js index 7642c60..0657238 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -1,6 +1,20 @@ // app.js App({ - onLaunch: function () { + getUserProfile: function (e) { + // 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认 + // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 + wx.getUserProfile({ + desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 + success: (res) => { + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + } + }) + }, + onLaunch: function (options) { + console.log('start') if (!wx.cloud) { console.error('请使用 2.2.3 或以上的基础库以使用云能力'); } else { @@ -13,7 +27,59 @@ App({ traceUser: true, }); } + // 用户授权 + wx.getUserProfile({ + desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 + success: (res) => { + console.info('用户授权', res) + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + } + }) - this.globalData = {}; + // 用户登录 + let host = "https://example.com/onLogin" + wx.login({ + success(res) { + console.log('res login', res) + console.log('res code', res.code) + // if (res.code) { + // //发起网络请求 + // wx.request({ + // url: host, + // data: { + // code: res.code + // } + // }) + // } else { + // console.log('登录失败!' + res.errMsg) + // } + } + }) + + + let setting = null; + wx.getSetting({ + success(res) { + setting = res + console.log('res', res) + } + }) + + this.globalData = { setting: setting }; + console.log('onLaunch', options) + }, + onShow(options) { + // Do something when show. + console.info('show', options) + }, + onHide(options) { + console.info('onHide', options) + // Do something when hide. + }, + onError(msg) { + console.log('error', msg) } }); diff --git a/miniprogram/app.json b/miniprogram/app.json index 9d1e260..322eec2 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -1,24 +1,18 @@ { "pages": [ "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/home/home", + "pages/homeContent/homeContent", + "pages/blog/blog", + "pages/life/life", + "pages/future/future" ], "window": { "backgroundColor": "#F6F6F6", "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#F6F6F6", - "navigationBarTitleText": "云开发 QuickStart", - "navigationBarTextStyle": "black" + "navigationBarBackgroundColor": "#262626", + "navigationBarTitleText": "阳光罐里的日记", + "navigationBarTextStyle": "white" }, "sitemapLocation": "sitemap.json", "style": "v2", diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss index df96b0e..ab1bfbb 100644 --- a/miniprogram/app.wxss +++ b/miniprogram/app.wxss @@ -4,17 +4,18 @@ flex-direction: column; align-items: center; box-sizing: border-box; -} + color: #fff; +} button { background: initial; } -button:focus{ +button:focus { outline: 0; } -button::after{ +button::after { border: none; } diff --git a/miniprogram/pages/blog/blog.js b/miniprogram/pages/blog/blog.js new file mode 100644 index 0000000..a4409f9 --- /dev/null +++ b/miniprogram/pages/blog/blog.js @@ -0,0 +1,66 @@ +// pages/blog/blog.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/createCollection/index.json b/miniprogram/pages/blog/blog.json similarity index 100% rename from miniprogram/pages/createCollection/index.json rename to miniprogram/pages/blog/blog.json diff --git a/miniprogram/pages/blog/blog.wxml b/miniprogram/pages/blog/blog.wxml new file mode 100644 index 0000000..98446b4 --- /dev/null +++ b/miniprogram/pages/blog/blog.wxml @@ -0,0 +1,2 @@ + +pages/blog/blog.wxml diff --git a/miniprogram/pages/blog/blog.wxss b/miniprogram/pages/blog/blog.wxss new file mode 100644 index 0000000..f85709a --- /dev/null +++ b/miniprogram/pages/blog/blog.wxss @@ -0,0 +1 @@ +/* pages/blog/blog.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/createCollection/index.js b/miniprogram/pages/createCollection/index.js deleted file mode 100644 index d98a4ce..0000000 --- a/miniprogram/pages/createCollection/index.js +++ /dev/null @@ -1,10 +0,0 @@ -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - -}); diff --git a/miniprogram/pages/createCollection/index.wxml b/miniprogram/pages/createCollection/index.wxml deleted file mode 100644 index fcec8c8..0000000 --- a/miniprogram/pages/createCollection/index.wxml +++ /dev/null @@ -1,7 +0,0 @@ - - 功能介绍 - 集合为常用数据库中表的概念。云开发数据库支持自动备份、无损回档,并且QPS高达3千+。 - 如何体验 - 已自动创建名为“sales”的体验合集,可打开“云开发控制台>数据库>记录列表”中找到该集合。 - - diff --git a/miniprogram/pages/createCollection/index.wxss b/miniprogram/pages/createCollection/index.wxss deleted file mode 100644 index d89d5f0..0000000 --- a/miniprogram/pages/createCollection/index.wxss +++ /dev/null @@ -1,29 +0,0 @@ -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/deployService/index.js b/miniprogram/pages/deployService/index.js deleted file mode 100644 index 133cd5d..0000000 --- a/miniprogram/pages/deployService/index.js +++ /dev/null @@ -1,11 +0,0 @@ -// miniprogram/pages/deployService/index.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - -}); diff --git a/miniprogram/pages/deployService/index.wxml b/miniprogram/pages/deployService/index.wxml deleted file mode 100644 index 476e764..0000000 --- a/miniprogram/pages/deployService/index.wxml +++ /dev/null @@ -1,10 +0,0 @@ - - - 功能介绍 - 云托管是全托管的容器服务,支持任何语言及框架运行,只需将已有业务代码打包上传,即可快速迁移。 - 如何体验 - 步骤一:切换按量付费,打开“云开发控制台>设置>环境设置”找到按量付费,点击切换。 - - 步骤二:开通云托管,体验相关能力 - - diff --git a/miniprogram/pages/deployService/index.wxss b/miniprogram/pages/deployService/index.wxss deleted file mode 100644 index aa739a0..0000000 --- a/miniprogram/pages/deployService/index.wxss +++ /dev/null @@ -1,30 +0,0 @@ -/* 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/miniprogram/pages/future/future.js b/miniprogram/pages/future/future.js new file mode 100644 index 0000000..15da2d4 --- /dev/null +++ b/miniprogram/pages/future/future.js @@ -0,0 +1,66 @@ +// pages/future/future.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/deployService/index.json b/miniprogram/pages/future/future.json similarity index 100% rename from miniprogram/pages/deployService/index.json rename to miniprogram/pages/future/future.json diff --git a/miniprogram/pages/future/future.wxml b/miniprogram/pages/future/future.wxml new file mode 100644 index 0000000..2fffdc2 --- /dev/null +++ b/miniprogram/pages/future/future.wxml @@ -0,0 +1,2 @@ + +pages/future/future.wxml diff --git a/miniprogram/pages/future/future.wxss b/miniprogram/pages/future/future.wxss new file mode 100644 index 0000000..1ad5f1c --- /dev/null +++ b/miniprogram/pages/future/future.wxss @@ -0,0 +1 @@ +/* pages/future/future.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/getMiniProgramCode/index.js b/miniprogram/pages/getMiniProgramCode/index.js deleted file mode 100644 index 75328ae..0000000 --- a/miniprogram/pages/getMiniProgramCode/index.js +++ /dev/null @@ -1,53 +0,0 @@ -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 deleted file mode 100644 index 73fa860..0000000 --- a/miniprogram/pages/getMiniProgramCode/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index df1b529..0000000 --- a/miniprogram/pages/getMiniProgramCode/index.wxml +++ /dev/null @@ -1,11 +0,0 @@ - - 可通过云函数免接口调用凭证,直接生成小程序码。 - 小程序码将展示在这里 - - - - 生成小程序码 - 清空 - 在”资源管理器>cloudfunctions>quickstartFunctions>getMiniProgramCode>index.js“找到获取小程序码函数,体验该能力 - - diff --git a/miniprogram/pages/getMiniProgramCode/index.wxss b/miniprogram/pages/getMiniProgramCode/index.wxss deleted file mode 100644 index 3557c79..0000000 --- a/miniprogram/pages/getMiniProgramCode/index.wxss +++ /dev/null @@ -1,58 +0,0 @@ -.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 deleted file mode 100644 index a8927bc..0000000 --- a/miniprogram/pages/getOpenId/index.js +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100644 index 899024b..0000000 --- a/miniprogram/pages/getOpenId/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 6f011cc..0000000 --- a/miniprogram/pages/getOpenId/index.wxml +++ /dev/null @@ -1,8 +0,0 @@ - - 无需维护鉴权机制及登录票据,仅一行代码即可获得。 - {{ openId ? openId : 'OpenID将展示在这里' }} - 获取OpenId - 清空 - 在”资源管理器>cloudfunctions>quickstartFunctions>getOpenId>index.js“找到获取openId函数,体验该能力 - - diff --git a/miniprogram/pages/getOpenId/index.wxss b/miniprogram/pages/getOpenId/index.wxss deleted file mode 100644 index 596c65d..0000000 --- a/miniprogram/pages/getOpenId/index.wxss +++ /dev/null @@ -1,46 +0,0 @@ -.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/home/home.js b/miniprogram/pages/home/home.js new file mode 100644 index 0000000..cda3bfd --- /dev/null +++ b/miniprogram/pages/home/home.js @@ -0,0 +1,130 @@ +// pages/home/home.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + title: 'header', + userInfo: '', + content: '我是父组件的content', + footContent: "bottomContent", + background: [{class:'header-swiper-one',content:'数据分析'}, {class:'header-swiper-two',content:'前端开发'}, {class:'header-swiper-three',content:'全栈开发'}], + indicatorDots: true, + headerContent:'swiper', + vertical: false, + autoplay: true, + interval: 5000, + duration: 1000, + menuIsShow:false, + bottomBtn:'front' + }, + // 监听 + watch:{ + bottomBtn:function(newVal,oldVal){ + console.log('监听',newVal,oldVal) + } + }, + // 自定义函数 + changeIndicatorDots() { + this.setData({ + indicatorDots: !this.data.indicatorDots + }) + }, + + changeAutoplay() { + this.setData({ + autoplay: !this.data.autoplay + }) + }, + + + + intervalChange(e) { + this.setData({ + interval: e.detail.value + }) + }, + + durationChange(e) { + this.setData({ + duration: e.detail.value + }) + }, + + // 关闭菜单 + menuClose(){ + this.data.menuIsShow&&this.setData({ + menuIsShow: !this.data.menuIsShow + }) + }, + menuSwitch(){ + this.setData({ + menuIsShow: !this.data.menuIsShow + }) + }, + // 导航的按钮 + clickBottomBtn(e){ + const label=e.currentTarget.dataset.label||'front' + console.log('click',label) + this.setData({ + bottomBtn:label + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log('进入home页面' ,12431243) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + 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/home/home.json b/miniprogram/pages/home/home.json new file mode 100644 index 0000000..438e1c3 --- /dev/null +++ b/miniprogram/pages/home/home.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "home-content": "/pages/homeContent/homeContent", + "blog": "/pages/blog/blog", + "life": "/pages/life/life", + "future": "/pages/future/future" + } +} \ No newline at end of file diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml new file mode 100644 index 0000000..fa72cbb --- /dev/null +++ b/miniprogram/pages/home/home.wxml @@ -0,0 +1,42 @@ + + + + + + + + + + 这是菜单 + + + + + + + + {{item.content}} + + + + + + + + + 倒计时 {{content}} + + + + + + + + 前端 + 博客 + 方向 + 生活 + + + \ No newline at end of file diff --git a/miniprogram/pages/home/home.wxss b/miniprogram/pages/home/home.wxss new file mode 100644 index 0000000..9842c06 --- /dev/null +++ b/miniprogram/pages/home/home.wxss @@ -0,0 +1,152 @@ +/* pages/home/home.wxss */ +page { + position: absolute; + width: 100vw; + height: 100vh; + bottom: 0; + overflow: hidden; +} +.container{ + position: relative; + width: 100%; + height:100%; + background: rgb(255, 255, 255); +} +/* 箭头 //上右边下左 */ +.arrow-left{ + width: 0; + height: 0; + border: 20px solid; + border-color: transparent transparent transparent rgb(255,255,255); + position: relative; + cursor: pointer; +} +.arrow-left::after{ + content: ''; + position: absolute; + top: -20px; + left: -23px; + border: 20px solid; + border-color: transparent transparent transparent rgb(0, 183, 255); +} + +.arrow-right{ + float: right; + width: 0; + height: 0; + border: 20px solid; + border-color: transparent rgb(255,255,255) transparent transparent; + position: relative; + cursor: pointer; +} +.arrow-right::after{ + content: ''; + position: absolute; + top: -20px; + right: -23px; + border: 20px solid; + border-color: transparent rgb(0, 183, 255) transparent transparent; +} +/* 左侧的菜单 */ +.container-menu{ + position: absolute; + left: 0; + z-index: 1; + width:30%; + font-size: 12px; + height:100%; + background-color: rgba(0, 0, 0,.8); + overflow: hidden; +} +.btn-ul{ + position: relative; + margin-top:40px; + margin-left:10px; +} +/* mask */ +.container-menu-mask{ + position: absolute; + right: 0; + z-index: 1; + width:70%; + height:100%; + background-color: rgba(0, 0, 0,.5); + overflow: hidden; +} + + +.container-menu-expand{ + position: absolute; + left: 0; + z-index: 1; +} + +.caontainer-header{ + height:150px; + display: flex; +} +/* 嵌入表头图案 */ +.swiper{ + position: relative; + height:150px; + width: 100vw; + background-color: rgb(49, 28, 3); +} +.swiper-item{ + position: relative; + width: 100%; + text-align: center; + line-height: 150px; + height: 100%; +} +.header-swiper-one{ + background-color: rgba(158, 209, 238,.4); +} +.header-swiper-two{ + background-color: rgba(158, 209, 238,.5); +} +.header-swiper-three{ + background-color: rgba(158, 209, 238, 0.6); +} + +.caontainer-header content-title{ + text-align: center; +} + +.container-content{ + position: relative; + height: 50vh; +} +.home-content-class{ + position: relative; + width: 100%; + height:100%; +} +.container-footer{ + position: absolute; + width:100vw; + bottom: 0; + left:0; + right:0; + padding: 0; +} +.container-footer-btn-menu{ + position: relative; + display: flex; + flex-wrap: nowrap; + width:100vw; + bottom:0; +} +.default-btn{ + position: relative; + width:25%; + border:1px solid antiquewhite; + text-align: center; + height:100%; +} +.default-btn:active{ + background-color: rgb(8, 113, 252); +} +.btn-actived{ + background-color: rgb(8, 113, 252); +} \ No newline at end of file diff --git a/miniprogram/pages/homeContent/homeContent.js b/miniprogram/pages/homeContent/homeContent.js new file mode 100644 index 0000000..cfed657 --- /dev/null +++ b/miniprogram/pages/homeContent/homeContent.js @@ -0,0 +1,84 @@ +// pages/homeContent/homeContent.js +Page({ + // prop + properties: { + headerItem:String + }, + // observers: { + // headerItem: function(newVal,oldVal) { + // console.log('change',newVal,oldVal) + // this.setData({ + // homeHeaderItem: newVal + // }); + // } +// }, + + /** + * 页面的初始数据 + */ + data: { + content:'子组件的content', + homeHeaderItem:'' + }, + observers:{ + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log('进入homePage home-content 渲染开始 onload') + console.log('传递的header-item',options,this) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + console.log('进入homePage home-content 渲染开始 onready') + console.log('传递的header-item',this) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/homeContent/homeContent.json b/miniprogram/pages/homeContent/homeContent.json new file mode 100644 index 0000000..79be446 --- /dev/null +++ b/miniprogram/pages/homeContent/homeContent.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + + } +} \ No newline at end of file diff --git a/miniprogram/pages/homeContent/homeContent.wxml b/miniprogram/pages/homeContent/homeContent.wxml new file mode 100644 index 0000000..9b1cbf0 --- /dev/null +++ b/miniprogram/pages/homeContent/homeContent.wxml @@ -0,0 +1,8 @@ + + + +content内容 +{{headerItem}} +{{content + headerItem}} + + diff --git a/miniprogram/pages/homeContent/homeContent.wxss b/miniprogram/pages/homeContent/homeContent.wxss new file mode 100644 index 0000000..043ee50 --- /dev/null +++ b/miniprogram/pages/homeContent/homeContent.wxss @@ -0,0 +1,8 @@ +/* pages/homeContent/homeContent.wxss */ +.container{ + position: relative; + width: 100%; + height:100%; + background: #262626; + overflow: hidden; +} diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 807f628..a79e72f 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -1,142 +1,111 @@ // index.js // const app = getApp() -const { envList } = require('../../envList.js'); +// 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 + title: "alpha测试阶段", + userImageUrl: "https://res.wx.qq.com/wxdoc/dist/assets/img/0.4cb08bb4.jpg", + loginTitle: "授权", + userName: '未授权用户', + userInfo: {}, + hasUserInfo: 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 { + getUserInfoBtn: function (info) {fgetUserProfile + wx.showLoading({ + title: '授权中', + }); + console.log('userinfo', info) + if (info && info.detail) { + const rowData = info.detail.rawData ? JSON.parse(info.detail.rawData) : { nickName: '未授权用户', avatarUrl: '' } + this.setData({ + userImageUrl: rowData.avatarUrl + }) this.setData({ - powerList - }); + userName: rowData.nickName + }) + console.log('rowData', rowData) } + wx.hideLoading(); }, - - onChangeShowEnvChoose() { - wx.showActionSheet({ - itemList: this.data.envList.map(i => i.alias), + getUserProfile(e) { + // 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认 + // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 + wx.getUserProfile({ + desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (res) => { - this.onChangeSelectedEnv(res.tapIndex); - }, - fail (res) { - console.log(res.errMsg); + console.log('信息',res) + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + // 全局变量 + try { + wx.setStorageSync('currentUserInfo', JSON.stringify(this.userInfo)) + } catch (e) { + console.warn('获取用户信息报错',this.userInfo) + } + // 跳转到home + this.jumpTohome() } - }); - }, - - 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) { + // 跳转到home + jumpTohome: function () { + console.log('跳转到home') + console.log('this.pageRouter',this.pageRouter) wx.navigateTo({ - url: `/pages/${e.currentTarget.dataset.page}/index?envId=${this.data.selectedEnv.envId}`, - }); + url: '/pages/home/home' + }) }, - - 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 - }); + onLoad: function (options) { + console.log('this page', this) + console.log('this.pageRouter',this.pageRouter) + this.jumpTohome() + // 页面创建时执行 + }, + onShow: function () { + // 页面出现在前台时执行 + }, + onReady: function () { + // 页面首次渲染完毕时执行 + }, + onHide: function () { + // 页面从前台变为后台时执行 + }, + onUnload: function () { + // 页面销毁时执行 + }, + onPullDownRefresh: function () { + // 触发下拉刷新时执行 + }, + onReachBottom: function () { + // 页面触底时执行 + }, + onShareAppMessage: function () { + // 页面被用户分享时执行 + }, + onPageScroll: function () { + // 页面滚动时执行 + }, + onResize: function () { + // 页面尺寸变化时执行 + }, + userLogin: function () { + wx.login({ + success(res) { + if (res.code) { + //发起网络请求 + wx.request({ + url: 'https://example.com/onLogin', + data: { + code: res.code + } + }) + } else { + console.log('登录失败!' + res.errMsg) + } } - this.setData({ - powerList - }); - wx.hideLoading(); - }).catch((e) => { - console.log(e); - this.setData({ - showUploadTip: true - }); - wx.hideLoading(); - }); + }) } }); diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml index ecd65e4..7b50cd9 100644 --- a/miniprogram/pages/index/index.wxml +++ b/miniprogram/pages/index/index.wxml @@ -1,4 +1,4 @@ - + + + + {{title}} + + {{userName}} + + + + + + + + \ No newline at end of file diff --git a/miniprogram/pages/index/index.wxss b/miniprogram/pages/index/index.wxss index c813cf4..8856264 100644 --- a/miniprogram/pages/index/index.wxss +++ b/miniprogram/pages/index/index.wxss @@ -2,14 +2,47 @@ page { padding-top: 54rpx; - background-color: #f6f6f6; + background: #076585; + color: #fff; + /* fallback for old browsers */ + background: -webkit-linear-gradient(to top, #fff, #076585); + /* Chrome 10-25, Safari 5.1-6 */ + background: linear-gradient(to top, #fff, #076585); + /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ + padding-bottom: 60rpx; } +.user-login { + width: 100px !important; + color: #fff !important; + border-color: #fff !important; +} + +.user-info { + color: #fff; +} + +.user-nick-name { + height: 30px; +} + +.user-image-box { + width: 200px; + height: 140px; + text-align: center; + align-items: center; +} + +.user-image { + width: 100px; + height: 100px; + border-radius: 50%; +} + .title { font-family: PingFang SC; font-weight: 500; - color: #000000; font-size: 44rpx; margin-bottom: 40rpx; } diff --git a/miniprogram/pages/life/life.js b/miniprogram/pages/life/life.js new file mode 100644 index 0000000..58cd660 --- /dev/null +++ b/miniprogram/pages/life/life.js @@ -0,0 +1,66 @@ +// pages/life/life.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/life/life.json b/miniprogram/pages/life/life.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram/pages/life/life.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/pages/life/life.wxml b/miniprogram/pages/life/life.wxml new file mode 100644 index 0000000..4484642 --- /dev/null +++ b/miniprogram/pages/life/life.wxml @@ -0,0 +1,2 @@ + +pages/life/life.wxml diff --git a/miniprogram/pages/life/life.wxss b/miniprogram/pages/life/life.wxss new file mode 100644 index 0000000..0b7c764 --- /dev/null +++ b/miniprogram/pages/life/life.wxss @@ -0,0 +1 @@ +/* pages/life/life.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/selectRecord/index.js b/miniprogram/pages/selectRecord/index.js deleted file mode 100644 index fe00c3e..0000000 --- a/miniprogram/pages/selectRecord/index.js +++ /dev/null @@ -1,53 +0,0 @@ -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 deleted file mode 100644 index a85acd9..0000000 --- a/miniprogram/pages/selectRecord/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 78dd8fc..0000000 --- a/miniprogram/pages/selectRecord/index.wxml +++ /dev/null @@ -1,22 +0,0 @@ - - 体验查询记录能力,查询数据表中的销量数据。 - 销量数据将展示在这里 - - 地区销量统计 - - 地域 - 城市 - 销量 - - - - {{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 deleted file mode 100644 index 76652f4..0000000 --- a/miniprogram/pages/selectRecord/index.wxss +++ /dev/null @@ -1,83 +0,0 @@ -.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 deleted file mode 100644 index 4ee28ce..0000000 --- a/miniprogram/pages/sumRecord/index.js +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100644 index b2e58f0..0000000 --- a/miniprogram/pages/sumRecord/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 467c63b..0000000 --- a/miniprogram/pages/sumRecord/index.wxml +++ /dev/null @@ -1,21 +0,0 @@ - - 常用数据库中的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 deleted file mode 100644 index 02d5527..0000000 --- a/miniprogram/pages/sumRecord/index.wxss +++ /dev/null @@ -1,83 +0,0 @@ -.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 deleted file mode 100644 index d2dcc09..0000000 --- a/miniprogram/pages/sumRecordResult/index.js +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index b2e58f0..0000000 --- a/miniprogram/pages/sumRecordResult/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 2e32aac..0000000 --- a/miniprogram/pages/sumRecordResult/index.wxml +++ /dev/null @@ -1,19 +0,0 @@ - - 常用数据库中的groupby操作,体验按地域聚合数据。 - 数据将展示在这里 - - 地区销量统计 - - 地域 - 销量 - - - - {{item._id}} - {{item.sum}} - - - 返回上一步 - 在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数,体验该能力 - - diff --git a/miniprogram/pages/sumRecordResult/index.wxss b/miniprogram/pages/sumRecordResult/index.wxss deleted file mode 100644 index 49ba9e3..0000000 --- a/miniprogram/pages/sumRecordResult/index.wxss +++ /dev/null @@ -1,73 +0,0 @@ -.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 deleted file mode 100644 index e27c4c8..0000000 --- a/miniprogram/pages/updateRecord/index.js +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100644 index d7969cb..0000000 --- a/miniprogram/pages/updateRecord/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 4a62aa6..0000000 --- a/miniprogram/pages/updateRecord/index.wxml +++ /dev/null @@ -1,21 +0,0 @@ - - 体验更新字段记录能力,更新数据表中的销量数据。 - 数据将展示在这里 - - 地区销量统计 - - 地域 - 城市 - 销量 - - - - {{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 deleted file mode 100644 index 02d5527..0000000 --- a/miniprogram/pages/updateRecord/index.wxss +++ /dev/null @@ -1,83 +0,0 @@ -.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 deleted file mode 100644 index a200e6e..0000000 --- a/miniprogram/pages/updateRecordResult/index.js +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100644 index d7969cb..0000000 --- a/miniprogram/pages/updateRecordResult/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 97ebbab..0000000 --- a/miniprogram/pages/updateRecordResult/index.wxml +++ /dev/null @@ -1,21 +0,0 @@ - - 体验更新字段记录能力,更新数据表中的销量数据。 - 数据将展示在这里 - - 地区销量统计 - - 地域 - 城市 - 销量 - - - - {{item.region}} - {{item.city}} - - - - 更新 - 在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数,体验该能力 - - diff --git a/miniprogram/pages/updateRecordResult/index.wxss b/miniprogram/pages/updateRecordResult/index.wxss deleted file mode 100644 index 95e89fa..0000000 --- a/miniprogram/pages/updateRecordResult/index.wxss +++ /dev/null @@ -1,72 +0,0 @@ -.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 deleted file mode 100644 index b4ebffd..0000000 --- a/miniprogram/pages/updateRecordSuccess/index.js +++ /dev/null @@ -1,16 +0,0 @@ -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - goBack() { - wx.navigateBack({ - delta: 2 - }); - }, - -}); diff --git a/miniprogram/pages/updateRecordSuccess/index.json b/miniprogram/pages/updateRecordSuccess/index.json deleted file mode 100644 index d7969cb..0000000 --- a/miniprogram/pages/updateRecordSuccess/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 297640c..0000000 --- a/miniprogram/pages/updateRecordSuccess/index.wxml +++ /dev/null @@ -1,6 +0,0 @@ - - - 地区销量统计更新成功 - 可在“云开发控制台>数据库>记录列表”中进行查看 - 我知道了 - diff --git a/miniprogram/pages/updateRecordSuccess/index.wxss b/miniprogram/pages/updateRecordSuccess/index.wxss deleted file mode 100644 index 9334db1..0000000 --- a/miniprogram/pages/updateRecordSuccess/index.wxss +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100644 index b1ba60e..0000000 --- a/miniprogram/pages/uploadFile/index.js +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100644 index 50b16bd..0000000 --- a/miniprogram/pages/uploadFile/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 2eecd5c..0000000 --- a/miniprogram/pages/uploadFile/index.wxml +++ /dev/null @@ -1,15 +0,0 @@ - - 多存储类型,仅需一个云函数即可完成上传。 - 上传的图片将展示在这里 - - - - 文件路径 - {{imgSrc}} - - - 上传一张图片 - 清空 - 在“资源管理器>miniprogram>pages>uploadFile>index.js”找到相应代码,体验该能力 - - diff --git a/miniprogram/pages/uploadFile/index.wxss b/miniprogram/pages/uploadFile/index.wxss deleted file mode 100644 index c5c3b6a..0000000 --- a/miniprogram/pages/uploadFile/index.wxss +++ /dev/null @@ -1,86 +0,0 @@ -.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/towxml b/miniprogram/towxml new file mode 160000 index 0000000..974be3c --- /dev/null +++ b/miniprogram/towxml @@ -0,0 +1 @@ +Subproject commit 974be3cdbad40b379acd2940966fea2bcbfacd2d diff --git a/project.config.json b/project.config.json index e0d9f68..a88a760 100644 --- a/project.config.json +++ b/project.config.json @@ -18,7 +18,7 @@ "checkInvalidKey": true, "checkSiteMap": true, "uploadWithSourceMap": true, - "compileHotReLoad": false, + "compileHotReLoad": true, "lazyloadPlaceholderEnable": false, "useMultiFrameRuntime": true, "useApiHook": true, @@ -35,9 +35,9 @@ "packNpmRelationList": [], "minifyWXSS": true, "disableUseStrict": false, + "minifyWXML": true, "showES6CompileOption": false, - "useCompilerPlugins": false, - "minifyWXML": true + "useCompilerPlugins": false }, "appid": "wx373f33f993c688d1", "projectname": "yma16_program", -- GitLab