diff --git a/app.json b/app.json index 1e18c89..b880fc1 100644 --- a/app.json +++ b/app.json @@ -80,7 +80,8 @@ "pages/siteAdd/siteAdd", "pages/fillIndent/fillIndent", "pages/coupon/childDetail/childDetail", - "pages/theme/index1/index" + "pages/theme/index1/index", + "pages/cardorder/cardUse/cardUse" ], "subpackages": [ { diff --git a/pages/cardorder/cardUse/cardUse.js b/pages/cardorder/cardUse/cardUse.js new file mode 100644 index 0000000..2813982 --- /dev/null +++ b/pages/cardorder/cardUse/cardUse.js @@ -0,0 +1,115 @@ +const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'; +const util = require("../../../utils/util.js"); +const config = require("../../../config/config.js"); +const Http = require("../../../utils/HttpBasics"); +let app = getApp(); +const imgurl = require("../../../utils/imgurl"); +Page({ + + /** + * 页面的初始数据 + */ + data: { + navigationBarHeight, + data: {} + }, + + cardDetail(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, + data: res.data, + supportTransfer: res.data.supportTransfer + }) + /** + * 若可转赠获取用户头像信息 + */ + if (res.data.supportTransfer) { + that.getUserInfo() + } + if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length <= 4) { + that.setData({ + height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx', + showMore: false + }) + } else if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length > 4) { + that.setData({ + height: 4 * 140 + 'rpx' + }) + } + } + }) + .catch(err => { + console.log(err) + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options); + if (options.cardId) { + this.cardDetail(options.cardId); + } + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/cardorder/cardUse/cardUse.json b/pages/cardorder/cardUse/cardUse.json new file mode 100644 index 0000000..fe481ec --- /dev/null +++ b/pages/cardorder/cardUse/cardUse.json @@ -0,0 +1,11 @@ +{ + "usingComponents": { + "i-tab": "../../../dist/tab/index", + "i-tabs": "../../../dist/tabs/index", + "navbar": "../../../components/navbar/navbar", + "store": "../../../components/store/index", + "shop": "../../../components/shop/shop" + }, + "navigationBarTitleText": "使用消费卡", + "navigationBarBackgroundColor": "#F4F5F9" +} \ No newline at end of file diff --git a/pages/cardorder/cardUse/cardUse.wxml b/pages/cardorder/cardUse/cardUse.wxml new file mode 100644 index 0000000..f3f2f38 --- /dev/null +++ b/pages/cardorder/cardUse/cardUse.wxml @@ -0,0 +1,135 @@ + + + + + + + + + + {{data.title}} + {{data.subTitle}} + + 余额:{{data.couponPrice/100}} + 余额:{{data.salePrice/100}} + 余额:{{data.couponPrice/100}} + + + 过期不退款 + + + + + + 有效期至: + {{expiredTime}} + + + 有效期: + {{data.type==10?pickStartDate:validStartDate}} + + {{data.type==10?pickEndDate:validEndDate}} + + + 满{{data.usePrice/100}}元可用 + + + + + + + + + + + + + + + + 点一点刷新二维码 + + + 二维码在 + {{expiredSeconds}}s + 后失效 + + + + {{showIdFalg?code:codeS}} + + + + + + + + + + + + + 实付金额: + {{data.couponPrice/100}} + + + + 下单时间: + {{createDate}} + + + 核销时间: + {{updateDate}} + + + 过期时间: + {{updateDate}} + + + 退款时间: + {{updateDate}} + + + 订单编号: + {{data.orderId}} + + + + + + 购买须知 + + + {{data.remark}} + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/cardorder/cardUse/cardUse.wxss b/pages/cardorder/cardUse/cardUse.wxss new file mode 100644 index 0000000..aadeb22 --- /dev/null +++ b/pages/cardorder/cardUse/cardUse.wxss @@ -0,0 +1,371 @@ +.box { + height: 100%; + background: linear-gradient(180deg, rgba(253, 131, 45, 1) 0%, rgba(254, 74, 22, 1) 100%); +} + +.container { + background: #fff; + width: 92%; + margin: 8% auto 6%; + border-radius: 16rpx; + +} + +.coedTiem { + text-align: center; + color: rgba(253, 131, 45, 1); + margin-bottom: 10rpx; +} + +page { + background: linear-gradient(180deg, rgba(253, 131, 45, 1) 0%, rgba(254, 74, 22, 1) 100%); + height: auto !important; +} + +.zhuangtai { + margin-bottom: 20rpx; + +} + +.panel, +.zhuangtai image { + position: relative; + width: 600rpx; + display: block; + border-radius: 10rpx; + margin: 0 auto; + padding: 0; + z-index: 10000; +} + +.panel { + position: relative; +} + +.pane2 { + background: #fff; + opacity: 0.6; +} + +.pane2 image { + width: 500rpx; + display: block; + margin: 40rpx auto 0; +} + +.buy { + background: #fff; + height: 88rpx; + width: 98%; + color: #7e7e7e; + line-height: 88rpx; + border-radius: 16rpx; + border: 1px solid #eee; +} + +.barcode { + height: 100rpx; + width: 510rpx; + margin: 0 auto; +} + +.barnum { + background: #fff; + height: 88rpx; + width: 600rpx; + margin: 0 auto; + line-height: 88rpx; + border: 2rpx solid #ccc; + border-radius: 10px; + font-size: 36rpx; + color: #333; + letter-spacing: 0; + text-align: center; + overflow: hidden; +} + +.barnumtext { + float: left; + margin-left: 20rpx; + font-size: 30rpx; +} + +.barnumImg { + float: left; + height: 40rpx; + width: 40rpx !important; + margin: 24rpx 20rpx !important; +} + +.barnumtext::before { + content: "优惠券码:"; + font-size: 24rpx; + color: #999; +} + +.barcode>canvas { + width: 510rpx; + height: 100rpx; +} + +.qrcode { + position: relative; + height: 350rpx; + width: 350rpx; + display: flex; + flex-direction: column; + justify-content: flex-end; + align-items: center; + margin: 0 auto; +} + +.qrcode>canvas { + width: 350rpx; + height: 350rpx; +} + +.coupon_detail { + position: relative; +} + +.coupon_detail .wmfl { + position: absolute; + width: 120rpx; + height: 120rpx; + left: 0; + right: 0; + margin: auto; + top: -50rpx; + border-radius: 50%; + overflow: hidden; +} + +.coupon_detail image { + display: block; + width: 100%; + height: 100%; +} + +.coupon_detail .fr { + width: 100%; + text-align: center; +} + +.coupon_detail .title { + font-size: 32rpx; + color: #1f2d3d; + letter-spacing: 0; + text-align: center; + display: block; + padding-top: 92rpx; + line-height: 45rpx; +} + +.line { + height: 10rpx; + display: block; + width: 100%; + margin-top: 20rpx; +} + +.time { + font-size: 26rpx; + color: #999; + letter-spacing: 0; + text-align: center; + line-height: 37rpx; + padding: 0 10rpx; +} + +.time text { + font-size: 26rpx; + color: red; +} + +.money text { + color: #000; +} + +.money del { + color: #999; + font-size: 26rpx; + text-decoration: line-through; + margin-left: 20rpx; +} + +.clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.timevalidity { + text-align: center; +} + +.timevalidity text:nth-of-type(1) { + font-size: 22rpx; + color: #999; + letter-spacing: 0; + text-align: left; +} + +.timevalidity text:nth-of-type(2) { + font-size: 22rpx; + color: #999; + letter-spacing: 0; + text-align: left; +} + +.timevalidity text:nth-of-type(3) { + font-size: 22rpx; + color: #999; + letter-spacing: 0; + text-align: left; +} + +.tit { + padding: 53rpx 0 0; + text-indent: 30rpx; + font-size: 24rpx; + color: #919191; + letter-spacing: 0; +} + +.notes view:nth-child(1) { + width: 92%; + height: 87rpx; + padding: 0 4%; + line-height: 87rpx; + background: #fff; +} + +.notes view:nth-child(1) text { + font-size: 30rpx; + color: #333; + letter-spacing: 0; +} + +.notes view:nth-child(2) { + width: 92%; + padding: 0 4%; + background: #fff; + display: flex; + flex-direction: column; +} + +.notes view:nth-child(2)>text { + font-size: 24rpx; + color: #333; + letter-spacing: 0; + line-height: 42rpx; +} + +.notes { + border-bottom-left-radius: 16rpx; + border-bottom-right-radius: 16rpx; + padding-bottom: 30rpx; +} + +.note view { + height: 48rpx; + line-height: 48rpx; +} + +.note view text { + display: inline-block; +} + +.note text:nth-of-type(1) { + width: 22%; + text-indent: 30rpx; + text-align: left; + font-size: 24rpx; + color: #333; + letter-spacing: 1.16rpx; +} + +.note text:nth-of-type(2) { + width: 67%; + font-size: 24rpx; + color: #333; + letter-spacing: 1.16rpx; +} + +.manjian { + margin-left: 26rpx; + color: #999 !important; + font-size: 26rpx !important; + text-align: center; +} + +.moneys { + font-size: 40rpx !important; + color: #ff4949 !important; + letter-spacing: 0; + text-align: right; +} + + +.game-entry { + width: 690rpx; + height: 140rpx; + margin: 10rpx auto 0; +} + +.gameimg { + display: block; + width: 100%; + height: 140rpx; +} + +.refund { + display: inline-block; + font-size: 26rpx !important; + color: red !important; + border: 1px solid red; + padding: 3rpx; +} + +.closeRq { + position: absolute; + width: 420rpx; + height: 420rpx; + line-height: 420rpx; + text-align: center; + background-color: rgba(0, 0, 0, 0.8); + left: 50%; + top: 42%; + transform: translate(-50%, -50%); + /* 50%为自身尺寸的一半 */ + z-index: 10000000; + color: #fff; + font-size: 38rpx; +} + +.updataRqCode { + width: 80rpx !important; + height: 80rpx; + margin-top: calc(50%-80rpx) !important; + margin-left: calc(50%-80rpx) !important; + display: inline-block !important; +} + +.upDataRq { + position: absolute; + width: 100%; + text-align: center; + height: 80rpx; + color: #fff; + top: 20%; + left: 0; +} + +/* .upDataRqImg{ + width: 40rpx !important; + height: 40rpx; + float: left; + margin: 20rpx 0 0 20rpx !important; +} */ \ No newline at end of file diff --git a/pages/cardorder/index/index.js b/pages/cardorder/index/index.js index 9b543db..48f456c 100644 --- a/pages/cardorder/index/index.js +++ b/pages/cardorder/index/index.js @@ -17,13 +17,13 @@ Page({ weixinTitle: imgurl.weixinTitle.url, shixiao: imgurl.shixiao.url, tabs: [{ - key: 4, - name: "使用中" - }, - { - key: "5,6,7", - name: "已失效" - } + key: 4, + name: "使用中" + }, + { + key: "5,6,7", + name: "已失效" + } ], list: [], current: "4", @@ -42,7 +42,7 @@ Page({ url: this_.data.goHomeUrl, }) }, - onLoad: function() { + onLoad: function () { this.setData({ goHomeUrl: app.globalData.goHomeUrl }) @@ -60,13 +60,13 @@ Page({ // index: 3 // }) }, - userule: function() { + userule: function () { wx.navigateTo({ url: '/pages/cardorder/userule/userule', }) }, // 扫一扫去支付 - gotoPay: function(e) { + gotoPay: function (e) { app.globalData.previewFlag = true /* wx.navigateTo({ url: `/pages/scanPay/scanPay`, @@ -79,11 +79,11 @@ Page({ let value = JSON.parse(res.result); if (value.END == 'B' && value.TYPE == 'merchant' && value.ID) { Http.get({ - url: config.api.findByCode, - data: { - merchantCode: value.ID, - } - }) + url: config.api.findByCode, + data: { + merchantCode: value.ID, + } + }) .then(res => { if (res.code == 200) { let merChantDetail = JSON.stringify(res.data); @@ -123,15 +123,18 @@ Page({ }) }, // 跳转到详情 - gotoConsumeDetail: function(e) { - if (e.currentTarget.dataset.id){ + gotoConsumeDetail: function (e) { + if (e.currentTarget.dataset.id) { + // wx.navigateTo({ + // url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`, + // }) wx.navigateTo({ - url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`, + url: `/pages/cardorder/cardUse/cardUse?cardId=${e.currentTarget.dataset.id}`, }) } }, //点击跳转到券详情页面 - gotouse: function(e) { + gotouse: function (e) { if (this.data.mystatus == '' || this.data.mystatus == 'undefined') { var mystatus = e.currentTarget.dataset.couponorderstatus; } else { @@ -139,12 +142,11 @@ Page({ } if (e.currentTarget.dataset.quancode) { wx.navigateTo({ - url: `/pages/couponorder/detail/index?quancode=${ - e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` + url: `/pages/couponorder/detail/index?quancode=${e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` }); } }, - gotoBuy: function() { + gotoBuy: function () { wx.navigateTo({ url: '/pages/discountCardList/discountCardList', }) @@ -172,9 +174,9 @@ Page({ } } Http.get({ - url: config.api.cardorderList, - data: data - }) + url: config.api.cardorderList, + data: data + }) .then(res => { console.log(res) if (res.code == 200) { @@ -182,8 +184,8 @@ Page({ showPage: true }) } - - if (res.data.list && res.data.list.length>0){ + + if (res.data.list && res.data.list.length > 0) { res.data.list.map(file => { file.expiredTime = util.formatTime(file.expiredTime, "yyyy.MM.dd") if (file.couponOrderStatus == 5 || file.couponOrderStatus == 6 || file.couponOrderStatus == 7 || file.couponOrderStatus == 8) { @@ -203,7 +205,7 @@ Page({ }); } - setTimeout(function() { + setTimeout(function () { that.setData({ loading: false }); @@ -227,7 +229,7 @@ Page({ .catch(err => { wx.showModal({ title: '提示', - content: err.message ? err.message:err.data, + content: err.message ? err.message : err.data, showCancel: false }) }) @@ -254,7 +256,7 @@ Page({ }); this.getList(detail.key, 1); }, - onReachBottom: function() { + onReachBottom: function () { var that = this; that.data.page++; that.setData({ diff --git a/pages/cardorder/index/index.wxml b/pages/cardorder/index/index.wxml index df1f204..91b7009 100644 --- a/pages/cardorder/index/index.wxml +++ b/pages/cardorder/index/index.wxml @@ -36,7 +36,7 @@ - 扫一扫付款 + 再次购买 已过期 余额已用完