正在显示
47 个修改的文件
包含
1354 行增加
和
0 行删除
app.js
0 → 100644
1 | +//app.js | ||
2 | +App({ | ||
3 | + onLaunch: function () { | ||
4 | + // 展示本地存储能力 | ||
5 | + var logs = wx.getStorageSync('logs') || [] | ||
6 | + logs.unshift(Date.now()) | ||
7 | + wx.setStorageSync('logs', logs) | ||
8 | + | ||
9 | + // 登录 | ||
10 | + wx.login({ | ||
11 | + success: res => { | ||
12 | + // 发送 res.code 到后台换取 openId, sessionKey, unionId | ||
13 | + } | ||
14 | + }) | ||
15 | + // 获取用户信息 | ||
16 | + wx.getSetting({ | ||
17 | + success: res => { | ||
18 | + if (res.authSetting['scope.userInfo']) { | ||
19 | + // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 | ||
20 | + wx.getUserInfo({ | ||
21 | + success: res => { | ||
22 | + // 可以将 res 发送给后台解码出 unionId | ||
23 | + this.globalData.userInfo = res.userInfo | ||
24 | + | ||
25 | + // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 | ||
26 | + // 所以此处加入 callback 以防止这种情况 | ||
27 | + if (this.userInfoReadyCallback) { | ||
28 | + this.userInfoReadyCallback(res) | ||
29 | + } | ||
30 | + } | ||
31 | + }) | ||
32 | + } | ||
33 | + } | ||
34 | + }) | ||
35 | + }, | ||
36 | + globalData: { | ||
37 | + userInfo: null | ||
38 | + } | ||
39 | +}) |
app.json
0 → 100644
1 | +{ | ||
2 | + "pages": [ | ||
3 | + "pages/mall/charge/charge", | ||
4 | + "pages/mall/mall", | ||
5 | + "pages/signIn/dailySignIn/dailySignIn", | ||
6 | + "pages/signIn/daySignIn/daySignIn", | ||
7 | + "pages/signIn/Weight/Weight", | ||
8 | + "pages/signIn/bodyWeght/bodyWeght", | ||
9 | + "pages/my/my", | ||
10 | + "pages/signIn/signIn", | ||
11 | + "pages/index/index", | ||
12 | + "pages/logs/logs" | ||
13 | + ], | ||
14 | + "window": { | ||
15 | + "backgroundTextStyle": "light", | ||
16 | + "navigationBarBackgroundColor": "#FFAD50", | ||
17 | + "navigationBarTitleText": "麦夫子", | ||
18 | + "navigationBarTextStyle": "#FFFFFF" | ||
19 | + } | ||
20 | +} |
app.wxss
0 → 100644
1 | +/**app.wxss**/ | ||
2 | +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, | ||
3 | +blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, | ||
4 | +ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, | ||
5 | +dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, | ||
6 | +tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, | ||
7 | +figcaption, footer, header, menu, nav, output, ruby, section, summary, time, | ||
8 | +mark, audio, video, input, view, text, template, blockquote, page { | ||
9 | + margin: 0; | ||
10 | + padding: 0; | ||
11 | + border: 0; | ||
12 | + font-size: 100%; | ||
13 | + font-weight: normal; | ||
14 | + vertical-align: baseline; | ||
15 | + box-sizing: border-box; | ||
16 | + font-family: 'pingfang'; | ||
17 | +} | ||
18 | + | ||
19 | +/* HTML5 display-role reset for older browsers */ | ||
20 | + | ||
21 | +article, aside, details, figcaption, figure, footer, header, menu, nav, section { | ||
22 | + display: block; | ||
23 | +} | ||
24 | + | ||
25 | +body { | ||
26 | + line-height: 1; | ||
27 | + height: 100%; | ||
28 | + position: relative; | ||
29 | +} | ||
30 | + | ||
31 | +blockquote, q { | ||
32 | + quotes: none; | ||
33 | +} | ||
34 | + | ||
35 | +blockquote:before, blockquote:after, q:before, q:after { | ||
36 | + content: none; | ||
37 | +} | ||
38 | + | ||
39 | +table { | ||
40 | + border-collapse: collapse; | ||
41 | + border-spacing: 0; | ||
42 | +} | ||
43 | + | ||
44 | +html, body { | ||
45 | + width: 100%; | ||
46 | +} | ||
47 | + | ||
48 | +/* custom */ | ||
49 | + | ||
50 | +a { | ||
51 | + color: #000; | ||
52 | + text-decoration: none; | ||
53 | + -webkit-backface-visibility: hidden; | ||
54 | +} | ||
55 | + | ||
56 | +li { | ||
57 | + list-style: none; | ||
58 | +} | ||
59 | + | ||
60 | +body { | ||
61 | + -webkit-text-size-adjust: none; | ||
62 | + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
63 | +} | ||
64 | + | ||
65 | +img { | ||
66 | + border: 0; | ||
67 | + margin: 0; | ||
68 | +} | ||
69 | + | ||
70 | +input, textarea { | ||
71 | + height: 100%; | ||
72 | + width: 100%; | ||
73 | + border: 0; | ||
74 | + outline: none; | ||
75 | + background: none; | ||
76 | +} | ||
77 | + | ||
78 | +/* fontIcon */ | ||
79 | +@font-face { | ||
80 | + font-family: 'iconfont'; /* project id 921699 */ | ||
81 | + src: url('//at.alicdn.com/t/font_921699_itl48k5kvp.eot'); | ||
82 | + src: url('//at.alicdn.com/t/font_921699_itl48k5kvp.eot?#iefix') format('embedded-opentype'), | ||
83 | + url('//at.alicdn.com/t/font_921699_itl48k5kvp.woff') format('woff'), | ||
84 | + url('//at.alicdn.com/t/font_921699_itl48k5kvp.ttf') format('truetype'), | ||
85 | + url('//at.alicdn.com/t/font_921699_itl48k5kvp.svg#iconfont') format('svg'); | ||
86 | +} | ||
87 | + | ||
88 | + | ||
89 | +.iconfont { | ||
90 | + font-family:"iconfont" !important; | ||
91 | + font-size:16px; | ||
92 | + font-style:normal; | ||
93 | + -webkit-font-smoothing: antialiased; | ||
94 | + -moz-osx-font-smoothing: grayscale; | ||
95 | +} | ||
96 | + | ||
97 | +.icon-arrow-right:before { content: "\e600"; } |
images/good.png
0 → 100644
259.5 KB
images/img.png
0 → 100644
657.1 KB
pages/index/index.js
0 → 100644
1 | +//index.js | ||
2 | +//获取应用实例 | ||
3 | +const app = getApp() | ||
4 | + | ||
5 | +Page({ | ||
6 | + data: { | ||
7 | + motto: 'Hello World', | ||
8 | + userInfo: {}, | ||
9 | + hasUserInfo: false, | ||
10 | + canIUse: wx.canIUse('button.open-type.getUserInfo') | ||
11 | + }, | ||
12 | + //事件处理函数 | ||
13 | + bindViewTap: function() { | ||
14 | + wx.navigateTo({ | ||
15 | + url: '../logs/logs' | ||
16 | + }) | ||
17 | + }, | ||
18 | + onLoad: function () { | ||
19 | + if (app.globalData.userInfo) { | ||
20 | + this.setData({ | ||
21 | + userInfo: app.globalData.userInfo, | ||
22 | + hasUserInfo: true | ||
23 | + }) | ||
24 | + } else if (this.data.canIUse){ | ||
25 | + // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 | ||
26 | + // 所以此处加入 callback 以防止这种情况 | ||
27 | + app.userInfoReadyCallback = res => { | ||
28 | + this.setData({ | ||
29 | + userInfo: res.userInfo, | ||
30 | + hasUserInfo: true | ||
31 | + }) | ||
32 | + } | ||
33 | + } else { | ||
34 | + // 在没有 open-type=getUserInfo 版本的兼容处理 | ||
35 | + wx.getUserInfo({ | ||
36 | + success: res => { | ||
37 | + app.globalData.userInfo = res.userInfo | ||
38 | + this.setData({ | ||
39 | + userInfo: res.userInfo, | ||
40 | + hasUserInfo: true | ||
41 | + }) | ||
42 | + } | ||
43 | + }) | ||
44 | + } | ||
45 | + }, | ||
46 | + getUserInfo: function(e) { | ||
47 | + console.log(e) | ||
48 | + app.globalData.userInfo = e.detail.userInfo | ||
49 | + this.setData({ | ||
50 | + userInfo: e.detail.userInfo, | ||
51 | + hasUserInfo: true | ||
52 | + }) | ||
53 | + } | ||
54 | +}) |
pages/index/index.json
0 → 100644
1 | +{} |
pages/index/index.wxml
0 → 100644
1 | +<!--index.wxml--> | ||
2 | +<view class="container"> | ||
3 | + <view class="userinfo"> | ||
4 | + <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button> | ||
5 | + <block wx:else> | ||
6 | + <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image> | ||
7 | + <text class="userinfo-nickname">{{userInfo.nickName}}</text> | ||
8 | + </block> | ||
9 | + </view> | ||
10 | + <view class="usermotto"> | ||
11 | + <text class="user-motto">{{motto}}</text> | ||
12 | + </view> | ||
13 | +</view> |
pages/index/index.wxss
0 → 100644
1 | +/**index.wxss**/ | ||
2 | +.userinfo { | ||
3 | + display: flex; | ||
4 | + flex-direction: column; | ||
5 | + align-items: center; | ||
6 | +} | ||
7 | + | ||
8 | +.userinfo-avatar { | ||
9 | + width: 128rpx; | ||
10 | + height: 128rpx; | ||
11 | + margin: 20rpx; | ||
12 | + border-radius: 50%; | ||
13 | +} | ||
14 | + | ||
15 | +.userinfo-nickname { | ||
16 | + color: #aaa; | ||
17 | +} | ||
18 | + | ||
19 | +.usermotto { | ||
20 | + margin-top: 200px; | ||
21 | +} |
pages/logs/logs.js
0 → 100644
pages/logs/logs.json
0 → 100644
pages/logs/logs.wxml
0 → 100644
pages/logs/logs.wxss
0 → 100644
pages/mall/charge/charge.js
0 → 100644
1 | +// pages/mall/charge/charge.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/mall/charge/charge.json
0 → 100644
pages/mall/charge/charge.wxml
0 → 100644
1 | +<!--pages/mall/charge/charge.wxml--> | ||
2 | +<view class='content_box'> | ||
3 | + <view class='list_box'> | ||
4 | + <view class='item_list'> | ||
5 | + <view> | ||
6 | + <view> | ||
7 | + <text>向昱筱</text> | ||
8 | + <text>13252648165</text> | ||
9 | + </view> | ||
10 | + <view>天津市和平区气象台路1088号中环公寓</view> | ||
11 | + </view> | ||
12 | + <view class='iconfont icon-arrow-right'></view> | ||
13 | + </view> | ||
14 | + </view> | ||
15 | + <view class='list_box'> | ||
16 | + <view class='list_title'>订单信息</view> | ||
17 | + <view class='item_list'> | ||
18 | + <view class='list_info_box'> | ||
19 | + <view class='list_img'> | ||
20 | + <image src='/images/good.png'></image> | ||
21 | + </view> | ||
22 | + <view> | ||
23 | + <view>百草味 肉干肉脯 白芝麻猪肉脯</view> | ||
24 | + <view>100克</view> | ||
25 | + <view class='good_num_box'> | ||
26 | + <text> | ||
27 | + <text class='good_num'>150</text> | ||
28 | + <text>积分</text> | ||
29 | + </text> | ||
30 | + <text class='original_price'>250积分</text> | ||
31 | + </view> | ||
32 | + </view> | ||
33 | + </view> | ||
34 | + <view class=''>X1</view> | ||
35 | + </view> | ||
36 | + </view> | ||
37 | +</view> |
pages/mall/charge/charge.wxss
0 → 100644
1 | +/* pages/mall/charge/charge.wxss */ | ||
2 | + | ||
3 | +page { | ||
4 | + background: #fcfbfa; | ||
5 | +} | ||
6 | + | ||
7 | +.content_box { | ||
8 | + padding: 16rpx 30rpx; | ||
9 | +} | ||
10 | + | ||
11 | +.list_box { | ||
12 | + background: #fff; | ||
13 | + border-radius: 20rpx; | ||
14 | + margin-bottom: 16rpx; | ||
15 | + padding: 30rpx; | ||
16 | + box-sizing: border-box; | ||
17 | +} | ||
18 | + | ||
19 | +.item_list { | ||
20 | + display: flex; | ||
21 | + align-items: center; | ||
22 | + justify-content: space-between; | ||
23 | + font-size: 26rpx; | ||
24 | + color: #1a1a1a; | ||
25 | +} | ||
26 | + | ||
27 | +.list_title { | ||
28 | + font-size: 30rpx; | ||
29 | + font-weight: bold; | ||
30 | + color: #26363a; | ||
31 | + margin-bottom: 30rpx; | ||
32 | +} | ||
33 | +.list_info_box{ | ||
34 | + display: flex; | ||
35 | + align-items: center; | ||
36 | +} | ||
37 | +.list_img{ | ||
38 | + width: 128rpx; | ||
39 | + height: 128rpx; | ||
40 | + border-radius: 5rpx; | ||
41 | + margin-right: 30rpx; | ||
42 | +} | ||
43 | +.list_img image{ | ||
44 | + width: 100%; | ||
45 | + height: 100%; | ||
46 | +} |
pages/mall/mall.js
0 → 100644
1 | +// pages/mall/mall.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/mall/mall.json
0 → 100644
pages/mall/mall.wxml
0 → 100644
1 | +<!--pages/mall/mall.wxml--> | ||
2 | +<view class='goods_box'> | ||
3 | + <view class='good_item' wx:for='{{[1,1,1,1,1]}}'> | ||
4 | + <view class='good_img'> | ||
5 | + <image src='/images/good.png'></image> | ||
6 | + </view> | ||
7 | + <view class='good_info_box'> | ||
8 | + <view class='good_title'>红枣酿造酒贵族经典</view> | ||
9 | + <view class='good_info'>奶油味夏威夷果200g/袋</view> | ||
10 | + <view class='good_num_box'> | ||
11 | + <view> | ||
12 | + <text class='good_num'>150</text> | ||
13 | + <text>积分</text> | ||
14 | + </view> | ||
15 | + <view class='original_price'>250积分</view> | ||
16 | + </view> | ||
17 | + <view class='charge_btn'>立即兑换</view> | ||
18 | + </view> | ||
19 | + </view> | ||
20 | +</view> |
pages/mall/mall.wxss
0 → 100644
1 | +/* pages/mall/mall.wxss */ | ||
2 | + | ||
3 | +.goods_box{ | ||
4 | + display: flex; | ||
5 | + align-items: center; | ||
6 | + justify-content: space-between; | ||
7 | + flex-wrap: wrap; | ||
8 | +} | ||
9 | +.good_item{ | ||
10 | + margin-bottom: 40rpx; | ||
11 | +} | ||
12 | +.good_img { | ||
13 | + width: 370rpx; | ||
14 | + height: 370rpx; | ||
15 | + display: flex; | ||
16 | + align-items: center; | ||
17 | + justify-content: center; | ||
18 | +} | ||
19 | + | ||
20 | +.good_img image { | ||
21 | + width: 100%; | ||
22 | + height: 100%; | ||
23 | +} | ||
24 | + | ||
25 | +.charge_btn { | ||
26 | + width: 189rpx; | ||
27 | + height: 60rpx; | ||
28 | + background: rgba(255, 173, 80, 1); | ||
29 | + border-radius: 30rpx; | ||
30 | + font-size: 30rpx; | ||
31 | + color: #fff; | ||
32 | + display: flex; | ||
33 | + align-items: center; | ||
34 | + justify-content: center; | ||
35 | + margin-top: 27rpx; | ||
36 | +} | ||
37 | + | ||
38 | +.good_info_box { | ||
39 | + padding: 20rpx 32rpx; | ||
40 | +} | ||
41 | + | ||
42 | +.good_title { | ||
43 | + font-size: 28rpx; | ||
44 | + color: #000; | ||
45 | +} | ||
46 | + | ||
47 | +.good_info { | ||
48 | + font-size: 26rpx; | ||
49 | + color: #666; | ||
50 | + margin-top: 20rpx; | ||
51 | +} | ||
52 | + | ||
53 | +.good_num_box { | ||
54 | + font-size: 24rpx; | ||
55 | + color: #f00; | ||
56 | + display: flex; | ||
57 | + align-items: center; | ||
58 | + margin-top: 20rpx; | ||
59 | +} | ||
60 | + | ||
61 | +.good_num { | ||
62 | + font-size: 32rpx; | ||
63 | +} | ||
64 | + | ||
65 | +.original_price { | ||
66 | + color: #a5a6a8; | ||
67 | + text-decoration: line-through; | ||
68 | + margin-left: 26rpx; | ||
69 | +} |
pages/my/my.js
0 → 100644
1 | +// pages/my/my.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/my/my.json
0 → 100644
1 | +{} |
pages/my/my.wxml
0 → 100644
pages/my/my.wxss
0 → 100644
1 | +/* pages/my/my.wxss */ |
pages/signIn/Weight/Weight.js
0 → 100644
1 | +// pages/signIn/Weight/Weight.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/signIn/Weight/Weight.json
0 → 100644
1 | +{} |
pages/signIn/Weight/Weight.wxml
0 → 100644
pages/signIn/Weight/Weight.wxss
0 → 100644
1 | +/* pages/signIn/Weight/Weight.wxss */ |
pages/signIn/bodyWeght/bodyWeght.js
0 → 100644
1 | +// pages/signIn/bodyWeght/bodyWeght.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/signIn/bodyWeght/bodyWeght.json
0 → 100644
pages/signIn/bodyWeght/bodyWeght.wxml
0 → 100644
1 | +<!--pages/signIn/bodyWeght/bodyWeght.wxml--> | ||
2 | +<view class='content_box'> | ||
3 | + <view class='list_box'> | ||
4 | + <view class='item_list'> | ||
5 | + <view>测量日期</view> | ||
6 | + <view class='list_input'>2018年12月19日</view> | ||
7 | + </view> | ||
8 | + <view class='item_list'> | ||
9 | + <view>测量日期</view> | ||
10 | + <view class='list_input'><input placeholder='请输入当天体重kg' placeholder-class='input_color'></input></view> | ||
11 | + </view> | ||
12 | + </view> | ||
13 | + <view class='list_box'> | ||
14 | + <view class='item_list'> | ||
15 | + <view>我的体重数据</view> | ||
16 | + <view class='list_input'><text class='iconfont icon-arrow-right'></text></view> | ||
17 | + </view> | ||
18 | + </view> | ||
19 | +</view> | ||
20 | +<view class='bottom_btn'>保存</view> |
pages/signIn/bodyWeght/bodyWeght.wxss
0 → 100644
1 | +/* pages/signIn/bodyWeght/bodyWeght.wxss */ | ||
2 | + | ||
3 | +page { | ||
4 | + background: #fcfbfa; | ||
5 | +} | ||
6 | + | ||
7 | +.list_box { | ||
8 | + margin-top: 20rpx; | ||
9 | +} | ||
10 | + | ||
11 | +.item_list { | ||
12 | + font-size: 30rpx; | ||
13 | + color: #000; | ||
14 | + border-bottom: 1rpx solid #ebebeb; | ||
15 | + background: #fff; | ||
16 | + padding: 28rpx 33rpx; | ||
17 | + display: flex; | ||
18 | + align-items: center; | ||
19 | + justify-content: space-between; | ||
20 | +} | ||
21 | + | ||
22 | +.item_list:last-child { | ||
23 | + border: 0; | ||
24 | +} | ||
25 | + | ||
26 | +.list_input { | ||
27 | + font-size: 26rpx; | ||
28 | + color: #666; | ||
29 | +} | ||
30 | + | ||
31 | +.list_input input { | ||
32 | + text-align: right; | ||
33 | +} | ||
34 | + | ||
35 | +.input_color, .icon-arrow-right { | ||
36 | + font-size: 26rpx; | ||
37 | + color: #666; | ||
38 | +} | ||
39 | + | ||
40 | +.bottom_btn { | ||
41 | + width: 90%; | ||
42 | + height: 80rpx; | ||
43 | + background: rgba(255, 173, 80, 1); | ||
44 | + border-radius: 40rpx; | ||
45 | + font-size: 30rpx; | ||
46 | + color: #fff; | ||
47 | + position: fixed; | ||
48 | + bottom: 30rpx; | ||
49 | + left: 50%; | ||
50 | + transform: translateX(-50%); | ||
51 | + display: flex; | ||
52 | + align-items: center; | ||
53 | + justify-content: center; | ||
54 | +} |
pages/signIn/dailySignIn/dailySignIn.js
0 → 100644
1 | +// pages/signIn/dailySignIn/dailySignIn.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/signIn/dailySignIn/dailySignIn.json
0 → 100644
pages/signIn/dailySignIn/dailySignIn.wxml
0 → 100644
1 | +<!--pages/signIn/dailySignIn/dailySignIn.wxml--> | ||
2 | +<view class='content_box'> | ||
3 | + <view class='hint_box'>累计天数:That Girl——Olly Murs——24HRS(deluxe)</view> | ||
4 | + <view class='list_img'> | ||
5 | + <image src='/images/img.png'></image> | ||
6 | + </view> | ||
7 | + <view class='list_info'> | ||
8 | + <view>冬天太冷了,记得多穿几条秋裤,还有保暖~~~</view> | ||
9 | + <view>——麦夫子</view> | ||
10 | + </view> | ||
11 | +</view> | ||
12 | +<view class='bottom_box'>恭喜您签到成功,积分+5</view> |
pages/signIn/dailySignIn/dailySignIn.wxss
0 → 100644
1 | +/* pages/signIn/dailySignIn/dailySignIn.wxss */ | ||
2 | + | ||
3 | +.content_box { | ||
4 | + display: flex; | ||
5 | + align-items: center; | ||
6 | + justify-content: center; | ||
7 | + flex-direction: column; | ||
8 | + padding: 35rpx 32rpx; | ||
9 | +} | ||
10 | + | ||
11 | +.hint_box { | ||
12 | + width: 100%; | ||
13 | + height: 60rpx; | ||
14 | + line-height: 60rpx; | ||
15 | + background: linear-gradient(to right, rgba(255, 201, 136, 0.9), #ffad50); | ||
16 | + box-shadow: 0rpx 15rpx 30rpx 0rpx rgba(255, 214, 167, 1); | ||
17 | + border-radius: 30rpx; | ||
18 | + font-size: 27rpx; | ||
19 | + color: #fff; | ||
20 | + padding: 0 14rpx; | ||
21 | + box-sizing: border-box; | ||
22 | + display: -webkit-box; | ||
23 | + -webkit-box-orient: vertical; | ||
24 | + -webkit-line-clamp: 1; | ||
25 | + overflow: hidden; | ||
26 | +} | ||
27 | + | ||
28 | +.list_img { | ||
29 | + width: 100%; | ||
30 | + height: 448rpx; | ||
31 | + display: flex; | ||
32 | + align-items: center; | ||
33 | + justify-content: center; | ||
34 | + margin-top: 36rpx; | ||
35 | +} | ||
36 | + | ||
37 | +.list_img image { | ||
38 | + width: 100%; | ||
39 | + height: 100%; | ||
40 | +} | ||
41 | + | ||
42 | +.list_info { | ||
43 | + width: 100%; | ||
44 | + font-size: 28rpx; | ||
45 | + color: #000; | ||
46 | + margin-top: 59rpx; | ||
47 | + line-height: 60rpx; | ||
48 | +} | ||
49 | + | ||
50 | +.bottom_box { | ||
51 | + width: 100%; | ||
52 | + height: 165rpx; | ||
53 | + position: fixed; | ||
54 | + bottom: 0; | ||
55 | + left: 0; | ||
56 | + background: rgba(255, 173, 80, 1); | ||
57 | + border-radius: 36rpx 36rpx 0rpx 0rpx; | ||
58 | + font-size: 28rpx; | ||
59 | + color: #fff; | ||
60 | + display: flex; | ||
61 | + align-items: center; | ||
62 | + justify-content: center; | ||
63 | +} |
pages/signIn/daySignIn/daySignIn.js
0 → 100644
1 | +// pages/signIn/daySignIn/daySignIn.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/signIn/daySignIn/daySignIn.json
0 → 100644
pages/signIn/daySignIn/daySignIn.wxml
0 → 100644
1 | +<!--pages/signIn/daySignIn/daySignIn.wxml--> | ||
2 | +<view class='banner_box'> | ||
3 | + <view class='banner_item'>累计天数</view> | ||
4 | + <view class='banner_item'>连续天数</view> | ||
5 | + <view class='banner_item'>最长连续</view> | ||
6 | + <view class='banner_item banner_value'>3</view> | ||
7 | + <view class='banner_item banner_value'>2</view> | ||
8 | + <view class='banner_item banner_value'>1</view> | ||
9 | +</view> | ||
10 | +<view class='content_box'> | ||
11 | + <view class='list_info'>稳定血糖,从规律饮食开始!</view> | ||
12 | + <view class='circle_box'> | ||
13 | + <view>签到</view> | ||
14 | + <view class='time_info'>07:23:34</view> | ||
15 | + </view> | ||
16 | + <view class='list_info'>已进入早打卡时间范围</view> | ||
17 | +</view> | ||
18 | +<view class='footer_box'> | ||
19 | + <view class='footer_item'> | ||
20 | + <view>早</view> | ||
21 | + <view>午</view> | ||
22 | + <view>晚</view> | ||
23 | + <view>睡前</view> | ||
24 | + </view> | ||
25 | + <view class='footer_item footer_time'> | ||
26 | + <view class='footer_info'> | ||
27 | + <view>2018/10/19</view> | ||
28 | + <view>7:23:13</view> | ||
29 | + </view> | ||
30 | + <view class='footer_info'> | ||
31 | + <view>2018/10/19</view> | ||
32 | + <view>7:23:13</view> | ||
33 | + </view> | ||
34 | + <view class='footer_info'> | ||
35 | + <view>2018/10/19</view> | ||
36 | + <view>7:23:13</view> | ||
37 | + </view> | ||
38 | + <view class='footer_info'> | ||
39 | + <view>2018/10/19</view> | ||
40 | + <view>7:23:13</view> | ||
41 | + </view> | ||
42 | + </view> | ||
43 | +</view> |
pages/signIn/daySignIn/daySignIn.wxss
0 → 100644
1 | +/* pages/signIn/daySignIn/daySignIn.wxss */ | ||
2 | + | ||
3 | +.banner_box { | ||
4 | + display: flex; | ||
5 | + align-items: center; | ||
6 | + justify-content: space-between; | ||
7 | + flex-wrap: wrap; | ||
8 | + padding: 30rpx 35rpx; | ||
9 | +} | ||
10 | + | ||
11 | +.banner_item { | ||
12 | + width: 212rpx; | ||
13 | + height: 78rpx; | ||
14 | + background: #ffad50; | ||
15 | + border-radius: 16rpx; | ||
16 | + font-size: 28rpx; | ||
17 | + color: #fff; | ||
18 | + display: flex; | ||
19 | + align-items: center; | ||
20 | + justify-content: center; | ||
21 | + margin-bottom: 8rpx; | ||
22 | +} | ||
23 | + | ||
24 | +.banner_value { | ||
25 | + background: #f5f6fa; | ||
26 | + color: #000; | ||
27 | +} | ||
28 | + | ||
29 | +.content_box { | ||
30 | + display: flex; | ||
31 | + align-items: center; | ||
32 | + justify-content: center; | ||
33 | + flex-direction: column; | ||
34 | +} | ||
35 | + | ||
36 | +.circle_box { | ||
37 | + width: 300rpx; | ||
38 | + height: 300rpx; | ||
39 | + background: linear-gradient(100deg, rgba(255, 201, 136, 0.8), #ffad50); | ||
40 | + box-shadow: 0rpx 15rpx 30rpx 0rpx rgba(255, 211, 160, 1); | ||
41 | + border-radius: 50%; | ||
42 | + display: flex; | ||
43 | + align-items: center; | ||
44 | + justify-content: center; | ||
45 | + flex-direction: column; | ||
46 | + font-size: 48rpx; | ||
47 | + color: #fff; | ||
48 | +} | ||
49 | + | ||
50 | +.time_info { | ||
51 | + font-size: 32rpx; | ||
52 | + margin-top: 35rpx; | ||
53 | +} | ||
54 | + | ||
55 | +.list_info { | ||
56 | + font-size: 28rpx; | ||
57 | + font-weight: bold; | ||
58 | + color: #000; | ||
59 | + text-align: center; | ||
60 | + margin: 50rpx auto; | ||
61 | +} | ||
62 | + | ||
63 | +.footer_box { | ||
64 | + width: 100%; | ||
65 | + position: fixed; | ||
66 | + bottom: 0; | ||
67 | + left: 0; | ||
68 | +} | ||
69 | + | ||
70 | +.footer_item { | ||
71 | + height: 100rpx; | ||
72 | + background: #ffad50; | ||
73 | + border-radius: 16rpx 16rpx 0 0; | ||
74 | + display: flex; | ||
75 | + align-items: center; | ||
76 | + justify-content: space-between; | ||
77 | +} | ||
78 | + | ||
79 | +.footer_item view { | ||
80 | + width: 25%; | ||
81 | + text-align: center; | ||
82 | + font-size: 28rpx; | ||
83 | + color: #fff; | ||
84 | +} | ||
85 | + | ||
86 | +.footer_time { | ||
87 | + height: 117rpx; | ||
88 | + background: #f5f6fa; | ||
89 | +} | ||
90 | + | ||
91 | +.footer_time view { | ||
92 | + font-size: 24rpx; | ||
93 | + color: #000; | ||
94 | + text-align: center; | ||
95 | +} | ||
96 | + | ||
97 | +.footer_info view{ | ||
98 | + width: 100%; | ||
99 | + text-align: center; | ||
100 | +} |
pages/signIn/signIn.js
0 → 100644
1 | +// pages/signIn/signIn.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/signIn/signIn.json
0 → 100644
1 | +{} |
pages/signIn/signIn.wxml
0 → 100644
pages/signIn/signIn.wxss
0 → 100644
1 | +/* pages/signIn/signIn.wxss */ |
project.config.json
0 → 100644
1 | +{ | ||
2 | + "description": "项目配置文件", | ||
3 | + "packOptions": { | ||
4 | + "ignore": [] | ||
5 | + }, | ||
6 | + "setting": { | ||
7 | + "urlCheck": true, | ||
8 | + "es6": true, | ||
9 | + "postcss": true, | ||
10 | + "minified": true, | ||
11 | + "newFeature": true | ||
12 | + }, | ||
13 | + "compileType": "miniprogram", | ||
14 | + "libVersion": "2.4.0", | ||
15 | + "appid": "wx48319d952ea4e37f", | ||
16 | + "projectname": "%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9", | ||
17 | + "debugOptions": { | ||
18 | + "hidedInDevtools": [] | ||
19 | + }, | ||
20 | + "isGameTourist": false, | ||
21 | + "condition": { | ||
22 | + "search": { | ||
23 | + "current": -1, | ||
24 | + "list": [] | ||
25 | + }, | ||
26 | + "conversation": { | ||
27 | + "current": -1, | ||
28 | + "list": [] | ||
29 | + }, | ||
30 | + "game": { | ||
31 | + "currentL": -1, | ||
32 | + "list": [] | ||
33 | + }, | ||
34 | + "miniprogram": { | ||
35 | + "current": -1, | ||
36 | + "list": [] | ||
37 | + } | ||
38 | + } | ||
39 | +} |
utils/util.js
0 → 100644
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 | +} |
-
请 注册 或 登录 后发表评论