Browse Source

合并

master
j1ack 3 years ago
parent
commit
4cab300a06
  1. 16
      components/entrustOrderList/entrustOrderList.vue
  2. 4
      components/transaction/transaction.vue
  3. 308
      pages/home/index.vue
  4. 2
      pages/markets/trade.vue
  5. 26
      pages/me/transfer.vue
  6. 3
      pages/recharge/rechargeRecord.vue
  7. 2
      pages/subscription/details.vue
  8. 19
      utils/index.js
  9. 2
      utils/language/en_US.js

16
components/entrustOrderList/entrustOrderList.vue

@ -17,7 +17,7 @@
<view class="header">
<text :class="item.direction" >{{item.direction}}</text>
<text class="time">{{item.timestr}}</text>
<text class="closeTimeTitle" v-show="type === 2 || type === 3">{{ i18n.CloseTime }}</text>
<text class="closeTimeTitle" v-show="type === 2">{{ i18n.CloseTime }}</text>
<text class="closeTime" v-show="type === 2">{{item.timestr2}}</text>
<view class="closeBtn" v-show="type === 0 || type === 1" @click="closeItem(item,index)">{{
i18n.close
@ -32,8 +32,8 @@
<view class="value">{{item.openedPrice}}</view>
<view class="title">{{ i18n.Bond }}</view>
<view class="value">{{item.bondAmount}}</view>
<view class="title" v-show="type !== 3&&type !== 0">{{ i18n.StyPrice }}</view>
<view class="value" v-show="type !== 3&&type !== 0">{{item.winStopPrice}}</view>
<view class="title" v-show="type !== 3||type !== 0">{{ i18n.StyPrice }}</view>
<view class="value" v-show="type !== 3||type !== 0">{{item.winStopPrice}}</view>
</view>
<!-- 公共的 -->
<view class="center">
@ -41,8 +41,8 @@
<view class="value">{{item.hand}} * {{item.leverage}}</view>
<view class="title">{{ i18n.Fee }}</view>
<view class="value">{{item.fee}}</view>
<view class="title" v-show="type !== 3&&type !== 0">{{ i18n.StsPrice }}</view>
<view class="value" v-show="type !== 3&&type !== 0">{{item.lossStopPrice}}</view>
<view class="title" v-show="type !== 3||type !== 0">{{ i18n.StsPrice }}</view>
<view class="value" v-show="type !== 3||type !== 0">{{item.lossStopPrice}}</view>
</view>
<!-- Current Entrust Position-->
<view class="right" v-show="type === 0 || type === 1">
@ -53,7 +53,7 @@
<view class="title" v-show="type === 1">{{ i18n.do }}</view>
<view class="value" style="color:#00E8A2;" v-show="type === 1" @click="getStopLimit(item)">
Stop/Limit</view>
<view class="title"v-show="type === 1&&type === 2">{{ i18n.ExpectProfit }}</view>
<view class="title" v-show="type === 1||type === 2">{{ i18n.ExpectProfit }}</view>
<view class="value" v-show="type === 1"
:style="parseFloat(getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand))>=0?'color:#00E8A2':'color:#F4506A'">
{{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)
}

4
components/transaction/transaction.vue

@ -190,9 +190,11 @@
duration: 1500
})
setTimeout(()=>{
//使uni.$emit
uni.$emit("upData",true)
// usable
this.$emit('change','')
},800)
//使uni.$emit
});
},
}

308
pages/home/index.vue

@ -19,102 +19,105 @@
</u-overlay>
</view>
<!-- 轮播图 -->
<!-- #ifdef APP-PLUS -->
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx" nextMargin="80rpx" circular
:autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx">
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx" nextMargin="80rpx"
circular :autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx">
<!-- #endif -->
<!-- #ifdef H5 -->
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx" nextMargin="80rpx" circular
:autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx" style="margin-top: 145rpx;">
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx"
nextMargin="80rpx" circular :autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx"
style="margin-top: 145rpx;">
<!-- #endif -->
</u-swiper>
<!-- 消息 -->
<view class="message" @click="go('/pages/me/notification')">
<u-icon class="icon" name="../../static/home/ic_proclamation.png" size="60rpx" width="60rpx"></u-icon>
<!-- <view class="text">{{ i18n.homeMessage }}</view> -->
<u-notice-bar class="notice" :text="messageList" icon="" fontSize="24rpx" bgColor="#211F32" color="#fff"
direction="column" >
</u-notice-bar>
</view>
<!-- 三个按钮 -->
<view class="btnDiv">
<view class="item" @click="goto('recharge')">
<u--image class="img" :showLoading="true" src="../../static/home/img_recharge.png" width="144rpx"
height="144rpx"></u--image>
<view class="text">{{ i18n.Recharge }}</view>
<!-- 消息 -->
<view class="message" @click="go('/pages/me/notification')">
<u-icon class="icon" name="../../static/home/ic_proclamation.png" size="60rpx" width="60rpx">
</u-icon>
<!-- <view class="text">{{ i18n.homeMessage }}</view> -->
<u-notice-bar class="notice" :text="messageList" icon="" fontSize="24rpx" bgColor="#211F32"
color="#fff" direction="column">
</u-notice-bar>
</view>
<view class="item" @click="goto('mine')">
<u--image class="img" :showLoading="true" src="../../static/home/img_Mine.png" width="144rpx"
height="144rpx"></u--image>
<view class="text">{{ i18n.Mine }}</view>
</view>
<view class="item" @click="goto('subcription')">
<u--image class="img" :showLoading="true" src="../../static/home/img_Subcription.png" width="144rpx"
height="144rpx"></u--image>
<view class="text">{{ i18n.Subcription }}</view>
<!-- 三个按钮 -->
<view class="btnDiv">
<view class="item" @click="goto('recharge')">
<u--image class="img" :showLoading="true" src="../../static/home/img_recharge.png"
width="144rpx" height="144rpx"></u--image>
<view class="text">{{ i18n.Recharge }}</view>
</view>
<view class="item" @click="goto('mine')">
<u--image class="img" :showLoading="true" src="../../static/home/img_Mine.png" width="144rpx"
height="144rpx"></u--image>
<view class="text">{{ i18n.Mine }}</view>
</view>
<view class="item" @click="goto('subcription')">
<u--image class="img" :showLoading="true" src="../../static/home/img_Subcription.png"
width="144rpx" height="144rpx"></u--image>
<view class="text">{{ i18n.Subcription }}</view>
</view>
</view>
</view>
<!-- 步数 -->
<view class="steps">
<view class="content">
<view class="title">{{ i18n.TodaySteps }}</view>
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget" :change:stepTarget="echarts.stepTargetReceive"
:change:stepsNum="echarts.receive" style="width: 280rpx;height:280rpx; font-size: 40rpx;">
<!-- 步数 -->
<view class="steps">
<view class="content">
<view class="title">{{ i18n.TodaySteps }}</view>
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget"
:change:stepTarget="echarts.stepTargetReceive" :change:stepsNum="echarts.receive"
style="width: 280rpx;height:280rpx; font-size: 40rpx;">
</view>
<!-- <canvas id="chart" ref="chart" style="width: 280rpx;height:280rpx; font-size: 40rpx;"></canvas> -->
<u-button class="button" color="#00E8A2" @click="closeModalShow=true">{{ i18n.ReceiveEarnings }}
</u-button>
</view>
<!-- <canvas id="chart" ref="chart" style="width: 280rpx;height:280rpx; font-size: 40rpx;"></canvas> -->
<u-button class="button" color="#00E8A2" @click="closeModalShow=true">{{ i18n.ReceiveEarnings }}
</u-button>
</view>
</view>
<!-- close确认框 -->
<u-modal :show="closeModalShow" :confirmText="i18n.Confirm" :cancelText="i18n.Cancel"
:showCancelButton="true" :title="i18n.WarmTips" :content='i18n.WarmTipsText' @confirm="closeConfirm"
@cancel="closeModalShow = false" confirmColor="#00E8A2" cancelColor="#96959E">
</u-modal>
<!-- close确认框 -->
<u-modal :show="closeModalShow" :confirmText="i18n.Confirm" :cancelText="i18n.Cancel"
:showCancelButton="true" :title="i18n.WarmTips" :content='i18n.WarmTipsText' @confirm="closeConfirm"
@cancel="closeModalShow = false" confirmColor="#00E8A2" cancelColor="#96959E">
</u-modal>
<!-- 播放器 -->
<view class="videoList" v-for="(item, index) in videoList" :key="index" @click="playVideo(item.adText)">
<view class="videoImage" :style="`background-image: url(${baseURL+item.adImgPath});background-repeat: no-repeat;
<!-- 播放器 -->
<view class="videoList" v-for="(item, index) in videoList" :key="index" @click="playVideo(item.adText)">
<view class="videoImage" :style="`background-image: url(${baseURL+item.adImgPath});background-repeat: no-repeat;
background-size: cover;`">
<view class="VideoBg">
<view class="VideoLogo"></view>
<view class="VideoTitle">{{ item.adTitle }}</view>
<view class="VideoBg">
<view class="VideoLogo"></view>
<view class="VideoTitle">{{ item.adTitle }}</view>
</view>
</view>
</view>
</view>
<video class="video" v-show="videoShow" id="video" :enable-progress-gesture="false" autoplay="true"
:src="videoUrl" controls x5-video-player-type="h5-page" @fullscreenchange="ifStopVideo"></video>
<!-- 通知弹出层 -->
<view class="">
<u-popup class="popup" :show="popupShow" round="32rpx" mode="center" @close="popupShow = false"
@open="popupShow = true" bgColor="#211F32" :customStyle="{
<video class="video" v-show="videoShow" id="video" :enable-progress-gesture="false" autoplay="true"
:src="videoUrl" controls x5-video-player-type="h5-page" @fullscreenchange="ifStopVideo"></video>
<!-- 通知弹出层 -->
<view class="">
<u-popup class="popup" :show="popupShow" round="32rpx" mode="center" @close="popupShow = false"
@open="popupShow = true" bgColor="#211F32" :customStyle="{
margin: 'auto 102rpx auto 118rpx',
}">
<view class="content">
<scroll-view scroll-y="true" style="max-height: 288rpx;" scroll-with-animation="true"
@touchmove.stop.prevent="">
<view class="" v-html="contentFirst"></view>
</scroll-view>
<u-button class="button" color="#00E8A2" @click="toRead" :throttleTime="500">OK</u-button>
</view>
</u-popup>
</view>
<view class="content">
<scroll-view scroll-y="true" style="max-height: 288rpx;" scroll-with-animation="true"
@touchmove.stop.prevent="">
<view class="" v-html="contentFirst"></view>
</scroll-view>
<u-button class="button" color="#00E8A2" @click="toRead" :throttleTime="500">OK</u-button>
</view>
</u-popup>
</view>
<!-- <view class="" @click="startStep">
<!-- <view class="" @click="startStep">
开始记步
</view>
<view class="" @click="startStep">
步数{{stepCount}}
</view> -->
<!-- tabBar -->
<tab-bar :selectActive="1"></tab-bar>
<!-- tabBar -->
<tab-bar :selectActive="1"></tab-bar>
</view>
</template>
@ -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 @@
},
}
}
</script>
@ -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()

2
pages/markets/trade.vue

@ -15,7 +15,7 @@
<view class="transactionSide">
<transaction v-on:onChangeType="onChangeType" :contractConfig="contractConfig" :symbol="symbol"
:marketDetail="marketDetail" :type="type"></transaction>
:marketDetail="marketDetail" :type="type" @change="getContractConfig"></transaction>
</view>
<view class="positionSide">
<positionList v-on:depthChange="depthChange" :sum="sum" :marketDetail="marketDetail"

26
pages/me/transfer.vue

@ -41,7 +41,7 @@
:placeholder="i18n.pamount" >
</u-input>
<view class="numberDownSelect">{{coinInfo.coinCode||''}}
<view class="all" @click="coinInfo.tranAmt=coinWayInfo.userCapital">{{i18n.ALL}}</view>
<view class="all" @click="coinInfo.tranAmt=coinWayInfo.userCapital?coinWayInfo.userCapital:info.userCapital">{{i18n.ALL}}</view>
</view>
</view>
<view class="Usable">{{ 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)
})
},

3
pages/recharge/rechargeRecord.vue

@ -39,7 +39,7 @@
<key-value-row :keyName="i18n.Fees" :value="(item.tranAmt-item.realAmount)+item.coinCode"></key-value-row>
<key-value-row :keyName="i18n.Time" :value="item.timestr"></key-value-row>
</view>
<view style="border-top: 2rpx solid #323045;padding:0rpx 32rpx; margin-bottom: 20rpx;">
<view class="digitalShowMore" style="border-top: 2rpx solid #323045;padding:0rpx 32rpx; margin-bottom: 20rpx;">
<show-more>
<key-value-row :keyName="i18n.Address" :value="item.toAddress"></key-value-row>
<key-value-row :keyName="i18n.Hash" :value="item.txid"></key-value-row>
@ -178,6 +178,7 @@
/deep/ .digitalShowMore .KeyValueRow .value{
position: static !important;
word-break: break-all !important;
line-height: 38rpx !important;
}
.main {

2
pages/subscription/details.vue

@ -61,7 +61,7 @@
<view class="content">{{i18n.FullNameOfToken+deinfo.sysCoinInfo.fullName}}</view>
<view class="content">{{i18n.TotalCirculation+deinfo.sysCoinInfo.issueAmount}}</view>
<view class="content">{{i18n.ICOPrice+deinfo.sysCoinInfo.initalPrice}} USDT</view>
<view class="content">{{i18n.ICOTime+deinfo.sysCoinInfo.initialReleasePhase}}</view>
<view class="content">{{i18n.ICOTime+":"+deinfo.sysCoinInfo.initialReleasePhase}}</view>
<video class="video" v-show="videoShow" id="video" :enable-progress-gesture="false" autoplay="true"
:src="videoUrl" controls x5-video-player-type="h5-page" @fullscreenchange="ifStopVideo"></video>
</view>

19
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)

2
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',

Loading…
Cancel
Save