Browse Source

修改合约保证金为2位小数点、提笔记录、k线为自动切换夏令时和冬令时、币种为动态数据、

master
liaoxinyu 9 months ago
parent
commit
9bab56c9b5
  1. 18
      api/home.js
  2. 26
      api/member.js
  3. 5
      i18n/lang/en.json
  4. 5
      i18n/lang/zh-TW.json
  5. 3
      pages.json
  6. 2
      pages/assets/coin-list.vue
  7. 54
      pages/assets/records.vue
  8. 37
      pages/base/home.vue
  9. 2
      pages/exchange/exchange-transaction.vue
  10. 4
      pages/exchange/open-position.vue
  11. 121
      pages/oncs/onservice.vue
  12. 35
      static/chart_main/sevencoin.js
  13. 1
      static/img/cs_w.svg
  14. 60
      utils/class/date.js

18
api/home.js

@ -20,6 +20,24 @@ class Home {
static option(data){
return Serve.post('/option',data)
}
/*
* 获取用户在线接口
*/
static online(){
return Serve.get('/online')
}
/*
* 获取未读消息
*/
static chat(){
return Serve.get('/user/chat')
}
/*
* 已读消息
*/
static chatRead(){
return Serve.get('/user/chatRead')
}
}
export default Home;

26
api/member.js

@ -128,17 +128,21 @@ class Member {
return server.get(`/contact`);
}
/**
* 获取图形验证码
* @param data {email,token}
*/
static Graph_che() {
return server.get(`/register/Graph_che`);
}
// 提币获取邮箱验证码
static getWdcode(data){
return server.get(`/user/wdcode`, data);
}
/**
* 获取图形验证码
* @param data {email,token}
*/
static Graph_che() {
return server.get(`/register/Graph_che`);
}
// 提币获取邮箱验证码
static getWdcode(data){
return server.get(`/user/wdcode`, data);
}
// 查询用户的帐号
static getUnameByUid(data){
return server.get(`/user/getUserName`, data);
}
}
export default Member;

5
i18n/lang/en.json

@ -109,7 +109,10 @@
"c5": "your transfer order has been submitted successfully, please wait patiently, and the transfer result will be notified by SMS or e-mail. Please check it carefully. If you have any questions, please contact the customer service in time.",
"c6": "Increase ratio",
"c7": "Current valuation",
"GraphicValidation": "Graphical verification"
"GraphicValidation": "Graphical verification",
"loading": "loading",
"c12": "Rejection Information",
"rejection":"Reason for rejection"
},
"base": {
"a0": "Title",

5
i18n/lang/zh-TW.json

@ -109,7 +109,10 @@
"c5": "您的劃轉訂單已提交成功,請耐心等待,劃轉結果會以簡訊或郵件的管道通知。請注意查收,如有疑問請及時聯系客服",
"c6": "漲幅比例",
"c7": "當前估值",
"GraphicValidation": "圖形驗證"
"GraphicValidation": "圖形驗證",
"loading": "加载中",
"c12": "駁回信息",
"rejection":"拒絕理由"
},
"base": {
"a0": "標題",

3
pages.json

@ -173,6 +173,9 @@
{
"path": "pages/service/service"
},
{
"path" : "pages/oncs/onservice"
},
{
"path": "pages/service/index",
"style": {

2
pages/assets/coin-list.vue

@ -8,7 +8,7 @@
<view class="layout-main">
<template v-for="item in showList">
<view
v-if="item.coin_name=='USDT'||item.coin_name=='BTC'||item.coin_name=='ETH'"
v-if="item.is_recharge!==0&&item.is_recharge!==null||item.is_withdraw!==0&&item.is_withdraw!==null"
class="p-y-md p-x-xs align-center justify-between d-flex link-active m-x-md border-b"
@click="$emit('input',item.coin_name);$emit('close');$emit('imgs',item)"
>

54
pages/assets/records.vue

@ -16,29 +16,39 @@
<view class="">
<table class="w-max">
<thead class="p-x-md">
<tr class="fn-sm p-x-md">
<th class="p-b-md fn-left p-l-md">{{ $t("assets.c9") }}</th>
<th class="p-b-md fn-left">{{ $t("assets.d0") }}</th>
<th class="p-b-md fn-right p-r-md">{{ $t("assets.c0") }}</th>
<tr class="fn-sm p-x-md" style="display: flex;align-items: center;">
<view class="p-b-md fn-left p-l-md" style="width: 30%;">{{ $t("assets.c9") }}</view>
<view class="p-b-md fn-left" style="width: 20%;">{{ $t("assets.d0") }}</view>
<view class="p-b-md fn-right p-r-md" style="width: 30%;">{{ $t("assets.c0") }}</view>
<view class="p-b-md fn-right" style="width: 10%;">{{ $t("exchange.g3") }}</view>
</tr>
</thead>
<tbody>
<tr class="color-light trChange p-x-md rounded-md" v-for="item in list" :key="item.id">
<td class="p-y-xs p-l-md rounded-tl-sm rounded-bl-sm fn-sm">
{{ item.datetime | parseTime }}
</td>
<td v-if="type=='draw'">
<view>{{ item.status_text }}</view>
</td>
<td v-if="type=='recharge'">
<view v-if="item.status==0">{{$t('assets.d1')}}</view>
<view v-if="item.status==1" class="color-buy">{{$t('assets.d2')}}</view>
<view v-if="item.status==2" class="color-sell">{{$t('assets.d3')}}</view>
</td>
<td class="fn-right p-r-md rounded-tr-sm rounded-br-sm">
{{ item.amount }}
<span class="color-default">({{ item.coin_name }})</span>
</td>
<view style="display: flex;align-items: center;">
<view class="p-y-xs p-l-md rounded-tl-sm rounded-bl-sm fn-sm" style="width: 30%;">
{{ item.datetime | parseTime }}
</view>
<view v-if="type=='draw'" style="width: 20%;">
<view>{{ item.status_text }}</view>
</view>
<view v-if="type=='recharge'">
<view v-if="item.status==0">{{$t('assets.d1')}}</view>
<view v-if="item.status==1" class="color-buy">{{$t('assets.d2')}}</view>
<view v-if="item.status==2" class="color-sell">{{$t('assets.d3')}}</view>
</view>
<view class="fn-right p-r-md rounded-tr-sm rounded-br-sm" style="width: 30%;">
{{ item.amount }}
<span class="color-default">({{ item.coin_name }})</span>
</view>
<view class="" v-if="item.status==0" style="width: 10%;">
<span style="color: #4381F6;width: 60px;height: 30px;font-size: 12px;"
@click="cancelWithdraw(item)">{{$t('exchange.g4')}}</span>
</view>
</view>
<view class="p-l-md" v-if="item.remark" style="color:red;word-wrap: break-word;width:632rpx;">
{{$t('common.rejection')}}{{item.remark}}
</view>
</tr>
<!-- <tr v-if="loadMore">
<td colspan="3" class="fn-center p-xs link-active" @click="more">
@ -105,6 +115,12 @@ import formData from "@/utils/class/date";
this.depositHistory();
}
},
cancelWithdraw(item) {
Wallet.cancelWithdraw({ withdraw_id: item.id }).then(res => {
this.$toast(this.$t('otc.d4'));
this.getWithdrawRecords()
})
},
},
onLoad(e) {
console.log('---------',e);

37
pages/base/home.vue

@ -733,6 +733,11 @@
<img src="@/static/img/pages6.png">
<view class="color-light">{{ $t("base.c6") }}</view>
</v-link>
<v-link :to="isLogin?'/pages/oncs/onservice':'/pages/login/index'" tag="div" class="manage_text" style="position: relative;">
<img src="@/static/img/cs_w.svg">
<span class="circle-pulse1" v-if="newscount!==0">{{newscount>=100?'99+':newscount}}</span>
<view class="color-light">{{$t('common.service')}}</view>
</v-link>
</view>
<view class="h-100"></view>
<view v-if="isLogin" class="Logout_color logout w-max fn-center color-light rounded-xs"
@ -784,6 +789,8 @@
},
data() {
return {
newscount:0,
visible: false,
infoActive: 1, //
marketList: [],
marketListHe: [],
@ -1212,6 +1219,19 @@
// #ifdef H5
window.open('https://app.ajcoins.com/download/index.html', '_blank') //
// #endif
},
chat(){
Home.chat().then(res => {
if(res.code==200){
this.newscount = res.data.count;
}else{
console.log('1111');
clearInterval(this.chatcount);
}
})
},
close1() {
this.visible = false;
}
},
mounted() {
@ -1221,6 +1241,9 @@
this.getCurrencyExCny();
this.getHelpList();
if (this.isLogin) {
this.chatcount = setInterval(()=>{
this.chat()
},5000)
this.createWalletAddress();
this.getAuthInfo()
this.personalAssets();
@ -1230,6 +1253,20 @@
};
</script>
<style lang="scss" scoped>
.circle-pulse1 {
background: red;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
height: 20px;
font-size: 12px;
border-radius: 50%;
position: absolute;
right: 25%;
top: -10px;
color: #fff;
}
// .colbg {
// background-color: $bg;
// }

2
pages/exchange/exchange-transaction.vue

@ -823,7 +823,7 @@ export default {
this.getDefaultPrice();
// let n = this.progress[this.sliderActive];// --
let n = this.sliderActive;// --
this.sliderChange(n, this.sliderActive);
// this.sliderChange(n, this.sliderActive);
},
//
getValue(amount) {

4
pages/exchange/open-position.vue

@ -741,7 +741,7 @@
</view>
</view>
<view class="p-x-md p-t-0">
<v-input class="p-sm rounded border m-t-sm" :placeholder="$t('contract.i3')" type="number"
<v-input class="p-sm rounded border m-t-sm" :placeholder="$t('contract.i3')"
v-model="strategyForm.tp_trigger_price">
<template #left>
<span class="color-default">{{ $t("contract.i4") }}</span>
@ -757,7 +757,7 @@
}}
USDT
</view> -->
<v-input class="p-sm rounded border m-t-sm" :placeholder="$t('contract.i3')" type="number"
<v-input class="p-sm rounded border m-t-sm" :placeholder="$t('contract.i3')"
v-model="strategyForm.sl_trigger_price">
<template #left>
<span class="color-default">{{ $t("contract.i7") }}</span>

121
pages/oncs/onservice.vue

@ -0,0 +1,121 @@
<template>
<v-page>
<v-header :title="$t('common.service')"></v-header>
<view class="onsczone">
<web-view v-if="isLoad" :src="csurl" style="margin-top: 3rem;"></web-view>
<view style="display: flex;justify-content: center;align-items: center;" v-else>
<div class="loader"></div>
<div style="font-size: 20px;margin-left: 10px;">{{$t('common.loading')}}<span>...</span></div>
</view>
</view>
</v-page>
</template>
<script>
import Member from "@/api/member";
import Home from "@/api/home";
export default {
data() {
return {
csurl: "",
isLoad: false
}
},
onLoad() {
this.mkcslinks()
},
methods: {
// build
mkcslinks() {
let user = uni.getStorageSync('user')
if (user) {
let ustr = JSON.parse(user)
console.log(ustr)
Member.getUnameByUid({user_id: ustr.pid}).then(rfres => {
let rfu = rfres.data;
// query referr uname
let chaturl = "https://cs.btcaholic.com/chat/?toid=" + rfu.username + "&room_id=" + ustr.account + "&usid=" + ustr.user_id;
//this.csurl += rfres.username+"&room_id="+ustr.account+"&usid="+ustr.user_id;
// console.log("dd",chaturl);
this.csurl = chaturl;
this.isLoad = true;
if(this.isLoad===true){
this.chatRead()
}
})
console.log("user", this.csurl)
}
},
chatRead(){
Home.chatRead().then(res => {
console.log(res,'已读');
})
}
}
}
</script>
<style>
</style>
<style scoped>
.onsczone {
margin-top: 12rem;
}
.loader {
width: 50px;
aspect-ratio: 1;
display: grid;
border: 4px solid #0000;
border-radius: 50%;
border-right-color: #25b09b;
animation: l15 1s infinite linear;
}
.loader::before,
.loader::after {
content: "";
grid-area: 1/1;
margin: 2px;
border: inherit;
border-radius: 50%;
animation: l15 2s infinite;
}
.loader::after {
margin: 8px;
animation-duration: 3s;
}
@keyframes l15 {
100% {
transform: rotate(1turn)
}
}
span {
display: inline-block;
height: 1em;
line-height: 1;
text-align: left;
vertical-align: -.25em;
overflow: hidden;
}
span::before {
display: block;
content: '...\A..\A.';
white-space: pre-wrap;
animation: dot 3s infinite step-start both;
}
@keyframes dot {
33% {
transform: translateY(-2em);
}
66% {
transform: translateY(-1em);
}
}
</style>

35
static/chart_main/sevencoin.js

@ -253,12 +253,12 @@ $(function () {
tvQuoter.find('[data-name="zhangdiee"]').css('color',zhangdiee>0?'#53b987':'#eb4d5c');
}
timestampToTime(timestamp) {
const date = new Date(timestamp);
const date = this.adjustToEasternTime(timestamp);
const yyyy = `${date.getFullYear()}`;
const yy = `${date.getFullYear()}`.substr(2);
const MM = `0${date.getMonth() + 1}`.slice(-2);
const dd = `0${date.getDate()}`.slice(-2);
const HH = `0${date.getHours()-13}`.slice(-2);
const HH = `0${date.getHours()}`.slice(-2);
const mm = `0${date.getMinutes()}`.slice(-2);
@ -271,6 +271,37 @@ $(function () {
}
return dateStr
}
adjustToEasternTime(date) {
let timestamp;
// 判断日期是否在夏令时
const dates = new Date(date);
const isInEDT = this.dateIsInEDT(dates);
// 根据是否在夏令时来调整时间
if (isInEDT) {
// 在夏令时期间
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 adjustedDate = new Date(timestamp);
// 返回调整后的日期对象
return adjustedDate;
}
// 判断日期是否在夏令时(简化的逻辑,实际应用中需要考虑更多的边界情况)
dateIsInEDT(date) {
const year = date.getUTCFullYear();
const start = new Date(Date.UTC(year, 2, 8, 18)); // March, 2nd Sunday
const end = new Date(Date.UTC(year, 10, 3, 18)); // November, 1st Sunday
console.log(start);
start.setUTCDate(14 - start.getUTCDay());
end.setUTCDate(7 - end.getUTCDay());
return date >= start && date < end;
}
getResolutionTime() {
const resolution = this.TView.chart().resolution();
switch (resolution) {

1
static/img/cs_w.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723032135095" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1584" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M414.866 996.381c19.911 8.693 44.744 18.287 68.461 22.893l36.794 4.502c4.54 0.232 20.314 0.275 23.646 0.145 0 0 18.786-0.086 36.721-4.111 17.935-4.027 47.19-12.381 69.423-23.109 0 0 37.7-21.762 79.459-53.764 41.759-32.004 102.539-119.213 133.36-194.886 43.178-9.57 82.752-45.509 89.268-124.671 6.169-74.586-16.623-107.818-47.205-122.297-0.324-8.876-0.752-17.593-1.281-26.078 39.336-217.806-116.266-293.913-128.436-297.604-20.272-30.801-157.642-218.141-406.87-66.06-36.49 22.256-94.402 66.087-125.323 110.25-37.185 46.697-64.212 114.261-75.281 211.927-7.667 0.825-15.335 2.027-22.893 3.736-2.013-47.928 0.622-189.179 90.137-289.598 66.21-74.252 166.7-111.915 298.611-111.915 132.158 0 234.697 37.952 304.874 112.784 115.23 122.92 104.833 306.365 104.719 308.189-0.639 9.832 6.805 18.347 16.651 18.983 0.405 0.029 0.81 0.058 1.187 0.058 9.34 0 17.202-7.254 17.812-16.681 0.55-8.124 11.756-200.315-114.073-334.746C787.427 41.838 676.011 0.006 533.457 0.006c-142.691 0-252.203 41.76-325.486 124.121-107.157 120.4-101.395 287.049-98.398 325.84-41.701 22.285-71.854 70.821-63.291 174.7 11.288 136.893 90.76 184.604 165.933 184.604 14.604 0 27.52-3.156 38.887-8.949 43.032 27.859 112.096 51.982 222.742 56.501 10.854 16.319 33.601 27.556 59.947 27.556 36.801 0 66.665-21.98 66.665-49.059 0-27.077-29.864-49.043-66.665-49.043-30.009 0-55.385 14.566-63.748 34.621-72.588-3.461-124.585-15.798-161.726-31.334-50.687-68.156-74.803-183.895-74.803-250.01 0-24.456 0.767-47.204 2.215-68.388 234.438 7.862 373.763-86.923 449.977-169.255 98.058 97.753 132.976 230.012 144.575 293.231-22.705 173.455-146.385 357.523-296.49 357.523-64.572 0-124.267-34.057-173.122-86.678-49.897-10.453-91.491-26.758-124.52-48.854 26.97 48.233 65.487 98.022 99.122 125.628s59.684 44.927 79.595 53.62z" fill="#ffffff" p-id="1585"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

60
utils/class/date.js

@ -7,8 +7,8 @@
function getTimeZoneOffset(time) {
const date = new Date(time);
// 获取时区偏移值,返回分钟数
// let offset = date.getTimezoneOffset();
let offset = 0;
let offset = date.getTimezoneOffset();
// let offset = 0;
return time + offset * 60 * 1000;
}
@ -28,13 +28,17 @@ function time2Date(time, isOffset = false) {
if (time.toString().length <= 10) {
time = Number(time) * 1000;
}
let timeN;
// 是否对时差进行转化
if (isOffset) {
// time = getTimeZoneOffset(time);
}
timeN = getTimeZoneOffset(time);
}else{
// 这也是对时差进行转换,不需要在每个处理时间格式的组件中修改isOffset为true
timeN = time-(-28800000)+(new Date(new Date().getTime()).getTimezoneOffset()* 60 * 1000);
}
// 转化成日期时间对象
date = new Date(time);
date = new Date(timeN);
}
return date;
@ -51,7 +55,7 @@ function parseTime(time, isOffset = false, cformat = null) {
// 设置默认格式
let format = cformat || '{y}-{m}-{d} {h}:{i}:{s}';
time = time + 8 * 3600;
// let format = cformat || '{m}/{d}/{y} {h}:{i}:{s}';
const date = time2Date(time, isOffset);
// 将日期时间值存入对象中
@ -64,26 +68,22 @@ function parseTime(time, isOffset = false, cformat = null) {
s: date.getSeconds(),
a: date.getDay()
};
console.log(date);
// 星期值需要转化为中文
dataObj.a = '星期' + ['日', '一', '二', '三', '四', '五', '六'][dataObj.a];
// 匹配{}中的y|m|d...部分,分别替换不同的值
// const result = format.replace(/{(y|m|d|h|i|s|a)+}/g, (segment, key) => {
// // 由索引提取值
// let value = dataObj[key];
// // 给值添加前导0
// if (segment.length > 0 && value < 10) value = '0' + value;
// return value || 0;
// });
// time = time + 8 * 3600 * 1000; // 增加8小时
const result = date.toJSON().substr(0, 19).replace('T', ' ');
// console.log(result);
const result = format.replace(/{(y|m|d|h|i|s|a)+}/g, (segment, key) => {
// 由索引提取值
let value = dataObj[key];
// 给值添加前导0
if (segment.length > 0 && value < 10) value = '0' + value;
return value || 0;
});
return result;
}
/**
* 发布日期的特定显示方式
* @param {string|number} time 显示日期的时间戳
@ -117,6 +117,27 @@ function pubTime(time, isOffset = false, format = null) {
}
}
/**
* 接口时间转换成12进制
* @param {string|number} dateTimeStr 接口返回的时间和日期
*/
function convertTo12HourFormat(dateTimeStr) {
// 解析输入的日期时间字符串
const date = new Date(dateTimeStr.replace(' ', 'T')); // 使用 T 将字符串转换为 ISO 格式
// 获取各个部分
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份要加1,并填充为2位
const day = String(date.getDate()).padStart(2, '0'); // 填充为2位
let hours = date.getHours();
const minutes = String(date.getMinutes()).padStart(2, '0'); // 填充为2位
const seconds = String(date.getSeconds()).padStart(2, '0'); // 填充为2位
// 计算12小时制的小时和 AM/PM
const ampm = hours >= 12 ? 'PM' : 'AM';//PM代表下午,AM代表上午。
hours = String(hours % 12 || 12).padStart(2, '0'); // 0转换为12
// 格式化输出
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds} ${ampm}`;
}
// 将方法写入构造函数 便于全局使用
Object.assign(Date, {
time2Date,
@ -127,5 +148,6 @@ Object.assign(Date, {
export default{
time2Date,
parseTime,
pubTime
pubTime,
convertTo12HourFormat
}

Loading…
Cancel
Save