Browse Source

修改时间问题

master
liaoxinyu 4 months ago
parent
commit
e873969a40
  1. 20
      pages/assets/draw1.vue
  2. 36
      pages/exchange/time-sharing.vue
  3. 10
      pages/notice/index.vue
  4. 37
      static/chart_main/sevencoin.js
  5. 2
      static/js/jquery3_5_1.min.js
  6. 1
      static/js/pako1_0_9.min.js
  7. 1
      static/js/qs6_9_4.min.js
  8. 7
      static/tradingview.html

20
pages/assets/draw1.vue

@ -18,7 +18,7 @@
<el-steps direction="vertical" :active="active" style="min-height: 260px !important;width: 100%;box-sizing: border-box;"> <el-steps direction="vertical" :active="active" style="min-height: 260px !important;width: 100%;box-sizing: border-box;">
<el-step :title="$t('common.c21')" style="flex-basis: 110px;"> <el-step :title="$t('common.c21')" style="flex-basis: 110px;">
<template slot="description"> <template slot="description">
<view class="d-flex justify-between m-t-md" @click="coinListShow=true" style="border: 1px solid #4e4e5d;padding: 10px;"> <view class="d-flex justify-between m-t-md rounded-xs" @click="coinListShow=true" style="border: 1px solid #DCDFE6;padding: 10px;background-color: #fff;">
<view class="fn-20 color-light">{{ coin }}</view> <view class="fn-20 color-light">{{ coin }}</view>
<view class="d-flex align-center"> <view class="d-flex align-center">
{{ $t('recharge.a0') }} {{ $t('recharge.a0') }}
@ -30,7 +30,7 @@
<el-step :title="$t('common.c17')"> <el-step :title="$t('common.c17')">
<template slot="description"> <template slot="description">
<view style="margin: 10px 0px;width: 540rpx;"> <view style="margin: 10px 0px;width: 540rpx;">
<v-input @input="addressnum" v-model="form.address" class="bg-form-panel-3 color-light w-max fn-13 rounded-xs" :placeholder="$t('assets.b9')"></v-input> <v-input @input="addressnum" v-model="form.address" style="background-color: #fff;padding: 24rpx;color: #000;" class="rounded-xs" :placeholder="$t('assets.b9')"></v-input>
<el-select v-model="form.addressType" @change="enteraddressType" style="margin-top: 10px;width: 100%;" class="addressType" v-if="coin=='USDT'" :placeholder="$t('common.select')"> <el-select v-model="form.addressType" @change="enteraddressType" style="margin-top: 10px;width: 100%;" class="addressType" v-if="coin=='USDT'" :placeholder="$t('common.select')">
<el-option v-for="(item, index) in network" :key="index" :label="item.name" :value="item.id"> <el-option v-for="(item, index) in network" :key="index" :label="item.name" :value="item.id">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
@ -41,8 +41,8 @@
</el-step> </el-step>
<el-step :title="$t('common.c18')" v-if="form.address"> <el-step :title="$t('common.c18')" v-if="form.address">
<template slot="description"> <template slot="description">
<view style="margin: 10px 0px;color: #fff;width: 540rpx;"> <view style="margin: 10px 0px;color: #000;width: 540rpx;">
<v-input @input="amountnum" v-model="form.amount" :min="withdrawFee.withdrawal_min" :max="withdrawFee.withdrawal_max" class="color-light fn-13" :placeholder="$t('assets.c2')"></v-input> <v-input @input="amountnum" v-model="form.amount" :min="withdrawFee.withdrawal_min" :max="withdrawFee.withdrawal_max" style="background-color: #fff;padding: 24rpx;color: #000;" class="rounded-xs" :placeholder="$t('assets.c2')"></v-input>
<view class="d-flex justify-between align-end" style="margin: 10px 0px;"> <view class="d-flex justify-between align-end" style="margin: 10px 0px;">
<view style="width: 100%;">{{ $t("assets.c1") }}{{ withdrawFee.usable_balance }}{{ coin }}</view> <view style="width: 100%;">{{ $t("assets.c1") }}{{ withdrawFee.usable_balance }}{{ coin }}</view>
<view style="width: 100%;text-align: right;">{{$t('common.c23')}}{{timeFormat}}</view> <view style="width: 100%;text-align: right;">{{$t('common.c23')}}{{timeFormat}}</view>
@ -53,16 +53,16 @@
<el-step :title="$t('common.c13')" v-if="form.amount"> <el-step :title="$t('common.c13')" v-if="form.amount">
<template slot="description"> <template slot="description">
<view style="margin: 10px 0px;color: #fff;width: 540rpx;"> <view style="margin: 10px 0px;color: #fff;width: 540rpx;">
<v-input type="password" @input="withdrawalnum" v-model="form.withdrawal_psw" class="color-light w-max fn-13 rounded-xs" :placeholder="$t('common.c14')"></v-input> <v-input type="password" @input="withdrawalnum" v-model="form.withdrawal_psw" style="background-color: #fff;padding: 24rpx;color: #000;" class="rounded-xs" :placeholder="$t('common.c14')"></v-input>
</view> </view>
</template> </template>
</el-step> </el-step>
<el-step :title="$t('safe.a5')" v-if="form.withdrawal_psw"> <el-step :title="$t('safe.a5')" v-if="form.withdrawal_psw">
<template slot="description"> <template slot="description">
<view style="margin: 10px 0px;color: #fff;width: 540rpx;display: flex;"> <view style="margin: 10px 0px;color: #fff;width: 490rpx;display: flex;background-color: #fff;padding: 0rpx 24rpx;" class="rounded-xs">
<v-input type="text" v-model="form.emailcode" class="w-max color-light fn-13" :placeholder="$t('safe.a6')"></v-input> <v-input type="text" v-model="form.emailcode" class="w-max color-light fn-13" :placeholder="$t('safe.a6')"></v-input>
<view class="d-flex" style="justify-content: space-between;align-items: center;"> <view class="d-flex" style="justify-content: space-between;align-items: center;">
<view style="width: 180rpx;text-align: center;" class="all color-light m-l-md flex-shrink fn-12 getCode" @click="getEmailCode"> <view style="width: 180rpx;text-align: center;color: #000;" class="all color-light m-l-md flex-shrink fn-12 getCode" @click="getEmailCode">
<text v-if="!getEmailCodeLock">{{ $t("common.getCode") }}</text> <text v-if="!getEmailCodeLock">{{ $t("common.getCode") }}</text>
<text v-else>{{ daojishi }}</text> <text v-else>{{ daojishi }}</text>
</view> </view>
@ -380,7 +380,7 @@
color: #303133 !important; color: #303133 !important;
} }
::v-deep .el-input__inner{ ::v-deep .el-input__inner{
background-color: #242424; background-color: #fff;
} }
::v-deep .is-process .el-step__icon.is-text{ ::v-deep .is-process .el-step__icon.is-text{
border-color: #C0C4CC; border-color: #C0C4CC;
@ -393,13 +393,13 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: #f1f1f1; background-color: rgba(255, 255, 255, 0.8);
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.modal-content { .modal-content {
background-color: #1f1f1f; background-color: #fff;
padding: 20px; padding: 20px;
border-radius: 5px; border-radius: 5px;
width: 550rpx; width: 550rpx;

36
pages/exchange/time-sharing.vue

@ -101,10 +101,44 @@ export default {
break; break;
} }
}, },
isDSTByRules() {
const now = new Date();
const year = now.getUTCFullYear();
// 3 2:00 AM EDT
const dstStart = this.getNthSunday(year, 2, 2, 2); // 0 2=3
// 11 2:00 AM EST
const dstEnd = this.getNthSunday(year, 10, 1, 2); // 0 10=11
return now >= dstStart && now < dstEnd;
},
// nm0
getNthSunday(year, month, occurrence, hour) {
if (month === 10 && occurrence === 1) {
const date = new Date(year, 10, 3); // 113
date.setHours(hour, 0, 0, 0);
return date;
}
let date = new Date(year, month, 1);
let count = 0;
while (true) {
if (date.getDay() === 0) {
if (++count === occurrence) {
date.setHours(hour);
return date;
}
}
date.setDate(date.getDate() + 1);
}
},
intiChart($box) { intiChart($box) {
let timeData = this.isDSTByRules()
highstock.setOptions({ highstock.setOptions({
global: { global: {
timezoneOffset: -8 * 60, timezoneOffset: timeData ? 16 * 60 : 16 * 60,
}, },
}); });

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" :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>

37
static/chart_main/sevencoin.js

@ -253,9 +253,7 @@ $(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 dates = new Date(timestamp); const date = this.adjustToEasternTime(timestamp);
const resolutionTime = this.getResolutionTime()
const date = resolutionTime === 1 ? dates : this.adjustToEasternTime(dates);
const yyyy = `${date.getFullYear()}`; const yyyy = `${date.getFullYear()}`;
const yy = `${date.getFullYear()}`.substr(2); const yy = `${date.getFullYear()}`.substr(2);
@ -276,20 +274,21 @@ $(function () {
} }
adjustToEasternTime(date) { adjustToEasternTime(date) {
// 将给定日期转换为时间戳 let timestamp;
const timestamp = date.getTime();
// 获取美国东部时区偏移值(以分钟为单位) // 判断日期是否在夏令时
// const easternOffset = -240; // 美国东部时区偏移值为 -240 分钟 const dates = new Date(date);
// 获取东部时间的偏移值(分钟) const isInEDT = this.dateIsInEDT(dates);
let easternOffset = 1260; // 标准时间(EST) // 根据是否在夏令时来调整时间
if (this.dateIsInEDT(date)) { if (isInEDT) {
easternOffset = 1200; // 夏令时(EDT) // 在夏令时期间
timestamp = date - (-28800000)+(new Date(new Date().getTime()).getTimezoneOffset()* 60 * 1000) - 43200000; // 使用43200000毫秒 = 12小时
} else {
// 在冬令时期间
timestamp = date - (-28800000)+(new Date(new Date().getTime()).getTimezoneOffset()* 60 * 1000) - 46800000; // 使用46800000毫秒 = 13小时
} }
// 调整时间为美国东部时间
const adjustedTime = timestamp - (date.getTimezoneOffset() + easternOffset) * 60 * 1000;
// 创建新的日期对象,并使用调整后的时间戳 // 创建新的日期对象,并使用调整后的时间戳
const adjustedDate = new Date(adjustedTime); const adjustedDate = new Date(timestamp);
// 返回调整后的日期对象 // 返回调整后的日期对象
return adjustedDate; return adjustedDate;
@ -297,12 +296,10 @@ $(function () {
// 判断日期是否在夏令时(简化的逻辑,实际应用中需要考虑更多的边界情况) // 判断日期是否在夏令时(简化的逻辑,实际应用中需要考虑更多的边界情况)
dateIsInEDT(date) { dateIsInEDT(date) {
const year = date.getUTCFullYear(); const year = date.getUTCFullYear();
const start = new Date(Date.UTC(year, 2, 13, 7)); // March, 2nd Sunday const start = new Date(Date.UTC(year, 2, 8, 18)); // March, 2nd Sunday
const end = new Date(Date.UTC(year, 10, 6, 6)); // November, 1st Sunday const end = new Date(Date.UTC(year, 10, 3, 18)); // November, 1st Sunday
start.setUTCDate(13 - start.getUTCDay());
start.setUTCDate(14 - start.getUTCDay()); end.setUTCDate(3 - end.getUTCDay());
end.setUTCDate(7 - end.getUTCDay());
return date >= start && date < end; return date >= start && date < end;
} }

2
static/js/jquery3_5_1.min.js

File diff suppressed because one or more lines are too long

1
static/js/pako1_0_9.min.js

File diff suppressed because one or more lines are too long

1
static/js/qs6_9_4.min.js

File diff suppressed because one or more lines are too long

7
static/tradingview.html

@ -22,9 +22,12 @@
<body> <body>
<div class="tradingview" id="tradingview_10798345"></div> <div class="tradingview" id="tradingview_10798345"></div>
</body> </body>
<script src="https://www.btcooc.com/newlink/mobile/jquery3_5_1.min.js"></script> <!-- <script src="https://www.btcooc.com/newlink/mobile/jquery3_5_1.min.js"></script>
<script src="https://www.btcooc.com/newlink/mobile/pako1_0_9.min.js"></script> <script src="https://www.btcooc.com/newlink/mobile/pako1_0_9.min.js"></script>
<script src="https://www.btcooc.com/newlink/mobile/qs6_9_4.min.js"></script> <script src="https://www.btcooc.com/newlink/mobile/qs6_9_4.min.js"></script> -->
<script src="./js/jquery3_5_1.min.js"></script>
<script src="./js/pako1_0_9.min.js"></script>
<script src="./js/qs6_9_4.min.js"></script>
<script src="./chart_main/charting_library.min.js"></script> <script src="./chart_main/charting_library.min.js"></script>
<script src="./chart_main/ws.js"></script> <script src="./chart_main/ws.js"></script>
<script src="./chart_main/sevencoin.js?v=2"></script> <script src="./chart_main/sevencoin.js?v=2"></script>

Loading…
Cancel
Save