瀏覽代碼

持仓分析屏蔽刷新 限制查看后一天

Karsa 1 年之前
父節點
當前提交
826a9dd85e
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      src/views/hzyb/chart/positionAnalysis/Index.vue

+ 6 - 3
src/views/hzyb/chart/positionAnalysis/Index.vue

@@ -17,6 +17,7 @@ const isPcShow=ref(route.query.showType||'')
 let showDate=ref(false)
 const minDate=ref(new Date('2000/01/01'))
 let currentDate=ref('')//这是绑定在时间选择器的时间防止用户滑动了时间但是没点确定 这时候又把这个时间改成selectDate
+let latestDate=ref('') //最新更新时间
 let selectDate=ref('')
 function confirmSelectDate(e){
     // 如果选择的是 周六日 提示
@@ -152,6 +153,7 @@ async function getInfo(){
             selectDate.value=moment(res.data.data_time).toDate()
             currentDate.value=moment(res.data.data_time).toDate()
         }
+        latestDate.value = res.data.last_data_time
         document.title=`${route.query.classify_type} ${moment(selectDate.value).format('YYYYMMDD')}持仓`
     }else{
         // 清空数据
@@ -183,6 +185,7 @@ async function getInfo(){
         window.parent.postMessage({
             opt:'updateInfo',
             data_time:selectDate.value?moment(selectDate.value).format('YYYY-MM-DD'):'',
+            latestDate:latestDate.value,
             classify_name:route.query.classify_name,
             classify_type:route.query.classify_type,
             exchange:route.query.exchange,
@@ -230,7 +233,7 @@ window.addEventListener('message',e=>{
 </script>
 
 <template>
-    <PullRefresh v-model="isRefresh" @refresh="onRefresh">
+    <!-- <PullRefresh v-model="isRefresh" @refresh="onRefresh"> -->
     <div :class="['chart-position-analysis-page',isPcShow?'chart-position-analysis-page-pc':'']" v-if="!pageLoading">
         <div class="top-sticky-wrap">
             <div class="notice-box">如无法滑动,请在左侧空白处尝试</div>
@@ -241,7 +244,7 @@ window.addEventListener('message',e=>{
                     @click="showDate=true"
                 >{{selectDate?moment(selectDate).format('YYYY-MM-DD'):'选择日期'}}</div>
                 <span style="color:#E3B377" @click="handleDateChange('before')">前一天</span>
-                <span style="color:#E3B377" @click="handleDateChange('next')">后一天</span>
+                <span style="color:#E3B377" @click="handleDateChange('next')" v-show="selectDate?moment(selectDate).valueOf()<moment(latestDate).valueOf():true">后一天</span>
             </div>
         </div>
         <div class="empty-wrap" v-if="!chartListState.buy_list.list">
@@ -265,7 +268,7 @@ window.addEventListener('message',e=>{
         </div>
 
     </div>
-    </PullRefresh>
+    <!-- </PullRefresh> -->
     <!-- 选择时间弹窗 -->
     <Popup
         v-model:show="showDate"