@@ -1,6 +1,7 @@ | |||
{ | |||
"pages": [ | |||
"pages/index/index", | |||
"pages/spellGroup/spellGroup", | |||
"pages/complete/index", | |||
"pages/main/index", | |||
"pages/bargain/bargainDatail/bargainDatail", | |||
@@ -0,0 +1,45 @@ | |||
// pages/index/sw/index.js | |||
const imgurl = require("../../utils/imgurl"); | |||
Component({ | |||
/** | |||
* 组件的属性列表 | |||
*/ | |||
properties: { | |||
list: { | |||
value: [], | |||
type: Array | |||
} | |||
}, | |||
/** | |||
* 组件的初始数据 | |||
*/ | |||
data: { | |||
swiperCurrent: 0, | |||
bannerUrl: imgurl.banner.url | |||
}, | |||
/** | |||
* 组件的方法列表 | |||
*/ | |||
ready() {}, | |||
methods: { | |||
swiperChange: function(e) { | |||
this.setData({ | |||
swiperCurrent: e.detail.current | |||
}); | |||
}, | |||
gotobannerdetail: function(e) { | |||
console.log(e) | |||
if(e.currentTarget.dataset.data.type==2){ | |||
wx.navigateTo({ | |||
url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}` | |||
}); | |||
}else{ | |||
wx.navigateTo({ | |||
url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}` | |||
}); | |||
} | |||
} | |||
} | |||
}); |
@@ -0,0 +1,6 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": { | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<view wx:if="{{list.length!=0}}" class="index-slide-view"> | |||
<swiper class="index-slide" bindchange="swiperChange" autoplay="true" circular="false"> | |||
<block wx:for="{{list}}" wx:key="unique"> | |||
<swiper-item> | |||
<image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' src="{{item.coverImg}}" class="index-slide-image" /> | |||
</swiper-item> | |||
</block> | |||
</swiper> | |||
<view class="dots"> | |||
<block wx:for="{{list}}" wx:key="unique"> | |||
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view> | |||
</block> | |||
</view> | |||
</view> |
@@ -0,0 +1,51 @@ | |||
.index-slide-view{ | |||
position: relative; | |||
width: 710rpx; | |||
height: 260rpx; | |||
overflow: hidden; | |||
/* margin:-132rpx auto 0; */ | |||
border-radius:16rpx; | |||
box-shadow: 0 6px 20px 0 rgba(0,0,0,0.15); | |||
} | |||
.index-slide, | |||
swiper-item | |||
.index-slide-image { | |||
display: block; | |||
width: 710rpx; | |||
height: 260rpx; | |||
margin: 0 auto; | |||
border-radius:16rpx; | |||
overflow: hidden; | |||
position: relative; | |||
} | |||
.index-slide-view .dots{ | |||
position: absolute; | |||
left: 0; | |||
right: 0; | |||
bottom: 20rpx; | |||
display: flex; | |||
justify-content: center; | |||
} | |||
.index-slide-view .dots .dot{ | |||
margin: 0 8rpx; | |||
width: 12rpx; | |||
height: 12rpx; | |||
background: #b6b6b7; | |||
border-radius: 50%; | |||
transition: all .6s; | |||
} | |||
.index-slide-view .dots .dot.active{ | |||
background: #02C0FF; | |||
width: 30rpx; | |||
height: 12rpx; | |||
border-radius:10rpx; | |||
opacity: 1; | |||
} | |||
.bannerbg{ | |||
width: 100%; | |||
} | |||
.bannerbg image{ | |||
display: block; | |||
width: 100%; | |||
} |
@@ -220,7 +220,11 @@ var config = { | |||
/** | |||
* 领取转赠卡 | |||
*/ | |||
cardAccept:'/couponOrder/cardAccept' | |||
cardAccept:'/couponOrder/cardAccept', | |||
/** | |||
* 获取我的拼团列表 | |||
*/ | |||
getMySepllList:'/orderGroup/queryOrderGroup' | |||
}, | |||
weapp: { | |||
AppId: weappId | |||
@@ -10,6 +10,7 @@ Page({ | |||
icon002: imgurl.icon002.url, | |||
icon003: imgurl.icon003.url, | |||
icon004: imgurl.icon004.url, | |||
sapellgroup: imgurl.sapellgroup.url, | |||
market: app.globalData.market, | |||
list: [], | |||
loading: true, | |||
@@ -37,6 +38,11 @@ Page({ | |||
url: '/pages/rushToBuy/index', | |||
}) | |||
}, | |||
gotoSpellGroup:function(){ | |||
wx.navigateTo({ | |||
url: '/pages/spellGroup/spellGroup', | |||
}) | |||
}, | |||
qrcode: function(e) { | |||
var that = this; | |||
that.setData({ | |||
@@ -11,6 +11,10 @@ | |||
<image src='{{icon002}}'></image> | |||
<text>消费卡</text> | |||
</view> | |||
<view bindtap='gotoSpellGroup'> | |||
<image src='{{sapellgroup}}'></image> | |||
<text>拼团专场</text> | |||
</view> | |||
<view bindtap='gotoBargain'> | |||
<image src='{{icon004}}'></image> | |||
<text>砍价专场</text> | |||
@@ -0,0 +1,302 @@ | |||
var config = require("../../config/config.js"); | |||
const Http = require("../../utils/HttpBasics"); | |||
const imgurl = require("../../utils/imgurl"); | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
bannerUrl: imgurl.banner.url, | |||
loadingUrl: imgurl.loading.url, | |||
bargaingoods: true, | |||
mybargain: false, | |||
list: [], | |||
lists: [], | |||
page: 1, // 设置加载的第几次,默认是第一次 | |||
pageSize: 10, //返回数据的个数 | |||
searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏 | |||
allow_load: true, // 是否允许继续加载标识 默认 true 允许,false 加载完成 | |||
myorder: false, | |||
actUrl: imgurl.act.url, | |||
loadingUrl: imgurl.loading.url, | |||
flag: 'bargaingoods', | |||
}, | |||
onLoad: function () { | |||
let that = this; | |||
that.getBannerlist(); | |||
var todayDate = new Date().getTime(); | |||
that.setData({ | |||
todayDate: todayDate | |||
}) | |||
that.getList(1, "bargaingoods"); | |||
that.setData({ | |||
flag: "bargaingoods", | |||
bargaingoods: true, | |||
mybargain: false | |||
}) | |||
}, | |||
//切换拼团列表 | |||
getSpellList(){ | |||
this.setData({ | |||
flag: "bargaingoods" | |||
}) | |||
this.getList(1, "bargaingoods") | |||
}, | |||
//切换我的拼团 | |||
getmyList(){ | |||
this.setData({ | |||
flag: "mybargain" | |||
}) | |||
this.getList(1, "mybargain") | |||
}, | |||
/** | |||
* banner | |||
*/ | |||
getBannerlist: function () { | |||
let that = this; | |||
Http.get({ | |||
url: config.api.bannerlist, | |||
data: { | |||
pageNum: 1, | |||
pageSize: 7 | |||
} | |||
}).then(res => { | |||
that.setData({ | |||
list: res.data.list | |||
}); | |||
}); | |||
}, | |||
getList(pageNum, flag) { | |||
var that = this; | |||
console.log(pageNum) | |||
if (that.data.allow_load) { | |||
/** | |||
* mybargain: 我的砍价 | |||
* bargaingoods: 砍价商品 | |||
*/ | |||
that.setData({ | |||
loading: true, | |||
content: '小主,我在玩命加载中...' | |||
}) | |||
var param = {}; | |||
if (flag == 'mybargain') { | |||
that.setData({ | |||
flag: "mybargain" | |||
}) | |||
var param = { | |||
pageNum: pageNum, | |||
pageSize: 10 | |||
}; | |||
var url = config.api.getMySepllList; | |||
} else if (flag == 'bargaingoods') { | |||
that.setData({ | |||
flag: "bargaingoods" | |||
}) | |||
var param = { | |||
pageNum: pageNum, | |||
pageSize: 10, | |||
targetAd: 7 | |||
}; | |||
var url = config.api.couponChannelList; | |||
} | |||
// 请求接口 | |||
Http.get({ | |||
url: url, | |||
data: param | |||
}).then(res => { | |||
console.log(res) | |||
/** | |||
* 加载完成 | |||
*/ | |||
if (pageNum >= res.data.pages) { | |||
if (res.data.pages == 0 || res.data.pages == 1) { | |||
that.setData({ | |||
allow_load: true, | |||
loading: false, | |||
content: "" | |||
}); | |||
} else { | |||
that.setData({ | |||
allow_load: false, | |||
loading: true, | |||
content: "——— 再拉裤子就掉了啦 ———", | |||
}); | |||
} | |||
} | |||
if (pageNum == 1) { | |||
that.setData({ | |||
lists: [], | |||
}) | |||
} | |||
if (flag == 'bargaingoods') { | |||
var tmpArr = that.data.lists; | |||
tmpArr.push.apply(tmpArr, res.data.list); | |||
that.setData({ | |||
lists: tmpArr | |||
}) | |||
} else if (flag == 'mybargain') { | |||
console.log(res.data.list) | |||
var tmpArr = that.data.lists; | |||
tmpArr.push.apply(tmpArr, res.data.list); | |||
console.log(tmpArr) | |||
let lists = []; | |||
tmpArr.map(file => { | |||
if (file.orderStatus != 1) { | |||
lists.push(file); | |||
} | |||
}) | |||
that.setData({ | |||
lists: lists | |||
}) | |||
} | |||
wx.stopPullDownRefresh(); | |||
}) | |||
.catch(err => { | |||
wx.stopPullDownRefresh(); | |||
wx.showToast({ | |||
title: err.message, | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
}) | |||
setTimeout(function () { | |||
that.setData({ | |||
loading: false, | |||
}) | |||
}, 1400); | |||
} else { | |||
that.setData({ | |||
loading: true, | |||
content: "——— 再拉裤子就掉了啦 ———" | |||
}) | |||
setTimeout(function () { | |||
that.setData({ | |||
loading: false, | |||
}) | |||
}, 1400) | |||
} | |||
}, | |||
/** | |||
* 如果是重新砍价,需要重新下单 | |||
*/ | |||
orderSave: function (couponId, couponChannelId) { | |||
Http.post({ | |||
url: config.api.orderSave, | |||
data: { | |||
couponId: "" + couponId, | |||
couponChannelId: "" + couponChannelId, | |||
press: true | |||
} | |||
}) | |||
.then(res => { | |||
console.log(res) | |||
wx.navigateTo({ | |||
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.orderNumber}` | |||
}) | |||
}) | |||
.catch(err => { | |||
wx.showToast({ | |||
title: err.message, | |||
icon: "none" | |||
}) | |||
}) | |||
}, | |||
inviteFriend: function (e) { | |||
/** | |||
* 添加标识 | |||
*/ | |||
wx.navigateTo({ | |||
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${e.currentTarget.dataset.id}` | |||
}) | |||
}, | |||
barginAgain: function (e) { | |||
let that = this; | |||
console.log(e) | |||
let couponId = e.currentTarget.dataset.couponid; | |||
let couponChannelId = e.currentTarget.dataset.couponchannelid; | |||
// let orderId = e.currentTarget.dataset.id; | |||
that.orderSave(couponId, couponChannelId) | |||
}, | |||
mybargain: function () { | |||
let that = this; | |||
that.setData({ | |||
bargaingoods: false, | |||
mybargain: true, | |||
flag: "mybargain", | |||
allow_load: true, | |||
loading: false, | |||
content: "", | |||
page: 1 | |||
}) | |||
that.getList(1, 'mybargain'); | |||
wx.setNavigationBarTitle({ | |||
title: '我的砍价' | |||
}) | |||
}, | |||
bargaingoods: function () { | |||
let that = this; | |||
that.setData({ | |||
bargaingoods: true, | |||
mybargain: false, | |||
flag: "bargaingoods", | |||
allow_load: true, | |||
loading: false, | |||
page: 1, | |||
content: "" | |||
}) | |||
that.getList(1, 'bargaingoods'); | |||
wx.setNavigationBarTitle({ | |||
title: '砍价专场' | |||
}) | |||
}, | |||
/** | |||
* | |||
* @param {砍价} 邀请好友砍价 | |||
*/ | |||
invite: function (e) { | |||
let couponChannelId = e.currentTarget.dataset.id; | |||
let couponId = e.currentTarget.dataset.couponid; | |||
if (couponChannelId && couponId) { | |||
wx.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}` | |||
}) | |||
} | |||
}, | |||
//加载更多 | |||
onReachBottom: function () { | |||
let that = this; | |||
that.data.page++; | |||
that.setData({ | |||
page: that.data.page | |||
}); | |||
that.getList(that.data.page, that.data.flag); | |||
}, | |||
/** | |||
* 刷新 | |||
*/ | |||
onPullDownRefresh: function (e) { | |||
let that = this; | |||
if (that.data.flag == 'bargaingoods') { | |||
that.getBannerlist(); | |||
var todayDate = new Date().getTime(); | |||
that.setData({ | |||
todayDate: todayDate | |||
}) | |||
that.getList(1, "bargaingoods"); | |||
that.setData({ | |||
flag: "bargaingoods", | |||
bargaingoods: true, | |||
mybargain: false | |||
}) | |||
} else if (that.data.flag == 'mybargain') { | |||
that.getList(1, "mybargain"); | |||
that.setData({ | |||
flag: "mybargain", | |||
bargaingoods: false, | |||
mybargain: true | |||
}) | |||
} | |||
}, | |||
}) |
@@ -0,0 +1,10 @@ | |||
{ | |||
"navigationBarTitleText": "拼团专场", | |||
"enablePullDownRefresh": true, | |||
"navigationBarBackgroundColor":"#F13C42", | |||
"usingComponents": { | |||
"c-banner": "../../components/spellbanner/index", | |||
"i-tab": "../../../dist/tab/index", | |||
"i-tabs": "../../../dist/tabs/index" | |||
} | |||
} |
@@ -0,0 +1,34 @@ | |||
<view class='content-box'> | |||
<view class='top'> | |||
<view class="banner" wx:if="{{list.length>0}}" hover-class="none" hover-stop-propagation="false"> | |||
<c-banner wx:key="unique" list="{{list}}" /> | |||
</view> | |||
</view> | |||
<view class='content'> | |||
<view class='sepll-list' wx:for="{{lists}}" wx:key="{{index}}"> | |||
<view class='spell-left'> | |||
<image src='{{item.coverImg}}'></image> | |||
</view> | |||
<view class='spell-center'> | |||
<view class='tilte'>{{item.title}}</view> | |||
<view class='remark'>{{item.subTitle}}</view> | |||
<view class='spell-num'>{{item.pressLimitNum+'人团'}}</view> | |||
<view class='price'> | |||
<view class='price01'> | |||
<view class='price-num'>{{item.salePriceStr}}</view> | |||
<view class='price-unit'>元</view> | |||
</view> | |||
<view class='price02'>{{item.priceStr}}</view> | |||
</view> | |||
</view> | |||
<view class='spell-right'> | |||
<view class='right-button'>去拼团</view> | |||
<view class='right-text'>已拼27</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class='bottom'> | |||
<view class='bottom-left' bindtap="getSpellList" style="background:{{flag=='bargaingoods'?'#FF7250':'#F3453A'}}">拼团商品</view> | |||
<view class='bottom-right' bindtap="getmyList" style="background:{{flag!='bargaingoods'?'#FF7250':'#F3453A'}}">我的拼团</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,197 @@ | |||
/* pages/spellGroup/spellGroup.wxss */ | |||
page { | |||
height: auto; | |||
overflow: auto; | |||
background-image: url('https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/spell-bg.png'); | |||
background-size: cover; | |||
background-repeat: no-repeat; | |||
} | |||
.content-box{ | |||
height: auto; | |||
background: #f89132; | |||
padding-bottom: 200rpx; | |||
} | |||
.banner{ | |||
margin-bottom: 20rpx; | |||
background: none; | |||
border-radius: 16rpx; | |||
} | |||
.banner .bg { | |||
display: block; | |||
width: 100%; | |||
} | |||
image{ | |||
padding: 0; | |||
margin: 0; | |||
} | |||
.banner .bannerbg image{ | |||
display: none!important; | |||
height: 0; | |||
overflow: hidden; | |||
} | |||
.bannerimg { | |||
display: block; | |||
width: 710rpx; | |||
height: 260rpx; | |||
border-radius: 15rpx; | |||
margin: -132rpx auto 0; | |||
} | |||
.banner .index-slide-view { | |||
margin: -132rpx auto 0; | |||
} | |||
.top{ | |||
position: absolute; | |||
top: 30rpx; | |||
width: 710rpx; | |||
height: 260rpx; | |||
background: #fff; | |||
left: 20rpx; | |||
border-radius: 16rpx; | |||
overflow: hidden; | |||
} | |||
.content{ | |||
margin-top: 320rpx; | |||
} | |||
.content .sepll-list{ | |||
width: 690rpx; | |||
height: 230rpx; | |||
background: #fff; | |||
border-radius: 30rpx; | |||
margin: 30rpx auto 0; | |||
} | |||
.content .spell-left{ | |||
width: 230rpx; | |||
height: 230rpx; | |||
float: left; | |||
} | |||
.content .spell-left image{ | |||
width: 180rpx; | |||
height: 180rpx; | |||
margin: 25rpx; | |||
} | |||
.content .spell-center{ | |||
float: left; | |||
width: 304rpx; | |||
height: 100%; | |||
} | |||
.content .tilte{ | |||
font-size:30rpx; | |||
font-family:PingFang-SC-Bold; | |||
font-weight:bold; | |||
color:rgba(51,51,51,1); | |||
line-height:44rpx; | |||
padding-top: 16rpx; | |||
} | |||
.content .remark{ | |||
width:304rpx; | |||
font-size:24rpx; | |||
font-family:PingFang-SC-Medium; | |||
font-weight:500; | |||
color:rgba(140,140,140,1); | |||
line-height:44rpx; | |||
overflow: hidden; | |||
text-overflow:ellipsis; | |||
white-space: nowrap; | |||
} | |||
.content .spell-num{ | |||
width: 95rpx; | |||
border:1px solid rgba(255,50,50,1); | |||
border-radius:10rpx; | |||
font-size:24rpx; | |||
font-family:PingFang-SC-Medium; | |||
font-weight:500; | |||
color:rgba(255,50,50,1); | |||
line-height:30rpx; | |||
margin: 10rpx 0; | |||
text-align: center; | |||
} | |||
.content .price{ | |||
overflow: hidden; | |||
margin-top: 10rpx; | |||
} | |||
.content .price01{ | |||
display: inline; | |||
font-size:50rpx; | |||
font-family:PingFang-SC-Medium; | |||
font-weight:500; | |||
color:rgba(255,50,50,1); | |||
line-height:44rpx; | |||
} | |||
.content .price02{ | |||
display: inline; | |||
font-size: 24rpx; | |||
font-family:PingFang-SC-Medium; | |||
font-weight:500; | |||
text-decoration:line-through; | |||
color:rgba(140,140,140,1); | |||
} | |||
.content .price-num{ | |||
display: inline; | |||
} | |||
.content .price-unit{ | |||
display: inline; | |||
font-size:24rpx; | |||
margin-right: 10rpx; | |||
} | |||
.content .spell-right{ | |||
float: left; | |||
width: 156rpx; | |||
} | |||
.right-button{ | |||
width:120rpx; | |||
height:48rpx; | |||
font-size:26rpx; | |||
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%); | |||
border-radius:24rpx; | |||
font-family:PingFang-SC-Medium; | |||
font-weight:500; | |||
text-align: center; | |||
color:rgba(255,255,255,1); | |||
line-height:44rpx; | |||
margin: 110rpx auto 0; | |||
margin-top: 110rpx; | |||
} | |||
.right-text{ | |||
font-size:22rpx; | |||
font-family:PingFang-SC-Medium; | |||
font-weight:500; | |||
color:rgba(140,140,140,1); | |||
line-height:60rpx; | |||
text-align: center; | |||
} | |||
.bottom{ | |||
width: 690rpx; | |||
height: 85rpx; | |||
position: fixed; | |||
bottom: 26rpx; | |||
left: 30rpx; | |||
/* background:rgba(243,69,58,1); */ | |||
border:1px solid rgba(255, 222, 67, 1); | |||
border-radius:40px; | |||
color: #fff; | |||
overflow: hidden; | |||
} | |||
.bottom-left{ | |||
width: 50%; | |||
float: left; | |||
margin-left: -1rpx; | |||
text-align: center; | |||
line-height: 85rpx; | |||
font-size:30rpx; | |||
font-family:PingFang-SC-Medium; | |||
font-weight:500; | |||
color:rgba(255,253,245,1); | |||
border-right:1px solid rgba(255, 222, 67, 1); | |||
opacity: 1; | |||
} | |||
.bottom-right{ | |||
width: 50%; | |||
float: left; | |||
text-align: center; | |||
line-height: 85rpx; | |||
font-size:30rpx; | |||
font-family:PingFang-SC-Medium; | |||
font-weight:500; | |||
color:rgba(255,253,245,1); | |||
opacity: 1; | |||
} |
@@ -356,4 +356,12 @@ module.exports = { | |||
'url': baseUrl + 'success01.png', | |||
'name': '卡领取成功图标' | |||
}, | |||
'sapellgroup': { | |||
'url': baseUrl + 'sapellgroup.png', | |||
'name': '拼团图标' | |||
}, | |||
'spellBg': { | |||
'url': baseUrl + 'spell-bg.png', | |||
'name': '拼团背景图片' | |||
}, | |||
} |