DESKTOP-CVS3R96\我恁爹
2022-11-15 a1fb6cd3c3b8a48da4f9393e09718da04f51a373
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="$t('hj37')" ref="search" id="sousuo" v-model="gpcode"
                    @input="gpinput" />
                </div>
              </div>
            </div>
@@ -30,7 +30,7 @@
              <img src="../../assets/img/shenfen2.png" alt />
            </div>
            <div class="text">
              <span>{{ '开户即可入金交易' }}</span>
              <span>{{ $t('hj38') }}</span>
            </div>
            <div class="right_go">
              <img src="../../assets/img/yuoujiantou.png" alt />
@@ -38,87 +38,99 @@
          </div>
          <div class="list_title">
            <div class="item_title varieties">
              <span>{{ '品种' }}</span>
              <span>{{ $t('hj39') }}</span>
            </div>
            <div class="item_title latest_price">
              <span>{{ '最新价' }}</span>
              <span>{{ $t('hj40') }}</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">{{ $t('hj41') }}</span>
              <span v-show="tabsItemIndex == 5" style="width: 100%;text-align: center;">{{ $t('hj42') }}</span>
            </div>
          </div>
          <!-- 市场列表 -->
          <div class="list" :class="isToken == '' ? 'listHeight' : 'listHeights'">
            <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"
            <van-list v-model="loading" :finished="finished" :finished-text="$t('hj43')" @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.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 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="bt">
                        <span>
                          {{ tabsItemIndex == 3 ? item.code : 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 || 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>
                    <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? '' :'手续费:' + 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"
                          :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"
                      <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> -->
                        <span v-if="tabsItemIndex == 3" class="price_color" style="text-align: center;width: 100%;">
                          {{item.orderNumber}}
                        </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 class="bt">
                        <div v-if="tabsItemIndex != 1 && tabsItemIndex != 3">{{ item.stock_type.toUpperCase() }}</div>
                        <!-- class="codeIcon" -->
                      </div>
                    </div>
                  </div>
                </div>
@@ -135,7 +147,7 @@
                  <img src="../../assets/img/searchs.png" alt />
                </div>
                <div class="search_input">
                  <input type="text" class="searchs" placeholder="输入品种名称/代码搜索"
                  <input type="text" class="searchs" :placeholder="$t('hj37')"
                    onkeyup="value=value.replace(/[^a-zA-Z0-9]/g,'')" v-model="gpcodes" @input="gpinputs" />
                </div>
              </div>
@@ -143,34 +155,36 @@
          </div>
          <div class="list_title">
            <div class="item_title varieties">
              <span>{{ '品种' }}</span>
              <span>{{ $t('hj39') }}</span>
            </div>
            <div class="item_title latest_price">
              <span>{{ '最新价' }}</span>
              <span>{{ $t('hj40') }}</span>
            </div>
            <div class="item_title applies">
              <span>{{ '涨跌幅' }}</span>
              <span>{{ $t('hj41') }}</span>
            </div>
          </div>
          <!-- 自选列表 -->
          <div class="list zxlist">
            <van-list v-model="loadings" :finished="finisheds" finished-text="没有更多了" @load="onLoads"
            <van-list v-model="loadings" :finished="finisheds" :finished-text="$t('hj43')" @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>
@@ -178,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">
@@ -207,23 +221,37 @@
          <div class="content_money" v-if="tabsIndex === 1">
            <div class="top_price">
              <div class="left">
                <span>{{ '余额' }}</span>
                <span>{{ $t('hj47') }}</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" 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 == 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"
                  style="white-space: nowarp;">
                  {{ '¥ ' + $store.state.userInfo.userAmt
                  }}
                </span>
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 3" style="white-space: nowarp;">
                <span v-if="$store.state.userInfo.userAmt != undefined && tabsItemIndex == 5"
                  style="white-space: nowarp;">
                  {{ '¥ ' + $store.state.userInfo.userAmt
                  }}
                </span>
@@ -240,7 +268,7 @@
            </div>
            <div class="bottom_balance">
              <div>
                <span>{{ '可用余额' }}</span>
                <span>{{ $t('hj48') }}</span>
              </div>
            </div>
          </div>
@@ -250,11 +278,11 @@
        <div class="card_item">
          <div class="tops_title">
            <div>
              <span>{{ '总资产' }}</span>
              <span>{{ $t('hj49') }}</span>
            </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 +
@@ -278,13 +306,65 @@
                }}
              </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"
              >
                ¥{{ $store.state.hide ? '****' : Number($store.state.userInfo.userAmt +
                $store.state.userInfo.userIndexAmt + $store.state.userInfo.userFuturesAmt).toFixed(2)
                }}
              </p> -->
            </div>
          </div>
        </div>
        <div class="card_item">
          <div class="tops_title">
            <div>
              <span>{{ '强平线' }}</span>
              <span>{{ $t('hj50') }}</span>
            </div>
          </div>
          <div class="bottom_price">
@@ -295,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">
@@ -320,18 +412,22 @@
          <div class="tops_title">
            <div>
              <span>
                {{ tabsItemIndex == 1 ? '指数' : tabsItemIndex == 0 ? '股票' : tabsItemIndex == 2 ? '股票' :
                {{ tabsItemIndex == 1 ? $t('hj51') : tabsItemIndex == 0 ? $t('hj52') : tabsItemIndex == 2 ? $t('hj52') :
                    tabsItemIndex ==
                      3 ? '股票' : ''
                      5 ? $t('hj52') : ''
                }}
              </span>
              <span>{{ '资产' }}</span>
              <span>{{ $t('hj53') }}</span>
            </div>
          </div>
          <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>
@@ -340,13 +436,18 @@
        <div class="card_item">
          <div class="tops_title">
            <div>
              <span>{{ '可用资金' }}</span>
              <span>{{ $t('hj54') }}</span>
            </div>
          </div>
          <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>
@@ -355,13 +456,20 @@
        <div class="card_item">
          <div class="tops_title">
            <div>
              <span>{{ '冻结保证金' }}</span>
              <span>{{ $t('hj55') }}</span>
            </div>
          </div>
          <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>
              <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> -->
            </div>
@@ -370,7 +478,7 @@
        <div class="card_item">
          <div class="tops_title">
            <div>
              <span>{{ '持仓总盈亏' }}</span>
              <span>{{ $t('hj56') }}</span>
            </div>
          </div>
          <div class="bottom_price">
@@ -380,7 +488,16 @@
                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 }}</span>
                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' : ''"
                v-show="tabsItemIndex == 2">{{ '¥ ' + $store.state.userInfo.allProfitAndLose }}</span>
@@ -392,10 +509,58 @@
        </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>{{ $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>
        </div>
        <div class="shijian">
          <div class="xgsj">
            <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="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";
export default {
  name: "trading",
@@ -404,7 +569,7 @@
  data() {
    return {
      tabsIndex: 1,
      tabsArr: ["自选", "市场"],
      tabsArr: [this.$t('hj61'), this.$t('hj62')],
      tabClassActive: 1,
      dialogFlag: false,
      pageNum: 1,
@@ -420,23 +585,31 @@
      loadings: false,
      finished: false,
      finisheds: false,
      settingDialog: false,
      sgNum: 1,
      sgCode: '',
      gpcode: "",
      gpcodes: "",
      texts: "",
      sgsj: "",
      rjsj: "",
      orderNumber: "",
      elAlertShow: false,
      userData: [],
      elAlertText: "",
      stockType: '',
      tabsClassArr: [
        {
          name: "沪深京",
          name: this.$t('hj63'),
          type: 0
        },
        {
          name: "指数",
          name: this.$t('hj51'),
          type: 1
        },
        {
          name: "科创",
          name: this.$t('hj64'),
          type: 2
        },
        // {
@@ -444,13 +617,21 @@
        //   type: 3
        // }
        {
          name: "新股",
          name: this.$t('hj65'),
          type: 3
        },
        {
          name: this.$t('hj66'),
          type: 4
        },
        {
          name: this.$t('hj3'),
          type: 5
        }
      ],
      tabsItemIndex: 0,
      listArr: [],
      listArrs: []
      listArrs: [],
    };
  },
@@ -461,10 +642,12 @@
        this.$refs.search.focus();
      });
    }
    if (this.$route.query.listid) {
      this.tabsItemIndex = Number(this.$route.query.listid)
    }
  },
  mounted() {
    this.loading = true;
    this.getStock();
    this.isToken = window.localStorage.getItem("USERTOKEN");
@@ -485,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;
@@ -508,26 +705,37 @@
      // }
    },
    gpinput() {
      this.pageNum = 1;
      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;
      }
@@ -553,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;
    },
@@ -566,7 +777,7 @@
        // 成功
        this.indexSettingInfo = data.data;
      } else {
        this.$store.commit('elAlertShow',{'elAlertShow':true,'elAlertText': data.msg});
        this.$store.commit('elAlertShow', { 'elAlertShow': true, 'elAlertText': data.msg });
      }
    },
    async getFuturesSetting() {
@@ -576,7 +787,7 @@
        // 成功
        this.futuresSettingInfo = data.data;
      } else {
        this.$store.commit('elAlertShow',{'elAlertShow':true,'elAlertText': data.msg});
        this.$store.commit('elAlertShow', { 'elAlertShow': true, 'elAlertText': data.msg });
      }
    },
    async getSettingInfo() {
@@ -585,7 +796,7 @@
        // 成功
        this.settingInfo = data.data;
      } else {
       ` this.$store.commit('elAlertShow',{'elAlertShow':true,'elAlertText': data.msg});`
        ` this.$store.commit('elAlertShow',{'elAlertShow':true,'elAlertText': data.msg});`
      }
    },
    async getListMarket() {
@@ -612,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;
@@ -620,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 {
@@ -663,27 +875,110 @@
        this.alertShow = true;
      }
    },
    popClose() {
      this.sgCode = '';
      this.sgsj = '';
      this.rjsj = '';
      this.orderNumber = '';
    },
    async changeSg() {
      if (!this.sgNum) {
        Toast(this.$t('hj67'));
        return;
      };
      //this.sgNum必须是数字并且不能小于1
      if (this.sgNum < 1) {
        Toast(this.$t('hj68'));
        return;
      }
      if (this.sgNum > this.orderNumber) {
        Toast(this.$t('hj69') + 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.$t('hj70'));
        this.$router.push({ path: '/warehouse?index=3' });
      } 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;
@@ -692,8 +987,12 @@
          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;
          this.orderNumber = item.orderNumber;
          this.settingDialog = true;
          return;
          codes = item.futuresGid;
          names = item.futuresName;
@@ -713,6 +1012,8 @@
          code: codes,
          type: stock_type,
          sok: soks,
          if_us: if_us,
          usType: item.type,
          if_zhishu: if_zhishu,
        }
      });
@@ -728,13 +1029,13 @@
    async getFutures() {
      // 获取期货列表
      let opt = {
      };
      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;
@@ -786,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";
@@ -814,7 +1119,6 @@
      this.pageNum = 1;
      this.finished = false;
      this.loading = true;
      console.log(item.type,"阿斯顿八岁的跟随阿达");
      switch (item.type) {
        case 1:
          this.listArr = [];
@@ -823,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: this.$t('hj71'),
          type: 'warning'
        });
        return;
      }
      var codes = "";
      switch (this.tabsItemIndex) {
        case 0:
@@ -849,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:
@@ -868,6 +1203,7 @@
            case 0:
              this.stockPlate = "";
              this.pageNum = 1;
              this.stockType = '';
              this.loading = true;
              this.listArr = [];
              this.finished = false;
@@ -876,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;
@@ -905,6 +1260,7 @@
              break;
            case 0:
              this.stockPlate = "";
              this.stockType = '';
              this.pageNum = 1;
              this.finished = false;
              this.listArr = [];
@@ -912,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;
@@ -928,6 +1301,10 @@
          console.log(data.msg);
        }
      }
      if (navigator.vibrate) {
          // 支持
          navigator.vibrate([55]);
        }
    },
    async optionszx(val) {
      let data = await api.delOption({ code: val.stockGid });
@@ -939,6 +1316,10 @@
      } else {
        console.log(data.msg);
      }
      if (navigator.vibrate) {
          // 支持
          navigator.vibrate([55]);
        }
    },
    async refreshList() {
      // 刷新指数
@@ -956,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 {
@@ -965,6 +1350,13 @@
    }
  },
  filters: {
    getName(name) {
      if (name.length > 15) {
        return name.substring(0, 14);
      } else {
        return name;
      }
    },
    gettime(time) {
      if (!time) {
        return "";
@@ -993,6 +1385,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;
    }
  }
};
@@ -1081,7 +1502,7 @@
  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;
@@ -1227,19 +1648,26 @@
      margin: 0.5rem 0;
      >div {
        width: 100%;
        height: 1.0256rem;
        display: flex;
        >div {
          display: flex;
          align-items: center;
        }
          >div {
            display: flex;
            align-items: center;
          }
        .tp {
          width: 100%;
          height: 70%;
        }
          .tp {
            width: 100%;
            height: 70%;
          }
        .bt {
          width: 100%;
          height: 30%;
          .bt {
            width: 100%;
            height: 30%;
          }
        }
      }
    }
@@ -1284,6 +1712,7 @@
  .applies {
    width: 20%;
    justify-content: flex-end;
  }
}
@@ -1339,7 +1768,7 @@
  justify-content: flex-end;
  .content_money {
    width: 80%;
    // width: 80%;
    height: 80%;
  }
@@ -1378,6 +1807,7 @@
      margin-right: 0.1rem;
      min-width: 1.9rem;
      // padding-left: 0.2rem;
      span {
        font-weight: 600;
        text-align: right;
@@ -1467,6 +1897,10 @@
    align-items: center;
    padding-left: 0.5rem;
    p {
      font-weight: 600;
    }
    span {
      font-weight: 600;
    }
@@ -1526,8 +1960,140 @@
/deep/.van-list__loading {
  margin-top: 0.2rem;
}
.hongse{
  background-color: #4d73b1!important;
.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>