Bladeren bron

产权交易

newProperty
庞东旭 1 jaar geleden
bovenliggende
commit
1947a5a8e3
4 gewijzigde bestanden met toevoegingen van 43 en 62 verwijderingen
  1. +22
    -19
      static/js/lib/paging/page_common.js
  2. +5
    -29
      static/js/project/bidding/biddingList.js
  3. +15
    -13
      static/js/project/listingItems/items2.js
  4. +1
    -1
      view/listingItems/itemsDetail.html

+ 22
- 19
static/js/lib/paging/page_common.js Bestand weergeven

@@ -38,7 +38,7 @@ function setPage(dom, pageData) {
if(pageData.maxBtnNum<5||pageData.maxBtnNum==undefined){ if(pageData.maxBtnNum<5||pageData.maxBtnNum==undefined){
pageData.maxBtnNum=5; pageData.maxBtnNum=5;
} }
if(pageData.pageCurrent==undefined){ if(pageData.pageCurrent==undefined){
pageData.pageCurrent=1; pageData.pageCurrent=1;
} }
@@ -57,6 +57,7 @@ function setPage(dom, pageData) {


// 获取需要多少个按钮 // 获取需要多少个按钮
var btnSum; // sum var btnSum; // sum
console.log(pageData)
if (pageData.pageTotal < pageData.pageSize) { if (pageData.pageTotal < pageData.pageSize) {
btnSum = 1; btnSum = 1;
} else if (pageData.pageTotal % pageData.pageSize === 0) { } else if (pageData.pageTotal % pageData.pageSize === 0) {
@@ -92,7 +93,7 @@ function setPage(dom, pageData) {
maxPageNum-- maxPageNum--
} }


if(minPageNum<1){
if(minPageNum<1){
maxPageNum+= 1-minPageNum; maxPageNum+= 1-minPageNum;
minPageNum=1; minPageNum=1;
} }
@@ -107,9 +108,9 @@ function setPage(dom, pageData) {


// 生成按钮 // 生成按钮
for(var i=minPageNum;i<maxPageNum+1;i++){ for(var i=minPageNum;i<maxPageNum+1;i++){
if(i==pageCurrent){
if(i==pageCurrent){
html_S='<span class="page_common_btn_style page_common_btn_active" data-pageIndex="'+i+'" onclick="turnThePage('+i+')">'+i+'</span>'; html_S='<span class="page_common_btn_style page_common_btn_active" data-pageIndex="'+i+'" onclick="turnThePage('+i+')">'+i+'</span>';
}else{
}else{
html_S='<a class="page_common_btn_style" data-pageIndex="'+i+'" onclick="turnThePage('+i+')">'+i+'</a>'; html_S='<a class="page_common_btn_style" data-pageIndex="'+i+'" onclick="turnThePage('+i+')">'+i+'</a>';
} }
if(i==minPageNum&&minPageNum!=1){ if(i==minPageNum&&minPageNum!=1){
@@ -121,17 +122,17 @@ function setPage(dom, pageData) {
content_html+=html_S; content_html+=html_S;
} }
$(dom.el+' .page_btn_box').html(content_html) $(dom.el+' .page_btn_box').html(content_html)
}
}
createBtnItem(Current); createBtnItem(Current);
//
//
setUpbtnState(dom.el,Current) setUpbtnState(dom.el,Current)


// 分页切换按钮事件 // 分页切换按钮事件
$(dom.el+' .page_btn_box').on('click','a.page_common_btn_style',function(){ $(dom.el+' .page_btn_box').on('click','a.page_common_btn_style',function(){
Current=parseInt($(this).attr('data-pageIndex')); Current=parseInt($(this).attr('data-pageIndex'));
createBtnItem(Current); createBtnItem(Current);
//
//
setUpbtnState(dom.el,Current) setUpbtnState(dom.el,Current)
}) })


@@ -141,9 +142,9 @@ function setPage(dom, pageData) {
return; return;
} }
Current-=1; Current-=1;
createBtnItem(Current); createBtnItem(Current);
//
//
setUpbtnState(dom.el,Current) setUpbtnState(dom.el,Current)
turnThePage(Current) turnThePage(Current)
}) })
@@ -154,22 +155,24 @@ function setPage(dom, pageData) {
return; return;
} }
Current=1; Current=1;
createBtnItem(Current); createBtnItem(Current);
//
//
setUpbtnState(dom.el,Current) setUpbtnState(dom.el,Current)
turnThePage(Current) turnThePage(Current)
}) })


// 下一页事件 // 下一页事件
$(dom.el).on('click','a.next_btn',function(){ $(dom.el).on('click','a.next_btn',function(){
console.log(Current)
console.log(btnSum)
if(Current>=btnSum){ if(Current>=btnSum){
return; return;
} }
Current+=1; Current+=1;
createBtnItem(Current); createBtnItem(Current);
//
//
setUpbtnState(dom.el,Current) setUpbtnState(dom.el,Current)
turnThePage(Current) turnThePage(Current)
}) })
@@ -181,9 +184,9 @@ function setPage(dom, pageData) {
return; return;
} }
Current=btnSum; Current=btnSum;
createBtnItem(Current); createBtnItem(Current);
//
//
setUpbtnState(dom.el,Current) setUpbtnState(dom.el,Current)
turnThePage(Current) turnThePage(Current)
}) })
@@ -208,8 +211,8 @@ function setPage(dom, pageData) {
setCssStyle(1,none_css) setCssStyle(1,none_css)
setCssStyle(2,none_css) setCssStyle(2,none_css)
} }
//
//
function setCssStyle(type,_cssObject){ function setCssStyle(type,_cssObject){
if(type==1){ if(type==1){
// 上 // 上
@@ -222,4 +225,4 @@ function setPage(dom, pageData) {
} }
} }
} }
}
}

+ 5
- 29
static/js/project/bidding/biddingList.js Bestand weergeven

@@ -41,6 +41,7 @@ define(['jquery', "template", "Tools", "biddingApi", "itemsApi", "paging",'dateT
deptId:100, deptId:100,
projectNumber:'', projectNumber:'',
projectShowStatus:'', projectShowStatus:'',
pageSize: 20,
// signupStartTime:'', // signupStartTime:'',
// signupStopTime:'', // signupStopTime:'',
// biddingStartTime:'', // biddingStartTime:'',
@@ -158,6 +159,7 @@ define(['jquery', "template", "Tools", "biddingApi", "itemsApi", "paging",'dateT
console.log(data) console.log(data)
var content = data.rows; var content = data.rows;
var pageCount = (data.total/module.data.pageSize).toFixed(0); var pageCount = (data.total/module.data.pageSize).toFixed(0);
console.log(pageCount)
if (pageCount < 1){ if (pageCount < 1){
pageCount = 1; pageCount = 1;
} }
@@ -174,33 +176,6 @@ define(['jquery', "template", "Tools", "biddingApi", "itemsApi", "paging",'dateT
$('#page_s1').html('共'+pageCount+'页') $('#page_s1').html('共'+pageCount+'页')
} }
module.data.pageCount = pageCount; module.data.pageCount = pageCount;
for(var i = 0 ; i < content.length ; i++){
if(content[i].biddingStopTime == null || content[i].biddingStartTime == null){continue;}
var endTimes=content[i].biddingStopTime.substring(0,10).split('-');
var biddingStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+content[i].biddingStopTime.substring(10,19);

var startTimes=content[i].biddingStartTime.substring(0,10).split('-');
var biddingStartTime=startTimes[1]+'/'+startTimes[2]+'/'+startTimes[0]+' '+content[i].biddingStartTime.substring(10,19);

var nowTime = Date.parse(new Date());
var leftTime = Date.parse(biddingStopTime)-nowTime;
var rightTime = Date.parse(biddingStartTime)-nowTime;
console.log(biddingStopTime)
console.log(leftTime)

if(leftTime>0){
console.log('进行中')
content[i].timeType = '进行中'
}
if(leftTime<0){
console.log('已结束')
content[i].timeType = '已结束'
}
if(rightTime>0){
console.log('未开始')
content[i].timeType = '未开始'
}
}
module.data.biddingInformationList = content; module.data.biddingInformationList = content;
var biddingInformationData = template('biddingInformationData', module.data); var biddingInformationData = template('biddingInformationData', module.data);
$("#biddingInformationContent").html(biddingInformationData); $("#biddingInformationContent").html(biddingInformationData);
@@ -280,8 +255,9 @@ define(['jquery', "template", "Tools", "biddingApi", "itemsApi", "paging",'dateT
} }


turnThePage = function (pageNum) { turnThePage = function (pageNum) {
module.data.pageNum = pageNum ;
tools.doGet(biddingList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.biddingList,true);
module.data.pageNum = pageNum;
module.data.form.pageNum = pageNum ;
tools.doGet(biddingList, module.data.form, module.biddingList,true);
} }


typeCheck = function(id,projectNumber){ typeCheck = function(id,projectNumber){


+ 15
- 13
static/js/project/listingItems/items2.js Bestand weergeven

@@ -441,16 +441,17 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function
let signupStartTime = module.data.outProjectInformationDetail.signupStartTime; let signupStartTime = module.data.outProjectInformationDetail.signupStartTime;
let signupStopTime = module.data.outProjectInformationDetail.signupStopTime; let signupStopTime = module.data.outProjectInformationDetail.signupStopTime;
let biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime; let biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime;
let biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;
let biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;//延时后结束时间
let biddingStopSetime = module.data.outProjectInformationDetail.biddingStopSetime;//原始结束时间


var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"))); var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
console.log(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")))
var difference = Date.parse(biddingStopTime)-nowTime;
var difference = Date.parse(biddingStopTime)-nowTime;//延时后时间差
var differenceSetime = Date.parse(biddingStopSetime)-nowTime;//原始时间差
// var centerTime = module.data.timeConfig * 60 * 1000 // var centerTime = module.data.timeConfig * 60 * 1000
var centerTime = content.delayPeriod * 1000
var centerTime = content.delayPeriod * 1000//延时周期


if ( 0 <= difference&&difference <= centerTime){
// console.log("竞价最后两分钟")
if ( differenceSetime <= 0 && difference >= 0 && difference <= centerTime){
console.log("竞价最后两分钟")
//正在竞价 //正在竞价
var m,s; var m,s;
if(module.data.outProjectInformationDetail.biddingType == '自由竞价'){ if(module.data.outProjectInformationDetail.biddingType == '自由竞价'){
@@ -540,7 +541,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function
} }
} }
console.log(s+'-------------'+m) console.log(s+'-------------'+m)
if (s < 1 && m < 1){
if (s < 2 && m < 1){
console.log("竞价结束22222222222") console.log("竞价结束22222222222")
tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){ tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){
if (data.code == 200) { if (data.code == 200) {
@@ -554,6 +555,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function
}else{ }else{
$('#countType').html('') $('#countType').html('')
$('#countDown').html('竞价结束') $('#countDown').html('竞价结束')
$('#timeDown').css('display','none');
// document.getElementById('swiperType').style.display = 'none'; // document.getElementById('swiperType').style.display = 'none';
document.getElementById('biddingTable').style.display = 'table'; document.getElementById('biddingTable').style.display = 'table';
document.getElementById('biddingTitle').style.display = 'none'; document.getElementById('biddingTitle').style.display = 'none';
@@ -571,7 +573,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function
if (!signupStopTime){console.log('缺失报名结束时间');return;} if (!signupStopTime){console.log('缺失报名结束时间');return;}
if (!biddingStartTime){console.log('缺失竞价开始时间');return;} if (!biddingStartTime){console.log('缺失竞价开始时间');return;}
if (!biddingStopTime){console.log('缺失竞价结束时间');return;} if (!biddingStopTime){console.log('缺失竞价结束时间');return;}
module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime);
module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopSetime);
} }
if(module.data.outProjectInformationDetail.biddingType == '自由竞价' && module.data.biddingTimeType != 2){ if(module.data.outProjectInformationDetail.biddingType == '自由竞价' && module.data.biddingTimeType != 2){
document.getElementById('biddingTable').style.display = 'none'; document.getElementById('biddingTable').style.display = 'none';
@@ -597,7 +599,7 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function


module.getBiddingStopTime = function(data){ module.getBiddingStopTime = function(data){
if (data.code == 200) { if (data.code == 200) {
$('#stopTime').html(data.data)
// $('#stopTime').html(data.data)
module.data.outProjectInformationDetail.biddingStopTime = data.data module.data.outProjectInformationDetail.biddingStopTime = data.data
} }
} }
@@ -848,10 +850,10 @@ define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function
let timeNew = Date.parse(data.data) + 0 - nowDate; let timeNew = Date.parse(data.data) + 0 - nowDate;
if (timeNew > 0) { if (timeNew > 0) {
module.data.outProjectInformationDetail.biddingStopTime = data.data; module.data.outProjectInformationDetail.biddingStopTime = data.data;
module.dataCompare(
module.data.outProjectInformationDetail.signupStartTime,
module.data.outProjectInformationDetail.signupStopTime,
module.data.outProjectInformationDetail.biddingStartTime,data.data);
// module.dataCompare(
// module.data.outProjectInformationDetail.signupStartTime,
// module.data.outProjectInformationDetail.signupStopTime,
// module.data.outProjectInformationDetail.biddingStartTime,data.data);
}else{ }else{
$('#countType').html('') $('#countType').html('')
$('#countDown').html('竞价结束') $('#countDown').html('竞价结束')


+ 1
- 1
view/listingItems/itemsDetail.html Bestand weergeven

@@ -302,7 +302,7 @@
</tr> </tr>
<tr> <tr>
<td>竞价开始时间:{{outProjectInformationDetail.biddingStartTime}}</td> <td>竞价开始时间:{{outProjectInformationDetail.biddingStartTime}}</td>
<td>竞价结束时间{{if outProjectInformationDetail.delayPeriod!=0}}(含延期){{/if}}:<span id="stopTime">{{outProjectInformationDetail.biddingStopTime}}</span></td>
<td>竞价结束时间:{{outProjectInformationDetail.biddingStopSetime}}</td>
</tr> </tr>
<tr> <tr>
<td>竞价方式:{{outProjectInformationDetail.biddingType}}<i title="友情提示:规则详情请看下边的竞买须知!" class="wh">?</i></td> <td>竞价方式:{{outProjectInformationDetail.biddingType}}<i title="友情提示:规则详情请看下边的竞买须知!" class="wh">?</i></td>


Laden…
Annuleren
Opslaan