Compare commits

...

4 Commits

  1. 457
      components/kEchart/index.vue
  2. 52
      pages/home/index.vue
  3. 769
      pages/markets/kLine.vue
  4. 11
      pages/markets/trade.vue
  5. 31
      pages/me/index.vue
  6. 45
      static/echarts.min.js

457
components/kEchart/index.vue

@ -0,0 +1,457 @@
<template>
<view class="content">
<!-- #ifdef APP-PLUS || H5 -->
<view @click="echarts.onClick" :prop="option" :change:prop="echarts.updateEcharts" id="echarts" class="echarts">
</view>
<!-- #endif -->
<!-- #ifndef APP-PLUS || H5 -->
<view> APPH5 环境不支持</view>
<!-- #endif -->
</view>
</template>
<script>
// (open)(close)(lowest)(highest)(vol)
function splitData(rawData) {
let raw = JSON.parse(JSON.stringify(rawData))
let categoryData = [];
let values = [];
let volumes = [];
for (let i = 0; i < raw.length; i++) {
categoryData.push(raw[i].splice(0, 1)[0]);
values.push(raw[i]);
// console.log(raw[i],'*****')
// volumes.push([i, raw[i][4], raw[i][0] >= raw[i][1] ? 1 : -1]);
volumes.push([i, raw[i][3], raw[i][0] >= raw[i][1] ? 1 : -1]);
}
return {
categoryData: categoryData,
values: values,
volumes: volumes
};
}
function calculateMA(dayCount, values) {
let result = [];
for (let i = 0, len = values.length; i < len; i++) {
if (i < dayCount) {
result.push('-');
continue;
}
let sum = 0;
for (let j = 0; j < dayCount; j++) {
sum += values[i - j][1];
}
result.push(+(sum / dayCount).toFixed(3));
}
return result;
}
export default {
props: {
kData,
//
initData: {
type: Array,
required: true
},
upColor: {
type: String,
default: 'rgb(49,186,160)'
},
downColor: {
type: String,
default: 'rgb(252,95,95)'
},
// 线
markLineColor: {
type: String,
default: '#ffffff'
},
// 线
markLineLabelColor: {
type: String,
default: '#ffffff'
},
// 线
markLineYTime: {
type: String,
default: '最新价'
},
// 线
markLineLabelBackgroundColor: {
type: String,
default: '#00b6ff'
},
// Y
yAxisSplitLineColor: {
type: String,
default: '#333'
},
// Y
yAxisAxisLabelColor: {
type: String,
default: '#fff'
},
//
backgroundImageUrl: {
type: String,
default: '#000'
},
},
data() {
return {
option: {},
oldData: {}
}
},
onShow() {
console.log(this.kData);
this.init(this.kData)
},
mounted() {
if (this.initData.length > 0) {
this.init(this.initData)
}
},
methods: {
//
addData(oo) {
let isUp = false;
let isUpIndex = true;
for (let i = 0; i < this.oldData.length; i++) {
// console.log(listData[i][0], oo[0],listData[i][0] != oo[0])
if (this.oldData[i][0] == oo[0]) {
isUp = true;
isUpIndex = i;
this.oldData[isUpIndex] = oo
}
}
if (!isUp) {
this.oldData.shift();
this.oldData.push(oo)
}
this.changeOption(this.oldData)
},
//
init(data) {
console.log(data);
this.oldData = JSON.parse(JSON.stringify(data));
this.changeOption(this.oldData)
},
changeOption(res) {
let data = splitData(JSON.parse(JSON.stringify(res)));
this.option = {
// animation: false,
animationEasing: 'elasticOut',
legend: {
show: false,
bottom: 10,
left: 'center',
data: ['Dow-Jones index', 'MA5', 'MA10']
},
tooltip: {
trigger: 'axis',
confine: true,
axisPointer: {
type: 'line',
},
backgroundColor: 'rgba(255, 255, 255, 0.8)',
position: function (pos, params, el, elRect, size) {
let obj = { top: 10 };
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 30;
return obj;
},
extraCssText: 'width: 170px'
},
axisPointer: {
type: 'line',
lineStyle: {
type: 'solid',
color: '#ffffff'
},
link: { xAxisIndex: 'all' },
label: {
backgroundColor: '#777'
}
},
visualMap: {
show: false,
seriesIndex: 3,
dimension: 2,
pieces: [{
value: 1,
color: this.downColor
}, {
value: -1,
color: this.upColor
}]
},
grid: [
{
top: '4%',
left: '2%',
right: '18%',
height: '65%',
bottom: '0%',
borderWidth: 20
},
{
left: '2%',
right: '18%',
bottom: '5%',
height: '25%'
}
],
graphic: [
{
type: 'image', //
id: 'logo', //
right: 'center', //
bottom: 'middle', // 0%, bottom 0bottom
z: 0, //
bounding: 'all', //
style: {
image: this.backgroundImageUrl, // https
width: '100%',
height: '100%'
}
}],
xAxis: [
{
show: false,
type: 'category',
},
{
type: 'category',
gridIndex: 1,
data: data.categoryData,
// scale: true,
// boundaryGap: false,
axisTick: { show: false },
minorTick: { show: false },
axisLine: { onZero: false },
axisLabel: { onZero: false },
// splitNumber: 20,
min: 'dataMin',
max: 'dataMax',
axisPointer: {
label: {
formatter: function (params) {
let seriesValue = (params.seriesData[0] || {}).value;
return params.value
+ (seriesValue != null
? '\n' + echarts.format.addCommas(seriesValue)
: ''
);
}
}
}
}
],
yAxis: [
{
scale: true,
position: 'right',
splitLine: {
show: true,
lineStyle: {
color: this.yAxisSplitLineColor
}
},
axisLabel: {
show: true,
color: this.yAxisAxisLabelColor,
},
minorTick: {
show: true,
splitNumber: 10,
lineStyle: {
color: this.yAxisAxisLabelColor,
}
}
},
{
scale: true,
gridIndex: 1,
splitNumber: 1,
axisLabel: { show: false },
axisLine: { show: false },
axisTick: { show: false },
splitLine: { show: false }
}
],
dataZoom: [
{
type: 'inside',
xAxisIndex: [0, 1],
zoomOnMouseWheel: false,
moveOnMouseMove: false,
moveOnMouseWheel: false,
start: 0,
end: 100,
},
{
show: true,
xAxisIndex: [0, 1],
type: 'inside',
zoomOnMouseWheel: false,
moveOnMouseMove: false,
moveOnMouseWheel: false,
top: '85%',
start: 0,
end: 100,
}
],
series: [
{
name: 'Dow-Jones index',
type: 'candlestick',
data: data.values,
itemStyle: {
color: this.upColor,
color0: this.downColor,
borderColor: null,
borderColor0: null
},
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('');
}
},
markLine: {
symbol: 'none', //线
data: [
{
silent: false,// truefalse
yAxis: data.values[data.values.length - 1][1],// 线yAxis,线 {type : 'average', name: ''}type max min average
lineStyle: { //线
type: "solid",
color: this.markLineColor,
},
label: {
position: "end",//start,"middle","end"
color: this.markLineLabelColor,
// backgroundColor:"#00b6ff",
fontSize: "12px",
formatter: [
'{a|{c}}',
'{b|' + this.markLineYTime + '}'
].join('\n'),
// formatter:"{c}\n",
rich: {
a: {
padding: 4,
backgroundColor: this.markLineLabelBackgroundColor,
align: 'right',
},
b: {
padding: 4,
backgroundColor: this.markLineLabelBackgroundColor,
align: 'right',
},
}
},
},
]
},
},
{
name: 'MA5',
type: 'line',
symbol: "none",
data: calculateMA(5, data.values),
smooth: true,
lineStyle: {
opacity: 0.5
}
},
{
name: 'MA10',
type: 'line',
symbol: "none",
data: calculateMA(10, data.values),
smooth: true,
lineStyle: {
opacity: 0.5
}
},
{
name: 'Volume',
type: 'bar',
xAxisIndex: 1,
yAxisIndex: 1,
data: data.volumes
}
]
}
},
onViewClick(options) {
console.log(options)
}
}
}
</script>
<script module="echarts" lang="renderjs">
let myChart
export default {
mounted() {
if (typeof window.echarts === 'function') {
this.initEcharts()
} else {
//
const script = document.createElement('script')
// view www www
script.src = 'static/echarts.min.js'
script.onload = this.initEcharts.bind(this)
document.head.appendChild(script)
}
},
methods: {
initEcharts() {
myChart = echarts.init(document.getElementById('echarts'), null, {renderer: 'svg'})
// view 访
myChart.setOption(this.option)
},
updateEcharts(newValue, oldValue, ownerInstance, instance) {
// service
if (myChart) {
myChart.setOption(newValue)
}
},
onClick(event, ownerInstance) {
// service
ownerInstance.callMethod('onViewClick', {
test: 'test'
})
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.echarts {
width: 100%;
height: 482px;
overflow: hidden;
width: 100%;
background-color: #12023e;
}
</style>

52
pages/home/index.vue

@ -50,9 +50,8 @@ Blame
<view class="steps">
<view class="content">
<view class="title">{{ i18n.TodaySteps }}</view>
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget"
:change:stepTarget="echarts.receive" :change:stepsNum="echarts.receive"
style="width: 280rpx;height:280rpx; font-size: 40rpx;"></view>
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget" :change:stepTarget="echarts.receive"
: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">{{ i18n.ReceiveEarnings }}</u-button>
</view>
@ -75,7 +74,8 @@ Blame
margin: 'auto 102rpx auto 118rpx',
}">
<view class="content">
<scroll-view scroll-y="true" style="height: 288rpx;" scroll-with-animation="true" @touchmove.stop.prevent="">
<scroll-view scroll-y="true" style="height: 288rpx;" scroll-with-animation="true"
@touchmove.stop.prevent="">
{{ i18n.homeMessage }}
</scroll-view>
<u-button class="button" color="#00E8A2" @click="popupShow = false">OK</u-button>
@ -175,8 +175,8 @@ export default {
}
},
methods: {
getbanner(){
const indexBanner=api.indexBanner({'mark':'APP_INDEX'});
getbanner() {
const indexBanner = api.indexBanner({ 'mark': 'APP_INDEX' });
console.log(indexBanner)
},
//
@ -342,26 +342,18 @@ export default {
let myChart
export default {
mounted() {
console.log(0);
console.log(window);
console.log(typeof window.echarts);
// this.initEcharts();
if (typeof window.echarts === 'object') {
this.initEcharts()
}else if (typeof window.echarts === 'function') {
this.initEcharts()
} else {
console.log(1);
//
const script = document.createElement('script');
console.log(2);
// view www www
script.src = './static/echarts.js';
console.log(3);
script.src = './static/echarts.min.js';
script.onload = this.initEcharts.bind(this);
console.log(4);
document.head.appendChild(script);
console.log(5);
}
},
@ -371,20 +363,10 @@ export default {
},
initEcharts() {
console.log(31);
// let t1=null;
this.initChart()
console.log(32);
myChart = echarts.init(document.getElementById('chart'))
console.log(33);
// view 访
myChart.setOption(this.option)
console.log(34);
// clearInterval(t1)
// t1= setInterval(() => {
// console.log(1);
// myChart.setOption(this.option)
// }, 1000);
},
updateEcharts(newValue, oldValue, ownerInstance, instance) {
// service
@ -397,12 +379,6 @@ export default {
})
},
initChart() {
// let myChart = echarts.init(this.$refs.chart);
// console.log(document);
// console.log(this.$refs.chart);
// this.myChart = echarts.init(document.getElementById('chart'));
// this.myChart = echarts.init(this.$refs.chart);
// myChart = echarts.init(document.getElementById('chart'))
this.option = {
title: {
text: this.stepsNum,
@ -421,6 +397,7 @@ export default {
series: [{
name: '环形饼图',
type: 'pie',
roundCap: true,
radius: ['48%', '70%'],
avoidLabelOverlap: false,
label: {
@ -432,7 +409,7 @@ export default {
shadowBlur: 30,
shadowColor: '#15141F',
shadowOffsetX: 'center',
shadowOffsetY: 'center'
shadowOffsetY: 'center',
},
data: [{
@ -452,8 +429,6 @@ export default {
}
]),
borderRadius: 800,
}
},
{
@ -469,9 +444,9 @@ export default {
}
// myChart.setOption(this.option, true);
// window.addEventListener('resize', () => {
// myChart.resize();
// });
window.addEventListener('resize', () => {
myChart.resize();
});
}
},
watch: {
@ -487,6 +462,7 @@ export default {
<style lang="scss" scoped>
.main {
padding-bottom: 198rpx; // TabBar
.nav-head {
position: fixed;
top: 0rpx;
@ -574,7 +550,7 @@ export default {
left: 20rpx;
}
.notice{
.notice {
width: 574rpx;
margin-left: 80rpx;
margin-top: 10rpx;

769
pages/markets/kLine.vue

@ -26,8 +26,8 @@
</view>
</view>
<!-- K线图 -->
<view class="kline" id="kline" :kdata="kdata"
:change:kdata="klineE.receive" style="height:1000rpx;color:aliceblue ">
<view class="kline" id="kline" :kdata="kdata" :change:kdata="klineE.receive"
style="height:1000rpx;color:aliceblue ">
</view>
<!-- 买卖挂牌表 -->
@ -78,107 +78,94 @@
</view>
</template>
<script>
import ktest from '@/utils/ktest.js'
export default {
name: "trade",
components: { ktest },
data() {
return {
buyList: 7,
sellList: 9,
kdata:[]
<script>
import ktest from '@/utils/ktest.js'
export default {
name: "trade",
components: { ktest },
data() {
return {
buyList: 7,
sellList: 9,
kdata: []
};
},
computed: {
i18n() {
return this.$t("markets");
},
},
onLoad() {
this.kdata = this.splitData(ktest.JSON);
console.log(this.kdata, 1111)
},
onShow() { },
methods: {
into() {
};
},
computed: {
i18n() {
return this.$t("markets");
},
splitData(rawData) {
let categoryData = [];
let values = [];
let volumes = [];
for (let i = 0; i < rawData.length; i++) {
categoryData.push(rawData[i].splice(0, 1)[0]);
values.push(rawData[i]);
volumes.push([i, rawData[i][4], rawData[i][0] > rawData[i][1] ? 1 : -1]);
}
return {
categoryData: categoryData,
values: values,
volumes: volumes
};
},
onLoad() {
this.kdata=this.splitData(ktest.JSON);
console.log(this.kdata,1111)
depthChange(e) {
console.log(e);
},
onShow() {},
methods: {
into(){
},
splitData(rawData) {
let categoryData = [];
let values = [];
let volumes = [];
for (let i = 0; i < rawData.length; i++) {
categoryData.push(rawData[i].splice(0, 1)[0]);
values.push(rawData[i]);
volumes.push([i, rawData[i][4], rawData[i][0] > rawData[i][1] ? 1 : -1]);
}
return {
categoryData: categoryData,
values: values,
volumes: volumes
};
},
depthChange(e) {
console.log(e);
},
goto(page) {
let url = '';
switch (page) {
case 'kLine':
url = '/pages/markets/kLine'
break;
default:
break;
}
uni.navigateTo({
url,
});
goto(page) {
let url = '';
switch (page) {
case 'kLine':
url = '/pages/markets/kLine'
break;
default:
break;
}
uni.navigateTo({
url,
});
}
},
}
},
}
</script>
<script module="klineE" lang="renderjs">
let kline
export default {
mounted() {
console.log(0);
console.log(window);
console.log(typeof window.echarts);
// this.initEcharts();
if (typeof window.echarts === 'object') {
//this.initEcharts()
} else if (typeof window.echarts === 'function') {
if (typeof window.echarts === 'function') {
//this.initEcharts()
} else {
// console.log(1);
// //
// const script = document.createElement('script');
// console.log(2);
// //this.kdata=this.splitData(this.kdata);
// // view www www
// script.src = './static/echarts.js';
// console.log(3);
// script.onload = this.initEcharts.bind(this);
// console.log(4);
// document.head.appendChild(script);
// console.log(5);
}
},
methods: {
receive(newValue, oldValue, ownerVm, vm) {
console.log('newValue', newValue)
const script = document.createElement('script');
// view www www
script.src = './static/echarts.js';
console.log(3);
script.onload = this.upData.bind(this);
console.log(4);
document.head.appendChild(script);
methods: {
receive(newValue, oldValue, ownerVm, vm) {
console.log('newValue', newValue)
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) {
@ -195,184 +182,184 @@
result.push(+(sum / dayCount).toFixed(3));
}
return result;
},
upData(myChart){
const upColor = '#00da3c';
const downColor = '#ec0000';
var chartDom = document.getElementById('kline');
var myChart = echarts.init(chartDom);
var option;
myChart.setOption(
(option = {
animation: false,
legend: {
bottom: 10,
left: 'center',
data: []
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
borderWidth: 1,
borderColor: '#ccc',
padding: 10,
textStyle: {
color: '#ffffff'
},
position: function (pos, params, el, elRect, size) {
const obj = {
top: 10
};
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 30;
return obj;
}
// extraCssText: 'width: 170px'
},
axisPointer: {
link: [
{
xAxisIndex: 'all'
}
],
label: {
backgroundColor: '#fff'
}
},
toolbox: {
feature: {
dataZoom: {
yAxisIndex: false
},
brush: {
type: ['lineX', 'clear']
}
}
},
brush: {
xAxisIndex: 'all',
brushLink: 'all',
outOfBrush: {
colorAlpha: 0.1
}
},
visualMap: {
show: false,
seriesIndex: 5,
dimension: 2,
pieces: [
{
value: 1,
color: downColor
},
{
value: -1,
color: upColor
}
]
},
grid: [
{
left: '10%',
right: '8%',
height: '50%'
},
{
left: '10%',
right: '8%',
top: '63%',
height: '16%'
}
],
xAxis: [
{
type: 'category',
data: this.kdata.categoryData,
boundaryGap: false,
axisLine: { onZero: 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: [
{
scale: true,
splitArea: {
show: true
}
},
{
scale: true,
gridIndex: 1,
splitNumber: 2,
axisLabel: { show: false },
axisLine: { show: false },
axisTick: { show: false },
splitLine: { show: false }
}
],
dataZoom: [
{
type: 'inside',
xAxisIndex: [0, 1],
start: 98,
end: 100
},
{
show: true,
xAxisIndex: [0, 1],
type: 'slider',
top: '85%',
start: 98,
end: 100
}
],
series: [
{
name: 'Dow-Jones index',
type: 'candlestick',
data: this.kdata.values,
itemStyle: {
color: upColor,
color0: downColor,
borderColor: undefined,
borderColor0: undefined
},
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('');
}
}
},
]
}),
true
);
},
upData(myChart){
const upColor = '#00da3c';
const downColor = '#ec0000';
var chartDom = document.getElementById('kline');
var myChart = echarts.init(chartDom);
var option;
myChart.setOption(
(option = {
animation: false,
legend: {
bottom: 10,
left: 'center',
data: []
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
borderWidth: 1,
borderColor: '#ccc',
padding: 10,
textStyle: {
color: '#ffffff'
},
position: function (pos, params, el, elRect, size) {
const obj = {
top: 10
};
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 30;
return obj;
}
// extraCssText: 'width: 170px'
},
axisPointer: {
link: [
{
xAxisIndex: 'all'
}
],
label: {
backgroundColor: '#fff'
}
},
toolbox: {
feature: {
dataZoom: {
yAxisIndex: false
},
brush: {
type: ['lineX', 'clear']
}
}
},
brush: {
xAxisIndex: 'all',
brushLink: 'all',
outOfBrush: {
colorAlpha: 0.1
}
},
visualMap: {
show: false,
seriesIndex: 5,
dimension: 2,
pieces: [
{
value: 1,
color: downColor
},
{
value: -1,
color: upColor
}
]
},
grid: [
{
left: '10%',
right: '8%',
height: '50%'
},
{
left: '10%',
right: '8%',
top: '63%',
height: '16%'
}
],
xAxis: [
{
type: 'category',
data: this.kdata.categoryData,
boundaryGap: false,
axisLine: { onZero: 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: [
{
scale: true,
splitArea: {
show: true
}
},
{
scale: true,
gridIndex: 1,
splitNumber: 2,
axisLabel: { show: false },
axisLine: { show: false },
axisTick: { show: false },
splitLine: { show: false }
}
],
dataZoom: [
{
type: 'inside',
xAxisIndex: [0, 1],
start: 98,
end: 100
},
{
show: true,
xAxisIndex: [0, 1],
type: 'slider',
top: '85%',
start: 98,
end: 100
}
],
series: [
{
name: 'Dow-Jones index',
type: 'candlestick',
data: this.kdata.values,
itemStyle: {
color: upColor,
color0: downColor,
borderColor: undefined,
borderColor0: undefined
},
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('');
}
}
},
]
}),
true
);
}
},
watch: {
@ -386,183 +373,183 @@
</script>
<style lang="scss" scoped>
.main {
.main {
.header {
background: #000000;
margin-top: 200rpx;
padding: 0 32rpx;
.header {
background: #000000;
margin-top: 200rpx;
padding: 0 32rpx;
.top {
height: 80rpx;
border-bottom: 2rpx solid #A1A0A8;
.price {
line-height: 80rpx;
font-size: 40rpx;
}
.top {
height: 80rpx;
border-bottom: 2rpx solid #A1A0A8;
.percent {
vertical-align: text-top;
margin-left: 20rpx;
padding: 8rpx 20rpx;
border-radius: 8rpx;
font-size: 24rpx;
background-color: rgba($color: #F26666, $alpha: 0.2);
color: #F26666;
&.rise {
color: #00E8A2;
background-color: rgba($color: #00E8A2, $alpha: 0.2);
}
}
.price {
line-height: 80rpx;
font-size: 40rpx;
}
.bottom {
display: flex;
.percent {
vertical-align: text-top;
margin-left: 20rpx;
padding: 8rpx 20rpx;
border-radius: 8rpx;
font-size: 24rpx;
background-color: rgba($color: #F26666, $alpha: 0.2);
color: #F26666;
.title {
margin-top: 24rpx;
line-height: 32rpx;
&.rise {
color: #00E8A2;
background-color: rgba($color: #00E8A2, $alpha: 0.2);
}
}
}
.value {
margin: 24rpx 0;
color: #A1A0A8;
}
.bottom {
display: flex;
font-size: 24rpx;
.left {
flex: 1;
text-align: left;
}
.title {
margin-top: 24rpx;
line-height: 32rpx;
}
.center {
flex: 1;
text-align: center;
}
.value {
margin: 24rpx 0;
color: #A1A0A8;
}
.right {
flex: 1;
text-align: right;
}
.left {
flex: 1;
text-align: left;
}
.center {
flex: 1;
text-align: center;
}
}
.MarketTrades {
.headTitle {
padding-left: 32rpx;
font-size: 34rpx;
height: 80rpx;
line-height: 80rpx;
.right {
flex: 1;
text-align: right;
}
.table {
display: flex;
font-size: 24rpx;
}
}
.box {
flex: 1;
overflow: hidden;
height: 450rpx;
.MarketTrades {
.headTitle {
padding-left: 32rpx;
font-size: 34rpx;
height: 80rpx;
line-height: 80rpx;
}
.title {
display: flex;
margin-bottom: 16rpx;
color: #A1A0A8;
.table {
display: flex;
font-size: 24rpx;
.quantity {
flex: 1;
}
.box {
flex: 1;
overflow: hidden;
height: 450rpx;
.price {
flex: 1;
text-align: center;
}
.title {
display: flex;
margin-bottom: 16rpx;
color: #A1A0A8;
.quantity {
flex: 1;
}
.list {
overflow: hidden;
.price {
flex: 1;
text-align: center;
}
}
.item {
position: relative;
width: 100%;
height: 50rpx;
line-height: 50rpx;
display: flex;
.list {
overflow: hidden;
.price {
display: block;
width: 50%;
text-align: left;
z-index: 1;
.item {
position: relative;
width: 100%;
height: 50rpx;
line-height: 50rpx;
display: flex;
}
.price {
display: block;
width: 50%;
text-align: left;
z-index: 1;
.num {
display: block;
width: 50%;
text-align: right;
padding-right: 32rpx;
z-index: 1;
}
&.buy {
color: #00E8A2;
}
.num {
display: block;
width: 50%;
text-align: right;
padding-right: 32rpx;
z-index: 1;
&.sell {
color: #F4506A;
}
&.buy {
color: #00E8A2;
}
.buybg {
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
background: rgba($color: #00E8A2, $alpha: 0.1)
&.sell {
color: #F4506A;
}
}
.sellbg {
height: 100%;
position: absolute;
top: 0;
right: 0;
z-index: 0;
background: rgba($color: #F4506A, $alpha: 0.1)
}
.buybg {
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
background: rgba($color: #00E8A2, $alpha: 0.1)
}
.sellbg {
height: 100%;
position: absolute;
top: 0;
right: 0;
z-index: 0;
background: rgba($color: #F4506A, $alpha: 0.1)
}
}
}
}
}
}
}
.btn {
display: flex;
margin: 96rpx 32rpx;
.button {
flex: 1;
box-sizing: border-box;
height: 96rpx;
border-radius: 16rpx;
font-weight: 700;
font-size: 28rpx;
color: #15141F !important;
&:nth-child(2) {
margin-left: 14rpx;
}
.btn {
display: flex;
margin: 96rpx 32rpx;
.button {
flex: 1;
box-sizing: border-box;
height: 96rpx;
border-radius: 16rpx;
font-weight: 700;
font-size: 28rpx;
color: #15141F !important;
&:nth-child(2) {
margin-left: 14rpx;
}
}
}
</style>
}
</style>

11
pages/markets/trade.vue

@ -28,8 +28,9 @@
</view>
<!-- 列表 -->
<view class="coinList">
<scroll-view scroll-y="true" style="height: 86vh;" scroll-with-animation="true" @touchmove.stop.prevent="">
<view class="coin" v-for="(item, index) in 20" :key="index" @click="goto(item)">
<scroll-view scroll-y="true" style="height: 86vh;" scroll-with-animation="true"
@touchmove.stop.prevent="">
<view class="coin" v-for="(item, index) in 20" :key="index" @click="switchTo(item)">
<view class="name">BTC/USDT</view>
<view class="price">{{ 5145 * index * index * index }}</view>
<view class="priceChange" :class="{ 'down': index % 2 === 0 }">500.30%</view>
@ -76,6 +77,12 @@ export default {
uni.navigateTo({
url,
});
},
/**
* 切换当前交易货币对
*/
switchTo(item) {
this.popupShow = false;
}
},

31
pages/me/index.vue

@ -7,7 +7,7 @@
radius="160rpx"></u-image>
<view class="idAndAccount">
<view class="id">ID:{{userInfo.uid}}</view>
<view class="account">{{ i18n.account }}:{{userInfo.email}}</view>
<view class="account">{{ i18n.account }}:{{userInfo.email || ''}}</view>
</view>
</view>
<!-- 三个按钮 -->
@ -32,17 +32,17 @@
<view class="balanceRow">
<!-- 可用余额 -->
<view class="item">
<view class="number">{{userInfoBalance.balance}}</view>
<view class="number">{{userInfoBalance.balance || 0 }}</view>
<view class="title">{{ i18n.Balance }}</view>
</view>
<!-- 质押余额 -->
<view class="item">
<view class="number">{{userInfoBalance.pledge}}</view>
<view class="number">{{userInfoBalance.pledge || 0 }}</view>
<view class="title">{{ i18n.Pledge }}</view>
</view>
<!-- 合约余额 -->
<view class="item">
<view class="number">{{userInfoBalance.contract}}</view>
<view class="number">{{userInfoBalance.contract || 0 }}</view>
<view class="title">{{ i18n.Contarct }}</view>
</view>
</view>
@ -217,10 +217,11 @@
.idAndAccount {
margin-left: 40rpx;
flex: 1;
.id {
height: 56rpx;
width: 378rpx;
// width: 400rpx;
font-weight: 600;
font-size: 40rpx;
margin: 16rpx 0;
@ -228,15 +229,25 @@
.account {
position: relative;
height: 56rpx;
line-height: 56rpx;
width: 378rpx;
// height: 56rpx;
line-height: 46rpx;
width: 390rpx;
overflow: hidden;
background: rgba(255, 188, 31, 0.1);
border-radius: 16rpx;
font-size: 24rpx;
color: #FFBC1F;
text-align: left;
padding-left: 20rpx;
padding: 4rpx 10rpx 8rpx 40rpx;
// ...
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; //
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2; //
-webkit-box-orient: vertical;
&::before {
display: block;
@ -248,7 +259,7 @@
width: 32rpx;
height: 32rpx;
top: 12rpx;
left: 20rpx;
left: 10rpx;
}
}
}

45
static/echarts.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save