diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..115cc02 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +/* + * Eslint config file + * Documentation: https://eslint.org/docs/user-guide/configuring/ + * Install the Eslint extension before using this feature. + */ +module.exports = { + env: { + es6: true, + browser: true, + node: true, + }, + ecmaFeatures: { + modules: true, + }, + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + // extends: 'eslint:recommended', + rules: {}, +} diff --git a/README.md b/README.md index 9bb25f3..f50cbf6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # bendishenghuo - +![截图](./screen.png) 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..741352a --- /dev/null +++ b/app.json @@ -0,0 +1,17 @@ +{ + "pages": [ + "pages/index/index", + "pages/logs/logs", + "pages/grid/grid", + "pages/marry/marry" + ], + "window": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "Weixin", + "navigationBarBackgroundColor": "#ffffff" + }, + "style": "v2", + "componentFramework": "glass-easel", + "sitemapLocation": "sitemap.json", + "lazyCodeLoading": "requiredComponents" +} \ No newline at end of file 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/images/chang.png b/images/chang.png new file mode 100644 index 0000000..2fb6767 Binary files /dev/null and b/images/chang.png differ diff --git a/images/che.png b/images/che.png new file mode 100644 index 0000000..be4827d Binary files /dev/null and b/images/che.png differ diff --git a/images/fang.png b/images/fang.png new file mode 100644 index 0000000..285c194 Binary files /dev/null and b/images/fang.png differ diff --git a/images/gong.png b/images/gong.png new file mode 100644 index 0000000..acd4ced Binary files /dev/null and b/images/gong.png differ diff --git a/images/hun.png b/images/hun.png new file mode 100644 index 0000000..f1c2f75 Binary files /dev/null and b/images/hun.png differ diff --git a/images/shi.png b/images/shi.png new file mode 100644 index 0000000..b45c0b3 Binary files /dev/null and b/images/shi.png differ diff --git a/images/swiper01.jpg b/images/swiper01.jpg new file mode 100644 index 0000000..632daca Binary files /dev/null and b/images/swiper01.jpg differ diff --git a/images/swiper02.jpg b/images/swiper02.jpg new file mode 100644 index 0000000..3008816 Binary files /dev/null and b/images/swiper02.jpg differ diff --git a/images/xiu.png b/images/xiu.png new file mode 100644 index 0000000..56ae5f7 Binary files /dev/null and b/images/xiu.png differ diff --git a/images/xue.png b/images/xue.png new file mode 100644 index 0000000..35b5f1c Binary files /dev/null and b/images/xue.png differ diff --git a/images/yu.png b/images/yu.png new file mode 100644 index 0000000..002229d Binary files /dev/null and b/images/yu.png differ diff --git a/pages/grid/grid.js b/pages/grid/grid.js new file mode 100644 index 0000000..841079e --- /dev/null +++ b/pages/grid/grid.js @@ -0,0 +1,66 @@ +// pages/grid.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/grid/grid.json b/pages/grid/grid.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/grid/grid.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/grid/grid.wxml b/pages/grid/grid.wxml new file mode 100644 index 0000000..02d0687 --- /dev/null +++ b/pages/grid/grid.wxml @@ -0,0 +1,49 @@ + +pages/grid.wxml + + + + + + + + + + + + +美食 + + + +装修 + + + +洗浴 + + + +汽车 + + + +唱歌 + + + +住宿 + + + +学习 + + + +工作 + + + +结婚 + + diff --git a/pages/grid/grid.wxss b/pages/grid/grid.wxss new file mode 100644 index 0000000..6377b44 --- /dev/null +++ b/pages/grid/grid.wxss @@ -0,0 +1 @@ +/* pages/grid.wxss */ \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..f10008d --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1 @@ +// index.js diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..b55b5a2 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,4 @@ +{ + "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..334eb74 --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,48 @@ +pages/grid.wxml + + + + + + + + + + + + +美食 + + + +装修 + + + +洗浴 + + + +汽车 + + + +唱歌 + + + +住宿 + + + +学习 + + + +工作 + + + +结婚 + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..97a2ace --- /dev/null +++ b/pages/index/index.wxss @@ -0,0 +1,41 @@ +swiper{ + height: 350rpx; +} +swiper image{ + width: 100%; + height: 100%; +} +.grids{ + display: flex; + flex-wrap:wrap ; +} +.grids .item{ + width: 250rpx; + height: 250rpx; + border-right: 1rpx solid #eee; + border-bottom:1rpx solid #eee; + box-sizing: border-box; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} +.grids .item:nth-child(3){ + border-right: 0; +} +.grids .item:nth-child(6){ + border-right: 0; + } + .grids .item:nth-child(9){ + border-right: 0; + } + + .grids .item image{ + width: 70rpx; + height: 70rpx; + } + .grids .item text{ + color: #999; + font-size: 28rpx; + margin-top: 20rpx; + } \ No newline at end of file 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..b55b5a2 --- /dev/null +++ b/pages/logs/logs.json @@ -0,0 +1,4 @@ +{ + "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..85cf1bf --- /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..33f9d9e --- /dev/null +++ b/pages/logs/logs.wxss @@ -0,0 +1,16 @@ +page { + height: 100vh; + display: flex; + flex-direction: column; +} +.scrollarea { + flex: 1; + overflow-y: hidden; +} +.log-item { + margin-top: 20rpx; + text-align: center; +} +.log-item:last-child { + padding-bottom: env(safe-area-inset-bottom); +} diff --git a/pages/marry/marry.js b/pages/marry/marry.js new file mode 100644 index 0000000..05430c5 --- /dev/null +++ b/pages/marry/marry.js @@ -0,0 +1,66 @@ +// pages/marry/marry.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/marry/marry.json b/pages/marry/marry.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/marry/marry.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/marry/marry.wxml b/pages/marry/marry.wxml new file mode 100644 index 0000000..8dd46a9 --- /dev/null +++ b/pages/marry/marry.wxml @@ -0,0 +1,2 @@ + +pages/marry/marry.wxml \ No newline at end of file diff --git a/pages/marry/marry.wxss b/pages/marry/marry.wxss new file mode 100644 index 0000000..5a99007 --- /dev/null +++ b/pages/marry/marry.wxss @@ -0,0 +1 @@ +/* pages/marry/marry.wxss */ \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..d4f6eb2 --- /dev/null +++ b/project.config.json @@ -0,0 +1,28 @@ +{ + "compileType": "miniprogram", + "libVersion": "trial", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "coverView": true, + "es6": true, + "postcss": true, + "minified": true, + "enhance": true, + "showShadowRootInWxmlPanel": true, + "packNpmRelationList": [], + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "condition": {}, + "editorSetting": { + "tabIndent": "auto", + "tabSize": 2 + }, + "appid": "wx2d72f07adf0c3941" +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..9e45cec --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,7 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "miniprogram-33", + "setting": { + "compileHotReLoad": true + } +} \ No newline at end of file diff --git a/screen.png b/screen.png new file mode 100644 index 0000000..4970b3b Binary files /dev/null and b/screen.png differ 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 +}