Commit 2851bfb7 authored by superman's avatar superman

update 8.1

parent f9af8a30
{ {
"plugins": ["transform-es2015-modules-umd"] "presets": [
"es2015",
"stage-0"
],
"plugins": [
"transform-es2015-literals",
"transform-es2015-destructuring",
"transform-es2015-duplicate-keys",
"transform-es2015-destructuring"
]
} }
\ No newline at end of file
...@@ -26,7 +26,7 @@ app.set('view engine', 'hbs'); ...@@ -26,7 +26,7 @@ app.set('view engine', 'hbs');
app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev')); app.use(logger('dev'));
app.use(bodyParser.json()); app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.urlencoded({extended: false}));
app.use(cookieParser()); app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public')));
...@@ -34,7 +34,7 @@ app.use('/', routes); ...@@ -34,7 +34,7 @@ app.use('/', routes);
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function (req, res, next) {
var err = new Error('Not Found'); var err = new Error('Not Found');
err.status = 404; err.status = 404;
next(err); next(err);
...@@ -45,18 +45,19 @@ app.use(function(req, res, next) { ...@@ -45,18 +45,19 @@ app.use(function(req, res, next) {
// development error handler // development error handler
// will print stacktrace // will print stacktrace
if (app.get('env') === 'development') { if (app.get('env') === 'development') {
app.use(function(err, req, res, next) { app.use(function (err, req, res, next) {
res.status(err.status || 500); res.status(err.status || 500);
res.render('error', { res.render('error', {
message: err.message, message: err.message,
error: err error: err,
layout: false
}); });
}); });
} }
// production error handler // production error handler
// no stacktraces leaked to user // no stacktraces leaked to user
app.use(function(err, req, res, next) { app.use(function (err, req, res, next) {
res.status(err.status || 500); res.status(err.status || 500);
res.render('error', { res.render('error', {
message: err.message, message: err.message,
......
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'start' ]
2 info using npm@3.8.3
3 info using node@v5.10.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle www.fudou6.com@0.0.0~prestart: www.fudou6.com@0.0.0
6 silly lifecycle www.fudou6.com@0.0.0~prestart: no script for prestart, continuing
7 info lifecycle www.fudou6.com@0.0.0~start: www.fudou6.com@0.0.0
8 verbose lifecycle www.fudou6.com@0.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle www.fudou6.com@0.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/superman/Works/www.fudou6.com/node_modules/.bin:/usr/local/bin:/Users/superman/.sdkman/candidates/groovy/current/bin:/Users/superman/.sdkman/candidates/gradle/current/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle www.fudou6.com@0.0.0~start: CWD: /Users/superman/Works/www.fudou6.com
11 silly lifecycle www.fudou6.com@0.0.0~start: Args: [ '-c', 'node --harmony ./bin/www' ]
12 silly lifecycle www.fudou6.com@0.0.0~start: Returned: code: 1 signal: null
13 info lifecycle www.fudou6.com@0.0.0~start: Failed to exec start script
14 verbose stack Error: www.fudou6.com@0.0.0 start: `node --harmony ./bin/www`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at EventEmitter.emit (events.js:185:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at ChildProcess.emit (events.js:185:7)
14 verbose stack at maybeClose (internal/child_process.js:850:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid www.fudou6.com@0.0.0
16 verbose cwd /Users/superman/Works/www.fudou6.com
17 error Darwin 15.6.0
18 error argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "run-script" "start"
19 error node v5.10.1
20 error npm v3.8.3
21 error code ELIFECYCLE
22 error www.fudou6.com@0.0.0 start: `node --harmony ./bin/www`
22 error Exit status 1
23 error Failed at the www.fudou6.com@0.0.0 start script 'node --harmony ./bin/www'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the www.fudou6.com package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node --harmony ./bin/www
23 error You can get information on how to open an issue for this project with:
23 error npm bugs www.fudou6.com
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls www.fudou6.com
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
...@@ -3,21 +3,28 @@ ...@@ -3,21 +3,28 @@
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "node ./bin/www" "start": "node --harmony ./bin/www"
}, },
"dependencies": { "dependencies": {
"babel-plugin-transform-es2015-sticky-regex": "^6.8.0", "babel-plugin-transform-es2015-sticky-regex": "^6.8.0",
"babel-preset-stage-0": "^6.5.0",
"body-parser": "~1.13.2", "body-parser": "~1.13.2",
"cookie-parser": "~1.3.5", "cookie-parser": "~1.3.5",
"debug": "~2.2.0", "debug": "~2.2.0",
"express": "~4.13.1", "express": "~4.13.1",
"express-handlebars": "*", "express-handlebars": "*",
"isomorphic-fetch": "^2.2.1",
"morgan": "~1.6.1", "morgan": "~1.6.1",
"serve-favicon": "~2.3.0" "serve-favicon": "~2.3.0"
}, },
"devDependencies": { "devDependencies": {
"babel-cli": "^6.11.4", "babel-cli": "^6.11.4",
"babel-plugin-transform-es2015-destructuring": "^6.9.0",
"babel-plugin-transform-es2015-duplicate-keys": "^6.8.0",
"babel-plugin-transform-es2015-literals": "^6.8.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.11.5",
"babel-plugin-transform-es2015-sticky-regex": "^6.8.0", "babel-plugin-transform-es2015-sticky-regex": "^6.8.0",
"babel-polyfill": "^6.9.1",
"babel-preset-es2015": "^6.9.0" "babel-preset-es2015": "^6.9.0"
} }
} }
\ No newline at end of file
...@@ -12,10 +12,8 @@ ...@@ -12,10 +12,8 @@
var balance = $('.balance').html(); var balance = $('.balance').html();
var total = $('.total').html(); var total = $('.total').html();
var progressBar = $('.progress-bar'); var progress = $('.progress-bar i');
var progress = progressBar.width(); progress.width(progress.data('width'));
$('i', progressBar).width(balance / total * progress);
/** /**
* 验证用户姓名 * 验证用户姓名
* @param obj * @param obj
...@@ -70,12 +68,15 @@ ...@@ -70,12 +68,15 @@
$userTel.focus(); $userTel.focus();
return; return;
} }
$modalBox.show(500);
request()
$modalBox.fadeIn(300);
}); });
$('#modalBoxHidden').click(function (e) { $('#modalBoxHidden').click(function (e) {
e.preventDefault(); e.preventDefault();
$modalBox.hide(500); $modalBox.fadeOut(300);
}); });
......
(function(){var $form=$("#form");var $userName=$('input[name="userName"]',$form);var $userTel=$('input[name="userTel"]',$form);var $errorName=$(".appointment .errorName");var $errorTel=$(".appointment .errorTel");var $modalBox=$(".modal-box");var balance=$(".balance").html();var total=$(".total").html();var progress=$(".progress-bar i");progress.width(progress.data("width"));function valiUserName(userName){$errorName.html(userName?"":"请输入您的姓名!");return!userName}function filterNotNumber(mobile){if(/[^\d]/g.test(mobile)){$userTel.val(mobile.replace(/[^\d]/g,""));return false}return true}function valiMobile(mobile){if(/^[\d]{11}$/g.test(mobile)){$errorTel.html("");return false}$errorTel.html("手机号有误,请重新输入!");return true}$userName.on("keyup",function(){valiUserName($.trim($userName.val()+""))});$userTel.on("keyup",function(){var mobile=$userTel.val();filterNotNumber(mobile);valiMobile(mobile)});$form.on("submit",function(e){e.preventDefault();if(valiUserName($.trim($userName.val()+""))){$userName.focus();return}if(valiMobile($.trim($userTel.val()+""))){$userTel.focus();return}request();$modalBox.fadeIn(300)});$("#modalBoxHidden").click(function(e){e.preventDefault();$modalBox.fadeOut(300)})})();
\ No newline at end of file
import $ from 'jquery'; 'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
$.ajax('/api/1.0/prod/hList.json', { // import "babel-polyfill";
dataType: 'json',
data: {
cateId: 2001000,
s: 10,
p: 0
}
}).done(data=> {
console.log(data);
}).fail((xhr, status, text) => {
console.log(arguments);
}).always(()=> {
});
export default ()=>{ function fetch(query, panel) {
var data = _extends({}, query, { p: (parseInt(query.p, 10) || 1) - 1 });
request('/api/1.0/prod/hList.json', data).then(function (_ref) {
var hasNext = _ref.hasNext;
var items = _ref.items;
if (items && items.length) {
var html = items.map(function (item) {
return '<li data-id="' + item.id + '" class="product-item status-' + item.status + '">\n <i class="seal">' + (item.status == 11 && item.fundRaisedTarget - item.fundRaisedOver > 0 ? '<span>' + formatMoney(item.fundRaisedTarget - item.fundRaisedOver) + '</span>' : '') + '</i>\n <div class="clear">\n <div>\n <h2>' + item.itemShortTitle + '</h2>\n <h3>' + formatMoney(item.fundRaisedTarget) + '</h3>\n <div class="clear">\n <span>\n <p>' + item.commissionMaxDur + '</p>\n </span>\n <span>\n <p>' + formatMoney(item.minimumAmount) + '</p>\n </span>\n <span>\n <p>' + item.duration + '</p>\n </span>\n </div>\n </div>\n <div>\n <div>\n <h4>项目亮点</h4>\n <p>' + item.summary + '</p>\n </div>\n </div>\n </div>\n <i class="corner"></i>\n </li>';
}).join('');
$('.products', panel).html(html);
var pagination = [];
if (hasNext) {
pagination.push('<a data-cate-id="' + data.cateId + '" data-p="' + (data.p + 2) + '" data-s="' + data.s + '" href="javascript:void(\'下一页\');">下一页</a>');
}
if (data.p >= 1) {
pagination.unshift('<a data-cate-id="' + data.cateId + '" data-p="' + data.p + '" data-s="' + data.s + '" href="javascript:void(\'上一页\');">上一页</a>');
}
$('.pagination', panel).html(pagination.join(''));
history.replaceState && history.replaceState(null, null, location.pathname + '?' + serialize(query));
}
}).catch(function (err) {
console.log(err);
});
} }
function fetchCates(query) {
request('/api/1.0/cate/cates.json').then(function (_ref2) {
var pCates = _ref2.pCates;
var cates = [];
pCates.unshift({
name: '全部',
id: 'all'
});
pCates.forEach(function (cate) {
!cate.selfPick && cates.push(cate.name);
});
var tabs = new Tabs({
container: '.tabs',
headers: cates,
initializePanel: function initializePanel(index, header, panel) {
var cate = pCates[index];
var fetchQuery = cate.id == query.cateId ? query : { cateId: cate.id, p: 1, s: query.s || 10 };
panel.html('<ul class="products"><li class="loading">正在努力加载中...</li></ul><ul class="pagination"></ul>');
fetch(fetchQuery, panel);
}
});
tabs.initialize();
tabs.element.on('click', '.pagination a', function (e) {
e.preventDefault();
var data = $(this).data();
fetch(data, tabs.findPanel(tabs.activeIndex));
$(this).text('加载中...');
}).on('click', '.product-item', function (e) {
e.preventDefault();
var id = $(this).data('id');
location.href = location.pathname + '/' + id;
});
});
}
fetchCates(deserialize());
//# sourceMappingURL=products.js.map
\ No newline at end of file
{"version":3,"sources":["products.jsx"],"names":[],"mappings":";;;;AAAA;;AAEA,SAAS,KAAT,CAAe,KAAf,EAAsB,KAAtB,EAA6B;AACzB,QAAM,oBAAW,KAAX,IAAkB,GAAG,CAAC,SAAS,MAAM,CAAf,EAAkB,EAAlB,KAAyB,CAA1B,IAA+B,CAApD,GAAN;;AAEA,YAAQ,0BAAR,EAAoC,IAApC,EAA0C,IAA1C,CAA+C,gBAAqB;AAAA,YAAnB,OAAmB,QAAnB,OAAmB;AAAA,YAAV,KAAU,QAAV,KAAU;;AAChE,YAAI,SAAS,MAAM,MAAnB,EAA2B;AACvB,gBAAI,OAAO,MAAM,GAAN,CAAU,gBAAO;AACxB,yCAAuB,KAAK,EAA5B,qCAA8D,KAAK,MAAnE,6CAEK,KAAK,MAAL,IAAe,EAAf,IAAsB,KAAK,gBAAL,GAAwB,KAAK,cAA7B,GAA8C,CAArE,GACA,WAAW,YAAY,KAAK,gBAAL,GA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SAFD;AAGA,YAAM,OAAO,IAAI,IAAJ,CAAS;AAClB,uBAAW,OADO;AAElB,qBAAS,KAFS;AAGlB,6BAAiB,yBAAU,KAAV,EAAiB,MAAjB,EAAyB,KAAzB,EAAgC;AAC7C,oBAAI,OAAO,OAAO,KAAP,CAAX;AACA,oBAAI,aAAa,KAAK,EAAL,IAAW,MAAM,MAAjB,GAA0B,KAA1B,GAAkC,EAAC,QAAQ,KAAK,EAAd,EAAkB,GAAG,CAArB,EAAwB,GAAG,MAAM,CAAN,IAAW,EAAtC,EAAnD;AACA,sBAAM,IAAN,CAAW,2FAAX;AACA,sBAAM,UAAN,EAAkB,KAAlB;AACH;AARiB,SAAT,CAAb;AAUA,aAAK,UAAL;AACA,aAAK,OAAL,CAAa,EAAb,CAAgB,OAAhB,EAAyB,eAAzB,EAA0C,UAAU,CAAV,EAAa;AACnD,cAAE,cAAF;AACA,gBAAM,OAAO,EAAE,IAAF,EAAQ,IAAR,EAAb;AACA,kBAAM,IAAN,EAAY,KAAK,SAAL,CAAe,KAAK,WAApB,CAAZ;AACA,cAAE,IAAF,EAAQ,IAAR,CAAa,QAAb;AACH,SALD,EAKG,EALH,CAKM,OALN,EAKe,eALf,EAKgC,UAAU,CAAV,EAAa;AACzC,cAAE,cAAF;AACA,gBAAM,KAAK,EAAE,IAAF,EAAQ,IAAR,CAAa,IAAb,CAAX;AACA,qBAAS,IAAT,GAAgB,SAAS,QAAT,GAAoB,GAApB,GAA0B,EAA1C;AACH,SATD;AAUH,KA9BD;AA+BH;;AAED,WAAW,aAAX","file":"products.js","sourcesContent":["// import \"babel-polyfill\";\n\nfunction fetch(query, panel) {\n const data = {...query, p: (parseInt(query.p, 10) || 1) - 1};\n\n request('/api/1.0/prod/hList.json', data).then(({hasNext, items})=> {\n if (items && items.length) {\n let html = items.map(item=> {\n return `<li data-id=\"${item.id}\" class=\"product-item status-${item.status}\">\n <i class=\"seal\">${\n (item.status == 11 && (item.fundRaisedTarget - item.fundRaisedOver > 0)) ?\n '<span>' + formatMoney(item.fundRaisedTarget - item.fundRaisedOver) + '</span>' : ''\n }</i>\n <div class=\"clear\">\n <div>\n <h2>${item.itemShortTitle}</h2>\n <h3>${formatMoney(item.fundRaisedTarget)}</h3>\n <div class=\"clear\">\n <span>\n <p>${item.commissionMaxDur}</p>\n </span>\n <span>\n <p>${formatMoney(item.minimumAmount)}</p>\n </span>\n <span>\n <p>${item.duration}</p>\n </span>\n </div>\n </div>\n <div>\n <div>\n <h4>项目亮点</h4>\n <p>${item.summary}</p>\n </div>\n </div>\n </div>\n <i class=\"corner\"></i>\n </li>`;\n }).join('');\n $('.products', panel).html(html);\n const pagination = [];\n if (hasNext) {\n pagination.push(`<a data-cate-id=\"${data.cateId}\" data-p=\"${data.p + 2}\" data-s=\"${data.s}\" href=\"javascript:void('下一页');\">下一页</a>`);\n }\n\n if (data.p >= 1) {\n pagination.unshift(`<a data-cate-id=\"${data.cateId}\" data-p=\"${data.p}\" data-s=\"${data.s}\" href=\"javascript:void('上一页');\">上一页</a>`);\n }\n $('.pagination', panel).html(pagination.join(''));\n history.replaceState && history.replaceState(null, null, location.pathname + '?' + serialize(query));\n }\n }).catch(err=> {\n console.log(err);\n });\n}\n\nfunction fetchCates(query) {\n request('/api/1.0/cate/cates.json').then(({pCates})=> {\n const cates = [];\n pCates.unshift({\n name: '全部',\n id: 'all'\n });\n pCates.forEach(cate=> {\n !cate.selfPick && cates.push(cate.name);\n });\n const tabs = new Tabs({\n container: '.tabs',\n headers: cates,\n initializePanel: function (index, header, panel) {\n let cate = pCates[index];\n let fetchQuery = cate.id == query.cateId ? query : {cateId: cate.id, p: 1, s: query.s || 10};\n panel.html('<ul class=\"products\"><li class=\"loading\">正在努力加载中...</li></ul><ul class=\"pagination\"></ul>');\n fetch(fetchQuery, panel);\n }\n });\n tabs.initialize();\n tabs.element.on('click', '.pagination a', function (e) {\n e.preventDefault();\n const data = $(this).data();\n fetch(data, tabs.findPanel(tabs.activeIndex));\n $(this).text('加载中...')\n }).on('click', '.product-item', function (e) {\n e.preventDefault();\n const id = $(this).data('id');\n location.href = location.pathname + '/' + id;\n })\n });\n}\n\nfetchCates(deserialize());\n\n\n\n\n\n\n\n\n\n\n\n\n\n"]}
\ No newline at end of file
// import "babel-polyfill";
function fetch(query, panel) {
const data = {...query, p: (parseInt(query.p, 10) || 1) - 1};
request('/api/1.0/prod/hList.json', data).then(({hasNext, items})=> {
if (items && items.length) {
let html = items.map(item=> {
return `<li data-id="${item.id}" class="product-item status-${item.status}">
<i class="seal">${
(item.status == 11 && (item.fundRaisedTarget - item.fundRaisedOver > 0)) ?
'<span>' + formatMoney(item.fundRaisedTarget - item.fundRaisedOver) + '</span>' : ''
}</i>
<div class="clear">
<div>
<h2>${item.itemShortTitle}</h2>
<h3>${formatMoney(item.fundRaisedTarget)}</h3>
<div class="clear">
<span>
<p>${item.commissionMaxDur}</p>
</span>
<span>
<p>${formatMoney(item.minimumAmount)}</p>
</span>
<span>
<p>${item.duration}</p>
</span>
</div>
</div>
<div>
<div>
<h4>项目亮点</h4>
<p>${item.summary}</p>
</div>
</div>
</div>
<i class="corner"></i>
</li>`;
}).join('');
$('.products', panel).html(html);
const pagination = [];
if (hasNext) {
pagination.push(`<a data-cate-id="${data.cateId}" data-p="${data.p + 2}" data-s="${data.s}" href="javascript:void('下一页');">下一页</a>`);
}
if (data.p >= 1) {
pagination.unshift(`<a data-cate-id="${data.cateId}" data-p="${data.p}" data-s="${data.s}" href="javascript:void('上一页');">上一页</a>`);
}
$('.pagination', panel).html(pagination.join(''));
history.replaceState && history.replaceState(null, null, location.pathname + '?' + serialize(query));
}
}).catch(err=> {
console.log(err);
});
}
function fetchCates(query) {
request('/api/1.0/cate/cates.json').then(({pCates})=> {
const cates = [];
pCates.unshift({
name: '全部',
id: 'all'
});
pCates.forEach(cate=> {
!cate.selfPick && cates.push(cate.name);
});
const tabs = new Tabs({
container: '.tabs',
headers: cates,
initializePanel: function (index, header, panel) {
let cate = pCates[index];
let fetchQuery = cate.id == query.cateId ? query : {cateId: cate.id, p: 1, s: query.s || 10};
panel.html('<ul class="products"><li class="loading">正在努力加载中...</li></ul><ul class="pagination"></ul>');
fetch(fetchQuery, panel);
}
});
tabs.initialize();
tabs.element.on('click', '.pagination a', function (e) {
e.preventDefault();
const data = $(this).data();
fetch(data, tabs.findPanel(tabs.activeIndex));
$(this).text('加载中...')
}).on('click', '.product-item', function (e) {
e.preventDefault();
const id = $(this).data('id');
location.href = location.pathname + '/' + id;
})
});
}
fetchCates(deserialize());
"use strict";var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};function fetch(query,panel){var data=_extends({},query,{p:(parseInt(query.p,10)||1)-1});request("/api/1.0/prod/hList.json",data).then(function(_ref){var hasNext=_ref.hasNext;var items=_ref.items;if(items&&items.length){var html=items.map(function(item){return'<li data-id="'+item.id+'" class="product-item status-'+item.status+'">\n <i class="seal">'+(item.status==11&&item.fundRaisedTarget-item.fundRaisedOver>0?"<span>"+formatMoney(item.fundRaisedTarget-item.fundRaisedOver)+"</span>":"")+'</i>\n <div class="clear">\n <div>\n <h2>'+item.itemShortTitle+"</h2>\n <h3>"+formatMoney(item.fundRaisedTarget)+'</h3>\n <div class="clear">\n <span>\n <p>'+item.commissionMaxDur+"</p>\n </span>\n <span>\n <p>"+formatMoney(item.minimumAmount)+"</p>\n </span>\n <span>\n <p>"+item.duration+"</p>\n </span>\n </div>\n </div>\n <div>\n <div>\n <h4>项目亮点</h4>\n <p>"+item.summary+'</p>\n </div>\n </div>\n </div>\n <i class="corner"></i>\n </li>'}).join("");$(".products",panel).html(html);var pagination=[];if(hasNext){pagination.push('<a data-cate-id="'+data.cateId+'" data-p="'+(data.p+2)+'" data-s="'+data.s+'" href="javascript:void(\'下一页\');">下一页</a>')}if(data.p>=1){pagination.unshift('<a data-cate-id="'+data.cateId+'" data-p="'+data.p+'" data-s="'+data.s+'" href="javascript:void(\'上一页\');">上一页</a>')}$(".pagination",panel).html(pagination.join(""));history.replaceState&&history.replaceState(null,null,location.pathname+"?"+serialize(query))}}).catch(function(err){console.log(err)})}function fetchCates(query){request("/api/1.0/cate/cates.json").then(function(_ref2){var pCates=_ref2.pCates;var cates=[];pCates.unshift({name:"全部",id:"all"});pCates.forEach(function(cate){!cate.selfPick&&cates.push(cate.name)});var tabs=new Tabs({container:".tabs",headers:cates,initializePanel:function initializePanel(index,header,panel){var cate=pCates[index];var fetchQuery=cate.id==query.cateId?query:{cateId:cate.id,p:1,s:query.s||10};panel.html('<ul class="products"><li class="loading">正在努力加载中...</li></ul><ul class="pagination"></ul>');fetch(fetchQuery,panel)}});tabs.initialize();tabs.element.on("click",".pagination a",function(e){e.preventDefault();var data=$(this).data();fetch(data,tabs.findPanel(tabs.activeIndex));$(this).text("加载中...")}).on("click",".product-item",function(e){e.preventDefault();var id=$(this).data("id");location.href=location.pathname+"/"+id})})}fetchCates(deserialize());
\ No newline at end of file
...@@ -82,11 +82,11 @@ ...@@ -82,11 +82,11 @@
*/ */
$('.hot-project-address a').click(function (e) { $('.hot-project-address a').click(function (e) {
e.preventDefault(); e.preventDefault();
$modalBox.show(500); $modalBox.fadeIn(300);
}); });
$('#modalBoxHidden').click(function (e) { $('#modalBoxHidden').click(function (e) {
e.preventDefault(); e.preventDefault();
$modalBox.hide(500); $modalBox.fadeOut(300);
}); });
......
(function(){var $submit=$("#submit");var $errorPhone=$(".error-phone");var $errorDescription=$(".error-description");var $introducerMobile=$("#introducerMobile");var $projectDescription=$("#projectDescription");var $modalBox=$(".modal-box");var $introducer=$("#introducer");function valiTel(tel){var msg=/^[\d]/g.test(tel)?"":"电话号码有误,请再次输入!";/^[\d]/g.test(tel[tel.length-1])?$introducerMobile.val(tel):$introducerMobile.val(tel.slice(0,tel.length-1));console.log(tel[tel.length-1]);console.log(/^[\d]/g.test(tel[tel.length-1]));!msg&&$errorPhone.html(msg);$errorPhone.data("vali",!msg);disableSubmit();return!msg}function valiDescription(text){$errorDescription.html(text?"":"项目描述不能为空!");$errorDescription.data("vali",text);disableSubmit();return!text}function disableSubmit(){$errorPhone.data("vali")&&$errorDescription.data("vali")&&$submit.attr("disabled",false).css("background","#ff4a4b")}$introducerMobile.on({keyup:function(e){valiTel(($introducerMobile.val()+"").trim())}});$projectDescription.on({keyup:function(e){valiDescription(($projectDescription.val()+"").trim())}});$(".hot-project-address a").click(function(e){e.preventDefault();$modalBox.fadeIn(300)});$("#modalBoxHidden").click(function(e){e.preventDefault();$modalBox.fadeOut(300)})})();
\ No newline at end of file
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function request(url, data) {
var method = arguments.length <= 2 || arguments[2] === undefined ? 'GET' : arguments[2];
return new Promise(function (resolve, reject) {
$.ajax(url, {
type: method,
dataType: 'json',
data: data,
success: function success(res) {
if (res && res.status == 1) {
resolve(res.result);
} else {
reject({
code: res && res.code || 0,
message: res && res.msg || res.message || '系统错误,请稍后再试!'
});
}
},
error: function error(xhr, status, text) {
console.log(xhr, status, text);
reject({
code: xhr && xhr.status || status,
message: text
});
}
});
});
}
function formatMoney() {
var money = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
var ret = void 0;
if (isNaN(money)) {
ret = '0';
} else if (money >= 1E10) {
ret = money / 1E10 + '亿';
} else if (money >= 1E6) {
ret = money / 1E6 + '万';
} else {
ret = money / 1E2;
}
return ret;
}
function deserialize() {
var str = arguments.length <= 0 || arguments[0] === undefined ? location.search : arguments[0];
var query = {};
(str + '').replace(/^\?/g, '').split('&').forEach(function (item) {
var tmp = (item + '').split('=');
if (tmp.length) {
query[decodeURIComponent(tmp[0])] = decodeURIComponent(tmp[1]);
}
});
return query;
}
function serialize(obj, prefix) {
var str = [];
Object.keys(obj).map(function (p) {
var v = obj[p];
if (p && typeof v !== 'undefined') {
var k = prefix ? prefix + "." + p : p;
if ((typeof v === 'undefined' ? 'undefined' : _typeof(v)) == 'object') {
v = serialize(v, k);
if (v) {
str.push(v);
}
} else {
str.push(encodeURIComponent(k) + "=" + encodeURIComponent(v));
}
}
});
return str.length ? str.join("&") : '';
}
var Tabs = function () {
function Tabs(options) {
_classCallCheck(this, Tabs);
this.options = _extends({ activeClass: 'active' }, options);
}
_createClass(Tabs, [{
key: 'initialize',
value: function initialize() {
this.container = $(this.options.container || 'body').empty();
this.render();
return this;
}
}, {
key: 'findHeader',
value: function findHeader(index) {
return this.element.find('.tabs-headers-item:eq(' + index + ')');
}
}, {
key: 'findPanel',
value: function findPanel(index) {
return this.element.find('.tabs-panels-item:eq(' + index + ')');
}
}, {
key: 'selectIndex',
value: function selectIndex(index) {
var header = this.findHeader(this.activeIndex);
var panel = this.findPanel(this.activeIndex);
if (typeof index === 'number' && index !== this.activeIndex) {
var _options = this.options;
var activeClass = _options.activeClass;
var initializePanel = _options.initializePanel;
header.removeClass(activeClass);
panel.removeClass(activeClass);
this.activeIndex = index;
header = this.findHeader(index).addClass(activeClass);
panel = this.findPanel(index).addClass(activeClass);
if (!panel.attr('initialized')) {
if (typeof initializePanel === 'function') {
initializePanel.call(this, index, header, panel);
}
panel.attr('initialized', true);
}
}
return {
header: header,
panel: panel
};
}
}, {
key: 'render',
value: function render() {
var headers = [];
var panels = [];
var self = this;
this.options.headers.forEach(function (item, index) {
headers.push('<a class="tabs-headers-item" data-index="' + index + '" href="javascript:void(\'' + item + '\')">' + item + '</a>');
panels.push('<div class="tabs-panels-item" data-index="' + index + '"></div>');
});
var html = '<div class="tabs">\n <header class="tabs-header">\n <div class="clear">\n ' + headers.join('') + '\n </div>\n </header>\n <section>\n ' + panels.join('') + '\n </section>\n </div>';
this.element = $(html).appendTo(this.container);
this.selectIndex(this.options.defaultIndex || 0);
this.element.on('click', '.tabs-headers-item', function (e) {
e.preventDefault();
var tabHeader = $(this);
var index = tabHeader.data('index');
if (index != self.activeIndex) {
self.selectIndex(index);
}
});
return this;
}
}]);
return Tabs;
}();
//# sourceMappingURL=utils.js.map
\ No newline at end of file
{"version":3,"sources":["utils.jsx"],"names":[],"mappings":";;;;;;;;;;AAAC,SAAS,OAAT,CAAiB,GAAjB,EAAsB,IAAtB,EAA4C;AAAA,QAAhB,MAAgB,yDAAP,KAAO;;AACzC,WAAO,IAAI,OAAJ,CAAY,UAAC,OAAD,EAAU,MAAV,EAAoB;AACnC,UAAE,IAAF,CAAO,GAAP,EAAY;AACR,kBAAM,MADE;AAER,sBAAU,MAFF;AAGR,sBAHQ;AAIR,qBAAS,sBAAM;AACX,oBAAI,OAAO,IAAI,MAAJ,IAAc,CAAzB,EAA4B;AACxB,4BAAQ,IAAI,MAAZ;AACH,iBAFD,MAEO;AACH,2BAAO;AACH,8BAAM,OAAO,IAAI,IAAX,IAAmB,CADtB;AAEH,iCAAS,OAAO,IAAI,GAAX,IAAkB,IAAI,OAAtB,IAAiC;AAFvC,qBAAP;AAIH;AACJ,aAbO;AAcR,mBAAO,eAAC,GAAD,EAAM,MAAN,EAAc,IAAd,EAAsB;AACzB,wBAAQ,GAAR,CAAY,GAAZ,EAAiB,MAAjB,EAAyB,IAAzB;AACA,uBAAO;AACH,0BAAM,OAAO,IAAI,MAAX,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n return new Promise((resolve, reject)=> {\n $.ajax(url, {\n type: method,\n dataType: 'json',\n data,\n success: res=> {\n if (res && res.status == 1) {\n resolve(res.result);\n } else {\n reject({\n code: res && res.code || 0,\n message: res && res.msg || res.message || '系统错误,请稍后再试!'\n });\n }\n },\n error: (xhr, status, text)=> {\n console.log(xhr, status, text);\n reject({\n code: xhr && xhr.status || status,\n message: text\n });\n }\n });\n });\n}\n\n function formatMoney(money = 0) {\n let ret;\n if (isNaN(money)) {\n ret = '0';\n } else if (money >= 1E10) {\n ret = (money / 1E10) + '亿';\n } else if (money >= 1E6) {\n ret = (money / 1E6) + '万';\n } else {\n ret = (money / 1E2);\n }\n return ret;\n}\n\n function deserialize(str = location.search) {\n const query = {};\n (str + '').replace(/^\\?/g, '').split('&').forEach(item=> {\n let tmp = (item + '').split('=');\n if (tmp.length) {\n query[decodeURIComponent(tmp[0])] = decodeURIComponent(tmp[1]);\n }\n });\n return query;\n}\n\n function serialize(obj, prefix) {\n var str = [];\n Object.keys(obj).map(p=> {\n let v = obj[p];\n if (p && typeof v !== 'undefined') {\n let k = prefix ? prefix + \".\" + p : p;\n if (typeof v == 'object') {\n v = serialize(v, k);\n if (v) {\n str.push(v);\n }\n } else {\n str.push(encodeURIComponent(k) + \"=\" + encodeURIComponent(v));\n }\n }\n });\n return str.length ? str.join(\"&\") : '';\n}\n\n class Tabs {\n constructor(options) {\n this.options = {activeClass: 'active', ...options};\n }\n\n initialize() {\n this.container = $(this.options.container || 'body').empty();\n this.render();\n return this;\n }\n\n findHeader(index) {\n return this.element.find('.tabs-headers-item:eq(' + index + ')');\n }\n\n findPanel(index) {\n return this.element.find('.tabs-panels-item:eq(' + index + ')');\n }\n\n selectIndex(index) {\n\n let header = this.findHeader(this.activeIndex);\n let panel = this.findPanel(this.activeIndex);\n\n if (typeof index === 'number' && index !== this.activeIndex) {\n const {activeClass, initializePanel} = this.options;\n header.removeClass(activeClass);\n panel.removeClass(activeClass);\n this.activeIndex = index;\n header = this.findHeader(index).addClass(activeClass);\n panel = this.findPanel(index).addClass(activeClass);\n if (!panel.attr('initialized')) {\n if (typeof initializePanel === 'function') {\n initializePanel.call(this, index, header, panel);\n }\n panel.attr('initialized', true);\n }\n }\n return {\n header,\n panel\n };\n }\n\n render() {\n const headers = [];\n const panels = [];\n const self = this;\n this.options.headers.forEach((item, index)=> {\n headers.push(`<a class=\"tabs-headers-item\" data-index=\"${index}\" href=\"javascript:void('${item}')\">${item}</a>`);\n panels.push(`<div class=\"tabs-panels-item\" data-index=\"${index}\"></div>`);\n });\n const html = `<div class=\"tabs\">\n <header class=\"tabs-header\">\n <div class=\"clear\">\n ${headers.join('')}\n </div>\n </header>\n <section>\n ${panels.join('')}\n </section>\n </div>`;\n this.element = $(html).appendTo(this.container);\n\n this.selectIndex(this.options.defaultIndex || 0);\n\n this.element.on('click', '.tabs-headers-item', function (e) {\n e.preventDefault();\n const tabHeader = $(this);\n const index = tabHeader.data('index');\n if (index != self.activeIndex) {\n self.selectIndex(index);\n }\n });\n return this;\n }\n\n\n}"]}
\ No newline at end of file
function request(url, data, method = 'GET') {
return new Promise((resolve, reject)=> {
$.ajax(url, {
type: method,
dataType: 'json',
data,
success: res=> {
if (res && res.status == 1) {
resolve(res.result);
} else {
reject({
code: res && res.code || 0,
message: res && res.msg || res.message || '系统错误,请稍后再试!'
});
}
},
error: (xhr, status, text)=> {
console.log(xhr, status, text);
reject({
code: xhr && xhr.status || status,
message: text
});
}
});
});
}
function formatMoney(money = 0) {
let ret;
if (isNaN(money)) {
ret = '0';
} else if (money >= 1E10) {
ret = (money / 1E10) + '亿';
} else if (money >= 1E6) {
ret = (money / 1E6) + '万';
} else {
ret = (money / 1E2);
}
return ret;
}
function deserialize(str = location.search) {
const query = {};
(str + '').replace(/^\?/g, '').split('&').forEach(item=> {
let tmp = (item + '').split('=');
if (tmp.length) {
query[decodeURIComponent(tmp[0])] = decodeURIComponent(tmp[1]);
}
});
return query;
}
function serialize(obj, prefix) {
var str = [];
Object.keys(obj).map(p=> {
let v = obj[p];
if (p && typeof v !== 'undefined') {
let k = prefix ? prefix + "." + p : p;
if (typeof v == 'object') {
v = serialize(v, k);
if (v) {
str.push(v);
}
} else {
str.push(encodeURIComponent(k) + "=" + encodeURIComponent(v));
}
}
});
return str.length ? str.join("&") : '';
}
class Tabs {
constructor(options) {
this.options = {activeClass: 'active', ...options};
}
initialize() {
this.container = $(this.options.container || 'body').empty();
this.render();
return this;
}
findHeader(index) {
return this.element.find('.tabs-headers-item:eq(' + index + ')');
}
findPanel(index) {
return this.element.find('.tabs-panels-item:eq(' + index + ')');
}
selectIndex(index) {
let header = this.findHeader(this.activeIndex);
let panel = this.findPanel(this.activeIndex);
if (typeof index === 'number' && index !== this.activeIndex) {
const {activeClass, initializePanel} = this.options;
header.removeClass(activeClass);
panel.removeClass(activeClass);
this.activeIndex = index;
header = this.findHeader(index).addClass(activeClass);
panel = this.findPanel(index).addClass(activeClass);
if (!panel.attr('initialized')) {
if (typeof initializePanel === 'function') {
initializePanel.call(this, index, header, panel);
}
panel.attr('initialized', true);
}
}
return {
header,
panel
};
}
render() {
const headers = [];
const panels = [];
const self = this;
this.options.headers.forEach((item, index)=> {
headers.push(`<a class="tabs-headers-item" data-index="${index}" href="javascript:void('${item}')">${item}</a>`);
panels.push(`<div class="tabs-panels-item" data-index="${index}"></div>`);
});
const html = `<div class="tabs">
<header class="tabs-header">
<div class="clear">
${headers.join('')}
</div>
</header>
<section>
${panels.join('')}
</section>
</div>`;
this.element = $(html).appendTo(this.container);
this.selectIndex(this.options.defaultIndex || 0);
this.element.on('click', '.tabs-headers-item', function (e) {
e.preventDefault();
const tabHeader = $(this);
const index = tabHeader.data('index');
if (index != self.activeIndex) {
self.selectIndex(index);
}
});
return this;
}
}
\ No newline at end of file
"use strict";var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor}}();var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function request(url,data){var method=arguments.length<=2||arguments[2]===undefined?"GET":arguments[2];return new Promise(function(resolve,reject){$.ajax(url,{type:method,dataType:"json",data:data,success:function success(res){if(res&&res.status==1){resolve(res.result)}else{reject({code:res&&res.code||0,message:res&&res.msg||res.message||"系统错误,请稍后再试!"})}},error:function error(xhr,status,text){console.log(xhr,status,text);reject({code:xhr&&xhr.status||status,message:text})}})})}function formatMoney(){var money=arguments.length<=0||arguments[0]===undefined?0:arguments[0];var ret=void 0;if(isNaN(money)){ret="0"}else if(money>=1e10){ret=money/1e10+"亿"}else if(money>=1e6){ret=money/1e6+"万"}else{ret=money/100}return ret}function deserialize(){var str=arguments.length<=0||arguments[0]===undefined?location.search:arguments[0];var query={};(str+"").replace(/^\?/g,"").split("&").forEach(function(item){var tmp=(item+"").split("=");if(tmp.length){query[decodeURIComponent(tmp[0])]=decodeURIComponent(tmp[1])}});return query}function serialize(obj,prefix){var str=[];Object.keys(obj).map(function(p){var v=obj[p];if(p&&typeof v!=="undefined"){var k=prefix?prefix+"."+p:p;if((typeof v==="undefined"?"undefined":_typeof(v))=="object"){v=serialize(v,k);if(v){str.push(v)}}else{str.push(encodeURIComponent(k)+"="+encodeURIComponent(v))}}});return str.length?str.join("&"):""}var Tabs=function(){function Tabs(options){_classCallCheck(this,Tabs);this.options=_extends({activeClass:"active"},options)}_createClass(Tabs,[{key:"initialize",value:function initialize(){this.container=$(this.options.container||"body").empty();this.render();return this}},{key:"findHeader",value:function findHeader(index){return this.element.find(".tabs-headers-item:eq("+index+")")}},{key:"findPanel",value:function findPanel(index){return this.element.find(".tabs-panels-item:eq("+index+")")}},{key:"selectIndex",value:function selectIndex(index){var header=this.findHeader(this.activeIndex);var panel=this.findPanel(this.activeIndex);if(typeof index==="number"&&index!==this.activeIndex){var _options=this.options;var activeClass=_options.activeClass;var initializePanel=_options.initializePanel;header.removeClass(activeClass);panel.removeClass(activeClass);this.activeIndex=index;header=this.findHeader(index).addClass(activeClass);panel=this.findPanel(index).addClass(activeClass);if(!panel.attr("initialized")){if(typeof initializePanel==="function"){initializePanel.call(this,index,header,panel)}panel.attr("initialized",true)}}return{header:header,panel:panel}}},{key:"render",value:function render(){var headers=[];var panels=[];var self=this;this.options.headers.forEach(function(item,index){headers.push('<a class="tabs-headers-item" data-index="'+index+'" href="javascript:void(\''+item+"')\">"+item+"</a>");panels.push('<div class="tabs-panels-item" data-index="'+index+'"></div>')});var html='<div class="tabs">\n <header class="tabs-header">\n <div class="clear">\n '+headers.join("")+"\n </div>\n </header>\n <section>\n "+panels.join("")+"\n </section>\n </div>";this.element=$(html).appendTo(this.container);this.selectIndex(this.options.defaultIndex||0);this.element.on("click",".tabs-headers-item",function(e){e.preventDefault();var tabHeader=$(this);var index=tabHeader.data("index");if(index!=self.activeIndex){self.selectIndex(index)}});return this}}]);return Tabs}();
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
} }
.intro { .intro {
position: relative; position: relative;
height: 408px; min-height: 408px;
border-bottom: 1px solid #aaa; border-bottom: 1px solid #aaa;
} }
.intro table { .intro table {
...@@ -56,37 +56,33 @@ ...@@ -56,37 +56,33 @@
.intro table tbody td:first-child { .intro table tbody td:first-child {
border-left: 0; border-left: 0;
} }
.intro table tfoot td { .intro .product-surplus {
padding-left: 100px; padding: 50px 0 50px 100px;
font-size: 18px; font-size: 18px;
line-height: 106px;
text-align: left;
} }
.intro table tfoot td .balance:after { .intro .product-surplus span,
content: '万 / '; .intro .product-surplus p {
float: left;
} }
.intro table tfoot td .total:after { .intro .product-surplus .balance:after {
content: ''; content: ' / ';
} }
.intro table tfoot td .progress-bar { .intro .product-surplus .progress-bar {
position: relative; position: relative;
display: inline-block; margin-top: 7px;
width: 365px; width: 365px;
height: 13px; height: 13px;
margin-left: 42px; margin-left: 42px;
border: 1px solid #ff4a4a; border: 1px solid #ff4a4a;
} }
.intro table tfoot td .progress-bar i { .intro .product-surplus .progress-bar i {
display: inline-block; display: block;
position: absolute;
left: 0;
top: 0;
height: 13px; height: 13px;
width: 0; width: 0;
background: #ff4a4a; background: #ff4a4a;
transition: width 1s; transition: width 1s;
} }
.intro > div { .intro .product-status {
width: 180px; width: 180px;
height: 180px; height: 180px;
border-radius: 50%; border-radius: 50%;
...@@ -95,7 +91,7 @@ ...@@ -95,7 +91,7 @@
right: 0px; right: 0px;
top: 95px; top: 95px;
} }
.intro > div p { .intro .product-status p {
width: 100%; width: 100%;
height: 100%; height: 100%;
text-align: center; text-align: center;
...@@ -103,7 +99,7 @@ ...@@ -103,7 +99,7 @@
font-size: 40px; font-size: 40px;
color: #000; color: #000;
} }
.intro > div > div { .intro .product-status > div {
position: absolute; position: absolute;
top: -10px; top: -10px;
left: -10px; left: -10px;
...@@ -111,6 +107,8 @@ ...@@ -111,6 +107,8 @@
height: 180px; height: 180px;
border-radius: 50%; border-radius: 50%;
border: 10px solid transparent; border: 10px solid transparent;
}
.intro .product-status > div.status-11 {
border-right-color: #ff4a4a; border-right-color: #ff4a4a;
animation: huxian 1s infinite linear; animation: huxian 1s infinite linear;
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
.intro { .intro {
position: relative; position: relative;
height: 408px; min-height: 408px;
border-bottom: 1px solid #aaa; border-bottom: 1px solid #aaa;
table { table {
...@@ -62,45 +62,34 @@ ...@@ -62,45 +62,34 @@
} }
} }
} }
tfoot {
td {
padding-left: 100px;
font-size: 18px;
line-height: 106px;
text-align: left;
.balance {
&:after {
content: '万 / '
} }
.product-surplus {
padding: 50px 0 50px 100px;
font-size: 18px;
span, p {
float: left;
} }
.total { .balance:after {
&:after { content: ' / '
content: '万'
}
} }
.progress-bar { .progress-bar {
position: relative; position: relative;
display: inline-block; margin-top: 7px;
width: 365px; width: 365px;
height: 13px; height: 13px;
margin-left: 42px; margin-left: 42px;
border: 1px solid #ff4a4a; border: 1px solid #ff4a4a;
i { i {
display: inline-block; display: block;
position: absolute;
left: 0;
top: 0;
height: 13px; height: 13px;
width:0; width: 0;
background: #ff4a4a; background: #ff4a4a;
transition: width 1s; transition: width 1s;
} }
} }
} }
} .product-status {
}
& > div {
width: 180px; width: 180px;
height: 180px; height: 180px;
border-radius: 50%; border-radius: 50%;
...@@ -124,10 +113,12 @@ ...@@ -124,10 +113,12 @@
height: 180px; height: 180px;
border-radius: 50%; border-radius: 50%;
border: 10px solid transparent; border: 10px solid transparent;
&.status-11 {
border-right-color: #ff4a4a; border-right-color: #ff4a4a;
animation: huxian 1s infinite linear; animation: huxian 1s infinite linear;
} }
} }
}
} }
.appointment { .appointment {
...@@ -166,7 +157,7 @@ ...@@ -166,7 +157,7 @@
background: #ec3737; background: #ec3737;
} }
} }
.errorName,.errorTel { .errorName, .errorTel {
display: inline-block; display: inline-block;
width: 246px; width: 246px;
height: 40px; height: 40px;
...@@ -215,6 +206,7 @@ ...@@ -215,6 +206,7 @@
body { body {
position: relative; position: relative;
} }
.modal-box { .modal-box {
display: none; display: none;
top: 0; top: 0;
...@@ -236,7 +228,7 @@ body { ...@@ -236,7 +228,7 @@ body {
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
div { div {
&:nth-child(1){ &:nth-child(1) {
width: 100%; width: 100%;
height: 80px; height: 80px;
background: #ff4a4b; background: #ff4a4b;
...@@ -257,23 +249,23 @@ body { ...@@ -257,23 +249,23 @@ body {
color: #fff; color: #fff;
} }
} }
&:nth-child(2){ &:nth-child(2) {
position: relative; position: relative;
i { i {
display: inline-block; display: inline-block;
width: 69px; width: 69px;
height: 69px; height: 69px;
background: url(https://res.fudou6.com/c/4/20160730/e86YXBwb2ludG1lbnQtc3VjY2VzcyA=_69x69.png)no-repeat; background: url(https://res.fudou6.com/c/4/20160730/e86YXBwb2ludG1lbnQtc3VjY2VzcyA=_69x69.png) no-repeat;
position: absolute; position: absolute;
left:90px; left: 90px;
top:8px; top: 8px;
} }
h3 { h3 {
font-size: 50px; font-size: 50px;
font-weight: bold; font-weight: bold;
color: #ff4a4a; color: #ff4a4a;
margin: 43px 0; margin: 43px 0;
padding-left:180px; padding-left: 180px;
} }
} }
} }
......
.products { .tabs {
padding-bottom: 50px;
}
.tabs .loading {
text-align: center;
min-height: 500px;
line-height: 500px;
color: #ccc;
font-size: 32px;
border: none !important;
}
.tabs > header {
background-color: #2d2f33;
margin-bottom: 25px;
}
.tabs > header > div {
width: 1150px;
margin: 0 auto;
line-height: 1;
}
.tabs > header > div > a {
display: block;
float: left;
padding: 20px 40px;
font-size: 18px;
font-weight: 300;
color: #fff;
}
.tabs > header > div > a.active,
.tabs > header > div > a:hover {
background-color: #ff4a4a;
}
.tabs > section {
min-height: 500px;
}
.tabs > section > div {
width: 1150px; width: 1150px;
margin: 0 auto; margin: 0 auto;
display: none;
}
.tabs > section > div.active {
display: block;
} }
.products li { .products li {
position: relative; position: relative;
...@@ -20,6 +59,18 @@ ...@@ -20,6 +59,18 @@
height: 150px; height: 150px;
margin-top: -75px; margin-top: -75px;
} }
.products li > .seal > span {
position: absolute;
top: 50%;
width: 100%;
height: 24px;
margin-top: -4px;
text-align: center;
line-height: 24px;
font-size: 24px;
font-style: normal;
color: #ff4a4a;
}
.products li > .corner { .products li > .corner {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -34,17 +85,17 @@ ...@@ -34,17 +85,17 @@
} }
.products li > div { .products li > div {
border-left: 8px solid transparent; border-left: 8px solid transparent;
padding: 0 125px 0 236px; padding: 0 60px 0 230px;
transition: border .5s; transition: border .5s;
} }
.products li > div > div { .products li > div > div {
float: left; float: left;
min-height: 300px;
color: #2d2f33; color: #2d2f33;
position: relative; position: relative;
} }
.products li > div > div:first-child { .products li > div > div:first-child {
width: 60%; width: 60%;
padding: 40px 0;
} }
.products li > div > div:first-child:after { .products li > div > div:first-child:after {
content: ''; content: '';
...@@ -63,6 +114,7 @@ ...@@ -63,6 +114,7 @@
.products li > div > div:first-child h3 { .products li > div > div:first-child h3 {
color: #ff4a4a; color: #ff4a4a;
font-size: 16px; font-size: 16px;
margin: 10px 0;
} }
.products li > div > div:first-child h3:before { .products li > div > div:first-child h3:before {
margin-right: 1em; margin-right: 1em;
...@@ -72,81 +124,133 @@ ...@@ -72,81 +124,133 @@
.products li > div > div:first-child > div span { .products li > div > div:first-child > div span {
float: left; float: left;
width: 33%; width: 33%;
text-align: center;
font-size: 16px; font-size: 16px;
line-height: 50px; line-height: 50px;
} }
.products li > div > div:first-child > div span:after { .products li > div > div:first-child > div span > p {
float: left;
text-align: center;
}
.products li > div > div:first-child > div span > p:after {
font-size: 16px; font-size: 16px;
color: #848484; color: #848484;
line-height: 16px; line-height: 16px;
display: block;
} }
.products li > div > div:first-child > div span:nth-child(1) { .products li > div > div:first-child > div span:nth-child(1) {
font-size: 30px; font-size: 30px;
color: #ff4a4a; color: #ff4a4a;
} }
.products li > div > div:first-child > div span:nth-child(1):after { .products li > div > div:first-child > div span:nth-child(1) > p:after {
content: '预期收益'; content: '预期收益';
} }
.products li > div > div:first-child > div span:nth-child(2):after { .products li > div > div:first-child > div span:nth-child(2) > p:after {
content: '起投(万)'; content: '起投(万)';
} }
.products li > div > div:first-child > div span:nth-child(3):after { .products li > div > div:first-child > div span:nth-child(3) > p:after {
content: '期限'; content: '期限';
} }
.products li > div > div:last-child { .products li > div > div:last-child {
width: 40%; width: 40%;
} }
.products li > div > div:last-child > div {
padding: 20px 30px;
}
.products li > div > div:last-child h4 { .products li > div > div:last-child h4 {
color: #000; color: #000;
font-size: 16px; font-size: 16px;
border-left: 5px solid #2d2f33; border-left: 5px solid #2d2f33;
padding-left: .5em;
line-height: 1;
} }
.products li > div > div:last-child p { .products li > div > div:last-child p {
font-size: 14px; font-size: 14px;
margin-top: 15px;
} }
.products li.status-1 > .seal { .products li.status-11 > .seal {
background-image: url('https://res.fudou6.com/c/4/20160730/yetaWNvbi1zeWVk_235x235.png'); background-image: url('https://res.fudou6.com/c/4/20160730/yetaWNvbi1zeWVk_235x235.png');
} }
.products li.status-1 > .corner { .products li.status-11 > .corner {
background-image: url('https://res.fudou6.com/c/4/20160730/vjbc3RhdHVzXzAz_125x158.png'); background-image: url('https://res.fudou6.com/c/4/20160730/vjbc3RhdHVzXzAz_125x158.png');
} }
.products li.status-1:hover > div { .products li.status-11:hover > div {
border-left-color: #ff4a4a; border-left-color: #ff4a4a;
} }
.products li.status-2 > .seal { .products li.status-5 > .seal {
background-image: url('https://res.fudou6.com/c/4/20160730/9m3aWNvbi13YWl0_236x236.png'); background-image: url('https://res.fudou6.com/c/4/20160730/9m3aWNvbi13YWl0_236x236.png');
} }
.products li.status-2 > .corner { .products li.status-5 > .corner {
background-image: url('https://res.fudou6.com/c/4/20160730/37nc3RhdHVzXzEw_125x158.png'); background-image: url('https://res.fudou6.com/c/4/20160730/37nc3RhdHVzXzEw_125x158.png');
} }
.products li.status-2:hover > div { .products li.status-5:hover > div {
border-left-color: #000; border-left-color: #000;
} }
.products li.status-3 > .seal { .products li.status-17 > .seal {
background-image: url('https://res.fudou6.com/c/4/20160730/9w0aWNvbi1wYXVzZQ==_236x236.png'); background-image: url('https://res.fudou6.com/c/4/20160730/9w0aWNvbi1wYXVzZQ==_236x236.png');
} }
.products li.status-3 > .corner { .products li.status-17 > .corner {
background-image: url('https://res.fudou6.com/c/4/20160730/g33c3RhdHVzXzE1_125x158.png'); background-image: url('https://res.fudou6.com/c/4/20160730/g33c3RhdHVzXzE1_125x158.png');
} }
.products li.status-3:hover > div { .products li.status-17:hover > div {
border-left-color: #43abb6; border-left-color: #43abb6;
} }
.products li.status-4 > .seal { .products li.status-21 > .seal {
background-image: url('https://res.fudou6.com/c/4/20160730/9r8aWNvbi15Zno=_236x236.png'); background-image: url('https://res.fudou6.com/c/4/20160730/9r8aWNvbi15Zno=_236x236.png');
} }
.products li.status-4 > .corner { .products li.status-21 > .corner {
background-image: url('https://res.fudou6.com/c/4/20160730/cwnc3RhdHVzXzE5_125x158.png'); background-image: url('https://res.fudou6.com/c/4/20160730/cwnc3RhdHVzXzE5_125x158.png');
} }
.products li.status-4:hover > div { .products li.status-21:hover > div {
border-left-color: #7a7b7c; border-left-color: #7a7b7c;
} }
.products li.status-5 > .seal { .products li.status-31 > .seal {
background-image: url('https://res.fudou6.com/c/4/20160730/q9gaWNvbi15d2M=_236x236.png'); background-image: url('https://res.fudou6.com/c/4/20160730/q9gaWNvbi15d2M=_236x236.png');
} }
.products li.status-5 > .corner { .products li.status-31 > .corner {
background-image: url('https://res.fudou6.com/c/4/20160730/52mc3RhdHVzXzIz_125x158.png'); background-image: url('https://res.fudou6.com/c/4/20160730/52mc3RhdHVzXzIz_125x158.png');
} }
.products li.status-5:hover > div { .products li.status-31:hover > div {
border-left-color: #c5c5c5; border-left-color: #c5c5c5;
} }
.products .product-item {
cursor: pointer;
}
.pagination {
text-align: center;
padding: 20px 0;
}
.pagination a {
padding: 5px 15px;
margin: 0 1em;
font-size: 16px;
color: #fff;
background-color: #939393;
border-radius: 8px;
}
.pagination a:hover {
background-color: #2d2f33;
}
@media screen and (min-width: 769px) {
body .tabs > header > div {
width: 990px;
}
body .tabs > section > div {
width: 990px;
}
}
@media screen and (min-width: 1281px) {
body .tabs > header > div {
width: 1150px;
}
body .tabs > section > div {
width: 1150px;
}
}
@media screen and (min-width: 1441px) {
body .tabs > header > div {
width: 1360px;
}
body .tabs > section > div {
width: 1360px;
}
}
...@@ -21,9 +21,54 @@ ...@@ -21,9 +21,54 @@
bottom: @b; bottom: @b;
} }
.products { .tabs {
padding-bottom: 50px;
.loading {
text-align: center;
min-height: 500px;
line-height: 500px;
color: #ccc;
font-size: 32px;
border: none !important;
}
& > header {
background-color: @color;
margin-bottom: 25px;
& > div {
width: @container-width;
margin: 0 auto;
line-height: 1;
& > a {
display: block;
float: left;
padding: 20px 40px;
font-size: 18px;
font-weight: 300;
color: #fff;
&.active,
&:hover {
background-color: @highlightColor;
}
}
}
}
& > section {
min-height: 500px;
& > div {
width: @container-width; width: @container-width;
margin: 0 auto; margin: 0 auto;
display: none;
&.active {
display: block;
}
}
}
}
.products {
//width: @container-width;
//margin: 0 auto;
li { li {
position: relative; position: relative;
border: 1px solid #939393; border: 1px solid #939393;
...@@ -32,6 +77,18 @@ ...@@ -32,6 +77,18 @@
.absolute(50%, 45px); .absolute(50%, 45px);
.icon(@seal-size, @seal-size); .icon(@seal-size, @seal-size);
margin-top: -@seal-size/2; margin-top: -@seal-size/2;
& > span {
position: absolute;
top: 50%;
width: 100%;
height: 24px;
margin-top: -4px;
text-align: center;
line-height: 24px;
font-size: 24px;
font-style: normal;
color: @highlightColor;
}
} }
& > .corner { & > .corner {
.absolute(0, auto, 0); .absolute(0, auto, 0);
...@@ -40,15 +97,16 @@ ...@@ -40,15 +97,16 @@
& > div { & > div {
border-left: 8px solid transparent; border-left: 8px solid transparent;
padding: 0 125px 0 236px; padding: 0 60px 0 230px;
transition: border .5s; transition: border .5s;
& > div { & > div {
float: left; float: left;
min-height: 300px; //min-height: 300px;
color: @color; color: @color;
position: relative; position: relative;
&:first-child { &:first-child {
width: 60%; width: 60%;
padding: 40px 0;
&:after { &:after {
content: ''; content: '';
.absolute(0, 100%, 0, 0); .absolute(0, 100%, 0, 0);
...@@ -58,10 +116,12 @@ ...@@ -58,10 +116,12 @@
} }
h2 { h2 {
font-size: 18px; font-size: 18px;
} }
h3 { h3 {
color: @highlightColor; color: @highlightColor;
font-size: 16px; font-size: 16px;
margin: 10px 0;
&:before { &:before {
margin-right: 1em; margin-right: 1em;
content: '总额度'; content: '总额度';
...@@ -69,31 +129,37 @@ ...@@ -69,31 +129,37 @@
} }
} }
& > div { & > div {
span { span {
float: left; float: left;
width: 33%; width: 33%;
text-align: center; //text-align: center;
font-size: 16px; font-size: 16px;
line-height: 50px; line-height: 50px;
&:after { & > p {
float: left;
text-align: center;
}
& > p:after {
font-size: 16px; font-size: 16px;
color: #848484; color: #848484;
line-height: 16px; line-height: 16px;
display: block;
} }
&:nth-child(1) { &:nth-child(1) {
font-size: 30px; font-size: 30px;
color: @highlightColor; color: @highlightColor;
&:after { & > p:after {
content: '预期收益'; content: '预期收益';
} }
} }
&:nth-child(2) { &:nth-child(2) {
&:after { & > p:after {
content: '起投(万)'; content: '起投(万)';
} }
} }
&:nth-child(3) { &:nth-child(3) {
&:after { & > p:after {
content: '期限'; content: '期限';
} }
} }
...@@ -102,13 +168,19 @@ ...@@ -102,13 +168,19 @@
} }
&:last-child { &:last-child {
width: 40%; width: 40%;
& > div {
padding: 20px 30px;
}
h4 { h4 {
color: #000; color: #000;
font-size: 16px; font-size: 16px;
border-left: 5px solid @color; border-left: 5px solid @color;
padding-left: .5em;
line-height: 1;
} }
p { p {
font-size: 14px; font-size: 14px;
margin-top: 15px;
} }
} }
} }
...@@ -129,16 +201,64 @@ ...@@ -129,16 +201,64 @@
} }
} }
} }
.status(1, 'https://res.fudou6.com/c/4/20160730/yetaWNvbi1zeWVk_235x235.png', .status(11, 'https://res.fudou6.com/c/4/20160730/yetaWNvbi1zeWVk_235x235.png',
'https://res.fudou6.com/c/4/20160730/vjbc3RhdHVzXzAz_125x158.png', @highlightColor); 'https://res.fudou6.com/c/4/20160730/vjbc3RhdHVzXzAz_125x158.png', @highlightColor);
.status(2, 'https://res.fudou6.com/c/4/20160730/9m3aWNvbi13YWl0_236x236.png', .status(5, 'https://res.fudou6.com/c/4/20160730/9m3aWNvbi13YWl0_236x236.png',
'https://res.fudou6.com/c/4/20160730/37nc3RhdHVzXzEw_125x158.png', #000); 'https://res.fudou6.com/c/4/20160730/37nc3RhdHVzXzEw_125x158.png', #000);
.status(3, 'https://res.fudou6.com/c/4/20160730/9w0aWNvbi1wYXVzZQ==_236x236.png', .status(17, 'https://res.fudou6.com/c/4/20160730/9w0aWNvbi1wYXVzZQ==_236x236.png',
'https://res.fudou6.com/c/4/20160730/g33c3RhdHVzXzE1_125x158.png', #43abb6); 'https://res.fudou6.com/c/4/20160730/g33c3RhdHVzXzE1_125x158.png', #43abb6);
.status(4, 'https://res.fudou6.com/c/4/20160730/9r8aWNvbi15Zno=_236x236.png', .status(21, 'https://res.fudou6.com/c/4/20160730/9r8aWNvbi15Zno=_236x236.png',
'https://res.fudou6.com/c/4/20160730/cwnc3RhdHVzXzE5_125x158.png', #7a7b7c); 'https://res.fudou6.com/c/4/20160730/cwnc3RhdHVzXzE5_125x158.png', #7a7b7c);
.status(5, 'https://res.fudou6.com/c/4/20160730/q9gaWNvbi15d2M=_236x236.png', .status(31, 'https://res.fudou6.com/c/4/20160730/q9gaWNvbi15d2M=_236x236.png',
'https://res.fudou6.com/c/4/20160730/52mc3RhdHVzXzIz_125x158.png', #c5c5c5); 'https://res.fudou6.com/c/4/20160730/52mc3RhdHVzXzIz_125x158.png', #c5c5c5);
} }
.product-item {
cursor: pointer;
}
}
.pagination {
text-align: center;
padding: 20px 0;
a {
padding: 5px 15px;
margin: 0 1em;
font-size: 16px;
color: #fff;
background-color: #939393;
border-radius: 8px;
&:hover {
background-color: @color;
}
}
}
.screen() {
.media(@screen-width-small, @container-width-small);
.media(@screen-width, @container-width);
.media(@screen-width-large, @container-width-large);
}
.media(@sw, @cw) {
@media screen and (min-width: @sw) {
.rules(@cw);
}
}
.rules(@cw) {
.tabs {
& > header {
& > div {
width: @cw;
}
}
& > section > div {
width: @cw;
}
}
}
body {
.screen();
} }
\ No newline at end of file
...@@ -20,37 +20,38 @@ ...@@ -20,37 +20,38 @@
/* .hot-project-banner end */ /* .hot-project-banner end */
/* .hot-project-introducer start*/ /* .hot-project-introducer start*/
.hot-project-introducer { .hot-project-introducer {
height: 728px; padding: 0 0 60px 0;
margin: 0 auto; margin: 0 auto;
} }
.hot-project-introducer > ul { .hot-project-introducer > ul {
height: 180px; height: 180px;
} }
.hot-project-introducer > ul li { .hot-project-introducer > ul li {
width: 25%;
float: left; float: left;
width: 25%;
font-size: 18px; font-size: 18px;
color: #000; color: #000;
line-height: 180px; line-height: 180px;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
} }
.hot-project-introducer > ul li i { .hot-project-introducer > ul li:before {
content: '';
display: inline-block; display: inline-block;
position: relative;
top: -3px;
width: 8px; width: 8px;
height: 8px; height: 8px;
margin-right: 40px;
border-radius: 50%; border-radius: 50%;
background: #bb342e; background: #bb342e;
position: relative;
top: -3px;
margin-right: 40px;
} }
.hot-project-introducer > ul li b { .hot-project-introducer > ul li b {
display: inline-block; display: inline-block;
width: 46px;
height: 46px;
position: relative; position: relative;
top: 20px; top: 20px;
width: 46px;
height: 46px;
margin-right: 6px; margin-right: 6px;
background: url("../images/hot_project/tabs01.png") no-repeat -46px -13px; background: url("../images/hot_project/tabs01.png") no-repeat -46px -13px;
} }
...@@ -63,61 +64,56 @@ ...@@ -63,61 +64,56 @@
.hot-project-introducer > ul li:nth-child(4) > b { .hot-project-introducer > ul li:nth-child(4) > b {
background-position: -450px -13pxpx; background-position: -450px -13pxpx;
} }
.hot-project-introducer > hr.line-separate {
width: 100%;
}
.hot-project-introducer > hr.line-separate:after { .hot-project-introducer > hr.line-separate:after {
background: #01a9dd; background: #01a9dd;
} }
.hot-project-introducer .introducer { .hot-project-introducer .introducer {
position: relative;
width: 700px; width: 700px;
margin: 0 auto; margin: 0 auto;
position: relative;
} }
.hot-project-introducer .introducer h4 { .hot-project-introducer .introducer h2 {
margin: 50px 0;
font-size: 36px; font-size: 36px;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
margin: 50px 0 58px;
} }
.hot-project-introducer .introducer div { .hot-project-introducer .introducer div {
width: 100%;
color: #000;
margin: 15px 0; margin: 15px 0;
position: relative;
} }
.hot-project-introducer .introducer div span { .hot-project-introducer .introducer label {
font-size: 25px; float: left;
} font-size: 24px;
.hot-project-introducer .introducer div input {
width: 506px;
height: 40px;
line-height: 40px;
font-size: 18px;
color: #7f7f7f;
outline: none;
border: 1px solid #090204;
padding: 0 30px;
background: #f4f4f4;
} }
.hot-project-introducer .introducer div textarea { .hot-project-introducer .introducer input[type="text"],
width: 506px; .hot-project-introducer .introducer textarea {
min-height: 100px; float: left;
padding: 12px 30px; width: 500px;
font-size: 18px; font-size: 18px;
border: 1px solid #939393;
border-radius: 10px;
color: #7f7f7f; color: #7f7f7f;
border: 1px solid #090204;
background: #f4f4f4;
outline: none; outline: none;
} }
.hot-project-introducer .introducer div:nth-child(4) span { .hot-project-introducer .introducer input[type="text"] {
position: relative; height: 40px;
left: 0; padding: 0 20px;
top: -74px; line-height: 40px;
} }
.hot-project-introducer .introducer div:last-child { .hot-project-introducer .introducer textarea {
text-align: center; min-height: 100px;
margin-top: 55px; padding: 12px 20px;
margin-bottom: 40px;
} }
.hot-project-introducer .introducer div:last-child input { .hot-project-introducer .introducer input[type="submit"] {
display: block;
width: 333px; width: 333px;
height: 60px; height: 60px;
margin: auto;
line-height: 60px; line-height: 60px;
border: none; border: none;
font-size: 24px; font-size: 24px;
...@@ -127,19 +123,13 @@ ...@@ -127,19 +123,13 @@
text-align: center; text-align: center;
} }
.hot-project-introducer .introducer p { .hot-project-introducer .introducer p {
height: 40px; position: absolute;
left: 680px;
top: 0;
width: 200px;
line-height: 40px; line-height: 40px;
font-size: 18px; font-size: 18px;
color: #ff4a4b; color: #ff4a4b;
position: absolute;
}
.hot-project-introducer .introducer p:nth-child(3) {
top: 102px;
right: -238px;
}
.hot-project-introducer .introducer p:nth-child(5) {
top: 172px;
right: -152px;
} }
/* .hot-project-introducer end*/ /* .hot-project-introducer end*/
/* .hot-project-address start */ /* .hot-project-address start */
...@@ -192,6 +182,10 @@ ...@@ -192,6 +182,10 @@
right: -144px; right: -144px;
z-index: 3; z-index: 3;
} }
.hot-project-address .hot-project-address-box > div:nth-child(2) a:hover {
background: #000;
color: #fff;
}
.hot-project-address .hot-project-address-box > div:nth-child(2) a:nth-child(2) { .hot-project-address .hot-project-address-box > div:nth-child(2) a:nth-child(2) {
top: 3%; top: 3%;
} }
...@@ -354,9 +348,6 @@ ...@@ -354,9 +348,6 @@
} }
/* .hot-project-tabs end */ /* .hot-project-tabs end */
/* .modal-box start */ /* .modal-box start */
body {
position: relative;
}
.modal-box { .modal-box {
display: none; display: none;
top: 0; top: 0;
...@@ -412,3 +403,18 @@ body { ...@@ -412,3 +403,18 @@ body {
cursor: pointer; cursor: pointer;
} }
/* .modal-box end */ /* .modal-box end */
@media screen and (min-width: 769px) {
body .hot-project-introducer {
width: 990px;
}
}
@media screen and (min-width: 1281px) {
body .hot-project-introducer {
width: 1150px;
}
}
@media screen and (min-width: 1441px) {
body .hot-project-introducer {
width: 1360px;
}
}
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
// //} // //}
// //
/* .hot-project-banner start */ /* .hot-project-banner start */
.hot-project-banner {
.hot-project-banner {
height: 470px; height: 470px;
width: 100%; width: 100%;
background: url('../images/hot_project/hot_project_banner.jpg') no-repeat center center; background: url('../images/hot_project/hot_project_banner.jpg') no-repeat center center;
...@@ -91,112 +92,102 @@ ...@@ -91,112 +92,102 @@
/* .hot-project-introducer start*/ /* .hot-project-introducer start*/
.hot-project-introducer { .hot-project-introducer {
height: 728px; padding: 0 0 60px 0;
margin: 0 auto; margin: 0 auto;
& > ul { & > ul {
height: 180px; height: 180px;
li { li {
width: 25%;
float: left; float: left;
width: 25%;
font-size: 18px; font-size: 18px;
color: #000; color: #000;
line-height: 180px; line-height: 180px;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
i { &:before {
content: '';
display: inline-block; display: inline-block;
position: relative;
top: -3px;
width: 8px; width: 8px;
height: 8px; height: 8px;
margin-right: 40px;
border-radius: 50%; border-radius: 50%;
background: #bb342e; background: #bb342e;
position: relative;
top: -3px;
margin-right: 40px;
} }
b { b {
display: inline-block; display: inline-block;
width: 46px;
height: 46px;
position: relative; position: relative;
top: 20px; top: 20px;
width: 46px;
height: 46px;
margin-right: 6px; margin-right: 6px;
background: url("../images/hot_project/tabs01.png") no-repeat -46px -13px; background: url("../images/hot_project/tabs01.png") no-repeat -46px -13px;
} }
} }
li:nth-child(2) { li:nth-child(2) > b {
> b {
background-position: -176px -13px; background-position: -176px -13px;
} }
} li:nth-child(3) > b {
li:nth-child(3) {
> b {
background-position: -329px -13px; background-position: -329px -13px;
} }
} li:nth-child(4) > b {
li:nth-child(4) {
> b {
background-position: -450px -13pxpx; background-position: -450px -13pxpx;
} }
} }
}
> hr.line-separate { & > hr.line-separate {
&:after{ width: 100%;
&:after {
background: #01a9dd; background: #01a9dd;
} }
} }
.introducer { .introducer {
position: relative;
width: 700px; width: 700px;
margin: 0 auto; margin: 0 auto;
position: relative; h2 {
h4 { margin: 50px 0;
font-size: 36px; font-size: 36px;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
margin: 50px 0 58px;
} }
div { div {
width: 100%;
color: #000;
margin: 15px 0; margin: 15px 0;
span { position: relative;
font-size: 25px;
} }
input { label {
width: 506px; float: left;
height: 40px; font-size: 24px;
line-height: 40px;
font-size: 18px;
color: #7f7f7f;
outline: none;
border: 1px solid #090204;
padding: 0 30px;
background: #f4f4f4;
} }
input[type="text"],
textarea { textarea {
width: 506px; float: left;
min-height: 100px; width: 500px;
padding: 12px 30px;
font-size: 18px; font-size: 18px;
border: 1px solid #939393;
border: 1px solid #939393;
border-radius: 10px;
color: #7f7f7f; color: #7f7f7f;
border: 1px solid #090204;
background: #f4f4f4;
outline: none; outline: none;
} }
input[type="text"] {
height: 40px;
padding: 0 20px;
line-height: 40px;
} }
div:nth-child(4) { textarea {
span { min-height: 100px;
position: relative; padding: 12px 20px;
left: 0; margin-bottom: 40px;
top: -74px;
}
} }
div:last-child { input[type="submit"] {
text-align: center; display: block;
margin-top: 55px;
input {
width: 333px; width: 333px;
height: 60px; height: 60px;
margin: auto;
line-height: 60px; line-height: 60px;
border: none; border: none;
font-size: 24px; font-size: 24px;
...@@ -205,21 +196,14 @@ ...@@ -205,21 +196,14 @@
border-radius: 10px; border-radius: 10px;
text-align: center; text-align: center;
} }
}
p { p {
height: 40px; position: absolute;
left: 680px;
top: 0;
width: 200px;
line-height: 40px; line-height: 40px;
font-size: 18px; font-size: 18px;
color: #ff4a4b; color: #ff4a4b;
position: absolute;
}
p:nth-child(3) {
top: 102px;
right: -238px;
}
p:nth-child(5) {
top: 172px;
right: -152px;
} }
} }
} }
...@@ -254,10 +238,10 @@ ...@@ -254,10 +238,10 @@
line-height: 53px; line-height: 53px;
} }
} }
&:nth-child(2){ &:nth-child(2) {
width: 100%; width: 100%;
position: relative; position: relative;
left:-80px; left: -80px;
img { img {
width: 100%; width: 100%;
} }
...@@ -272,31 +256,35 @@ ...@@ -272,31 +256,35 @@
background: #fff; background: #fff;
color: #000; color: #000;
position: absolute; position: absolute;
right:-144px; right: -144px;
z-index:3; z-index: 3;
&:hover {
background: #000;
color: #fff;
}
&:nth-child(2) { &:nth-child(2) {
top:3%; top: 3%;
} }
&:nth-child(3) { &:nth-child(3) {
top:23%; top: 23%;
} }
&:nth-child(4) { &:nth-child(4) {
top:38%; top: 38%;
} }
&:nth-child(5) { &:nth-child(5) {
top:56%; top: 56%;
} }
&:nth-child(6) { &:nth-child(6) {
top:65%; top: 65%;
} }
&:nth-child(7) { &:nth-child(7) {
top:74%; top: 74%;
} }
&:nth-child(8) { &:nth-child(8) {
top:84%; top: 84%;
} }
&:nth-child(9) { &:nth-child(9) {
top:94%; top: 94%;
} }
} }
} }
...@@ -315,12 +303,12 @@ ...@@ -315,12 +303,12 @@
ul { ul {
width: 1203px; width: 1203px;
height: 350px; height: 350px;
margin:180px auto 160px; margin: 180px auto 160px;
border: 1px solid #43abb6; border: 1px solid #43abb6;
li { li {
width: 300px; width: 300px;
height: 100%; height: 100%;
float:left; float: left;
font-size: 16px; font-size: 16px;
color: #000; color: #000;
text-align: center; text-align: center;
...@@ -437,7 +425,7 @@ ...@@ -437,7 +425,7 @@
background: url("../images/hot_project/tabs02_b.png ") no-repeat; background: url("../images/hot_project/tabs02_b.png ") no-repeat;
} }
50% { 50% {
opacity:0; opacity: 0;
} }
100% { 100% {
opacity: 1; opacity: 1;
...@@ -456,9 +444,10 @@ ...@@ -456,9 +444,10 @@
/* .hot-project-tabs end */ /* .hot-project-tabs end */
/* .modal-box start */ /* .modal-box start */
body { //body {
position: relative; // position: relative;
} //}
.modal-box { .modal-box {
display: none; display: none;
top: 0; top: 0;
...@@ -515,3 +504,25 @@ body { ...@@ -515,3 +504,25 @@ body {
} }
/* .modal-box end */ /* .modal-box end */
.screen() {
.media(@screen-width-small, @container-width-small);
.media(@screen-width, @container-width);
.media(@screen-width-large, @container-width-large);
}
.media(@sw, @cw) {
@media screen and (min-width: @sw) {
.rules(@cw);
}
}
.rules(@cw) {
.hot-project-introducer {
width: @cw;
}
}
body {
.screen();
}
\ No newline at end of file
...@@ -149,6 +149,7 @@ hr.line-separate { ...@@ -149,6 +149,7 @@ hr.line-separate {
} }
} }
/*.banner end*/ /*.banner end*/
.screen() { .screen() {
......
...@@ -6,7 +6,8 @@ var product = require('./product'); ...@@ -6,7 +6,8 @@ var product = require('./product');
/* GET home page. */ /* GET home page. */
router.get('/', function (req, res) { router.get('/', function (req, res) {
res.render('index', { res.render('index', {
page: 'index', styles: ['index'],
scripts:['index'],
character: [ character: [
{ {
sum: '526亿', sum: '526亿',
...@@ -43,7 +44,7 @@ router.get('/', function (req, res) { ...@@ -43,7 +44,7 @@ router.get('/', function (req, res) {
img: 'http://res.fudou6.com/c/4/20160730/c4sNTI4YWQ1Nw==_1000x600.jpg', img: 'http://res.fudou6.com/c/4/20160730/c4sNTI4YWQ1Nw==_1000x600.jpg',
raiseTime: '28', raiseTime: '28',
raiseFunds: '4', raiseFunds: '4',
maxProfits: '8.0%-8.5%', maxProfits: '8.5%',
link: '' link: ''
}, { }, {
title: '中电投先融-天津市级政信', title: '中电投先融-天津市级政信',
...@@ -57,21 +58,21 @@ router.get('/', function (req, res) { ...@@ -57,21 +58,21 @@ router.get('/', function (req, res) {
img: 'http://res.fudou6.com/c/4/20160730/eedZmNmYmIwOA==_600x375.jpg', img: 'http://res.fudou6.com/c/4/20160730/eedZmNmYmIwOA==_600x375.jpg',
raiseTime: '21', raiseTime: '21',
raiseFunds: '2', raiseFunds: '2',
maxProfits: '8.5%-8.7%', maxProfits: '8.7%',
link: '' link: ''
}, { }, {
title: '金元南通新沿海1号', title: '金元南通新沿海1号',
img: 'http://res.fudou6.com/c/4/20160730/y3sNWNlN2NmOA==_1000x600.jpg', img: 'http://res.fudou6.com/c/4/20160730/y3sNWNlN2NmOA==_1000x600.jpg',
raiseTime: '20', raiseTime: '20',
raiseFunds: '2', raiseFunds: '2',
maxProfits: '8.2%-8.5%', maxProfits: '8.5%',
link: '' link: ''
}, { }, {
title: '国信证券<br/>巴中市高明新区壁州大道', title: '国信证券<br/>巴中市高明新区壁州大道',
img: 'http://res.fudou6.com/c/4/20160730/pdeMzhiZTc4ZA==_1000x600.jpg', img: 'http://res.fudou6.com/c/4/20160730/pdeMzhiZTc4ZA==_1000x600.jpg',
raiseTime: '52', raiseTime: '52',
raiseFunds: '1', raiseFunds: '1',
maxProfits: '10.2%-10.6%', maxProfits: '10.6%',
link: '' link: ''
}, },
] ]
...@@ -80,25 +81,28 @@ router.get('/', function (req, res) { ...@@ -80,25 +81,28 @@ router.get('/', function (req, res) {
router.get('/about', function (req, res) { router.get('/about', function (req, res) {
res.render('about', { res.render('about', {
page: 'about' styles: ['about'],
}); });
}); });
router.get('/project', function (req, res) { router.get('/project', function (req, res) {
res.render('project', { res.render('project', {
page: 'project' styles: ['project'],
scripts:['project'],
}); });
}); });
router.get('/product', product);
router.get('/products', function (req, res) { router.get('/products', function (req, res) {
res.render('products', { res.render('products', {
page: 'products' styles: ['products'],
scripts:['utils','products'],
}); });
}); });
router.get('/products/:id', product);
module.exports = router; module.exports = router;
var express = require('express'); (function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['module', 'exports', '../utils/xFetch', 'express'], factory);
} else if (typeof exports !== "undefined") {
factory(module, exports, require('../utils/xFetch'), require('express'));
} else {
var mod = {
exports: {}
};
factory(mod, mod.exports, global.xFetch, global.express);
global.product = mod.exports;
}
})(this, function (module, exports, _xFetch, express) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.formatDateTime = exports.leftPad = exports.productStatusToString = exports.PRODUCT_STATUS = undefined;
exports.formatMoney = formatMoney;
var _xFetch2 = _interopRequireDefault(_xFetch);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var PRODUCT_STATUS = exports.PRODUCT_STATUS = {
'-9': '草稿',
0: '已删除',
1: '未发布',
5: '预热中',
11: '募集中',
17: '已暂停',
21: '已封账',
31: '已成立'
};
var productStatusToString = exports.productStatusToString = function productStatusToString(status) {
return PRODUCT_STATUS[status] || '未定义';
};
function formatMoney() {
var money = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
module.exports = function(req, res, next) { var ret = void 0;
res.render('product', { if (isNaN(money)) {
page: 'product', ret = '0';
} else if (money >= 1E10) {
ret = money / 1E10 + '亿';
} else if (money >= 1E6) {
ret = money / 1E6 + '万';
} else {
ret = money / 1E2;
}
return ret;
}
var leftPad = exports.leftPad = function leftPad(num) {
return num >= 10 ? num : '0' + num;
};
var formatDateTime = exports.formatDateTime = function formatDateTime() {
var time = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
var format = arguments.length <= 1 || arguments[1] === undefined ? 'YYYY-MM-DD hh:mm:ss' : arguments[1];
var date = new Date(time);
var data = {
YYYY: date.getFullYear(),
MM: leftPad(date.getMonth() + 1),
DD: leftPad(date.getDate()),
hh: leftPad(date.getHours()),
mm: leftPad(date.getMinutes()),
ss: leftPad(date.getSeconds())
};
return format.replace(/[A-Za-z]+/g, function (metch) {
return data[metch];
});
};
module.exports = function (req, res, next) {
Promise.all([(0, _xFetch2.default)('https://m.fudou6.com/api/1.0/cate/cates.json'), (0, _xFetch2.default)('https://m.fudou6.com/api/1.0/prod/detail.json?itemId=' + req.params.id)]).then(function (arr) {
var pCates = arr[0].pCates;
var item = arr[1].item;
if (!item || !pCates) {
var err = new Error('Not Found');
err.status = 404;
next(err);
}
pCates.forEach(function (cate) {
cate.subCates.forEach(function (scate) {
if (scate.id == item.categoryId) {
item.categoryName = scate.name;
item.categoryParentId = cate.id;
item.categroyParentName = cate.name;
}
});
}); });
};
item.elements = JSON.parse(item.elements);
Object.keys(item.elements).forEach(function (key) {
console.log('%s\t%s\t%s', key, item.elements[key][0], item.elements[key][1]);
item.elements[key] = item.elements[key][1];
});
item.commissionAlg = JSON.parse(item.commissionAlg);
item.commissionAlg = item.commissionAlg.map(function (it) {
var _ref = it.result || {};
var sy = _ref.sy;
var yj = _ref.yj;
return {
rowspan: item.commissionAlg.length,
range: (it.min ? formatMoney(it.min) + ' ≤ ' : '') + ' x ' + (it.max ? ' < ' + formatMoney(it.max) : ''),
min: it.min,
max: it.max,
sy: sy, yj: yj
};
});
item.fundRaisedStartTimeString = item.fundRaisedStartTime && formatDateTime(item.fundRaisedStartTime);
item.fundRaisedEndTimeString = item.fundRaisedEndTime && formatDateTime(item.fundRaisedEndTime);
item.statusString = productStatusToString(item.status);
//募集目标
item.fundRaisedTargetString = formatMoney(item.fundRaisedTarget);
//已募集
item.fundRaisedOverString = formatMoney(item.fundRaisedOver);
item.fundRaisedPercentage = item.fundRaisedOver / item.fundRaisedTarget * 100;
//募集剩余
item.fundRaisedSurplus = Math.max(item.fundRaisedTarget - item.fundRaisedOver, 0);
item.fundRaisedSurplusString = formatMoney(item.fundRaisedSurplus);
//最小投资
item.minimumAmountString = formatMoney(item.minimumAmount);
//console.log(item);
res.render('product', _extends({
styles: ['product'],
scripts: ['utils', 'product']
}, item));
}).catch(function (err) {
console.log(err);
next(err);
});
};
});
//# sourceMappingURL=product.js.map
\ No newline at end of file
{"version":3,"sources":["product.jsx"],"names":[],"mappings":";;wDAEsB,S;;qEAAA,S;;;;;;;;6CAAlB,O;;;;;;;YAiBY,W,GAAA,W;;;;;;;;;;;;;;;;;;;;;;;;AAfT,QAAM,0CAAiB;AAC1B,cAAM,IADoB;AAE1B,WAAG,KAFuB;AAG1B,WAAG,KAHuB;AAI1B,WAAG,KAJuB;AAK1B,YAAI,KALsB;AAM1B,YAAI,KANsB;AAO1B,YAAI,KAPsB;AAQ1B,YAAI;AARsB,KAAvB;;AAWA,QAAM,wDAAwB,SAAxB,qBAAwB,SAAU;AAC3C,eAAO,eAAe,MAAf,KAA0B,KAAjC;AACH,KAFM;;AAIA,aAAS,WAAT,GAAgC;AAAA,YAAX,KAAW,yDAAH,CAAG;;AACnC,YAAI,YAAJ;AACA,YAAI,MAAM,KAAN,CAAJ,EAAkB;AACd,kBAAM,GAAN;AACH,SAFD,MAEO,IAAI,SAAS,IAAb,EAAmB;AACtB,kBAAO,QAAQ,IAAT,GAAiB,GAAvB;AACH,SAFM,MAEA,IAAI,SAAS,GAAb,EAAkB;AACrB,kBAAO,QAAQ,GAAT,GAAgB,GAAtB;AACH,SAFM,MAEA;AACH,kBAAO,QAAQ,GAAf;AACH;AACD,eAAO,GAAP;AACH;;AAGM,QAAM,4BAAU,SAAV,OAAU,MAAO;AAC1B,eAAO,OAAO,EAAP,GAAY,GAAZ,GAAmB,MAAM,GAAhC;AACH,KAFM;;AAIA,QAAM,0CAAiB,SAAjB,cAAiB,GAA8C;AAAA,YAA7C,IAA6C,yDAAtC,CAAsC;AAAA,YAAnC,MAAmC,yDAA1B,qBAA0B;;AACxE,YAAM,OAAO,IAAI,IAAJ,CAAS,IAAT,CAAb;A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sB,KAAK,gBAA3B,GAA8C,GAA1E;AACA;AACA,iBAAK,iBAAL,GAAyB,KAAK,GAAL,CAAS,KAAK,gBAAL,GAAwB,KAAK,cAAtC,EAAsD,CAAtD,CAAzB;;AAEA,iBAAK,uBAAL,GAA+B,YAAY,KAAK,iBAAjB,CAA/B;AACA;AACA,iBAAK,mBAAL,GAA2B,YAAY,KAAK,aAAjB,CAA3B;;AAEA;;AAEA,gBAAI,MAAJ,CAAW,SAAX;AACI,wBAAO,CAAC,SAAD,CADX;AAEI,yBAAQ,CAAC,OAAD,EAAS,SAAT;AAFZ,eAGO,IAHP;AAMH,SAzED,EAyEG,KAzEH,CAyES,eAAM;AACX,oBAAQ,GAAR,CAAY,GAAZ;AACA,iBAAK,GAAL;AACH,SA5ED;AA8EH,KA/ED","file":"product.js","sourcesContent":["import xFetch from '../utils/xFetch';\n\nvar express = require('express');\n\nexport const PRODUCT_STATUS = {\n '-9': '草稿',\n 0: '已删除',\n 1: '未发布',\n 5: '预热中',\n 11: '募集中',\n 17: '已暂停',\n 21: '已封账',\n 31: '已成立',\n}\n\nexport const productStatusToString = status => {\n return PRODUCT_STATUS[status] || '未定义';\n};\n\nexport function formatMoney(money = 0) {\n let ret;\n if (isNaN(money)) {\n ret = '0';\n } else if (money >= 1E10) {\n ret = (money / 1E10) + '亿';\n } else if (money >= 1E6) {\n ret = (money / 1E6) + '万';\n } else {\n ret = (money / 1E2);\n }\n return ret;\n}\n\n\nexport const leftPad = num => {\n return num >= 10 ? num : ('0' + num);\n};\n\nexport const formatDateTime = (time = 0, format = 'YYYY-MM-DD hh:mm:ss') => {\n const date = new Date(time);\n const data = {\n YYYY: date.getFullYear(),\n MM: leftPad(date.getMonth() + 1),\n DD: leftPad(date.getDate()),\n hh: leftPad(date.getHours()),\n mm: leftPad(date.getMinutes()),\n ss: leftPad(date.getSeconds())\n };\n return format.replace(/[A-Za-z]+/g, metch => {\n return data[metch];\n });\n};\n\n\nmodule.exports = function (req, res, next) {\n Promise.all([\n xFetch('https://m.fudou6.com/api/1.0/cate/cates.json'),\n xFetch('https://m.fudou6.com/api/1.0/prod/detail.json?itemId=' + req.params.id)\n ]).then((arr)=> {\n const {pCates} = arr[0];\n const {item} = arr[1];\n\n\n\n if (!item || !pCates) {\n var err = new Error('Not Found');\n err.status = 404;\n next(err);\n }\n\n\n pCates.forEach(cate=> {\n cate.subCates.forEach(scate=> {\n if (scate.id == item.categoryId) {\n item.categoryName = scate.name;\n item.categoryParentId = cate.id;\n item.categroyParentName = cate.name;\n }\n });\n });\n\n item.elements = JSON.parse(item.elements);\n\n Object.keys(item.elements).forEach(key=>{\n console.log('%s\\t%s\\t%s', key, item.elements[key][0], item.elements[key][1]);\n item.elements[key] = item.elements[key][1];\n });\n\n item.commissionAlg = JSON.parse(item.commissionAlg);\n\n item.commissionAlg = item.commissionAlg.map(it=> {\n const {sy, yj} = (it.result || {});\n return {\n rowspan:item.commissionAlg.length,\n range: (it.min ? formatMoney(it.min)+' ≤ ':'') + ' x ' + (it.max ? ' < '+formatMoney(it.max) : ''),\n min: it.min,\n max: it.max,\n sy, yj\n };\n });\n\n item.fundRaisedStartTimeString = item.fundRaisedStartTime && formatDateTime(item.fundRaisedStartTime);\n item.fundRaisedEndTimeString = item.fundRaisedEndTime && formatDateTime(item.fundRaisedEndTime);\n\n\n\n item.statusString = productStatusToString(item.status);\n\n //募集目标\n item.fundRaisedTargetString = formatMoney(item.fundRaisedTarget);\n //已募集\n item.fundRaisedOverString = formatMoney(item.fundRaisedOver);\n item.fundRaisedPercentage = item.fundRaisedOver / item.fundRaisedTarget * 100;\n //募集剩余\n item.fundRaisedSurplus = Math.max(item.fundRaisedTarget - item.fundRaisedOver, 0);\n\n item.fundRaisedSurplusString = formatMoney(item.fundRaisedSurplus);\n //最小投资\n item.minimumAmountString = formatMoney(item.minimumAmount);\n\n //console.log(item);\n\n res.render('product', {\n styles:['product'],\n scripts:['utils','product'],\n ...item\n });\n\n }).catch(err=> {\n console.log(err);\n next(err);\n });\n\n};\n"]}
\ No newline at end of file
import xFetch from '../utils/xFetch';
var express = require('express');
export const PRODUCT_STATUS = {
'-9': '草稿',
0: '已删除',
1: '未发布',
5: '预热中',
11: '募集中',
17: '已暂停',
21: '已封账',
31: '已成立',
}
export const productStatusToString = status => {
return PRODUCT_STATUS[status] || '未定义';
};
export function formatMoney(money = 0) {
let ret;
if (isNaN(money)) {
ret = '0';
} else if (money >= 1E10) {
ret = (money / 1E10) + '亿';
} else if (money >= 1E6) {
ret = (money / 1E6) + '万';
} else {
ret = (money / 1E2);
}
return ret;
}
export const leftPad = num => {
return num >= 10 ? num : ('0' + num);
};
export const formatDateTime = (time = 0, format = 'YYYY-MM-DD hh:mm:ss') => {
const date = new Date(time);
const data = {
YYYY: date.getFullYear(),
MM: leftPad(date.getMonth() + 1),
DD: leftPad(date.getDate()),
hh: leftPad(date.getHours()),
mm: leftPad(date.getMinutes()),
ss: leftPad(date.getSeconds())
};
return format.replace(/[A-Za-z]+/g, metch => {
return data[metch];
});
};
module.exports = function (req, res, next) {
Promise.all([
xFetch('https://m.fudou6.com/api/1.0/cate/cates.json'),
xFetch('https://m.fudou6.com/api/1.0/prod/detail.json?itemId=' + req.params.id)
]).then((arr)=> {
const {pCates} = arr[0];
const {item} = arr[1];
if (!item || !pCates) {
var err = new Error('Not Found');
err.status = 404;
next(err);
}
pCates.forEach(cate=> {
cate.subCates.forEach(scate=> {
if (scate.id == item.categoryId) {
item.categoryName = scate.name;
item.categoryParentId = cate.id;
item.categroyParentName = cate.name;
}
});
});
item.elements = JSON.parse(item.elements);
Object.keys(item.elements).forEach(key=>{
console.log('%s\t%s\t%s', key, item.elements[key][0], item.elements[key][1]);
item.elements[key] = item.elements[key][1];
});
item.commissionAlg = JSON.parse(item.commissionAlg);
item.commissionAlg = item.commissionAlg.map(it=> {
const {sy, yj} = (it.result || {});
return {
rowspan:item.commissionAlg.length,
range: (it.min ? formatMoney(it.min)+' ≤ ':'') + ' x ' + (it.max ? ' < '+formatMoney(it.max) : ''),
min: it.min,
max: it.max,
sy, yj
};
});
item.fundRaisedStartTimeString = item.fundRaisedStartTime && formatDateTime(item.fundRaisedStartTime);
item.fundRaisedEndTimeString = item.fundRaisedEndTime && formatDateTime(item.fundRaisedEndTime);
item.statusString = productStatusToString(item.status);
//募集目标
item.fundRaisedTargetString = formatMoney(item.fundRaisedTarget);
//已募集
item.fundRaisedOverString = formatMoney(item.fundRaisedOver);
item.fundRaisedPercentage = item.fundRaisedOver / item.fundRaisedTarget * 100;
//募集剩余
item.fundRaisedSurplus = Math.max(item.fundRaisedTarget - item.fundRaisedOver, 0);
item.fundRaisedSurplusString = formatMoney(item.fundRaisedSurplus);
//最小投资
item.minimumAmountString = formatMoney(item.minimumAmount);
//console.log(item);
res.render('product', {
styles:['product'],
scripts:['utils','product'],
...item
});
}).catch(err=> {
console.log(err);
next(err);
});
};
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['exports', 'isomorphic-fetch'], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require('isomorphic-fetch'));
} else {
var mod = {
exports: {}
};
factory(mod.exports, global.isomorphicFetch);
global.xFetch = mod.exports;
}
})(this, function (exports, fetch) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
// import cookie from 'js-cookie';
var errorMessages = function errorMessages(res) {
return res.status + ' ' + res.statusText;
};
function check401(res) {
if (res.status === 401) {
// location.href = '/login';
console.log('401');
}
return res;
}
function check404(res) {
if (res.status === 404) {
// location.href='/404';
return Promise.reject(errorMessages(res));
}
return res;
}
function jsonParse(res) {
return res.json().then(function (json) {
return _extends({}, res, { json: json });
}).catch(function (err) {
return _extends({}, res, { json: { status: 0, message: '数据加载错误!' } });
});
}
function errorMessageParse(res) {
var _res$json = res.json;
var status = _res$json.status;
var msg = _res$json.msg;
var message = _res$json.message;
var result = _res$json.result;
if (status != 1) {
return Promise.reject(msg || message);
}
return result;
}
function xFetch(url, options) {
var opts = _extends({}, options);
if (opts.method != 'GET') {
opts.headers = _extends({}, opts.headers, {
'content-type': 'application/x-www-form-urlencoded'
});
}
return fetch(url, opts).then(check401).then(check404).then(jsonParse).then(errorMessageParse);
}
exports.default = xFetch;
});
//# sourceMappingURL=xFetch.js.map
\ No newline at end of file
{"version":3,"sources":["xFetch.jsx"],"names":[],"mappings":";;2BAAqB,kB;;iCAAA,kB;;;;;;;;4BAAjB,K;;;;;;;;;;;;;;;;;;;;;AACJ;;AAEA,QAAM,gBAAgB,SAAhB,aAAgB,CAAC,GAAD;AAAA,eAAY,IAAI,MAAhB,SAA0B,IAAI,UAA9B;AAAA,KAAtB;;AAEA,aAAS,QAAT,CAAkB,GAAlB,EAAuB;AACnB,YAAI,IAAI,MAAJ,KAAe,GAAnB,EAAwB;AACpB;AACA,oBAAQ,GAAR,CAAY,KAAZ;AACH;AACD,eAAO,GAAP;AACH;;AAED,aAAS,QAAT,CAAkB,GAAlB,EAAuB;AACnB,YAAI,IAAI,MAAJ,KAAe,GAAnB,EAAwB;AACpB;AACA,mBAAO,QAAQ,MAAR,CAAe,cAAc,GAAd,CAAf,CAAP;AACH;AACD,eAAO,GAAP;AACH;;AAGD,aAAS,SAAT,CAAmB,GAAnB,EAAwB;AACpB,eAAO,IAAI,IAAJ,GAAW,IAAX,CAAgB;AAAA,gCAAa,GAAb,IAAkB,UAAlB;AAAA,SAAhB,EAA0C,KAA1C,CAAgD;AAAA,gCAAW,GAAX,IAAgB,MAAK,EAAC,QAAO,CAAR,EAAW,SAAS,SAApB,EAArB;AAAA,SAAhD,CAAP;AACH;;AAED,aAAS,iBAAT,CAA2B,GAA3B,EAAgC;AAAA,wBACW,IAAI,IADf;AAAA,YACrB,MADqB,aACrB,MADqB;AAAA,YACb,GADa,aACb,GADa;AAAA,YACR,OADQ,aACR,OADQ;AAAA,YACC,MADD,aACC,MADD;;AAE5B,YAAI,UAAU,CAAd,EAAiB;AACb,mBAAO,QAAQ,MAAR,CAAe,OAAO,OAAtB,CAAP;AACH;AACD,eAAO,MAAP;AACH;;AAED,aAAS,MAAT,CAAgB,GAAhB,EAAqB,OAArB,EAA8B;AAC1B,YAAM,oBAAW,OAAX,CAAN;;AAEA,YAAI,KAAK,MAAL,IAAe,KAAnB,EAA0B;AACtB,iBAAK,OAAL,gBACO,KAAK,OADZ;AAEI,gCAAgB;AAFpB;AAIH;;AAED,eAAO,MAAM,GAAN,EAAW,IAAX,EACF,IADE,CACG,QADH,EAEF,IAFE,CAEG,QAFH,EAGF,IAHE,CAGG,SAHH,EAIF,IAJE,CAIG,iBAJH,CAAP;AAMH;;sBAEc,M","file":"xFetch.js","sourcesContent":["var fetch = require('isomorphic-fetch');\n// import cookie from 'js-cookie';\n\nconst errorMessages = (res) => `${res.status} ${res.statusText}`;\n\nfunction check401(res) {\n if (res.status === 401) {\n // location.href = '/login';\n console.log('401');\n }\n return res;\n}\n\nfunction check404(res) {\n if (res.status === 404) {\n // location.href='/404';\n return Promise.reject(errorMessages(res));\n }\n return res;\n}\n\n\nfunction jsonParse(res) {\n return res.json().then(json => ({...res, json})).catch(err=> ({...res, json:{status:0, message: '数据加载错误!'}}));\n}\n\nfunction errorMessageParse(res) {\n const {status, msg, message, result} = res.json;\n if (status != 1) {\n return Promise.reject(msg || message);\n }\n return result;\n}\n\nfunction xFetch(url, options) {\n const opts = {...options};\n\n if (opts.method != 'GET') {\n opts.headers = {\n ...opts.headers,\n 'content-type': 'application/x-www-form-urlencoded'\n }\n }\n\n return fetch(url, opts)\n .then(check401)\n .then(check404)\n .then(jsonParse)\n .then(errorMessageParse);\n\n}\n\nexport default xFetch;\n"]}
\ No newline at end of file
var fetch = require('isomorphic-fetch');
// import cookie from 'js-cookie';
const errorMessages = (res) => `${res.status} ${res.statusText}`;
function check401(res) {
if (res.status === 401) {
// location.href = '/login';
console.log('401');
}
return res;
}
function check404(res) {
if (res.status === 404) {
// location.href='/404';
return Promise.reject(errorMessages(res));
}
return res;
}
function jsonParse(res) {
return res.json().then(json => ({...res, json})).catch(err=> ({...res, json:{status:0, message: '数据加载错误!'}}));
}
function errorMessageParse(res) {
const {status, msg, message, result} = res.json;
if (status != 1) {
return Promise.reject(msg || message);
}
return result;
}
function xFetch(url, options) {
const opts = {...options};
if (opts.method != 'GET') {
opts.headers = {
...opts.headers,
'content-type': 'application/x-www-form-urlencoded'
}
}
return fetch(url, opts)
.then(check401)
.then(check404)
.then(jsonParse)
.then(errorMessageParse);
}
export default xFetch;
...@@ -19,14 +19,15 @@ ...@@ -19,14 +19,15 @@
下载iPhone版 下载iPhone版
</a> </a>
<a class="qr-code" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.fudou6.app" target="_blank"> <a class="qr-code" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.fudou6.app" target="_blank">
<img src="https://res.fudou6.com/c/4/20160730/e9e5a+M6LGG5LyY5oqV5LiL6L295LqM57u056CB_280x280.png" width="124" alt=""> <img src="https://res.fudou6.com/c/4/20160730/e9e5a+M6LGG5LyY5oqV5LiL6L295LqM57u056CB_280x280.png" width="124"
alt="">
<span>扫描下载富豆APP</span> <span>扫描下载富豆APP</span>
</a> </a>
<div class="app-screen"></div> <div class="app-screen"></div>
<hr class="line-separate"/> <hr class="line-separate"/>
</div> </div>
<div class="character"> <div class="character">
<ul class="clear">z <ul class="clear">
{{#each character}} {{#each character}}
<li> <li>
<div> <div>
...@@ -95,7 +96,7 @@ ...@@ -95,7 +96,7 @@
<strong>{{this.raiseFunds}}</strong>亿<br/>募集资金 <strong>{{this.raiseFunds}}</strong>亿<br/>募集资金
</span> </span>
<span> <span>
<strong>{{this.maxProfits}}</strong><br/>客户收益 <strong>{{this.maxProfits}}</strong><br/>最高收益
</span> </span>
</div> </div>
<div> <div>
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<title>富豆优投</title> <title>富豆优投</title>
<link rel="icon" href="/favicon.ico"/> <link rel="icon" href="/favicon.ico"/>
<link rel="stylesheet" href="/stylesheets/style.css"/> <link rel="stylesheet" href="/stylesheets/style.css"/>
<link rel="stylesheet" href="/stylesheets/{{page}}.css"/> {{#each styles}}
<link rel="stylesheet" href="/stylesheets/{{this}}.css"/>
{{/each}}
</head> </head>
<body> <body>
<header id="header"> <header id="header">
...@@ -14,7 +16,7 @@ ...@@ -14,7 +16,7 @@
<nav class="clear"> <nav class="clear">
<span><a href="/">首页 / HOME</a></span> <span><a href="/">首页 / HOME</a></span>
<span><a href="/project">项目合作 / PROJECT</a></span> <span><a href="/project">项目合作 / PROJECT</a></span>
<span><a href="/product">最新产品 / PRODUCT</a></span> <span><a href="/products">最新产品 / PRODUCT</a></span>
<span><a href="/about">关于我们 / ABOUT</a></span> <span><a href="/about">关于我们 / ABOUT</a></span>
</nav> </nav>
</div> </div>
...@@ -30,6 +32,8 @@ ...@@ -30,6 +32,8 @@
<p class="copyright">Copyright2016 <span>shuniu</span> All Right Reserved&copy;2014-2015 杭州枢纽科技有限公司 版权所有</p> <p class="copyright">Copyright2016 <span>shuniu</span> All Right Reserved&copy;2014-2015 杭州枢纽科技有限公司 版权所有</p>
</footer> </footer>
<script src="/javascripts/jquery-1.8.3.min.js"></script> <script src="/javascripts/jquery-1.8.3.min.js"></script>
<script src="/javascripts/{{page}}.js"></script> {{#each scripts}}
<script src="/javascripts/{{this}}.js"></script>
{{/each}}
</body> </body>
</html> </html>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div class="intro"> <div class="intro">
<h2 class="info-title">XX证券-贵州同仁证券</h2> <h2 class="info-title">{{itemTitle}}</h2>
<table> <table>
<thead> <thead>
<tr> <tr>
...@@ -20,36 +20,30 @@ ...@@ -20,36 +20,30 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#each commissionAlg}}
<tr> <tr>
<td>300万≤x<1000</td> <td>{{range}}</td>
<td> <td>
<strong>6.4</strong>% <strong>{{sy}}</strong>%
</td> </td>
<td rowspan="2"> {{#unless @index}}
<a href="">登录富豆APP可见</a> <td rowspan={{rowspan}}>
</td> <a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.fudou6.app" target="_blank">登录富豆APP可见</a>
</tr>
<tr>
<td>1000万≤x</td>
<td>
<strong>6.2</strong>%
</td> </td>
{{/unless}}
</tr> </tr>
{{/each}}
</tbody> </tbody>
<tfoot>
<tr>
<td colspan="3">
<span>剩余额度:</span>
<span class="balance">200</span>
<span class="total">2000</span>
<p class="progress-bar"><i></i></p>
</td>
</tr>
</tfoot>
</table> </table>
<div> <div class="product-surplus clear">
<div class="huxian"></div> <span>剩余额度:</span>
<p>募集中</p> <span class="balance">{{fundRaisedOverString}}</span>
<span class="total">{{fundRaisedTargetString}}</span>
<p class="progress-bar"><i data-width="{{fundRaisedPercentage}}%"></i></p>
</div>
<div class="product-status">
<div class="huxian status-{{status}}"></div>
<p>{{statusString}}</p>
</div> </div>
</div> </div>
<div class="appointment"> <div class="appointment">
...@@ -80,79 +74,82 @@ ...@@ -80,79 +74,82 @@
<tbody> <tbody>
<tr> <tr>
<td>产品名称</td> <td>产品名称</td>
<td>XX证券-贵州同仁证券</td> <td>{{itemTitle}}</td>
</tr> </tr>
<tr> <tr>
<td>产品类别</td> <td>产品类别</td>
<td >集合信托</td> <td>{{categroyParentName}} / {{categoryName}}</td>
</tr> </tr>
<tr> <tr>
<td>产品状态</td> <td>产品状态</td>
<td >募集中</td> <td>{{statusString}}</td>
</tr> </tr>
<tr> <tr>
<td>剩余额度</td> <td>总规模</td>
<td >200万 / 2000万</td> <td>{{elements.zgm}}</td>
</tr> </tr>
<tr> <tr>
<td>投资门槛</td> <td>募集目标</td>
<td >100万</td> <td>{{fundRaisedTargetString}}</td>
</tr> </tr>
<tr> <tr>
<td>投资期限</td> <td>已募集</td>
<td >3+2年</td> <td>{{fundRaisedOverString}}</td>
</tr> </tr>
<tr> <tr>
<td>投资领域</td> <td>剩余额度</td>
<td >房地产类</td> <td>{{fundRaisedSurplusString}}</td>
</tr> </tr>
<tr> <tr>
<td>付息方式</td> <td>投资门槛</td>
<td >半年付息</td> <td>{{minimumAmountString}}</td>
</tr>
<tr>
<td>投资期限</td>
<td>{{duration}}</td>
</tr> </tr>
<tr> <tr>
<td>融资方</td> <td>融资方</td>
<td >XXX公司</td> <td>{{{elements.rzf}}}</td>
</tr> </tr>
<tr> <tr>
<td>担保方</td> <td>担保方</td>
<td >XXX公司</td> <td>{{{elements.dbzt}}}</td>
</tr>
<tr>
<td>发行方</td>
<td>{{{elements.fxf}}}</td>
</tr> </tr>
<tr> <tr>
<td>募集时间</td> <td>募集时间</td>
<td >2016/06/24 12:22:22 — 2016/07/24 12:22:22</td> <td>{{fundRaisedStartTimeString}}{{fundRaisedEndTimeString}}</td>
</tr> </tr>
<tr> <tr>
<td>资金用途</td> <td>资金用途</td>
<td > <td>{{{elements.zjyt}}}</td>
本合同项下的信托资金将由受托人纳入信托计划资金的范围,由受托人以自己的名义集合管理运用和处分,坚持稳健投资原则下获取利益最大化的理念,按照风险的权重,主要通过投资股权、股权收益权等方式,将信托资金投向民生工程、能源等行业的优质企业及项目,资金闲置期间,也可以债权、可转债、投资信托受益权的方式运用信托资金,或以有限合伙人身份加入专门从事投资业务的有限合伙企业等方式间接投资、于优质企业及项目,或投资于其他低风险且收益稳定、风险可控的产品及项目,以期为受益人获得良好的投资
收益。
</td>
</tr> </tr>
<tr> <tr>
<td>还款来源</td> <td>还款来源</td>
<td >中融信托主动管理项目下的投资回报。</td> <td>{{{elements.hkly}}}</td>
</tr> </tr>
<tr> <tr>
<td>风控措施</td> <td>风控措施</td>
<td> <td>{{{elements.fkcs}}}</td>
1、信托资金投向限制:本信托计划项下信托资金不得用于资金拆入、对外担保;不得将资金运用于房地产领域,不得直接投资于债券正回购、QDII产品(代理客户境外理财产品)黄金期货等商品期货、股指期权、股票期权等产品以及法律禁止投资的领域、对象;<br>2、流动性支持:次级受益人在其与受托人签署的《信托合同》项下同时承诺,在本信托计划存续期间,受托人认为信托财产专户内的现金资产不足以支付对应的支付日预计支付的信托费用、信托税费及预计应予分配的信托收益/信托利益金额或受托人调整信托计划项下优先级信托资金和次级信托资金比例的,次级受益人应以其自有资金随时追加认购次级信托单位
</td>
</tr> </tr>
<tr> <tr>
<td>项目亮点</td> <td>项目亮点</td>
<td >1、(从法律层面)《信托法》明确规定,信托公司因主动管理不善导致信托亏损,信托公司要付全责。所以主动管理型项目在任何一类信托项目中,它的受重视程度是最高的;<br>2、(从实力背景层面)主动管理型项目的融资主体就是信托公司,股东都是央企、国企、地方政府或者大型金融机构,所以信托公司作为融资主体比一般的实体企业都更具实力,况且在目前信托刚性兑付的大背景下,信托公司帮其他融资主体融的资金,在融资方不能按期兑付投资者本息的情况下,都是信托公司以自有资金垫付,然后再通过风控措施去处置抵押或者是质押物,而自主管理型信托融资主体是信托公司本身,信托项目到期信托公司更应该按时兑付投资者的本息,所以信托公司自主管理型项目是目前最安全的类型; <td>{{{summary}}}</td>
</td> </tr>
</tr> <!--<tr>-->
<tr> <!--<td>募集账号</td>-->
<td>募集账号</td> <!--<td>-->
<td> <!--<p>账户名:中融国际信托有限公司</p>-->
<p>账户名:中融国际信托有限公司</p> <!--<p>账号:【1003 4702 7350 010035】</p>-->
<p>账号:【1003 4702 7350 010035】</p> <!--<p>开户行:中国邮政储蓄银行有限责任公司黑龙江省分行直属支行</p>-->
<p>开户行:中国邮政储蓄银行有限责任公司黑龙江省分行直属支行</p> <!--<p>打款备注:xxx认购隆晟1号12个月</p>-->
<p>打款备注:xxx认购隆晟1号12个月</p> <!--</td>-->
</td> <!--</tr>-->
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
......
...@@ -10,115 +10,5 @@ ...@@ -10,115 +10,5 @@
</div> </div>
</div> </div>
<div class="tabs"> <div class="tabs">
<header> <div class="loading">正在努力加载中...</div>
<a>全部</a>
<a>资管</a>
<a>信托</a>
<a>私募</a>
</header>
<section>
<div>
<ul class="products">
<li class="status-1">
<i class="seal seal-{{seal}}"></i>
<div class="clear">
<div>
<h2>{{itemShortTitle}}</h2>
<h3>{{fundRaisedTarget}}</h3>
<div>
<span>{{commissionMaxDur}}</span>
<span>{{minimumAmount}}</span>
<span>{{duration}}</span>
</div>
</div>
<div>
<h4>项目亮点</h4>
<p>{{summary}}</p>
</div>
</div>
<i class="corner corner-{{status}}"></i>
</li>
<li class="status-2">
<i class="seal seal-{{seal}}"></i>
<div class="clear">
<div>
<h2>{{itemShortTitle}}</h2>
<h3>{{fundRaisedTarget}}</h3>
<div>
<span>{{commissionMaxDur}}</span>
<span>{{minimumAmount}}</span>
<span>{{duration}}</span>
</div>
</div>
<div>
<h4>项目亮点</h4>
<p>{{summary}}</p>
</div>
</div>
<i class="corner corner-{{status}}"></i>
</li>
<li class="status-3">
<i class="seal seal-{{seal}}"></i>
<div class="clear">
<div>
<h2>{{itemShortTitle}}</h2>
<h3>{{fundRaisedTarget}}</h3>
<div>
<span>{{commissionMaxDur}}</span>
<span>{{minimumAmount}}</span>
<span>{{duration}}</span>
</div>
</div>
<div>
<h4>项目亮点</h4>
<p>{{summary}}</p>
</div>
</div>
<i class="corner corner-{{status}}"></i>
</li>
<li class="status-4">
<i class="seal seal-{{seal}}"></i>
<div class="clear">
<div>
<h2>{{itemShortTitle}}</h2>
<h3>{{fundRaisedTarget}}</h3>
<div>
<span>{{commissionMaxDur}}</span>
<span>{{minimumAmount}}</span>
<span>{{duration}}</span>
</div>
</div>
<div>
<h4>项目亮点</h4>
<p>{{summary}}</p>
</div>
</div>
<i class="corner corner-{{status}}"></i>
</li>
<li class="status-5">
<i class="seal seal-{{seal}}"></i>
<div class="clear">
<div>
<h2>{{itemShortTitle}}</h2>
<h3>{{fundRaisedTarget}}</h3>
<div>
<span>{{commissionMaxDur}}</span>
<span>{{minimumAmount}}</span>
<span>{{duration}}</span>
</div>
</div>
<div>
<h4>项目亮点</h4>
<p>{{summary}}</p>
</div>
</div>
<i class="corner corner-{{status}}"></i>
</li>
</ul>
<ul class="pagination"></ul>
</div>
<div></div>
<div></div>
<div></div>
</section>
</div> </div>
\ No newline at end of file
...@@ -26,22 +26,22 @@ ...@@ -26,22 +26,22 @@
</li> </li>
</ul> </ul>
<hr class="line-separate"/> <hr class="line-separate"/>
<div class="introducer"> <form class="introducer">
<form id="introducer"> <h2>寻找优质项目介绍人</h2>
<h4>寻找优质项目介绍人</h4> <div class="clear">
<div> <label for="introducerMobile">联系方式:</label>
<span>联系方式:</span> <input type="text" id="introducerMobile" name="introducer-mobile" placeholder="填写您的联系方式"
<input type="text" id="introducerMobile" name="introducer-mobile" placeholder="填写您的联系方式" maxlength="11"/> maxlength="11"/>
</div>
<p class="error-phone"></p> <p class="error-phone"></p>
<div>
<span>项目描述:</span>
<textarea name="project-description" id="projectDescription" placeholder="详细写明您的项目需求 例如:项目时间、内容、合作意向。"></textarea>
</div> </div>
<div class="clear">
<label>项目描述:</label>
<textarea name="project-description" id="projectDescription"
placeholder="详细写明您的项目需求 例如:项目时间、内容、合作意向。"></textarea>
<p class="error-description"></p> <p class="error-description"></p>
</div>
<div><input type="submit" value="立即提交" disabled id="submit"/></div> <div><input type="submit" value="立即提交" disabled id="submit"/></div>
</form> </form>
</div>
</div> </div>
<div class="hot-project-address"> <div class="hot-project-address">
<div class="hot-project-address-box"> <div class="hot-project-address-box">
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<h3>180天 </h3> <h3>180天 </h3>
<h6>基础设施类</h6> <h6>基础设施类</h6>
<p>认购光大信托计划,用于“绿源公司”发放信托贷款,用于建设西安绿源农产品批发市场项目</p> <p>认购光大信托计划,用于“绿源公司”发放信托贷款,用于建设西安绿源农产品批发市场项目</p>
<img src="../public/images/hot_project/success.jpg"> <img src="/images/hot_project/success.jpg">
<b id="modalBoxHidden">&times;</b> <b id="modalBoxHidden">&times;</b>
</div> </div>
</div> </div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment