Browse Source

新增轮播

master
ltlzx 4 years ago
parent
commit
7b1f7fccbc
  1. 18
      src/views/contract/index.vue
  2. 19
      src/views/exchange/index.vue

18
src/views/contract/index.vue

@ -1,5 +1,12 @@
<template> <template>
<div class="contract-page"> <div class="contract-page">
<div class="banner-block col-xs-8">
<el-carousel :interval="6000" height="450px">
<el-carousel-item v-for="item in pcBannerList" :key="item.id">
<img :src="item.imgurl" width="100%" height="100%" />
</el-carousel-item>
</el-carousel>
</div>
<div class="page-top d-flex pt-2"> <div class="page-top d-flex pt-2">
<div class="kline-box flex-fill mr-2"> <div class="kline-box flex-fill mr-2">
<div <div
@ -194,6 +201,7 @@ import exchangeStore from "./exchange-store.vue";
import pageBottom from "./page-bottom.vue"; import pageBottom from "./page-bottom.vue";
import Contract from "../../api/contract"; import Contract from "../../api/contract";
import Socket from "@/api/server/Socket.js"; import Socket from "@/api/server/Socket.js";
import Home from "@/api/home";
export default { export default {
components: { components: {
kline, kline,
@ -209,6 +217,7 @@ export default {
holdPositionAll: false, holdPositionAll: false,
holdPositionList: [], holdPositionList: [],
newPriceObj: {}, newPriceObj: {},
pcBannerList:[],
accountInfo: {}, accountInfo: {},
defaultPrice: "", defaultPrice: "",
wsUrl: this.Globals.Server.Path.WS1, wsUrl: this.Globals.Server.Path.WS1,
@ -244,6 +253,7 @@ export default {
// this.openStatus(); // this.openStatus();
this.getMarketList(); this.getMarketList();
this.holdPosition(); this.holdPosition();
this.indexList();
this._time = setInterval(() => { this._time = setInterval(() => {
if (this.contractOpen) { if (this.contractOpen) {
this.holdPosition(); this.holdPosition();
@ -319,6 +329,14 @@ export default {
this.$message.success(this.$t('contract.j9')); this.$message.success(this.$t('contract.j9'));
}); });
}, },
indexList() {
Home.indexList().then((res) => {
this.pcBannerList = res.pcBannerList
setTimeout(() => {
this.skroll();
}, 100);
}).catch((res) => {});
},
// //
setactiveItem(index=0){ setactiveItem(index=0){
this.accountInfo=this.holdPositionList[index] this.accountInfo=this.holdPositionList[index]

19
src/views/exchange/index.vue

@ -1,5 +1,12 @@
<template> <template>
<div> <div>
<div class="banner-block col-xs-8">
<el-carousel :interval="6000" height="450px">
<el-carousel-item v-for="item in pcBannerList" :key="item.id">
<img :src="item.imgurl" width="100%" height="100%" />
</el-carousel-item>
</el-carousel>
</div>
<div class="container-fluid mtb15 no-fluid"> <div class="container-fluid mtb15 no-fluid">
<div class="row sm-gutters"> <div class="row sm-gutters">
@ -28,7 +35,7 @@ import Socket from '@/api/server/Socket.js';
import Market from '@/api/market.js'; import Market from '@/api/market.js';
import Exchange from "@/api/exchange"; import Exchange from "@/api/exchange";
import Order from "@/api/order" import Order from "@/api/order"
import Home from "@/api/home";
export default { export default {
components: { components: {
@ -59,6 +66,7 @@ export default {
}, },
marketList: [], // symbol marketList: [], // symbol
trade: [], trade: [],
pcBannerList:[],
newTrade: null, newTrade: null,
// //
@ -391,6 +399,14 @@ export default {
.catch(err => {}) .catch(err => {})
} }
}, },
indexList() {
Home.indexList().then((res) => {
this.pcBannerList = res.pcBannerList
setTimeout(() => {
this.skroll();
}, 100);
}).catch((res) => {});
},
}, },
created() { created() {
@ -462,6 +478,7 @@ export default {
}); });
}); });
if (this.symbol) this.getCurrencyExCny(); if (this.symbol) this.getCurrencyExCny();
this.indexList()
// this.update(); // this.update();
}, },

Loading…
Cancel
Save