Commit 841caa3e by 李伟康

提交代码

1 parent 29e4130a
No preview for this file type
......@@ -9,7 +9,7 @@
html,
body .app {
color: #333333;
font-family:'PingFangSC-Regular', Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
font-family: 'PingFangSC-Regular', Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: #fff;
-webkit-overflow-scrolling: touch;
height: 100%;
......@@ -87,10 +87,11 @@ img {
.title {
font-size: 12px;
color: #e8e8e8;
line-height: 2.1vh;
// line-height: 2.1vh;
font-weight: 400;
padding: 0.5vh 8px;
user-select: none;
box-sizing: border-box;
}
.title-icon {
......
......@@ -225,7 +225,7 @@ p {
display: flex;
.rank-line {
box-sizing: border-box;
width: 25%;
width: 20%;
padding: 0 6px;
border-left: 1px solid rgba(96, 98, 102, 0.4);
.line-item {
......
<template>
<div class="number-box flex">
<template v-if="numList.length">
<template v-for="(i,index) in numList">
<div :key="index">
{{i}}
</div>
<template v-if="index != numList.length - 1">,</template>
</template>
</template>
<template v-else>
<div
class="transition-number"
:id="idKey"
>
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
......@@ -11,34 +25,52 @@ export default {
name: 'TransitionNumber',
props: {
num: [String, Number],
idKey: String
idKey: String,
split: Boolean
},
data () {
return {
numList: []
}
},
watch: {
num (n) {
if (n > 0) {
document.querySelector(`#${this.idKey}`).style = `--step:${n}`
setTimeout(() => {
this.numList = this.setPrice(n)
}, 1000)
}else{
this.numList = []
document.querySelector(`#${this.idKey}`).style = `--step:0`
}
}
},
mounted () {
},
methods: {
setPrice (price) {
let number = (price.toString() || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
return number.split(',')
}
}
}
</script>
<style scoped lang='scss'>
.number-box {
}
.transition-number {
color: inherit;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #fff;
--step: 0;
counter-reset: count var(--step);
z-index: var(--step);
transition: --step 1s;
font-size: inherit;
&::before {
content: counter(count);
}
......
......@@ -13,13 +13,10 @@
</div>
<div class="total-number-box flex">
<transition-number
:num="test"
idKey="number-total"
/>
<!-- <transition-number
:num="pageData.total.totalNum"
idKey="number-total"
/> -->
class="number-total"
/>
<transition-number
:num="pageData.total.incrNum"
idKey="number-incr"
......@@ -44,8 +41,11 @@
:idKey="`number-${i.key}`"
class="item-total"
/>
<div class="item-incr flex">
<div :class="['item-incr flex',{'up':pageData[i.key].up},{'down':pageData[i.key].down}]">
{{req.queryType == 0 ?'上月':'昨日'}}
<template v-if="pageData[i.key].up || pageData[i.key].down">
<div class="arrow"></div>
</template>
<transition-number
:num="pageData[i.key].incrNum"
:idKey="`number-incr-${i.key}`"
......@@ -153,7 +153,8 @@ export default {
req: {},
isGroup: true,
isEmpty: true,
flag: false
flag: false,
updata: Date.now()
}
},
mounted () {
......@@ -191,6 +192,11 @@ export default {
if (code == 0) {
let [dataList] = data.dataList
if (dataList) {
if (dataList.incrNum > 0) dataList.up = true
if (dataList.incrNum < 0) {
dataList.down = true
dataList.incrNum = Math.abs(dataList.incrNum)
}
dataList.top = this.ObjectToArray(dataList.topList)
dataList.last = this.ObjectToArray(dataList.lastList)
} else {
......@@ -203,6 +209,15 @@ export default {
}
}
this.pageData[queryItem] = dataList
}
}).catch(() => {
this.pageData[queryItem] = {
top: [],
last: [],
incrNum: 0,
returnNum: 0,
totalNum: 0
}
})
},
......@@ -296,7 +311,8 @@ export default {
lineStyle: {
color: '#606266'
}
}
},
splitNumber: 5
},
series: [
{
......@@ -358,24 +374,24 @@ export default {
box-sizing: border-box;
.total-title-box {
.total {
width: 40%;
width: 50%;
}
> div {
box-sizing: border-box;
width: 30%;
width: 25%;
padding-left: 0;
}
}
.total-number-box {
#number-total {
.number-total {
font-size: 24px;
color: #eb6001;
font-weight: 700;
line-height: 3.7vh;
width: 40%;
width: 50%;
}
> div {
width: 30%;
width: 25%;
font-size: 14px;
color: #f5aa01;
}
......@@ -389,7 +405,6 @@ export default {
padding: 0 8px;
box-sizing: border-box;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
&-title {
font-size: 12px;
......@@ -404,12 +419,34 @@ export default {
&-incr {
font-size: 12px;
color: #606266;
padding-bottom: 0.5vh;
// padding-bottom: 0.5vh;
&-numer {
font-size: 10px;
color: #fff;
}
.arrow {
border-top: 2.5px solid transparent;
border-right: 2.5px solid transparent;
border-bottom: 2.5px solid transparent;
border-left: 2.5px solid transparent;
}
}
.up {
.arrow {
border-bottom-color: #e60115;
}
.item-incr-numer {
color: #e60115;
}
}
.down {
.arrow {
border-top-color: #00b900;
}
.item-incr-numer {
color: #00b900;
}
}
> div {
flex-shrink: 0;
}
......
......@@ -10,7 +10,7 @@ function getLineOptions(obj) {
color: '#FFFFFF',
fontSize: '8px'
},
extraCssText: 'width: 60px;',
// extraCssText: 'width: 60px;',
formatter: tooltipFormatter || ''
},
grid: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!