From 930565caf565851a51419d44bd1f2ac124f6769a Mon Sep 17 00:00:00 2001 From: 060143A Date: Fri, 7 May 2021 13:33:36 +0800 Subject: [PATCH 1/2] i --- app.js | 19 +++++++++ app.json | 14 +++++++ app.wxss | 10 +++++ pages/index/index.js | 48 ++++++++++++++++++++++ pages/index/index.json | 3 ++ pages/index/index.wxml | 43 ++++++++++++++++++++ pages/index/index.wxss | 91 ++++++++++++++++++++++++++++++++++++++++++ pages/logs/logs.js | 18 +++++++++ pages/logs/logs.json | 4 ++ pages/logs/logs.wxml | 6 +++ pages/logs/logs.wxss | 8 ++++ project.config.json | 71 ++++++++++++++++++++++++++++++++ sitemap.json | 7 ++++ utils/util.js | 19 +++++++++ 14 files changed, 361 insertions(+) create mode 100644 app.js create mode 100644 app.json create mode 100644 app.wxss create mode 100644 pages/index/index.js create mode 100644 pages/index/index.json create mode 100644 pages/index/index.wxml create mode 100644 pages/index/index.wxss create mode 100644 pages/logs/logs.js create mode 100644 pages/logs/logs.json create mode 100644 pages/logs/logs.wxml create mode 100644 pages/logs/logs.wxss create mode 100644 project.config.json create mode 100644 sitemap.json create mode 100644 utils/util.js diff --git a/app.js b/app.js new file mode 100644 index 0000000..1ed57c4 --- /dev/null +++ b/app.js @@ -0,0 +1,19 @@ +// app.js +App({ + onLaunch() { + // 展示本地存储能力 + const logs = wx.getStorageSync('logs') || [] + logs.unshift(Date.now()) + wx.setStorageSync('logs', logs) + + // 登录 + wx.login({ + success: res => { + // 发送 res.code 到后台换取 openId, sessionKey, unionId + } + }) + }, + globalData: { + userInfo: null + } +}) diff --git a/app.json b/app.json new file mode 100644 index 0000000..3d7616f --- /dev/null +++ b/app.json @@ -0,0 +1,14 @@ +{ + "pages":[ + "pages/index/index", + "pages/logs/logs" + ], + "window":{ + "backgroundTextStyle":"light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "Weixin", + "navigationBarTextStyle":"black" + }, + "style": "v2", + "sitemapLocation": "sitemap.json" +} diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..06c6fc9 --- /dev/null +++ b/app.wxss @@ -0,0 +1,10 @@ +/**app.wxss**/ +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; +} diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..0bc1771 --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,48 @@ +// index.js +// 获取应用实例 +const app = getApp() + +Page({ + data: { + motto: 'Hello World', + userInfo: {}, + hasUserInfo: false, + canIUse: wx.canIUse('button.open-type.getUserInfo'), + canIUseGetUserProfile: false, + canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false + }, + // 事件处理函数 + bindViewTap() { + wx.navigateTo({ + url: '../logs/logs' + }) + }, + onLoad() { + if (wx.getUserProfile) { + this.setData({ + canIUseGetUserProfile: true + }) + } + }, + getUserProfile(e) { + // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 + wx.getUserProfile({ + desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 + success: (res) => { + console.log(res) + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + } + }) + }, + getUserInfo(e) { + // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息 + console.log(e) + this.setData({ + userInfo: e.detail.userInfo, + hasUserInfo: true + }) + } +}) diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..69ae9a6 --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,43 @@ + + + 贝壳日程 + 2月 + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + + + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 15 + 16 + 17 + 18 + 19 + 20 + 21 + + + 22 + 23 + 24 + 25 + 26 + 27 + 28 + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..5a3fb72 --- /dev/null +++ b/pages/index/index.wxss @@ -0,0 +1,91 @@ +/**index.wxss**/ +.container { + height: 20rpx; + display: flex; + flex-direction: column; + align-items: center; + padding-left: 150rpx; + padding-right: 150rpx; +} + +.title { + display: flex; + align-items: center; + flex-direction: column; + justify-content: center; + font-size: 50rpx; + color: #5393C3; + background: #87C0CA; + width: 100%; + height: 200rpx; + padding: 45rpx; + margin-top: 10rpx; + border-radius: 50rpx; +} + +.week { + display: flex; + margin-top: 25rpx; + margin-bottom: 25rpx; + font-size: 35rpx; + color: #b5d4eb; +} + +.form { + display: block; + width: 100%; + background: #EAE5E3; + margin-top: 50rpx; + border-radius: 50rpx; +} + +.week1 { + display: flex; + flex-direction: row; + width: 100%; + height: 100rpx; + font-size: 40rpx; +} + +.week2 { + display: flex; + flex-direction: row; + width: 100%; + height: 100rpx; + font-size: 40rpx; +} + +.week3 { + display: flex; + flex-direction: row; + width: 100%; + height: 100rpx; + font-size: 40rpx; +} + +.week4 { + display: flex; + flex-direction: row; + width: 100%; + height: 100rpx; + font-size: 40rpx; +} + +.colora { + color: #87C0CA; + width: 10%; + display: flex; + align-items: center; + flex-direction: column; + justify-content: center; + margin-top: 15rpx; + margin-right: 15rpx; + margin-left: 15rpx; + border-radius: 40rpx; +} + + + + + + diff --git a/pages/logs/logs.js b/pages/logs/logs.js new file mode 100644 index 0000000..85f6aac --- /dev/null +++ b/pages/logs/logs.js @@ -0,0 +1,18 @@ +// logs.js +const util = require('../../utils/util.js') + +Page({ + data: { + logs: [] + }, + onLoad() { + this.setData({ + logs: (wx.getStorageSync('logs') || []).map(log => { + return { + date: util.formatTime(new Date(log)), + timeStamp: log + } + }) + }) + } +}) diff --git a/pages/logs/logs.json b/pages/logs/logs.json new file mode 100644 index 0000000..3ee76c1 --- /dev/null +++ b/pages/logs/logs.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "查看启动日志", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/logs/logs.wxml b/pages/logs/logs.wxml new file mode 100644 index 0000000..0b6b645 --- /dev/null +++ b/pages/logs/logs.wxml @@ -0,0 +1,6 @@ + + + + {{index + 1}}. {{log.date}} + + diff --git a/pages/logs/logs.wxss b/pages/logs/logs.wxss new file mode 100644 index 0000000..94d4b88 --- /dev/null +++ b/pages/logs/logs.wxss @@ -0,0 +1,8 @@ +.log-list { + display: flex; + flex-direction: column; + padding: 40rpx; +} +.log-item { + margin: 10rpx; +} diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..2624304 --- /dev/null +++ b/project.config.json @@ -0,0 +1,71 @@ +{ + "description": "项目配置文件", + "packOptions": { + "ignore": [] + }, + "setting": { + "urlCheck": true, + "es6": true, + "enhance": false, + "postcss": true, + "preloadBackgroundData": false, + "minified": true, + "newFeature": false, + "coverView": true, + "nodeModules": false, + "autoAudits": false, + "showShadowRootInWxmlPanel": true, + "scopeDataCheck": false, + "uglifyFileName": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "compileHotReLoad": false, + "useMultiFrameRuntime": true, + "useApiHook": true, + "useApiHostProcess": false, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "enableEngineNative": false, + "bundle": false, + "useIsolateContext": true, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false, + "userConfirmedBundleSwitch": false, + "packNpmManually": false, + "packNpmRelationList": [], + "minifyWXSS": true + }, + "compileType": "miniprogram", + "libVersion": "2.17.0", + "appid": "wx1753a643a845b44a", + "projectname": "frontend1", + "debugOptions": { + "hidedInDevtools": [] + }, + "scripts": {}, + "isGameTourist": false, + "condition": { + "search": { + "list": [] + }, + "conversation": { + "list": [] + }, + "game": { + "list": [] + }, + "plugin": { + "list": [] + }, + "gamePlugin": { + "list": [] + }, + "miniprogram": { + "list": [] + } + } +} \ No newline at end of file diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..764bc2c --- /dev/null +++ b/utils/util.js @@ -0,0 +1,19 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}` +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : `0${n}` +} + +module.exports = { + formatTime +} From 0e3db804c5b618d90e71eb0bbb8a6845aede844e Mon Sep 17 00:00:00 2001 From: 060143A Date: Thu, 27 May 2021 11:52:07 +0800 Subject: [PATCH 2/2] Frontend1-02 --- app.json | 3 +- pages/app/app.js | 66 ++++++++++++++++++++++++ pages/app/app.json | 3 ++ pages/app/app.wxml | 2 + pages/app/app.wxss | 1 + pages/index/index.json | 3 +- pages/index/index.wxml | 56 ++++++--------------- pages/index/index.wxss | 112 +++++++++++++---------------------------- project.config.json | 11 ++-- 9 files changed, 133 insertions(+), 124 deletions(-) create mode 100644 pages/app/app.js create mode 100644 pages/app/app.json create mode 100644 pages/app/app.wxml create mode 100644 pages/app/app.wxss diff --git a/app.json b/app.json index 3d7616f..1136805 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,8 @@ { "pages":[ "pages/index/index", - "pages/logs/logs" + "pages/logs/logs", + "pages/app/app" ], "window":{ "backgroundTextStyle":"light", diff --git a/pages/app/app.js b/pages/app/app.js new file mode 100644 index 0000000..ec7e972 --- /dev/null +++ b/pages/app/app.js @@ -0,0 +1,66 @@ +// pages/app/app.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/pages/app/app.json b/pages/app/app.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/app/app.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/app/app.wxml b/pages/app/app.wxml new file mode 100644 index 0000000..e3405ef --- /dev/null +++ b/pages/app/app.wxml @@ -0,0 +1,2 @@ +2021 +JAN \ No newline at end of file diff --git a/pages/app/app.wxss b/pages/app/app.wxss new file mode 100644 index 0000000..c35f28e --- /dev/null +++ b/pages/app/app.wxss @@ -0,0 +1 @@ +/* pages/app/app.wxss */ \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json index 8835af0..0e1c2f0 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,3 +1,4 @@ { - "usingComponents": {} + "usingComponents": {}, + "navigationBarBackgroundColor":"#2A81CA" } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 69ae9a6..3dd8b48 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,43 +1,17 @@ - - - 贝壳日程 - 2月 - - - - 1 - 2 - 3 - 4 - 5 - 6 - 7 - - - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 15 - 16 - 17 - 18 - 19 - 20 - 21 - - - 22 - 23 - 24 - 25 - 26 - 27 - 28 + + + 2021 + JAN + + + + +Month +Week +Add + + +{{item}} +{{item + 1}} \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 5a3fb72..e8e378c 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -1,91 +1,49 @@ -/**index.wxss**/ -.container { - height: 20rpx; - display: flex; - flex-direction: column; - align-items: center; - padding-left: 150rpx; - padding-right: 150rpx; +page { + background-color: #2A81CA; + color: white; } -.title { +.top { display: flex; - align-items: center; - flex-direction: column; - justify-content: center; - font-size: 50rpx; - color: #5393C3; - background: #87C0CA; - width: 100%; - height: 200rpx; - padding: 45rpx; - margin-top: 10rpx; - border-radius: 50rpx; + justify-content: space-between; + padding: 10px 20px; } -.week { +.btns { display: flex; - margin-top: 25rpx; - margin-bottom: 25rpx; - font-size: 35rpx; - color: #b5d4eb; + justify-content: space-between; + padding: 10px 20px; + box-shadow: 0px 17px 34px 0px rgba(0, 0, 0, 0.3); } -.form { - display: block; - width: 100%; - background: #EAE5E3; - margin-top: 50rpx; - border-radius: 50rpx; -} - -.week1 { - display: flex; - flex-direction: row; - width: 100%; - height: 100rpx; - font-size: 40rpx; +.btns>view { + padding: 5px 0; + font-size: 18px; } -.week2 { - display: flex; - flex-direction: row; - width: 100%; - height: 100rpx; - font-size: 40rpx; +.btns>view.active { + padding: 5px 20px; + border-radius: 20px; + box-shadow: 0px 17px 34px 0px rgba(0, 0, 0, 0.3); + background: linear-gradient(150deg, #73B7FB, #3F9CFA); + font-size: 18px; } -.week3 { - display: flex; - flex-direction: row; - width: 100%; - height: 100rpx; - font-size: 40rpx; +.calendar { + /* display: flex; */ + padding: 10px 0; + background-color: white; + color: black; } - -.week4 { - display: flex; - flex-direction: row; - width: 100%; - height: 100rpx; - font-size: 40rpx; +.date { + padding: 8px 0; + display: inline-block; + text-align: center; + width: 14.2857142857143%; } - -.colora { - color: #87C0CA; - width: 10%; - display: flex; - align-items: center; - flex-direction: column; - justify-content: center; - margin-top: 15rpx; - margin-right: 15rpx; - margin-left: 15rpx; - border-radius: 40rpx; -} - - - - - - +.week { + padding: 8px 0; + display: inline-block; + text-align: center; + width: 14.2857142857143%; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json index 2624304..be83d8a 100644 --- a/project.config.json +++ b/project.config.json @@ -21,8 +21,8 @@ "checkSiteMap": true, "uploadWithSourceMap": true, "compileHotReLoad": false, - "useMultiFrameRuntime": true, - "useApiHook": true, + "useMultiFrameRuntime": false, + "useApiHook": false, "useApiHostProcess": false, "babelSetting": { "ignore": [], @@ -30,7 +30,6 @@ "outputPath": "" }, "enableEngineNative": false, - "bundle": false, "useIsolateContext": true, "useCompilerModule": true, "userConfirmedUseCompilerModuleSwitch": false, @@ -42,11 +41,15 @@ "compileType": "miniprogram", "libVersion": "2.17.0", "appid": "wx1753a643a845b44a", - "projectname": "frontend1", + "projectname": "Frontend01-02", "debugOptions": { "hidedInDevtools": [] }, "scripts": {}, + "staticServerOptions": { + "baseURL": "", + "servePath": "" + }, "isGameTourist": false, "condition": { "search": {