From 4cab300a06c99e9f9dab1a331ffb4c7ee8cd0bfb Mon Sep 17 00:00:00 2001 From: j1ack <1209452658@qq.com> Date: Tue, 6 Sep 2022 11:04:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entrustOrderList/entrustOrderList.vue | 16 +- components/transaction/transaction.vue | 4 +- pages/home/index.vue | 308 +++++++++--------- pages/markets/trade.vue | 2 +- pages/me/transfer.vue | 26 +- pages/recharge/rechargeRecord.vue | 3 +- pages/subscription/details.vue | 2 +- utils/index.js | 19 ++ utils/language/en_US.js | 2 +- 9 files changed, 204 insertions(+), 178 deletions(-) diff --git a/components/entrustOrderList/entrustOrderList.vue b/components/entrustOrderList/entrustOrderList.vue index b145854..0626827 100644 --- a/components/entrustOrderList/entrustOrderList.vue +++ b/components/entrustOrderList/entrustOrderList.vue @@ -17,7 +17,7 @@ {{item.direction}} {{item.timestr}} - {{ i18n.CloseTime }} + {{ i18n.CloseTime }} {{item.timestr2}} {{ i18n.close @@ -32,8 +32,8 @@ {{item.openedPrice}} {{ i18n.Bond }} {{item.bondAmount}} - {{ i18n.StyPrice }} - {{item.winStopPrice}} + {{ i18n.StyPrice }} + {{item.winStopPrice}} @@ -41,8 +41,8 @@ {{item.hand}} * {{item.leverage}} {{ i18n.Fee }} {{item.fee}} - {{ i18n.StsPrice }} - {{item.lossStopPrice}} + {{ i18n.StsPrice }} + {{item.lossStopPrice}} @@ -53,7 +53,7 @@ {{ i18n.do }} Stop/Limit - {{ i18n.ExpectProfit }} + {{ i18n.ExpectProfit }} {{getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand)}} @@ -279,11 +279,11 @@ this.list = res.data for (var i = 0; i < this.list.length; i++) { if (this.list[i].addTime) { - this.list[i].timestr = this.$index.formatyymmddhhmmss(this.list[ + this.list[i].timestr = this.$index.formatmmddhhmmss(this.list[ i].addTime) } if (this.list[i].closedTime) { - this.list[i].timestr2 = this.$index.formatyymmddhhmmss(this.list[ + this.list[i].timestr2 = this.$index.formatmmddhhmmss(this.list[ i].closedTime) } diff --git a/components/transaction/transaction.vue b/components/transaction/transaction.vue index 7b88c4d..64b22f4 100644 --- a/components/transaction/transaction.vue +++ b/components/transaction/transaction.vue @@ -190,9 +190,11 @@ duration: 1500 }) setTimeout(()=>{ + //使用uni.$emit触发全局事件,并传参 触发这个给兄弟组件 刷新页面下面的订单列表 uni.$emit("upData",true) + // 刷新下单余额 usable + this.$emit('change','') },800) - //使用uni.$emit触发全局事件,并传参 触发这个给兄弟组件 刷新页面下面的订单列表 }); }, } diff --git a/pages/home/index.vue b/pages/home/index.vue index 4621082..9f5acfd 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -19,102 +19,105 @@ - - - + + + - + - - - - - - - - - - - - {{ i18n.Recharge }} + + + + + + + - - - {{ i18n.Mine }} - - - - {{ i18n.Subcription }} + + + + + {{ i18n.Recharge }} + + + + {{ i18n.Mine }} + + + + {{ i18n.Subcription }} + - - - - - {{ i18n.TodaySteps }} - - - - + + + + {{ i18n.TodaySteps }} + + + + + + + + + {{ i18n.ReceiveEarnings }} + - - - - {{ i18n.ReceiveEarnings }} - - - - - + + + - - - + - - - {{ item.adTitle }} + + + {{ item.adTitle }} + - - - - - + + + - - - - - OK - - - - + + + + + OK + + + + - - - + + @@ -156,7 +159,7 @@ swiperList: [ ], - bannerList:[], + bannerList: [], videoShow: false, videoUrl: '', videoList: [], @@ -173,7 +176,7 @@ this.getUserInfoBalance(); }, onShow() { - + // 生成播放器队列对象 // this.videoList.forEach((item, index) => { // const VideoPlayer = uni.createVideoContext(`video-${index}`, this) @@ -188,16 +191,16 @@ this.langTrue = uni.getStorageSync('langTrue') } // #ifdef APP-PLUS - this.getSept() - // this.startStep() - // this.resStartStep() - this.updateSteps('show'); + this.getSept() + // this.startStep() + // this.resStartStep() + this.updateSteps('show'); // #endif // #ifdef H5 - this.stepsNum=0; + this.stepsNum = 0; // #endif }, - + onHide() { this.stopAllVideoPlay() }, @@ -208,57 +211,57 @@ }, methods: { // 更新步数逻辑 - updateSteps(soucre){ - var today=this.$index.formatyymmdd(new Date().getTime()); - var stepsNum_date= uni.getStorageSync("stepsNum_date"); - - var isUpdate=false; - console.log(today) - console.log(uni.getStorageSync("stepsNum_date")) - console.log(stepsNum_date) - - if(stepsNum_date){ - if(today!=stepsNum_date.date){ - uni.setStorageSync("stepsNum_date",null); - - }else{ - if(this.stepsNum==0){ - this.stepsNum=stepsNum_date.newStepsNum; + updateSteps(soucre) { + var today = this.$index.formatyymmdd(new Date().getTime()); + var stepsNum_date = uni.getStorageSync("stepsNum_date"); + + var isUpdate = false; + // console.log(today) + // console.log(uni.getStorageSync("stepsNum_date")) + // console.log(stepsNum_date) + + if (stepsNum_date) { + if (today != stepsNum_date.date) { + uni.setStorageSync("stepsNum_date", null); + + } else { + if (this.stepsNum == 0) { + this.stepsNum = stepsNum_date.newStepsNum; + } + if (parseInt(this.stepsNum) > parseInt(stepsNum_date.stepsNum)) { + + uni.setStorageSync("stepsNum_date", { + stepsNum: stepsNum_date.stepsNum, + date: today, + newStepsNum: this.stepsNum + }); + if (soucre) { + isUpdate = true; + } } - if(parseInt(this.stepsNum)>parseInt(stepsNum_date.stepsNum)){ - - uni.setStorageSync("stepsNum_date",{ - stepsNum:stepsNum_date.stepsNum, - date:today, - newStepsNum:this.stepsNum - }); - if(soucre){ - isUpdate=true; - } - } } - - - }else{ - isUpdate=true; + + + } else { + isUpdate = true; } - - if(isUpdate){ + + if (isUpdate) { this.$api.updateSteps({ steps: this.stepsNum }).then(res => { - console.log(res,'res更新') - uni.setStorageSync("stepsNum_date",{ - stepsNum:this.stepsNum, - date:today, - newStepsNum:this.stepsNum + console.log(res, 'res更新') + uni.setStorageSync("stepsNum_date", { + stepsNum: this.stepsNum, + date: today, + newStepsNum: this.stepsNum }); }) } console.log(this.stepsNum) }, - - bannerClick(i){ + + bannerClick(i) { // #ifdef APP-PLUS plus.runtime.openUrl(this.bannerList[i].adUrl) // #endif @@ -270,26 +273,25 @@ }, // 获取用户余额信息 getUserInfoBalance() { - api.userAccount().then(res => { - - }) + api.userAccount().then(res => { + + }) }, // 捐步 closeConfirm() { this.$api.receivStepsAward().then(res => { uni.$u.toast(this.$t("markets").Succeeded) - this.closeModalShow=false }) - + this.closeModalShow = false }, // 开启计步服务 getSept() { - try{ + try { //整个应用设置一次即可,停止计步后需重新调用,所有接口调用必须先开启计步服务 StepCounter.startStep((res) => { console.log(res, '步数res'); this.stepCount = res.stepCount - this.stepsNum=res.stepCount; + this.stepsNum = res.stepCount; this.updateSteps(); //res.stepCount 当天累计步数 }, (res) => { @@ -310,10 +312,10 @@ console.log('允许运动权限(处理安卓权限问题)') } } - + }); - }catch(e){ - console.error("获取步数出错",e) + } catch (e) { + console.error("获取步数出错", e) } }, startStep() { @@ -348,7 +350,7 @@ var href = res.url window.open(href, '_blank'); // #endif - + } }) }, @@ -365,26 +367,28 @@ // 如果循环都是已读的就关闭弹框 if (!this.noticeId) { this.popupShow = false - } + } }, // 读公告 toRead() { api.noticeRead({ noticeId: this.noticeId }).then(res => { - + }) - this.noticeId = null; this.popupShow = false - this.getNoReadNotice() - console.log(res, '已经读了吗') + setTimeout(() => { + this.noticeId = null; + this.getNoReadNotice() + }, 1500) + }, go(url) { uni.navigateTo({ url: url }) }, - + // 公告 noticeList() { @@ -402,7 +406,7 @@ api.indexBanner({ 'mark': 'APP_INDEX' }).then(res => { - this.bannerList=res + this.bannerList = res for (var i = 0; i < res.length; i++) { this.swiperList.push(this.baseURL + res[i].adImgPath) } @@ -490,7 +494,7 @@ }, - + } } @@ -516,17 +520,17 @@ methods: { receive(newValue, oldValue, ownerVm, vm) { - console.log(newValue,'变化') + console.log(newValue, '变化') this.initEcharts() - // if(!this.myChart){ - // this.initEcharts() - // }else{ - // this.myChart.setOption(this.option) - // } - + // if(!this.myChart){ + // this.initEcharts() + // }else{ + // this.myChart.setOption(this.option) + // } + }, - stepTargetReceive(newValue, oldValue, ownerVm, vm){ - + stepTargetReceive(newValue, oldValue, ownerVm, vm) { + }, initEcharts() { this.initChart() diff --git a/pages/markets/trade.vue b/pages/markets/trade.vue index 16bf9e6..6dd722d 100644 --- a/pages/markets/trade.vue +++ b/pages/markets/trade.vue @@ -15,7 +15,7 @@ + :marketDetail="marketDetail" :type="type" @change="getContractConfig"> {{coinInfo.coinCode||''}} - {{i18n.ALL}} + {{i18n.ALL}} {{ i18n.Usable }} @@ -188,21 +188,20 @@ }, onShow() {}, methods: { - // 重置 + // 重置 tranAmt: null, reset(){ - this.type='' - this.coinWayInfo={} - this.transCoinInfo={ - coinCode:null, - fromWays:null, - } - this.coinCode=null, - this.coinCode2=null, + // this.type='' + // this.coinWayInfo={} + // this.transCoinInfo={ + // coinCode:null, + // fromWays:null, + // } + // this.coinCode=null, + // this.coinCode2=null, this.coinInfo={ - coinCode: null, + // coinCode: null, fromWays: null, toWays: null, - tranAmt: null, } }, getAccount(e,type){ @@ -230,7 +229,8 @@ uni.$u.toast(this.$t("login").Transfersucceeded) setTimeout(() => { this.getInfo(true) - this.reset() + // this.reset() + this.coinInfo.tranAmt=null }, 1200) }) }, diff --git a/pages/recharge/rechargeRecord.vue b/pages/recharge/rechargeRecord.vue index 285a7cb..e7755f1 100644 --- a/pages/recharge/rechargeRecord.vue +++ b/pages/recharge/rechargeRecord.vue @@ -39,7 +39,7 @@ - + @@ -178,6 +178,7 @@ /deep/ .digitalShowMore .KeyValueRow .value{ position: static !important; word-break: break-all !important; + line-height: 38rpx !important; } .main { diff --git a/pages/subscription/details.vue b/pages/subscription/details.vue index 9d4fe74..51feaa5 100644 --- a/pages/subscription/details.vue +++ b/pages/subscription/details.vue @@ -61,7 +61,7 @@ {{i18n.FullNameOfToken+deinfo.sysCoinInfo.fullName}} {{i18n.TotalCirculation+deinfo.sysCoinInfo.issueAmount}} {{i18n.ICOPrice+deinfo.sysCoinInfo.initalPrice}} USDT - {{i18n.ICOTime+deinfo.sysCoinInfo.initialReleasePhase}} + {{i18n.ICOTime+":"+deinfo.sysCoinInfo.initialReleasePhase}} diff --git a/utils/index.js b/utils/index.js index d30f812..24f949e 100644 --- a/utils/index.js +++ b/utils/index.js @@ -62,6 +62,25 @@ var utils = { // return Y + '-' + M + '-' + D + ' ' + h + ':' + m + ':' + s; return D + '/' + M + '/' + Y + ' ' + h + ':' + m + ':' + s; }, + // 日月时分秒 + formatmmddhhmmss: function(time) { + var date = new Date(time) + var localTime = date.getTime() + var localOffset = date.getTimezoneOffset() * 60000 //获得当地时间偏移的毫秒数 + var utc = localTime + localOffset; //utc即GMT时间 + var offset = uni.getStorageSync('coinTypeInfo').system_timezone //时区拿接口的 + var beijing = utc + (3600000 * offset); + date = new Date(beijing) + var Y = date.getFullYear() + var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + var h = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() + var m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() + var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() + // return Y + '-' + M + '-' + D + ' ' + h + ':' + m + ':' + s; + return D + '/' + M + '/' + ' ' + h + ':' + m + ':' + s; + }, + formatyymmddhhmm: function(time) { var date = new Date(time) diff --git a/utils/language/en_US.js b/utils/language/en_US.js index bffb4ce..1a307da 100644 --- a/utils/language/en_US.js +++ b/utils/language/en_US.js @@ -218,7 +218,7 @@ export default { invuteCode: 'Please type your invute code', lockBTC: 'Please type you want to lock BTC quantity ', ALL: 'ALL', - LockBTCBtn: 'Lock BTC and begin prouce', + LockBTCBtn: 'Khoá BTC và sản xuất đầu', MineRecord: 'Mine Record', NoData: 'No Data',