XIGUASSR
2022-11-12 cf0d36bbe155ecdfd8bca429666405e830d0dc7a
src/page/list/trading-list.vue
@@ -11,29 +11,16 @@
                  <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"
                    onkeyup="value=value.replace(/[^a-zA-Z0-9]/g,'')" v-model="gpcode" @input="gpinput" />
                </div>
              </div>
            </div>
          </div>
          <div class="tab_class">
            <div class="scroll_tab">
              <div
                class="tab_items"
                v-for="(item, index) in tabsClassArr"
                :key="index"
                :class="index == 0 ? 'mrt' : ''"
                @click="handleTabsItem(item, index)"
              >
              <div class="tab_items" v-for="(item, index) in tabsClassArr" :key="index" :class="index == 0 ? 'mrt' : ''"
                @click="handleTabsItem(item, index)">
                <span :class="tabsItemIndex === index ? 'active' : ''">{{ item.name }}</span>
              </div>
            </div>
@@ -57,96 +44,89 @@
              <span>{{ '最新价' }}</span>
            </div>
            <div class="item_title applies">
              <span>{{ '涨跌幅' }}</span>
              <span v-show="tabsItemIndex != 3">{{ '涨跌幅' }}</span>
              <span v-show="tabsItemIndex == 3" 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"
            >
            <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"
              :immediate-check="false">
              <div class="van-clearfix">
                <div class="list_items">
                  <div class="item" v-for="(item, index) in listArr" :key="index" @click="handleGoToKlineDetail(item, index)">
                    <div class="left_title">
                      <div class="tp">
                        <span class="collection" @click.prevent="options(item)">
                          <span class="shu" :class="item.isOption == '1' ? 'shublue' : ''"></span>
                        </span>
                        <span class="title_color">
                          {{ tabsItemIndex == 3 ? item.futuresName : tabsItemIndex ==
                          2 ? item.name : tabsItemIndex == 0 ? item.name : item.indexName
                          }}
                        </span>
                  <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 class="left_title">
                        <div class="tp">
                          <span class="collection" @click.stop="options(item)">
                            <span v-show="tabsItemIndex != 3" class="shu"
                              :class="item.isOption == '1' ? 'shublue' : ''"></span>
                            <span v-show="tabsItemIndex == 3" class="shu hongse"></span>
                          </span>
                          <span class="title_color">
                            {{ tabsItemIndex == 3 ? item.name : tabsItemIndex ==
                                2 ? item.name : tabsItemIndex == 0 ? item.name : item.indexName
                            }}
                          </span>
                        </div>
                        <div class="bt">
                          <span>
                            {{ tabsItemIndex == 3 ? item.stockType + item.code : tabsItemIndex == 2 ? item.gid :
                                tabsItemIndex
                                  ==
                                  0 ? item.gid : item.indexCode
                            }}
                          </span>
                        </div>
                      </div>
                      <div class="bt">
                        <span>
                          {{ tabsItemIndex == 3 ? item.futuresCode : tabsItemIndex == 2 ? item.code : tabsItemIndex
                          ==
                          0 ? item.code : item.indexCode
                          }}
                        </span>
                      <div class="center_price">
                        <div class="tp">
                          <span class="price_color" v-if="tabsItemIndex == 0 || tabsItemIndex == 2"
                            :class="item.hcrate > 0 ? 'green' : 'red'">
                            {{ item.nowPrice
                            }}
                          </span>
                          <span class="price_color" v-else>
                            {{ tabsItemIndex == 3 ? Number(item.price).toFixed(2) :
                                item.currentPoint
                            }}
                          </span>
                        </div>
                        <div class="bt">
                          <span v-if="tabsItemIndex == 3 || tabsItemIndex == 1">{{ tabsItemIndex == 3 ? 'Max:' +
                              Number(item.orderNumber) : '手续费:' + Number(item.transFee)
                          }}</span>
                          <span v-else>{{ item.today_min }}</span>
                        </div>
                      </div>
                    </div>
                    <div class="center_price">
                      <div class="tp">
                        <span
                          class="price_color"
                          v-if="tabsItemIndex == 0 || tabsItemIndex == 2"
                          :class="item.hcrate > 0 ? 'green' : 'red'"
                        >
                          {{ item.nowPrice
                          }}
                        </span>
                        <span class="price_color" v-else>
                          {{ tabsItemIndex == 3 ? Number(item.nowPrice).toFixed(2) :
                          item.currentPoint
                          }}
                        </span>
                      </div>
                      <div class="bt">
                        <span
                          v-if="tabsItemIndex == 3 || tabsItemIndex == 1"
                        >{{ '手续费:' + 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"
                          :class="item.hcrate > 0 ? 'green' : 'red'"
                        >{{ item.hcrate }}</span>
                        <span
                          class="price_color"
                          v-if="tabsItemIndex == 1"
                          :class="item.floatRate > 0 ? 'green' : 'red'"
                        >
                      <div class="right_bs">
                        <div class="tp">
                          <span class="price_color" v-if="tabsItemIndex == 0 || tabsItemIndex == 2"
                            :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.floatRate + '%'
                              item.lastClose == "" ? 0.00 : ((Number(item.nowPrice) - Number(item.lastClose)) /
                                Number(item.lastClose) * 100).toFixed(2) + '%'
                          }}
                        </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>
                        </span> -->
                          <div v-if="tabsItemIndex == 3" :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>
                          <!-- class="codeIcon"  item.stock_type.toUpperCase()-->
                        </div>
                      </div>
                      <div class="bt">
                        <div
                          v-if="tabsItemIndex != 1 && tabsItemIndex != 3"
                        >{{ item.stock_type.toUpperCase() }}</div>
                        <!-- class="codeIcon" -->
                      </div>
                    </div>
                  </div>
                </div>
@@ -163,14 +143,8 @@
                  <img src="../../assets/img/searchs.png" alt />
                </div>
                <div class="search_input">
                  <input
                    type="text"
                    class="searchs"
                    placeholder="输入品种名称/代码搜索"
                    onkeyup="value=value.replace(/[^a-zA-Z0-9]/g,'')"
                    v-model="gpcodes"
                    @input="gpinputs"
                  />
                  <input type="text" class="searchs" placeholder="输入品种名称/代码搜索"
                    onkeyup="value=value.replace(/[^a-zA-Z0-9]/g,'')" v-model="gpcodes" @input="gpinputs" />
                </div>
              </div>
            </div>
@@ -188,13 +162,8 @@
          </div>
          <div class="list zxlist">
            <van-list
              v-model="loadings"
              :finished="finisheds"
              finished-text="没有更多了"
              @load="onLoads"
              :immediate-check="false"
            >
            <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">
@@ -203,15 +172,15 @@
                        <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">{{ item.stockName }}</span>
                      </div>
                      <div class="bt">
                        <span>{{ item.stockCode}}</span>
                        <span>{{ item.stockCode }}</span>
                      </div>
                    </div>
                    <div class="center_price">
                      <div class="tp">
                        <span class="price_color">{{item.nowPrice}}</span>
                        <span class="price_color">{{ item.nowPrice }}</span>
                      </div>
                      <div class="bt">
                        <span>{{ item.addTime }}</span>
@@ -219,10 +188,7 @@
                    </div>
                    <div class="right_bs">
                      <div class="tp">
                        <span
                          class="price_color"
                          :class="item.hcrate > 0 ? 'green' : 'red'"
                        >{{ item.hcrate }}</span>
                        <span class="price_color" :class="item.hcrate > 0 ? 'green' : 'red'">{{ item.hcrate }}</span>
                      </div>
                      <div class="bt">
                        <!-- <div>{{ item.stock_type.toUpperCase() }}</div> -->
@@ -241,12 +207,7 @@
    <div class="top_title" ref="topTitle">
      <div>
        <div class="tabs_title">
          <div
            class="tb"
            v-for="(item, index) in tabsArr"
            :key="index"
            @click="handleTabsClick(item, index)"
          >
          <div class="tb" v-for="(item, index) in tabsArr" :key="index" @click="handleTabsClick(item, index)">
            <span :class="index === tabsIndex ? 'active' : ''">{{ item }}</span>
          </div>
        </div>
@@ -257,38 +218,35 @@
                <span>{{ '余额' }}</span>
              </div>
              <div class="right">
                <span v-if="$store.state.userInfo.userAmt==undefined">¥0.00</span>
                <span v-if="$store.state.userInfo&&tabsItemIndex == 1" style="white-space: nowarp;">
                <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"
                  style="white-space: nowarp;"
                >
                <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 == 2"
                  style="white-space: nowarp;"
                >
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 2"
                  style="white-space: nowarp;">
                  {{ '¥ ' + $store.state.userInfo.userAmt
                  }}
                </span>
                <span v-if="$store.state.userInfo&&tabsItemIndex == 3" style="white-space: nowarp;">
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 3"
                  style="white-space: nowarp;">
                  {{ '¥ ' + $store.state.userInfo.userAmt
                  }}
                </span>
                <!-- <span v-if="$store.state.userInfo && tabsItemIndex == 3" style="white-space: nowarp;">
                  {{
                  '¥' + $store.state.userInfo.userFuturesAmt
                      '¥' + $store.state.userInfo.userFuturesAmt
                  }}
                </span>
                </span> -->
              </div>
              <div class="sanjiao">
                <img
                  :class="dialogFlag ? 'xuanz' : ''"
                  style="transition: all 0.5s;"
                  src="../../assets/img/xiala.png"
                  alt
                />
                <img :class="dialogFlag ? 'xuanz' : ''" style="transition: all 0.5s;" src="../../assets/img/xiala.png"
                  alt />
              </div>
            </div>
            <div class="bottom_balance">
@@ -308,34 +266,28 @@
          </div>
          <div class="bottom_price">
            <div>
              <p
                v-if="this.$store.state.settingForm.indexDisplay && !this.$store.state.settingForm.futuresDisplay"
                class="account"
              >
              <p v-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).toFixed(2)
                    $store.state.userInfo.userIndexAmt).toFixed(2)
                }}
              </p>
              <p
                v-else-if="!this.$store.state.settingForm.indexDisplay && this.$store.state.settingForm.futuresDisplay"
                class="account"
              >
              <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.userFuturesAmt).toFixed(2)
                    $store.state.userInfo.userFuturesAmt).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).toFixed(2) }}</p>
              <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>
              </p> -->
            </div>
          </div>
        </div>
@@ -350,28 +302,28 @@
            <div>
              <span v-show="tabsItemIndex == 1">
                {{ $store.state.hide ? '****' :
                Number(($store.state.userInfo.enableIndexAmt +
                $store.state.userInfo.allIndexFreezAmt) * indexSettingInfo.forceSellPercent).toFixed(2)
                    Number(($store.state.userInfo.enableIndexAmt +
                      $store.state.userInfo.allIndexFreezAmt) * indexSettingInfo.forceSellPercent).toFixed(2)
                }}
              </span>
              <span v-show="tabsItemIndex == 0">
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 3">
                {{ $store.state.hide ? '****' : Number(($store.state.userInfo.enableAmt
                +
                $store.state.userInfo.allFreezAmt) * settingInfo.forceStopPercent).toFixed(2)
                    +
                    $store.state.userInfo.allFreezAmt) * settingInfo.forceStopPercent).toFixed(2)
                }}
              </span>
              <span v-show="tabsItemIndex == 2">
                {{ $store.state.hide ? '****' : Number(($store.state.userInfo.enableAmt
                +
                $store.state.userInfo.allFreezAmt) * settingInfo.forceStopPercent).toFixed(2)
                    +
                    $store.state.userInfo.allFreezAmt) * settingInfo.forceStopPercent).toFixed(2)
                }}
              </span>
              <span v-show="tabsItemIndex == 3">
              <!-- <span v-show="tabsItemIndex == 3">
                {{ $store.state.hide ? '****' :
                Number(($store.state.userInfo.enableFuturesAmt +
                $store.state.userInfo.allFuturesFreezAmt) * futuresSettingInfo.forceSellPercent).toFixed(2)
                    Number(($store.state.userInfo.enableFuturesAmt +
                      $store.state.userInfo.allFuturesFreezAmt) * futuresSettingInfo.forceSellPercent).toFixed(2)
                }}
              </span>
              </span> -->
            </div>
          </div>
        </div>
@@ -379,9 +331,9 @@
          <div class="tops_title">
            <div>
              <span>
                {{ tabsItemIndex == 1 ? '指数' : tabsItemIndex == 0 ? '沪深' : tabsItemIndex == 2 ? '科创' :
                tabsItemIndex ==
                3 ? '期货' : ''
                {{ tabsItemIndex == 1 ? '指数' : tabsItemIndex == 0 ? '股票' : tabsItemIndex == 2 ? '股票' :
                    tabsItemIndex ==
                      3 ? '股票' : ''
                }}
              </span>
              <span>{{ '资产' }}</span>
@@ -390,9 +342,9 @@
          <div class="bottom_price">
            <div>
              <span v-show="tabsItemIndex == 1">{{ '¥ ' + $store.state.userInfo.userIndexAmt }}</span>
              <span v-show="tabsItemIndex == 0">{{ '¥ ' + $store.state.userInfo.userAmt }}</span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.userAmt }}</span>
              <span v-show="tabsItemIndex == 2">{{ '¥ ' + $store.state.userInfo.userAmt }}</span>
              <span v-show="tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.userFuturesAmt }}</span>
              <!-- <span v-show="tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.userFuturesAmt }}</span> -->
            </div>
          </div>
        </div>
@@ -405,9 +357,9 @@
          <div class="bottom_price">
            <div>
              <span v-show="tabsItemIndex == 1">{{ '¥ ' + $store.state.userInfo.enableIndexAmt }}</span>
              <span v-show="tabsItemIndex == 0">{{ '¥ ' + $store.state.userInfo.enableAmt }}</span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.enableAmt }}</span>
              <span v-show="tabsItemIndex == 2">{{ '¥ ' + $store.state.userInfo.enableAmt }}</span>
              <span v-show="tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.enableFuturesAmt }}</span>
              <!-- <span v-show="tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.enableFuturesAmt }}</span> -->
            </div>
          </div>
        </div>
@@ -420,11 +372,10 @@
          <div class="bottom_price">
            <div>
              <span v-show="tabsItemIndex == 1">{{ '¥ ' + $store.state.userInfo.allIndexFreezAmt }}</span>
              <span v-show="tabsItemIndex == 0">{{ '¥ ' + $store.state.userInfo.allFreezAmt }}</span>
              <span v-show="tabsItemIndex == 0 || tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.allFreezAmt
              }}</span>
              <span v-show="tabsItemIndex == 2">{{ '¥ ' + $store.state.userInfo.allFreezAmt }}</span>
              <span
                v-show="tabsItemIndex == 3"
              >{{ '¥ ' + $store.state.userInfo.allFuturesFreezAmt }}</span>
              <!-- <span v-show="tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.allFuturesFreezAmt }}</span> -->
            </div>
          </div>
        </div>
@@ -438,35 +389,79 @@
            <div>
              <span
                :class="$store.state.userInfo.allIndexProfitAndLose > 0 ? ' red' : $store.state.userInfo.allIndexProfitAndLose < 0 ? ' green' : ''"
                v-show="tabsItemIndex == 1"
              >{{ '¥ ' + $store.state.userInfo.allIndexProfitAndLose }}</span>
                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"
              >{{ '¥ ' + $store.state.userInfo.allProfitAndLose }}</span>
                v-show="tabsItemIndex == 0 || tabsItemIndex == 3">{{ '¥ ' + $store.state.userInfo.allProfitAndLose
                }}</span>
              <span
                :class="$store.state.userInfo.allProfitAndLose > 0 ? ' red' : $store.state.userInfo.allProfitAndLose < 0 ? ' green' : ''"
                v-show="tabsItemIndex == 2"
              >{{ '¥ ' + $store.state.userInfo.allProfitAndLose }}</span>
              <span
                v-show="tabsItemIndex == 2">{{ '¥ ' + $store.state.userInfo.allProfitAndLose }}</span>
              <!-- <span
                :class="$store.state.userInfo.allFuturesProfitAndLose > 0 ? 'red' : $store.state.userInfo.allFuturesProfitAndLose < 0 ? ' green' : ''"
                v-show="tabsItemIndex == 3"
              >{{ '¥ '+Number($store.state.userInfo.allFuturesProfitAndLose).toFixed(2)}}</span>
                v-show="tabsItemIndex == 3">{{ '¥' +Number($store.state.userInfo.allFuturesProfitAndLose).toFixed(2)}}</span> -->
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 新股弹窗 -->
    <van-popup v-model="settingDialog" position="bottom" :style="{ height: '35%' }" @close="popClose">
      <div class="setting_content">
        <div class="old_password">
          <div class="left_titles">
            <span>{{ '申购数量:' }}</span>
          </div>
          <div class="right_password_input">
            <input type="number" v-model="sgNum" />
          </div>
        </div>
        <div class="btn_setting" @click="changeSg()">
          <span>{{ '立即申购' }}</span>
        </div>
        <div class="shijian">
          <div class="xgsj">
            <div class="sjtlt">申购时间: </div>
            <div class="xgTime" v-if="this.sgsj">{{ this.sgsj | getTimeYear }}</div>
          </div>
          <div class="xgsj">
            <div class="sjtlt">认缴时间: </div>
            <div class="xgTime" v-if="this.rjsj">{{ this.rjsj | getTimeYear }}</div>
          </div>
        </div>
        <!-- <div class="old_password">
          <div class="left_titles">
            <span>{{ '新密码:' }}</span>
          </div>
          <div class="right_password_input">
            <input type="password" v-model="newPassword" />
          </div>
        </div>
        <div class="old_password">
          <div class="left_titles">
            <span>{{ '确认新密码:' }}</span>
          </div>
          <div class="right_password_input">
            <input type="password" v-model="cirNewPassword" />
          </div>
        </div> -->
      </div>
    </van-popup>
  </div>
</template>
<script>
//Toast
import { Toast } from 'vant';
import * as api from "@/axios/api";
import elalert from "@/components/elalert.vue";
export default {
  name: "trading",
  components: {
    elalert
  },
  data() {
    return {
@@ -487,9 +482,17 @@
      loadings: false,
      finished: false,
      finisheds: false,
      settingDialog: false,
      sgNum: 1,
      sgCode: '',
      gpcode: "",
      gpcodes: "",
      texts: "",
      sgsj: "",
      rjsj: "",
      orderNumber: "",
      elAlertShow: false,
      elAlertText: "",
      tabsClassArr: [
        {
          name: "沪深京",
@@ -504,8 +507,12 @@
          name: "科创",
          type: 2
        },
        // {
        //   name: "期货",
        //   type: 3
        // }
        {
          name: "期货",
          name: "新股",
          type: 3
        }
      ],
@@ -521,6 +528,9 @@
      this.$nextTick(() => {
        this.$refs.search.focus();
      });
    }
    if(this.$route.query.listid){
      this.tabsItemIndex = Number(this.$route.query.listid)
    }
  },
@@ -568,6 +578,7 @@
      // }
    },
    gpinput() {
      this.pageNum = 1;
      this.listArr = [];
      this.loading = true;
@@ -614,7 +625,7 @@
        // this.getProductSetting()
        this.$store.state.userInfo = data.data;
      } else {
        Toast(data.msg);
        this.$store.commit('elAlertShow', { 'elAlertShow': true, 'elAlertText': data.msg });
      }
      this.$store.state.user = this.user;
    },
@@ -625,7 +636,7 @@
        // 成功
        this.indexSettingInfo = data.data;
      } else {
        Toast(data.msg);
        this.$store.commit('elAlertShow', { 'elAlertShow': true, 'elAlertText': data.msg });
      }
    },
    async getFuturesSetting() {
@@ -635,7 +646,7 @@
        // 成功
        this.futuresSettingInfo = data.data;
      } else {
        Toast(data.msg);
        this.$store.commit('elAlertShow', { 'elAlertShow': true, 'elAlertText': data.msg });
      }
    },
    async getSettingInfo() {
@@ -644,7 +655,7 @@
        // 成功
        this.settingInfo = data.data;
      } else {
        Toast(data.msg);
        ` this.$store.commit('elAlertShow',{'elAlertShow':true,'elAlertText': data.msg});`
      }
    },
    async getListMarket() {
@@ -680,9 +691,14 @@
          this.finished = true;
        }
        if (this.tabsItemIndex == 0) {
          data.data.list.forEach(element => {
            this.listArr.push(element);
          });
          if (this.gpcode) {
            this.listArr = data.data.list;
          } else {
            data.data.list.forEach(element => {
              this.listArr.push(element);
            });
          }
        }
      } else {
        this.texts = data.msg;
@@ -704,25 +720,114 @@
          this.finished = true;
        }
        if (this.tabsItemIndex == 2) {
          data.data.list.forEach(element => {
            this.listArr.push(element);
          });
          if (this.gpcode) {
            this.listArr = data.data.list;
          } else {
            data.data.list.forEach(element => {
              this.listArr.push(element);
            });
          }
        }
      } else {
        this.texts = data.msg;
        this.alertShow = true;
      }
    },
    popClose() {
      this.sgCode = '';
      this.sgsj = '';
      this.rjsj = '';
      this.orderNumber = '';
    },
    async changeSg() {
      if (!this.sgNum) {
        Toast('数量不能为空');
        return;
      };
      //this.sgNum必须是数字并且不能小于1
      if (this.sgNum < 1) {
        Toast('数量不能小于1');
        return;
      }
      if (this.sgNum > this.orderNumber) {
        Toast('数量不能大于' + this.orderNumber);
        return;
      }
      let opt = {
        newCode: this.sgCode,
        applyNums: this.sgNum,
        phone: this.$store.state.userInfo.phone,
      };
      let data = await api.getNewAdd(opt);
      if (data.status === 0) {
        this.sgShow = false;
        this.sgCode = '';
        this.sgsj = '';
        this.rjsj = '';
        this.orderNumber = '';
        Toast('申购成功');
        this.$router.push({ path: '/warehouse?index=3' });
      } else {
        Toast(data.msg);
      }
    },
    handleGoToKlineDetail(item) {
      console.log(item);
      var codes = "";
      var names = "";
      var stock_type = "";
      var soks = "";
      var if_zhishu = '0';
      switch (this.tabsItemIndex) {
        case 0:
          codes = item.code;
          names = item.name;
          stock_type = item.stock_type;
          soks = this.filterSH(item.stock_type);
          if_zhishu = '0';
          break;
        case 1:
          codes = item.indexGid;
          names = item.indexName;
          stock_type = 'sh';
          if_zhishu = item.indexCode;
          soks = 0;
          break;
        case 2:
          codes = item.code;
          names = item.name;
          stock_type = item.stock_type;
          soks = this.filterSH(item.stock_type);
          if_zhishu = '0';
          break;
        case 3:
          this.sgCode = item.code;
          this.sgsj = item.subscribeTime;
          this.rjsj = item.subscriptionTime;
          this.orderNumber = item.orderNumber;
          this.settingDialog = true;
          return;
          codes = item.futuresGid;
          names = item.futuresName;
          soks = 0;
          stock_type = 'qh';
          if_zhishu = item.indexGid;
          break;
        default:
          break;
      }
      this.$router.push({
        path: "/kline",
        query: {
          name: item.name,
          name: names,
          stockplate: item.stock_plate,
          code: item.code,
          type: item.stock_type,
          sok: this.filterSH(item.stock_type)
          code: codes,
          type: stock_type,
          sok: soks,
          if_zhishu: if_zhishu,
        }
      });
    },
@@ -737,26 +842,44 @@
    async getFutures() {
      // 获取期货列表
      let opt = {
        homeShow: 1,
        pageNum: this.pageNum,
        pageSize: 15
      };
      let data = await api.getListFutures(opt);
      let data = await api.getNewGu(opt);
      this.loading = false;
      if (data.data.length < 15) {
        this.finished = true;
      }
      if (data.status === 0) {
        if (this.tabsItemIndex == 3) {
          data.data.forEach(element => {
            this.listArr.push(element);
          });
          this.listArr = data.data.list;
        }
        this.finished = true;
      } else {
        this.texts = data.msg;
        this.alertShow = true;
      }
    },
    // async getFutures() {
    //   // 获取期货列表
    //   let opt = {
    //     homeShow: 1,
    //     pageNum: this.pageNum,
    //     pageSize: 15
    //   };
    //   let data = await api.getListFutures(opt);
    //   this.loading = false;
    //   if (data.data.length < 15) {
    //     this.finished = true;
    //   }
    //   if (data.status === 0) {
    //     if (this.tabsItemIndex == 3) {
    //       data.data.forEach(element => {
    //         this.listArr.push(element);
    //       });
    //     }
    //   } else {
    //     this.texts = data.msg;
    //     this.alertShow = true;
    //   }
    // },
    async getMyList() {
      this.loadings = true;
      //获取自选列表
@@ -983,6 +1106,35 @@
      }
      //17:35:2922-06-2022
      return h + ":" + m + ":" + c;
    },
    getTimeYear(time) {
      if (!time) {
        return "";
      }
      var nd = new Date(time);
      var y = nd.getFullYear();
      var mm = nd.getMonth() + 1;
      var d = nd.getDate();
      var h = nd.getHours();
      var m = nd.getMinutes();
      var c = nd.getSeconds();
      if (mm < 10) {
        mm = "0" + mm;
      }
      if (d < 10) {
        d = "0" + d;
      }
      if (h < 10) {
        h = "0" + h;
      }
      if (m < 10) {
        m = "0" + m;
      }
      if (c < 10) {
        c = "0" + c;
      }
      //17:35:2922-06-2022
      return y + '-' + mm + '-' + d + ' ' + h + ":" + m + ":" + c;
    }
  }
};
@@ -994,7 +1146,7 @@
  height: calc(100% - 1.3rem);
  background: #fff;
  > .content {
  >.content {
    width: 100%;
    height: 100%;
  }
@@ -1013,6 +1165,7 @@
    justify-content: center;
    padding: 0 0.3rem;
    position: relative;
    .search_content {
      width: 100%;
      height: 90%;
@@ -1070,12 +1223,12 @@
  position: fixed;
  background: #fff;
  top: 0;
  z-index: 9999999;
  z-index: 2000;
  transition: all 0.5s;
  overflow: hidden;
  border-radius: 0 0 0.2rem 0.2rem;
  > div {
  >div {
    width: 100%;
    height: 1.2821rem;
    display: flex;
@@ -1119,7 +1272,7 @@
  display: -webkit-box;
  white-space: nowrap;
  > div {
  >div {
    display: inline-block;
    width: 15%;
    height: 100%;
@@ -1209,26 +1362,32 @@
    margin-top: -0.5rem;
    width: 100%;
    > div {
    >div {
      width: 100%;
      height: 1.0256rem;
      display: flex;
      margin: 0.5rem 0;
      > div {
        > div {
          display: flex;
          align-items: center;
        }
      >div {
        width: 100%;
        height: 1.0256rem;
        display: flex;
        .tp {
          width: 100%;
          height: 70%;
        }
        >div {
          >div {
            display: flex;
            align-items: center;
          }
        .bt {
          width: 100%;
          height: 30%;
          .tp {
            width: 100%;
            height: 70%;
          }
          .bt {
            width: 100%;
            height: 30%;
          }
        }
      }
    }
@@ -1258,7 +1417,7 @@
  color: #a1a2a4;
  display: flex;
  > div {
  >div {
    display: flex;
    align-items: center;
  }
@@ -1366,6 +1525,7 @@
      margin-left: 0.1rem;
      margin-right: 0.1rem;
      min-width: 1.9rem;
      span {
        font-weight: 600;
        text-align: right;
@@ -1514,4 +1674,140 @@
/deep/.van-list__loading {
  margin-top: 0.2rem;
}
.hongse {
  background-color: #4d73b1 !important;
}
.xgsgType {
  position: relative;
  top: 30%;
  left: 0;
  right: 0;
  margin: auto;
  width: 85%;
  height: 80%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.1rem;
  background-color: rgba(102, 204, 153, 0.1);
  border: 0.04rem solid #5CE398;
  color: #5CE398;
}
.xgsgTypeRed {
  position: relative;
  top: 30%;
  left: 0;
  right: 0;
  margin: auto;
  width: 85%;
  height: 80%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.1rem;
  background-color: rgba(223, 59, 59, 0.062);
  border: 0.04rem solid rgb(231, 61, 61);
  color: rgb(231, 61, 61);
}
.setting_content {
  width: 100%;
  height: 5rem;
  padding: 0.3rem;
  .old_password {
    width: 100%;
    height: 1.6rem;
    background: rgb(243, 243, 243);
    border-radius: 0.15rem;
    display: flex;
    margin-top: 0.8rem;
    .left_titles {
      margin-left: 0.2rem;
      width: 25%;
      height: 100%;
      display: flex;
      align-items: center;
      padding-left: 0.2rem;
      font-size: 0.3975rem;
      // justify-content: flex-end;
      span {
        font-weight: 600;
        letter-spacing: 0.04rem;
      }
    }
    .right_password_input {
      width: 75%;
      height: 100%;
      display: flex;
      align-items: center;
      input {
        width: 100%;
        height: 100%;
        padding-left: 0.2rem;
        border-radius: 0 0.2rem 0.2rem 0;
        font-size: 0.3975rem;
        font-weight: 600;
        //文字间距
        letter-spacing: 0.04rem;
      }
    }
  }
  .btn_setting {
    width: 100%;
    height: 1.3rem;
    border-radius: 0.15rem;
    background: #2d6ae9;
    color: #fff;
    font-size: 0.4615rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    span {
      font-weight: 600;
    }
  }
}
.shijian {
  width: 100%;
  height: 1.6rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.xgsj {
  font-size: 0.3875rem;
  font-weight: 600;
  display: flex;
  height: 50%;
  align-items: center;
}
.sjtlt {
  width: 25%;
  margin-left: 0.4rem;
}
.xgTime() {
  width: 75%;
}
/deep/.van-popup {
  border-radius: 0.2rem 0.2rem 0 0;
}
</style>