document.addEventListener("DOMContentLoaded", function() {
|
//把对象赋值到JS中
|
try {
|
new QWebChannel(qt.webChannelTransport, function(channel) {
|
window.pyjs = channel.objects.Bridge;
|
console.log("回调成功");
|
});
|
} catch (e) {
|
|
}
|
});
|
|
var app;
|
$(function() {
|
|
function _resize() {
|
var code_info_height = 440
|
console.log("总高", $(window).height())
|
var bottom_height = $(window).height() - code_info_height - 140;
|
console.log("底部高", bottom_height)
|
$("#body>div:nth-child(3)>div").css("height", code_info_height).css("max-height", code_info_height);
|
$("#body>div:nth-child(4)").css("height", bottom_height)
|
$("#body>div:nth-child(4)>div:nth-child(2)").css("height", bottom_height - 10)
|
$("#body>div:nth-child(4)>div:nth-child(3)").css("height", bottom_height - 60)
|
$(".outer-container").css("height", bottom_height - 180)
|
}
|
//针对窗口高度做调整
|
_resize();
|
$(window).resize(function() {
|
_resize();
|
});
|
|
var layer;
|
layui.use('layer', function() {
|
layer = layui.layer;
|
});
|
|
var vConsole = new VConsole();
|
|
function request(params, callback) {
|
pyjs.request(params, function(result) {
|
callback(result);
|
});
|
}
|
|
function show_info(msg) {
|
pyjs.show_info(msg);
|
}
|
|
function is_trade_time() {
|
var nowdate = new Date();
|
h = nowdate.getHours();
|
m = nowdate.getMinutes();
|
total_m = h * 60 + m;
|
if ((total_m >= (9 * 60 + 25) && total_m <= (11 * 60 + 30)) || (total_m >= 13 * 60 && total_m <= 15 *
|
60)) {
|
return true;
|
} else {
|
return false;
|
}
|
}
|
|
setInterval(function() {
|
//非交易时间不刷新
|
if (is_trade_time()) {
|
app.get_limit_up_list(app.code, true);
|
}
|
}, 3000, 3000);
|
|
setInterval(function() {
|
if (is_trade_time()) {
|
app.get_industry_data(app.industry_data_type);
|
app.get_jingxuan_data(app.jingxuan_data_type);
|
}
|
}, 3000, 10000);
|
|
|
setInterval(function() {
|
if (is_trade_time()) {
|
app.get_kpl_market_feelings();
|
}
|
}, 3000, 3000);
|
|
setInterval(function() {
|
if (is_trade_time()) {
|
app.get_cb_list();
|
}
|
}, 3000, 3000);
|
|
|
|
|
|
|
|
function init() {
|
app = new Vue({
|
el: "#body",
|
data: {
|
code: "000000",
|
code_name: "----",
|
last_show_dialog: 0,
|
limit_up_search_key: '',
|
trade_data: {
|
order: 0
|
},
|
cb_list:[],// 可转债列表
|
cb_list_top:[],
|
cb_selected_code:'',
|
// 代码的开盘啦涨停原因
|
kpl_limit_up_reason: '',
|
default_score_data: {
|
volume: {
|
"score": 0,
|
"now": 0,
|
"high": {
|
"num": 0,
|
"date": "------"
|
},
|
"rate": 0
|
},
|
bidding: {
|
"score": 0,
|
"money": 0
|
},
|
deal_big_money: {
|
"score": 0,
|
"money": 0,
|
"base_money": 0,
|
"rate": 0
|
},
|
k_form: {
|
"score": 0,
|
"datas": []
|
},
|
code_nature: {
|
"score": 0,
|
"data": {
|
"limit_up_count": 0,
|
"first_limit_up_yijia": 0,
|
"first_open_limit_up_yijia": 0
|
}
|
},
|
hot_block: {
|
"score": 0,
|
"limit_up_index": 0,
|
"block_name": "----",
|
"limit_up_count": 0,
|
"block_history_count": 0,
|
"open_limit_up_count": 0
|
},
|
limit_up_time: {
|
"score": 0,
|
"time": "00:00:00"
|
},
|
zyltgb: {
|
"score": 0,
|
"value": "0.00"
|
},
|
limit_up_price: {
|
"score": 0,
|
"price": "0.00"
|
},
|
total_score: 0
|
},
|
score_data: {
|
volume: {
|
"score": 0,
|
"now": 0,
|
"high": {
|
"num": 0,
|
"date": "------"
|
},
|
"rate": 0
|
},
|
bidding: {
|
"score": 0,
|
"money": 0
|
},
|
deal_big_money: {
|
"score": 0,
|
"money": 0,
|
"base_money": 0,
|
"rate": 0
|
},
|
k_form: {
|
"score": 0,
|
"datas": [{
|
name: "---",
|
score: 0
|
}, {
|
name: "---",
|
score: 0
|
}]
|
},
|
code_nature: {
|
"score": 0,
|
"data": {
|
"limit_up_count": 0,
|
"first_limit_up_yijia": 0,
|
"first_open_limit_up_yijia": 0
|
}
|
},
|
hot_block: {
|
"score": 0,
|
"limit_up_index": 1,
|
"block_name": "测试板块",
|
"limit_up_count": 0,
|
"block_history_count": 0,
|
"open_limit_up_count": 0
|
},
|
limit_up_time: {
|
"score": 0,
|
"time": "00:00:00"
|
},
|
zyltgb: {
|
"score": 0,
|
"value": "0.00"
|
},
|
limit_up_price: {
|
"score": 0,
|
"price": "0.00"
|
},
|
total_score: 0
|
},
|
kpl_code_info: {
|
code_records: [
|
[
|
["原因", ''], "2020-01-01", [
|
["板块", '']
|
]
|
],
|
[
|
["原因", ''], "2020-01-01", [
|
["板块", '']
|
]
|
],
|
[
|
["原因", ''], "2020-01-01", [
|
["板块", '']
|
]
|
]
|
],
|
today: [
|
["涨停原因", ''], "2023-01-01", [
|
["传媒", '']
|
]
|
],
|
plate: [
|
["板块1", "1%", ''],
|
["板块2", "0.5%", '']
|
]
|
},
|
yesterday_block_info: {
|
reason: "测试",
|
data: {
|
yesterday: [
|
["000333", "美的集团"]
|
],
|
current: []
|
}
|
},
|
|
initiative_buy_codes: [{
|
"name": "美的集团",
|
"code": "000333",
|
"score": -777,
|
"limit_up": true,
|
"open_limit_up": false
|
}, {
|
"name": "美的集团",
|
"code": "000333",
|
"score": 0,
|
"limit_up": true,
|
"open_limit_up": false
|
}, {
|
"name": "美的集团",
|
"code": "000333",
|
"score": 0,
|
"limit_up": true,
|
"open_limit_up": false
|
}, {
|
"name": "美的集团",
|
"code": "000333",
|
"score": 0,
|
"limit_up": true,
|
"open_limit_up": false
|
}],
|
passive_buy_codes: [{
|
"name": "美的集团",
|
"code": "000333",
|
"score": 0,
|
"limit_up": true,
|
"open_limit_up": false
|
}],
|
industry_datas: [
|
["贵金属", "1.56亿", "0.9%"]
|
],
|
jingxuan_datas: [],
|
//涨停代码信息
|
first_info: {
|
limit_up_count: 10,
|
open_limit_up_count: 10,
|
limit_up_codes: [
|
//(代码,名称,涨停状态(0-无状态 1-涨停 2-炸板),龙几,首板,分值,涨停时间,原因,相同原因代码数量,自由流通,之前的板块)
|
["000333", "美的集团", 1, "龙1", "首板", "200", "10:00:00", "一季度增长", "1", "12.02亿",
|
'12亿', '', ''
|
]
|
]
|
},
|
//选中代码信息
|
choose_code_info: {
|
code: "123123",
|
//强度
|
plat_strength: [
|
["跨境电商", 3225]
|
],
|
code_records: [
|
["原因", "2020-01-01", "板块"],
|
["原因", "2020-01-01", "板块"]
|
],
|
today: ["涨停原因", "2023-01-01", "传媒"],
|
plate: [
|
["板块1", "1%"],
|
["板块2", "0.5%"]
|
],
|
code_list_info: [{
|
//(代码,名称,涨停状态(0-无状态 1-涨停 2-炸板),龙几,首板,分值,涨停时间,原因,相同原因代码数量,自由流通,涨停原因是否变化,涨幅,现价,黑名单,想买单,主力净值,300w,)
|
code_info: ["000333", "美的集团", 1, "龙1", "首板", "200", "10:00:00", "一季度增长",
|
"1", "12.02亿", 0, "10%", "10.23", "黑名单", "想买单", "10.99万",
|
"555万", "3000万"
|
],
|
plate: [
|
["板块1", "1%"],
|
["板块2", "0.5%"]
|
],
|
code_records: [
|
["板块", "2020-01-01"],
|
["板块", "2020-01-01"]
|
],
|
blocks: ["板块1", "板块2"]
|
}, {
|
//(代码,名称,涨停状态(0-无状态 1-涨停 2-炸板),龙几,首板,分值,涨停时间,原因,相同原因代码数量,自由流通,涨停原因是否变化,涨幅,现价,黑名单,想买单,主力净值,300w,)
|
code_info: ["000333", "美的集团", 1, "龙1", "首板", "200", "10:00:00", "一季度增长",
|
"1", "12.02亿", 0, "10%", "10.23", "黑名单", "想买单", "10.99万",
|
"555万", "3000万"
|
],
|
plate: [
|
["板块1", "1%"],
|
["板块2", "0.5%"]
|
],
|
code_records: [
|
["板块", "2020-01-01"],
|
["板块", "2020-01-01"]
|
],
|
blocks: ["板块1", "板块2"]
|
}, {
|
//(代码,名称,涨停状态(0-无状态 1-涨停 2-炸板),龙几,首板,分值,涨停时间,原因,相同原因代码数量,自由流通,涨停原因是否变化,涨幅,现价,黑名单,想买单,主力净值,300w,)
|
code_info: ["000333", "美的集团", 1, "龙1", "首板", "200", "10:00:00", "一季度增长",
|
"1", "12.02亿", 0, "10%", "10.23", "黑名单", "想买单", "10.99万",
|
"555万", "3000万"
|
],
|
plate: [
|
["板块1", "1%"],
|
["板块2", "0.5%"]
|
],
|
code_records: [
|
["板块", "2020-01-01"],
|
["板块", "2020-01-01"]
|
],
|
blocks: ["板块1", "板块2"]
|
}]
|
|
},
|
want_codes: [],
|
want_codes_plate: "",
|
choose_code: {
|
first: '',
|
second: ''
|
},
|
industry_data_type: -1,
|
jingxuan_data_type: 0,
|
// 选股宝涨停原因
|
xgb_limit_up_reasons: null,
|
// 市场情绪
|
market_feeling_info: {}
|
},
|
watch: {
|
want_codes: function() {
|
layer.open({
|
title: app.want_codes_plate,
|
type: 1,
|
content: $("#want_code_dialog"),
|
});
|
}
|
},
|
methods: {
|
refresh: function() {
|
if (app.origin_code) {
|
app.code = app.origin_code + "";
|
} else {
|
app.code = "000000"
|
}
|
init_data();
|
_resize();
|
},
|
limit_up_search: function() {
|
key = $("#limit_up_search_key").val();
|
app.limit_up_search_key = key;
|
},
|
//获取行业数据
|
get_industry_data: function(type) {
|
if (type < 0) {
|
return;
|
}
|
app.industry_data_type = type;
|
app.jingxuan_data_type = -1;
|
http_util.get_market_data(app.industry_data_type, function(result) {
|
result = JSON.parse(result);
|
if (result.code == 0) {
|
app.jingxuan_datas = result.data;
|
}
|
});
|
},
|
get_jingxuan_data: function(type) {
|
if (type < 0) {
|
return;
|
}
|
app.jingxuan_data_type = type;
|
app.industry_data_type = -1;
|
if (type == 0) {
|
type = 2;
|
} else {
|
type = 3;
|
}
|
|
http_util.get_market_data(type, function(result) {
|
result = JSON.parse(result);
|
if (result.code == 0) {
|
app.jingxuan_datas = result.data;
|
}
|
});
|
},
|
get_score_data: function(code, name, callback) {
|
console.log("获取分数数据:", code, name);
|
var date=$("#date").val();
|
http_util.get_score_data(code, name,date, function(res) {
|
res = JSON.parse(res)
|
console.log("分数请求结果:", res)
|
if (res.code == 0) {
|
console.log("获取分数", res)
|
app.code = res.data.code
|
app.code_name = res.data.code_name
|
if (res.data.score_data) {
|
app.score_data = res.data.score_data;
|
} else {
|
app.score_data = app.default_score_data;
|
}
|
if (res.data.trade_data) {
|
app.trade_data = {
|
order: res.data.trade_data.trade_state.order
|
}
|
} else {
|
res.data.trade_data = {
|
order: false
|
};
|
app.trade_data = res.data.trade_data
|
}
|
res.data.kpl_code_info.plate.forEach(function(e) {
|
var s = null;
|
if (app.first_info.limit_up_reason_statistic) {
|
for (var i = 0; i < app.first_info
|
.limit_up_reason_statistic
|
.length; i++) {
|
var limit_up_info = app.first_info.limit_up_reason_statistic[i];
|
if (limit_up_info[0] == e[1]) {
|
s = limit_up_info;
|
break;
|
}
|
}
|
}
|
e.push(s);
|
});
|
|
|
app.kpl_code_info = res.data.kpl_code_info;
|
app.initiative_buy_codes = res.data.initiative_buy_codes;
|
app.passive_buy_codes = res.data.passive_buy_codes;
|
|
//通知副屏改变内容
|
pyjs.set_trade_info(app.code, app.code_name, res.data
|
.trade_data ? JSON.stringify(res.data.trade_data) : "",
|
res.data.trade_record ? JSON.stringify(res.data
|
.trade_record) : '', res.data
|
.initiative_buy_codes ? JSON.stringify(res.data
|
.initiative_buy_codes) : '', res.data
|
.passive_buy_codes ? JSON.stringify(res.data
|
.passive_buy_codes) : '');
|
|
if (callback) {
|
callback()
|
}
|
}
|
});
|
},
|
get_limit_up_list: function(code, is_auto_refresh) {
|
day = $("#date").val();
|
http_util.get_limit_up_list(code,day, function(res) {
|
res = JSON.parse(res)
|
if (res.code == 0) {
|
app.first_info = res.data
|
var temps = new Array();
|
var current_limit_up_reason = null;
|
app.first_info.limit_up_reason_statistic.forEach(function(d) {
|
if (d[0] == app.kpl_limit_up_reason) {
|
current_limit_up_reason = d;
|
} else {
|
temps.push(d);
|
}
|
});
|
if (current_limit_up_reason) {
|
temps.unshift(current_limit_up_reason);
|
}
|
app.first_info.limit_up_reason_statistic = temps;
|
// if (app.choose_code.first) {
|
// app.get_plate_info(app.choose_code.first, is_auto_refresh);
|
// } else if (app.first_info.limit_up_codes) {
|
// app.choose_code.first = app.first_info.limit_up_codes[0][0];
|
// app.get_plate_info(app.first_info.limit_up_codes[0][0],
|
// is_auto_refresh);
|
// }
|
}
|
});
|
},
|
get_plate_info: function(code, is_auto_refresh) {
|
http_util.get_plate_info(code, function(res) {
|
res = JSON.parse(res)
|
console.log(res)
|
if (res.code == 0) {
|
app.choose_code_info = res.data
|
if (!is_auto_refresh) {
|
setTimeout(function() {
|
$(".outer-container").scrollTop(0);
|
}, 50);
|
} else {
|
//如果之前选中了某个票就不更新这个票的历史与板块
|
|
|
}
|
|
}
|
});
|
},
|
cancel_order: function() {
|
// if (!trade_data.order) {
|
// return;
|
// }
|
http_util.cancel_order(app.code, function() {
|
//撤单成功,刷新代码
|
app.get_score_data(app.code,null,null);
|
});
|
},
|
forbidden_plate: function(plate, type) {
|
http_util.forbidden_plate(plate, function(res) {
|
res = JSON.parse(res)
|
if (res.code == 0) {
|
layer.msg("删除成功");
|
if (type == 0) {
|
app.get_industry_data(app.industry_data_type);
|
} else {
|
app.get_jingxuan_data(app.jingxuan_data_type);
|
}
|
}
|
});
|
},
|
//选中1级代码
|
select_code_level_1: function(event, index) {
|
var el = event.currentTarget;
|
if (app.choose_code.first != app.first_info.limit_up_codes[index][0]) {
|
app.choose_code.first = app.first_info.limit_up_codes[index][0];
|
app.code = app.first_info.limit_up_codes[index][0];
|
app.code_name = app.code + "(" + app.first_info.limit_up_codes[index][1] +
|
")";
|
app.get_score_data(app.first_info.limit_up_codes[index][0], app.first_info
|
.limit_up_codes[index][1]);
|
app.get_plate_info(app.first_info.limit_up_codes[index][0]);
|
app.get_last_trade_day_reasons(app.first_info.limit_up_codes[index][0]);
|
}
|
},
|
//删除1级代码
|
del_code_level_1: function(index) {
|
http_util.add_ignore_code(1, app.first_info.limit_up_codes[index][0], function(
|
res) {
|
res = JSON.parse(res);
|
if (res.code == 0) {
|
if (app.first_info.limit_up_codes[index][0] == app.choose_code
|
.first) {
|
app.choose_code.first = '';
|
}
|
app.first_info.limit_up_codes.splice(index, 1);
|
}
|
});
|
},
|
//选中二级代码
|
select_code_level_2: function(event, index) {
|
if (app.choose_code_info.code_list_info[index].code_info[0] != app.choose_code
|
.second) {
|
console.log("选中二级代码:" + app.choose_code_info.code_list_info[index]
|
.code_info[0])
|
app.choose_code.second = app.choose_code_info.code_list_info[index]
|
.code_info[0];
|
app.get_score_data(app.choose_code_info.code_list_info[index].code_info[0],
|
app.choose_code_info.code_list_info[index].code_info[1],
|
function() {
|
app.choose_code_info.code_list_info[index].code_records = app
|
.kpl_code_info.code_records;
|
app.choose_code_info.code_list_info[index].plate = app
|
.kpl_code_info
|
.plate;
|
app.$set(app.choose_code_info.code_list_info, index, app
|
.choose_code_info.code_list_info[index]);
|
if (app.choose_code.second_info) {
|
//暂存选中二级代码数据
|
app.choose_code.second_info.code_records = app.kpl_code_info
|
.code_records;
|
app.choose_code.second_info.plate = app.kpl_code_info.plate;
|
}
|
|
});
|
app.get_last_trade_day_reasons(app.choose_code_info.code_list_info[index]
|
.code_info[0]);
|
}
|
},
|
//删除二级代码
|
del_code_level_2: function(index) {
|
http_util.add_ignore_code(2, app.choose_code_info.code_list_info[index]
|
.code_info[0],
|
function(res) {
|
res = JSON.parse(res);
|
if (res.code == 0) {
|
if (app.choose_code_info.code_list_info[index]
|
.code_info[0] == app.choose_code.second) {
|
app.choose_code.second = '';
|
app.choose_code.second_info = {};
|
}
|
|
app.choose_code_info.code_list_info.splice(index, 1);
|
}
|
});
|
|
return false;
|
},
|
//为代码做操作
|
do_action_for_code: function(type) {
|
var plate = "";
|
if (app.choose_code_info && app.choose_code_info.today) {
|
plate = app.choose_code_info.today[0]
|
}
|
|
http_util.do_action_for_code(app.code, plate, type, function(result) {});
|
},
|
set_target_code: function(code) {
|
console.log("设置目标代码", code);
|
app.origin_code = code;
|
app.code = code;
|
app.code_name = code;
|
app.first_info.limit_up_codes.forEach(function(e) {
|
if (e[0] == code) {
|
app.code_name = e[1] + " " + e[0];
|
}
|
});
|
http_util.get_xgb_limit_up_reasons(code, function(res) {
|
console.log("选股宝请求结果:", res);
|
res = JSON.parse(res)
|
if (res.code == 0) {
|
app.xgb_limit_up_reasons = res.data;
|
console.log(app.xgb_limit_up_reasons.reasons)
|
} else {
|
app.xgb_limit_up_reasons = null;
|
}
|
});
|
|
//请求板块
|
setTimeout(function() {
|
http_util.get_kpl_block_info(code, function(res) {
|
res = JSON.parse(res)
|
console.log("板块请求结果:", res);
|
if (res.code == 0) {
|
res.data.plate.forEach(function(e) {
|
var s = null;
|
if (app.first_info.limit_up_reason_statistic) {
|
for (var i = 0; i < app.first_info
|
.limit_up_reason_statistic
|
.length; i++) {
|
if (app.first_info
|
.limit_up_reason_statistic[
|
i][0] == e[1]) {
|
s = app.first_info.limit_up_reason_statistic[i];
|
break;
|
}
|
}
|
}
|
e.push(s);
|
});
|
|
|
app.kpl_code_info = res.data;
|
|
// 设置当日涨停原因
|
app.kpl_limit_up_reason = app.kpl_code_info.today[0]
|
[0];
|
// 将当前涨停原因置顶
|
var limit_up_reason_statistic = app.first_info
|
.limit_up_reason_statistic;
|
var current_limit_up_reason;
|
if (limit_up_reason_statistic) {
|
var temps = new Array();
|
limit_up_reason_statistic.forEach(function(d) {
|
if (d[0] == app
|
.kpl_limit_up_reason) {
|
current_limit_up_reason = d;
|
} else {
|
temps.push(d);
|
}
|
});
|
if (current_limit_up_reason) {
|
temps.unshift(current_limit_up_reason);
|
}
|
app.first_info.limit_up_reason_statistic =
|
temps;
|
}
|
|
}
|
});
|
app.get_last_trade_day_reasons(code);
|
}, 10);
|
|
this.set_selected_cb_top(true);
|
//init_data();
|
},
|
show_want_codes: function(plate) {
|
if (Date.now() - app.last_show_dialog < 500) {
|
return;
|
}
|
app.last_show_dialog = Date.now()
|
var day = $("#date").val();
|
http_util.get_plate_codes(plate,day, function(result) {
|
result = JSON.parse(result);
|
console.log("涨停原因成分股返回:", result);
|
var datas = result.data;
|
app.want_codes_title = plate;
|
app.want_codes = datas;
|
|
console.log("涨停原因成分股:", datas)
|
|
});
|
|
},
|
delete_from_want_codes: function(index) {
|
http_util.do_action_for_code(app.want_codes[index][0], "", 5,
|
function(result) {
|
if (result.code == 0) {
|
app.want_codes[index][2] = 0;
|
app.$set(app.want_codes, index, app.want_codes[index]);
|
app.get_limit_up_list(app.code, true);
|
}
|
});
|
},
|
get_last_trade_day_reasons: function(code) {
|
|
http_util.get_last_trade_day_reasons(code, function(res) {
|
res = JSON.parse(res);
|
console.log("板块今日表现:", res)
|
if (res.code == 0) {
|
app.yesterday_block_info = res.data;
|
} else {
|
app.yesterday_block_info = null;
|
}
|
});
|
},
|
get_kpl_market_feelings: function() {
|
http_util.get_kpl_market_feelings(function(res) {
|
console.log(res);
|
res = JSON.parse(res);
|
if (res.code == 0) {
|
app.market_feeling_info = res.data;
|
labels = [];
|
values = [];
|
colors = [];
|
res.data.map.forEach(function(e) {
|
labels.push(e[0]);
|
values.push(e[1]);
|
colors.push(e[2]);
|
});
|
console.log(colors);
|
if (!app.market_feeling_chart) {
|
app.market_feeling_chart = new Chart($(
|
"#market_feeling_chart"), {
|
type: 'bar',
|
data: {
|
labels: labels,
|
datasets: [{
|
label: '市场情绪',
|
data: values,
|
backgroundColor: colors,
|
}]
|
},
|
itemStyle: {
|
|
},
|
options: {
|
plugins: {
|
legend: {
|
display: false // 隐藏图例
|
},
|
},
|
scales: {
|
y: {
|
display: true
|
},
|
x: {
|
grid: {
|
display: false,
|
}
|
|
},
|
}
|
|
}
|
});
|
} else {
|
app.market_feeling_chart.data.labels = labels;
|
app.market_feeling_chart.data.datasets[0].data = values;
|
app.market_feeling_chart.data.datasets[0].backgroundColor =
|
colors;
|
app.market_feeling_chart.update();
|
}
|
|
|
}
|
});
|
},
|
add_or_remove_forbidden:function(event,code){
|
|
var el = event.currentTarget;
|
var checked = $(el).is(':checked');
|
console.log(code, checked);
|
if(checked){
|
http_util.do_action_for_code(code,'',0,function(res){
|
|
});
|
}else{
|
http_util.do_action_for_code(code,'',1,function(res){
|
|
});
|
}
|
|
},
|
get_cb_list:function(){
|
http_util.get_cb_list(function(res){
|
res = JSON.parse(res);
|
if(res.code==0){
|
app.cb_list = res.data;
|
var arr= new Array();
|
arr = arr.concat(res.data);
|
app.cb_list_top = arr;
|
app.set_selected_cb_top(true);
|
}
|
})
|
},
|
|
set_selected_cb_top:function(update_top){
|
var temp_list=app.cb_list;
|
for(var i=0;i<temp_list.length;i++){
|
if(temp_list[i][0][0] == app.cb_selected_code){
|
var data = temp_list[i];
|
temp_list.splice(i, 1);
|
temp_list.unshift(data);
|
app.cb_list = temp_list;
|
|
break;
|
}
|
}
|
if(update_top){
|
// 先变黄
|
// 置顶
|
var temp_list=app.cb_list_top;
|
for(var i=0;i<temp_list.length;i++){
|
if(temp_list[i][1][0] == app.code){
|
var data = temp_list[i];
|
temp_list.splice(i, 1);
|
temp_list.unshift(data);
|
app.cb_list_top = temp_list;
|
app.cb_selected_code = data[0][0];
|
break;
|
}
|
}
|
}
|
},
|
|
select_cb:function(data){
|
app.cb_selected_code = data[0][0];
|
this.set_selected_cb_top(false);
|
},
|
add_to_ths:function(code){
|
pyjs.add_code_to_ths(code);
|
}
|
}
|
});
|
}
|
|
function init_data() {
|
app.get_industry_data(app.industry_data_type);
|
app.get_jingxuan_data(app.jingxuan_data_type);
|
app.get_limit_up_list(app.code, false);
|
app.get_kpl_market_feelings();
|
app.get_cb_list();
|
}
|
|
$(".market .child-title").click(function() {
|
alert("test")
|
if ($(this).hasClass("child-title-active")) {
|
return;
|
}
|
console.log($(".child-title").index(this));
|
|
$(".child-title").removeClass("child-title-active");
|
$(this).addClass("child-title-active");
|
console.log("markets://" + $(".child-title").index(this))
|
window.location.href = "markets://" + $(".child-title").index(this);
|
});
|
|
$(".shoubanzuogundong tbody tr").click(function() {
|
if ($(this).hasClass("active")) {
|
return;
|
}
|
$(".shoubanzuogundong tbody tr").removeClass("active");
|
$(this).addClass("active");
|
|
// alert($(".shoubanzuogundong tbody tr").index(this));
|
});
|
|
$(".shoubanzuogundong tbody tr .delete").click(function() {
|
alert("删除" + $(".shoubanzuogundong tbody tr .delete").index(this));
|
return false;
|
});
|
init();
|
});
|