|
@@ -267,6 +267,7 @@ Page({
|
267
|
267
|
})
|
268
|
268
|
}
|
269
|
269
|
//根据状态计算时间
|
|
270
|
+ clearInterval(_this.data.setInval);
|
270
|
271
|
_this.setGoodsTime(data.data.data[0].bid_opening, data.data.data[0].time_opening, data.data.data[0].time_end);
|
271
|
272
|
//设置进入页面时默标签显示商品详情
|
272
|
273
|
_this.setData({
|
|
@@ -313,8 +314,9 @@ Page({
|
313
|
314
|
* 生命周期函数--监听页面隐藏
|
314
|
315
|
*/
|
315
|
316
|
onHide: function() {
|
316
|
|
- clearInterval(this.data.setInval);
|
317
|
|
- clearInterval(this.data.setMtimeVal);
|
|
317
|
+ clearInterval(_this.data.setInval);
|
|
318
|
+ clearInterval(_this.data.setMtimeVal);
|
|
319
|
+ clearInterval(_this.data.serverTimeVal);
|
318
|
320
|
},
|
319
|
321
|
|
320
|
322
|
/**
|
|
@@ -367,7 +369,7 @@ Page({
|
367
|
369
|
console.log("id",_this.data.goodsInfo.kid)
|
368
|
370
|
console.log("price",_this.data.goodsInfo.price_bidder)
|
369
|
371
|
console.log("ydw-token",wx.getStorageSync('key').ydw_token)
|
370
|
|
- console.log("页面状态",data)
|
|
372
|
+ console.log("页面状态",data.data)
|
371
|
373
|
_this.setData({
|
372
|
374
|
online_sum: data.data.online_sum
|
373
|
375
|
})
|
|
@@ -391,12 +393,13 @@ Page({
|
391
|
393
|
|
392
|
394
|
}
|
393
|
395
|
if (data.data.offer_status) {
|
|
396
|
+
|
394
|
397
|
_this.setPageData(_this.data.goodsInfo.kid);
|
395
|
398
|
if (data.data.offer_price_persion !== wx.getStorageSync('persion').persion.kid) {
|
396
|
399
|
wx.showToast({
|
397
|
400
|
title: '有新的报价!',
|
398
|
401
|
icon: 'none',
|
399
|
|
- duration: 3000
|
|
402
|
+ duration: 1000
|
400
|
403
|
});
|
401
|
404
|
};
|
402
|
405
|
};
|
|
@@ -443,7 +446,10 @@ Page({
|
443
|
446
|
dataType: 'json',
|
444
|
447
|
responseType: 'text',
|
445
|
448
|
success: function(data) {
|
446
|
|
- console.log("更新数据",data)
|
|
449
|
+ console.log("结束时间",data.data.data[0].time_end)
|
|
450
|
+ console.log("结束时间", _this.getMyDate(parseInt(_this.data.nowTime)))
|
|
451
|
+ console.log("结束时间", _this.getMyDate(parseInt(data.data.data[0].time_end)))
|
|
452
|
+
|
447
|
453
|
var pmItem = data.data.data[0];
|
448
|
454
|
if (data.data.data[0].price_bidder == 0) {
|
449
|
455
|
_this.setData({
|
|
@@ -472,6 +478,26 @@ Page({
|
472
|
478
|
complete: function(res) {},
|
473
|
479
|
})
|
474
|
480
|
},
|
|
481
|
+ getMyDate: function(str) {
|
|
482
|
+ let _this = this;
|
|
483
|
+ var oDate = new Date(str),
|
|
484
|
+ oYear = oDate.getFullYear(),
|
|
485
|
+ oMonth = oDate.getMonth()+1,
|
|
486
|
+ oDay = oDate.getDate(),
|
|
487
|
+ oHour = oDate.getHours(),
|
|
488
|
+ oMin = oDate.getMinutes(),
|
|
489
|
+ oSen = oDate.getSeconds(),
|
|
490
|
+ oTime = oYear +'-'+ _this.addZero(oMonth) +'-'+ _this.addZero(oDay) +' '+ _this.addZero(oHour) +':'+
|
|
491
|
+ _this.addZero(oMin) +':'+_this.addZero(oSen);
|
|
492
|
+ return oTime;
|
|
493
|
+},
|
|
494
|
+//补零操作
|
|
495
|
+ addZero:function(num){
|
|
496
|
+ if(parseInt(num) < 10){
|
|
497
|
+ num = '0'+num;
|
|
498
|
+ }
|
|
499
|
+ return num;
|
|
500
|
+},
|
475
|
501
|
//设置服务器时间
|
476
|
502
|
setServerTime: function() {
|
477
|
503
|
let _this = this;
|
|
@@ -713,7 +739,7 @@ _this.setData({
|
713
|
739
|
if (_this.data.onlineFlag) {
|
714
|
740
|
onlineUrl = '../payDeposit/payDeposit?kid=' + _this.data.goodsInfo.kid + '&deposit=' + _this.data.goodsInfo.price_guarantee + '&auction_way=' + _this.data.goodsInfo.auction_way + "&time=" + _this.data.goodsInfo.time_opening
|
715
|
741
|
} else {
|
716
|
|
- onlineUrl = '../OfflinePayment/OfflinePayment?kid=' + _this.data.goodsInfo.kid + '&deposit=' + _this.data.goodsInfo.price_guarantee
|
|
742
|
+ onlineUrl = '../OfflinePayment/OfflinePayment?kid=' + _this.data.goodsInfo.kid + '&deposit=' + _this.data.goodsInfo.price_guarantee + '&bidding_agreement_path=' + _this.data.goodsInfo.bidding_agreement_path + '&bidding_rules_path=' + _this.data.goodsInfo.bidding_rules_path
|
717
|
743
|
}
|
718
|
744
|
wx.navigateTo({
|
719
|
745
|
url: onlineUrl,
|
|
@@ -727,6 +753,10 @@ _this.setData({
|
727
|
753
|
//跳转出价记录
|
728
|
754
|
getRecordlist:function(e){
|
729
|
755
|
let _this = this;
|
|
756
|
+ clearInterval(_this.data.setInval);
|
|
757
|
+ clearInterval(_this.data.setMtimeVal);
|
|
758
|
+ clearInterval(_this.data.serverTimeVal);
|
|
759
|
+
|
730
|
760
|
wx.navigateTo({
|
731
|
761
|
url: '/pages/recordlist/recordlist?kid='+ _this.data.goodsInfo.kid
|
732
|
762
|
})
|