|
@@ -1,5 +1,5 @@
|
|
<script setup>
|
|
<script setup>
|
|
-import {reactive, ref,watch} from 'vue'
|
|
|
|
|
|
+import {reactive, ref,watch,nextTick} from 'vue'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import ChartBox from './components/ChartBox.vue'
|
|
import ChartBox from './components/ChartBox.vue'
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
@@ -113,6 +113,7 @@ watch(
|
|
|
|
|
|
|
|
|
|
// 获取详情
|
|
// 获取详情
|
|
|
|
+let pageLoading=ref(false)
|
|
const chartListState = reactive({
|
|
const chartListState = reactive({
|
|
buy_list:{
|
|
buy_list:{
|
|
name:'多单',
|
|
name:'多单',
|
|
@@ -132,12 +133,14 @@ const chartListState = reactive({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
async function getInfo(){
|
|
async function getInfo(){
|
|
|
|
+ pageLoading.value=true
|
|
const res=await apiPositionAnalysisInfo({
|
|
const res=await apiPositionAnalysisInfo({
|
|
data_time:selectDate.value?moment(selectDate.value).format('YYYY-MM-DD'):'',
|
|
data_time:selectDate.value?moment(selectDate.value).format('YYYY-MM-DD'):'',
|
|
classify_name:route.query.classify_name,
|
|
classify_name:route.query.classify_name,
|
|
classify_type:route.query.classify_type,
|
|
classify_type:route.query.classify_type,
|
|
exchange:route.query.exchange
|
|
exchange:route.query.exchange
|
|
})
|
|
})
|
|
|
|
+ pageLoading.value=false
|
|
if(res.code===200){
|
|
if(res.code===200){
|
|
const obj=res.data||{}
|
|
const obj=res.data||{}
|
|
for (let key in chartListState) {
|
|
for (let key in chartListState) {
|
|
@@ -154,6 +157,25 @@ async function getInfo(){
|
|
chartListState[key].list=null
|
|
chartListState[key].list=null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ nextTick(()=>{
|
|
|
|
+ // 获取页面实际高度 传给pc端
|
|
|
|
+ const pageEl=document.getElementsByClassName('chart-position-analysis-page')
|
|
|
|
+ window.parent.postMessage({
|
|
|
|
+ opt:'updateIframeHeight',
|
|
|
|
+ height:pageEl[0].offsetHeight
|
|
|
|
+ },"*")
|
|
|
|
+
|
|
|
|
+ // 传给pc当前的数据
|
|
|
|
+ window.parent.postMessage({
|
|
|
|
+ opt:'updateInfo',
|
|
|
|
+ data_time:selectDate.value?moment(selectDate.value).format('YYYY-MM-DD'):'',
|
|
|
|
+ classify_name:route.query.classify_name,
|
|
|
|
+ classify_type:route.query.classify_type,
|
|
|
|
+ exchange:route.query.exchange,
|
|
|
|
+ title:`${route.query.classify_type} ${moment(selectDate.value).format('YYYYMMDD')}持仓`
|
|
|
|
+ },"*")
|
|
|
|
+ })
|
|
}
|
|
}
|
|
getInfo()
|
|
getInfo()
|
|
|
|
|
|
@@ -174,11 +196,29 @@ function handleBackList(){
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+// 监听pc端传来的消息
|
|
|
|
+window.addEventListener('message',e=>{
|
|
|
|
+ // 监听选择的日期改变
|
|
|
|
+ if(e.data.opt=="date"){
|
|
|
|
+ selectDate.value=e.data.val
|
|
|
|
+ getInfo()
|
|
|
|
+ }else if(e.data.opt==='beforeDate'){
|
|
|
|
+ handleDateChange('before')
|
|
|
|
+ }else if(e.data.opt==='nextDate'){
|
|
|
|
+ handleDateChange('next')
|
|
|
|
+ }else if(e.data.opt==='beforeClassifyType'){
|
|
|
|
+ handleClassifyTypeChange('before')
|
|
|
|
+ }else if(e.data.opt==='nextClassifyType'){
|
|
|
|
+ handleClassifyTypeChange('next')
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<PullRefresh v-model="isRefresh" @refresh="onRefresh">
|
|
<PullRefresh v-model="isRefresh" @refresh="onRefresh">
|
|
- <div class="chart-position-analysis-page">
|
|
|
|
|
|
+ <div class="chart-position-analysis-page" v-if="!pageLoading">
|
|
<div class="top-sticky-wrap">
|
|
<div class="top-sticky-wrap">
|
|
<div class="notice-box">如无法滑动,请在左侧空白处尝试</div>
|
|
<div class="notice-box">如无法滑动,请在左侧空白处尝试</div>
|
|
<div class="action-box">
|
|
<div class="action-box">
|
|
@@ -321,4 +361,31 @@ function handleBackList(){
|
|
text-align: center;
|
|
text-align: center;
|
|
padding-top: 300px;
|
|
padding-top: 300px;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+@media (min-width: 400px){
|
|
|
|
+ .chart-position-analysis-page{
|
|
|
|
+ padding: 0;
|
|
|
|
+ .top-sticky-wrap{
|
|
|
|
+ display: none;
|
|
|
|
+ }
|
|
|
|
+ .bot-fixed-wrap{
|
|
|
|
+ display: none;
|
|
|
|
+ }
|
|
|
|
+ .empty-wrap{
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+ .chart-wrap{
|
|
|
|
+ margin-bottom: 60px;
|
|
|
|
+ .top-info-box{
|
|
|
|
+ padding: 0 20px 20px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ span{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin-right: 30px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|