From 8c33bafba5783f3b64c4e2a058629df574c1df25 Mon Sep 17 00:00:00 2001 From: chenshengle <954534408@qq.com> Date: Wed, 18 May 2022 10:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ext.json | 2 +- index/index.json | 2 +- pages/coupon/detail/index.ttml | 6 ++- pages/coupon/detail/index.ttss | 30 +++++++++++---- pages/couponorder/detail/index.js | 46 +++++++++++++--------- pages/couponorder/index/index.js | 6 +-- pages/couponorder/index/index.ttml | 6 +-- pages/liveLsit/liveLsit.js | 11 ++++-- pages/liveLsit/liveLsit.json | 8 ++-- pages/liveLsit/liveLsit.ttml | 9 +++-- pages/liveLsit/liveLsit.ttss | 62 ++++++++++++++++++++++-------- pages/order/detail/index.js | 41 +++++++++++--------- pages/order/detail/index.ttml | 2 +- pages/orderquanma/index.js | 38 ++++++++++-------- project.config.json | 2 +- 15 files changed, 170 insertions(+), 101 deletions(-) diff --git a/ext.json b/ext.json index 06b740e..70a4fd4 100644 --- a/ext.json +++ b/ext.json @@ -7,7 +7,7 @@ "navigationBarTitleText": "Mini Program", "navigationBarTextStyle": "black", "navigationStyle": "custom" - }, + }, "ext": { "weappId": "ttef6599d8705b49b101", "name": "富茂券模板", diff --git a/index/index.json b/index/index.json index d18c932..aea870d 100644 --- a/index/index.json +++ b/index/index.json @@ -12,5 +12,5 @@ }, "enablePullDownRefresh": true, "navigationBarBackgroundColor": "#F4F5F9" - } +} \ No newline at end of file diff --git a/pages/coupon/detail/index.ttml b/pages/coupon/detail/index.ttml index e59a6d6..3e9d6f4 100644 --- a/pages/coupon/detail/index.ttml +++ b/pages/coupon/detail/index.ttml @@ -221,7 +221,6 @@ {{data.type==50?priceAndStockObj.creditPrice+'积分':priceAndStockObj.salePrice/100}} ¥{{priceAndStockObj.price/100}} - @@ -246,6 +245,11 @@ + diff --git a/pages/coupon/detail/index.ttss b/pages/coupon/detail/index.ttss index 807b1d8..b8e637f 100644 --- a/pages/coupon/detail/index.ttss +++ b/pages/coupon/detail/index.ttss @@ -343,13 +343,7 @@ button::after { font-weight: 400; float: left; } -.serviceBox{ - float: left; - margin-top: 58rpx; - margin-left: 14rpx; - height: 40rpx; - width: 40rpx; -} + .serviceImg{ height: 100%; width: 100%; @@ -1190,4 +1184,26 @@ button{ color: #fff; background-color: rgba(221,171,90, 0.5); padding:0; +} +.serviceBox{ + float: right; + margin-top: 58rpx; + margin-right: 14rpx; + height: 40rpx; + width: 40rpx; + background-color: #fff; +} +.fuwuLogoBox{ + width: 40rpx; + height: 40rpx; + line-height: 0; +} +.itemLogo{ + width: 100%; + height: 100%; +} +.fuwuName{ + text-align: center; + color: #000; + font-size: 24rpx; } \ No newline at end of file diff --git a/pages/couponorder/detail/index.js b/pages/couponorder/detail/index.js index 1b0a8ef..4f7fe83 100644 --- a/pages/couponorder/detail/index.js +++ b/pages/couponorder/detail/index.js @@ -49,9 +49,14 @@ Page({ console.log(options); that.setData({ code: options.quancode, - couponorderstatus: options.couponorderstatus + couponorderstatus: options.couponorderstatus, + validStatus:options.validStatus }); - that.setRq()//动态二维码 //这个方法必须在拿到 options.quancode 后调用 + + if(options.couponorderstatus==0&&options.validStatus!=0){ + that.setRq()//动态二维码 //这个方法必须在拿到 options.quancode 后调用 + } + //初始数据不能延时收到写一边 Http.get({ url: config.api.couponOrderDetail, @@ -165,24 +170,27 @@ Page({ TYPE: "couponorder", ID: _this.data.dynamicRq }) + if(res.data.expiredSeconds==0){ - let inre = setInterval(()=>{ - if(_this.data.expiredSeconds>1){ - _this.setData({ - expiredSeconds: _this.data.expiredSeconds-1 - }) - console.log("有效",_this.data.expiredSeconds) - }else{ - console.log("无效", _this.data.expiredSeconds) - clearInterval(_this.data.templTiem) - _this.setData({ - showhieRq:true - }) - } - },1000) - _this.setData({ - templTiem:inre - }) + }else{ + let inre = setInterval(()=>{ + if(_this.data.expiredSeconds>1){ + _this.setData({ + expiredSeconds: _this.data.expiredSeconds-1 + }) + console.log("有效",_this.data.expiredSeconds) + }else{ + console.log("无效", _this.data.expiredSeconds) + clearInterval(_this.data.templTiem) + _this.setData({ + showhieRq:true + }) + } + },1000) + _this.setData({ + templTiem:inre + }) + } // util.qrcode("qrcode", url, 350, 350); _this.createQrCode(url, "qrcode", 210, 210); }).catch(err => { diff --git a/pages/couponorder/index/index.js b/pages/couponorder/index/index.js index c032078..c44fe5b 100644 --- a/pages/couponorder/index/index.js +++ b/pages/couponorder/index/index.js @@ -69,7 +69,7 @@ Page({ let tempArr= that.data.list if(tempArr.length>0){ tempArr.map(item=>{ - item.createDate = util.formatTime(item.createDate, "yyyy-MM-dd hh:mm:ss"); + item.expiredTime = util.formatTime(item.expiredTime, "yyyy-MM-dd "); }) } @@ -88,7 +88,7 @@ Page({ let tempLsit = res.data.list?res.data.list:[] if(tempLsit.length>0){ tempLsit.map(item=>{ - item.createDate = util.formatTime(item.createDate, "yyyy-MM-dd hh:mm:ss"); + item.expiredTime = util.formatTime(item.expiredTime, "yyyy-MM-dd"); }) } that.setData({ @@ -126,8 +126,6 @@ Page({ this.getList() }, onShow:function(){ - debugger - this.getList() } diff --git a/pages/couponorder/index/index.ttml b/pages/couponorder/index/index.ttml index b618e11..cd61dda 100644 --- a/pages/couponorder/index/index.ttml +++ b/pages/couponorder/index/index.ttml @@ -19,15 +19,15 @@ {{item.title}} - {{item.createDate}} + {{item.expiredTime}} 去使用 查看 diff --git a/pages/liveLsit/liveLsit.js b/pages/liveLsit/liveLsit.js index 2d354b5..7b39bac 100644 --- a/pages/liveLsit/liveLsit.js +++ b/pages/liveLsit/liveLsit.js @@ -1,11 +1,13 @@ -const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px' +const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' const util = require("../../utils/util.js"); const Http = require("../../utils/HttpBasics"); const config = require("../../config/config"); const imgurl = require("../../utils/imgurl"); +const { alipay } = require("../../utils/imgurl"); let app = getApp(); Page({ data: { + navLineHeight: ((app.statusBarHeight + app.statusBarHeight) + 50) + "px", navigationBarHeight, noDataFlag: false, businePageNum: 1, @@ -40,13 +42,15 @@ Page({ url: config.api.couponChannelDouyinLiveList, data: param }).then(res => { + if (res.data.list && res.data.list.length != 0) { let tempArr = [] let tempLsit = this.data.businessData let data = res.data.list data.map(item => { tempArr.push(item.id) - + + item.discount = (((item.salePriceStr*1)/(item.priceStr*1))*10).toFixed(1) }) if (this.data.businePageNum > 1) { this.setData({ @@ -107,7 +111,7 @@ Page({ let data = res.data.list data.map(item => { tempArr.push(item.id) - + item.discount = (((item.salePriceStr*1)/(item.priceStr*1))*10).toFixed(1) }) if (this.data.businePageNum > 1) { this.setData({ @@ -195,6 +199,7 @@ Page({ }) }, onLoad: function (options) { + app.globalData.ifCongPh = 1//固定写法 放在指定要手机号授权框出现 this.getCouponChannelList() }, onReachBottom: function () { diff --git a/pages/liveLsit/liveLsit.json b/pages/liveLsit/liveLsit.json index f42c7a6..88eeb8e 100644 --- a/pages/liveLsit/liveLsit.json +++ b/pages/liveLsit/liveLsit.json @@ -1,5 +1,5 @@ { - "usingComponents": { - "navbar": "../../components/navbar/navbar" - } - } \ No newline at end of file + "usingComponents": { + "navbar": "../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/liveLsit/liveLsit.ttml b/pages/liveLsit/liveLsit.ttml index 69c142e..d73da5a 100644 --- a/pages/liveLsit/liveLsit.ttml +++ b/pages/liveLsit/liveLsit.ttml @@ -1,5 +1,6 @@ - - + + + @@ -17,12 +18,14 @@ ¥ {{item.salePriceStr}} {{item.priceStr}}元 + {{item.discount}}折 - 立即抢购 + + {{item.salePriceStr!=0?"立即抢购":"免费领取"}} diff --git a/pages/liveLsit/liveLsit.ttss b/pages/liveLsit/liveLsit.ttss index 26f39d3..e4861c0 100644 --- a/pages/liveLsit/liveLsit.ttss +++ b/pages/liveLsit/liveLsit.ttss @@ -4,8 +4,19 @@ overflow: hidden; background-color: #f4f5f9;; } +.title{ + text-align: center; + position: fixed; + top:0; + left: 0; + width: 100%; + background-color: #fff; + z-index: 10000; + font-size: 36rpx; + font-weight: 500; +} .wBox{ - margin: 30rpx auto; + margin: 20rpx auto; } .itemBox{ overflow: hidden; @@ -14,12 +25,12 @@ } .imgBox{ - width: 200rpx; - height: 200rpx; + width: 160rpx; + height: 160rpx; border-radius: 8px; overflow: hidden; float: left; - margin: 12rpx 0 12rpx 20rpx; + margin: 20rpx 0 20rpx 20rpx; position: relative; } .num{ @@ -40,21 +51,20 @@ height: 100%; } .dataBox{ - width: 420rpx; - height: 240rpx; + width: 460rpx; + /* height: 220rpx; */ float: left; margin-left: 20rpx; position: relative; } .titleName{ color: #402e1e; - font-size: 15px; font-family: "PingFangSC-Regular"; - font-weight: 400; + font-weight: 600; width: 100%; - font-size: 14px; + font-size: 28rpx; display: -webkit-box; - -webkit-line-clamp: 2; + -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; @@ -64,7 +74,7 @@ .subTitleC{ color: #402e1e; font-size: 24rpx; - margin: 10rpx 0 0 0; + margin: 6rpx 0 0 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; @@ -74,7 +84,7 @@ .subTitle{ color: #a6a6a6; font-size: 24rpx; - margin: 10rpx 0 0 0; + margin: 6rpx 0 0 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; @@ -83,7 +93,8 @@ } .priceBox{ overflow: hidden; - margin-top: 10rpx; + margin-top: 6rpx; + margin-bottom: 10rpx; } .rmb{ color: #d5af67; @@ -92,7 +103,7 @@ float: left; } .pri01{ - font-size: 32rpx; + font-size: 28rpx; color: #d5af67; letter-spacing: 0; line-height: 40rpx; @@ -104,7 +115,7 @@ margin-left: 10rpx; color: #999 !important; line-height: 40rpx; - font-size: 28rpx; + font-size: 24rpx; float: left; } .progressBox{ @@ -133,13 +144,30 @@ font-size: 20rpx; color: #fff; } +.discount{ + position: absolute; + bottom: 60rpx; + right: 12rpx; + color: #d5af67; + font-size: 24rpx; +} +.discount1{ + float: left; + font-size: 20rpx; + border: #d5af67 1px solid; + color: #d5af67; + border-radius: 20rpx; + padding: 2rpx 10rpx; + margin-left: 10rpx; + margin-top: 4rpx; +} .goPay{ position: absolute; - bottom: 14rpx; + bottom: 6rpx; right: 0rpx; background-color: #d5af67; color: #fff; - font-size: 28rpx; + font-size: 24rpx; text-align: center; line-height: 28rpx; padding: 12rpx 16rpx; diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index 7774b29..450ca5c 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -175,9 +175,9 @@ Page({ createDate: createDate, composeOrderType: tempData.composeOrderType, contentType: tempData.contentType ? tempData.contentType : 0, - orderFlag: tempData.type == 11 ? true : false //判断是不是线上配送 + orderFlag: tempData.type == 11 ? true : false ,//判断是不是线上配送 }) - if (tempData.couponOrderId&&(tempData.orderStatus != 0&&tempData.orderStatus != 2)) { //0未付款 1已支付 2已取消 3退款中 4已退款 + if (tempData.couponOrderId) { //0未付款 1已支付 2已取消 3退款中 4已退款 that.setRq() // that.upStatus() let setInter = setInterval(() => { @@ -327,7 +327,7 @@ Page({ couponOrderId: _this.data.order.couponOrderId } }).then(res => { - console.log(res, "res") + console.log(res, "res") _this.setData({ dynamicRq: res.data.dynamicId, expiredSeconds: res.data.expiredSeconds @@ -338,24 +338,27 @@ Page({ TYPE: "couponorder", ID: _this.data.dynamicRq }) - - let inre = setInterval(() => { - if (_this.data.expiredSeconds > 1) { - _this.setData({ - expiredSeconds: _this.data.expiredSeconds - 1 - }) - // console.log("有效", _this.data.expiredSeconds) - } else { - // console.log("无效", _this.data.expiredSeconds) - clearInterval(_this.data.templTiem) + if(res.data.expiredSeconds==0){ + //倒计时为零直接显示券码 + }else{ + let inre = setInterval(() => { + if (_this.data.expiredSeconds > 1) { + _this.setData({ + expiredSeconds: _this.data.expiredSeconds - 1 + }) + // console.log("有效", _this.data.expiredSeconds) + } else { + // console.log("无效", _this.data.expiredSeconds) + clearInterval(_this.data.templTiem) + _this.setData({ + showhieRq: true + }) + } _this.setData({ - showhieRq: true + templTiem: inre }) - } - }, 1000) - _this.setData({ - templTiem: inre - }) + }, 1000) + } _this.createQrCode(url, "qrcode", 350, 350); }).catch(err => { tt.showToast({ diff --git a/pages/order/detail/index.ttml b/pages/order/detail/index.ttml index 87789a3..ffd096b 100644 --- a/pages/order/detail/index.ttml +++ b/pages/order/detail/index.ttml @@ -46,7 +46,7 @@ - + diff --git a/pages/orderquanma/index.js b/pages/orderquanma/index.js index dd8860f..a8850c6 100644 --- a/pages/orderquanma/index.js +++ b/pages/orderquanma/index.js @@ -85,24 +85,28 @@ Page({ TYPE: "couponorder", ID: _this.data.dynamicRq }) + if(res.data.expiredSeconds==0){ - let inre = setInterval(() => { - if (_this.data.expiredSeconds > 1) { - _this.setData({ - expiredSeconds: _this.data.expiredSeconds - 1 - }) - console.log("有效", _this.data.expiredSeconds) - } else { - console.log("无效", _this.data.expiredSeconds) - clearInterval(_this.data.templTiem) - _this.setData({ - showhieRq: true - }) - } - }, 1000) - _this.setData({ - templTiem: inre - }) + }else{ + let inre = setInterval(() => { + if (_this.data.expiredSeconds > 1) { + _this.setData({ + expiredSeconds: _this.data.expiredSeconds - 1 + }) + console.log("有效", _this.data.expiredSeconds) + } else { + console.log("无效", _this.data.expiredSeconds) + clearInterval(_this.data.templTiem) + _this.setData({ + showhieRq: true + }) + } + }, 1000) + _this.setData({ + templTiem: inre + }) + } + // util.qrcode("qrcode", url, 350, 350); _this.createQrCode(url, "qrcode", 350, 350); }).catch(err => { diff --git a/project.config.json b/project.config.json index a1ee543..a268481 100644 --- a/project.config.json +++ b/project.config.json @@ -14,7 +14,7 @@ "projectname": "tt富茂C", "condition": { "miniprogram": { - "current": 1649905362371, + "current": -1, "list": [ { "id": 1650610427387,