main
unknown 8 months ago
parent 0e40a73511
commit adb677494e

@ -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: {},
}

@ -1,2 +1,2 @@
# bendishenghuo # bendishenghuo
![截图](./screen.png)

@ -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
}
})

@ -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"
}

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

@ -0,0 +1,66 @@
// pages/grid.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,49 @@
<!--pages/grid.wxml-->
<text>pages/grid.wxml</text>
<swiper indicator-dots="true" autoplay="true" interval="3000">
<swiper-item>
<image src="/images/swiper01.jpg"/>
</swiper-item>
<swiper-item>
<image src="/images/swiper02.jpg"/>
</swiper-item>
</swiper>
<view class="grids">
<view class="item">
<image src="/images/shi.png"/>
<text>美食</text>
</view>
<view class="item">
<image src="/images/xiu.png"/>
<text>装修</text>
</view>
<view class="item">
<image src="/images/yu.png"/>
<text>洗浴</text>
</view>
<view class="item">
<image src="/images/che.png"/>
<text>汽车</text>
</view>
<view class="item">
<image src="/images/chang.png"/>
<text>唱歌</text>
</view>
<view class="item">
<image src="/images/fang.png"/>
<text>住宿</text>
</view>
<view class="item">
<image src="/images/xue.png"/>
<text>学习</text>
</view>
<view class="item">
<image src="/images/gong.png"/>
<text>工作</text>
</view>
<view class="item">
<image src="/images/hun.png"/>
<text>结婚</text>
</view>
</view>

@ -0,0 +1 @@
/* pages/grid.wxss */

@ -0,0 +1 @@
// index.js

@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

@ -0,0 +1,48 @@
<text>pages/grid.wxml</text>
<swiper indicator-dots="true" autoplay="true" interval="3000">
<swiper-item>
<image src="/images/swiper01.jpg"/>
</swiper-item>
<swiper-item>
<image src="/images/swiper02.jpg"/>
</swiper-item>
</swiper>
<view class="grids">
<view class="item">
<image src="/images/shi.png"/>
<text>美食</text>
</view>
<view class="item">
<image src="/images/xiu.png"/>
<text>装修</text>
</view>
<view class="item">
<image src="/images/yu.png"/>
<text>洗浴</text>
</view>
<view class="item">
<image src="/images/che.png"/>
<text>汽车</text>
</view>
<view class="item">
<image src="/images/chang.png"/>
<text>唱歌</text>
</view>
<view class="item">
<image src="/images/fang.png"/>
<text>住宿</text>
</view>
<view class="item">
<image src="/images/xue.png"/>
<text>学习</text>
</view>
<view class="item">
<image src="/images/gong.png"/>
<text>工作</text>
</view>
<view class="item">
<image src="/images/hun.png"/>
<text>结婚</text>
</view>
</view>

@ -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;
}

@ -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
}
})
})
}
})

@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

@ -0,0 +1,6 @@
<!--logs.wxml-->
<scroll-view class="scrollarea" scroll-y type="list">
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
<view class="log-item">{{index + 1}}. {{log.date}}</view>
</block>
</scroll-view>

@ -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);
}

@ -0,0 +1,66 @@
// pages/marry/marry.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,2 @@
<!--pages/marry/marry.wxml-->
<text>pages/marry/marry.wxml</text>

@ -0,0 +1 @@
/* pages/marry/marry.wxss */

@ -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"
}

@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "miniprogram-33",
"setting": {
"compileHotReLoad": true
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 KiB

@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

@ -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
}
Loading…
Cancel
Save