DESKTOP-CVS3R96\我恁爹
2022-11-14 f8b256ef152e54c19adb85856f62432d59c16b6e
src/page/list/trading-list.vue
@@ -11,8 +11,8 @@
                  <img src="../../assets/img/searchs.png" alt />
                </div>
                <div class="search_input">
                  <input type="text" class="searchs" placeholder="输入品种名称/代码搜索" ref="search" id="sousuo"
                    onkeyup="value=value.replace(/[^a-zA-Z0-9]/g,'')" v-model="gpcode" @input="gpinput" />
                  <input type="text" class="searchs" placeholder="输入品种名称/代码搜索" ref="search" id="sousuo" v-model="gpcode"
                    @input="gpinput" />
                </div>
              </div>
            </div>
@@ -44,10 +44,11 @@
              <span>{{ '最新价' }}</span>
            </div>
            <div class="item_title applies">
              <span v-show="tabsItemIndex != 3">{{ '涨跌幅' }}</span>
              <span v-show="tabsItemIndex == 3" style="width: 100%;text-align: center;">{{ '申购类型' }}</span>
              <span v-show="tabsItemIndex != 5">{{ '涨跌幅' }}</span>
              <span v-show="tabsItemIndex == 5" style="width: 100%;text-align: center;">{{ '申购类型' }}</span>
            </div>
          </div>
          <!-- 市场列表 -->
          <div class="list" :class="isToken == '' ? 'listHeight' : 'listHeights'">
            <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"
              :immediate-check="false">
@@ -55,53 +56,56 @@
                <div class="list_items">
                  <div class="item" v-for="(item, index) in listArr" :key="index"
                    @click="handleGoToKlineDetail(item, index)">
                    <div v-if="(tabsItemIndex == 3 && item.zt == 0) || tabsItemIndex != 3">
                    <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 != 3" class="shu"
                            <span v-show="tabsItemIndex != 5" class="shu"
                              :class="item.isOption == '1' ? 'shublue' : ''"></span>
                            <span v-show="tabsItemIndex == 3" class="shu hongse"></span>
                            <span v-show="tabsItemIndex == 5" class="shu hongse"></span>
                          </span>
                          <span class="title_color">
                            {{ tabsItemIndex == 3 ? item.name : tabsItemIndex ==
                                2 ? item.name : tabsItemIndex == 0 ? item.name : item.indexName
                          <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 == 3 ? item.stockType + item.code : tabsItemIndex == 2 ? item.gid :
                            {{ tabsItemIndex == 5 ? item.stockType + item.code : tabsItemIndex == 2 ? item.gid :
                                tabsItemIndex
                                  ==
                                  0 ? item.gid : item.indexCode
                                  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"
                          <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 == 3 ? Number(item.price).toFixed(2) :
                            {{ tabsItemIndex == 5 ? Number(item.price).toFixed(2) :
                                item.currentPoint
                            }}
                          </span>
                        </div>
                        <div class="bt">
                          <span v-if="tabsItemIndex == 3 || tabsItemIndex == 1">{{ tabsItemIndex == 3 ? 'Max:' +
                          <span v-if="tabsItemIndex == 5 || tabsItemIndex == 1">{{ tabsItemIndex == 5 ? 'Max:' +
                              Number(item.orderNumber) : '手续费:' + Number(item.transFee)
                          }}</span>
                          <span v-else>{{ item.today_min }}</span>
                        </div>
                      </div>
                      <div class="right_bs">
                        <div class="tp">
                          <span class="price_color" v-if="tabsItemIndex == 0 || tabsItemIndex == 2"
                        <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'">
@@ -116,13 +120,13 @@
                                Number(item.lastClose) * 100).toFixed(2) + '%'
                          }}
                        </span> -->
                          <div v-if="tabsItemIndex == 3" :class="item.type == 1 ? 'xgsgType' : 'xgsgTypeRed'">
                          <div v-if="tabsItemIndex == 5" :class="item.type == 1 ? 'xgsgType' : 'xgsgTypeRed'">
                            <!-- {{item.orderNumber}} -->
                            {{ item.type == 1 ? '新股申购' : '线下配售' }}
                          </div>
                        </div>
                        <div class="bt">
                          <div v-if="tabsItemIndex != 1 && tabsItemIndex != 3">{{ item.preclose_px }}</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>
@@ -161,24 +165,26 @@
            </div>
          </div>
          <!-- 自选列表 -->
          <div class="list zxlist">
            <van-list v-model="loadings" :finished="finisheds" finished-text="没有更多了" @load="onLoads"
              :immediate-check="false">
              <div class="van-clearfix">
                <div class="list_items">
                  <div class="item" v-for="(item, index) in listArrs" :key="item.indexCode">
                    <div class="left_title">
                      <div class="tp">
                  <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">{{ 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.stockCode }}</span>
                        <span>{{ item.stockGid }}</span>
                      </div>
                    </div>
                    <div class="center_price">
                    <div class="center_price" style="align-items: center;">
                      <div class="tp">
                        <span class="price_color">{{ item.nowPrice }}</span>
                      </div>
@@ -186,8 +192,8 @@
                        <span>{{ item.addTime }}</span>
                      </div>
                    </div>
                    <div class="right_bs">
                      <div class="tp">
                    <div class="right_bs" style="justify-content: flex-end;align-items: center;">
                      <div class="tp" >
                        <span class="price_color" :class="item.hcrate > 0 ? 'green' : 'red'">{{ item.hcrate }}</span>
                      </div>
                      <div class="bt">
@@ -217,15 +223,26 @@
              <div class="left">
                <span>{{ '余额' }}</span>
              </div>
              <div class="right">
              <div class="right" v-if="userData.length == 0">¥0.00</div>
              <div class="right" v-if="userData.length != 0">
                <span v-if="$store.state.userInfo.userAmt == undefined">¥0.00</span>
                <span v-if="$store.state.userInfo && tabsItemIndex == 1" style="white-space: nowarp;">
                  {{ '¥' + $store.state.userInfo.userIndexAmt
                  }}
                </span>
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 0"
                <span v-if="$store.state.userInfo.userAmt != undefined && (tabsItemIndex == 0)"
                  style="white-space: nowarp;">
                  {{ '¥ ' + $store.state.userInfo.userAmt
                  }}
                </span>
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 3"
                  style="white-space: nowarp;">
                  {{ '$ ' + (Number($store.state.userInfo.userAmt) / 7.1).toFixed(2)
                  }}
                </span>
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 4"
                  style="white-space: nowarp;">
                  {{ 'HK$ ' + (Number($store.state.userInfo.userAmt) / 0.9).toFixed(2)
                  }}
                </span>
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 2"
@@ -233,7 +250,7 @@
                  {{ '¥ ' + $store.state.userInfo.userAmt
                  }}
                </span>
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 3"
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 5"
                  style="white-space: nowarp;">
                  {{ '¥ ' + $store.state.userInfo.userAmt
                  }}
@@ -265,7 +282,7 @@
            </div>
          </div>
          <div class="bottom_price">
            <div>
            <div v-if="tabsItemIndex != 3 && tabsItemIndex != 4">
              <p v-if="this.$store.state.settingForm.indexDisplay && !this.$store.state.settingForm.futuresDisplay"
                class="account">
                ¥{{ $store.state.hide ? '****' : Number($store.state.userInfo.userAmt +
@@ -280,6 +297,58 @@
              </p>
              <p v-else-if="!this.$store.state.settingForm.indexDisplay && !this.$store.state.settingForm.futuresDisplay"
                class="account">¥{{ $store.state.hide ? '****' : Number($store.state.userInfo.userAmt).toFixed(2) }}</p>
              <!-- <p
                v-else-if="this.$store.state.settingForm.indexDisplay && this.$store.state.settingForm.futuresDisplay"
                class="account"
              >
                ¥{{ $store.state.hide ? '****' : Number($store.state.userInfo.userAmt +
                $store.state.userInfo.userIndexAmt + $store.state.userInfo.userFuturesAmt).toFixed(2)
                }}
              </p> -->
            </div>
            <div v-if="tabsItemIndex == 3">
              <p v-if="this.$store.state.settingForm.indexDisplay && !this.$store.state.settingForm.futuresDisplay"
                class="account">
                $ {{ $store.state.hide ? '****' : Number(Number($store.state.userInfo.userAmt +
                    $store.state.userInfo.userIndexAmt) / 7.1).toFixed(2)
                }}
              </p>
              <p v-else-if="!this.$store.state.settingForm.indexDisplay && this.$store.state.settingForm.futuresDisplay"
                class="account">
                $ {{ $store.state.hide ? '****' : Number(Number($store.state.userInfo.userAmt +
                    $store.state.userInfo.userFuturesAmt) / 7.1).toFixed(2)
                }}
              </p>
              <p v-else-if="!this.$store.state.settingForm.indexDisplay && !this.$store.state.settingForm.futuresDisplay"
                class="account">$ {{ Number($store.state.hide ? '****' :
                    Number($store.state.userInfo.userAmt) / 7.1).toFixed(2)
                }}</p>
              <!-- <p
                v-else-if="this.$store.state.settingForm.indexDisplay && this.$store.state.settingForm.futuresDisplay"
                class="account"
              >
                ¥{{ $store.state.hide ? '****' : Number($store.state.userInfo.userAmt +
                $store.state.userInfo.userIndexAmt + $store.state.userInfo.userFuturesAmt).toFixed(2)
                }}
              </p> -->
            </div>
            <div v-if="tabsItemIndex == 4">
              <p v-if="this.$store.state.settingForm.indexDisplay && !this.$store.state.settingForm.futuresDisplay"
                class="account">
                HK$ {{ $store.state.hide ? '****' : Number(Number($store.state.userInfo.userAmt +
                    $store.state.userInfo.userIndexAmt) / 0.9).toFixed(2)
                }}
              </p>
              <p v-else-if="!this.$store.state.settingForm.indexDisplay && this.$store.state.settingForm.futuresDisplay"
                class="account">
                HK$ {{ $store.state.hide ? '****' : Number(Number($store.state.userInfo.userAmt +
                    $store.state.userInfo.userFuturesAmt) / 0.9).toFixed(2)
                }}
              </p>
              <p v-else-if="!this.$store.state.settingForm.indexDisplay && !this.$store.state.settingForm.futuresDisplay"
                class="account">HK$ {{ $store.state.hide ? '****' :
                    Number(Number($store.state.userInfo.userAmt) / 0.9).toFixed(2)
                }}</p>
              <!-- <p
                v-else-if="this.$store.state.settingForm.indexDisplay && this.$store.state.settingForm.futuresDisplay"
                class="account"
@@ -306,10 +375,22 @@
                      $store.state.userInfo.allIndexFreezAmt) * indexSettingInfo.forceSellPercent).toFixed(2)
                }}
              </span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 3">
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 5">
                {{ $store.state.hide ? '****' : Number(($store.state.userInfo.enableAmt
                    +
                    $store.state.userInfo.allFreezAmt) * settingInfo.forceStopPercent).toFixed(2)
                }}
              </span>
              <span v-show="tabsItemIndex == 3">
                {{ $store.state.hide ? '****' : Number(Number(($store.state.userInfo.enableAmt
                    +
                    $store.state.userInfo.allFreezAmt) * Number(settingInfo.forceStopPercent)) / 7.1).toFixed(2)
                }}
              </span>
              <span v-show="tabsItemIndex == 4">
                {{ $store.state.hide ? '****' : Number(Number(Number($store.state.userInfo.enableAmt
                    +
                    $store.state.userInfo.allFreezAmt) * Number(settingInfo.forceStopPercent)) / 0.9).toFixed(2)
                }}
              </span>
              <span v-show="tabsItemIndex == 2">
@@ -333,7 +414,7 @@
              <span>
                {{ tabsItemIndex == 1 ? '指数' : tabsItemIndex == 0 ? '股票' : tabsItemIndex == 2 ? '股票' :
                    tabsItemIndex ==
                      3 ? '股票' : ''
                      5 ? '股票' : ''
                }}
              </span>
              <span>{{ '资产' }}</span>
@@ -342,7 +423,11 @@
          <div class="bottom_price">
            <div>
              <span v-show="tabsItemIndex == 1">{{ '¥ ' + $store.state.userInfo.userIndexAmt }}</span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.userAmt }}</span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 5">{{ '¥ ' + $store.state.userInfo.userAmt }}</span>
              <span v-show="tabsItemIndex == 3">{{ '$ ' + (Number($store.state.userInfo.userAmt) / 7.1).toFixed(2)
              }}</span>
              <span v-show="tabsItemIndex == 4">{{ 'HK$ ' + (Number($store.state.userInfo.userAmt) / 0.9).toFixed(2)
              }}</span>
              <span v-show="tabsItemIndex == 2">{{ '¥ ' + $store.state.userInfo.userAmt }}</span>
              <!-- <span v-show="tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.userFuturesAmt }}</span> -->
            </div>
@@ -357,7 +442,12 @@
          <div class="bottom_price">
            <div>
              <span v-show="tabsItemIndex == 1">{{ '¥ ' + $store.state.userInfo.enableIndexAmt }}</span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.enableAmt }}</span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 5">{{ '¥ ' + $store.state.userInfo.enableAmt
              }}</span>
              <span v-show="tabsItemIndex == 3">{{ '$ ' + (Number($store.state.userInfo.enableAmt) / 7.1).toFixed(2)
              }}</span>
              <span v-show="tabsItemIndex == 4">{{ 'HK$ ' + (Number($store.state.userInfo.enableAmt) / 0.9).toFixed(2)
              }}</span>
              <span v-show="tabsItemIndex == 2">{{ '¥ ' + $store.state.userInfo.enableAmt }}</span>
              <!-- <span v-show="tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.enableFuturesAmt }}</span> -->
            </div>
@@ -372,7 +462,13 @@
          <div class="bottom_price">
            <div>
              <span v-show="tabsItemIndex == 1">{{ '¥ ' + $store.state.userInfo.allIndexFreezAmt }}</span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.allFreezAmt
              <span v-show="tabsItemIndex == 0">{{ '¥ ' + $store.state.userInfo.allFreezAmt
              }}</span>
              <span v-show="tabsItemIndex == 5">{{ '¥ ' + $store.state.userInfo.djzj
              }}</span>
              <span v-show="tabsItemIndex == 3">{{ '$ ' + (Number($store.state.userInfo.allFreezAmt) / 7.1).toFixed(2)
              }}</span>
              <span v-show="tabsItemIndex == 4">{{ 'HK$ ' + (Number($store.state.userInfo.allFreezAmt) / 0.9).toFixed(2)
              }}</span>
              <span v-show="tabsItemIndex == 2">{{ '¥ ' + $store.state.userInfo.allFreezAmt }}</span>
              <!-- <span v-show="tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.allFuturesFreezAmt }}</span> -->
@@ -392,7 +488,15 @@
                v-show="tabsItemIndex == 1">{{ '¥ ' + $store.state.userInfo.allIndexProfitAndLose }}</span>
              <span
                :class="$store.state.userInfo.allProfitAndLose > 0 ? ' red' : $store.state.userInfo.allProfitAndLose < 0 ? ' green' : ''"
                v-show="tabsItemIndex == 0 || tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.allProfitAndLose
                v-show="tabsItemIndex == 0 || tabsItemIndex == 5">{{ '¥ ' + $store.state.userInfo.allProfitAndLose
                }}</span>
              <span
                :class="$store.state.userInfo.allProfitAndLose > 0 ? ' red' : $store.state.userInfo.allProfitAndLose < 0 ? ' green' : ''"
                v-show="tabsItemIndex == 3">{{ '$ ' + (Number($store.state.userInfo.allProfitAndLose) / 7.1).toFixed(2)
                }}</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)
                }}</span>
              <span
                :class="$store.state.userInfo.allProfitAndLose > 0 ? ' red' : $store.state.userInfo.allProfitAndLose < 0 ? ' green' : ''"
@@ -451,7 +555,6 @@
      </div>
    </van-popup>
  </div>
</template>
@@ -492,7 +595,9 @@
      rjsj: "",
      orderNumber: "",
      elAlertShow: false,
      userData: [],
      elAlertText: "",
      stockType: '',
      tabsClassArr: [
        {
          name: "沪深京",
@@ -512,13 +617,21 @@
        //   type: 3
        // }
        {
          name: "新股",
          name: "美股",
          type: 3
        },
        {
          name: "港股",
          type: 4
        },
        {
          name: "新股",
          type: 5
        }
      ],
      tabsItemIndex: 0,
      listArr: [],
      listArrs: []
      listArrs: [],
    };
  },
@@ -529,7 +642,7 @@
        this.$refs.search.focus();
      });
    }
    if(this.$route.query.listid){
    if (this.$route.query.listid) {
      this.tabsItemIndex = Number(this.$route.query.listid)
    }
  },
@@ -555,15 +668,29 @@
          break;
        case 0:
          this.stockPlate = "";
          this.stockType = "";
          this.loading = true;
          this.getStock();
          break;
        case 2:
          this.stockPlate = "科创";
          this.stockType = "";
          this.loading = true;
          this.getStocks();
          break;
        case 3:
          this.stockPlate = "";
          this.stockType = "us";
          this.loading = true;
          this.getStock();
          break;
        case 4:
          this.stockPlate = "";
          this.stockType = "hk";
          this.loading = true;
          this.getStock();
          break;
        case 5:
          this.loading = true;
          this.getFutures();
          break;
@@ -583,21 +710,32 @@
      this.listArr = [];
      this.loading = true;
      this.finished = false;
      this.stockType = '';
      switch (this.tabsItemIndex) {
        case 1:
          this.getListMarket();
          break;
        case 0:
          this.stockPlate = "";
          this.stockType = '';
          this.getStock();
          break;
        case 2:
          this.stockPlate = "科创";
          this.stockType = '';
          this.getStocks();
          break;
        case 3:
          this.stockPlate = "";
          this.stockType = 'us';
          this.getStock();
          break;
        case 4:
          this.stockPlate = "";
          this.stockType = 'hk';
          this.getStock();
          break;
        case 5:
          this.getFutures();
          break;
      }
@@ -623,9 +761,12 @@
      let data = await api.getUserInfo();
      if (data.status === 0) {
        // this.getProductSetting()
        this.$store.state.userInfo = data.data;
        this.userData = data.data;
      } else {
        this.$store.commit('elAlertShow', { 'elAlertShow': true, 'elAlertText': data.msg });
      }
      this.$store.state.user = this.user;
    },
@@ -682,7 +823,8 @@
        pageNum: this.pageNum,
        pageSize: 15,
        stockPlate: this.stockPlate,
        keyWords: this.gpcode
        keyWords: this.gpcode,
        stockType: this.stockType
      };
      let data = await api.getStock(opt);
      this.loading = false;
@@ -690,7 +832,7 @@
        if (data.data.list.length < 15) {
          this.finished = true;
        }
        if (this.tabsItemIndex == 0) {
        if (this.tabsItemIndex == 0 || this.tabsItemIndex == 3 || this.tabsItemIndex == 4) {
          if (this.gpcode) {
            this.listArr = data.data.list;
          } else {
@@ -733,6 +875,7 @@
        this.alertShow = true;
      }
    },
    popClose() {
      this.sgCode = '';
      this.sgsj = '';
@@ -771,29 +914,71 @@
      } else {
        Toast(data.msg);
      }
      if (navigator.vibrate) {
        // 支持
        navigator.vibrate([55]);
      }
    },
    handleGoToKlineDetail1(item) {
      var codes = item.stockCode;
      var names = item.stockName;
      var if_zhishu = '0';
      var if_us = item.stock_type == 'us' ? '1' : item.stock_type == 'hk' ? '2' : '';
      this.$router.push({
        path: "/kline",
        query: {
          name: names,
          code: codes,
          if_us: if_us,
          if_zhishu: if_zhishu,
          sok: item.type ? item.type : this.filterSH(item.stock_type),
          type: item.stock_type
        }
      });
    },
    //进入详情
    handleGoToKlineDetail(item) {
      if (this.userData.length == 0) {
        this.$store.commit('dialogVisible', true);
        return;
      }
      var codes = "";
      var names = "";
      var stock_type = "";
      var soks = "";
      var if_zhishu = '0';
      var if_us = '';
      switch (this.tabsItemIndex) {
        case 0:
          codes = item.code;
          names = item.name;
          stock_type = item.stock_type;
          soks = this.filterSH(item.stock_type);
          stock_type = item.stock_type == 'us' ? item.stock_type + 'a' : item.stock_type;
          soks = item.type ? item.type : this.filterSH(item.stock_type);
          if_zhishu = '0';
          if_us = item.stock_type == 'us' ? '1' : '';
          break;
        case 3:
          codes = item.code;
          names = item.name;
          stock_type = item.stock_type + 'a';
          if_us = '1';
          soks = item.type;
          if_zhishu = '0';
          break;
        case 4:
          codes = item.code;
          names = item.name;
          stock_type = item.stock_type;
          soks = item.type;
          if_zhishu = '0';
          if_us = '2';
          break;
        case 1:
          codes = item.indexGid;
          names = item.indexName;
          stock_type = 'sh';
          if_zhishu = item.indexCode;
          soks = 0;
          soks = item.type ? item.type : 0;
          break;
        case 2:
          codes = item.code;
@@ -802,7 +987,7 @@
          soks = this.filterSH(item.stock_type);
          if_zhishu = '0';
          break;
        case 3:
        case 5:
          this.sgCode = item.code;
          this.sgsj = item.subscribeTime;
          this.rjsj = item.subscriptionTime;
@@ -827,6 +1012,8 @@
          code: codes,
          type: stock_type,
          sok: soks,
          if_us: if_us,
          usType: item.type,
          if_zhishu: if_zhishu,
        }
      });
@@ -848,7 +1035,7 @@
      let data = await api.getNewGu(opt);
      this.loading = false;
      if (data.status === 0) {
        if (this.tabsItemIndex == 3) {
        if (this.tabsItemIndex == 5) {
          this.listArr = data.data.list;
        }
        this.finished = true;
@@ -900,6 +1087,10 @@
      }
    },
    handleTabsClick(item, index) {
      if (this.userData.length == 0) {
        this.$store.commit('dialogVisible', true);
        return;
      }
      if (index == 0) {
        if (this.dialogFlag) {
          this.$refs["topTitle"].style.height = "1.2821rem";
@@ -936,20 +1127,45 @@
        case 0:
          this.stockPlate = "";
          this.listArr = [];
          this.stockType = '';
          this.getStock();
          break;
        case 2:
          this.stockPlate = "科创";
          this.stockType = '';
          this.listArr = [];
          this.getStocks();
          break;
        case 3:
          this.stockPlate = "";
          this.stockType = 'us';
          this.listArr = [];
          this.getStock();
          break;
        case 4:
          this.stockPlate = "";
          this.stockType = 'hk';
          this.listArr = [];
          this.getStock();
          break;
        case 5:
          this.listArr = [];
          this.getFutures();
          break;
      }
      if (navigator.vibrate) {
        // 支持
        navigator.vibrate([55]);
      }
    },
    async options(val) {
      if(this.tabsItemIndex == 1){
        this.$message({
          message: '指数暂不支持自选!',
          type: 'warning'
        });
        return;
      }
      var codes = "";
      switch (this.tabsItemIndex) {
        case 0:
@@ -962,6 +1178,12 @@
          codes = val.code;
          break;
        case 3:
          codes = val.code;
          break;
        case 4:
          codes = val.code;
          break;
        case 5:
          codes = val.futuresGid;
          break;
        default:
@@ -981,6 +1203,7 @@
            case 0:
              this.stockPlate = "";
              this.pageNum = 1;
              this.stockType = '';
              this.loading = true;
              this.listArr = [];
              this.finished = false;
@@ -989,12 +1212,31 @@
            case 2:
              this.stockPlate = "科创";
              this.pageNum = 1;
              this.stockType = '';
              this.loading = true;
              this.listArr = [];
              this.finished = false;
              this.getStocks();
              break;
            case 3:
              this.stockPlate = "";
              this.stockType = 'us';
              this.pageNum = 1;
              this.loading = true;
              this.listArr = [];
              this.finished = false;
              this.getStock();
              break;
            case 4:
              this.stockPlate = "";
              this.stockType = 'hk';
              this.pageNum = 1;
              this.loading = true;
              this.listArr = [];
              this.finished = false;
              this.getStock();
              break;
            case 5:
              this.listArr = [];
              this.loading = true;
              this.pageNum = 1;
@@ -1018,6 +1260,7 @@
              break;
            case 0:
              this.stockPlate = "";
              this.stockType = '';
              this.pageNum = 1;
              this.finished = false;
              this.listArr = [];
@@ -1025,12 +1268,29 @@
              break;
            case 2:
              this.stockPlate = "科创";
              this.stockType = '';
              this.pageNum = 1;
              this.finished = false;
              this.listArr = [];
              this.getStocks();
              break;
            case 3:
              this.stockPlate = "";
              this.pageNum = 1;
              this.finished = false;
              this.stockType = 'us';
              this.listArr = [];
              this.getStock();
              break;
            case 4:
              this.stockPlate = "";
              this.stockType = 'hk';
              this.pageNum = 1;
              this.finished = false;
              this.listArr = [];
              this.getStock();
              break;
            case 5:
              this.listArr = [];
              this.pageNum = 1;
              this.finished = false;
@@ -1041,6 +1301,10 @@
          console.log(data.msg);
        }
      }
      if (navigator.vibrate) {
          // 支持
          navigator.vibrate([55]);
        }
    },
    async optionszx(val) {
      let data = await api.delOption({ code: val.stockGid });
@@ -1052,6 +1316,10 @@
      } else {
        console.log(data.msg);
      }
      if (navigator.vibrate) {
          // 支持
          navigator.vibrate([55]);
        }
    },
    async refreshList() {
      // 刷新指数
@@ -1069,6 +1337,10 @@
      item.collection = !item.collection;
    },
    openDialog() {
      if (this.userData.length == 0) {
        this.$store.commit('dialogVisible', true);
        return;
      }
      if (!this.dialogFlag) {
        this.$refs["topTitle"].style.height = "6.9rem";
      } else {
@@ -1078,6 +1350,13 @@
    }
  },
  filters: {
    getName(name) {
      if (name.length > 15) {
        return name.substring(0, 14);
      } else {
        return name;
      }
    },
    gettime(time) {
      if (!time) {
        return "";
@@ -1387,6 +1666,7 @@
          .bt {
            width: 100%;
            height: 30%;
          }
        }
      }
@@ -1432,6 +1712,7 @@
  .applies {
    width: 20%;
    justify-content: flex-end;
  }
}
@@ -1487,7 +1768,7 @@
  justify-content: flex-end;
  .content_money {
    width: 80%;
    // width: 80%;
    height: 80%;
  }
@@ -1526,6 +1807,7 @@
      margin-right: 0.1rem;
      min-width: 1.9rem;
      // padding-left: 0.2rem;
      span {
        font-weight: 600;
        text-align: right;
@@ -1615,6 +1897,10 @@
    align-items: center;
    padding-left: 0.5rem;
    p {
      font-weight: 600;
    }
    span {
      font-weight: 600;
    }