到目前来说,vmarket数据模拟还是依旧处于原始手动的阶段,即使在年初做了parser解析器来生成数据结构,还是有不足。仔细考虑之下,目前依旧只有3种方案:
- 自动数据
- 半人肉数据
- 纯人肉数据
纯人肉自然不用说不在考虑之列。其余两种数据生成考虑方案,不论是否能成,还是先列一下。
{ | |
"success":true, | |
"errMsg":"", | |
"data":[ | |
{ | |
"itemId":"", | |
"title":"", //宝贝截断标题,一行内 | |
"pic":"", | |
"link":"", //detail链接 | |
"status":0, // 0未开始 1已经开始 2已结束 |
本身vmarket同步html到demo环境是完全可行的,唯一的不足就是会丢失参数和状态
假如vmarket传递vm模板那么量又会过大,那如果合并所有的vm之后是否可行? -> control这样就需要重复多次,虽然会比较麻烦,但是依旧似乎可以实时,然后把合并后的vm和数据文件传输到demo服务器,每次查看是通过vmarket服务器提供的渲染接口来返回html,不知道这样是否可行
{ | |
"autoBind": true, | |
"stopOnError": false, | |
"msg": { | |
"tpl": '<div class="msg {prefixCls}"><p class="{style}">{msg}</p></div>', | |
"style":{ | |
"success":'attention', | |
"error":'error' | |
} | |
}, |
var http = require('http'); | |
function getPort (cb) { | |
var server = http.createServer(); | |
server.listen(0); | |
server.on('listening', function() { | |
var port = server.address().port; | |
server.close(); | |
cb(port); | |
}); |
String.prototype.each=function(i,fun){ | |
var index=0; | |
var that=this; | |
while(index<=that.length){ | |
(fun||function(){})(that.substr(index,i)) | |
index+=i; | |
} | |
} | |
var exec=require('child_process').exec; | |
var iconv=require('./iconv-lite'); |
var h = setInterval(function(){ | |
console.log('start check'); | |
if($('#mi3Btn a')) { | |
console.log('check it'); | |
clearInterval(h); | |
$('#mi3Btn a').click(); | |
var tagName = $('#fkNumTxt .hide').tagName; | |
var n = $$('#fkNumTxt ' + tagName+':not(.hide)'); | |
if(n && n.length) { | |
$('#fkNum').value = n[0].innerText + n[1].innerText + n[2].innerText+ n[3].innerText; |