<template>
|
<div class="list-data">
|
<div class="header-box">
|
<van-row type="flex" align="center" gutter="20">
|
<van-col span="9">
|
<div>
|
{{ $t("hj39") }}
|
</div>
|
</van-col>
|
<van-col span="9"
|
><div v-show="false" style="text-align: left">
|
{{ $t("hj40") }}
|
</div>
|
</van-col>
|
<van-col span="6">
|
<div style="text-align: right">
|
{{ $t("hj42") }}
|
</div>
|
</van-col>
|
</van-row>
|
</div>
|
|
<van-list
|
v-model="loadings"
|
:finished-text="$t('hj43')"
|
:loading-text="$t('hj430')"
|
:immediate-check="false"
|
>
|
<div
|
class="item"
|
v-for="item in listArr"
|
:key="item.indexCode"
|
@click="shengou(item)"
|
>
|
<van-row type="flex" align="center" gutter="20">
|
<van-col span="9">
|
<div>
|
<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.code }}</span>
|
</div> -->
|
</div></van-col
|
>
|
|
<van-col span="9" >
|
<div style="text-align: left" v-show="false">
|
<div class="tp">
|
<span class="price_color">{{
|
item.price
|
}}</span>
|
</div>
|
<div class="bt">
|
<span>Max: {{ item.orderNumber }}</span>
|
</div>
|
</div>
|
</van-col>
|
<van-col span="6">
|
<div style="text-align: right">
|
<div :class="item.type === 1 ? 'xgsgType' : 'xgpsType'">
|
<span class="price_color">
|
{{ item.type === 1 ? $t("hj45") : $t("新股配售") }}
|
</span>
|
</div>
|
</div>
|
</van-col>
|
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-top: 10px;font-size: 10px;;">
|
<div>{{$t('hj59')}}:{{
|
$moment(item.subscriptionTime).format(
|
"DD-MM-YYYY hh:mm:ss A"
|
)
|
}}</div>
|
<div>{{$t('申购结束时间')}}:{{
|
$moment(item.subscribeTime).format(
|
"DD-MM-YYYY hh:mm:ss A"
|
)
|
}}</div>
|
</div>
|
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-top: 10px;font-size: 10px;;">
|
<div>{{$t('上市时间')}}:{{
|
$moment(item.listDate).format(
|
"DD-MM-YYYY hh:mm:ss A"
|
)
|
}}</div>
|
<div>{{$t('hj314')}}:{{item.price }}</div>
|
</div>
|
</van-row>
|
|
</div>
|
</van-list>
|
|
<van-popup
|
v-model="show"
|
:style="{
|
minHeight: '30%',
|
borderTopLeftRadius: '10px',
|
borderTopRightRadius: '10px',
|
}"
|
position="bottom"
|
>
|
<div class="popup-box">
|
<div class="input-box">
|
<div class="laber">
|
{{ shengouObj.type === 1 ? $t("hj57") : $t("配售数量") }}:
|
</div>
|
<input type="text" :maxlength="9" v-model="fromData.value" @input="fromDatavalue" />
|
</div>
|
<div class="input-box" style="margin-top:20px;" v-if="shengouObj.password">
|
<!-- <div class="input-box" style="margin-top:20px;"> -->
|
<div class="laber">
|
{{$t("秘钥")}}:
|
</div>
|
<input type="text" :maxlength="9" v-model="fromData.password" />
|
</div>
|
|
<div class="shijian">
|
<div class="xgsj">
|
<div class="sjtlt">
|
{{
|
shengouObj.type === 1 ? $t("申购开启时间") : $t("配售开启时间")
|
}}:
|
</div>
|
<div class="xgTime">
|
{{
|
$moment(shengouObj.subscriptionTime).format(
|
"DD-MM-YYYY hh:mm:ss A"
|
)
|
}}
|
</div>
|
</div>
|
<div class="xgsj">
|
<div class="sjtlt">
|
{{
|
shengouObj.type === 1 ? $t("申购结束时间") : $t("配售结束时间")
|
}}:
|
<!-- {{ $t("hj60") }}: -->
|
</div>
|
<div class="xgTime">
|
{{
|
$moment(shengouObj.subscribeTime).format(
|
"DD-MM-YYYY hh:mm:ss A"
|
)
|
}}
|
</div>
|
</div>
|
<div class="xgsj">
|
<div class="sjtlt">{{ $t("上市时间") }}:</div>
|
<div class="xgTime">
|
{{ $moment(shengouObj.listDate).format("DD-MM-YYYY hh:mm:ss A") }}
|
</div>
|
</div>
|
<div class="xgsj">
|
<div class="sjtlt">{{ $t("最大購買") }}:</div>
|
<div class="xgTime">{{ shengouObj.orderNumber }}</div>
|
</div>
|
<div class="xgsj">
|
<div class="sjtlt">{{ $t("hj101") }}:</div>
|
<div class="xgTime">{{ shengouObj.lever }}</div>
|
</div>
|
<div class="xgsj">
|
<div class="sjtlt">{{ $t("hj120") }}:</div>
|
<div class="xgTime">
|
{{ shengouObj.price }}
|
</div>
|
</div>
|
<!-- <div class="xgsj">
|
<div class="sjtlt">上市時間:</div>
|
</div> -->
|
</div>
|
<van-button class="but" type="info" @click="newAddxg">
|
{{ shengouObj.type === 1 ? $t("hj58") : $t("立即配售") }}
|
</van-button>
|
</div>
|
</van-popup>
|
</div>
|
</template>
|
|
<script>
|
import * as api from "@/axios/api";
|
import handleDt from "@/utils/deTh";
|
import { Notify } from "vant";
|
|
// getNewAdd
|
export default {
|
props: {
|
active: {
|
type: String,
|
default: "",
|
},
|
zxactive: {
|
type: String,
|
default: "",
|
},
|
sousuo: {
|
type: String,
|
default: "",
|
},
|
tabsList: {
|
type: Array,
|
default: [],
|
},
|
},
|
watch: {
|
active(e) {
|
this.listArr = [];
|
this.getStock(e, this.zxactive);
|
},
|
zxactive(e) {
|
this.listArr = [];
|
this.getStock(this.active, e);
|
},
|
sousuo(e) {
|
this.listArr = [];
|
this.getStock(this.active, this.zxactive);
|
},
|
},
|
data() {
|
return {
|
fromData: {
|
value: 1,
|
password:''
|
},
|
loadings: false,
|
show: false,
|
finished: false,
|
listArr: [],
|
pageNumVal: 1,
|
shengouObj: {},
|
};
|
},
|
|
mounted() {
|
this.listArr = [];
|
this.pageNumVal = 1;
|
this.getStock(this.active, this.zxactive);
|
},
|
methods: {
|
fromDatavalue(e) {
|
this.fromData.value = this.fromData.value.replace(/^(0+)|[^\d]+/g, '')
|
},
|
async newAddxg() {
|
console.log(this.shengouObj.newlistId, "=====");
|
const res = await api.getNewAdd({
|
newCode: this.shengouObj.code,
|
applyNums: this.fromData.value,
|
password: this.fromData.password,
|
newlistId: this.shengouObj.newlistId,
|
type: this.shengouObj.type,
|
});
|
if (res.status === 0) {
|
Notify({ type: "success", message: res.msg });
|
this.show = false;
|
this.fromData.value = "";
|
} else {
|
Notify({ type: "warning", message: res.msg });
|
}
|
},
|
shengou(item) {
|
this.show = true;
|
this.shengouObj = item;
|
this.fromData.value = item.orderNumber
|
},
|
filterSH(val) {
|
if (val === "sh") {
|
return 1;
|
} else if (val === "bj" || val === "sz") {
|
return 0;
|
}
|
},
|
|
// 获取列表
|
getStock: handleDt.debounce(async function (a, b) {
|
a = this.active;
|
let stockType = "";
|
console.log(this.tabsList, a, this.active);
|
if (a !== "") {
|
let array = this.tabsList.filter((item) => item.key === a);
|
stockType = array[0].name;
|
}
|
let opt = {
|
zt: 0,
|
getType: 1,
|
pageSize: 1000,
|
};
|
let data = await api.getStocklist(opt);
|
this.loading = false;
|
if (data.status === 0) {
|
if (this.listArr.length >= data.data.total) {
|
this.finished = true;
|
}
|
if (this.pageNumVal !== 1) {
|
this.listArr = [...this.listArr, ...data.data.list];
|
} else {
|
this.listArr = data.data.list;
|
}
|
} else {
|
this.loading = false;
|
this.finished = true;
|
}
|
}, 500),
|
onLoads() {
|
if (!this.loading) {
|
this.pageNumVal++;
|
this.loading = true;
|
this.getStock();
|
}
|
},
|
optionszx() {},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.popup-box {
|
padding: 30px 20px;
|
.input-box {
|
height: 1.3rem;
|
background: #f3f3f3;
|
border-radius: 0.15rem;
|
|
line-height: 1.3rem;
|
padding-left: 10px;
|
display: flex;
|
padding-left: 0.2rem;
|
font-size: 0.3975rem;
|
.laber {
|
margin-right: 10px;
|
width: 50%;
|
}
|
// margin-top: 0.8rem;
|
}
|
.but {
|
width: 100%;
|
height: 1.3rem;
|
border-radius: 0.15rem;
|
background: #5c288c;
|
color: #fff;
|
font-size: 0.4615rem;
|
margin-top: 0.5rem;
|
}
|
.shijian {
|
width: 100%;
|
margin-top: 0.5rem;
|
margin-bottom: 0.5rem;
|
.xgsj {
|
margin-top: 10px;
|
font-size: 0.3875rem;
|
// font-weight: 600;
|
display: -webkit-box;
|
display: -ms-flexbox;
|
display: flex;
|
height: 50%;
|
-webkit-box-align: center;
|
-ms-flex-align: center;
|
align-items: center;
|
.sjtlt {
|
width: 33%;
|
margin-left: 0.4rem;
|
}
|
}
|
}
|
}
|
.list-data {
|
width: 100%;
|
background-color: #fff;
|
|
.header-box {
|
padding: 20px 15px;
|
|
color: rgb(140, 159, 173);
|
}
|
}
|
|
.item {
|
// width: 100%;
|
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: 4rem;
|
text-align: left;
|
color: #14181f;
|
}
|
.xgsgType {
|
border-radius: 0.1rem;
|
// background-color: rgba(102, 204, 153, 0.1);
|
border: 0.04rem solid #5ce398;
|
color: #5ce398;
|
text-align: center;
|
line-height: 35px;
|
}
|
.xgpsType {
|
border-radius: 0.1rem;
|
// background-color: rgba(102, 204, 153, 0.1);
|
border: 0.04rem solid #ba33a5;
|
color: #ba33a5;
|
text-align: center;
|
line-height: 35px;
|
}
|
</style>
|