From 06b810422918932a87149f68fe88ea7349e0e653 Mon Sep 17 00:00:00 2001 From: hurui Date: Wed, 24 Jul 2019 19:02:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E9=A6=96=E9=A1=B5][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F][=E5=88=B8=E8=AF=A6=E6=83=85][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E6=A0=B7=E5=BC=8F]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/hot/index.js | 57 ++++++++++++---- components/hot/index.wxml | 38 ++++++----- components/hot/index.wxss | 3 - dist/tabs/index.wxss | 2 +- pages/coupon/detail/index.js | 3 +- pages/coupon/detail/index.wxml | 29 ++++---- pages/coupon/detail/index.wxss | 104 ++++++++++++++++++++--------- pages/couponorder/index/index.wxss | 1 + pages/main/coupons/index.wxss | 3 + pages/main/index.js | 4 ++ pages/main/index.wxml | 12 ++-- pages/main/index.wxss | 11 ++- pages/order/index/index.wxss | 1 + pages/user/index.js | 6 +- pages/user/index.wxml | 6 +- pages/user/index.wxss | 5 +- utils/bgColor.js | 26 +++++++- utils/imgurl.js | 9 +++ 18 files changed, 217 insertions(+), 103 deletions(-) diff --git a/components/hot/index.js b/components/hot/index.js index b04b0ee..73dd2af 100644 --- a/components/hot/index.js +++ b/components/hot/index.js @@ -3,6 +3,7 @@ let config = require("../../config/config.js"); let Http = require("../../utils/HttpBasics"); let app = getApp(); const imgurl = require("../../utils/imgurl"); +const bgColor = require("../../utils/bgColor.js") Component({ /** * 组件的属性列表 @@ -13,24 +14,22 @@ Component({ * 组件的初始数据 */ data: { + sql: bgColor.colorFirst.main.sql, + txt: bgColor.colorFirst.main.txt, change: imgurl.change.url, None: imgurl.None.url, jianUrl: imgurl.jian.url, barginicon: imgurl.barginicon.url, wangmeimeibargin: imgurl.wangmeimeibargin.url, list: [], + pintuanList:[], total: '' }, - /** * 组件的方法列表 */ methods: { - gotoBargainList() { - wx.navigateTo({ - url: "/pages/bargain/bargain" - }) - }, + //获取砍价列表 getList() { let that = this; Http.get({ @@ -41,12 +40,10 @@ Component({ targetAd: 6 } }).then(res => { - console.log(res.data.list) that.setData({ list: res.data.list, total: res.data.total }); - console.log(this.data.list) }) .catch(err => { console.log(err) @@ -58,14 +55,47 @@ Component({ }); }) }, - gotomore: function () { + //获取拼团列表 + getptList() { + Http.get({ + url: config.api.couponChannelList, + data: { + pageNum: 1, + pageSize: 4, + targetAd: 7 + } + }).then(res => { + this.setData({ + pintuanList: res.data.list, + total: res.data.total + }); + console.log(this.data.pintuanList) + }) + .catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + //跳转砍价详情 + gotokjdetail: function (e) { wx.navigateTo({ - url: "/pages/bargain/bargain" + url: `/pages/coupon/detail/index?couponChannelId=${ + e.currentTarget.dataset.couponchannelid + }&couponId=${ + e.currentTarget.dataset.couponid + }&targetAd=${ + e.currentTarget.dataset.targetad + }` }); }, - gotodetail: function (e) { + //跳转拼团详情 + gotoptdetail: function (e) { wx.navigateTo({ - url: `/pages/coupon/detail/index?couponChannelId=${ + url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${ e.currentTarget.dataset.couponchannelid }&couponId=${ e.currentTarget.dataset.couponid @@ -73,12 +103,13 @@ Component({ e.currentTarget.dataset.targetad }` }); - } + }, }, ready() { app.couponChannelListCallback = token => { Http.setToken(token); this.getList(); + this.getptList(); }; if (app.globalData.token && app.globalData.token != null) { app.couponChannelListCallback(app.globalData.token); diff --git a/components/hot/index.wxml b/components/hot/index.wxml index ba42a86..7b62a07 100644 --- a/components/hot/index.wxml +++ b/components/hot/index.wxml @@ -2,25 +2,25 @@ - + 爆款专区 - 换一换 + 换一换 - - + + - + - {{item.title}} - ¥{{item.priceStr}} - {{item.salePriceStr}} + {{list[0].title}} + ¥{{list[0].priceStr}} + {{list[0].salePriceStr}} 砍价 @@ -35,20 +35,22 @@ - - - + + + - - 日本bilii杯子 - ¥2.8 - 1.99 - 拼团 + + {{pintuanList[0].title}} + ¥{{pintuanList[0].priceStr}} + {{pintuanList[0].salePriceStr}} + 拼团 - + + + - + 疯狂补货中... 敬请期待 拼团 diff --git a/components/hot/index.wxss b/components/hot/index.wxss index b5d4aa4..ac8d216 100644 --- a/components/hot/index.wxss +++ b/components/hot/index.wxss @@ -20,7 +20,6 @@ .titleR text{ float: left; margin-right: 10rpx; - color: #2C8DFF; font-family:PingFangSC-Regular!important; } .titleR view{ @@ -36,7 +35,6 @@ .sql{ width:12rpx; height:24rpx; - background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); border-radius:8rpx; float: left; margin: 20rpx 10rpx 0 0; @@ -63,7 +61,6 @@ .hotCon image{ width: 86rpx; height: 86rpx; - border: 1rpx solid #fff; margin: 24rpx 0 46rpx 16rpx; } .hotCon .btn{ diff --git a/dist/tabs/index.wxss b/dist/tabs/index.wxss index 6e228c2..69fc772 100644 --- a/dist/tabs/index.wxss +++ b/dist/tabs/index.wxss @@ -8,7 +8,7 @@ justify-content: space-around; align-items: center; -webkit-box-align: center; - background: #fff + /* background: #fff */ } .i-tabs::after { diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 8f281d3..804b3bc 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -14,8 +14,9 @@ Page({ headbgUrl: imgurl.headbg.url, quesBgUrl: imgurl.ques_bg.url, close02: imgurl.close02.url, - share01: imgurl.share01.url, + fenxiang: imgurl.fenxiang.url, fail: imgurl.fail.url, + homeSelectedO: imgurl.homeSelectedO.url, wmhome: imgurl.wmhome.url, swiperCurrent: 0, hidden: "hidden", diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index 7a38095..0492190 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -19,7 +19,8 @@ - + + 分享有礼 @@ -43,7 +44,6 @@ {{data.title}}电子卡 {{data.subTitle}} - {{data.pressLimitNum+'人可砍至底价'}} 售价: {{data.salePriceStr}} @@ -55,18 +55,20 @@ 过期不退款 - 可砍至 - {{data.salePriceStr}}元 - {{data.priceStr}}元 + + + {{data.salePriceStr}} + + {{data.pressLimitNum+'人可砍至底价'}} - 剩余{{data.remainInventory}}件 有效期:自领取之日起 {{validDays}}天内有效 (请在有效期内使用) 有效期: - {{validStartDate}}至{{validEndDate}}(请在有效期内使用) + {{validStartDate}}至{{validEndDate}} + 剩余{{data.remainInventory}}件 当次有效 @@ -77,15 +79,16 @@ 满{{data.usePriceStr}}元可用 - 限购条件: - 每人限购{{data.useLimitQuantity}}张 + + + 限购{{data.useLimitQuantity}}张 (仅限新用户活动) ({{minLimit}}-{{maxLimit}}成长值) (大于{{minLimit}}成长值) - 适用门店 +