diff --git a/app.json b/app.json index a03b24f..f864159 100644 --- a/app.json +++ b/app.json @@ -60,8 +60,7 @@ "pages/externallinks/index", "pages/czdetail/czdetail", "pages/spellGroup/paySpellGroup/index", - "pages/integralmall/index", - "pages/integralmall/integcoupondetail/index" + "pages/integralmall/index" ], "navigateToMiniProgramAppIdList": [ "wx192b7d2e8dcbefd0", diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index f8f5be2..62f1841 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -257,20 +257,21 @@ Page({ that.orderFunc(); }, 500) }, - /** - * gotopay - */ gotopay: function(e) { let that = this; - console.log(e) - let formId = e.detail.formId; - var discount = e.currentTarget.dataset.discount; - that.setData({ - queueData: null, - showbutton: true, - formId: formId - }) - Http.get({ + if (e.currentTarget.dataset.type == 51 || e.currentTarget.dataset.type == 50){ + wx.navigateTo({ + url: '/pages/integralmall/payIntegcoupondetail/index?couponChannelId=' + that.data.couponChannelId + '&couponId=' + that.data.couponId, + }) + }else{ + let formId = e.detail.formId; + var discount = e.currentTarget.dataset.discount; + that.setData({ + queueData: null, + showbutton: true, + formId: formId + }) + Http.get({ url: config.api.getQuestion, data: { couponType: JSON.stringify(that.data.data.type) @@ -306,6 +307,7 @@ Page({ mask: false }); }) + } }, setIntervalTime(end_time) { let that = this; diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index b229eb1..02b8dcc 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -6,7 +6,7 @@ - + @@ -34,10 +34,11 @@ {{data.pressLimitNum+'人可砍至底价'}} 售价: - {{data.salePriceStr}} - - {{data.priceStr}}元 - {{data.priceStr}}小时 + {{data.salePriceStr}} + {{data.creditPrice}}积分 + + {{data.priceStr}}元 + {{data.priceStr}}小时 过期不退款 @@ -48,7 +49,6 @@ 剩余{{data.remainInventory}}件 - 有效期:自领取之日起 {{validDays}}天内有效(请在有效期内使用) 有效期: @@ -96,12 +96,13 @@ -
+ - - + + diff --git a/pages/index/index.js b/pages/index/index.js index 4f7ea9c..499b58b 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -334,54 +334,54 @@ Page({ url: config.api.login, data: usrdata }) - .then(res => { - that.setData({ - showPages: true - }) - app.globalData.token = res.data.token; - app.globalData.openId = res.data.openId; - // 初始化websocket - if (extConfig.attr.ifHaveWebSocket == 1) { - app.initSocket(); - // 回调发送给自己的消息 - app.globalData.socketReceiver = function (e) { - let msgList = that.data.msgList - msgList.push(e) - that.setData({ - msgList: msgList - }) - } + .then(res => { + that.setData({ + showPages: true + }) + app.globalData.token = res.data.token; + app.globalData.openId = res.data.openId; + // 初始化websocket + if (extConfig.attr.ifHaveWebSocket == 1) { + app.initSocket(); + // 回调发送给自己的消息 + app.globalData.socketReceiver = function (e) { + let msgList = that.data.msgList + msgList.push(e) + that.setData({ + msgList: msgList + }) } + } - if (res.data && res.data.score) { - if (res.data.score != 0) { - app.globalData.score = res.data.score; - } + if (res.data && res.data.score) { + if (res.data.score != 0) { + app.globalData.score = res.data.score; } - Http.setToken(res.data.token); - if (options && (options.couponChannelId || options.orderId || options.id)) { - that.checkuserstatus(options); - } else { - that.checkuserstatus(); + } + Http.setToken(res.data.token); + if (options && (options.couponChannelId || options.orderId || options.id)) { + that.checkuserstatus(options); + } else { + that.checkuserstatus(); + } + }) + .catch(err => { + wx.showModal({ + title: '提示', + showCancel: false, + content: '登录失败,请重新尝试', + success: function (res) { + if (res.cancel) { + //点击取消,默认隐藏弹框 + } else { + //点击确定 + wx.reLaunch({ + url: '/pages/index/index', + }) + } } }) - .catch(err => { - wx.showModal({ - title: '提示', - showCancel: false, - content: '登录失败,请重新尝试', - success: function (res) { - if (res.cancel) { - //点击取消,默认隐藏弹框 - } else { - //点击确定 - wx.reLaunch({ - url: '/pages/index/index', - }) - } - } - }) - }); + }); } }); }, diff --git a/pages/integralmall/index.js b/pages/integralmall/index.js index fd93b76..c662e20 100644 --- a/pages/integralmall/index.js +++ b/pages/integralmall/index.js @@ -176,7 +176,7 @@ Page({ let couponId = e.currentTarget.dataset.couponid; if (couponChannelId && couponId) { wx.navigateTo({ - url: `/pages/integralmall/integcoupondetail/index?couponChannelId=${couponChannelId}&couponId=${couponId}` + url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}` }) } }, diff --git a/pages/integralmall/integcoupondetail/index.js b/pages/integralmall/integcoupondetail/index.js deleted file mode 100644 index 474f9e4..0000000 --- a/pages/integralmall/integcoupondetail/index.js +++ /dev/null @@ -1,159 +0,0 @@ -// pages/spellGroup/mySpellGroup/index.js -var config = require("../../../config/config.js"); -const Http = require("../../../utils/HttpBasics"); -const imgurl = require("../../../utils/imgurl"); -const utils = require("../../../utils/util.js") -Page({ - - /** - * 页面的初始数据 - */ - data: { - teljpgUrl: imgurl.teljpg.url, - wmhome: imgurl.wmhome.url, - couponChannelId: '', - couponId: '', - data: null, - spellData: null, - canSpell: true, - canBuyIf: true, - clock: "00", - day: "00", - hour: "00", - min: "00", - sec: "00", - showTime: true - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.setData({ - couponChannelId: options.couponChannelId, - couponId: options.couponId - }) - if (options && options.couponChannelId) { - this.getDetail(options.couponChannelId); - } - }, - gotoIndex: function () { - wx.switchTab({ - url: '/pages/main/index', - }) - }, - /** - * 拨打电话 - */ - phone: function (e) { - let that = this; - wx.makePhoneCall({ - phoneNumber: e.target.dataset.merchantlinkphone - }); - }, - /** - * 直接购买 - */ - gotoBuy(e) { - console.log(22222) - this.setData({ - canBuyIf: false - }) - wx.navigateTo({ - url: '/pages/integralmall/payIntegcoupondetail/index?couponChannelId=' + this.data.couponChannelId + '&couponId=' + this.data.couponId, - }) - }, - // 时间格式化输出,如11:03 25:19 每1s都会调用一次 - dateformat(micro_second) { - // 总秒数 - var second = Math.floor(micro_second / 1000); - // 天数 - var day = Math.floor(second / 3600 / 24) < 10 ? "0" + Math.floor(second / 3600 / 24) : Math.floor(second / 3600 / 24); - // 小时 - var hr = Math.floor(second / 3600 % 24) < 10 ? "0" + Math.floor(second / 3600 % 24) : Math.floor(second / 3600 % 24); - // 分钟 - var min = Math.floor(second / 60 % 60) < 10 ? "0" + Math.floor(second / 60 % 60) : Math.floor(second / 60 % 60); - // 秒 - var sec = Math.floor(second % 60) < 10 ? "0" + Math.floor(second % 60) : Math.floor(second % 60); - - // return day + "天" + hr + "小时" + min + "分钟" + sec + "秒"; - return { - a1: day, - b1: hr, - c1: min, - d1: sec - } - }, - /** - * 获取券详情信息 - */ - getDetail(couponChannelId) { - let that = this; - Http.get({ - url: config.api.couponDetail, - data: { - couponChannelId: couponChannelId - } - }).then(res => { - wx.stopPullDownRefresh(); - let data = res.data; - data.price = (data.price / 100).toFixed(2) - data.salePrice = (data.salePrice / 100).toFixed(2); - data.validStartDate = utils.formatTime(data.validStartDate, 'yyyy-MM-dd') - data.validEndDate = utils.formatTime(data.validEndDate, 'yyyy-MM-dd') - that.setData({ - data - }); - }); - }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - this.setData({ - canSpell: true, - canBuyIf: true, - showTime: true - }) - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - this.setData({ - showTime: false - }) - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - this.setData({ - showTime: false - }) - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function (e) { - let that = this; - that.getDetail(that.data.couponChannelId); - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - } -}) \ No newline at end of file diff --git a/pages/integralmall/integcoupondetail/index.json b/pages/integralmall/integcoupondetail/index.json deleted file mode 100644 index 2c03b59..0000000 --- a/pages/integralmall/integcoupondetail/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "navigationBarTitleText": "积分券详情", - "enablePullDownRefresh": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/integralmall/integcoupondetail/index.wxml b/pages/integralmall/integcoupondetail/index.wxml deleted file mode 100644 index b3b4745..0000000 --- a/pages/integralmall/integcoupondetail/index.wxml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - {{data.title}} - - {{data.subTitle}} - - 售价 - {{data.creditPrice}}积分 - - 有效期: - {{data.validStartDate}}至{{data.validEndDate}}(请在有效期内使用) - - - 价值: - {{data.priceStr}}元 - - - 限购条件: - 每人{{data.useLimitQuantity}}张 - - - 购买须知 - {{data.remark}} - - - 适用门店 - - - - - - - - - - - - \ No newline at end of file diff --git a/pages/integralmall/integcoupondetail/index.wxss b/pages/integralmall/integcoupondetail/index.wxss deleted file mode 100644 index 363ae76..0000000 --- a/pages/integralmall/integcoupondetail/index.wxss +++ /dev/null @@ -1,405 +0,0 @@ -/* pages/spellGroup/mySpellGroup/index.wxss */ -.top-img{ - width: 100%; - height: 533rpx; - z-index: 1; -} -.top-img image{ - width: 100%; - height: 533rpx; -} -button::after{ border: none; } -.goback { - float:left; - width:122rpx!important; - height:95rpx; - background:rgba(255,255,255,1); - line-height:95rpx; - border:1rpx solid rgba(227,227,227,1); - /* box-shadow:0px 8px 8px 1px rgba(189,189,189,0.32); */ - border-radius:48rpx; - margin-right:20rpx; -} -.goback image{ - position:absolute; - width:60rpx; - left:0; - right:0; - top:0; - bottom:0; - margin:auto; - height: 80rpx; -} -.content-box{ - box-sizing: content-box; - height: auto; - overflow: hidden; -} -.content{ - position: relative; - width: 100%; - height: auto; - background: #fff; - overflow: hidden; - padding-bottom: 130rpx; -} -.text{ - padding: 0 30rpx; -} -.title{ - position: relative; - background-color: #fff; - z-index: 100; - width: 750rpx; - padding-top: 30rpx; - padding-left: 30rpx; - line-height: 50rpx; - border-radius:20rpx 20rpx 0px 0px; - margin-top: -25rpx; - opacity: 1; - font-size:32rpx; - font-weight:bold; - color:rgba(51,51,51,1); - box-sizing: border-box; -} -.remark{ - font-size:24rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(134,134,134,1); - line-height: 48rpx; -} -.des{ - width: 100%; - height: auto; - padding-top: 6rpx; - border-top: 2rpx solid rgb(240, 238, 238); -} -.des-peoplenum{ - display: inline; - font-size:24rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(0,0,0,1); - line-height:44rpx; - margin-right: 5rpx; -} -.des-saleprice{ - display: inline; - font-size:40rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(255,53,53,1); -} -.status{ - width: 100%; - border-radius: 15rpx; - background:rgba(255,235,229,1); - margin: 30rpx 0; - overflow: hidden; -} -.status01{ - float: left; - width: 130rpx; - height: 130rpx; -} -.status01 image{ - width: 90rpx; - height: 90rpx; - border-radius: 45rpx; - margin: 20rpx 0 0 20rpx; -} -.status02{ - margin-top: 20rpx; - float: left; - width: 140rpx; - font-size:28rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(51,51,51,1); -} -.r-p-num{ - display: inline; - color: #FF3535; -} -.status03{ - width: 264rpx; - float: left; - padding-left: 10rpx; - color: #F74812; - box-sizing: border-box; -} -.hh,.mm,.ss{ - display: inline-block; - font-size:26rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(255,255,255,1); - height: 38rpx; - width: 38rpx; - background: #F74812; - border-radius:10rpx; - margin: 46rpx 0 0 0; - text-align: center; - line-height: 38rpx; -} -.day-box{ - width: 40rpx; - text-align: center; -} -.mao{ - display: inline-block; - width: 20rpx; - text-align: center; -} -.status04{ - float: left; - width: 146rpx; -} -.s-button{ - background:#ED3D2E; - width: 120rpx; - height: 48rpx; - font-size:28rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(255,255,255,1); - text-align: center; - line-height: 48rpx; - border-radius: 24rpx; - margin: 40rpx auto 0; -} -.p-title{ - font-size:30rpx; - color:rgba(51,51,51,1); - margin: 10rpx 0 20rpx 0; -} -.p-list{ - font-size:24rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(51,51,51,1); - line-height:50rpx; -} -.edit{ - position:fixed; - bottom:0; - left:0; - right:0; - padding:20rpx 22rpx; - background:#fff; -} -.edit-left{ - float: left; - width: 562rpx; - height: 95rpx; - background:rgba(255,169,2,1); - box-shadow:0px 8rpx 8rpx 1rpx rgba(255,169,2,0.32); - border-radius:48rpx; -} -.edit-left02{ - float: left; - width: 562rpx; - height: 95rpx; - border-radius:48rpx; - border:none !important; -} -.edit-right{ - float: right; - width: 269rpx; - height: 95rpx; - line-height: 46rpx; - background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%); - box-shadow:0px 8rpx 8rpx 1rpx rgba(246,93,51,0.32); - border-radius:48rpx; -} -.edit-left-top{ - height: 46rpx; - text-align: center; - line-height:65rpx; -} -.price{ - display: inline; - font-size:32rpx; - line-height: 32rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(254,254,254,1); - margin-top: 6rpx; -} -.price-unit{ - display: inline; - font-size:27rpx; - line-height: 27rpx; - margin-top: 11rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(254,254,254,1); -} -.edit-left-bottom{ - text-align: center; - font-size:30rpx; - line-height: 95rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(254,254,254,1); -} - -.edit-right-top{ - line-height: 32rpx; - text-align: center; - margin-top: 13rpx; -} -.real-price{ - display: inline; - font-size:32rpx; - font-family:PingFang-SC-Medium; - font-weight:500; - color:rgba(254,254,254,1); -} -.real-price-unit{ - display: inline; - font-size:27rpx; - line-height: 27rpx; - font-weight:500; - color:rgba(254,254,254,1); -} -.edit-right-bottom{ - text-align: center; - font-size:30rpx; - line-height: 40rpx; - font-weight:500; - color:rgba(254,254,254,1); -} -.posi { - position: relative; -} -.applyshop{ - font-size:32rpx; - color:rgba(51,51,51,1); - margin: 10rpx 0 20rpx 0; -} - -.posi>view:nth-child(2) { - width: 100%; - height: 87rpx; - display: flex; - justify-content: space-between; - 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; - line-height: 40rpx; -} - -.posi_logo view:nth-child(2) text:nth-child(2) { - font-size: 24rpx; - color: #b8b8b8; - padding-top: 3rpx; - width: 450rpx; - height: 36rpx; - overflow: hidden; -} -.tel { - right: 0; - top: 0; - bottom: 0; - margin: auto; - width: 50rpx; - height: 50rpx; -} -.rest { - font-size: 24rpx; - color: #919191; - letter-spacing: 0; - height: 70rpx; - line-height: 70rpx; - /* border-bottom: 1px solid #eee; */ - border-bottom: 1px solid #f9f9f9; -} - -.restNum { - font-size: 24rpx; - color: #999; - letter-spacing: 1.16rpx; - text-align: right; -} - -.time { - font-size: 24rpx; - color: #333; - letter-spacing: 0; - line-height: 33rpx; - display: inline-block; -} - -.txt01 { - font-size: 24rpx; - color: #919191; - letter-spacing: 0; -} - -.times { - display: inline-block; - color: #ff4949; - font-weight: bold; - font-size: 26rpx; - text-align: center; -} - -.times text { - display: inline-block; - margin: 6rpx; - width: 46rpx; - height: 56rpx; - text-align: center; - font-size: 28rpx; - line-height: 60rpx; - border-radius: 12rpx; - color: #fff; - font-weight: bold; - background: #ff4949; -} \ No newline at end of file