<template>
|
<div class="list-data">
|
<div class="header-box">
|
<div style="min-width: 180px; max-width: 180px">{{ $t("hj313") }}</div>
|
<div style="text-align: right; flex: 1; margin-right: 20px">
|
{{ $t("hj314") }}
|
</div>
|
<div style="text-align: right; max-width: 90px; min-width: 90px">
|
{{ $t("hj315") }}
|
</div>
|
</div>
|
|
<van-list
|
v-model="loadings"
|
:finished="finished"
|
:finished-text="$t('hj43')"
|
@load="onLoads"
|
:immediate-check="false"
|
>
|
<div
|
class="item"
|
@click="handleGoToKlineDetail1(item, index)"
|
v-for="(item, index) in listArr"
|
:key="item.indexCode"
|
>
|
<div class="left_title" style="min-width: 180px; max-width: 180px">
|
<div class="tp">
|
<span class="collection" @click="optionszx(item)">
|
<span
|
class="shu"
|
:class="item.isOption == '1' ? 'shublue' : ''"
|
></span>
|
</span>
|
<span
|
class="title_color"
|
style="
|
overflow: hidden;
|
-webkit-line-clamp: 1;
|
text-overflow: ellipsis;
|
display: -webkit-box;
|
-webkit-box-orient: vertical;
|
"
|
>{{ item.name }}</span
|
>
|
</div>
|
<div class="bt">
|
<span>{{ item.spell }}</span>
|
</div>
|
</div>
|
<div class="center_price" style="align-items: center">
|
<div class="tp">
|
<span class="price_color">{{ item.nowPrice }}</span>
|
</div>
|
<div class="bt">
|
<span>{{ item.addTime }}</span>
|
</div>
|
</div>
|
<div
|
class="right_bs"
|
style="max-width: 90px; min-width: 90px"
|
:class="`${item.hcrate > 0 ? 'green' : 'red'}`"
|
>
|
<div class="tp">
|
<span class="price_color">{{ item.hcrate }}</span>
|
</div>
|
<div class="bt"></div>
|
</div>
|
</div>
|
</van-list>
|
</div>
|
</template>
|
|
<script>
|
import * as api from "@/axios/api";
|
import handleDt from "@/utils/deTh";
|
export default {
|
props: {
|
active: {
|
type: String,
|
default: "",
|
},
|
zxactive: {
|
type: String,
|
default: "",
|
},
|
},
|
watch: {
|
active(e) {
|
console.log(e);
|
},
|
zxactive(e) {
|
console.log(e);
|
},
|
},
|
data() {
|
return {
|
loadings: false,
|
finished: false,
|
listArr: [],
|
};
|
},
|
|
mounted() {
|
this.getStock();
|
},
|
methods: {
|
getStock: handleDt.debounce(async function (pageNum) {
|
let stockType = "IN";
|
let pageNumVal = 1;
|
let opt = {
|
pageNum: pageNumVal,
|
pageSize: 15,
|
stockPlate: "",
|
keyWords: "",
|
stockType: stockType,
|
orderBy: "",
|
};
|
let data = await api.getStockByType(opt);
|
this.loading = false;
|
if (data.status === 0) {
|
if (data.data.list.length < 15) {
|
this.finished = true;
|
}
|
this.listArr = data.data.list;
|
}
|
}, 500),
|
onLoads() {},
|
optionszx() {},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.list-data {
|
width: 100%;
|
height: 100vh;
|
background-color: #fff;
|
|
.header-box {
|
padding: 20px 15px;
|
display: flex;
|
justify-content: space-between;
|
color: rgb(140, 159, 173);
|
}
|
}
|
|
.item {
|
margin: 12px 15px;
|
padding-bottom: 15px;
|
display: flex;
|
justify-content: space-between;
|
border-bottom: 1px solid #f0f2f3;
|
.right_bs {
|
text-align: center;
|
border-radius: 0.05333rem;
|
font-family: PingFang SC;
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.32rem;
|
line-height: 0.64rem;
|
color: #fff;
|
min-width: 2.13333rem;
|
padding: 0 0.16rem;
|
height: 0.64rem;
|
background-color: rgb(3, 173, 143);
|
font-weight: 900;
|
}
|
|
.green {
|
background-color: rgb(3, 173, 143);
|
}
|
.red {
|
background-color: rgb(208, 75, 100);
|
}
|
}
|
.center_price {
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.4rem;
|
line-height: 0.56rem;
|
text-align: right;
|
color: #14181f;
|
text-align: right;
|
flex: 1;
|
margin-right: 20px;
|
}
|
.title_color {
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.4rem;
|
line-height: 0.56rem;
|
width: 4.2rem;
|
text-align: left;
|
color: #14181f;
|
}
|
</style>
|