Browse Source

修改币币、合约、资产没有数据时提示文字,修改消息通知的报错,修改k线时间

master
liaoxinyu 1 year ago
parent
commit
a2d1b768a9
  1. 4
      pages/base/home.vue
  2. 10
      pages/notice/index.vue
  3. 2
      pages/safe/email.vue
  4. 45
      static/chart_main/sevencoin.js

4
pages/base/home.vue

@ -851,14 +851,14 @@
</view> </view>
<van-icon name="arrow" class="fn-18" /> <van-icon name="arrow" class="fn-18" />
</v-link> </v-link>
<v-link :to="`/pages/help/detail?id=${167}`" tag="div" <!-- <v-link :to="`/pages/help/detail?id=${167}`" tag="div"
class="per-bot p-y-md p-x-sm d-flex align-center justify-between"> class="per-bot p-y-md p-x-sm d-flex align-center justify-between">
<view class="d-flex align-center"> <view class="d-flex align-center">
<img :src="$localImgUrl('icon5.png')" alt="" class="h-20 m-r-xs" /> <img :src="$localImgUrl('icon5.png')" alt="" class="h-20 m-r-xs" />
<span class="color-light">{{$t('first.a1')}}</span> <span class="color-light">{{$t('first.a1')}}</span>
</view> </view>
<van-icon name="arrow" class="fn-18" /> <van-icon name="arrow" class="fn-18" />
</v-link> </v-link> -->
<!-- <view class="per-bot p-y-md p-x-sm d-flex align-center"> <!-- <view class="per-bot p-y-md p-x-sm d-flex align-center">
<img :src="$localImgUrl('Page6.png')" alt="" class="h-20 m-r-xs" /> <img :src="$localImgUrl('Page6.png')" alt="" class="h-20 m-r-xs" />
<span class="color-light"> <span class="color-light">

10
pages/notice/index.vue

@ -21,11 +21,11 @@
<v-paging class="layout-main" :key="1" :ajax="article" :data="{type:'notice'}" v-if="active==0"> <v-paging class="layout-main" :key="1" :ajax="article" :data="{type:'notice'}" v-if="active==0">
<template #box="list"> <template #box="list">
<view class="list m-t-md" key="ul1"> <view class="list m-t-md" key="ul1">
<v-link tag="li" :to="{path:'/pages/notice/detail',query:{id:item.id}}" class="item d-flex p-md align-center m-x-md m-b-xs bg-panel-3 rounded box-shadow" v-for="item in $list(list)" :key="item.id"> <v-link tag="li" v-if="item.title!==null" :to="{path:'/pages/notice/detail',query:{id:item.id}}" class="item d-flex p-md align-center m-x-md m-b-xs bg-panel-3 rounded box-shadow" v-for="item in $list(list)" :key="item.id">
<view class="flex-fill"> <view class="flex-fill">
<view class="title color-light eps-2 m-b-xs">{{item.title}}</view> <view class="title color-light eps-2 m-b-xs">{{item.title}}</view>
<!-- <view class="time fn-sm">{{item.created_at}}</view> --> <view class="time fn-sm">{{item.created_at}}</view>
<view class="time fn-sm">{{item.created_ats| parseTime}}</view> <!-- <view class="time fn-sm">{{item.created_ats| parseTime}}</view> -->
</view> </view>
<van-icon name="arrow" /> <van-icon name="arrow" />
</v-link> </v-link>
@ -39,8 +39,8 @@
<v-link tag="li" :to="{path:'/pages/notice/msg-detail',query:{id:item.id}}" class="item d-flex p-md align-center m-x-md m-b-xs bg-panel-3 rounded box-shadow" v-for="item in $list(list)" :key="item.id"> <v-link tag="li" :to="{path:'/pages/notice/msg-detail',query:{id:item.id}}" class="item d-flex p-md align-center m-x-md m-b-xs bg-panel-3 rounded box-shadow" v-for="item in $list(list)" :key="item.id">
<view class="flex-fill"> <view class="flex-fill">
<view class="title color-light eps-2 m-b-xs">{{item.data.title}}</view> <view class="title color-light eps-2 m-b-xs">{{item.data.title}}</view>
<!-- <view class="time fn-sm">{{item.created_at}}</view> --> <view class="time fn-sm">{{item.created_at}}</view>
<view class="time fn-sm">{{item.created_ats| parseTime}}</view> <!-- <view class="time fn-sm">{{item.created_ats| parseTime}}</view> -->
</view> </view>
<van-icon name="arrow" /> <van-icon name="arrow" />
</v-link> </v-link>

2
pages/safe/email.vue

@ -38,7 +38,7 @@
</view> </view>
</main> </main>
<view class="p-md bg-panel-4"> <view class="p-md bg-panel-4">
<v-button block class="w-max" type="theme" ref="btn" @click="chnageEmail">{{user.email?$t('safe.a0'):$t('safe.a1')}}</v-button> <!-- <v-button block class="w-max" type="theme" ref="btn" @click="chnageEmail">{{user.email?$t('safe.a0'):$t('safe.a1')}}</v-button> -->
</view> </view>
<van-toast id="van-toast" /> <van-toast id="van-toast" />
</v-page> </v-page>

45
static/chart_main/sevencoin.js

@ -233,9 +233,9 @@ $(function () {
} }
let zhangdiefu=(bar.close-bar.open)/bar.open let zhangdiefu=(bar.close-bar.open)/bar.open
let zhangdiee=bar.close-bar.open let zhangdiee=bar.close-bar.open
const times = new Date().toLocaleString("en-US", {timeZone: "America/New_York", hour: 'numeric', minute: 'numeric', hour12: false}); // const times = new Date().toLocaleString("en-US", {timeZone: "America/New_York", hour: 'numeric', minute: 'numeric', hour12: false});
// tvQuoter.find('[data-name="date"]').text(this.timestampToTime(bar.time)); // tvQuoter.find('[data-name="date"]').text(times);
tvQuoter.find('[data-name="date"]').text(times); tvQuoter.find('[data-name="date"]').text(this.timestampToTime(bar.time));
tvQuoter.find('[data-name="date_lang"]').text(this.lang=='zh-CN'?'时间':'Date'); tvQuoter.find('[data-name="date_lang"]').text(this.lang=='zh-CN'?'时间':'Date');
tvQuoter.find('[data-name="open"]').text(bar.open); tvQuoter.find('[data-name="open"]').text(bar.open);
tvQuoter.find('[data-name="open_lang"]').text(this.lang=='zh-CN'?'开':'Open'); tvQuoter.find('[data-name="open_lang"]').text(this.lang=='zh-CN'?'开':'Open');
@ -255,10 +255,10 @@ $(function () {
tvQuoter.find('[data-name="zhangdiee"]').css('color',zhangdiee>0?'#53b987':'#eb4d5c'); tvQuoter.find('[data-name="zhangdiee"]').css('color',zhangdiee>0?'#53b987':'#eb4d5c');
} }
timestampToTime(timestamp) { timestampToTime(timestamp) {
const thirteenHoursMs = 13 * 3600 * 1000;//修改时间只需要修改 那个13就行了 const dates = new Date(timestamp);
const adjustedTimestamp = timestamp - thirteenHoursMs; const resolutionTime = this.getResolutionTime()
// const adjustedTimestamp = timestamp; const date = resolutionTime === 1 ? dates : this.adjustToEasternTime(dates);
const date = new Date(adjustedTimestamp);
const yyyy = `${date.getFullYear()}`; const yyyy = `${date.getFullYear()}`;
const yy = `${date.getFullYear()}`.substr(2); const yy = `${date.getFullYear()}`.substr(2);
const MM = `0${date.getMonth() + 1}`.slice(-2); const MM = `0${date.getMonth() + 1}`.slice(-2);
@ -276,6 +276,37 @@ $(function () {
} }
return dateStr return dateStr
} }
adjustToEasternTime(date) {
// 将给定日期转换为时间戳
const timestamp = date.getTime();
// 获取美国东部时区偏移值(以分钟为单位)
// const easternOffset = -240; // 美国东部时区偏移值为 -240 分钟
// 获取东部时间的偏移值(分钟)
let easternOffset = 1260; // 标准时间(EST)
if (this.dateIsInEDT(date)) {
easternOffset = 1200; // 夏令时(EDT)
}
// 调整时间为美国东部时间
const adjustedTime = timestamp - (date.getTimezoneOffset() + easternOffset) * 60 * 1000;
// 创建新的日期对象,并使用调整后的时间戳
const adjustedDate = new Date(adjustedTime);
// 返回调整后的日期对象
return adjustedDate;
}
// 判断日期是否在夏令时(简化的逻辑,实际应用中需要考虑更多的边界情况)
dateIsInEDT(date) {
const year = date.getUTCFullYear();
const start = new Date(Date.UTC(year, 2, 13, 7)); // March, 2nd Sunday
const end = new Date(Date.UTC(year, 10, 6, 6)); // November, 1st Sunday
start.setUTCDate(14 - start.getUTCDay());
end.setUTCDate(7 - end.getUTCDay());
return date >= start && date < end;
}
getResolutionTime() { getResolutionTime() {
const resolution = this.TView.chart().resolution(); const resolution = this.TView.chart().resolution();
switch (resolution) { switch (resolution) {

Loading…
Cancel
Save