@@ -1,9 +1,7 @@ | |||||
var config = require("../../config/config.js"); | var config = require("../../config/config.js"); | ||||
const Http = require("../../utils/HttpBasics"); | const Http = require("../../utils/HttpBasics"); | ||||
const imgurl = require("../../utils/imgurl"); | const imgurl = require("../../utils/imgurl"); | ||||
Page({ | Page({ | ||||
/** | /** | ||||
* 页面的初始数据 | * 页面的初始数据 | ||||
*/ | */ | ||||
@@ -21,7 +19,7 @@ Page({ | |||||
myorder: false, | myorder: false, | ||||
actUrl: imgurl.act.url, | actUrl: imgurl.act.url, | ||||
loadingUrl: imgurl.loading.url, | loadingUrl: imgurl.loading.url, | ||||
flag: null, | |||||
flag: 'bargaingoods', | |||||
}, | }, | ||||
onShow: function () { | onShow: function () { | ||||
let that = this; | let that = this; | ||||
@@ -65,6 +63,7 @@ Page({ | |||||
}, | }, | ||||
getList(pageNum, flag) { | getList(pageNum, flag) { | ||||
var that = this; | var that = this; | ||||
console.log(pageNum) | |||||
if (that.data.allow_load) { | if (that.data.allow_load) { | ||||
/** | /** | ||||
* mybargain: 我的砍价 | * mybargain: 我的砍价 | ||||
@@ -81,7 +80,7 @@ Page({ | |||||
}) | }) | ||||
var param = { | var param = { | ||||
pageNum: pageNum, | pageNum: pageNum, | ||||
pageSize: 6 | |||||
pageSize: 10 | |||||
}; | }; | ||||
var url = config.api.pressOrderList; | var url = config.api.pressOrderList; | ||||
} else if (flag == 'bargaingoods') { | } else if (flag == 'bargaingoods') { | ||||
@@ -90,7 +89,7 @@ Page({ | |||||
}) | }) | ||||
var param = { | var param = { | ||||
pageNum: pageNum, | pageNum: pageNum, | ||||
pageSize: 6, | |||||
pageSize: 10, | |||||
targetAd: 6 | targetAd: 6 | ||||
}; | }; | ||||
var url = config.api.couponChannelList; | var url = config.api.couponChannelList; | ||||
@@ -132,7 +131,7 @@ Page({ | |||||
}) | }) | ||||
.catch(err => { | .catch(err => { | ||||
wx.showToast({ | wx.showToast({ | ||||
title: err.errMsg, | |||||
title: err.message, | |||||
icon: 'none', | icon: 'none', | ||||
duration: 2000, | duration: 2000, | ||||
mask: false | mask: false | ||||
@@ -158,7 +157,7 @@ Page({ | |||||
/** | /** | ||||
* 如果是重新砍价,需要重新下单 | * 如果是重新砍价,需要重新下单 | ||||
*/ | */ | ||||
orderSave: function (couponId,orderId,couponChannelId) { | |||||
orderSave: function (couponId,couponChannelId) { | |||||
Http.post({ | Http.post({ | ||||
url: config.api.orderSave, | url: config.api.orderSave, | ||||
data: { | data: { | ||||
@@ -170,7 +169,7 @@ Page({ | |||||
.then(res => { | .then(res => { | ||||
console.log(res) | console.log(res) | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${orderId}` | |||||
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.orderNumber}` | |||||
}) | }) | ||||
}) | }) | ||||
.catch(err => { | .catch(err => { | ||||
@@ -193,8 +192,8 @@ Page({ | |||||
console.log(e) | console.log(e) | ||||
let couponId = e.currentTarget.dataset.couponid; | let couponId = e.currentTarget.dataset.couponid; | ||||
let couponChannelId = e.currentTarget.dataset.couponchannelid; | let couponChannelId = e.currentTarget.dataset.couponchannelid; | ||||
let orderId = e.currentTarget.dataset.id; | |||||
that.orderSave(couponId,orderId,couponChannelId) | |||||
// let orderId = e.currentTarget.dataset.id; | |||||
that.orderSave(couponId,couponChannelId) | |||||
}, | }, | ||||
mybargain: function () { | mybargain: function () { | ||||
let that = this; | let that = this; | ||||
@@ -232,7 +231,6 @@ Page({ | |||||
* @param {砍价} 邀请好友砍价 | * @param {砍价} 邀请好友砍价 | ||||
*/ | */ | ||||
invite: function (e) { | invite: function (e) { | ||||
console.log(e.currentTarget.dataset.id); | |||||
let couponChannelId = e.currentTarget.dataset.id; | let couponChannelId = e.currentTarget.dataset.id; | ||||
let couponId = e.currentTarget.dataset.couponid; | let couponId = e.currentTarget.dataset.couponid; | ||||
if (couponChannelId && couponId) { | if (couponChannelId && couponId) { | ||||
@@ -4,7 +4,7 @@ | |||||
<c-banner wx:key="unique" list="{{list}}" /> | <c-banner wx:key="unique" list="{{list}}" /> | ||||
</view> | </view> | ||||
<view class="list" hover-class="none" hover-stop-propagation="false"> | <view class="list" hover-class="none" hover-stop-propagation="false"> | ||||
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="{{index}}" hover-class="none" hover-stop-propagation="false"> | |||||
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="{{index}}" hover-class="none" hover-stop-propagation="false" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'> | |||||
<image class="fl" src="{{item.coverImg}}" mode="widthFix" lazy-load="true" binderror="" | <image class="fl" src="{{item.coverImg}}" mode="widthFix" lazy-load="true" binderror="" | ||||
bindload=""></image> | bindload=""></image> | ||||
<view class="fl ri" hover-class="none" hover-stop-propagation="false"> | <view class="fl ri" hover-class="none" hover-stop-propagation="false"> | ||||
@@ -13,7 +13,7 @@ | |||||
<text class="txt03">{{item.priceStr}}元</text> | <text class="txt03">{{item.priceStr}}元</text> | ||||
<text class="txt04">可砍至<text class="money">{{item.salePriceStr}}</text>元</text> | <text class="txt04">可砍至<text class="money">{{item.salePriceStr}}</text>元</text> | ||||
</view> | </view> | ||||
<view class="botton" hover-class="none" hover-stop-propagation="false" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'>发起砍价</view> | |||||
<view class="botton" hover-class="none" hover-stop-propagation="false">发起砍价</view> | |||||
</view> | </view> | ||||
<view class='dingdan' wx:if="{{list.length==0}}"> | <view class='dingdan' wx:if="{{list.length==0}}"> | ||||
<image src="{{actUrl}}" mode="widthFix"></image> | <image src="{{actUrl}}" mode="widthFix"></image> | ||||
@@ -25,13 +25,13 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="list mybargain" wx:if="{{mybargain}}" hover-class="none" hover-stop-propagation="false"> | <view class="list mybargain" wx:if="{{mybargain}}" hover-class="none" hover-stop-propagation="false"> | ||||
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="index" wx:if="{{item.orderStatus == 8||item.orderStatus == 6|| item.orderStatus == 7 || item.orderStatus == 9}}" hover-class="none" hover-stop-propagation="false"> | |||||
<view class="listitem clearfix" wx:for="{{lists}}" wx:key="index" wx:if="{{item.orderStatus == 6||item.orderStatus == 7|| item.orderStatus == 8 || item.orderStatus == 9}}" hover-class="none" hover-stop-propagation="false"> | |||||
<image class="fl" src="{{item.coverImg}}" mode="widthFix" lazy-load="true" binderror="" | <image class="fl" src="{{item.coverImg}}" mode="widthFix" lazy-load="true" binderror="" | ||||
bindload=""></image> | bindload=""></image> | ||||
<view class="fl ri" hover-class="none" hover-stop-propagation="false"> | <view class="fl ri" hover-class="none" hover-stop-propagation="false"> | ||||
<text class="txt01">{{item.title}}</text> | <text class="txt01">{{item.title}}</text> | ||||
<text class="txt02">{{item.subTitle}}</text> | <text class="txt02">{{item.subTitle}}</text> | ||||
<text class="txt04 mr" wx:if="{{item.orderStatus != 7}}">距砍价到{{item.salePrice/100}}元还差:{{item.pressCurrentValue/100}}元</text> | |||||
<text class="txt04 mr" wx:if="{{item.orderStatus != 7&&item.orderStatus != 8}}">距砍价到{{item.salePrice/100}}元还差:{{item.pressCurrentValue/100}}元</text> | |||||
<text class="txt04 mr" wx:if="{{item.orderStatus == 7}}">已砍价到底价:{{item.salePrice/100}}元</text> | <text class="txt04 mr" wx:if="{{item.orderStatus == 7}}">已砍价到底价:{{item.salePrice/100}}元</text> | ||||
</view> | </view> | ||||
<view class="botton1" wx:if="{{item.orderStatus == 6&&todayDate<=item.pressEndDate}}" hover-class="none" hover-stop-propagation="false" data-id="{{item.id}}" bindtap="inviteFriend">邀请好友砍价</view> | <view class="botton1" wx:if="{{item.orderStatus == 6&&todayDate<=item.pressEndDate}}" hover-class="none" hover-stop-propagation="false" data-id="{{item.id}}" bindtap="inviteFriend">邀请好友砍价</view> | ||||
@@ -499,5 +499,10 @@ function diffTime(startDate) { | |||||
if (days > 0) { | if (days > 0) { | ||||
returnStr = days + "天" + returnStr; | returnStr = days + "天" + returnStr; | ||||
} | } | ||||
return returnStr; | |||||
if (returnStr.indexOf('-1')==-1){ | |||||
return returnStr; | |||||
}else{ | |||||
return '1秒' | |||||
} | |||||
} | } |
@@ -22,6 +22,9 @@ | |||||
<view class="fail" hover-class="none" hover-stop-propagation="false" wx:if="{{todayDate>data.pressEndDate && from=='discount'&& discountStatus !=1}}"> | <view class="fail" hover-class="none" hover-stop-propagation="false" wx:if="{{todayDate>data.pressEndDate && from=='discount'&& discountStatus !=1}}"> | ||||
好友的砍价已过期 | 好友的砍价已过期 | ||||
</view> | </view> | ||||
<view class="fail" hover-class="none" hover-stop-propagation="false" wx:if="{{todayDate>data.pressEndDate && discountStatus ==1}}"> | |||||
您的砍价已过期 | |||||
</view> | |||||
<view class="status" hover-class="none" hover-stop-propagation="false" wx:if="{{discountStatus==3}}"> | <view class="status" hover-class="none" hover-stop-propagation="false" wx:if="{{discountStatus==3}}"> | ||||
<button bindtap="barginAgain" data-couponChannelId="{{data.couponChannelId}}" data-couponId="{{data.productId}}" data-id="{{data.id}}">发起砍价</button> | <button bindtap="barginAgain" data-couponChannelId="{{data.couponChannelId}}" data-couponId="{{data.productId}}" data-id="{{data.id}}">发起砍价</button> | ||||
<button bindtap="gotomore">更多砍价商品</button> | <button bindtap="gotomore">更多砍价商品</button> | ||||
@@ -50,7 +53,7 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view wx:if="{{data.orderStatus != 7&&discountStatus==1}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | |||||
<view wx:if="{{data.orderStatus != 7&&discountStatus==1&&todayDate<=data.pressEndDate}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | |||||
<view class="fl" bindtap='orderFunc' data-orderId="{{data.id}}" data-price="{{data.price/100}}"> | <view class="fl" bindtap='orderFunc' data-orderId="{{data.id}}" data-price="{{data.price/100}}"> | ||||
<text>{{data.price/100}}元</text> | <text>{{data.price/100}}元</text> | ||||
<text>立即购买</text> | <text>立即购买</text> | ||||
@@ -221,10 +221,12 @@ | |||||
width: 200rpx; | width: 200rpx; | ||||
height: 200rpx; | height: 200rpx; | ||||
border-radius:50%; | border-radius:50%; | ||||
font-size: 24rpx; | |||||
font-size: 26rpx; | |||||
text-align: center; | text-align: center; | ||||
line-height: 200rpx; | line-height: 200rpx; | ||||
margin-top: 30rpx; | margin-top: 30rpx; | ||||
background: #EC3B2D; | |||||
color: #fff!important; | |||||
} | } | ||||
.helpDiscount::after{ border: none; } | .helpDiscount::after{ border: none; } | ||||
.success{ | .success{ | ||||
@@ -284,17 +286,17 @@ | |||||
text-align: center; | text-align: center; | ||||
border: none; | border: none; | ||||
} | } | ||||
.status button::after{ border: none; } | |||||
.status button:nth-of-type(1){ | .status button:nth-of-type(1){ | ||||
background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%); | background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%); | ||||
border:1rpx solid rgba(236,59,45,1); | |||||
border:1px solid rgba(236,59,45,1); | |||||
border-radius:48rpx; | border-radius:48rpx; | ||||
margin-bottom: 38rpx; | margin-bottom: 38rpx; | ||||
color: #fff; | color: #fff; | ||||
} | } | ||||
.status button:nth-of-type(2){ | .status button:nth-of-type(2){ | ||||
background:rgba(255,255,255,1); | |||||
border:1rpx solid rgba(190,190,190,1); | |||||
background:rgba(190,190,190,1); | |||||
border:1px solid rgba(190,190,190,1); | |||||
border-radius:48rpx; | border-radius:48rpx; | ||||
width:520rpx; | |||||
color: #333; | color: #333; | ||||
} | } |