diff --git a/app.json b/app.json index 4809728..823e8a3 100644 --- a/app.json +++ b/app.json @@ -41,7 +41,8 @@ "pages/scanPay/scanPay", "pages/paySuccess/paySuccess", "pages/ConsumeDetail/ConsumeDetail", - "pages/externallinks/index" + "pages/externallinks/index", + "pages/czdetail/czdetail" ], "navigateToMiniProgramAppIdList": [ "wx192b7d2e8dcbefd0", diff --git a/pages/czdetail/czdetail.js b/pages/czdetail/czdetail.js new file mode 100644 index 0000000..2807596 --- /dev/null +++ b/pages/czdetail/czdetail.js @@ -0,0 +1,117 @@ +var config = require("../../config/config.js"); +var app = getApp(); +const Http = require("../../utils/HttpBasics"); +let util = require("../../utils/util"); +Page({ + + /** + * 页面的初始数据 + */ + data: { + score: 10, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + + }, + gotorule: function() { + wx.navigateTo({ + url: '/pages/grade/grade', + }) + }, + record: function() { + let that = this; + Http.get({ + url: config.api.scoreHistory, + data: { + pageNum: 1, + pageSize: 100 + } + }) + .then(res => { + console.log(res) + if (res.data.list.length > 0) { + res.data.list.map(file=>{ + file.createDate = util.formatTime(file.createDate, "yyyy-MM-dd hh:mm:ss") + }); + that.setData({ + list:res.data.list + }) + } + }) + .catch(err => { + wx.showModal({ + title: '抱歉', + content: err.message, + showCancel:false + }) + }) + }, + getScore: function() { + let that = this; + Http.get({ + url: config.api.getScore, + data: {} + }) + .then(res => { + console.log(res) + that.setData({ + score: res.data.score, + levelName: res.data.levelName, + }) + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + let that = this; + that.getScore(); + that.record(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + + } +}) \ No newline at end of file diff --git a/pages/czdetail/czdetail.json b/pages/czdetail/czdetail.json new file mode 100644 index 0000000..cd2bb5f --- /dev/null +++ b/pages/czdetail/czdetail.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "成长值" +} \ No newline at end of file diff --git a/pages/czdetail/czdetail.wxml b/pages/czdetail/czdetail.wxml new file mode 100644 index 0000000..28db773 --- /dev/null +++ b/pages/czdetail/czdetail.wxml @@ -0,0 +1,18 @@ + + 当前 + {{score}} + 规则 + + + + 成长值明细 + + + {{item.scoreAmount}} + {{item.createDate}} + + + +{{item.scoreAmount}}分 + + + \ No newline at end of file diff --git a/pages/czdetail/czdetail.wxss b/pages/czdetail/czdetail.wxss new file mode 100644 index 0000000..2e65718 --- /dev/null +++ b/pages/czdetail/czdetail.wxss @@ -0,0 +1,100 @@ +/* pages/czdetail/czdetail.wxss */ + +.head { + height: 252rpx; + background: #02c0ff; + position: relative; +} + +.rule { + position: absolute; + right: 0; + top: 0; + bottom: 0; + margin: auto; + width: 124rpx; + height: 48rpx; + line-height: 48rpx; + text-align: center; + background: #fff; + font-size: 28rpx; + font-weight: 400; + color: rgba(2, 192, 255, 1); + border-bottom-left-radius: 50rpx; + border-top-left-radius: 50rpx; +} + +.head text { + display: block; + text-align: center; + color: #fff; +} + +.head text:nth-of-type(1) { + font-size: 28rpx; + font-family: PingFang-SC-Regular; + font-weight: 400; + color: rgba(255, 255, 255, 1); +} + +.head text:nth-of-type(2) { + font-size: 70rpx; + font-family: PingFang-SC-Bold; + font-weight: bold; + color: rgba(255, 255, 255, 1); +} + +.bg { + position: absolute; + bottom: 0; + left: 0; + right: 0; + width: 100%; + height: 55rpx; +} + +.content { + position: relative; + padding: 0 35rpx; + height: 145rpx; + border-bottom: 1px solid #eaeaea; +} + +.content>view:nth-of-type(2n+1) text { + display: block; +} + +.content>view:nth-of-type(2n+1) text:nth-of-type(1) { + margin-top: 24rpx; +} + +.content>view:nth-of-type(2n+1) text:nth-of-type(2) { + margin-top: 10rpx; + font-size: 26rpx; + font-family: PingFang-SC-Bold; + color: rgba(153, 153, 153, 1); +} + +.content>view:nth-of-type(2n+1) { + float: left; + width: 78%; +} + +.content>view:nth-of-type(2n) { + width: 20%; + float: right; + text-align: right; + line-height: 145rpx; +} + +.title { + display: block; + text-align: center; + font-size: 30rpx; + font-family: PingFang-SC-Regular; + font-weight: 400; + color: rgba(51, 51, 51, 1); +} +.fr text{ + color: #FF3535; +} \ No newline at end of file diff --git a/pages/user/index.js b/pages/user/index.js index 6c98754..f150fc5 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -38,7 +38,7 @@ Page({ */ gotograde:function(){ wx.navigateTo({ - url: '/pages/grade/grade', + url: '/pages/czdetail/czdetail', }) }, // getrun:function(){ diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 8bd748c..6fadc22 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -72,16 +72,6 @@ - - - - - 成长值规则 - - - - -