Commit 841caa3e by 李伟康

提交代码

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