码迷,mamicode.com
首页 > 微信 > 详细

阅读项目:微信日历小程序插件

时间:2019-03-12 22:38:54      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:宽度   display   cloc   this   hide   pos   显示   atime   fun   

韩颖 1759110 软工一班      

我在网上找到了一段别人写的微信小程序代码,主题是日历以及签到。由于市面上的小程序鲜少有签到及积分功能,此款程序内容完备且观点新颖,因此值得我们学习与借鉴。

-----------------------------------------------------------    

以下是小程序插件的代码链接

https://www.cnblogs.com/zengxuelan/p/10030598.html

-----------------------------------------------------------

一 .代码方面:

-----------------------------------------------------------------------

1.签到日历出现及消失 onAppear: function () { // this.clockIn(); this.setData({ display: "block", }) }, onhide: function () { this.setData({ display: "none", })

},

 

2.监听页面加载;根据屏幕宽度变化自动设置宽度 onLoad: function (options) { currentPageUrl = this.route //当前页面url if (Object.keys(options).length != 0) { currentPageOption = util.route(options); } var that = this; uid = wx.getStorageSync("userid"); this.clockIn(); // this.SignRule(); this.getPic(); this.dataScore(); this.setNowDate(); // this.getProWeekList() this.dataTime(); var res = wx.getSystemInfoSync(); this.setData({ sysW: 60, marLet: this.data.firstDay, nowDay: this.data.getDate, getDate: this.data.getDate, judge: 1, month: this.data.month, });

},

 

3.打卡 clockIn:function(){ var that=this; var params = { "uid": uid, "signPosition":‘‘ } util.requestLoading(‘/api/Users/SignIn‘, ‘GET‘, params, ‘‘, function (res) { console.log(res); // that.dataInit(); that.dataScore(); // //console.log(res) var msg = JSON.parse(res).Msg; setTimeout(function(){ wx.showToast({ title: msg, icon: ‘none‘, duration: 3000 }); },1500) }, function (err) { })

},

 

4.打卡 dataScore: function () { var that = this; var params = { "uid": uid } util.requestLoading(‘/test‘, ‘GET‘, params, ‘‘, function (res) { // //console.log(res) that.setData({ allScore: JSON.parse(res).Data.coin }) }, function (err) { })

},

 

5.获取积分规则 SignRule: function () { var that = this; util.requestLoading(‘/test3‘, ‘GET‘, ‘‘, ‘‘, function (res) { // //console.log("积分规则",JSON.parse(res)); var data = JSON.parse(res).Data; for(var i=1;i<data.length;i++){ // //console.log(data[i].daysNum, data[i].score) if (that.data.signInCount == data[i].daysNum-1){ that.setData({ addScore: data[i].score }) }else{ that.setData({ addScore: data[0].score }) } } that.setData({ rules: data }) }, function (err) {

})

----------------------------------------------------------

二.用户体验方面

1.用户在页面上可以看到图片以及激励性质的名人名言,有趣味性。

 

2.当天的日期被放大后在首页上显示,清晰直观。积分和累计签到次数简洁明了,排版比较成功。

 

3.用户在签到过后,当日日期颜色会加深,当月历史签到成功的页面会一并显示,方便用户查看。

 

4.积分机制是这款小程序的一大特色,但是内容亟待改进。积分的累计和奖惩需要进一步的完善。

 

5.由于微信的页面比较简单,没有多余的功能,所以我认为添加一些实用的小功能可以增加用户体验,比如添加当日指定地理位置的天气,或者每日推荐书目等等,增强用户依赖性。

--------------------------------------------------------------------------------

阅读项目:微信日历小程序插件

标签:宽度   display   cloc   this   hide   pos   显示   atime   fun   

原文地址:https://www.cnblogs.com/hanyeong2019/p/10520102.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!