| @@ -1,9 +1,7 @@ | |||
| var config = require("../../config/config.js"); | |||
| const Http = require("../../utils/HttpBasics"); | |||
| const imgurl = require("../../utils/imgurl"); | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| @@ -21,7 +19,7 @@ Page({ | |||
| myorder: false, | |||
| actUrl: imgurl.act.url, | |||
| loadingUrl: imgurl.loading.url, | |||
| flag: null, | |||
| flag: 'bargaingoods', | |||
| }, | |||
| onShow: function () { | |||
| let that = this; | |||
| @@ -65,6 +63,7 @@ Page({ | |||
| }, | |||
| getList(pageNum, flag) { | |||
| var that = this; | |||
| console.log(pageNum) | |||
| if (that.data.allow_load) { | |||
| /** | |||
| * mybargain: 我的砍价 | |||
| @@ -81,7 +80,7 @@ Page({ | |||
| }) | |||
| var param = { | |||
| pageNum: pageNum, | |||
| pageSize: 6 | |||
| pageSize: 10 | |||
| }; | |||
| var url = config.api.pressOrderList; | |||
| } else if (flag == 'bargaingoods') { | |||
| @@ -90,7 +89,7 @@ Page({ | |||
| }) | |||
| var param = { | |||
| pageNum: pageNum, | |||
| pageSize: 6, | |||
| pageSize: 10, | |||
| targetAd: 6 | |||
| }; | |||
| var url = config.api.couponChannelList; | |||
| @@ -132,7 +131,7 @@ Page({ | |||
| }) | |||
| .catch(err => { | |||
| wx.showToast({ | |||
| title: err.errMsg, | |||
| title: err.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| @@ -158,7 +157,7 @@ Page({ | |||
| /** | |||
| * 如果是重新砍价,需要重新下单 | |||
| */ | |||
| orderSave: function (couponId,orderId,couponChannelId) { | |||
| orderSave: function (couponId,couponChannelId) { | |||
| Http.post({ | |||
| url: config.api.orderSave, | |||
| data: { | |||
| @@ -170,7 +169,7 @@ Page({ | |||
| .then(res => { | |||
| console.log(res) | |||
| wx.navigateTo({ | |||
| url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${orderId}` | |||
| url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.orderNumber}` | |||
| }) | |||
| }) | |||
| .catch(err => { | |||
| @@ -193,8 +192,8 @@ Page({ | |||
| console.log(e) | |||
| let couponId = e.currentTarget.dataset.couponid; | |||
| 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 () { | |||
| let that = this; | |||
| @@ -232,7 +231,6 @@ Page({ | |||
| * @param {砍价} 邀请好友砍价 | |||
| */ | |||
| invite: function (e) { | |||
| console.log(e.currentTarget.dataset.id); | |||
| let couponChannelId = e.currentTarget.dataset.id; | |||
| let couponId = e.currentTarget.dataset.couponid; | |||
| if (couponChannelId && couponId) { | |||
| @@ -4,7 +4,7 @@ | |||
| <c-banner wx:key="unique" list="{{list}}" /> | |||
| </view> | |||
| <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="" | |||
| bindload=""></image> | |||
| <view class="fl ri" hover-class="none" hover-stop-propagation="false"> | |||
| @@ -13,7 +13,7 @@ | |||
| <text class="txt03">{{item.priceStr}}元</text> | |||
| <text class="txt04">可砍至<text class="money">{{item.salePriceStr}}</text>元</text> | |||
| </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 class='dingdan' wx:if="{{list.length==0}}"> | |||
| <image src="{{actUrl}}" mode="widthFix"></image> | |||
| @@ -25,13 +25,13 @@ | |||
| </view> | |||
| </view> | |||
| <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="" | |||
| bindload=""></image> | |||
| <view class="fl ri" hover-class="none" hover-stop-propagation="false"> | |||
| <text class="txt01">{{item.title}}</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> | |||
| </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) { | |||
| 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> | |||
| <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}}"> | |||
| <button bindtap="barginAgain" data-couponChannelId="{{data.couponChannelId}}" data-couponId="{{data.productId}}" data-id="{{data.id}}">发起砍价</button> | |||
| <button bindtap="gotomore">更多砍价商品</button> | |||
| @@ -50,7 +53,7 @@ | |||
| </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}}"> | |||
| <text>{{data.price/100}}元</text> | |||
| <text>立即购买</text> | |||
| @@ -221,10 +221,12 @@ | |||
| width: 200rpx; | |||
| height: 200rpx; | |||
| border-radius:50%; | |||
| font-size: 24rpx; | |||
| font-size: 26rpx; | |||
| text-align: center; | |||
| line-height: 200rpx; | |||
| margin-top: 30rpx; | |||
| background: #EC3B2D; | |||
| color: #fff!important; | |||
| } | |||
| .helpDiscount::after{ border: none; } | |||
| .success{ | |||
| @@ -284,17 +286,17 @@ | |||
| text-align: center; | |||
| border: none; | |||
| } | |||
| .status button::after{ border: none; } | |||
| .status button:nth-of-type(1){ | |||
| 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; | |||
| margin-bottom: 38rpx; | |||
| color: #fff; | |||
| } | |||
| .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; | |||
| width:520rpx; | |||
| color: #333; | |||
| } | |||