├── pages
├── user
│ ├── user.json
│ ├── user.wxss
│ ├── user.wxml
│ └── user.js
└── index
│ ├── index.wxss
│ ├── index.js
│ └── index.wxml
├── README.md
├── images
├── map.png
├── face.png
├── head_3.jpg
└── head_4.jpg
├── app.wxss
├── app.json
├── utils
└── util.js
├── project.config.json
└── app.js
/pages/user/user.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OnceLove
2 | 婚礼喜帖小程序
3 |
--------------------------------------------------------------------------------
/pages/user/user.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user/user.wxss */
--------------------------------------------------------------------------------
/images/map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenyongze/OnceLove/HEAD/images/map.png
--------------------------------------------------------------------------------
/images/face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenyongze/OnceLove/HEAD/images/face.png
--------------------------------------------------------------------------------
/images/head_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenyongze/OnceLove/HEAD/images/head_3.jpg
--------------------------------------------------------------------------------
/images/head_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenyongze/OnceLove/HEAD/images/head_4.jpg
--------------------------------------------------------------------------------
/pages/user/user.wxml:
--------------------------------------------------------------------------------
1 |
2 | pages/user/user.wxml
3 |
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | .container {
3 | font-weight: 200;
4 | }
5 | .fl {
6 | float: left;
7 | }
8 | .fr {
9 | float: right;
10 | }
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages":[
3 | "pages/index/index",
4 | "pages/user/user"
5 | ],
6 | "window":{
7 | "backgroundTextStyle":"light",
8 | "navigationBarBackgroundColor": "#fff",
9 | "navigationBarTitleText": "Once Love",
10 | "navigationBarTextStyle":"black"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "setting": {
4 | "urlCheck": true,
5 | "es6": true,
6 | "postcss": true,
7 | "minified": true,
8 | "newFeature": true
9 | },
10 | "compileType": "miniprogram",
11 | "libVersion": "1.6.4",
12 | "appid": "wxade372ce7f2da061",
13 | "projectname": "OnceLove",
14 | "condition": {
15 | "search": {
16 | "current": -1,
17 | "list": []
18 | },
19 | "conversation": {
20 | "current": -1,
21 | "list": []
22 | },
23 | "miniprogram": {
24 | "current": -1,
25 | "list": []
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | // app.js
2 |
3 | App({
4 | onLaunch: function () {
5 | console.log('start!');
6 | // var logs = wx.getStorageSync('logs') || []
7 | // logs.unshift(Date.now())
8 | // wx.setStorageSync('logs', logs)
9 | },
10 | getUserInfo: function (cb) {
11 | var that = this;
12 | if (this.globalData.userInfo) {
13 | typeof cb == "function" && cb(this.globalData.userInfo)
14 | } else {
15 | //调用登录接口
16 | wx.login({
17 | success: function () {
18 | wx.getUserInfo({
19 | success: function (res) {
20 | that.globalData.userInfo = res.userInfo;
21 | typeof cb == "function" && cb(that.globalData.userInfo)
22 | }
23 | })
24 | }
25 | });
26 | }
27 | },
28 | globalData: {
29 | userInfo: null
30 | }
31 | });
32 |
--------------------------------------------------------------------------------
/pages/user/user.js:
--------------------------------------------------------------------------------
1 | // pages/user/user.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | .head image{
3 | width: 750rpx;
4 | height: 563rpx;
5 | }
6 | .title {
7 | text-align: center;
8 | font-size: 30rpx;
9 | line-height: 60rpx;
10 | margin-top: 20rpx;
11 | }
12 | .date {
13 | text-align: center;
14 | font-size: 24rpx;
15 | line-height: 50rpx;
16 | }
17 | .name {
18 | width: 400rpx;
19 | margin: 0 auto;
20 | min-height: 0;
21 | overflow: hidden;
22 | margin-top: 20rpx;
23 | }
24 | .friends {
25 | min-height: 0;
26 | overflow: hidden;
27 | width: 480rpx;
28 | margin: 0 auto;
29 | margin-top: 20rpx;
30 | }
31 | .face {
32 | width: 100rpx;
33 | height: 100rpx;
34 | float: left;
35 | margin: 10rpx;
36 | }
37 | .face image {
38 | width: 100rpx;
39 | height: 100rpx;
40 | border-radius: 50%;
41 | }
42 | .btn_zone {
43 | padding: 30rpx 50rpx;
44 | border-top: 1px solid #f1f1f1;
45 | border-bottom: 1px solid #f1f1f1;
46 | min-height: 0;
47 | overflow: hidden;
48 | margin-top: 20rpx;
49 | }
50 | .zan {
51 | width: 400rpx;
52 | }
53 | .share {
54 | width: 200rpx;
55 | }
56 | .address {
57 | text-align: center;
58 | padding: 30rpx;
59 | background-color: #f8f8f8;
60 | }
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | const app = getApp()
4 |
5 | Page({
6 | data: {
7 | userInfo: {},
8 | hasUserInfo: false,
9 | markers: [{
10 | iconPath: "/images/map.png",
11 | id: 0,
12 | latitude: 36.718820,
13 | longitude: 119.128520,
14 | width: 50,
15 | height: 50
16 | }]
17 | },
18 | markertap(e) {
19 | wx.openLocation({
20 | latitude: 36.718820,
21 | longitude: 119.128520,
22 | scale: 18,
23 | name: '万达广场',
24 | address: '山东省潍坊市万达广场'
25 | })
26 | },
27 | onLoad: function () {
28 |
29 | var that = this
30 | //调用应用实例的方法获取全局数据
31 | app.getUserInfo( function( userInfo ) {
32 | //更新数据
33 | that.setData( {
34 | userInfo: userInfo
35 | })
36 | })
37 |
38 | wx.request({
39 | url: 'https://wx.qiaker.cn/api',
40 | method: 'GET',
41 | data: {},
42 | header: {
43 | 'Accept': 'application/json'
44 | },
45 | success: function(res) {
46 | console.log(res.data)
47 | that.data.items = res.data
48 | }
49 | })
50 | },
51 | onShareAppMessage: function (options) {
52 | //console.log(options);
53 | return {
54 | title: '标题',
55 | desc: '描述',
56 | path: '/pages/index/',
57 | }
58 | }
59 | })
60 |
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 2017年12月12日
8 | 农历 腊月 初十
9 |
10 |
11 | 梁山伯
12 | 朱丽叶
13 |
14 | 已有342人赞过
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 山东省潍坊市万达广场
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------