| | |
| | | <span class="red m-4">{{ chartData.netChange ? chartData.netChange : '--' }}</span> |
| | | <span class="red">{{ |
| | | chartData?.change_ratio ? `${chartData?.change_ratio}%` : "-" |
| | | }}</span> |
| | | }}</span> |
| | | </p> |
| | | </div> |
| | | <div class="flex-r"> |
| | |
| | | <span class="label">{{ $t("Change") }}</span> |
| | | <span class="value">{{ |
| | | chartData?.turnoverRate ? formatMoney(chartData?.turnoverRate) + "%" : "-" |
| | | }}</span> |
| | | }}</span> |
| | | </p> |
| | | <p class="flex"> |
| | | <span class="label">{{ $t("Forehead") }}</span> |
| | |
| | | <span class="time">{{ chartData?.market?.time_str }}</span> |
| | | <span>{{ |
| | | chartData?.market?.time_zone && $t(chartData?.market?.time_zone) |
| | | }}</span> |
| | | }}</span> |
| | | </p> |
| | | <section class="indicator-index-container"> |
| | | <div class="indicator-index-box"> |
| | |
| | | :class="[item.index === timeLabelActive ? 'active' : '']"> |
| | | {{ item.name }} |
| | | </li> |
| | | <!-- <li @click="handleClickMoreBtn">{{ t("更多") }}</li> --> |
| | | <li @click="handleClickMoreBtn">{{ t("更多") }}</li> |
| | | </ul> |
| | | </div> |
| | | <!-- <div class="flex-r"> |
| | |
| | | </section> |
| | | <section class="kline-container flex"> |
| | | <div class="chart-index"> |
| | | <fx-kline :height="400" :symbol="symbol" :isShowsolid="true" :chartType="chartType" v-if="symbol" |
| | | @data="onData" :key="`${symbol}-${timeValue}`" @loading="onLoading" /> |
| | | <fx-kline :height="400" :symbol="symbol" :isShowsolid="true" :chartType="chartType" v-if="symbol" @data="onData" |
| | | :key="`${symbol}-${timeValue}`" @loading="onLoading" /> |
| | | </div> |
| | | <div class="order-book-container" v-if="timeLabelActive === 0"> |
| | | <keep-alive> |
| | |
| | | class="flex justify-between mt-30"> |
| | | <span class="flex-1">{{ |
| | | item.current_time ? item.current_time : "--" |
| | | }}</span> |
| | | }}</span> |
| | | <span :class="item.direction === 'buy' ? 'text-green' : 'text-red'" class="flex-1">{{ item.direction === |
| | | "buy" ? $t("买入") : $t("卖出") }}</span> |
| | | <span :class="item.direction === 'buy' ? 'text-green' : 'text-red'" class="flex-1 flex-justify-center">{{ |
| | |
| | | } |
| | | const filterOne = ref([ |
| | | { name: t("分时"), paramsValue: "timeSharing", seconds: 1 * 60 * 1000, index: 0 }, |
| | | |
| | | { name: "1" + t("分"), paramsValue: "1day", seconds: 1 * 60 * 1000, index: 12 }, |
| | | { name: "15" + t("分"), paramsValue: "1week", seconds: 15 * 60 * 1000, index: 10 }, |
| | | { name: "30" + t("分"), paramsValue: "1mon", seconds: 30 * 60 * 1000, index: 9 }, |
| | | { name: "120" + t("分"), paramsValue: "1quarter", seconds: 2 * 60 * 60 * 1000, index: 7 }, |
| | | |
| | | { |
| | | name: "1" + t("天"), |
| | | paramsValue: "1year", |
| | | paramsValue: "1day", |
| | | seconds: 1 * 24 * 60 * 60 * 1000, |
| | | index: 1, |
| | | }, |
| | | |
| | | // { name: t('分时'), paramsValue: 'timeSharing', seconds: 1 * 60 * 1000, index: 0, }, |
| | | // { name: '1' + t('天'), paramsValue: '1day', seconds: 1 * 24 * 60 * 60 * 1000, index: 1, }, |
| | | // { name: '1' + t('周'), paramsValue: '1week', seconds: 7 * 24 * 60 * 60 * 1000, index: 2, }, |
| | | // { name: '1' + t('月'), paramsValue: '1mon', seconds: 30 * 24 * 60 * 60 * 1000, index: 3, }, |
| | | // { name: '5' + t('天'), paramsValue: '5day', seconds: 5 * 24 * 60 * 60 * 1000, index: 4, }, |
| | | // { name: t('season'), paramsValue: '1quarter', seconds: 3 * 30 * 24 * 60 * 60 * 1000, index: 5, }, |
| | | // { name: t('Year'), paramsValue: '1year', seconds: 12 * 30 * 24 * 60 * 60 * 1000, index: 6, }, |
| | | { |
| | | name: "1" + t("周"), |
| | | paramsValue: "1week", |
| | | seconds: 7 * 24 * 60 * 60 * 1000, |
| | | index: 2, |
| | | }, |
| | | { |
| | | name: "1" + t("月"), |
| | | paramsValue: "1mon", |
| | | seconds: 30 * 24 * 60 * 60 * 1000, |
| | | index: 3, |
| | | }, |
| | | { |
| | | name: "5" + t("天"), |
| | | paramsValue: "5day", |
| | | seconds: 5 * 24 * 60 * 60 * 1000, |
| | | index: 4, |
| | | }, |
| | | { |
| | | name: t("season"), |
| | | paramsValue: "1quarter", |
| | | seconds: 3 * 30 * 24 * 60 * 60 * 1000, |
| | | index: 5, |
| | | }, |
| | | { |
| | | name: t("Year"), |
| | | paramsValue: "1year", |
| | | seconds: 12 * 30 * 24 * 60 * 60 * 1000, |
| | | index: 6, |
| | | }, |
| | | ]); |
| | | |
| | | const filterTwo = ref([ |
| | | { name: '120' + t('分'), paramsValue: '120min', seconds: 2 * 60 * 60 * 1000, index: 7, }, |
| | | { name: '60' + t('分'), paramsValue: '60min', seconds: 1 * 60 * 60 * 1000, index: 8, }, |
| | | { name: '30' + t('分'), paramsValue: '30min', seconds: 30 * 60 * 1000, index: 9, }, |
| | | { name: '15' + t('分'), paramsValue: '15min', seconds: 15 * 60 * 1000, index: 10, }, |
| | | { name: '5' + t('分'), paramsValue: '5min', seconds: 5 * 60 * 1000, index: 11, }, |
| | | { name: '1' + t('分'), paramsValue: '1min', seconds: 1 * 60 * 1000, index: 12, }, |
| | | { name: "120" + t("分"), paramsValue: "120min", seconds: 2 * 60 * 60 * 1000, index: 7 }, |
| | | { name: "60" + t("分"), paramsValue: "60min", seconds: 1 * 60 * 60 * 1000, index: 8 }, |
| | | { name: "30" + t("分"), paramsValue: "30min", seconds: 30 * 60 * 1000, index: 9 }, |
| | | { name: "15" + t("分"), paramsValue: "15min", seconds: 15 * 60 * 1000, index: 10 }, |
| | | { name: "5" + t("分"), paramsValue: "5min", seconds: 5 * 60 * 1000, index: 11 }, |
| | | { name: "1" + t("分"), paramsValue: "1min", seconds: 1 * 60 * 1000, index: 12 }, |
| | | ]); |
| | | |
| | | const show = ref(false); |
| | |
| | | }; |
| | | const startDealsSocket = () => { |
| | | // 交易 |
| | | sockets.value.deals = new WebSocket(`${WS_URL}/3/${symbol.value}`); |
| | | sockets.value.deals = new WebSocket(`${WS_URL}/2/${symbol.value}`); |
| | | sockets.value.deals.onmessage = (evt) => { |
| | | const { data } = evt; |
| | | const { code, data: _data } = JSON.parse(data); |
| | | // todo: 数据有些问题 |
| | | if (code / 1 === 0) { |
| | | // deals.value = _data.data.slice(0, 17); |
| | | let asks = _data.asks.map(item => { |
| | | item.direction = 'sell' |
| | | return item |
| | | }) |
| | | let bids = _data.bids.map(item => { |
| | | item.direction = 'buy' |
| | | return item |
| | | }) |
| | | deals.value = [...asks.slice(0, 8), ...bids.slice(0, 9)] |
| | | deals.value = _data.data.slice(0, 17); |
| | | } |
| | | }; |
| | | }; |
| | |
| | | if (route.query.from === "trade") { |
| | | router.push(`/trade/index?tabActive=0&navActive=3`); |
| | | } else if (route.query.from === "hot") { |
| | | if (route.query.category) { |
| | | if(route.query.category){ |
| | | router.push(`/quotes/hotModules?typName=${route.query.typName}&category=${route.query.category}&tabIndex=${route.query.tabIndex}&symbolType=${route.query.symbolType}`); |
| | | } else { |
| | | }else{ |
| | | router.push(`/quotes/hotModules?typName=${route.query.typName}&tabIndex=${route.query.tabIndex}&symbolType=${route.query.symbolType}`); |
| | | } |
| | | |
| | | |
| | | } else if (route.query.isOptional == 1) { |
| | | router.push(`/optional/index`); |
| | | } else if (route.query.tabIndex) { |
| | | } else if(route.query.tabIndex){ |
| | | router.push(`/quotes/index?tabActive=${route.query.tabIndex}&symbolType=${route.query.symbolType}`) |
| | | } else { |
| | | }else { |
| | | onRoute("/quotes/index"); |
| | | } |
| | | }; |
| | |
| | | }; |
| | | |
| | | const onLoading = (val) => { |
| | | console.log(val, 'valsssss') |
| | | console.log(val,'valsssss') |
| | | isLoading.value = val |
| | | } |
| | | |