Browse Source

K线

master
vee 3 years ago
parent
commit
b63f451fed
  1. 141
      components/entrustOrderList/entrustOrderList.vue
  2. 15
      components/transaction/transaction.vue
  3. 4
      manifest.json
  4. 10
      pages/charity/details.vue
  5. 2
      pages/login/forget.vue
  6. 329
      pages/markets/kLine.vue
  7. 4
      pages/markets/trade.vue
  8. 4
      pages/me/index.vue
  9. 41
      pages/me/transfer.vue
  10. 13
      pages/withdrawal/addAddress.vue
  11. 31
      pages/withdrawal/chooseAddress.vue
  12. 1
      utils/api.js
  13. 37
      utils/axios.js
  14. 2
      utils/constant.js
  15. 7
      utils/language/en_US.js
  16. 5
      utils/language/vi_VN.js
  17. 10
      utils/language/zh_TW.js
  18. 13
      utils/websocket.js

141
components/entrustOrderList/entrustOrderList.vue

@ -20,9 +20,10 @@
<text class="time">{{item.timestr}}</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)">{{
<view class="closeBtn" v-show="type === 0" @click="closeItem(item,index)">{{
i18n.close
}}</view>
</view>
<view class="infoBody">
@ -33,8 +34,11 @@
<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 == 1||type == 2">{{ i18n.StyPrice }}</view>
<view class="value" v-show="type ==1||type == 2">{{item.winStopPrice}}</view>
<view class="closeBtn" v-show="type === 1" @click="Margincall(item)">
{{ i18n.Margincall }}
</view>
</view>
<!-- 公共的 -->
<view class="center">
@ -42,35 +46,54 @@
<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 == 1||type == 2">{{ i18n.StsPrice }}</view>
<view class="value" v-show="type == 1||type == 2">{{item.lossStopPrice}}</view>
<!-- <view class="title" v-show="type === 1">{{ i18n.do }}</view> -->
<view class="closeBtn" v-show="type === 1" @click="getStopLimit(item)">
{{ i18n.StopLimit }}
</view>
</view>
<!-- Current Entrust Position-->
<view class="right" v-show="type === 0 || type === 1">
<view class="title">{{ i18n.CurrentPrice }}</view>
<view class="value" style="color:#F4506A;">{{marketDetail.close}}</view>
<view class="title" v-show="type === 0">{{ i18n.status }}</view>
<!-- <view class="title" v-show="type === 0">{{ i18n.status }}</view>
<view class="value" v-show="type === 0">
{{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}}
</view> -->
<view class="title" v-show="type === 1">{{ i18n.ROE }}</view>
<view class="value" v-show="type === 1" :style="
getValue(item.direction=='buy'
?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)>=0?'color:#00E8A2;':'color:#F4506A'">
<!-- {{getValue(item.profitAmount/item.bondAmount)}}% -->
{{getValue(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)}}%
</view>
<view class="title" v-show="type === 1">{{ i18n.do }}</view>
<view class="value" style="color:#00E8A2;" v-show="type === 1" @click="getStopLimit(item)">
{{ i18n.StopLimit }}
</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)}}
</view>
<view class="value" style="color:#00E8A2;" v-show="type === 2">0</view>
<!-- <view class="title" v-show="type === 1">{{ i18n.do }}</view> -->
<view class="closeBtn" v-show="type === 1" @click="closeItem(item,index)">{{
i18n.close
}}</view>
</view>
<!-- Closed -->
<view class="right" v-show="type === 2">
<view class="title">{{ i18n.ClosePrice }}</view>
<view class="value" style="color:#00E8A2;">{{item.closedPrice}}</view>
<view class="title">{{ i18n.status }}</view>
<view class="title">{{ i18n.ROE }}</view>
<view class="value">
{{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}}
<!-- {{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}} -->
<view class="value" :style="(item.profitAmount/item.bondAmount)*100>=0?'color:#00E8A2;':'color:#F4506A'">
{{getValue(item.profitAmount/item.bondAmount)}}%
</view>
</view>
<view class="title">{{ i18n.PL }}</view>
@ -82,13 +105,13 @@
</view>
<!-- Revoked -->
<view class="right" v-show="type === 3">
<view class="title">{{ i18n.status }}</view>
<!-- <view class="title">{{ i18n.status }}</view>
<view class="value" style="color:#F4506A;">
{{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}}
</view>
</view> -->
<view class="title">{{ i18n.PL }}</view>
<view class="value" style="color:#00E8A2;">
<!-- {{item.currentPl}} --> 0
0
</view>
</view>
</view>
@ -131,10 +154,29 @@
<button class="btn add" @click="stsValueChange('add')"></button>
</view>
</view>
</u-modal>
<!-- 追加保证金 -->
<u-modal :show="stopModalShowZui" :confirmText="i18n.Confirm" :cancelText="i18n.Cancel" :showCancelButton="true"
:title="i18n.Margincall" :content='i18n.WarmTipsText' @confirm="stopConfirm" @cancel="stopModalShowZui = false"
confirmColor="#00E8A2" cancelColor="#96959E">
<view class="stopModel">
<view class="title">
<text class="left">{{ i18n.AmountTrue }}</text>
<!-- <text class="right">{{ i18n.ExpectProfit }} {{ profit }}</text> -->
</view>
<view class="numberInput">
<button class="btn sub" :class="{ disabled: stySubBtnDisabled || styValue <= 0 }"
:disabled="stySubBtnDisabled" @click="styValueChange('sub')"></button>
<input class="number" type="number" v-model="styValue" @input="stopModalChange" />
<button class="btn add" @click="styValueChange('add')"></button>
</view>
</view>
</u-modal>
<u-empty :text="i18n.Dataisempty" mode="data" v-if="!list.length"></u-empty>
</view>
</template>
@ -194,7 +236,12 @@
status: 'opened',
closeModalShow: false,
stopModalShow: false,
<<<<<<< HEAD
type: 1,
=======
stopModalShowZui:false,
type: 0,
>>>>>>> 1e578ec94e2ad85c6c797e5669f396b7f88e1b91
test: 0,
dealList: [{
dealType: 'long'
@ -247,6 +294,13 @@
timer2 = null;
},
methods: {
//
getValue(e){
let data = e*100
data = parseFloat(data.toPrecision(10))
data = String(data)
return data.substring(0, data.indexOf(".") + 3);
},
//
getPrice(s) {
var i=s;
@ -257,6 +311,7 @@
i = String(i)
return i.substring(0, i.indexOf(".") + 5);
},
stopModalChange() {
if (this.stopLimitData.direction === 'buy') {
if (this.styValue)
@ -289,7 +344,15 @@
this.profit = 0
this.loss = 0
},
//
Margincall(i){
this.stopLimitData = i
this.stopModalShowZui=true
this.styValue = 0;
this.stsValue = 0;
this.profit = 0
this.loss = 0
},
//
closeItem(item, i) {
this.itemData = item
@ -369,6 +432,7 @@
* stop确认弹窗
*/
stopConfirm() {
if(this.stopModalShow){
if (this.styValue < 0 || this.stsValue < 0) {
uni.showToast({
title: this.i18n.lessThan,
@ -387,8 +451,33 @@
this.stopModalShow = false
setTimeout(() => {
this.getContractOrderList()
}, 600)
}, 800)
});
}
if(this.stopModalShowZui){
if (this.styValue < 0) {
uni.showToast({
title: this.i18n.lessThan,
icon: 'none',
duration: 2000 //
})
return;
}
const orderList = this.$api.addBond({
"orderNo": this.stopLimitData.orderNo,
"amount": this.styValue,
});
orderList.then(res => {
uni.$u.toast(this.$t("markets").Succeeded)
this.stopModalShowZui = false
setTimeout(() => {
this.getContractOrderList()
}, 800)
});
}
},
/**
* styValue值变化
@ -444,6 +533,23 @@
</script>
<style scoped lang="scss">
.righttype3{
position: absolute;
right: 115rpx;
}
.closeBtn {
display: inline-block;
// width: 98rpx;
padding: 0 12rpx;
height: 48rpx;
border-radius: 8rpx;
line-height: 48rpx;
background-color: rgba($color: rgb(0, 232, 162), $alpha: 0.1);
font-size: 24rpx;
text-align: center;
color: rgb(0, 232, 162);
margin-top: 22rpx;
}
/deep/ .u-empty {
top: 500% !important;
}
@ -519,6 +625,7 @@
font-size: 24rpx;
text-align: center;
color: #F4506A;
margin-top: 0;
}
}

15
components/transaction/transaction.vue

@ -115,6 +115,7 @@
data() {
return {
newSymbol:'',
math:null,
priceSelectListShow: false,
priceTypeValue: 0,
@ -144,11 +145,22 @@
handler: function (n,i) {
this.leverageValue = n.leverage[0];
}
},
marketDetail: {
deep: true,
handler: function (n,i) {
if(this.newSymbol!=n.symbol){
this.coinPrice = this.marketDetail.close
}
this.newSymbol=n.symbol
}
}
},
mounted() {
this.leverageValue = this.contractConfig.leverage[0];
this.coinPrice = this.marketDetail.close
this.newSymbol=this.marketDetail.symbol
},
methods: {
@ -158,7 +170,8 @@
selectChange(index) {
this.priceTypeValue = index;
this.priceSelectListShow = false;
this.coinPrice = this.marketDetail.low
// this.coinPrice = this.marketDetail.low
this.coinPrice = this.marketDetail.close
},
leverageSelectChange(item) {
this.leverageValue = item;

4
manifest.json

@ -44,7 +44,9 @@
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
/* ios */
"ios" : {},
"ios" : {
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
"ad" : {}

10
pages/charity/details.vue

@ -5,7 +5,7 @@
<view class="body">
<view class="titleBody">
<!-- 海报 -->
<u--image class="img" :showLoading="true" :src="baseURL+detail.charityDetails.img" width="750rpx"
<u--image class="img" :showLoading="true" :src="baseURL+imgDetail" width="750rpx"
height="762rpx"></u--image>
<!-- 文章标题 -->
<view class="title">{{detail.charityDetails.title}}</view>
@ -117,6 +117,7 @@
name: "charityDetails",
data() {
return {
imgDetail:'',
id:'',
baseURL:'',
DonatePopupShow: false,
@ -131,7 +132,9 @@
},
radioValue: '',
detail:{
charityDetails:{},
charityDetails:{
img:null,
},
coins:[{}],
},
};
@ -189,6 +192,9 @@
charityId:id
}).then(res => {
this.detail=res;
this.imgDetail=res.charityDetails.img
this.coinInfo.coinCode=this.detail.coins[0].enname
this.coinInfo.coinCode2=this.detail.coins[0].code
})

2
pages/login/forget.vue

@ -25,7 +25,7 @@
<u-input class="input" v-model="userInfo.code" color="#fff" fontSize="32rpx" border="none"
:placeholder="i18n.registerWelcomeText" maxlength="6">
</u-input>
<u-code startText="Get code" :seconds="seconds" ref="uCode" keep-running unique-key="login"
<u-code :startText="i18n.Getcode" :seconds="seconds" ref="uCode" keep-running unique-key="login"
@change="codeChange">
</u-code>
<u-button class="getVCodeBtn" color="#323045" @tap="getCode">{{tips}}</u-button>

329
pages/markets/kLine.vue

@ -74,11 +74,11 @@
<view class="btn">
<!-- open按钮 -->
<u-button class="button" color="#00E8A2" throttleTime="500" @click="btnClick('buy')">
{{ i18n.open }}
{{ i18n.LONG }}
</u-button>
<!-- close按钮 -->
<u-button class="button" color="#F4506A" throttleTime="500" @click="btnClick('sell')">
{{ i18n.close }}
{{ i18n.SHORT }}
</u-button>
</view>
@ -292,12 +292,23 @@
} else if (data.channel === 'market.' + that.symbol.symbol + '.detail') {
that.marketDetail = data.data;
} else if (data.channel === 'market.' + that.symbol.symbol + ".kline." + that.type) {
// console.log('k线')
if (data.event === 'req') {
<<<<<<< HEAD
//that.kdata = that.splitData(data.data)
} else {
//that.upkline(data.data)
=======
// console.log('k线req')
// console.log(11111,data)
that.kdata = that.splitData(data.data)
} else {
that.upkline(data.data)
>>>>>>> 1e578ec94e2ad85c6c797e5669f396b7f88e1b91
}
}
});
},
@ -332,6 +343,320 @@
}
</script>
<<<<<<< HEAD
=======
if (this.channel != newValue.webSocketChannel) {
this.is = false
}
this.channel = newValue.webSocketChannel
const script = document.createElement('script');
// view www www
script.src = './static/echarts.js';
script.onload = this.upData.bind(this);
document.head.appendChild(script);
},
calculateMA(dayCount, data) {
var result = [];
if(data.values){
for (var i = 0, len = data.values.length; i < len; i++) {
if (i < dayCount) {
result.push('-');
continue;
}
var sum = 0;
for (var j = 0; j < dayCount; j++) {
sum += data.values[i - j][1];
}
result.push(+(sum / dayCount).toFixed(3));
}
}
return result;
},
upData(myChart) {
const upColor = '#00C873';
const downColor = '#FF3750';
var chartDom = document.getElementById('kline');
if (!this.is) {
// console.log("this.is11111111", this.is)
this.myChart = echarts.init(chartDom);
if(this.kdata.categoryData){
if (this.kdata.categoryData.length < 100) {
this.start = 50
this.end = 100
} else if (this.kdata.categoryData.length < 200) {
this.start = 85
this.end = 100
} else {
this.start = 98
this.end = 100
}
}
} else {
// console.log(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.is = true;
var option;
this.myChart.setOption(
(option = {
tooltip: {
trigger: 'axis',
axisPointer: {
animation: false,
type: 'cross',
lineStyle: {
width: 1,
opacity: 3
}
}
},
xAxis: [{
type: 'category',
data: this.kdata.categoryData,
boundaryGap: false,
axisLine: {
show: false,
onZero: false
},
axisTick: {
show: false
},
splitLine: {
show: false
},
min: 'dataMin',
max: 'dataMax',
axisPointer: {
z: 100
}
},
{
type: 'category',
gridIndex: 1,
data: this.kdata.categoryData,
boundaryGap: false,
axisLine: {
onZero: false
},
axisTick: {
show: false
},
splitLine: {
show: false
},
axisLabel: {
show: false
},
min: 'dataMin',
max: 'dataMax'
}
],
yAxis: [{
position: 'right',
scale: true,
axisLine: {
show: false
},
axisTick: {
show: true
},
splitArea: {
show: false, // areaStyle: {
// color: 'transparency',
// },
},
splitLine: {
show: true,
lineStyle: {
// 使
color: ['#211F32']
}
}
},
{
scale: true,
gridIndex: 1,
splitNumber: 2,
axisLabel: {
show: false
},
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
show: false
}
}
],
visualMap: {
show: false,
seriesIndex: 5,
dimension: 2,
pieces: [{
value: 1,
color: downColor
},
{
value: -1,
color: upColor
}
]
},
grid: [{
top: '8%',
left: '10rpx',
right: '50rpx',
height: '60%',
backgroundColor: 'transparent',
},
{
left: '10rpx',
right: '50rpx',
top: '80%',
height: '16%'
}
],
dataZoom: [{
type: 'inside',
start: this.start,
end: this.end
},
{
show: false,
xAxisIndex: [0, 1],
type: 'slider',
top: '85%',
start: this.start,
end: this.end
}
],
series: [{
type: 'candlestick',
data: this.kdata.values,
itemStyle: {
color: upColor,
color0: downColor,
borderColor: undefined,
borderColor0: undefined
},
markLine: {
symbol: ['none', 'none'],
data: [
{
name: 'max line on close',
type: 'max',
valueDim: 'highest'
}
]
},
tooltip: {
formatter: function(param) {
param = param[0];
return [
'Date: ' + param.name +
'<hr size=1 style="margin: 3px 0">',
'Open: ' + param.data[0] + '<br/>',
'Close: ' + param.data[1] + '<br/>',
'Lowest: ' + param.data[2] + '<br/>',
'Highest: ' + param.data[3] + '<br/>'
].join('');
}
}
},
{
name: 'MA5',
type: 'line',
showSymbol: false,
data: this.calculateMA(5, this.kdata),
smooth: true,
lineStyle: {
opacity: 0.5
}
},
{
name: 'MA10',
type: 'line',
showSymbol: false,
data: this.calculateMA(10, this.kdata),
smooth: true,
lineStyle: {
opacity: 0.5
}
},
{
name: 'MA20',
type: 'line',
showSymbol: false,
data: this.calculateMA(20, this.kdata),
smooth: true,
lineStyle: {
opacity: 0.5
}
},
{
name: 'MA30',
type: 'line',
showSymbol: false,
data: this.calculateMA(30, this.kdata),
smooth: true,
lineStyle: {
opacity: 0.5
}
},
{
name: 'Volume',
type: 'bar',
xAxisIndex: 1,
yAxisIndex: 1,
data: this.kdata.volumes,
itemStyle: {
color: upColor,
borderColor: undefined,
},
}
]
}),
true
);
}
},
watch: {
// `question`
columData: function(newQuestion, oldQuestion) {
// this.updateEcharts(this.option)
}
},
}
</script>
>>>>>>> 1e578ec94e2ad85c6c797e5669f396b7f88e1b91
<style lang="scss" scoped>
.main {

4
pages/markets/trade.vue

@ -239,11 +239,11 @@
*/
switchTo(item) {
this.popupShow = false;
this.getContractConfig();
this.websock.unSubBbo(this.symbol.symbol)
this.websock.unSubTrade(this.symbol.symbol)
this.symbol = item;
uni.setStorageSync('symbol', this.symbol);
this.getContractConfig();
this.getMarketDetail()
this.getBboList();
this.websock.subBbo(this.symbol.symbol)
@ -340,7 +340,7 @@
color: #818197;
margin-left: 16rpx;
display: flex;
justify-content: space-evenly;
.center {
width: 190rpx;
padding-left: 30rpx;

4
pages/me/index.vue

@ -10,7 +10,7 @@
<view class="contentBody">
<!-- 用户头像和id -->
<view class="userInfo">
<u-image class="headImg" :src="baseURL+userInfo.headImg" width="160rpx" height="160rpx"
<u-image class="headImg" :src="baseURL+imgDetail" width="160rpx" height="160rpx"
radius="160rpx"></u-image>
<view class="idAndAccount">
<view class="id">ID:{{userInfo.uid}}</view>
@ -100,6 +100,7 @@
name: 'me',
data() {
return {
imgDetail:'',
baseURL:'',
// 退
showLogOut: false,
@ -132,6 +133,7 @@
//
getUserInfo() {
api.userInfo().then(res => {
this.imgDetail=res.headImg
this.userInfo=res
})
},

41
pages/me/transfer.vue

@ -30,7 +30,7 @@
<view class="text">{{ i18n.To }}</view>
<view class="input-item">
<u-input class="input" v-model="i18toWays" color="#fff" fontSize="32rpx" border="none"
:placeholder="i18n.TradingAccount" :disabled="true">
:placeholder="i18n.OptionAccount" :disabled="true">
</u-input>
<view class="downSelect" @click="accountPopupShowTo = true"></view>
</view>
@ -94,18 +94,17 @@
@touchmove.stop.prevent="">
<radio-group class="radioGroup" >
<!-- v-for="(item, index) in 3" :key="index" -->
<label class="checkBox" @click="getAccount('exchange','form')">
<label class="checkBox" @click="getAccount('exchange','form'),getCoinOrAccount()">
<view class="name">{{i18n.Balanceaccount}}</view>
<radio color="#00E8A2" shape="square" :checked="transCoinInfo.fromWays=='Balance account'"></radio>
</label>
<label class="checkBox" @click="getAccount('contract','form')">
<label class="checkBox" @click="getAccount('contract','form'),getCoinOrAccount()">
<view class="name">{{i18n.Contractaccount}}</view>
<radio color="#00E8A2" shape="square" :checked="transCoinInfo.fromWays=='Contract account'"></radio>
</label>
</radio-group>
</scroll-view>
<u-button class="button" color="#00E8A2" throttleTime="500" @click="getCoinOrAccount">OK
<u-button class="button" color="#00E8A2" throttleTime="500" @click="accountPopupShow=false">OK
</u-button>
</view>
</u-popup>
@ -119,11 +118,11 @@
@touchmove.stop.prevent="">
<radio-group class="radioGroup" >
<!-- v-for="(item, index) in 3" :key="index" -->
<label class="checkBox" @click="getAccount('contract','to')">
<label class="checkBox" @click="getAccount('contract','to'),getCoinOrAccount()">
<view class="name">{{i18n.Contractaccount}}</view>
<radio color="#00E8A2" shape="square" :checked="transCoinInfo.toWays=='Contract account'"></radio>
</label>
<label class="checkBox" @click="getAccount('exchange','to')">
<label class="checkBox" @click="getAccount('exchange','to'),getCoinOrAccount()">
<view class="name">{{i18n.Balanceaccount}}</view>
<radio color="#00E8A2" shape="square" :checked="transCoinInfo.toWays=='Balance account'"></radio>
</label>
@ -131,7 +130,7 @@
</radio-group>
</scroll-view>
<u-button class="button" color="#00E8A2" throttleTime="500" @click="getCoinOrAccount">OK
<u-button class="button" color="#00E8A2" throttleTime="500" @click="accountPopupShowTo=false">OK
</u-button>
</view>
</u-popup>
@ -187,6 +186,14 @@
},
onLoad() {
this.baseURL = constant.BASE_URL
this.coinInfo.fromWays='exchange';
this.coinInfo.toWays='contract';
this.transCoinInfo.fromWays='Balance account';
this.i18fromWays=this.$t("me").Balanceaccount
this.transCoinInfo.toWays='Contract account';
this.i18toWays=this.$t("me").Contractaccount
this.getInfo()
},
onShow() {},
@ -213,12 +220,13 @@
if(e=='exchange'){
this.transCoinInfo.fromWays='Balance account'
this.i18fromWays=this.$t("me").Balanceaccount
}else{
console.log(123456)
this.transCoinInfo.fromWays='Contract account'
this.i18fromWays=this.$t("me").Contractaccount
}
this.coinInfo.fromWays=e
this.getInfo()
}else{
if(e=='exchange'){
this.transCoinInfo.toWays='Balance account'
@ -267,13 +275,16 @@
fromWays:this.coinInfo.fromWays,
}).then(res => {
this.coinWayInfo=res
this.accountPopupShow = false
this.accountPopupShowTo = false
})
},
//
getInfo(type) {
api.getTransferConfig({}).then(res => {
this.coinWayInfo={};
this.info={};
api.getTransferConfig({
fromWays:this.coinInfo.fromWays
}).then(res => {
this.info = res
//
if(type){
@ -283,13 +294,7 @@
this.coinInfo.coinCode=this.info.coinList[0].enname
this.coinCode = this.info.coinList[0].enname
this.coinCode2 = this.info.coinList[0].code
this.coinInfo.fromWays='exchange';
this.coinInfo.toWays='contract';
this.transCoinInfo.fromWays='Balance account';
this.i18fromWays=this.$t("me").Balanceaccount
this.transCoinInfo.toWays='Contract account';
this.i18toWays=this.$t("me").Contractaccount
})
},
USDTRadioChange(e) {},

13
pages/withdrawal/addAddress.vue

@ -2,7 +2,15 @@
<view class="main">
<!-- nav -->
<navigation>{{ i18n.AddAddress }} </navigation>
<!-- #ifdef H5 -->
<view class="body">
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="body-APP">
<!-- #endif -->
<!-- coin选择框 -->
<view class="choose-item">
<u-input class="input inputbg" v-model="coinInfo.coinCode" color="#fff" fontSize="32rpx" border="none"
@ -242,6 +250,11 @@ export default {
padding: 32rpx;
}
.body-APP{
margin-top: 200rpx !important;
padding: 32rpx;
}
.choose-item {
overflow: hidden;
position: relative;

31
pages/withdrawal/chooseAddress.vue

@ -2,10 +2,23 @@
<view class="main">
<!-- nav -->
<navigation>{{ i18n.ChooseAddress }}
<!-- #ifdef H5 -->
<view slot="right" class="right" @click="editFlag = !editFlag;">{{
editFlag ? i18n.OK : i18n.Edit
}}
</view>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view slot="right" class="right2" @click="editFlag = !editFlag;">{{
editFlag ? i18n.OK : i18n.Edit
}}
</view>
<!-- #endif -->
</navigation>
<!-- #ifdef APP-PLUS -->
@ -225,6 +238,8 @@
line-height: 56rpx;
position: absolute;
right: 32rpx;
top: 50%;
transform: translateY(-50%);
font-size: 24rpx;
background: rgba(246, 166, 9, 0.1);
border-radius: 8px;
@ -232,6 +247,22 @@
}
.right2{
width: 82rpx;
height: 56rpx;
line-height: 56rpx;
position: absolute;
right: 32rpx;
top: 70%;
transform: translateY(-50%);
font-size: 24rpx;
background: rgba(246, 166, 9, 0.1);
border-radius: 8px;
color: #FFBC1F;
}
.content {
margin-top: 200rpx;
padding: 40rpx;

1
utils/api.js

@ -39,6 +39,7 @@ const api = {
contractClosed: (params) => Vue.prototype.$axios.post('/api/contract/closed',params),//合约订单平仓
contractConfig: (params) => Vue.prototype.$axios.post('/api/contract/contractConfig',params),//合约配置
contractOrderList: (params) => Vue.prototype.$axios.post('/api/contract/orderList',params),//合约订单列表
addBond: (params) => Vue.prototype.$axios.post('/api/contract/addBond',params),//追加保证金
//--------------------------------- transfer ---------------------------------
getTransferConfig: (params) => Vue.prototype.$axios.post('/api/transfer/getTransferConfig',params),//获取转账配置配置

37
utils/axios.js

@ -29,7 +29,44 @@ service.interceptors.request.use(
// mask: true
// })
}
console.log(config.url)
if (config.url.indexOf("/api/index/register") !== -1 ||
config.url.indexOf("/api/user/login") !== -1 ||
config.url.indexOf("/api/user/forgotPassword") !== -1 ||
config.url.indexOf("/api/user/updatePassword") !== -1 ||
config.url.indexOf("/api/user/bindBank") !== -1 ||
config.url.indexOf("/api/user/updatePayPassword") !== -1 ||
config.url.indexOf("/api/index/sendEmailCode") !== -1 ||
config.url.indexOf("/api/user/loginOut") !== -1 ||
config.url.indexOf("/api/recharge/recharge") !== -1 ||
config.url.indexOf("/api/withdraw/withdrawAddressAdd") !== -1 ||
config.url.indexOf("/api/withdraw/withdraw") !== -1 ||
config.url.indexOf("/api/mine/mineSubmit") !== -1 ||
config.url.indexOf("/api/contract/order") !== -1 ||
config.url.indexOf("/api/contract/setWinOrLossStopPrice") !== -1 ||
config.url.indexOf("/api/contract/cancel") !== -1 ||
config.url.indexOf("/api/contract/closed") !== -1 ||
config.url.indexOf("/api/transfer/transfer") !== -1 ||
config.url.indexOf("/api/exchange/exchangeCoin") !== -1 ||
config.url.indexOf("/api/charity/charitySubmit") !== -1 ||
config.url.indexOf("/api/steps/receivStepsAward") !== -1 ||
config.url.indexOf("/api/withdraw/withdrawAddressDel") !== -1
) {
console.log(config.url)
uni.showLoading({
title: 'loading',
mask: true
})
}
if (config.url.indexOf("/api/recharge/rechargeConfig") !== -1
|| config.url.indexOf("/api/recharge/rechargeList") !== -1
|| config.url.indexOf("/api/withdraw/withdrawConfig") !== -1
|| config.url.indexOf("/api/withdraw/withdrawList") !== -1
|| config.url.indexOf("/api/contract/orderList") !== -1
) {
uni.hideLoading()
}
if (config.url.indexOf('market') > -1) {
// #ifdef H5

2
utils/constant.js

@ -1,5 +1,5 @@
const IS_TEST = true;
const IS_TEST = false;
const H5_BASE_URL = '/api';
const BASE_URL = IS_TEST?'https://sapi.payairs.com':'https://api.gream.ltd';
const H5_MARKET_URL = '/market';

7
utils/language/en_US.js

@ -95,6 +95,10 @@ export default {
// 合约页面相关
markets: {
Margincall:'Margin call',
ROE:'ROE',
// 漏掉的国际化
undone:'undone',
opened:'open position',
@ -154,6 +158,7 @@ export default {
BuyingPrice:'Buying Price',
SellPrice:'Sell Price',
open:'Open',
AmountTrue:'Amount',
},
// 捐赠页面相关
@ -443,7 +448,7 @@ export default {
SelectCurrency: 'Select currency',
PleaseChooseCoin: 'Please choose coin',
From: 'From',
OptionAccount: 'Option account',
OptionAccount: 'Choose account',
To: 'To',
TradingAccount: 'Trading account',
TransferNumber: 'Transfer number',

5
utils/language/vi_VN.js

@ -93,6 +93,8 @@ export default {
// 合约页面相关
markets: {
Margincall:'Gọi Lề',
ROE:'Thua',
// 漏掉的国际化
undone: 'Không',
@ -153,6 +155,7 @@ export default {
BuyingPrice: 'giá mua',
SellPrice: 'gia ban',
open: 'mở một vị trí',
AmountTrue:'lượng',
},
// 捐赠页面相关
@ -434,7 +437,7 @@ export default {
SelectCurrency: 'Chọn đơn vị tiền tệ',
PleaseChooseCoin: 'Vui lòng chọn đơn vị tiền tệ',
From: 'chuyển ra ngoài',
OptionAccount: 'Tài khoản Tùy chọn',
OptionAccount: 'chọn tài khoản',
To: 'chuyển giao',
TradingAccount: 'tài khoản giao dịch',
TransferNumber: 'Số tiền chuyển khoản',

10
utils/language/zh_TW.js

@ -94,6 +94,10 @@ export default {
// 合约页面相关
markets: {
ROE:'收益率',
Margincall:'追加保證金',
// 漏掉的国际化
undone:'未成交',
opened:'已開倉',
@ -154,6 +158,8 @@ export default {
BuyingPrice:'買價',
SellPrice:'賣價',
open:'開倉',
AmountTrue:'數量',
},
// 捐赠页面相关
@ -356,7 +362,7 @@ export default {
ConfirmAmount: '確認金額',
USDT: 'USDT',
Time: '時間',
CheckTheNumberoOfUSDT: '查看USDT數量',
CheckTheNumberoOfUSDT: '確認USDT數量',
// Subscription
Subscription: '申購',
Days: '天',
@ -438,7 +444,7 @@ export default {
SelectCurrency: '選擇幣種',
PleaseChooseCoin: '請選擇幣種',
From: '轉出',
OptionAccount: '期權賬戶',
OptionAccount: '選擇帳戶',
To: '轉入',
TradingAccount: '交易賬戶',
TransferNumber: '轉帳金額',

13
utils/websocket.js

@ -124,6 +124,7 @@ class WebSocketClass {
// #ifdef APP-PLUS
this.ws.onMessage(event => {
this.globalCallback(JSON.parse(event.data))
});
// #endif
@ -150,7 +151,7 @@ class WebSocketClass {
this.ws && this.ws.send({
data: JSON.stringify(msg),
success() {
console.log('消息发送成功');
console.log('消息发送成功',msg);
},
fail(err) {
console.log('关闭失败', err)
@ -218,7 +219,17 @@ class WebSocketClass {
}
subKHistory(timeType, symbol) {
var toDate = parseInt(new Date().getTime() / 1000);
<<<<<<< HEAD
var num = 500000;
=======
var num = 10000;
// #ifdef APP-PLUS
num = 3000;
// #endif
>>>>>>> 1e578ec94e2ad85c6c797e5669f396b7f88e1b91
var fromDate = parseInt(new Date().getTime() / 1000);
switch (timeType) {
case '1min':

Loading…
Cancel
Save