diff --git a/pages/ConsumeDetail/ConsumeDetail.js b/pages/ConsumeDetail/ConsumeDetail.js index 32b524d..54c6822 100644 --- a/pages/ConsumeDetail/ConsumeDetail.js +++ b/pages/ConsumeDetail/ConsumeDetail.js @@ -5,17 +5,18 @@ const util = require("../../utils/util"); const imgurl = require("../../utils/imgurl"); Page({ data: { - fenxiangUrl:imgurl.fenxiang.url, - clockUrl:imgurl.clock.url, - teljpgUrl:imgurl.teljpg.url, - closedUrl:imgurl.closed.url, - quesGouUrl:imgurl.ques_gou.url, - headbgUrl:imgurl.headbg.url, - quesBgUrl:imgurl.ques_bg.url, + fenxiangUrl: imgurl.fenxiang.url, + clockUrl: imgurl.clock.url, + teljpgUrl: imgurl.teljpg.url, + closedUrl: imgurl.closed.url, + quesGouUrl: imgurl.ques_gou.url, + headbgUrl: imgurl.headbg.url, + quesBgUrl: imgurl.ques_bg.url, + cardDetail:null, data: { title: null }, - showPage:false, + showPage: false, questions1: null, questions2: null, carList: [], @@ -31,7 +32,7 @@ Page({ id: null, result: [], end_time: null, - checked:false, + checked: false, clock: "已经截止", questionnaire: {}, questionId: null, @@ -42,11 +43,11 @@ Page({ scaleData: null, skewData: null, matrixData: null, - opacity:0, - queueData:null, - zIndex:11, - display:"none", - showbutton:false + opacity: 0, + queueData: null, + zIndex: 11, + display: "none", + showbutton: false }, phone: function (e) { let that = this; @@ -55,6 +56,12 @@ Page({ }); }, onLoad(options) { + let that = this; + console.log(options.cardId) + that.cardpayList(options.cardId); + that.cardDetail(options.cardId); + }, + cardpayList: function (cardId) { let that = this; wx.showLoading({ title: "加载中..." @@ -62,51 +69,68 @@ Page({ var parmer = { url: config.api.cardpayList, data: { - cardId: options.cardId, - pageNum:1, - pageSize:100 + cardId: cardId, + pageNum: 1, + pageSize: 100 } }; Http.get(parmer) + .then(res => { + console.log(res); + if (res.code == 200 && res.data.list.length > 0) { + that.setData({ + showPage: true + }) + } else { + wx.showModal({ + title: '抱歉', + content: '暂无消费记录', + showCancel: false, + success: function (res) { + } + }) + } + wx.hideLoading(); + res.data.list.map(file => { + file.updateDate = util.formatTime(file.updateDate, "yyyy-MM-dd hh:mm:ss") + }) + that.setData({ + data: res.data.list + }); + }).catch(err => { + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + cardDetail: function (couponOrderId) { + let that = this; + Http.get({ + url: config.api.cardDetail, + data: { + couponOrderId: couponOrderId + } + }) .then(res => { - console.log(res); - if (res.code == 200 && res.data.list.length>0){ + console.log(res) + if (res.code == 200) { + res.data.expiredTime = util.formatTime(res.data.expiredTime, "yyyy-MM-dd hh:mm:ss") that.setData({ - showPage:true - }) - }else{ - wx.showModal({ - title: '抱歉', - content: '暂无数据', - showCancel:false, - success:function(res){ - if(res.confirm){ - wx.navigateBack({ - url: '/pages/cardorder/index' - }) - } - } + showPage: true, + cardDetail:res.data }) } - wx.hideLoading(); - res.data.list.map(file=>{ - file.updateDate = util.formatTime(file.updateDate, "yyyy-MM-dd hh:mm:ss") - }) - that.setData({ - data: res.data.list - }); - }).catch(err => { - wx.showToast({ - title: err.message, - icon: 'none', - duration: 2000, - mask: false - }); }) - }, - onShow(){ - this.setData({ - showbutton:false + .catch(err => { + console.log(err) }) }, -}); \ No newline at end of file + onShow() { + this.setData({ + showbutton: false + }) +}, + }); \ No newline at end of file diff --git a/pages/ConsumeDetail/ConsumeDetail.wxml b/pages/ConsumeDetail/ConsumeDetail.wxml index 0c34c70..8ea5bc2 100644 --- a/pages/ConsumeDetail/ConsumeDetail.wxml +++ b/pages/ConsumeDetail/ConsumeDetail.wxml @@ -1,9 +1,37 @@ - + + {{cardDetail.title}} + + {{cardDetail.expiredTime}} + 余额:¥{{cardDetail.remainingAmount/100}} + + + - 交易明细: + 购买须知 + + {{cardDetail.remark}} + + + + 使用门店: + + + + + + 交易明细: {{item.merchantName}} diff --git a/pages/ConsumeDetail/ConsumeDetail.wxss b/pages/ConsumeDetail/ConsumeDetail.wxss index 4a2300b..73480e6 100644 --- a/pages/ConsumeDetail/ConsumeDetail.wxss +++ b/pages/ConsumeDetail/ConsumeDetail.wxss @@ -1,29 +1,149 @@ -.notes{ - padding: 0 32rpx; +.notes { + padding: 32rpx; } -.record text:nth-of-type(2n+1){ + +.record text:nth-of-type(2n+1) { float: left; } -.record text:nth-of-type(2n){ + +.record text:nth-of-type(2n) { float: right; } -.record text{ + +.record text { font-size: 28rpx; color: #333; } -.record1 text:nth-of-type(2){ - color: #FF3535; + +.record1 text:nth-of-type(2) { + color: #ff3535; } -.record1 text:nth-of-type(1){ + +.record1 text:nth-of-type(1) { font-size: 32rpx; } -.record1{ + +.record1 { margin-top: 15rpx; } -.title{ - font-size: 34rpx; + +.title { + display: block; font-weight: bold; + font-size: 32rpx; + color: rgba(51, 51, 51, 1); } -.record2{ + +.record2 { margin-top: 16rpx; +} + +.posi { + position: relative; + width: 100%; + margin: 0 auto; +} + +.posi>view:nth-child(2) { + width: 100%; + height: 87rpx; + display: flex; + justify-content: space-between; + border-top: 1px solid #f6f6f6; + line-height: 87rpx; +} + +.posi>view:nth-child(2) text:nth-child(1) { + font-size: 30rpx; + color: #a9a9a9; +} + +.posi>view:nth-child(2) text:nth-child(2) { + font-size: 30rpx; + color: #a9a9a9; +} + +.posi_logo { + width: 100%; + display: flex; + padding: 20rpx 0; + background: #fff; + height: 100rpx; + margin-bottom: 20rpx; +} + +.posi_logo view:nth-child(1) { + width: 100rpx; + height: 100rpx; + border-radius: 16rpx; +} + +.posi_logo view:nth-child(1) image { + display: block; + width: 100rpx; + height: 100rpx; + border-radius: 16rpx; + border: 1px solid #e5e5e5; +} + +.posi_logo view:nth-child(2) { + display: flex; + flex-direction: column; + flex: 8; + padding-left: 30rpx; +} + +.posi_logo view:nth-child(2) text:nth-child(1) { + font-size: 32rpx; + color: #333; + letter-spacing: 0; +} + +.posi_logo view:nth-child(2) text:nth-child(2) { + font-size: 24rpx; + color: #b8b8b8; + padding-top: 3rpx; + width: 450rpx; + height: 36rpx; + overflow: hidden; +} + +.titles { + font-size: 30rpx; + color: #333; + height: 60rpx; + line-height: 60rpx; +} + +.titles .fr { + color: red; +} + +.notess view:nth-child(1) { + width: 92%; + height: 87rpx; + line-height: 87rpx; + background: #fff; +} + +.notess view:nth-child(2) { + width: 92%; + background: #fff; + display: flex; + flex-direction: column; +} + +.notess view:nth-child(2)>text { + font-size: 28rpx; + color: #919191; + letter-spacing: 0; + line-height: 42rpx; +} +.tel { + right: 0; + top: 0; + bottom: 0; + margin: auto; + width: 50rpx; + height: 50rpx; } \ No newline at end of file diff --git a/pages/cardorder/index/index.wxml b/pages/cardorder/index/index.wxml index 46fb7b0..f8f5edb 100644 --- a/pages/cardorder/index/index.wxml +++ b/pages/cardorder/index/index.wxml @@ -17,7 +17,7 @@ - + {{item.title}} diff --git a/pages/coupon/detail/index.wxss b/pages/coupon/detail/index.wxss index 6ca0180..c21a611 100644 --- a/pages/coupon/detail/index.wxss +++ b/pages/coupon/detail/index.wxss @@ -150,11 +150,7 @@ page { margin-left: 10rpx; } -.posi { - position: relative; - width: 92%; - margin: 0 auto; -} + .fl { float: left; @@ -164,6 +160,11 @@ page { float: right; } +.posi { + position: relative; + width: 92%; + margin: 0 auto; +} .posi>view:nth-child(2) { width: 100%; height: 87rpx;