j1ack 3 years ago
parent
commit
704e6cdd12
  1. 2
      components/KeyValueRow/KeyValueRow.vue
  2. 16
      pages/home/index.vue
  3. 319
      pages/markets/kLine.vue
  4. 2
      pages/me/inviteFriends.vue
  5. 2
      pages/recharge/rechargeRecord.vue
  6. 2
      pages/withdrawal/addAddress.vue
  7. 2
      pages/withdrawal/withdrawal.vue

2
components/KeyValueRow/KeyValueRow.vue

@ -11,7 +11,7 @@
<view class="value" <view class="value"
:style="{ color: rightColor, fontSize: size || rightSize, lineHeight: lineHeight || lineHeightValue }">{{ :style="{ color: rightColor, fontSize: size || rightSize, lineHeight: lineHeight || lineHeightValue }">{{
value value
}}</view> }} USDT</view>
</view> </view>
</template> </template>

16
pages/home/index.vue

@ -22,11 +22,11 @@
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<u-swiper class="swiper" :list="swiperList" previousMargin="48rpx" nextMargin="80rpx" circular <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"> :autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx">
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<u-swiper class="swiper" :list="swiperList" previousMargin="48rpx" nextMargin="80rpx" circular <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;"> :autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx" style="margin-top: 145rpx;">
<!-- #endif --> <!-- #endif -->
</u-swiper> </u-swiper>
@ -150,6 +150,7 @@
swiperList: [ swiperList: [
], ],
bannerList:[],
videoShow: false, videoShow: false,
videoUrl: '', videoUrl: '',
videoList: [], videoList: [],
@ -196,6 +197,16 @@
} }
}, },
methods: { methods: {
bannerClick(i){
// #ifdef APP-PLUS
plus.runtime.openUrl(this.bannerList[i].adUrl)
// #endif
// #ifdef H5
var href = this.bannerList[i].adUrl
window.open(href, '_blank');
// #endif
},
// //
getUserInfoBalance() { getUserInfoBalance() {
api.userAccount().then(res => { api.userAccount().then(res => {
@ -322,6 +333,7 @@
api.indexBanner({ api.indexBanner({
'mark': 'APP_INDEX' 'mark': 'APP_INDEX'
}).then(res => { }).then(res => {
this.bannerList=res
for (var i = 0; i < res.length; i++) { for (var i = 0; i < res.length; i++) {
this.swiperList.push(this.baseURL + res[i].adImgPath) this.swiperList.push(this.baseURL + res[i].adImgPath)
} }

319
pages/markets/kLine.vue

@ -3,106 +3,106 @@
<!-- nav --> <!-- nav -->
<navigation>{{ symbol.pair }}</navigation> <navigation>{{ symbol.pair }}</navigation>
<!-- 价格百分比 --> <!-- 价格百分比 -->
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<view class="header"> <view class="header">
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="headerH5">
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <view class="top">
<view class="headerH5"> <!-- 实时价格 -->
<!-- #endif --> <text class="price">{{parseFloat(marketDetail.close).toFixed(marketDetail.baseCoinScale)}}</text>
<!-- 百分比,根据数据正负判断颜色 -->
<view class="top"> <text class="percent"
<!-- 实时价格 --> :class="{ rise: marketDetail.percent>=0 }">{{marketDetail.percent>=0?'+'+marketDetail.percent:marketDetail.percent}}%</text>
<text class="price">{{parseFloat(marketDetail.close).toFixed(marketDetail.baseCoinScale)}}</text> </view>
<!-- 百分比,根据数据正负判断颜色 --> <view class="bottom">
<text class="percent" <view class="left">
:class="{ rise: marketDetail.percent>=0 }">{{marketDetail.percent>=0?'+'+marketDetail.percent:marketDetail.percent}}%</text> <view class="title">{{ i18n.Highest }}</view>
<view class="value">{{marketDetail.high}}</view>
</view>
<view class="center">
<view class="title">{{ i18n.Lowest }}</view>
<view class="value">{{marketDetail.low}}</view>
</view>
<view class="right">
<view class="title">{{ i18n.Amount }}</view>
<view class="value">{{marketDetail.amount}}</view>
</view>
</view>
</view> </view>
<view class="bottom"> <view class="tab">
<view class="left"> <view class="item" :class="{ select: type === '1min' }" @click="onChangeType('1min')">1min
<view class="title">{{ i18n.Highest }}</view>
<view class="value">{{marketDetail.high}}</view>
</view> </view>
<view class="center"> <view class="item" :class="{ select: type === '5min' }" @click="onChangeType('5min')">5min
<view class="title">{{ i18n.Lowest }}</view>
<view class="value">{{marketDetail.low}}</view>
</view> </view>
<view class="right"> <view class="item" :class="{ select: type === '15min' }" @click="onChangeType('15min')">15min
<view class="title">{{ i18n.Amount }}</view> </view>
<view class="value">{{marketDetail.amount}}</view> <view class="item" :class="{ select: type === '30min' }" @click="onChangeType('30min')">30min
</view>
<view class="item" :class="{ select: type === '60min' }" @click="onChangeType('60min')">60min
</view>
<view class="item" :class="{ select: type === '1day' }" @click="onChangeType('1day')">1day
</view>
<view class="item" :class="{ select: type === '1week' }" @click="onChangeType('1week')">1week
</view>
<view class="item" :class="{ select: type === '1mon' }" @click="onChangeType('1mon')">1mon
</view> </view>
</view> </view>
</view> <!-- K线图 -->
<view class="tab"> <view class="kline" id="kline" :kdata="kdata" :change:kdata="klineE.receive"
<view class="item" :class="{ select: type === '1min' }" @click="onChangeType('1min')">1min style="height:500rpx;width: 100%;position: relative; padding: 0px; margin: 0px; border-width: 0px; cursor: default;">
</view>
<view class="item" :class="{ select: type === '5min' }" @click="onChangeType('5min')">5min
</view>
<view class="item" :class="{ select: type === '15min' }" @click="onChangeType('15min')">15min
</view>
<view class="item" :class="{ select: type === '30min' }" @click="onChangeType('30min')">30min
</view>
<view class="item" :class="{ select: type === '60min' }" @click="onChangeType('60min')">60min
</view>
<view class="item" :class="{ select: type === '1day' }" @click="onChangeType('1day')">1day
</view>
<view class="item" :class="{ select: type === '1week' }" @click="onChangeType('1week')">1week
</view>
<view class="item" :class="{ select: type === '1mon' }" @click="onChangeType('1mon')">1mon
</view>
</view>
<!-- K线图 -->
<view class="kline" id="kline" :kdata="kdata" :change:kdata="klineE.receive"
style="height:500rpx;width: 100%;position: relative; padding: 0px; margin: 0px; border-width: 0px; cursor: default;">
</view> </view>
<!-- 买卖挂牌表 --> <!-- 买卖挂牌表 -->
<view class="MarketTrades"> <view class="MarketTrades">
<view class="headTitle">Market trades</view> <view class="headTitle">Market trades</view>
<view class="table"> <view class="table">
<view class="box"> <view class="box">
<view class="title"> <view class="title">
<view class="quantity">{{ i18n.Quantity }}</view> <view class="quantity">{{ i18n.Quantity }}</view>
<view class="price">{{ i18n.BuyingPrice }}</view> <view class="price">{{ i18n.BuyingPrice }}</view>
</view>
<view class="list">
<view class="item" v-for="(item, index) in bboList.buy" :key="index">
<text class="price">{{parseFloat(item.size).toFixed(6)}}</text>
<text class="num buy">{{ item.price }}</text>
<view class="buybg" :style="`width: ${item.size/sum.buy*100 }%;`"></view>
</view> </view>
</view> <view class="list">
</view> <view class="item" v-for="(item, index) in bboList.buy" :key="index">
<view class="box"> <text class="price">{{parseFloat(item.size).toFixed(6)}}</text>
<view class="title"> <text class="num buy">{{ item.price }}</text>
<view class="quantity">{{ i18n.Quantity }}</view> <view class="buybg" :style="`width: ${item.size/sum.buy*100 }%;`"></view>
<view class="price">{{ i18n.SellPrice }}</view> </view>
</view>
<view class="list">
<view class="item" v-for="(item, index) in bboList.sell" :key="index">
<text class="price">{{parseFloat(item.size).toFixed(6)}}</text>
<text class="num sell">{{ item.price }}</text>
<view class="sellbg" :style="`width: ${item.size/sum.sell*100 }%;`"></view>
</view> </view>
</view> </view>
<view class="box">
<view class="title">
<view class="quantity">{{ i18n.Quantity }}</view>
<view class="price">{{ i18n.SellPrice }}</view>
</view>
<view class="list">
<view class="item" v-for="(item, index) in bboList.sell" :key="index">
<text class="price">{{parseFloat(item.size).toFixed(6)}}</text>
<text class="num sell">{{ item.price }}</text>
<view class="sellbg" :style="`width: ${item.size/sum.sell*100 }%;`"></view>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view>
<view class="btn"> <view class="btn">
<!-- open按钮 --> <!-- open按钮 -->
<u-button class="button" color="#00E8A2" throttleTime="500" @click="btnClick('buy')"> <u-button class="button" color="#00E8A2" throttleTime="500" @click="btnClick('buy')">
{{ i18n.open }} {{ i18n.open }}
</u-button> </u-button>
<!-- close按钮 --> <!-- close按钮 -->
<u-button class="button" color="#F4506A" throttleTime="500" @click="btnClick('sell')"> <u-button class="button" color="#F4506A" throttleTime="500" @click="btnClick('sell')">
{{ i18n.close }} {{ i18n.close }}
</u-button> </u-button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
@ -138,16 +138,16 @@
onShow() { onShow() {
this.into(); this.into();
}, },
onHide() { onHide() {
this.websock.closeSocket(); this.websock.closeSocket();
}, },
onUnload() { onUnload() {
this.websock.closeSocket(); this.websock.closeSocket();
}, },
methods: { methods: {
into() { into() {
this.symbol = uni.getStorageSync('symbol'); this.symbol = uni.getStorageSync('symbol');
if (!this.symbol) { if (!this.symbol) {
@ -183,10 +183,10 @@
}, },
onChangeType(type) { onChangeType(type) {
this.websock.unSubKline(this.type,this.symbol.symbol); this.websock.unSubKline(this.type, this.symbol.symbol);
this.type = type this.type = type
this.websock.subKHistory(this.type,this.symbol.symbol); this.websock.subKHistory(this.type, this.symbol.symbol);
this.websock.subKline(this.type,this.symbol.symbol); this.websock.subKline(this.type, this.symbol.symbol);
}, },
formateDate(time) { formateDate(time) {
@ -207,14 +207,22 @@
// } // }
// return time; // return time;
var time; time=this.$index.formatyymmddhhmmss(parseInt(time * 1000)) if (this.type === '1mon' ) { time = time.split(' ')[0]; time=time.substring(time.indexOf('/')+1,time.length) } else if (this.type === '1day' || this.type === '1week') { time = time.split(' ')[0]; } return time; var time;
time = this.$index.formatyymmddhhmmss(parseInt(time * 1000))
if (this.type === '1mon') {
time = time.split(' ')[0];
time = time.substring(time.indexOf('/') + 1, time.length)
} else if (this.type === '1day' || this.type === '1week') {
time = time.split(' ')[0];
}
return time;
}, },
getBboList() { getBboList() {
const bboList = this.$api.bboList({ const bboList = this.$api.bboList({
"symbol": this.symbol.symbol "symbol": this.symbol.symbol
}); });
bboList.then(res => { bboList.then(res => {
console.log(9999999,res) console.log(9999999, res)
this.bboList = res this.bboList = res
this.statisticsSum(); this.statisticsSum();
}) })
@ -255,15 +263,15 @@
if (data.channel === 'conn') { if (data.channel === 'conn') {
that.websockId = data.data that.websockId = data.data
that.websock.setId(data.data); that.websock.setId(data.data);
that.websock.subBbo(that.symbol.symbol) that.websock.subBbo(that.symbol.symbol)
that.websock.subDetail(that.symbol.symbol) that.websock.subDetail(that.symbol.symbol)
that.websock.subKHistory(that.type,that.symbol.symbol) that.websock.subKHistory(that.type, that.symbol.symbol)
that.websock.subKline(that.type,that.symbol.symbol) that.websock.subKline(that.type, that.symbol.symbol)
} else if (data.channel === 'market.pairsgroup') { } else if (data.channel === 'market.pairsgroup') {
that.symbolList = data.data.USDT; that.symbolList = data.data.USDT;
} else if (data.channel === 'market.' + that.symbol.symbol + '.bbo') { } else if (data.channel === 'market.' + that.symbol.symbol + '.bbo') {
that.bboList = data.data; that.bboList = data.data;
that.statisticsSum(); that.statisticsSum();
} else if (data.channel === 'market.' + that.symbol.symbol + '.trade') { } else if (data.channel === 'market.' + that.symbol.symbol + '.trade') {
@ -280,7 +288,7 @@
} }
}); });
}, },
upkline(data) { upkline(data) {
if (data.id === this.kdata.values[this.kdata.values.length - 1][5]) { if (data.id === this.kdata.values[this.kdata.values.length - 1][5]) {
@ -332,8 +340,8 @@
url, url,
}); });
}, },
btnClick(type) { btnClick(type) {
uni.setStorageSync('orderType',type); uni.setStorageSync('orderType', type);
// #ifdef H5 // #ifdef H5
history.back() history.back()
// #endif // #endif
@ -348,13 +356,13 @@
</script> </script>
<script module="klineE" lang="renderjs"> <script module="klineE" lang="renderjs">
let kline let kline
export default { export default {
data() { data() {
return { return {
start: 98, start: 98,
end: 100 end: 100
}; };
}, },
mounted() { mounted() {
@ -409,25 +417,25 @@
var chartDom = document.getElementById('kline'); var chartDom = document.getElementById('kline');
if (!this.is) { if (!this.is) {
console.log("this.is11111111", this.is) console.log("this.is11111111", this.is)
this.myChart = echarts.init(chartDom); this.myChart = echarts.init(chartDom);
if(this.kdata.categoryData.length<100){ if (this.kdata.categoryData.length < 100) {
this.start=50 this.start = 50
this.end=100 this.end = 100
}else if(this.kdata.categoryData.length<200){ } else if (this.kdata.categoryData.length < 200) {
this.start=85 this.start = 85
this.end=100 this.end = 100
}else{ } else {
this.start=98 this.start = 98
this.end=100 this.end = 100
} }
}else{ } else {
console.log(this.myChart.getModel().option.dataZoom[0].start) console.log(this.myChart.getModel().option.dataZoom[0].start)
this.start=this.myChart.getModel().option.dataZoom[0].start this.start = this.myChart.getModel().option.dataZoom[0].start
this.end=this.myChart.getModel().option.dataZoom[0].end this.end = this.myChart.getModel().option.dataZoom[0].end
} }
this.is = true; this.is = true;
var option; var option;
this.myChart.setOption( this.myChart.setOption(
@ -570,7 +578,7 @@
xAxisIndex: [0, 1], xAxisIndex: [0, 1],
type: 'slider', type: 'slider',
top: '85%', top: '85%',
start: this.start, start: this.start,
end: this.end end: this.end
} }
], ],
@ -746,21 +754,21 @@
} }
} }
.headerH5{ .headerH5 {
background: #000000; background: #000000;
margin-top: 122rpx; margin-top: 122rpx;
padding: 0 32rpx; padding: 0 32rpx;
.top { .top {
height: 80rpx; height: 80rpx;
border-bottom: 2rpx solid #A1A0A8; border-bottom: 2rpx solid #A1A0A8;
.price { .price {
line-height: 80rpx; line-height: 80rpx;
font-size: 40rpx; font-size: 40rpx;
} }
.percent { .percent {
vertical-align: text-top; vertical-align: text-top;
margin-left: 20rpx; margin-left: 20rpx;
@ -769,46 +777,46 @@
font-size: 24rpx; font-size: 24rpx;
background-color: rgba($color: #F26666, $alpha: 0.2); background-color: rgba($color: #F26666, $alpha: 0.2);
color: #F26666; color: #F26666;
&.rise { &.rise {
color: #00E8A2; color: #00E8A2;
background-color: rgba($color: #00E8A2, $alpha: 0.2); background-color: rgba($color: #00E8A2, $alpha: 0.2);
} }
} }
} }
.bottom { .bottom {
display: flex; display: flex;
font-size: 24rpx; font-size: 24rpx;
.title { .title {
margin-top: 24rpx; margin-top: 24rpx;
line-height: 32rpx; line-height: 32rpx;
} }
.value { .value {
margin: 24rpx 0; margin: 24rpx 0;
color: #A1A0A8; color: #A1A0A8;
} }
.left { .left {
flex: 1; flex: 1;
text-align: left; text-align: left;
} }
.center { .center {
flex: 1; flex: 1;
text-align: center; text-align: center;
} }
.right { .right {
flex: 1; flex: 1;
text-align: right; text-align: right;
} }
} }
} }
.tab { .tab {
display: flex; display: flex;
@ -852,6 +860,7 @@
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
height: 450rpx; height: 450rpx;
margin-bottom: 132rpx;
.title { .title {
display: flex; display: flex;
@ -932,7 +941,11 @@
.btn { .btn {
display: flex; display: flex;
margin: 96rpx 32rpx; z-index: 999;
position: fixed;
bottom: 16rpx;
left: 2%;
width: 96%;
.button { .button {
flex: 1; flex: 1;

2
pages/me/inviteFriends.vue

@ -82,7 +82,7 @@
content: e, content: e,
success: (res) => { success: (res) => {
uni.showToast({ uni.showToast({
title: this.$t("login").copySuccess, title: this.i18n.CopySuccess,
duration: 3000, duration: 3000,
}) })
}, },

2
pages/recharge/rechargeRecord.vue

@ -59,7 +59,7 @@
<view class="dataBody" v-if="form.type === 'online'"> <view class="dataBody" v-if="form.type === 'online'">
<view style="padding:20rpx 32rpx;"> <view style="padding:20rpx 32rpx;">
<key-value-row :keyName="i18n.OrderID" :value="item.orderNo"></key-value-row> <key-value-row :keyName="i18n.OrderID" :value="item.orderNo"></key-value-row>
<key-value-row :keyName="i18n.Fees" :value="(item.tranAmt-(parseInt(item.realAmount,16)))+item.coinCode"></key-value-row> <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> <key-value-row :keyName="i18n.Time" :value="item.timestr"></key-value-row>
</view> </view>
<view style="border-top: 2rpx solid #323045;padding:0rpx 32rpx; margin-bottom: 20rpx;"> <view style="border-top: 2rpx solid #323045;padding:0rpx 32rpx; margin-bottom: 20rpx;">

2
pages/withdrawal/addAddress.vue

@ -207,7 +207,7 @@ export default {
content: value, content: value,
success: (res) => { success: (res) => {
uni.showToast({ uni.showToast({
title: this.$t("login").copySuccess, title: this.i18n.CopySuccess,
duration: 3000, duration: 3000,
}) })
}, },

2
pages/withdrawal/withdrawal.vue

@ -371,7 +371,7 @@
content: value, content: value,
success: (res) => { success: (res) => {
uni.showToast({ uni.showToast({
title: this.$t("login").copySuccess, title: this.i18n.CopySuccess,
duration: 3000, duration: 3000,
}) })
}, },

Loading…
Cancel
Save