diff --git a/app.json b/app.json index baeb2d2..4e8ab1c 100644 --- a/app.json +++ b/app.json @@ -1,6 +1,7 @@ { "pages": [ "pages/index/index", + "pages/cardorder/index/index", "pages/scanPay/scanPay", "pages/edit/edit", "pages/cartest/cartest", @@ -14,7 +15,6 @@ "pages/rushToBuy/index", "pages/couponorder/index/index", "pages/couponorder/detail/index", - "pages/cardorder/index/index", "pages/cardorder/detail/index", "pages/cardorder/userule/userule", "pages/order/detail/index", diff --git a/pages/ConsumeDetail/ConsumeDetail.js b/pages/ConsumeDetail/ConsumeDetail.js index d3c9c6a..f6a56e0 100644 --- a/pages/ConsumeDetail/ConsumeDetail.js +++ b/pages/ConsumeDetail/ConsumeDetail.js @@ -13,7 +13,7 @@ Page({ headbgUrl: imgurl.headbg.url, quesBgUrl: imgurl.ques_bg.url, dingdanUrl: imgurl.dingdan.url, - cardDetail:null, + cardDetail: null, data: { title: null }, @@ -48,21 +48,45 @@ Page({ queueData: null, zIndex: 11, display: "none", - showbutton: false + showbutton: false, + hidden: "hidden", + height: "auto", + more: "点击查看更多", + showMore: true }, - phone: function (e) { + phone: function(e) { let that = this; wx.makePhoneCall({ phoneNumber: e.target.dataset.merchantlinkphone }); }, + // 点击查看更多 + more: function() { + let that = this; + + if (that.data.height == 'auto') { + this.setData({ + hidden: "hidden", + height: "auto", + more: "点击查看更多", + showMore: true + }) + } else { + this.setData({ + hidden: "", + height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx', + more: "", + showMore: false + }) + } + }, onLoad(options) { let that = this; console.log(options.cardId) that.cardpayList(options.cardId); that.cardDetail(options.cardId); }, - cardpayList: function (cardId) { + cardpayList: function(cardId) { let that = this; wx.showLoading({ title: "加载中..." @@ -82,8 +106,7 @@ Page({ that.setData({ showPage: true }) - } else { - } + } else {} wx.hideLoading(); res.data.list.map(file => { file.updateDate = util.formatTime(file.updateDate, "yyyy-MM-dd hh:mm:ss") @@ -100,31 +123,41 @@ Page({ }); }) }, - cardDetail: function (couponOrderId) { + 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.expiredTime = util.formatTime(res.data.expiredTime, "yyyy-MM-dd hh:mm:ss") - that.setData({ - showPage: true, - cardDetail:res.data - }) - } - }) - .catch(err => { - console.log(err) - }) + url: config.api.cardDetail, + data: { + couponOrderId: couponOrderId + } + }) + .then(res => { + 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, + cardDetail: res.data + }) + if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length<=4){ + that.setData({ + height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx' + }) + } else if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length >= 4){ + that.setData({ + height: 4 * 140 + 'rpx' + }) + } + } + }) + .catch(err => { + console.log(err) + }) }, onShow() { - this.setData({ - showbutton: false - }) -}, - }); \ No newline at end of file + let that = this; + that.setData({ + showbutton: false + }) + }, +}); \ No newline at end of file diff --git a/pages/ConsumeDetail/ConsumeDetail.wxml b/pages/ConsumeDetail/ConsumeDetail.wxml index 6403837..169139c 100644 --- a/pages/ConsumeDetail/ConsumeDetail.wxml +++ b/pages/ConsumeDetail/ConsumeDetail.wxml @@ -1,4 +1,27 @@ + + {{cardDetail.title}} + + 有效期:{{cardDetail.expiredTime}} + 余额: + {{cardDetail.remainingAmount/100}} + + + 适用门店 + + + + {{more}} + 交易记录 {{item.merchantName}} diff --git a/pages/ConsumeDetail/ConsumeDetail.wxss b/pages/ConsumeDetail/ConsumeDetail.wxss index 22e991b..b09870c 100644 --- a/pages/ConsumeDetail/ConsumeDetail.wxss +++ b/pages/ConsumeDetail/ConsumeDetail.wxss @@ -27,6 +27,7 @@ } .title { display: block; + padding: 0 32rpx; font-weight: bold; font-size: 32rpx; color: rgba(51, 51, 51, 1); @@ -43,7 +44,7 @@ .posi { position: relative; - width: 100%; + padding: 0 32rpx; margin: 0 auto; } @@ -52,7 +53,6 @@ height: 87rpx; display: flex; justify-content: space-between; - border-top: 1px solid #f6f6f6; line-height: 87rpx; } @@ -72,7 +72,6 @@ padding: 20rpx 0; background: #fff; height: 100rpx; - margin-bottom: 20rpx; } .posi_logo view:nth-child(1) { @@ -121,6 +120,9 @@ .titles .fr { color: red; } +.titles .fr text{ + font-size: 42rpx; +} .notess view:nth-child(1) { width: 92%; @@ -167,6 +169,7 @@ color: #333; letter-spacing: 0; text-align: center; + padding: 30rpx 0; } .dingdan text:nth-of-type(2) { @@ -182,4 +185,14 @@ width: 300rpx; height: 300rpx; margin: 0 auto 16rpx; +} +.head{ + padding:32rpx 32rpx 0; +} +.bottom{ + text-align: center; + height: 70rpx; + line-height: 70rpx; + color: #999; + font-size: 32rpx; } \ No newline at end of file diff --git a/pages/cardorder/index/index.js b/pages/cardorder/index/index.js index 283417c..de1eeb6 100644 --- a/pages/cardorder/index/index.js +++ b/pages/cardorder/index/index.js @@ -72,7 +72,6 @@ Page({ }, // 跳转到详情 gotoConsumeDetail: function(e) { - console.log(e.currentTarget.dataset.id) wx.navigateTo({ url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`, }) @@ -128,7 +127,7 @@ Page({ }) } res.data.list.map(file => { - file.expiredTime = util.fmtDate(file.expiredTime); + file.expiredTime = util.formatTime(file.expiredTime, "yyyy.MM.dd") if (file.couponOrderStatus == 5 || file.couponOrderStatus == 6 || file.couponOrderStatus == 7) { file.background = 'rgba(179,180,181,1)'; file.showImg = true; diff --git a/pages/cardorder/index/index.wxml b/pages/cardorder/index/index.wxml index 8db5c62..dd4d7a8 100644 --- a/pages/cardorder/index/index.wxml +++ b/pages/cardorder/index/index.wxml @@ -17,23 +17,20 @@ - - - {{item.title}} - - - + + + {{item.remainingAmount/100}} {{item.expiredTime}}到期 - 余额{{item.remainingAmount/100}} + + + {{item.title}} - 扫一扫付款 - - 已过期 - 余额已用完 - 已线下退款 - - + 扫一扫付款 + 再次购买 + 已过期 + 余额已用完 + 已线下退款 @@ -41,7 +38,7 @@ - 适用规则 + 使用规则 {{content}} diff --git a/pages/cardorder/index/index.wxss b/pages/cardorder/index/index.wxss index d2451b9..67f7141 100644 --- a/pages/cardorder/index/index.wxss +++ b/pages/cardorder/index/index.wxss @@ -28,26 +28,33 @@ position: relative; width: 690rpx; background: #fff; - padding: 36rpx 0 0; + height: 238rpx; margin: 0 auto 40rpx; border-radius: 16rpx; box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10); } +.yu { + display: inline-block !important; + font-size: 30rpx; +} + .expiretime { - display: block; - width: 100% !important; - text-align: left; - text-indent: 1em; - height: 40rpx; - line-height: 36rpx; - font-size: 22rpx; - color: #333; - letter-spacing: 0; + width: 250rpx; } -.expiretime .fr { - margin-right: 20rpx; +.expiretime text { + display: block; + width: 262rpx; + font-size: 30rpx; + font-family: PingFang-SC-Medium; + font-weight: 500; + white-space: nowrap; + text-align: center; + text-overflow: ellipsis; + overflow: hidden; + margin-top: 35rpx; + color: rgba(255, 255, 255, 1); } .money { @@ -76,20 +83,14 @@ border-radius: 50%; } -.info >view view:nth-child(1) { - display: flex; - justify-content: space-between; - padding: 0 2%; -} - .info { width: 100%; } -.info >view view:nth-child(1) text { - font-size: 32rpx; - line-height: 32rpx; - height: 32rpx; +.info .title .yue { + font-size: 60rpx; + line-height: 60rpx; + font-weight: bold; color: #fff; letter-spacing: 0; width: 400rpx; @@ -98,6 +99,8 @@ text-overflow: ellipsis; overflow: hidden; margin-bottom: 10rpx; + margin-top: 38rpx; + text-align: left; } .info >view view:nth-child(2) { @@ -109,17 +112,21 @@ white-space: nowrap; text-overflow: ellipsis; overflow: hidden; - width: 400rpx; + margin-right: 25rpx; } .btns { - height: 80rpx; - line-height: 80rpx; + position: absolute; + right: 30rpx; + bottom: 53rpx; text-align: center; - color: #fff; font-size: 28rpx; - margin-top: 46rpx; - border-top: 1px solid #e6e6e6; + width: 250rpx !important; + height: 61rpx; + line-height: 61rpx; + background: rgba(255, 255, 255, 1); + border-radius: 30rpx; + margin-top: 32rpx !important; } .active { @@ -200,17 +207,26 @@ line-height: 32px; } -.title .fr { - width: 30rpx; - margin-right: 10rpx; +.title { + width: 50%; } +.title text { + display: block; + color: #fff; + font-size: 24rpx; + margin-left: 25rpx; + text-align: left; +} +.txt2{ + opacity:0.5; +} .imgicon { position: absolute; width: 140rpx; height: 100rpx; z-index: 100; - right: 191rpx; + right: 257rpx; top: 0; } @@ -245,4 +261,11 @@ line-height: 44rpx; margin-top: 30rpx; padding-bottom: 30rpx; + background: #fff; +} +.yue text:nth-of-type(1){ + margin-right: 6rpx; } +.yue text:nth-of-type(2){ + margin-left: 6rpx; +} \ No newline at end of file diff --git a/pages/cardorder/userule/userule.wxml b/pages/cardorder/userule/userule.wxml index 9651d6e..66797f6 100644 --- a/pages/cardorder/userule/userule.wxml +++ b/pages/cardorder/userule/userule.wxml @@ -1,31 +1,31 @@ - 1、如何使用xx卡? + 1、如何使用消费卡? - 在门店消费后结算时,打开xx小程序,选择“我的”-“卡包”,选择扣款的消费卡,点击卡面上的”付款“,扫描 + 在门店消费后结算时,打开小程序,选择“我的”-“卡包”,选择扣款的消费卡,点击卡面上的”付款“,扫描 - 2、xx卡内余额不够支付最后一次消费额时怎么办? + 2、消费卡内余额不够支付最后一次消费额时怎么办? - 建议部分消费额用xx卡支付,部分消费额用微信、支付宝、刷卡或现金支付。 + 建议部分消费额用消费卡支付,部分消费额用微信、支付宝、刷卡或现金支付。 - 3、购买xx卡后,是否能退? + 3、购买消费卡后,是否能退? - xx卡一经出售,即完成开卡,不能退款。 + 消费卡一经出售,即完成开卡,不能退款。 - 4、xx卡会过期吗? + 4、消费卡会过期吗? 会过期。请在卡面有效期内将面额使用完毕。 @@ -36,7 +36,7 @@ 5、注意事项 - 在法律允许的范围内,XX商场保留对上述规则的解释权。 更多详情可至xx商场服务台咨询。 + 在法律允许的范围内,商场保留对上述规则的解释权。 更多详情可至商场服务台咨询。 \ No newline at end of file diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index 329f072..cdbc7db 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -42,24 +42,24 @@ 有效期:自领取之日起 {{validDays}}天内有效 - 有效期: + 有效期: {{validStartDate}}至{{validEndDate}} 当次有效 - 使用条件: + 使用条件: 满{{data.usePriceStr}}元可用 - 限购条件: + 限购条件: 每人{{data.useLimitQuantity}}张 - 适用门店: + 适用门店