| @@ -1,6 +1,6 @@ | |||||
| .index-coupons { | .index-coupons { | ||||
| /* height: 820rpx; */ | /* height: 820rpx; */ | ||||
| margin-top: 30rpx; | |||||
| /* margin-top: 30rpx; */ | |||||
| background:linear-gradient(0deg,rgba(235,235,235,1) 0%,rgba(255,255,255,1) 100%); | background:linear-gradient(0deg,rgba(235,235,235,1) 0%,rgba(255,255,255,1) 100%); | ||||
| } | } | ||||
| @@ -18,10 +18,8 @@ Page({ | |||||
| icon0006: imgurl.icon0006.url, | icon0006: imgurl.icon0006.url, | ||||
| icon0007: imgurl.icon0007.url, | icon0007: imgurl.icon0007.url, | ||||
| icon0008: imgurl.icon0008.url, | icon0008: imgurl.icon0008.url, | ||||
| rushtobuy: imgurl.rushtobuy.url, | |||||
| barcode: imgurl.barcode.url, | barcode: imgurl.barcode.url, | ||||
| leftarrows: imgurl.leftarrows.url, | leftarrows: imgurl.leftarrows.url, | ||||
| wmcard: imgurl.wmcard.url, | |||||
| newcard:imgurl.newcard.url, | newcard:imgurl.newcard.url, | ||||
| newseckill: imgurl.newseckill.url, | newseckill: imgurl.newseckill.url, | ||||
| newbargain: imgurl.newbargain.url, | newbargain: imgurl.newbargain.url, | ||||
| @@ -74,18 +72,7 @@ Page({ | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/couponorder/index/index', | url: '/pages/couponorder/index/index', | ||||
| }) | }) | ||||
| }, | |||||
| gotodiscountCardList: function() { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/discountCardList/discountCardList' | |||||
| }) | |||||
| }, | |||||
| //跳往限时秒杀 | |||||
| gotoRushBuy: function() { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/rushToBuy/index', | |||||
| }) | |||||
| }, | |||||
| }, | |||||
| gotoSpellGroup:function(){ | gotoSpellGroup:function(){ | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/spellGroup/spellGroup', | url: '/pages/spellGroup/spellGroup', | ||||
| @@ -123,6 +110,18 @@ Page({ | |||||
| showQrcode: false | showQrcode: false | ||||
| }) | }) | ||||
| }, | }, | ||||
| //跳往限时秒杀 | |||||
| gotoRushBuy: function () { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/rushToBuy/index', | |||||
| }) | |||||
| }, | |||||
| // 跳往卡列表 | |||||
| gotodiscountcard: function () { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/discountCardList/discountCardList', | |||||
| }) | |||||
| }, | |||||
| //跳往个人中心 | //跳往个人中心 | ||||
| gotouser:function(){ | gotouser:function(){ | ||||
| wx.switchTab({ | wx.switchTab({ | ||||
| @@ -174,17 +173,6 @@ Page({ | |||||
| swiperCurrent: e.detail.current | swiperCurrent: e.detail.current | ||||
| }); | }); | ||||
| }, | }, | ||||
| rushtobuy:function(){ | |||||
| wx.navigateTo({ | |||||
| url: '/pages/rushToBuy/index', | |||||
| }) | |||||
| }, | |||||
| // 跳往卡列表 | |||||
| gotodiscountcard:function(){ | |||||
| wx.navigateTo({ | |||||
| url: '/pages/discountCardList/discountCardList', | |||||
| }) | |||||
| }, | |||||
| gotogame: function() { | gotogame: function() { | ||||
| let that = this; | let that = this; | ||||
| Http.get({ | Http.get({ | ||||
| @@ -618,8 +606,9 @@ Page({ | |||||
| wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
| }; | }; | ||||
| // 砍价下拉刷新 | // 砍价下拉刷新 | ||||
| that.selectComponent("#bargain").getList(); | |||||
| that.selectComponent("#bargain").getList(); | |||||
| that.selectComponent("#spellGroup").getList(); | that.selectComponent("#spellGroup").getList(); | ||||
| that.selectComponent("#rushtobyCard").getList(); | |||||
| wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
| }, | }, | ||||
| //加载更多 | //加载更多 | ||||
| @@ -5,7 +5,8 @@ | |||||
| "c-bargain": "./bargain/index", | "c-bargain": "./bargain/index", | ||||
| "c-spellGroup": "./spellGroup/index", | "c-spellGroup": "./spellGroup/index", | ||||
| "c-coupons": "./coupons/index", | "c-coupons": "./coupons/index", | ||||
| "g-entry": "../../components/gameentry/gentry" | |||||
| "g-entry": "../../components/gameentry/gentry", | |||||
| "c-rushtobyCard": "./rushtobyCard/index" | |||||
| }, | }, | ||||
| "navigationBarTitleText": "首页", | "navigationBarTitleText": "首页", | ||||
| "enablePullDownRefresh": true | "enablePullDownRefresh": true | ||||
| @@ -67,16 +67,8 @@ | |||||
| <image src="{{usergift}}" bindtap="gotogame" class='gameimg' mode='widthFix'></image> | <image src="{{usergift}}" bindtap="gotogame" class='gameimg' mode='widthFix'></image> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='clearfix rushtobuyimgs'> | |||||
| <view> | |||||
| <text class='xianshi'>限时</text><text class='qianggou'>秒杀</text> | |||||
| <image class='fl' src='{{rushtobuy}}' bindtap='rushtobuy' mode='widthFix'></image> | |||||
| </view> | |||||
| <view> | |||||
| <text class='xiaofei'>消费</text> <text class='ka'>卡</text><text class='subtitle'>好物提前购</text> | |||||
| <image class='fr' src='{{wmcard}}' bindtap='gotodiscountcard' mode='widthFix'></image> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 限时抢购和消费卡 --> | |||||
| <c-rushtobyCard id="rushtobyCard"/> | |||||
| <c-coupons id="lists" bind:myevent="onGetCode" loadingtext="{{loadingtext}}" loading="{{loading}}" /> | <c-coupons id="lists" bind:myevent="onGetCode" loadingtext="{{loadingtext}}" loading="{{loading}}" /> | ||||
| <g-entry id="listss" wx:if="{{showGame&&!played&&!havePlayEd}}" gamedata="{{gamedata}}" bind:myevent="" /> | <g-entry id="listss" wx:if="{{showGame&&!played&&!havePlayEd}}" gamedata="{{gamedata}}" bind:myevent="" /> | ||||
| </view> | </view> | ||||
| @@ -47,40 +47,7 @@ page { | |||||
| display: block; | display: block; | ||||
| width: 100%; | 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{ | .userinfo{ | ||||
| position:relative; | position:relative; | ||||
| margin: 0 auto 38rpx; | margin: 0 auto 38rpx; | ||||
| @@ -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); | |||||
| } | |||||
| } | |||||
| }); | |||||
| @@ -0,0 +1,3 @@ | |||||
| { | |||||
| "component": true | |||||
| } | |||||
| @@ -0,0 +1,40 @@ | |||||
| <view class="index-rushToBuy" wx:if="{{list.length>0}}"> | |||||
| <view class='clearfix rushtobuyimgs'> | |||||
| <!-- 限时抢购 --> | |||||
| <view wx:if="{{list.length!=0}}"> | |||||
| <text class='xianshi'>限时</text><text class='qianggou'>秒杀</text> | |||||
| <scroll-view scroll-x class="index-scroll-view"> | |||||
| <view class="commodity" wx:for="{{list}}" wx:key="unique"> | |||||
| <view bindtap="rushtobuy" data-couponId="{{item.couponId}}" data-couponChannelId="{{item.id}}" data-targetAd="{{item.targetAd}}" > | |||||
| <image mode='aspectFill' lazy-load='true' class="commodity-img" src="{{item.coverImg}}" /> | |||||
| <view class="commodity-info"> | |||||
| <view class="commodity-info-name">{{item.title}}</view> | |||||
| <view class="commodity-info-price"> | |||||
| <text class="commodity-info-price-p">{{item.salePriceStr}}元</text> | |||||
| <text class="commodity-info-price-o">{{item.priceStr}}元</text> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </scroll-view> | |||||
| </view> | |||||
| <!-- 消费卡列表 --> | |||||
| <view wx:if="{{cardlist.length!=0}}"> | |||||
| <text class='xiaofei'>消费</text> <text class='ka'>卡</text><text class='subtitle'>好物提前购</text> | |||||
| <scroll-view scroll-x class="index-scroll-view"> | |||||
| <view class="commodity" wx:for="{{cardlist}}" wx:key="unique"> | |||||
| <view bindtap="gotodiscountCardList" data-couponId='{{item.couponId}}' data-type="{{item.type}}" data-quancode="{{item.id}}"> | |||||
| <image mode='aspectFill' lazy-load='true' class="commodity-img" src="{{item.coverImg}}" /> | |||||
| <view class="commodity-info"> | |||||
| <view class="commodity-info-name">{{item.title}}</view> | |||||
| <view class="commodity-info-price"> | |||||
| <text class="commodity-info-price-p">{{item.salePriceStr}}元</text> | |||||
| <text class="commodity-info-price-o">{{item.priceStr}}元</text> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </scroll-view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| @@ -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; | |||||
| } | |||||