新增门店管理店员管理营销推广码
This commit is contained in:
@@ -34,16 +34,243 @@
|
||||
<view class="title">{{ item.title }}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 平台概况 -->
|
||||
<view class="situation">
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="title">平台原石余量<uni-icons class="help-icon" @click="showHelp('occBalance')" type="help-filled" size="18" color="rgba(255,255,255,.3)" /></view>
|
||||
<view class="number ellipsis">{{ occBalance }}</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="title">昨日瓜分水晶<uni-icons class="help-icon" @click="showHelp('yesterdayCrystal')" type="help-filled" size="18" color="rgba(255,255,255,.3)" /></view>
|
||||
<view class="number ellipsis">{{ yesterdayCrystal }}</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="title">区块链高度<uni-icons class="help-icon" @click="showHelp('blockHeight')" type="help-filled" size="18" color="rgba(255,255,255,.3)" /></view>
|
||||
<view class="number ellipsis">{{ blockHeight }}</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="title">平台累计盈利额<uni-icons class="help-icon" @click="showHelp('gain')" type="help-filled" size="18" color="rgba(255,255,255,.3)" /></view>
|
||||
<view class="number ellipsis">{{ gain }}</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="title">已开通节点数<uni-icons class="help-icon" @click="showHelp('nodeNumber')" type="help-filled" size="18" color="rgba(255,255,255,.3)" /></view>
|
||||
<view class="number ellipsis">{{ nodeNumber }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 节点信息 -->
|
||||
<view class="node-info">
|
||||
<view class="node-item">
|
||||
<view class="title">轻节点</view>
|
||||
<view class="number ellipsis">{{occs.light || '-'}}</view>
|
||||
</view>
|
||||
<view class="node-item">
|
||||
<view class="title">合作节点</view>
|
||||
<view class="number ellipsis">{{occs.cooperation || '-'}}</view>
|
||||
</view>
|
||||
<view class="node-item">
|
||||
<view class="title">主节点</view>
|
||||
<view class="number ellipsis">{{occs.main || '-'}}</view>
|
||||
</view>
|
||||
<view class="node-item">
|
||||
<view class="title">超级节点</view>
|
||||
<view class="number ellipsis">{{occs.super || '-'}}</view>
|
||||
</view>
|
||||
<view class="node-item">
|
||||
<view class="title">运营节点</view>
|
||||
<view class="number ellipsis">{{occs.operating || '-'}}</view>
|
||||
</view>
|
||||
<view class="node-item">
|
||||
<view class="title">技术节点</view>
|
||||
<view class="number ellipsis">{{occs.technology || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 平台盈利额,原石数量 -->
|
||||
<view class="chart">
|
||||
<view class="title">平台累计营业额和原石价值走势图</view>
|
||||
<view class="chart-f2">
|
||||
<l-f2 ref="chartChange"></l-f2>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { occ } from '@/apis/interfaces/chain'
|
||||
import { certified, security } from '@/apis/interfaces/index'
|
||||
import F2 from '@/uni_modules/lime-f2/components/lime-f2/f2.min.js'
|
||||
import lF2 from '@/uni_modules/lime-f2/components/lime-f2/'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
crystalArr : [],
|
||||
categoryArr : [],
|
||||
occs: {},
|
||||
blockHeight: 0,
|
||||
occBalance: 0,
|
||||
occ: 0,
|
||||
yesterdayCrystal: 0,
|
||||
gain: 0,
|
||||
nodeNumber: 0,
|
||||
notice: [],
|
||||
isAuth: false,
|
||||
helpToast: {
|
||||
occ: '恒量发行原石量',
|
||||
occBalance: '平台原石量',
|
||||
yesterdayCrystal: '昨日瓜分水晶',
|
||||
blockHeight: '区块链高度',
|
||||
gain: '平台累计盈利额',
|
||||
nodeNumber: '已开通节点数'
|
||||
}
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if(this.$store.state.token != '') this.isAuth = true
|
||||
this.getOcc()
|
||||
},
|
||||
methods:{
|
||||
// 求助信息
|
||||
showHelp(type) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: this.helpToast[type],
|
||||
showCancel: false
|
||||
})
|
||||
},
|
||||
// 原石钱包
|
||||
openWallet(){
|
||||
Promise.all([certified(), security()]).then(res=> {
|
||||
let certified = res[0],
|
||||
security = res[1]
|
||||
if(!certified){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还为完成个人认证,无法激活您的钱包',
|
||||
confirmText: '去认证',
|
||||
confirmColor: '#009B69',
|
||||
cancelColor: '#666666',
|
||||
cancelText: '稍后再说',
|
||||
success: res=> {
|
||||
if(res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/certification/personal'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!security) {
|
||||
uni.showModal({
|
||||
title: '激活提示',
|
||||
content: '您的钱包未激活,是否立即导出助记词并激活您的钱包?',
|
||||
confirmText: '去激活',
|
||||
confirmColor: '#009B69',
|
||||
cancelColor: '#666666',
|
||||
cancelText: '稍后再说',
|
||||
success: res=> {
|
||||
if(res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/wallet/add'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/wallet/property'
|
||||
})
|
||||
})
|
||||
},
|
||||
// occ信息
|
||||
getOcc(){
|
||||
occ().then(res => {
|
||||
console.log(res)
|
||||
this.occs = res.occs
|
||||
this.yesterdayCrystal = res.yesterday_crystal
|
||||
this.occ = res.occ
|
||||
this.occBalance = res.occ_balance
|
||||
this.blockHeight = res.block_height
|
||||
this.gain = res.gain
|
||||
this.nodeNumber = res.node_number
|
||||
this.notice = res.notice
|
||||
if(res.help_toast) this.helpToast = res.help_toast
|
||||
this.showCartc(res.movements)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 绘制图表
|
||||
showCartc(data){
|
||||
// 图表信息
|
||||
this.$refs.chartChange.init(config => {
|
||||
config.appendPadding = [10, 15, 10, 15]
|
||||
|
||||
const chart = new F2.Chart(config);
|
||||
chart.source(data, {
|
||||
date: {
|
||||
range: [0, 1],
|
||||
type: 'timeCat',
|
||||
mask: 'MM-DD'
|
||||
},
|
||||
value: {
|
||||
tickCount: 5
|
||||
}
|
||||
});
|
||||
chart.axis('time', {
|
||||
line: null,
|
||||
label: function label(text, index, total) {
|
||||
const textCfg = {};
|
||||
if (index === 0) {
|
||||
textCfg.textAlign = 'left';
|
||||
} else if (index === total - 1) {
|
||||
textCfg.textAlign = 'right';
|
||||
}
|
||||
return textCfg;
|
||||
}
|
||||
});
|
||||
chart.axis('tem', {
|
||||
grid: function grid(text) {
|
||||
if (text === '0%') {
|
||||
return {
|
||||
lineDash: null,
|
||||
lineWidth: 1
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
chart.tooltip({
|
||||
showCrosshairs: true
|
||||
});
|
||||
chart.legend({
|
||||
position: 'bottom',
|
||||
offsetY: 0,
|
||||
offsetX: 30
|
||||
});
|
||||
chart.area()
|
||||
.position('date*value')
|
||||
.color('name', [ '#009b69', '#9f8052' ])
|
||||
.shape('smooth')
|
||||
chart.line()
|
||||
.position('date*value')
|
||||
.color('name', [ '#009b69', '#9f8052' ])
|
||||
.shape('smooth', name=> {
|
||||
if (name === '预期收益率') {
|
||||
return 'line';
|
||||
}
|
||||
if (name === '实际收益率') {
|
||||
return 'dash';
|
||||
}
|
||||
});
|
||||
chart.render();
|
||||
return chart;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -137,10 +364,83 @@
|
||||
background: #1f1922;
|
||||
overflow: hidden;
|
||||
}
|
||||
// 平台概况
|
||||
.situation{
|
||||
margin: 0 $margin;
|
||||
background-image: linear-gradient(to bottom, $block-color, #1f1922);
|
||||
border-radius: $radius;
|
||||
padding: $padding $padding/2 $padding*2;
|
||||
// 平台统计
|
||||
.header{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: $margin*2;
|
||||
.number{
|
||||
color: white;
|
||||
font-size: $title-size;
|
||||
padding-top: $padding/2;
|
||||
font-weight: bold;
|
||||
}
|
||||
.title{
|
||||
color: rgba($color: white, $alpha: .4);
|
||||
font-size: $title-size-sm;
|
||||
}
|
||||
.header-item{
|
||||
width: 50%;
|
||||
padding: $padding / 2;
|
||||
box-sizing: border-box;
|
||||
&:first-child{
|
||||
width: 100%;
|
||||
.number{
|
||||
font-size: $title-size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 节点信息
|
||||
.node-info{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 0 -$margin / 2;
|
||||
.node-item{
|
||||
background: rgba($color: $block-color, $alpha: .8);
|
||||
width: calc(50% - #{$margin});
|
||||
margin: $margin / 2;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
border-radius: $radius/2;
|
||||
}
|
||||
.number{
|
||||
font-size: $title-size + 4;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
||||
.title{
|
||||
font-size: $title-size-sm;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
// 图表
|
||||
.chart{
|
||||
background: rgba($color: $block-color, $alpha: .8);
|
||||
padding: $padding;
|
||||
border-radius: $radius/2;
|
||||
margin-top: $margin;
|
||||
.title{
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: white;
|
||||
font-size: $title-size-m;
|
||||
}
|
||||
.chart-f2{
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 数据统计
|
||||
.total {
|
||||
position: relative;
|
||||
margin: $margin ($margin + $margin/2);
|
||||
margin: $margin;
|
||||
background: #2b2449;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
@@ -171,6 +471,12 @@
|
||||
background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .7), transparent);
|
||||
}
|
||||
}
|
||||
// 求助icon
|
||||
.help-icon{
|
||||
vertical-align: middle;
|
||||
margin-left: $margin/3;
|
||||
opacity: .7;
|
||||
}
|
||||
// 矿石
|
||||
.ore {
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user