From c523ce0e8f371ed6c5a503eaa0a938b202daf8c2 Mon Sep 17 00:00:00 2001
From: DESKTOP-CVS3R96\我恁爹 <11>
Date: Tue, 15 Nov 2022 10:09:46 +0800
Subject: [PATCH] 吃屁护
---
src/page/list/trading-list.vue | 612 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 552 insertions(+), 60 deletions(-)
diff --git a/src/page/list/trading-list.vue b/src/page/list/trading-list.vue
index 5f98da4..0c3419a 100644
--- a/src/page/list/trading-list.vue
+++ b/src/page/list/trading-list.vue
@@ -52,7 +52,7 @@
<div class="list" :class="isToken == '' ? 'listHeight' : 'listHeights'">
<van-list v-model="loading" :finished="finished" :finished-text="$t('hj43')" @load="onLoad"
:immediate-check="false">
- <div class="van-clearfix">
+ <div v-if="tabsItemIndex == 0" class="van-clearfix">
<div class="list_items">
<div class="item" v-for="(item, index) in listArr" :key="index"
@click="handleGoToKlineDetail(item, index)">
@@ -135,7 +135,424 @@
</div>
</div>
</div>
+ <div v-if="tabsItemIndex==1" class="van-clearfix">
+ <div class="list_items">
+ <div class="item" v-for="(item, index) in listArr1" :key="index"
+ @click="handleGoToKlineDetail(item, index)">
+ <div v-if="(tabsItemIndex == 5 && item.zt == 0) || tabsItemIndex != 5">
+ <div class="left_title">
+ <div class="tp">
+ <span class="collection" @click.stop="options(item)">
+ <span v-show="tabsItemIndex != 5" class="shu"
+ :class="item.isOption == '1' ? 'shublue' : ''"></span>
+ <span v-show="tabsItemIndex == 5" class="shu hongse"></span>
+ </span>
+ <span class="title_color" style="white-space: nowrap;overflow: hidden;">
+ {{ tabsItemIndex == 5 ? item.name : tabsItemIndex ==
+ 2 ? item.name : tabsItemIndex == 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.name :
+ item.indexName | getName
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span>
+ {{ tabsItemIndex == 5 ? item.stockType + item.code : tabsItemIndex == 2 ? item.gid :
+ tabsItemIndex
+ ==
+ 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.gid : item.indexCode
+ }}
+ </span>
+ </div>
+ </div>
+ <div class="center_price">
+ <div class="tp">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">
+ {{ item.nowPrice
+ }}
+ </span>
+ <span class="price_color" v-else>
+ {{ tabsItemIndex == 5 ? Number(item.price).toFixed(2) :
+ item.currentPoint
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span v-if="tabsItemIndex == 5 || tabsItemIndex == 1">{{ tabsItemIndex == 5 ? 'Max:' +
+ Number(item.orderNumber) : $t('hj44') + ':' + Number(item.transFee)
+ }}</span>
+ <span v-else>{{ item.today_min }}</span>
+ </div>
+ </div>
+ <div class="right_bs">
+ <div class="tp" style="justify-content: flex-end;">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">{{ item.hcrate }}</span>
+ <span class="price_color" v-if="tabsItemIndex == 1"
+ :class="item.floatRate > 0 ? 'green' : 'red'">
+ {{
+ item.floatRate + '%'
+ }}
+ </span>
+ <!-- <span class="price_color" v-if="tabsItemIndex == 3"
+ :class="((item.nowPrice - item.lastClose) / item.lastClose * 100).toFixed(2) > 0 ? 'green' : 'red'">
+ {{
+ item.lastClose == "" ? 0.00 : ((Number(item.nowPrice) - Number(item.lastClose)) /
+ Number(item.lastClose) * 100).toFixed(2) + '%'
+ }}
+ </span> -->
+ <div v-if="tabsItemIndex == 5" :class="item.type == 1 ? 'xgsgType' : 'xgsgTypeRed'">
+ <!-- {{item.orderNumber}} -->
+ {{ item.type == 1 ? $t('hj45') : $t('hj46') }}
+ </div>
+ </div>
+ <div class="bt" style="justify-content: flex-end;">
+ <div v-if="tabsItemIndex != 1 && tabsItemIndex != 5">{{ item.preclose_px }}</div>
+ <!-- class="codeIcon" item.stock_type.toUpperCase()-->
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div v-if="tabsItemIndex==2" class="van-clearfix">
+ <div class="list_items">
+ <div class="item" v-for="(item, index) in listArr2" :key="index"
+ @click="handleGoToKlineDetail(item, index)">
+ <div v-if="(tabsItemIndex == 5 && item.zt == 0) || tabsItemIndex != 5">
+ <div class="left_title">
+ <div class="tp">
+ <span class="collection" @click.stop="options(item)">
+ <span v-show="tabsItemIndex != 5" class="shu"
+ :class="item.isOption == '1' ? 'shublue' : ''"></span>
+ <span v-show="tabsItemIndex == 5" class="shu hongse"></span>
+ </span>
+ <span class="title_color" style="white-space: nowrap;overflow: hidden;">
+ {{ tabsItemIndex == 5 ? item.name : tabsItemIndex ==
+ 2 ? item.name : tabsItemIndex == 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.name :
+ item.indexName | getName
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span>
+ {{ tabsItemIndex == 5 ? item.stockType + item.code : tabsItemIndex == 2 ? item.gid :
+ tabsItemIndex
+ ==
+ 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.gid : item.indexCode
+ }}
+ </span>
+ </div>
+ </div>
+ <div class="center_price">
+ <div class="tp">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">
+ {{ item.nowPrice
+ }}
+ </span>
+ <span class="price_color" v-else>
+ {{ tabsItemIndex == 5 ? Number(item.price).toFixed(2) :
+ item.currentPoint
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span v-if="tabsItemIndex == 5 || tabsItemIndex == 1">{{ tabsItemIndex == 5 ? 'Max:' +
+ Number(item.orderNumber) : $t('hj44') + ':' + Number(item.transFee)
+ }}</span>
+ <span v-else>{{ item.today_min }}</span>
+ </div>
+ </div>
+ <div class="right_bs">
+ <div class="tp" style="justify-content: flex-end;">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">{{ item.hcrate }}</span>
+ <span class="price_color" v-if="tabsItemIndex == 1"
+ :class="item.floatRate > 0 ? 'green' : 'red'">
+ {{
+ item.floatRate + '%'
+ }}
+ </span>
+ <!-- <span class="price_color" v-if="tabsItemIndex == 3"
+ :class="((item.nowPrice - item.lastClose) / item.lastClose * 100).toFixed(2) > 0 ? 'green' : 'red'">
+ {{
+ item.lastClose == "" ? 0.00 : ((Number(item.nowPrice) - Number(item.lastClose)) /
+ Number(item.lastClose) * 100).toFixed(2) + '%'
+ }}
+ </span> -->
+ <div v-if="tabsItemIndex == 5" :class="item.type == 1 ? 'xgsgType' : 'xgsgTypeRed'">
+ <!-- {{item.orderNumber}} -->
+ {{ item.type == 1 ? $t('hj45') : $t('hj46') }}
+ </div>
+ </div>
+ <div class="bt" style="justify-content: flex-end;">
+ <div v-if="tabsItemIndex != 1 && tabsItemIndex != 5">{{ item.preclose_px }}</div>
+ <!-- class="codeIcon" item.stock_type.toUpperCase()-->
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div v-if="tabsItemIndex==3" class="van-clearfix">
+ <div class="list_items">
+ <div class="item" v-for="(item, index) in listArr3" :key="index"
+ @click="handleGoToKlineDetail(item, index)">
+ <div v-if="(tabsItemIndex == 5 && item.zt == 0) || tabsItemIndex != 5">
+ <div class="left_title">
+ <div class="tp">
+ <span class="collection" @click.stop="options(item)">
+ <span v-show="tabsItemIndex != 5" class="shu"
+ :class="item.isOption == '1' ? 'shublue' : ''"></span>
+ <span v-show="tabsItemIndex == 5" class="shu hongse"></span>
+ </span>
+ <span class="title_color" style="white-space: nowrap;overflow: hidden;">
+ {{ tabsItemIndex == 5 ? item.name : tabsItemIndex ==
+ 2 ? item.name : tabsItemIndex == 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.name :
+ item.indexName | getName
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span>
+ {{ tabsItemIndex == 5 ? item.stockType + item.code : tabsItemIndex == 2 ? item.gid :
+ tabsItemIndex
+ ==
+ 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.gid : item.indexCode
+ }}
+ </span>
+ </div>
+ </div>
+ <div class="center_price">
+ <div class="tp">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">
+ {{ item.nowPrice
+ }}
+ </span>
+ <span class="price_color" v-else>
+ {{ tabsItemIndex == 5 ? Number(item.price).toFixed(2) :
+ item.currentPoint
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span v-if="tabsItemIndex == 5 || tabsItemIndex == 1">{{ tabsItemIndex == 5 ? 'Max:' +
+ Number(item.orderNumber) : $t('hj44') + ':' + Number(item.transFee)
+ }}</span>
+ <span v-else>{{ item.today_min }}</span>
+ </div>
+ </div>
+ <div class="right_bs">
+ <div class="tp" style="justify-content: flex-end;">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">{{ item.hcrate }}</span>
+ <span class="price_color" v-if="tabsItemIndex == 1"
+ :class="item.floatRate > 0 ? 'green' : 'red'">
+ {{
+ item.floatRate + '%'
+ }}
+ </span>
+ <!-- <span class="price_color" v-if="tabsItemIndex == 3"
+ :class="((item.nowPrice - item.lastClose) / item.lastClose * 100).toFixed(2) > 0 ? 'green' : 'red'">
+ {{
+ item.lastClose == "" ? 0.00 : ((Number(item.nowPrice) - Number(item.lastClose)) /
+ Number(item.lastClose) * 100).toFixed(2) + '%'
+ }}
+ </span> -->
+ <div v-if="tabsItemIndex == 5" :class="item.type == 1 ? 'xgsgType' : 'xgsgTypeRed'">
+ <!-- {{item.orderNumber}} -->
+ {{ item.type == 1 ? $t('hj45') : $t('hj46') }}
+ </div>
+ </div>
+ <div class="bt" style="justify-content: flex-end;">
+ <div v-if="tabsItemIndex != 1 && tabsItemIndex != 5">{{ item.preclose_px }}</div>
+ <!-- class="codeIcon" item.stock_type.toUpperCase()-->
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div v-if="tabsItemIndex==4" class="van-clearfix">
+ <div class="list_items">
+ <div class="item" v-for="(item, index) in listArr4" :key="index"
+ @click="handleGoToKlineDetail(item, index)">
+ <div v-if="(tabsItemIndex == 5 && item.zt == 0) || tabsItemIndex != 5">
+ <div class="left_title">
+ <div class="tp">
+ <span class="collection" @click.stop="options(item)">
+ <span v-show="tabsItemIndex != 5" class="shu"
+ :class="item.isOption == '1' ? 'shublue' : ''"></span>
+ <span v-show="tabsItemIndex == 5" class="shu hongse"></span>
+ </span>
+ <span class="title_color" style="white-space: nowrap;overflow: hidden;">
+ {{ tabsItemIndex == 5 ? item.name : tabsItemIndex ==
+ 2 ? item.name : tabsItemIndex == 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.name :
+ item.indexName | getName
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span>
+ {{ tabsItemIndex == 5 ? item.stockType + item.code : tabsItemIndex == 2 ? item.gid :
+ tabsItemIndex
+ ==
+ 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.gid : item.indexCode
+ }}
+ </span>
+ </div>
+ </div>
+ <div class="center_price">
+ <div class="tp">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">
+ {{ item.nowPrice
+ }}
+ </span>
+ <span class="price_color" v-else>
+ {{ tabsItemIndex == 5 ? Number(item.price).toFixed(2) :
+ item.currentPoint
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span v-if="tabsItemIndex == 5 || tabsItemIndex == 1">{{ tabsItemIndex == 5 ? 'Max:' +
+ Number(item.orderNumber) : $t('hj44') + ':' + Number(item.transFee)
+ }}</span>
+ <span v-else>{{ item.today_min }}</span>
+ </div>
+ </div>
+ <div class="right_bs">
+ <div class="tp" style="justify-content: flex-end;">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">{{ item.hcrate }}</span>
+ <span class="price_color" v-if="tabsItemIndex == 1"
+ :class="item.floatRate > 0 ? 'green' : 'red'">
+ {{
+ item.floatRate + '%'
+ }}
+ </span>
+ <!-- <span class="price_color" v-if="tabsItemIndex == 3"
+ :class="((item.nowPrice - item.lastClose) / item.lastClose * 100).toFixed(2) > 0 ? 'green' : 'red'">
+ {{
+ item.lastClose == "" ? 0.00 : ((Number(item.nowPrice) - Number(item.lastClose)) /
+ Number(item.lastClose) * 100).toFixed(2) + '%'
+ }}
+ </span> -->
+ <div v-if="tabsItemIndex == 5" :class="item.type == 1 ? 'xgsgType' : 'xgsgTypeRed'">
+ <!-- {{item.orderNumber}} -->
+ {{ item.type == 1 ? $t('hj45') : $t('hj46') }}
+ </div>
+ </div>
+ <div class="bt" style="justify-content: flex-end;">
+ <div v-if="tabsItemIndex != 1 && tabsItemIndex != 5">{{ item.preclose_px }}</div>
+ <!-- class="codeIcon" item.stock_type.toUpperCase()-->
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div v-if="tabsItemIndex==5" class="van-clearfix">
+ <div class="list_items">
+ <div class="item" v-for="(item, index) in listArr5" :key="index"
+ @click="handleGoToKlineDetail(item, index)">
+ <div v-if="(tabsItemIndex == 5 && item.zt == 0) || tabsItemIndex != 5">
+ <div class="left_title">
+ <div class="tp">
+ <span class="collection" @click.stop="options(item)">
+ <span v-show="tabsItemIndex != 5" class="shu"
+ :class="item.isOption == '1' ? 'shublue' : ''"></span>
+ <span v-show="tabsItemIndex == 5" class="shu hongse"></span>
+ </span>
+ <span class="title_color" style="white-space: nowrap;overflow: hidden;">
+ {{ tabsItemIndex == 5 ? item.name : tabsItemIndex ==
+ 2 ? item.name : tabsItemIndex == 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.name :
+ item.indexName | getName
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span>
+ {{ tabsItemIndex == 5 ? item.stockType + item.code : tabsItemIndex == 2 ? item.gid :
+ tabsItemIndex
+ ==
+ 0 || tabsItemIndex == 3 || tabsItemIndex == 4 ? item.gid : item.indexCode
+ }}
+ </span>
+ </div>
+ </div>
+ <div class="center_price">
+ <div class="tp">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">
+ {{ item.nowPrice
+ }}
+ </span>
+ <span class="price_color" v-else>
+ {{ tabsItemIndex == 5 ? Number(item.price).toFixed(2) :
+ item.currentPoint
+ }}
+ </span>
+ </div>
+ <div class="bt">
+ <span v-if="tabsItemIndex == 5 || tabsItemIndex == 1">{{ tabsItemIndex == 5 ? 'Max:' +
+ Number(item.orderNumber) : $t('hj44') + ':' + Number(item.transFee)
+ }}</span>
+ <span v-else>{{ item.today_min }}</span>
+ </div>
+ </div>
+ <div class="right_bs">
+ <div class="tp" style="justify-content: flex-end;">
+ <span class="price_color"
+ v-if="tabsItemIndex == 0 || tabsItemIndex == 2 || tabsItemIndex == 3 || tabsItemIndex == 4"
+ :class="item.hcrate > 0 ? 'green' : 'red'">{{ item.hcrate }}</span>
+ <span class="price_color" v-if="tabsItemIndex == 1"
+ :class="item.floatRate > 0 ? 'green' : 'red'">
+ {{
+ item.floatRate + '%'
+ }}
+ </span>
+ <!-- <span class="price_color" v-if="tabsItemIndex == 3"
+ :class="((item.nowPrice - item.lastClose) / item.lastClose * 100).toFixed(2) > 0 ? 'green' : 'red'">
+ {{
+ item.lastClose == "" ? 0.00 : ((Number(item.nowPrice) - Number(item.lastClose)) /
+ Number(item.lastClose) * 100).toFixed(2) + '%'
+ }}
+ </span> -->
+ <div v-if="tabsItemIndex == 5" :class="item.type == 1 ? 'xgsgType' : 'xgsgTypeRed'">
+ <!-- {{item.orderNumber}} -->
+ {{ item.type == 1 ? $t('hj45') : $t('hj46') }}
+ </div>
+ </div>
+ <div class="bt" style="justify-content: flex-end;">
+ <div v-if="tabsItemIndex != 1 && tabsItemIndex != 5">{{ item.preclose_px }}</div>
+ <!-- class="codeIcon" item.stock_type.toUpperCase()-->
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
</van-list>
+
+
</div>
</div>
<div class="bottom_content" v-if="tabsIndex === 0">
@@ -172,13 +589,17 @@
:immediate-check="false">
<div class="van-clearfix">
<div class="list_items">
- <div class="item" @click="handleGoToKlineDetail1(item, index)" v-for="(item, index) in listArrs" :key="item.indexCode">
+ <div class="item" @click="handleGoToKlineDetail1(item, index)" v-for="(item, index) in listArrs"
+ :key="item.indexCode">
<div class="left_title" style="flex-direction: column;align-items: flex-start;">
<div class="tp" style="display: flex;align-items: center;line-height: 2;">
<span class="collection" @click="optionszx(item)">
<span class="shu" :class="item.isOption == '1' ? 'shublue' : ''"></span>
</span>
- <span class="title_color" style="overflow: hidden;-webkit-line-clamp: 1;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;">{{ item.stockName }}</span>
+ <span class="title_color"
+ style="overflow: hidden;-webkit-line-clamp: 1;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;">{{
+ item.stockName
+ }}</span>
</div>
<div class="bt">
<span>{{ item.stockGid }}</span>
@@ -193,7 +614,7 @@
</div>
</div>
<div class="right_bs" style="justify-content: flex-end;align-items: center;">
- <div class="tp" >
+ <div class="tp">
<span class="price_color" :class="item.hcrate > 0 ? 'green' : 'red'">{{ item.hcrate }}</span>
</div>
<div class="bt">
@@ -496,7 +917,8 @@
}}</span>
<span
:class="$store.state.userInfo.allProfitAndLose > 0 ? ' red' : $store.state.userInfo.allProfitAndLose < 0 ? ' green' : ''"
- v-show="tabsItemIndex == 4">{{ 'HK$ ' + (Number($store.state.userInfo.allProfitAndLose) / 0.9).toFixed(2)
+ v-show="tabsItemIndex == 4">{{ 'HK$ ' + (Number($store.state.userInfo.allProfitAndLose) /
+ 0.9).toFixed(2)
}}</span>
<span
:class="$store.state.userInfo.allProfitAndLose > 0 ? ' red' : $store.state.userInfo.allProfitAndLose < 0 ? ' green' : ''"
@@ -515,23 +937,23 @@
<div class="setting_content">
<div class="old_password">
<div class="left_titles">
- <span>{{ $t('hj57') }}:</span>
+ <span>{{ $t('hj57') }}:</span>
</div>
<div class="right_password_input">
<input type="number" v-model="sgNum" />
</div>
</div>
<div class="btn_setting" @click="changeSg()">
- <span>{{ $t('hj58') }}</span>
+ <span>{{ $t('hj58') }}</span>
</div>
<div class="shijian">
<div class="xgsj">
- <div class="sjtlt">{{ $t('hj59') }}: </div>
+ <div class="sjtlt">{{ $t('hj59') }}: </div>
<div class="xgTime" v-if="this.sgsj">{{ this.sgsj | getTimeYear }}</div>
</div>
<div class="xgsj">
- <div class="sjtlt">{{ $t('hj60') }}: </div>
+ <div class="sjtlt">{{ $t('hj60') }}: </div>
<div class="xgTime" v-if="this.rjsj">{{ this.rjsj | getTimeYear }}</div>
</div>
</div>
@@ -562,6 +984,7 @@
//Toast
import { Toast } from 'vant';
import * as api from "@/axios/api";
+import handleDt from "@/utils/deTh";
export default {
name: "trading",
components: {
@@ -631,6 +1054,11 @@
],
tabsItemIndex: 0,
listArr: [],
+ listArr1:[],
+ listArr2:[],
+ listArr3:[],
+ listArr4:[],
+ listArr5:[],
listArrs: [],
};
},
@@ -682,13 +1110,13 @@
this.stockPlate = "";
this.stockType = "us";
this.loading = true;
- this.getStock();
+ this.getStockUs();
break;
case 4:
this.stockPlate = "";
this.stockType = "hk";
this.loading = true;
- this.getStock();
+ this.getStockHk();
break;
case 5:
this.loading = true;
@@ -704,10 +1132,15 @@
// this.finished = true;
// }
},
- gpinput() {
+ gpinput: handleDt.debounce(function() {
this.pageNum = 1;
this.listArr = [];
+ this.listArr1 = [];
+ this.listArr2 = [];
+ this.listArr3 = [];
+ this.listArr4 = [];
+ this.listArr5 = [];
this.loading = true;
this.finished = false;
this.stockType = '';
@@ -728,18 +1161,18 @@
case 3:
this.stockPlate = "";
this.stockType = 'us';
- this.getStock();
+ this.getStockUs();
break;
case 4:
this.stockPlate = "";
this.stockType = 'hk';
- this.getStock();
+ this.getStockHk();
break;
case 5:
this.getFutures();
break;
}
- },
+ }, 1000),
gpinputs() {
this.pageNums = 1;
this.listArrs = [];
@@ -799,7 +1232,7 @@
` this.$store.commit('elAlertShow',{'elAlertShow':true,'elAlertText': data.msg});`
}
},
- async getListMarket() {
+ getListMarket: handleDt.debounce(async function() {
let val = {
pageNum: this.pageNum,
pageSize: 15
@@ -809,15 +1242,15 @@
this.loading = false;
if (result.status === 0) {
if (this.tabsItemIndex == 1) {
- this.listArr = result.data;
+ this.listArr1 = result.data;
this.finished = true;
}
} else {
this.texts = result.msg;
this.alertShow = true;
}
- },
- async getStock() {
+ }, 500),
+ getStock: handleDt.debounce(async function() {
//沪深
let opt = {
pageNum: this.pageNum,
@@ -832,22 +1265,81 @@
if (data.data.list.length < 15) {
this.finished = true;
}
- if (this.tabsItemIndex == 0 || this.tabsItemIndex == 3 || this.tabsItemIndex == 4) {
+ if (this.tabsItemIndex == 0) {
if (this.gpcode) {
- this.listArr = data.data.list;
+
+ this.listArr = data.data.list;
+
} else {
data.data.list.forEach(element => {
- this.listArr.push(element);
+ this.listArr.push(element);
});
}
-
}
} else {
this.texts = data.msg;
this.alertShow = true;
}
- },
- async getStocks() {
+ }, 500),
+ getStockUs: handleDt.debounce(async function() {
+ //美股
+ let opt = {
+ pageNum: this.pageNum,
+ pageSize: 15,
+ stockPlate: this.stockPlate,
+ keyWords: this.gpcode,
+ stockType: this.stockType
+ };
+ let data = await api.getStock(opt);
+ this.loading = false;
+ if (data.status === 0) {
+ if (data.data.list.length < 15) {
+ this.finished = true;
+ }
+ if ( this.tabsItemIndex == 3) {
+ if (this.gpcode) {
+ this.listArr3 = data.data.list;
+ } else {
+ data.data.list.forEach(element => {
+ this.listArr3.push(element);
+ });
+ }
+ }
+ } else {
+ this.texts = data.msg;
+ this.alertShow = true;
+ }
+ },500) ,
+ getStockHk: handleDt.debounce(async function() {
+ //港股
+ let opt = {
+ pageNum: this.pageNum,
+ pageSize: 15,
+ stockPlate: this.stockPlate,
+ keyWords: this.gpcode,
+ stockType: this.stockType
+ };
+ let data = await api.getStock(opt);
+ this.loading = false;
+ if (data.status === 0) {
+ if (data.data.list.length < 15) {
+ this.finished = true;
+ }
+ if ( this.tabsItemIndex == 4) {
+ if (this.gpcode) {
+ this.listArr4 = data.data.list;
+ } else {
+ data.data.list.forEach(element => {
+ this.listArr4.push(element);
+ });
+ }
+ }
+ } else {
+ this.texts = data.msg;
+ this.alertShow = true;
+ }
+ },500) ,
+ getStocks: handleDt.debounce(async function() {
//科创
let opt = {
pageNum: this.pageNum,
@@ -863,10 +1355,10 @@
}
if (this.tabsItemIndex == 2) {
if (this.gpcode) {
- this.listArr = data.data.list;
+ this.listArr2 = data.data.list;
} else {
data.data.list.forEach(element => {
- this.listArr.push(element);
+ this.listArr2.push(element);
});
}
}
@@ -874,7 +1366,7 @@
this.texts = data.msg;
this.alertShow = true;
}
- },
+ },500),
popClose() {
this.sgCode = '';
@@ -1026,7 +1518,7 @@
}
},
- async getFutures() {
+ getFutures: handleDt.debounce(async function() {
// 获取期货列表
let opt = {
@@ -1036,14 +1528,14 @@
this.loading = false;
if (data.status === 0) {
if (this.tabsItemIndex == 5) {
- this.listArr = data.data.list;
+ this.listArr5 = data.data.list;
}
this.finished = true;
} else {
this.texts = data.msg;
this.alertShow = true;
}
- },
+ },500),
// async getFutures() {
// // 获取期货列表
// let opt = {
@@ -1121,7 +1613,7 @@
this.loading = true;
switch (item.type) {
case 1:
- this.listArr = [];
+ this.listArr1 = [];
this.getListMarket();
break;
case 0:
@@ -1133,23 +1625,23 @@
case 2:
this.stockPlate = "科创";
this.stockType = '';
- this.listArr = [];
+ this.listArr2 = [];
this.getStocks();
break;
case 3:
this.stockPlate = "";
this.stockType = 'us';
- this.listArr = [];
- this.getStock();
+ this.listArr3 = [];
+ this.getStockUs();
break;
case 4:
this.stockPlate = "";
this.stockType = 'hk';
- this.listArr = [];
- this.getStock();
+ this.listArr4 = [];
+ this.getStockHk();
break;
case 5:
- this.listArr = [];
+ this.listArr5 = [];
this.getFutures();
break;
}
@@ -1159,7 +1651,7 @@
}
},
async options(val) {
- if(this.tabsItemIndex == 1){
+ if (this.tabsItemIndex == 1) {
this.$message({
message: this.$t('hj71'),
type: 'warning'
@@ -1195,7 +1687,7 @@
switch (this.tabsItemIndex) {
case 1:
this.pageNum = 1;
- this.listArr = [];
+ this.listArr1 = [];
this.loading = true;
this.finished = false;
this.getListMarket();
@@ -1214,7 +1706,7 @@
this.pageNum = 1;
this.stockType = '';
this.loading = true;
- this.listArr = [];
+ this.listArr2 = [];
this.finished = false;
this.getStocks();
break;
@@ -1223,21 +1715,21 @@
this.stockType = 'us';
this.pageNum = 1;
this.loading = true;
- this.listArr = [];
+ this.listArr3 = [];
this.finished = false;
- this.getStock();
+ this.getStockUs();
break;
case 4:
this.stockPlate = "";
this.stockType = 'hk';
this.pageNum = 1;
this.loading = true;
- this.listArr = [];
+ this.listArr4 = [];
this.finished = false;
- this.getStock();
+ this.getStockHk();
break;
case 5:
- this.listArr = [];
+ this.listArr5 = [];
this.loading = true;
this.pageNum = 1;
this.finished = false;
@@ -1253,7 +1745,7 @@
if (data.status === 0) {
switch (this.tabsItemIndex) {
case 1:
- this.listArr = [];
+ this.listArr1 = [];
this.pageNum = 1;
this.finished = false;
this.getListMarket();
@@ -1271,7 +1763,7 @@
this.stockType = '';
this.pageNum = 1;
this.finished = false;
- this.listArr = [];
+ this.listArr2 = [];
this.getStocks();
break;
case 3:
@@ -1279,19 +1771,19 @@
this.pageNum = 1;
this.finished = false;
this.stockType = 'us';
- this.listArr = [];
- this.getStock();
+ this.listArr3 = [];
+ this.getStockUs();
break;
case 4:
this.stockPlate = "";
this.stockType = 'hk';
this.pageNum = 1;
this.finished = false;
- this.listArr = [];
- this.getStock();
+ this.listArr4 = [];
+ this.getStockHk();
break;
case 5:
- this.listArr = [];
+ this.listArr5 = [];
this.pageNum = 1;
this.finished = false;
this.getFutures();
@@ -1302,9 +1794,9 @@
}
}
if (navigator.vibrate) {
- // 支持
- navigator.vibrate([55]);
- }
+ // 支持
+ navigator.vibrate([55]);
+ }
},
async optionszx(val) {
let data = await api.delOption({ code: val.stockGid });
@@ -1317,9 +1809,9 @@
console.log(data.msg);
}
if (navigator.vibrate) {
- // 支持
- navigator.vibrate([55]);
- }
+ // 支持
+ navigator.vibrate([55]);
+ }
},
async refreshList() {
// 刷新指数
@@ -1666,7 +2158,7 @@
.bt {
width: 100%;
height: 30%;
-
+
}
}
}
--
Gitblit v1.9.3