<template>
|
<div>
|
<div class="zixuancontainer">
|
<Newheader ref="newheader"></Newheader>
|
<div class="newguheader">
|
<div :class="idx == 0 ? 'newguheaderactive' : ''" @click="firstselect">
|
{{$t('hj261')}}
|
</div>
|
<div :class="idx == 1 ? 'newguheaderactive' : ''" @click="twoselect">
|
{{$t('hj268')}}
|
</div>
|
</div>
|
<div style="background: #25262a;" v-if="idx == 0">
|
<el-table
|
:data="dazongList"
|
:highlight-current-row="false"
|
border
|
style="width: 100%"
|
v-loading="loading"
|
element-loading-spinner="el-icon-loading"
|
element-loading-background="rgba(37,38,42, 0.8)"
|
:height="tableHeight"
|
@row-click="handleTableRow"
|
:header-cell-style="{
|
padding: '2px 0',
|
background: 'rgb(37,38,42)',
|
color: '#9d9d9d',
|
'font-size': '12px'
|
}"
|
>
|
<el-table-column prop="name" :label="$t('MingCheng')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.stockName ? scope.row.stockName : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="code" :label="$t('dm')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.stockCode ? scope.row.stockCode : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="price" :label="$t('xj')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.price ? scope.row.price : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="stockNum" :label="$t('zxmgl')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.stockNum ? scope.row.stockNum : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="startTime" :label="$t('kstime')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.startTime | formatTime(that) }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="endTime" :label="$t('jstime')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.endTime | formatTime(that) }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="type" :label="$t('lx')">
|
<template slot-scope="scope">
|
<span
|
style="cursor: pointer;"
|
class="contents"
|
:class="'reds'"
|
>
|
<span v-if="scope.row.stockType == 'sz'">{{$t('hj258')}}</span>
|
<span class="sh" v-if="scope.row.stockType == 'sh'">{{$t('hj259')}}</span>
|
<span class="bj" v-if="scope.row.stockType == 'bj'">{{$t('hj260')}}</span>
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="endTime" :label="$t('cz')">
|
<template>
|
<span class="contents">
|
<el-button type="info" size="mini">{{$t('hj238')}}</el-button>
|
</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div style="background: #25262a;" v-if="idx == 1">
|
<el-table
|
:data="shengouList"
|
:highlight-current-row="false"
|
border
|
style="width: 100%"
|
v-loading="loading"
|
element-loading-spinner="el-icon-loading"
|
element-loading-background="rgba(37,38,42, 0.8)"
|
:height="tableHeight"
|
:header-cell-style="{
|
padding: '2px 0',
|
background: 'rgb(37,38,42)',
|
color: '#9d9d9d',
|
'font-size': '12px'
|
}"
|
>
|
<el-table-column prop="stockName" :label="$t('MingCheng')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.stockName ? scope.row.stockName : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="stockCode" :label="$t('dm')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.stockCode ? scope.row.stockCode : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="orderTotalPrice" :label="$t('mrjg')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.orderTotalPrice ? scope.row.orderTotalPrice : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="orderNum" :label="$t('hj57')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.orderNum ? scope.row.orderNum : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="buyOrderPrice" :label="$t('dddj')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.buyOrderPrice ? scope.row.buyOrderPrice : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="buyOrderId" :label="$t('ddbh')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.buyOrderId ? scope.row.buyOrderId : "--" }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="addTime" :label="$t('hj273')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.buyOrderTime | formatTime(that) }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="type" :label="$t('lx')">
|
<template slot-scope="scope">
|
<span style="cursor: pointer;" class="contents" :class="'reds'">
|
<span v-if="scope.row.stockGid.indexOf('sz') >= 0">{{$t('hj258')}}</span>
|
<span class="sh" v-if="scope.row.stockGid.indexOf('sh') >= 0"
|
>{{$t('hj259')}}</span
|
>
|
<span class="bj" v-if="scope.row.stockGid.indexOf('bj') >= 0"
|
>{{$t('hj260')}}</span
|
>
|
</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<Newfooter></Newfooter>
|
<el-dialog
|
:title="$t('hj261') + currentitem.stockCode + ')'"
|
center
|
:visible.sync="dialogVisible"
|
width="400px"
|
>
|
<div>
|
<el-input :placeholder="$t('qsrgms')" v-model="num"></el-input>
|
<div class="shengoutime">
|
<p>{{$t('hj263')}}{{ (num * currentitem.price * 100).toFixed(2) }}</p>
|
</div>
|
</div>
|
<div>
|
<el-input :placeholder="$t('hj264')" v-model="password"></el-input>
|
<div class="shengoutime">
|
<p>{{$t('hj54')}}{{ userData.enableAmt }}</p>
|
</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="dialogVisible = false">{{$t('qxx')}}</el-button>
|
<el-button type="primary" @click="getshengou">{{$t('hj85')}}</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</div>
|
</template>
|
<script>
|
import * as api from "../../axios/api";
|
import Newheader from "@/components/newheader";
|
import Newfooter from "@/components/newfooters";
|
export default {
|
components: {
|
Newheader,
|
Newfooter
|
},
|
data() {
|
return {
|
windowWidth: document.documentElement.clientWidth, //实时屏幕宽度
|
windowHeight: document.documentElement.clientHeight, //实时屏幕高
|
tableHeight: document.documentElement.clientHeight - 104 + "px",
|
keyWords: "",
|
pageNum: 1,
|
pageSize: 15,
|
zixuanlist: [],
|
loading: true,
|
isshow: true,
|
dialogVisible: false,
|
|
that: this,
|
currentitem: {},
|
idx: 0,
|
dazongList: [],
|
shengouList: [],
|
num: "",
|
password: "",
|
userData: ""
|
};
|
},
|
computed: {},
|
watch: {
|
windowHeight(val) {
|
let that = this;
|
console.log("实时屏幕高度:", val, that.windowHeight);
|
},
|
windowWidth(val) {
|
let that = this;
|
console.log("实时屏幕宽度:", val, that.windowHeight);
|
}
|
},
|
mounted() {
|
var that = this;
|
window.onresize = () => {
|
return (() => {
|
window.fullHeight = document.documentElement.clientHeight;
|
window.fullWidth = document.documentElement.clientWidth;
|
that.windowHeight = window.fullHeight; // 高
|
that.windowWidth = window.fullWidth; // 宽
|
that.$nextTick(() => {
|
that.tableHeight = that.windowHeight - 104 + "px";
|
});
|
})();
|
};
|
this.stockgetDzList();
|
this.getUserInfo();
|
},
|
beforeDestroy() {
|
window.onresize = null;
|
this.isshow = false;
|
},
|
filters: {
|
formatTime(value, that) {
|
if (value) {
|
return that.dayjs(value).format("YYYY-MM-DD HH:mm:ss");
|
} else {
|
return "--";
|
}
|
}
|
},
|
methods: {
|
getrenjiao(val) {
|
this.$confirm(this.$t('hj251'), this.$t('hj165'), {
|
confirmButtonText: this.$t('hj161'),
|
cancelButtonText: this.$t('hj106'),
|
type: "warning"
|
})
|
.then(async () => {
|
let opt = {
|
id: val
|
};
|
let data = await api.submitSubscribe(opt);
|
if (data.status == 0) {
|
this.$message({
|
message: data.msg,
|
type: "success"
|
});
|
this.getnewguRecord();
|
this.$refs.newheader.getUserInfo();
|
} else {
|
this.$message({
|
message: data.msg,
|
type: "error"
|
});
|
}
|
})
|
.catch(() => {});
|
},
|
firstselect() {
|
this.idx = 0;
|
this.pageNum = 1;
|
this.dazongList = [];
|
this.loading = true;
|
(this.tableHeight = document.documentElement.clientHeight - 104 + "px"),
|
this.stockgetDzList();
|
},
|
twoselect() {
|
this.idx = 1;
|
this.pageNum = 1;
|
this.shengouList = [];
|
this.getUserNewGuList();
|
},
|
|
async getUserNewGuList() {
|
let data = await api.buyStockDzList();
|
if (data.status == 0) {
|
this.shengouList = data.data;
|
}
|
},
|
async stockgetDzList() {
|
let res = await api.stockgetDzList();
|
if (res.status == 0) {
|
this.dazongList = res.data;
|
this.loading = false;
|
}
|
},
|
handleTableRow(row, event, column) {
|
console.log(row, event, column);
|
this.dialogVisible = true;
|
this.currentitem = row;
|
},
|
async getUserInfo() {
|
let data = await api.getUserInfo();
|
if (data.status == 0) {
|
this.userData = data.data;
|
}
|
},
|
async getshengou() {
|
if (!this.num) {
|
this.show = false;
|
this.$message.warning(this.$t('hj262'));
|
return;
|
}
|
if (!this.password) {
|
this.show = false;
|
this.$message.warning(this.$t('hj264'));
|
return;
|
}
|
var opt = {
|
stockCode: this.currentitem.stockCode,
|
password: this.password,
|
num: this.num * 100
|
};
|
let res = await api.buyStockDz(opt);
|
if (res.status == 0) {
|
this.$message.success(this.$t('hj265'));
|
this.num = "";
|
this.password = "";
|
this.getUserInfo();
|
} else {
|
this.$message.error(res.msg);
|
}
|
this.show = false;
|
}
|
}
|
};
|
</script>
|
<style lang="less" scoped>
|
.bgblue {
|
color: #1890ff;
|
background: #e6f7ff;
|
border-color: #91d5ff;
|
padding: 2px 7px;
|
font-size: 12px;
|
border-radius: 2px;
|
}
|
|
.bgpurple {
|
color: #722ed1;
|
background: #f9f0ff;
|
border-color: #d3adf7;
|
padding: 2px 7px;
|
font-size: 12px;
|
border-radius: 2px;
|
}
|
|
.el-table {
|
background: #25262a;
|
}
|
|
/deep/ .el-table__body td {
|
color: #fff !important;
|
font-size: 14px;
|
}
|
|
/deep/ .el-table tbody tr:hover > td,
|
.el-table tbody tr:hover > tr,
|
.el-table tbody tr:hover .el-table tbody tr td {
|
background-color: rgb(33, 59, 76) !important;
|
background: rgb(33, 59, 76) !important;
|
}
|
|
// /deep/.el-table--enable-row-hover .el-table__body tr:hover > td {
|
// background-color: rgb(19, 75, 132) !important; //颜色必须是rgb
|
// }
|
/deep/ .el-table__body-wrapper {
|
background-color: rgb(37, 38, 42) !important;
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-corner {
|
width: 8px;
|
height: 8px;
|
display: none;
|
}
|
|
/deep/ .el-table--border::after,
|
.el-table--group::after,
|
.el-table::before {
|
background-color: rgb(37, 38, 42);
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
|
background: rgb(37, 38, 42);
|
/*滚动条里面小方块*/
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-track {
|
// -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
border-radius: unset;
|
/*滚动条的背景区域的圆角*/
|
background-color: rgb(37, 38, 42);
|
/*滚动条的背景颜色*/
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
|
border-radius: unset;
|
/*滚动条的圆角*/
|
// -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
background-color: rgb(50, 51, 55);
|
/*滚动条的背景颜色*/
|
}
|
|
.greens {
|
color: rgb(22, 135, 64) !important;
|
}
|
|
.blues {
|
color: rgb(3, 182, 191) !important;
|
}
|
|
.reds {
|
color: rgb(237, 58, 59) !important;
|
}
|
|
.zixuancontainer {
|
background: #25262a;
|
height: calc(100vh - 34px);
|
overflow: unset;
|
|
.newguheader {
|
display: flex;
|
align-items: center;
|
color: #c9c9c9;
|
height: 30px;
|
font-size: 12px;
|
background: #323337;
|
|
div {
|
padding: 0 20px;
|
line-height: 30px;
|
cursor: pointer;
|
border: 1px solid #4a4b51;
|
}
|
|
.newguheaderactive {
|
background: rgb(74, 75, 81);
|
color: #fff;
|
}
|
}
|
|
.renjiao {
|
text-align: center;
|
color: #c9c9c9;
|
cursor: pointer;
|
border: 1px solid #757575;
|
padding: 0 6px;
|
border-radius: 4px;
|
background: rgb(50, 51, 55);
|
}
|
|
.shengoutime {
|
line-height: 2;
|
margin-bottom: 10px;
|
color: #999;
|
}
|
}
|
</style>
|