Browse Source

合并

master
j1ack 3 years ago
parent
commit
1918aebc02
  1. 16
      components/entrustOrderList/entrustOrderList.vue
  2. 21
      manifest.json
  3. 2
      pages/home/index.vue
  4. 50
      pages/markets/kLine.vue
  5. 103
      utils/axios.js
  6. 11
      utils/websocket.js

16
components/entrustOrderList/entrustOrderList.vue

@ -32,8 +32,8 @@
<view class="value">{{item.openedPrice}}</view> <view class="value">{{item.openedPrice}}</view>
<view class="title">{{ i18n.Bond }}</view> <view class="title">{{ i18n.Bond }}</view>
<view class="value">{{item.bondAmount}}</view> <view class="value">{{item.bondAmount}}</view>
<view class="title" v-show="type !== 3||type !== 0">{{ i18n.StyPrice }}</view> <view class="title" v-show="type == 1||type == 2">{{ i18n.StyPrice }}</view>
<view class="value" v-show="type !== 3||type !== 0">{{item.winStopPrice}}</view> <view class="value" v-show="type ==1||type == 2">{{item.winStopPrice}}</view>
</view> </view>
<!-- 公共的 --> <!-- 公共的 -->
<view class="center"> <view class="center">
@ -41,17 +41,17 @@
<view class="value">{{item.hand}} * {{item.leverage}}</view> <view class="value">{{item.hand}} * {{item.leverage}}</view>
<view class="title">{{ i18n.Fee }}</view> <view class="title">{{ i18n.Fee }}</view>
<view class="value">{{item.fee}}</view> <view class="value">{{item.fee}}</view>
<view class="title" v-show="type !== 3||type !== 0">{{ i18n.StsPrice }}</view> <view class="title" v-show="type == 1||type == 2">{{ i18n.StsPrice }}</view>
<view class="value" v-show="type !== 3||type !== 0">{{item.lossStopPrice}}</view> <view class="value" v-show="type == 1||type == 2">{{item.lossStopPrice}}</view>
</view> </view>
<!-- Current Entrust Position--> <!-- Current Entrust Position-->
<view class="right" v-show="type === 0 || type === 1"> <view class="right" v-show="type === 0 || type === 1">
<view class="title">{{ i18n.CurrentPrice }}</view> <view class="title">{{ i18n.CurrentPrice }}</view>
<view class="value" style="color:#F4506A;">{{marketDetail.close}}</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"> <view class="value" v-show="type === 0">
{{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> </view> -->
<view class="title" v-show="type === 1">{{ i18n.do }}</view> <view class="title" v-show="type === 1">{{ i18n.do }}</view>
<view class="value" style="color:#00E8A2;" v-show="type === 1" @click="getStopLimit(item)"> <view class="value" style="color:#00E8A2;" v-show="type === 1" @click="getStopLimit(item)">
{{ i18n.StopLimit }} {{ i18n.StopLimit }}
@ -81,10 +81,10 @@
</view> </view>
<!-- Revoked --> <!-- Revoked -->
<view class="right" v-show="type === 3"> <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;"> <view class="value" style="color:#F4506A;">
{{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> </view> -->
<view class="title">{{ i18n.PL }}</view> <view class="title">{{ i18n.PL }}</view>
<view class="value" style="color:#00E8A2;"> <view class="value" style="color:#00E8A2;">
<!-- {{item.currentPl}} --> 0 <!-- {{item.currentPl}} --> 0

21
manifest.json

@ -44,7 +44,9 @@
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ] "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
}, },
/* ios */ /* ios */
"ios" : {}, "ios" : {
"dSYMs" : false
},
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs" : {
"ad" : {} "ad" : {}
@ -82,22 +84,7 @@
} }
} }
}, },
"nativePlugins" : { "nativePlugins" : {}
"HF-Step" : {
"__plugin_info__" : {
"name" : "原生计步器(Android和IOS)",
"description" : "计步器,原生计步器插件,安卓,IOS",
"platforms" : "Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=6632",
"android_package_name" : "com.samehome",
"ios_bundle_id" : "com.samehome",
"isCloud" : true,
"bought" : 1,
"pid" : "6632",
"parameters" : {}
}
}
}
}, },
"h5" : { "h5" : {
"publicPath" : "/", "publicPath" : "/",

2
pages/home/index.vue

@ -170,7 +170,7 @@
} }
}, },
onLoad() { onLoad() {
this.baseURL = constant.BASE_URL this.baseURL = constant.BASE_URL
this.getbanner(); this.getbanner();
this.noticeList(); this.noticeList();
this.getUserInfoBalance(); this.getUserInfoBalance();

50
pages/markets/kLine.vue

@ -279,12 +279,17 @@
} else if (data.channel === 'market.' + that.symbol.symbol + '.detail') { } else if (data.channel === 'market.' + that.symbol.symbol + '.detail') {
that.marketDetail = data.data; that.marketDetail = data.data;
} else if (data.channel === 'market.' + that.symbol.symbol + ".kline." + that.type) { } else if (data.channel === 'market.' + that.symbol.symbol + ".kline." + that.type) {
// console.log('k线')
if (data.event === 'req') { if (data.event === 'req') {
// console.log('k线req')
// console.log(11111,data)
that.kdata = that.splitData(data.data) that.kdata = that.splitData(data.data)
} else { } else {
that.upkline(data.data) that.upkline(data.data)
} }
} }
}); });
}, },
@ -392,22 +397,23 @@
script.src = './static/echarts.js'; script.src = './static/echarts.js';
script.onload = this.upData.bind(this); script.onload = this.upData.bind(this);
document.head.appendChild(script); document.head.appendChild(script);
}, },
calculateMA(dayCount, data) { calculateMA(dayCount, data) {
var result = []; var result = [];
for (var i = 0, len = data.values.length; i < len; i++) { if(data.values){
if (i < dayCount) { for (var i = 0, len = data.values.length; i < len; i++) {
result.push('-'); if (i < dayCount) {
continue; result.push('-');
} continue;
var sum = 0; }
for (var j = 0; j < dayCount; j++) { var sum = 0;
sum += data.values[i - j][1]; for (var j = 0; j < dayCount; j++) {
sum += data.values[i - j][1];
}
result.push(+(sum / dayCount).toFixed(3));
} }
result.push(+(sum / dayCount).toFixed(3));
} }
return result; return result;
}, },
@ -418,17 +424,21 @@
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) {
this.start = 50 if(this.kdata.categoryData){
this.end = 100 if (this.kdata.categoryData.length < 100) {
} else if (this.kdata.categoryData.length < 200) { this.start = 50
this.start = 85 this.end = 100
this.end = 100 } else if (this.kdata.categoryData.length < 200) {
} else { this.start = 85
this.start = 98 this.end = 100
this.end = 100 } else {
this.start = 98
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

103
utils/axios.js

@ -21,7 +21,7 @@ const service = axios.create({
// request拦截器,在请求之前做一些处理 // request拦截器,在请求之前做一些处理
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
const language = uni.getStorageSync("language")|| 'en_US'; const language = uni.getStorageSync("language") || 'en_US';
// console.log('语言', language) // console.log('语言', language)
if (constant.SHOW_DIALOG) { if (constant.SHOW_DIALOG) {
// uni.showLoading({ // uni.showLoading({
@ -29,7 +29,44 @@ service.interceptors.request.use(
// mask: true // 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) { if (config.url.indexOf('market') > -1) {
// #ifdef H5 // #ifdef H5
@ -43,7 +80,7 @@ service.interceptors.request.use(
const ticket = uni.getStorageSync('ticket') const ticket = uni.getStorageSync('ticket')
if (ticket) { if (ticket) {
if(!config.data){ if (!config.data) {
config.data = {}; config.data = {};
} }
config.data['ticket'] = ticket config.data['ticket'] = ticket
@ -125,8 +162,8 @@ service.interceptors.request.use(
return config; return config;
}, },
error => { error => {
// console.error(error); // console.error(error);
// for debug // for debug
uni.hideLoading(); uni.hideLoading();
return Promise.reject(error); return Promise.reject(error);
} }
@ -137,42 +174,42 @@ service.interceptors.response.use(res => {
uni.hideLoading() uni.hideLoading()
res=res.data; res = res.data;
// console.log('数据',res) // console.log('数据',res)
// console.log(res.data) // console.log(res.data)
// console.log(res.data.data[0].nameAlias) // console.log(res.data.data[0].nameAlias)
if (res.code===0||res.success) { if (res.code === 0 || res.success) {
return res.data; return res.data;
} }
uni.showToast({ uni.showToast({
title: res.errMsg, title: res.errMsg,
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
})
if (res.errCode === 'SYS.0006') {
uni.setStorageSync('ticket', null);
uni.setStorageSync('logInfo', null);
uni.reLaunch({
url: '/pages/login/index'
}) })
if (res.errCode === 'SYS.0006') { // #ifdef H5
uni.setStorageSync('ticket',null); var url = location.href;
uni.setStorageSync('logInfo',null); if (url.indexOf('pages') > -1) {
uni.reLaunch({ uni.setStorage({
url: '/pages/login/index' key: 'url',
}) data: url,
// #ifdef H5 success: function() {
var url = location.href; // console.log('success')
if (url.indexOf('pages') > -1) { }
uni.setStorage({ });
key: 'url', } else {
data: url, uni.removeStorageSync('url')
success: function() {
// console.log('success')
}
});
} else {
uni.removeStorageSync('url')
}
// #endif
} }
uni.$emit('refreshQrCode') // #endif
return Promise.reject(res.errMsg); }
uni.$emit('refreshQrCode')
return Promise.reject(res.errMsg);
}, error => { }, error => {
uni.hideLoading(); uni.hideLoading();
return Promise.reject(error) return Promise.reject(error)

11
utils/websocket.js

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

Loading…
Cancel
Save