diff --git a/pages/main/coupons/index.wxss b/pages/main/coupons/index.wxss index 1b756b3..94bc1fd 100644 --- a/pages/main/coupons/index.wxss +++ b/pages/main/coupons/index.wxss @@ -1,6 +1,6 @@ .index-coupons { /* height: 820rpx; */ - margin-top: 30rpx; + /* margin-top: 30rpx; */ background:linear-gradient(0deg,rgba(235,235,235,1) 0%,rgba(255,255,255,1) 100%); } diff --git a/pages/main/index.js b/pages/main/index.js index 6c8700f..b5cecce 100644 --- a/pages/main/index.js +++ b/pages/main/index.js @@ -18,10 +18,8 @@ Page({ icon0006: imgurl.icon0006.url, icon0007: imgurl.icon0007.url, icon0008: imgurl.icon0008.url, - rushtobuy: imgurl.rushtobuy.url, barcode: imgurl.barcode.url, leftarrows: imgurl.leftarrows.url, - wmcard: imgurl.wmcard.url, newcard:imgurl.newcard.url, newseckill: imgurl.newseckill.url, newbargain: imgurl.newbargain.url, @@ -74,18 +72,7 @@ Page({ wx.navigateTo({ url: '/pages/couponorder/index/index', }) - }, - gotodiscountCardList: function() { - wx.navigateTo({ - url: '/pages/discountCardList/discountCardList' - }) - }, - //跳往限时秒杀 - gotoRushBuy: function() { - wx.navigateTo({ - url: '/pages/rushToBuy/index', - }) - }, + }, gotoSpellGroup:function(){ wx.navigateTo({ url: '/pages/spellGroup/spellGroup', @@ -123,6 +110,18 @@ Page({ showQrcode: false }) }, + //跳往限时秒杀 + gotoRushBuy: function () { + wx.navigateTo({ + url: '/pages/rushToBuy/index', + }) + }, + // 跳往卡列表 + gotodiscountcard: function () { + wx.navigateTo({ + url: '/pages/discountCardList/discountCardList', + }) + }, //跳往个人中心 gotouser:function(){ wx.switchTab({ @@ -174,17 +173,6 @@ Page({ swiperCurrent: e.detail.current }); }, - rushtobuy:function(){ - wx.navigateTo({ - url: '/pages/rushToBuy/index', - }) - }, - // 跳往卡列表 - gotodiscountcard:function(){ - wx.navigateTo({ - url: '/pages/discountCardList/discountCardList', - }) - }, gotogame: function() { let that = this; Http.get({ @@ -618,8 +606,9 @@ Page({ wx.stopPullDownRefresh(); }; // 砍价下拉刷新 - that.selectComponent("#bargain").getList(); + that.selectComponent("#bargain").getList(); that.selectComponent("#spellGroup").getList(); + that.selectComponent("#rushtobyCard").getList(); wx.stopPullDownRefresh(); }, //加载更多 diff --git a/pages/main/index.json b/pages/main/index.json index 47e7d94..3856ad9 100644 --- a/pages/main/index.json +++ b/pages/main/index.json @@ -5,7 +5,8 @@ "c-bargain": "./bargain/index", "c-spellGroup": "./spellGroup/index", "c-coupons": "./coupons/index", - "g-entry": "../../components/gameentry/gentry" + "g-entry": "../../components/gameentry/gentry", + "c-rushtobyCard": "./rushtobyCard/index" }, "navigationBarTitleText": "首页", "enablePullDownRefresh": true diff --git a/pages/main/index.wxml b/pages/main/index.wxml index a2fbc81..e82397f 100644 --- a/pages/main/index.wxml +++ b/pages/main/index.wxml @@ -67,16 +67,8 @@ - - - 限时秒杀 - - - - 消费 好物提前购 - - - + + diff --git a/pages/main/index.wxss b/pages/main/index.wxss index 892ad91..920fc94 100644 --- a/pages/main/index.wxss +++ b/pages/main/index.wxss @@ -47,40 +47,7 @@ page { display: block; width: 100%; } -.rushtobuyimgs{ - padding: 0 30rpx; - margin-top:20rpx; -} -.rushtobuyimgs>view{ - width: 50%; - display: inline-block; -} -.rushtobuyimgs>view>text{ - font-size:34rpx; - font-weight: bold; -} -.xianshi{ - color: #F12643; -} -.qianggou{ - color: #3D3737; -} -.rushtobuyimgs image{ - width: 335rpx; - height: 161rpx; -} -.xiaofei{ - color: #3D3737; -} -.ka{ - color: #ED734A -} -.subtitle{ - font-size:28rpx !important; - color: #666666; - font-weight:400 !important; - margin-left: 15rpx; -} + .userinfo{ position:relative; margin: 0 auto 38rpx; diff --git a/pages/main/rushtobyCard/index.js b/pages/main/rushtobyCard/index.js new file mode 100644 index 0000000..172a7c5 --- /dev/null +++ b/pages/main/rushtobyCard/index.js @@ -0,0 +1,102 @@ + +let config = require("../../../config/config.js"); +let Http = require("../../../utils/HttpBasics"); +// let Http = require("../../../utils/HttpBasics"); +const app = getApp(); +const imgurl = require("../../../utils/imgurl"); +Component({ + /** + * 组件的属性列表 + */ + properties: {}, + + /** + * 组件的初始数据 + */ + data: { + list: [], + cardlist:[],//消费卡列表 + total:'' + }, + + /** + * 组件的方法列表 + */ + methods: { + + rushtobuy: function (e) { + wx.navigateTo({ + url: `/pages/coupon/detail/index?couponChannelId=${ + e.currentTarget.dataset.couponchannelid + }&couponId=${e.currentTarget.dataset.couponid}` + }) + }, + + gotodiscountCardList: function (e) { + wx.navigateTo({ + url: `/pages/coupon/detail/index?couponChannelId=${e.currentTarget.dataset.quancode}&couponId=${e.currentTarget.dataset.couponid}&cardType=${e.currentTarget.dataset.type}` + }); + }, + //获取限时抢购列表 + getList(){ + Http.get({ + url: config.api.couponChannelList, + data: { + pageNum: 1, + pageSize: 3, + targetAd: 2 + } + }).then(res => { + this.setData({ + list: res.data.list, + total: res.data.total, + + }); + }) + .catch(err => { + console.log(err) + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + //获取消费卡列表 + getcardList() { + Http.get({ + url: config.api.couponChannelList, + data: { + pageNum: 1, + pageSize: 3, + targetAd: 5 + } + }).then(res => { + this.setData({ + cardlist: res.data.list, + total: res.data.total + }); + }) + .catch(err => { + console.log(err) + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); + }) + } + }, + ready() { + app.couponChannelListCallback = token => { + Http.setToken(token); + this.getList(); + this.getcardList(); + }; + if (app.globalData.token && app.globalData.token != null) { + app.couponChannelListCallback(app.globalData.token); + } + } +}); diff --git a/pages/main/rushtobyCard/index.json b/pages/main/rushtobyCard/index.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/pages/main/rushtobyCard/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/pages/main/rushtobyCard/index.wxml b/pages/main/rushtobyCard/index.wxml new file mode 100644 index 0000000..834b30c --- /dev/null +++ b/pages/main/rushtobyCard/index.wxml @@ -0,0 +1,40 @@ + + + + + 限时秒杀 + + + + + + {{item.title}} + + {{item.salePriceStr}}元 + {{item.priceStr}}元 + + + + + + + + + 消费 好物提前购 + + + + + + {{item.title}} + + {{item.salePriceStr}}元 + {{item.priceStr}}元 + + + + + + + + \ No newline at end of file diff --git a/pages/main/rushtobyCard/index.wxss b/pages/main/rushtobyCard/index.wxss new file mode 100644 index 0000000..2aa76f0 --- /dev/null +++ b/pages/main/rushtobyCard/index.wxss @@ -0,0 +1,138 @@ + +.rushtobuyimgs>view{ + width: 48%; + display: inline-block; +} +.rushtobuyimgs>view>text{ + font-size:34rpx; + font-weight: bold; +} +.xianshi{ + color: #F12643; + padding-left:30rpx; +} +.qianggou{ + color: #3D3737; +} +.xiaofei{ + color: #3D3737; + padding-left:30rpx; +} +.ka{ + color: #ED734A +} +.subtitle{ + font-size:28rpx !important; + color: #666666; + font-weight:400 !important; + margin-left: 15rpx; +} + +.index-rushToBuy { + width: 100%; + font-family: PingFangSC-Semibold; +} + +.index-rushToBuy-title { + position: relative; + font-size: 34rpx; + color: #000000; + letter-spacing: 1.16rpx; + padding-top: 0; + padding-left: 30rpx; + font-weight: bold; +} + +.index-rushToBuy-title text{ + float: right; + margin-right: 20rpx; + color: #999999; + font-size: 24rpx; + margin-top: 8rpx; + font-weight: normal; +} +.index-rushToBuy-title image{ + position: absolute; + right: 18rpx; + width: 20px; + top: 40rpx; +} +.index-scroll-view { + width: 100%; + white-space: nowrap; +} + +.index-scroll-view .commodity { + display: inline-block; + margin: 16rpx 30rpx 16rpx; + margin-right: 0; + position: relative; + background: #fff; + /* border: 1rpx solid #dddee1; */ + width: 334rpx; + /* box-shadow: 0 0 10px 0 rgba(211,211,211,0.30); */ + border-radius: 10rpx; + overflow: hidden; +} +.index-scroll-view .commodity:last-child{ + margin-right: 30rpx; +} +.commodity-img{ + display: block; + width: 335rpx; + height: 200rpx; + border-radius: 10rpx; + border: 1px solid #ebeced; +} + +.index-scroll-view .commodity-info { + padding:10rpx 0; + overflow: hidden; +} + +.index-scroll-view .commodity-info-name { + font-size: 28rpx; + color: #333; + letter-spacing: 0.7rpx; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + width:248px; + font-weight: bold; +} + +.index-scroll-view .commodity-info-time { + font-size: 28rpx; + color: #B4B4B4; + letter-spacing: 0.7rpx; + line-height: 42rpx; + font-weight: 500; +} + +.index-scroll-view .commodity-info-price-p { + font-size: 28rpx; + color: #FF3232; + line-height: 36rpx; + font-weight:500; +} +.index-scroll-view .commodity-info-price-o { + display: inline-block; + padding-left: 20rpx; + font-size: 24rpx; + color: #B4B4B4; + letter-spacing: 0.96rpx; + text-decoration:line-through; + line-height: 36rpx; +} +.commodity-info-price{ + line-height: 36rpx; +} +.remainingTime { + font-size: 28rpx; + color: #b4b4b4; +} + +.realRemainingTime { + color: #ff4949; + font-size: 28rpx; +} \ No newline at end of file