Browse Source

优化首页和合约

master
ltlzx 4 years ago
parent
commit
fb8db64dfb
  1. 2
      src/api/custom/Model.js
  2. 2
      src/views/contract/handicap.vue
  3. 15
      src/views/home/index.vue
  4. 38
      src/views/market/price-line.vue
  5. 39
      src/views/option/kline.vue

2
src/api/custom/Model.js

@ -353,4 +353,4 @@ class Model {
}
export default Model;
export default Model;

2
src/views/contract/handicap.vue

@ -190,7 +190,7 @@ export default {
this.linkSocket();
}
bus.$on('collapse', msg => {
console.info(msg)
// console.info(msg)
this.newPriceObj.price = msg.close;
this.$emit("input", this.newPriceObj);
});

15
src/views/home/index.vue

@ -237,11 +237,12 @@
> -->
<!-- <img src="../../assets/img/increace.png" class="td_img" alt="" v-show="item.increase * 1 >= 0">
<img src="../../assets/img/decreace.png" class="td_img" alt="" v-show="item.increase * 1 < 0"> -->
<svg width="109" height="39">
<!-- <svg width="109" height="39">
<g style="transform: translate(0, 10px)">
<path :d="item.line" :class="item.increase *1 <0 ?'path_decreace':'path_increace'"/>
</g>
</svg>
</svg> -->
<price-line :line="item.prices" :increase="item.increase" class="td_img"/>
</td>
<td>
<router-link :to="`/exchange/${item.symbol}`">
@ -420,10 +421,12 @@ import Socket from "@/api/server/Socket.js";
import College from "@/api/college";
import Member from "@/api/member";
import * as d3 from 'd3';
import priceLine from "../market/price-line";
// Vue.use(VueAwesomeSwiper);
export default {
components: {
vueQr,
priceLine
},
computed: {
@ -557,7 +560,7 @@ export default {
this.homeList = res.homeList;
this.marketList = res.marketList;
this.calculatePath()
// this.calculatePath()
this.iconList = res.iconList;
this.pcBannerList = res.pcBannerList
this.tab = this.marketList[0].coin_name;
@ -659,7 +662,7 @@ export default {
if (sub == "indexMarketList") {
this.marketList = data;
this.replaceOptional();
this.calculatePath()
// this.calculatePath()
} else if (type == "ping") {
ws.send({
cmd: "pong",
@ -708,7 +711,6 @@ created(){
this.indexList();
},
mounted() {
// this.calculatePath();
this.article()
if (this.isLogin) {
this.getCollect();
@ -1208,7 +1210,8 @@ path{
}
.td_img{
width: 109px;
height: 39px;
height: 39px !important;
margin: 0 auto;
}
.td_button{
width: 140px;

38
src/views/market/price-line.vue

@ -6,7 +6,7 @@
import Highcharts from "highcharts/highstock";
export default {
name: "price-line",
props: ['line'],
props: ['line','increase'],
data() {
return {
chart: undefined
@ -61,7 +61,8 @@ export default {
enabled: false
},
data: this.dataFilter(this.line),
color: "#00c162",
// color: "#00c162",
color: this.changeColors(),
fillColor: {
linearGradient: {
x1: 0,
@ -69,13 +70,38 @@ export default {
y1: 0,
y2: 1
},
stops: [
[0, "rgba(2,150,82,.5)"],
[1, "rgba(2,150,82,.2)"]
]
stops:this.changeColors1()
// stops: [
// [0, "rgba(2,150,82,.5)"],
// [1, "rgba(2,150,82,.2)"]
// ]
}
}, ]
});
},
changeColors(){
let col
if(this.increase * 1 >= 0 || !this.increase){
col='#00c162'
}else{
col="#ff0500"
}
return col
},
changeColors1(){
let col
if(this.increase * 1 >= 0 || !this.increase){
col=[
[0, "rgba(2,150,82,.5)"],
[1, "rgba(2,150,82,.2)"]
]
}else{
col=[
[0, "rgba(255,5,0,.5)"],
[1, "rgba(255,5,0,.2)"]
]
}
return col
}
},
mounted() {

39
src/views/option/kline.vue

@ -323,11 +323,19 @@ methods: {
// "header_widget_dom_node",
'timeframes_toolbar',
],
// enabled_features:['header_indicators'],
supported_resolutions: ["5", "15", "30", "60", "240", "1D", "1W", "1M"],
overrides: tvStyle[_this.theme],
custom_css_url: `/static/Kline/charting_library/static/css/tradingview_${
_this.theme == "light" ? "white" : "black"
}.css`,
drawings_access: {
type: "black",
tools: [
{ name: "Trend Line", grayed: true },
{ name: "Trend Angle", grayed: true }
]
},
}));
widget.onChartReady(function () {
let buttonArr = [
@ -408,7 +416,38 @@ methods: {
.find("div.button")
.removeClass("mydate");
};
widget.chart().createStudy(
"Moving Average",
false,
true,
[5, "close", 0],
null,
{
"Plot.color": "#e843da",
}
);
widget.chart().createStudy(
"Moving Average",
false,
true,
[10, "close", 0],
null,
{
"Plot.color": "#53b987",
}
);
widget.chart().createStudy(
"Moving Average",
false,
true,
[30, "close", 0],
null,
{
"Plot.color": "#ff231f",
}
);
});
},
},
mounted() {

Loading…
Cancel
Save