diff --git a/config/config.js b/config/config.js index cc749f3..6bf4087 100755 --- a/config/config.js +++ b/config/config.js @@ -271,6 +271,10 @@ var config = { * 积分券详情 */ integralDetail:'/wxCoupon/findById', + /** + * 会员积分记录 + */ + integralList:'/credit/list' }, weapp: { AppId: weappId diff --git a/pages/integralmall/integraHistory/index.js b/pages/integralmall/integraHistory/index.js index a23cc1c..c966c1c 100644 --- a/pages/integralmall/integraHistory/index.js +++ b/pages/integralmall/integraHistory/index.js @@ -3,6 +3,7 @@ var app = getApp(); const Http = require("../../../utils/HttpBasics"); let util = require("../../../utils/util"); const imgurl = require("../../../utils/imgurl"); +const {creditType} = require("../../../utils/creditType"); Page({ /** @@ -15,7 +16,8 @@ Page({ showcontent: false, loadingUrl: imgurl.loading.url, bgg: imgurl.bgg.url, - allow_load: true + allow_load: true, + creditAmount:0 }, /** @@ -41,13 +43,18 @@ Page({ var that = this; if (that.data.allow_load) { Http.get({ - url: config.api.scoreHistory, + url: config.api.integralList, data: { pageNum: pageNum, pageSize: 20, } }).then(res => { res.data.list.map(file => { + creditType.map((item,index)=>{ + if (file.creditType==item.value){ + file.creditTypeName = item.name; + } + }) file.createDate = util.formatTime( file.createDate, "yyyy-MM-dd hh:mm:ss" @@ -59,8 +66,10 @@ Page({ }); } that.data.list = that.data.list.concat(res.data.list); + console.log(that.data.list,22222222222) that.setData({ - list: that.data.list + list: that.data.list, + creditAmount: that.data.list[0].creditAmount }); }) .catch(err => { diff --git a/pages/integralmall/integraHistory/index.json b/pages/integralmall/integraHistory/index.json index 226994f..2bd5fcb 100644 --- a/pages/integralmall/integraHistory/index.json +++ b/pages/integralmall/integraHistory/index.json @@ -1,5 +1,5 @@ { - "navigationBarTitleText": "积分记录", + "navigationBarTitleText": "积分变更记录", "enablePullDownRefresh": true, "usingComponents": {} } \ No newline at end of file diff --git a/pages/integralmall/integraHistory/index.wxml b/pages/integralmall/integraHistory/index.wxml index ddcac53..c9d5017 100644 --- a/pages/integralmall/integraHistory/index.wxml +++ b/pages/integralmall/integraHistory/index.wxml @@ -1,6 +1,6 @@ 当前 - {{score}} + {{creditAmount+'分'}} @@ -8,21 +8,12 @@ 积分明细 - 每日登录 - 消费 - 绑车牌 - 连接WIFI - 微信用户昵称授权 - 微信用户手机授权 - 完善个人信息 - 会员导入 - {{item.reason}} + {{item.creditTypeName}} {{item.createDate}} - 重置为{{item.scoreAmount}}分 - +{{item.scoreAmount}}分 - {{item.scoreAmount}}分 + +{{item.creditNum}}分 + {{item.creditNum}}分 \ No newline at end of file diff --git a/utils/creditType.js b/utils/creditType.js new file mode 100644 index 0000000..7b0e439 --- /dev/null +++ b/utils/creditType.js @@ -0,0 +1,17 @@ +let creditType=[ + { name: "每日登录", value: "1" }, + { name: "消费", value: "2" }, + { name: "帮车牌", value: "3" }, + { name: "连接WIFI", value: "4" }, + { name: "微信昵称授权", value: "5" }, + { name: "微信用户手机授权", value: "6" }, + { name: "完善个人信息", value: "7" }, + { name: "积分导入", value: "8" }, + { name: "消费积分", value: "9" }, + { name: "消费积分", value: "10" }, + { name: "积分兑换", value: "11" }, + { name: "线下积分扣除", value: "12" }, +] +module.exports = { + creditType +} \ No newline at end of file