DESKTOP-CVS3R96\我恁爹
2022-11-11 9ca581cca97e9ba95ff808f6b7a08c24a4758dbf
src/page/user/Warehouse.vue
@@ -106,23 +106,33 @@
            </div>
            <div class="prices">
              <div class="left_titles">
                <span class="numDemo" v-show="titleIndex == 1">{{ '¥ ' + $store.state.userInfo.allIndexFreezAmt? $store.state.userInfo.allIndexFreezAmt:'0.00'
                <span class="numDemo" v-show="titleIndex == 1">{{ '¥ ' + $store.state.userInfo.allIndexFreezAmt ?
                    $store.state.userInfo.allIndexFreezAmt : '0.00'
                }}</span>
                <span class="numDemo" v-show="titleIndex == 0">{{ '¥ ' + $store.state.userInfo.allFreezAmt?$store.state.userInfo.allFreezAmt :'0.00'}}</span>
                <span class="numDemo" v-show="titleIndex == 2">{{ '¥ ' + $store.state.userInfo.allFuturesFreezAmt?$store.state.userInfo.allFuturesFreezAmt:'0.00'
                <span class="numDemo" v-show="titleIndex == 0">{{ '¥ ' +
                    $store.state.userInfo.allFreezAmt ? $store.state.userInfo.allFreezAmt : '0.00'
                }}</span>
                <span class="numDemo" v-show="titleIndex == 2">{{ '¥ ' +
                    $store.state.userInfo.allFuturesFreezAmt ? $store.state.userInfo.allFuturesFreezAmt : '0.00'
                }}</span>
              </div>
              <div class="right_titles">
                <span class="numDemo"
                  :class="$store.state.userInfo.allIndexProfitAndLose > 0 ? ' red' : $store.state.userInfo.allIndexProfitAndLose < 0 ? ' green' : ''"
                  v-show="titleIndex == 1">{{ '¥ ' + $store.state.userInfo.allIndexProfitAndLose?$store.state.userInfo.allIndexProfitAndLose:'0.00' }}</span>
                  v-show="titleIndex == 1">{{ '¥ ' +
                      $store.state.userInfo.allIndexProfitAndLose ? $store.state.userInfo.allIndexProfitAndLose : '0.00'
                  }}</span>
                <span class="numDemo"
                  :class="$store.state.userInfo.allProfitAndLose > 0 ? ' red' : $store.state.userInfo.allProfitAndLose < 0 ? ' green' : ''"
                  v-show="titleIndex == 0">{{ '¥ ' + $store.state.userInfo.allProfitAndLose?$store.state.userInfo.allProfitAndLose:'0.00' }}</span>
                  v-show="titleIndex == 0">{{ '¥ ' +
                      $store.state.userInfo.allProfitAndLose ? $store.state.userInfo.allProfitAndLose : '0.00'
                  }}</span>
                <span class="numDemo"
                  :class="$store.state.userInfo.allFuturesProfitAndLose > 0 ? 'red' : $store.state.userInfo.allFuturesProfitAndLose < 0 ? ' green' : ''"
                  v-show="titleIndex == 2">{{ '¥'+$store.state.userInfo.allFuturesProfitAndLose?Number($store.state.userInfo.allFuturesProfitAndLose).toFixed(2):'0.00'}}</span>
                  v-show="titleIndex == 2">{{
                      '¥' + $store.state.userInfo.allFuturesProfitAndLose ? Number($store.state.userInfo.allFuturesProfitAndLose).toFixed(2) : '0.00'
                  }}</span>
              </div>
            </div>
@@ -133,18 +143,22 @@
            <div class="tabs_top_title">
              <div class="title_items" v-for="(item, index) in   tabsArr" :key="index"
                @click="handleTabsClick(item, index)" :class="index == 0 ? 'kuan' : 'kuan'">
                <span :class="tabsCurrentIndex === index ? 'active' : ''">{{ item }}{{ index == 0 ? '(' + total + ')' : '(' + totals + ')'}}</span>
                <span :class="tabsCurrentIndex === index ? 'active' : ''">{{ item }}{{ index == 0 ? '(' + total + ')' : index == 1 ? '(' + totalss + ')' :
                    '(' + totals + ')'
                }}</span>
              </div>
            </div>
            <!-- 持仓 currentIndex: 0 -->
            <div class="over">
                <van-list v-model="loading" :finished="finished" finished-text="没有更多了" v-show="tabsCurrentIndex === 0&&total != 0" @load="onLoad" :immediate-check="immediate">
              <van-list v-model="loading" :finished="finished" finished-text="没有更多了"
                v-show="tabsCurrentIndex === 0 && total != 0" @load="onLoad" :immediate-check="immediate">
                  <div class="tabs_o" >
                    <div class="tabs_o_items" v-for="(item, index) in tabsPositionNumArr" :key="item.buyOrderId">
                      <div class="tabs_o_title">
                        <span class="title">{{ item.stockName }}</span>
                        <span class="buy_to_sell" :class="item.orderDirection=='买跌'?'maichu':'mairu'">{{ item.orderDirection=="买跌"?'卖出':'买入' }}</span>
                      <span class="buy_to_sell" :class="item.orderDirection == '买跌' ? 'maichu' : 'mairu'">{{
                          item.orderDirection == "买跌" ? '卖出' : '买入'
                      }}</span>
                        <span class="multiple">{{ item.allProfitAndLose }}</span>
                        <span class="nums">{{ item.orderNum / 100 + '手' }}</span>
                      </div>
@@ -174,8 +188,6 @@
                        <span>{{ '平仓' }}</span>
                      </div>
                    </div>
              </div>
            </van-list>
              <div class="waiting" v-if="total == 0 && tabsCurrentIndex === 0">
@@ -189,7 +201,63 @@
                  </div>
                </div>
              </div>
              <div class="waiting" v-if="totals == 0 && tabsCurrentIndex === 1">
              <div class="waiting" v-if="totalss == 0 && tabsCurrentIndex === 1">
                <div class="waiting_box">
                  <div class="img_cont">
                    <img src="../../assets/img/zhaobudao.png" alt />
                    <span class="gd">{{ '当前无挂单' }}</span>
                    <div class="trading" @click="$router.push('/trading-list')">
                      <span>{{ '开始交易' }}</span>
                    </div>
                  </div>
                </div>
              </div>
              <van-list v-model="loadingss" :finished="finishedss" finished-text="没有更多了"
                v-show="tabsCurrentIndex === 1 && totalss != 0" @load="onLoad" :immediate-check="immediate">
                <div class="tabs_o">
                  <div class="tabs_o_items" v-for="(item, index) in tabsOrderList" :key="item.id">
                    <div class="tabs_o_title">
                      <span class="title">{{ item.stockName }}</span>
                      <span class="buy_to_sell" :class="item.buyType == 1 ? 'maichu' : 'mairu'">{{
                          item.buyType == 1 ? '卖出' : '买入'
                      }}</span>
                      <span class="multiple">{{ item.lever  }}X</span>
                      <span class="nums">{{ item.buyNum / 100 + '手' }}</span>
                    </div>
                    <div class="center_price">
                      <div class="start_price jiantou">
                        <span>{{ item.targetPrice }}</span>
                      </div>
                      <div class="new_price">
                        <span>{{ item.nowPrice }}</span>
                      </div>
                    </div>
                    <div class="bottom_price_title">
                      <div class="start_price">
                        <span>{{ '挂单价格' }}</span>
                      </div>
                      <div class="new_price">
                        <span>{{ '当前价格' }}</span>
                      </div>
                    </div>
                    <div class="right_btn">
                      <span>{{ '撤销' }}</span>
                    </div>
                  </div>
                </div>
              </van-list>
              <div class="waiting" v-if="totals == 0 && tabsCurrentIndex === 2">
                <div class="waiting_box">
                  <div class="img_cont">
                    <img src="../../assets/img/zhaobudao.png" alt />
@@ -201,7 +269,8 @@
                </div>
              </div>
              
              <van-list v-model="loadings" :finished="finisheds" finished-text="没有更多了" @load="onLoads" :immediate-check="immediate"  v-show="tabsCurrentIndex === 1&&totals != 0">
              <van-list v-model="loadings" :finished="finisheds" finished-text="没有更多了" @load="onLoads"
                :immediate-check="immediate" v-show="tabsCurrentIndex === 2 && totals != 0">
              <div class="tabs_o">
                <div class="tabs_o_items oes" v-for="(item, index) in tabsPcArr" :key="index">
                  <div class="tabs_o_title">
@@ -215,7 +284,8 @@
                      <span>平仓时间: {{ item.buyOrderTime | gettime }}</span>
                    </div>
                  </div>
                  <div class="right_count" :class="item.profitAndLose > 0 ? 'red' : item.profitAndLose == 0 ? '' : 'green'">
                    <div class="right_count"
                      :class="item.profitAndLose > 0 ? 'red' : item.profitAndLose == 0 ? '' : 'green'">
                    <span>{{ item.profitAndLose }}</span>
                  </div>
                </div>
@@ -236,7 +306,7 @@
export default {
  data() {
    return {
      tabsArr: ["持仓", "已平仓"],
      tabsArr: ["持仓", "挂单", "已平仓"],
      tabsCurrentIndex: 0,
      titleName: "沪深京账户",
      indexSettingInfo: {},
@@ -248,13 +318,18 @@
      titleDialog: false,
      total: 0,
      totals: 0,
      totalss:0,
      loading: false,
      finished: false,
      finisheds:false,
      finishedss: false,
      page: 1,
      pages: 1,
      pagess: 1,
      immediate:false,
      loadings:false,
      loadingss:false,
      tabsOrderList:[]
    };
  },
  mounted() {
@@ -264,6 +339,7 @@
    this.getSettingInfo();
    this.getFuturesSetting();
    this.getListDetails();
    this.getorderList();
  },
  methods: {
    onLoad() {
@@ -279,8 +355,18 @@
    onLoads() {
      this.pages++;
      switch (this.titleIndex) {
        case 1:
        case 2:
          this.getListDetails();
          break;
        default:
          break;
      }
    },
    onLoadss() {
      this.pagess++;
      switch (this.titleIndex) {
        case 1:
          this.getorderList();
          break;
        default:
          break;
@@ -300,16 +386,19 @@
          this.titleName = "沪深京账户";
          this.getListDetail();
          this.getListDetails();
          this.getorderList();
          break;
        case 1:
          this.titleName = "指数账户";
          this.getzhishuListDetail();
          this.getzhishuListDetails();
          this.getorderList();
          break;
        case 2:
          this.titleName = "期货账户";
          this.getQhListDetail();
          this.getQhListDetails();
          this.getorderList();
          break;
        default:
          break;
@@ -322,6 +411,23 @@
    },
    handleOpenDialog() {
      this.titleDialog = !this.titleDialog;
    },
    //挂单
    async getorderList(){
      let opts={}
      let data = await api.getorderList(opts);
      this.loadingss = false;
      if (data.status === 0) {
        if (data.data.length < 15) {
          this.finishedss = true;
        }
        data.data.forEach(element => {
          this.tabsOrderList.push(element)
        })
        this.totalss = data.data.length
      } else {
        Toast(data.msg)
      }
    },
    async getIndexSettingInfo() {
      // 网站设置信息 指数
@@ -548,8 +654,11 @@
  display: flex;
  justify-content: center;
  align-items: center;
};
}
;
@topCardColor: #bdbdbd;
.warehouse_page {
  width: 100%;
  height: calc(100% - 1.2974rem);
@@ -824,6 +933,7 @@
      position: relative;
      border-bottom: 0.01rem solid #ececec;
      margin-bottom: 0.1rem;
      .tabs_o_title {
        width: 100%;
        height: 0.7179rem;
@@ -1083,17 +1193,21 @@
  font-weight: 500 !important;
  ;
}
.maichu{
  color: rgb(225,57,65);
          background: rgb(252,238,240);
}
.mairu{
  color: rgb(109, 175, 125);
          background: rgb(215, 243, 235);
}
.jiantou{
  position: relative;
}
.jiantou::before{
  content: '';
  background-image: url('../../assets/img/youyou.png') ;