diff --git a/miniprogram/app.js b/miniprogram/app.js index 7642c60e951b163002c015ae2252f353d0925e8e..0657238b90ef5e8673a57424bac39ed5c25f1035 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 9d1e2603f5de62c9a9af726a858649936470d2da..322eec2d006a48f9b0d5594eeeac915543f308ed 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 df96b0e9516ae508a23ea450c0254a90111f0925..ab1bfbb3379bf4f0852abbf733e2abbf49d82dd6 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 0000000000000000000000000000000000000000..a4409f91d984c6fbb692b563fd4a1e1ebb750a58 --- /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 0000000000000000000000000000000000000000..98446b49c32c02971080270772af57c1ca5c7a24 --- /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 0000000000000000000000000000000000000000..f85709a7161c95cd9561256956d42805007a0e69 --- /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 d98a4ce7da0b928b41500f06da819ddf7f6f3020..0000000000000000000000000000000000000000 --- 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 fcec8c8f4c051acb7de1c930c32752b8dca67cf1..0000000000000000000000000000000000000000 --- 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 d89d5f0b147a1fb99d4cb661d8898fe7bcfa73f7..0000000000000000000000000000000000000000 --- 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 133cd5d36ee19f777813ed8a45628e5fec2583cb..0000000000000000000000000000000000000000 --- 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 476e76454d108c8823dfd0b22da1a2d1e081c12e..0000000000000000000000000000000000000000 --- 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 aa739a0f494d627227d2fd8be1db1365204ea9fb..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..15da2d41cde6cec432dd12c73270ef9d4f73aa65 --- /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 0000000000000000000000000000000000000000..2fffdc2eb561492216f4476a3c5dd44904c35487 --- /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 0000000000000000000000000000000000000000..1ad5f1cdcdb517ea0f24981aa72662935670a168 --- /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 75328ae703af7abaf6a21e4031dcbeac46912c45..0000000000000000000000000000000000000000 --- 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 73fa86058f3e532de17a4114e03a8ab6c380c6c6..0000000000000000000000000000000000000000 --- 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 df1b529abf6e19ba7d0f8035eed484284e5cedfd..0000000000000000000000000000000000000000 --- 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 3557c79f911a6f1aa427eb59869a62a31b04ccdb..0000000000000000000000000000000000000000 --- 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 a8927bcec9b851ba380dfdaccb3d2d95652f816e..0000000000000000000000000000000000000000 --- 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 899024b7a20d70c8660652abe02857f98c42e3dd..0000000000000000000000000000000000000000 --- 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 6f011cc7304a08415d69f78968eb22d293b127db..0000000000000000000000000000000000000000 --- 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 596c65de7821e089230eff0983f567b83de6944a..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..cda3bfd580fade028df1a21b68605e127ffa6f1c --- /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 0000000000000000000000000000000000000000..438e1c309268a823a251e47a7ec623d8705c800b --- /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 0000000000000000000000000000000000000000..fa72cbb656768182b26cfda1e21acfd1622c9981 --- /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 0000000000000000000000000000000000000000..9842c0630bf3b128188015c4fd2b99b69ada879b --- /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 0000000000000000000000000000000000000000..cfed657938a03134c437e2e72fd1fb3d45db5a80 --- /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 0000000000000000000000000000000000000000..79be44697c984a70a0edc96443791473988a4bda --- /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 0000000000000000000000000000000000000000..9b1cbf0acc129363d3b3f279cac7ba8e2c4090ed --- /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 0000000000000000000000000000000000000000..043ee508acdeef069aba8bb23e4c36c9c99cf922 --- /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 807f628fd2f7e5dbbba283d383a52963c6b3bb25..a79e72f51c3edc87d777ad50c1ad3fec59cb8968 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 ecd65e43d1a66874918bd28c312185edc9a85c04..7b50cd935d4f1a982617471fe01ee936ac7f5767 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 c813cf4b4e4c770b82e803fe1f3dd7e140dc3c3f..885626401313327ef9341a06e803795d9605b5ac 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 0000000000000000000000000000000000000000..58cd660f2e53acef072bb2ff96118e0a5923a64e --- /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 0000000000000000000000000000000000000000..8835af0699ccec004cbe685ef938cd2d63ea7037 --- /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 0000000000000000000000000000000000000000..44846422d85d9c8fd3cf48ce0500c33735a7ec9a --- /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 0000000000000000000000000000000000000000..0b7c764b583dcee0c7d2cb30dcb8b3df81fdfa62 --- /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 fe00c3e6ca273ca9bbe273c1cfc4bd73ca5cb7b5..0000000000000000000000000000000000000000 --- 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 a85acd96bde75d2a76b6d303043d5479e4fae5eb..0000000000000000000000000000000000000000 --- 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 78dd8fcbe1cb4942f209d3aa46915a57585db751..0000000000000000000000000000000000000000 --- 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 76652f4accf5b1b2b35dc6d57b6c6801882fadc6..0000000000000000000000000000000000000000 --- 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 4ee28ce84d91195f5756513d256a57f70ce843c6..0000000000000000000000000000000000000000 --- 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 b2e58f018178c5a5a71941f68012d1cdf81e7271..0000000000000000000000000000000000000000 --- 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 467c63be7ee4dc202da1903e17bd3a0f547839e7..0000000000000000000000000000000000000000 --- 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 02d552765012931b291bd437cd42e24c2679cd29..0000000000000000000000000000000000000000 --- 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 d2dcc09252d178df47bfccae1dde3c7ec6c5bc03..0000000000000000000000000000000000000000 --- 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 b2e58f018178c5a5a71941f68012d1cdf81e7271..0000000000000000000000000000000000000000 --- 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 2e32aacf56d304674f21675496f4fcfa9d853040..0000000000000000000000000000000000000000 --- 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 49ba9e3f2da222289bdfec6ce1e26025b38d02e0..0000000000000000000000000000000000000000 --- 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 e27c4c8b94ad4c62ec3e6ed37a35b9145a0fb57b..0000000000000000000000000000000000000000 --- 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 d7969cb39f0522486213475eb343c2a8f6652996..0000000000000000000000000000000000000000 --- 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 4a62aa6ec998f167d273bebc510ac8b8150dd6e1..0000000000000000000000000000000000000000 --- 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 02d552765012931b291bd437cd42e24c2679cd29..0000000000000000000000000000000000000000 --- 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 a200e6e0cdd5203b619f16a78729efd8a4d45feb..0000000000000000000000000000000000000000 --- 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 d7969cb39f0522486213475eb343c2a8f6652996..0000000000000000000000000000000000000000 --- 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 97ebbab69ed2479d1b2c9f8c23c60dd24e658847..0000000000000000000000000000000000000000 --- 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 95e89fab656e2ec58ee475b69917279feed2f6db..0000000000000000000000000000000000000000 --- 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 b4ebffdb558bd8795fb813afe1a8da740f24e436..0000000000000000000000000000000000000000 --- 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 d7969cb39f0522486213475eb343c2a8f6652996..0000000000000000000000000000000000000000 --- 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 297640ce95050d87f53ea075117b7914c6eebfa9..0000000000000000000000000000000000000000 --- 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 9334db17bcf303d959fdac4e3832688754722e10..0000000000000000000000000000000000000000 --- 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 b1ba60e7daaee86f5924d1adcfc9c16874931f9e..0000000000000000000000000000000000000000 --- 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 50b16bd8bf5575daf00770916d334819374e7712..0000000000000000000000000000000000000000 --- 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 2eecd5cb818de359f27abeba97122b1b94b40448..0000000000000000000000000000000000000000 --- 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 c5c3b6a70aae535b94f9f54b077bc28e8ff41c2e..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..974be3cdbad40b379acd2940966fea2bcbfacd2d --- /dev/null +++ b/miniprogram/towxml @@ -0,0 +1 @@ +Subproject commit 974be3cdbad40b379acd2940966fea2bcbfacd2d diff --git a/project.config.json b/project.config.json index e0d9f68c906bca15b8cc87b099588bd4df183352..a88a760272c06a178f39181467a7d4dcd813ffb8 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",