|
|
@ -19,6 +19,9 @@
|
|
|
|
<li role="presentation">
|
|
|
|
<li role="presentation">
|
|
|
|
<a href="#list_view" aria-controls="list_view" role="tab" data-toggle="tab">数据预览</a>
|
|
|
|
<a href="#list_view" aria-controls="list_view" role="tab" data-toggle="tab">数据预览</a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li role="presentation">
|
|
|
|
|
|
|
|
<a href="#config_view" aria-controls="list_view" role="tab" data-toggle="tab">配置中心</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-content">
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="handinput">
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="handinput">
|
|
|
@ -70,7 +73,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<div role="tabpanel" class="tab-pane" id="listinput">
|
|
|
|
<div role="tabpanel" class="tab-pane" id="listinput">
|
|
|
|
<div class="row" style="margin-top:10px;">
|
|
|
|
<div class="row" style="margin-top:10px;">
|
|
|
|
<div class="col-md-9">
|
|
|
|
<div class="col-md-7">
|
|
|
|
<select name="destination" class="form-control" id="destination">
|
|
|
|
<select name="destination" class="form-control" id="destination">
|
|
|
|
<option value="">选择站点</option>
|
|
|
|
<option value="">选择站点</option>
|
|
|
|
<option value="tp_Beijing">tp_Beijing</option>
|
|
|
|
<option value="tp_Beijing">tp_Beijing</option>
|
|
|
@ -79,15 +82,20 @@
|
|
|
|
<option value="train">train</option>
|
|
|
|
<option value="train">train</option>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<div class="col-md-7">
|
|
|
|
|
|
|
|
<select name="production" class="form-control" id="production">
|
|
|
|
|
|
|
|
<option value="">选择产品</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-7">
|
|
|
|
<select name="nums" class="form-control" id="pagenums">
|
|
|
|
<select name="nums" class="form-control" id="pagenums">
|
|
|
|
<option value="">选择抓取条数</option>
|
|
|
|
<option value="">选择抓取条数</option>
|
|
|
|
<option value="">1~10</option>
|
|
|
|
<option value="">1~5</option>
|
|
|
|
<option value="10">11~20</option>
|
|
|
|
<option value="5">6~10</option>
|
|
|
|
<option value="20">21~30</option>
|
|
|
|
<option value="10">11~15</option>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="col-md-3">
|
|
|
|
<a href="#" id="batchcontents" class="btn btn-info">批量抓取</a>
|
|
|
|
<a href="#" id="batchcontents" class="btn btn-info">批量抓取</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -113,6 +121,29 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="tabpanel" class="tab-pane" id="config_view">
|
|
|
|
|
|
|
|
<div class="row" style="margin-top:10px;">
|
|
|
|
|
|
|
|
<div class="col-md-5">
|
|
|
|
|
|
|
|
<select name="confg_destination" class="form-control" id="confg_destination">
|
|
|
|
|
|
|
|
<option value="">选择站点</option>
|
|
|
|
|
|
|
|
<option value="tp_Beijing">tp_Beijing</option>
|
|
|
|
|
|
|
|
<option value="tp_Shanghai">tp_Shanghai</option>
|
|
|
|
|
|
|
|
<option value="tp_Guilin">tp_Guilin</option>
|
|
|
|
|
|
|
|
<option value="train">train</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-5">
|
|
|
|
|
|
|
|
<input name="production_code" type="text" class="form-control" placeholder="请输入产品代号" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-11">
|
|
|
|
|
|
|
|
<input name="production_link" type="text" class="form-control" placeholder="请输入产品链接" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
|
|
|
|
<a href="#" id="addproduction" class="btn btn-info">添加产品</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -133,6 +164,7 @@ $(function(){
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_reviews_detail',
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_reviews_detail',
|
|
|
|
data:{url:ta_url},
|
|
|
|
data:{url:ta_url},
|
|
|
|
|
|
|
|
type:'POST',
|
|
|
|
success:function(json,status){
|
|
|
|
success:function(json,status){
|
|
|
|
var data = $.parseJSON(json);
|
|
|
|
var data = $.parseJSON(json);
|
|
|
|
console.log(data);
|
|
|
|
console.log(data);
|
|
|
@ -161,21 +193,64 @@ $(function(){
|
|
|
|
$('#batchcontents').click(function(){
|
|
|
|
$('#batchcontents').click(function(){
|
|
|
|
var destination = $('#destination').val();
|
|
|
|
var destination = $('#destination').val();
|
|
|
|
var pagenums = $('#pagenums').val();
|
|
|
|
var pagenums = $('#pagenums').val();
|
|
|
|
|
|
|
|
var product_links = $('#production').val();
|
|
|
|
|
|
|
|
var product_code = $('#production option:selected').text();
|
|
|
|
|
|
|
|
|
|
|
|
if(destination != ''){
|
|
|
|
if(destination != ''){
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_destination_reviews/'+destination+'/'+pagenums,
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_destination_reviews/',
|
|
|
|
|
|
|
|
data : {
|
|
|
|
|
|
|
|
destination : destination,
|
|
|
|
|
|
|
|
pagenum : pagenums,
|
|
|
|
|
|
|
|
product_links : product_links
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
type:'POST',
|
|
|
|
success:function(json,status){
|
|
|
|
success:function(json,status){
|
|
|
|
var data = $.parseJSON(json);
|
|
|
|
var data = $.parseJSON(json);
|
|
|
|
var html = '';
|
|
|
|
var html = '';
|
|
|
|
for(var x=0;x<data.urls.length;x++){
|
|
|
|
for(var x=0;x<data.urls.length;x++){
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_reviews_detail',
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_reviews_detail',
|
|
|
|
data:{url:data.urls[x],html_num:'list_'+x,destination:destination},
|
|
|
|
type:'POST',
|
|
|
|
|
|
|
|
data:{
|
|
|
|
|
|
|
|
url : data.urls[x],
|
|
|
|
|
|
|
|
html_num : 'list_'+x,
|
|
|
|
|
|
|
|
destination : destination,
|
|
|
|
|
|
|
|
product_links : product_links,
|
|
|
|
|
|
|
|
product_code : product_code
|
|
|
|
|
|
|
|
},
|
|
|
|
success:function(content,status){
|
|
|
|
success:function(content,status){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
error:function (){
|
|
|
|
|
|
|
|
alert('获取失败,请重试!');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
timeout:function(){
|
|
|
|
|
|
|
|
alert('请求超时,请重试!');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改目的地获取产品
|
|
|
|
|
|
|
|
$('#destination').on("change",function (){
|
|
|
|
|
|
|
|
var destination = $(this).val();
|
|
|
|
|
|
|
|
if(destination != ''){
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
url : '/info.php/apps/tripadvisor_spider/index/get_production_code',
|
|
|
|
|
|
|
|
data : {destination : destination},
|
|
|
|
|
|
|
|
type:'POST',
|
|
|
|
|
|
|
|
success : function (json,status){
|
|
|
|
|
|
|
|
var jsondata = $.parseJSON(json);
|
|
|
|
|
|
|
|
var options_html = '<option value="">选择产品</option>';
|
|
|
|
|
|
|
|
for (var i=0;i<jsondata.length;i++){
|
|
|
|
|
|
|
|
options_html += '<option value="'+jsondata[i].trc_links+'">'+jsondata[i].trc_code+'</option>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#production').html(options_html);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -192,7 +267,7 @@ $(function(){
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/analysis_excel',
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/analysis_excel',
|
|
|
|
data: formData,
|
|
|
|
data: formData,
|
|
|
|
type: 'post',
|
|
|
|
type: 'POST',
|
|
|
|
cache: false,
|
|
|
|
cache: false,
|
|
|
|
contentType: false,
|
|
|
|
contentType: false,
|
|
|
|
processData: false,
|
|
|
|
processData: false,
|
|
|
@ -224,6 +299,7 @@ $(function(){
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_reviews_detail',
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_reviews_detail',
|
|
|
|
data:{url:ta_url,html_num:num,destination:jsondata[i].list_data[j][0],group_name:jsondata[i].list_data[j][1],guidename:jsondata[i].list_data[j][2]},
|
|
|
|
data:{url:ta_url,html_num:num,destination:jsondata[i].list_data[j][0],group_name:jsondata[i].list_data[j][1],guidename:jsondata[i].list_data[j][2]},
|
|
|
|
|
|
|
|
type:'POST',
|
|
|
|
success:function(json_detail,status){
|
|
|
|
success:function(json_detail,status){
|
|
|
|
var data = $.parseJSON(json_detail);
|
|
|
|
var data = $.parseJSON(json_detail);
|
|
|
|
$('#excel_title_'+data.html_id).html(data.title);
|
|
|
|
$('#excel_title_'+data.html_id).html(data.title);
|
|
|
@ -268,6 +344,7 @@ $(function(){
|
|
|
|
if(view_destination != ''){
|
|
|
|
if(view_destination != ''){
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_all_reviews/'+view_destination,
|
|
|
|
url:'/info.php/apps/tripadvisor_spider/index/get_all_reviews/'+view_destination,
|
|
|
|
|
|
|
|
type:'POST',
|
|
|
|
success:function(json,status){
|
|
|
|
success:function(json,status){
|
|
|
|
var jsondata = $.parseJSON(json);
|
|
|
|
var jsondata = $.parseJSON(json);
|
|
|
|
var html = '';
|
|
|
|
var html = '';
|
|
|
@ -294,5 +371,36 @@ $(function(){
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加数据
|
|
|
|
|
|
|
|
$('#addproduction').click(function (){
|
|
|
|
|
|
|
|
var config_destination = $('#confg_destination').val();
|
|
|
|
|
|
|
|
var production_code = $('input[name="production_code"]').val();
|
|
|
|
|
|
|
|
var production_link = $('input[name="production_link"]').val();
|
|
|
|
|
|
|
|
$(this).addClass('disabled');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(config_destination && production_code && production_link){
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
url : '/info.php/apps/tripadvisor_spider/index/add_production/',
|
|
|
|
|
|
|
|
data : {
|
|
|
|
|
|
|
|
config_destination : config_destination,
|
|
|
|
|
|
|
|
production_code : production_code,
|
|
|
|
|
|
|
|
production_link : production_link
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
type:'POST',
|
|
|
|
|
|
|
|
success : function (json,status){
|
|
|
|
|
|
|
|
var jsondata = $.parseJSON(json);
|
|
|
|
|
|
|
|
$('#confg_destination').val('');
|
|
|
|
|
|
|
|
$('input[name="production_code"]').val('');
|
|
|
|
|
|
|
|
$('input[name="production_link"]').val('');
|
|
|
|
|
|
|
|
$('#addproduction').removeClass('disabled');
|
|
|
|
|
|
|
|
alert(jsondata.reason);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
alert('请输入完整参数');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|