| | |
| | | <div class="sert"> |
| | | <span v-for="(item, index) in chicangList" :key="index" @click="chicangidx = index" |
| | | :class="chicangidx == index ? 'sdpl' : ''">{{ item.name }}</span> |
| | | <a :style="chicangidx == 0 ? 'left: 0.8rem;' : 'left: 4.54rem;'"></a> |
| | | <a :style="{ left: getIndicatorLeft() + 'rem' }"></a> |
| | | </div> |
| | | <div class="bnm"></div> |
| | | </div> |
| | |
| | | </p> |
| | | </div> |
| | | <div class="button-container"> |
| | | <div class="dr" style="margin-right: 16px" v-if="chicangidx == 0" @click="goBuyDetail(item)">买入</div> |
| | | <div class="dr-blue" style="margin-right: 16px" v-if="chicangidx == 0" @click="getpingcangbf(item.positionSn,item.orderNum)"> 部分平仓 </div> |
| | | <!-- <div class="dr" style="margin-right: 16px" v-if="chicangidx == 0" @click="goBuyDetail(item)">买入</div> |
| | | <div class="dr-blue" style="margin-right: 16px" v-if="chicangidx == 0" @click="getpingcangbf(item.positionSn,item.orderNum)"> 部分平仓 </div> --> |
| | | <div class="dr-blue" style="margin-right: 16px" v-if="chicangidx == 0" @click="getpingcang(item.positionSn)"> {{ $t('hj121') }} </div> |
| | | |
| | | </div> |
| | |
| | | </div> |
| | | </van-list> |
| | | |
| | | <van-list v-model="loadingss" :finished="finishedss" :finished-text="$t('hj43')" @load="onLoadss" |
| | | :immediate-check="immediate" v-show="(chicangidx === 2)"> |
| | | <div class="cichang" v-for="(item,index) in wtlist" :key="item.id" @click="goDetail(item)"> |
| | | <div class="dingbu"> |
| | | <div class="dl"> |
| | | <h6>{{ item.stockName ? item.stockName : item.indexName }}</h6> |
| | | <p> |
| | | <span v-show="(item.stockGid.indexOf('sz')>=0)">{{ $t('jy83') }}</span> |
| | | <span class="sh" v-show="(item.stockGid.indexOf('sh')>=0)">{{ $t('jy84') }}</span> |
| | | <span class="bj" v-show="(item.stockGid.indexOf('bj')>=0)">{{ $t('jy85') }}</span> |
| | | <a class="">{{item.stockGid}}</a> |
| | | </p> |
| | | </div> |
| | | <!-- <div class="dr" v-if="chicangidx == 2" > {{ $t('hj121') }} </div> --> |
| | | </div> |
| | | <div class="fudo" v-if="chicangidx == 2"> |
| | | <!-- <h6> {{ $t('jy20') }} <span class="red">{{ item.now_price }}</span></h6> --> |
| | | <!-- <p>{{ item.buyOrderTime | gettime }}</p> --> |
| | | </div> |
| | | <div class="fudo" v-else> |
| | | <h6> {{ $t('jy449') }} </h6> |
| | | <p>{{item.sellOrderTime | gettime}}</p> |
| | | </div> |
| | | <!-- <div class="fudong redbg"> |
| | | <div class="kuij"> |
| | | <p><span>{{ $t('jy13') }}:</span><a class="red">{{item.profitAndLose > 0 ? ('+' + item.profitAndLose) : item.profitAndLose}}</a></p> |
| | | <p><span>{{ $t('jy12') }}:</span><a class="red">{{item.allProfitAndLose}}</a></p> |
| | | </div> |
| | | </div> --> |
| | | <div class="plkm"> |
| | | <p><span>{{ $t('jy19') }}</span><a class="red">{{item.buyOrderPrice}}/{{ $t('jy96') }}</a></p> |
| | | <p v-if="chicangidx == 1"><span>{{ $t('jy25') }}</span><a class="red">{{item.sellOrderPrice}}/{{ $t('jy96') }}</a></p> |
| | | <p><span>{{ $t('jy18') }}</span><a class="red">{{item.orderNum}}</a></p> |
| | | <p><span>挂单时间</span><a class="red">{{ item.buyOrderTime | gettime }}</a></p> |
| | | <p><span>{{ $t('jy17') }}</span><a class="red">{{item.orderTotalPrice}}</a></p> |
| | | <!-- <p><span>{{ $t('jy153') }}</span><a class="red">{{item.orderSpread}}</a></p> --> |
| | | <p v-if="chicangidx == 1"><span>{{ $t('jy15') }}</span><a class="red">{{item.orderStayFee}}</a></p> |
| | | </div> |
| | | </div> |
| | | </van-list> |
| | | </div> |
| | | <div style="height:2rem"> |
| | | |
| | |
| | | }, |
| | | { |
| | | name: this.$t('jy410') |
| | | }, |
| | | { |
| | | name: '我的委托' |
| | | } |
| | | ], |
| | | chicangidx: 0, |
| | | loading: false, |
| | | loadings: false, |
| | | loadingss: false, |
| | | |
| | | finished: false, |
| | | finisheds: false, |
| | | finishedss: false, |
| | | |
| | | page:1, |
| | | pages:1, |
| | | pagess:1, |
| | | immediate: false, |
| | | tabsPositionNumArr: [], |
| | | tabsPositionObj: null, |
| | | tabsPcArr: [], |
| | | wtlist:[], |
| | | intervalId: null, // 用于存储定时器 ID |
| | | } |
| | | }, |
| | |
| | | this.getUserInfo() |
| | | this.getListDetail() |
| | | this.getListDetails() |
| | | this.getListDetailss() |
| | | this.startPolling(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.stopPolling(); // 销毁组件时停止轮询 |
| | | }, |
| | | methods: { |
| | | // 计算滑动指示器的位置 |
| | | getIndicatorLeft() { |
| | | const totalWidth = 5.34 // .sert 的总宽度(rem) |
| | | const tabCount = this.chicangList.length |
| | | const indicatorWidth = 0.53 // 指示器宽度(rem) |
| | | |
| | | // 计算每个标签的中心位置 |
| | | const tabWidth = totalWidth / tabCount |
| | | const centerPosition = (this.chicangidx + 0.7) * tabWidth |
| | | |
| | | // 减去指示器宽度的一半,使其居中 |
| | | return centerPosition - indicatorWidth / 2 |
| | | }, |
| | | goDetail(item) { |
| | | this.$router.push(`/WarehouseDetail?positionSn=${item.positionSn}`) |
| | | }, |
| | |
| | | path: '/Searchlist' |
| | | }) |
| | | }, |
| | | onLoads() { |
| | | //平仓 |
| | | this.pages++; |
| | | //沪深京平仓 |
| | | this.getListDetails(); |
| | | }, |
| | | onLoads() { |
| | | //平仓 |
| | | this.pages++; |
| | | //沪深京平仓 |
| | | this.getListDetails(); |
| | | }, |
| | | onLoadss() { |
| | | //委托 |
| | | this.pagess++; |
| | | //沪深京委托 |
| | | this.getListDetailss(); |
| | | }, |
| | | getpingcangbf(val,orderNum) { |
| | | // 如果 chicangidx 为 0,表示是沪深京市场(可能是股票市场的不同板块) |
| | | if (this.chicangidx == 0) { |
| | |
| | | //获取沪深我的平仓列表 |
| | | this.loadings = true; |
| | | let opt = { |
| | | state: 1, |
| | | state: 2, |
| | | stockCode: '', // 代码 |
| | | stockSpell: '', // 简拼 |
| | | pageNum: this.pages, |
| | |
| | | Toast(data.msg) |
| | | } |
| | | }, |
| | | async getListDetailss() { |
| | | //获取沪深我的委托列表 |
| | | this.loadingss = true; |
| | | // this.tabsPositionNumArr = []; |
| | | let opt = { |
| | | state: 0, |
| | | stockCode: '', // 代码 |
| | | stockSpell: '', // 简拼 |
| | | pageNum: this.page, |
| | | pageSize: 15, |
| | | } |
| | | let data = await api.getOrderList(opt) |
| | | this.loadingss = false; |
| | | if (data.status === 0) { |
| | | if (data.data.list.length < 20) { |
| | | this.finishedss = true; |
| | | } |
| | | // data.data.list.forEach(element => { |
| | | // this.tabsPositionNumArr.push(element) |
| | | // }) |
| | | console.log(data.data.list); |
| | | this.wtlist = data.data.list; |
| | | console.log('========================'); |
| | | // data.data.list.forEach((element, index) => { |
| | | // this.tabsPositionObj[index] = element; |
| | | // }); |
| | | //this.total = data.data.total |
| | | } else { |
| | | Toast(data.msg) |
| | | } |
| | | }, |
| | | async getListDetail() { |
| | | //获取沪深我的持仓列表 |
| | | this.loading = true; |
| | | // this.tabsPositionNumArr = []; |
| | | let opt = { |
| | | state: 0, |
| | | state: 1, |
| | | stockCode: '', // 代码 |
| | | stockSpell: '', // 简拼 |
| | | pageNum: this.page, |
| | |
| | | background: #dcf7ee !important; |
| | | } |
| | | |
| | | .chicangcontainer {} |
| | | |
| | | .toubu { |
| | | width: 100%; |
| | |
| | | flex-wrap: wrap; |
| | | |
| | | p { |
| | | width: 47%; |
| | | width: 49%; |
| | | margin-top: 0.4rem; |
| | | display: flex; |
| | | justify-content: space-between; |