Commit ebfe0ee7 authored by 罗超's avatar 罗超

更改个人中心

parent d6ee3123
......@@ -304,14 +304,17 @@ export default {
this.$cookie.set("RB_Group_id", userData.RB_Group_id);
localStorage.menu=JSON.stringify(firstTire)
this.loginState = 0;
let previousPathInfo = localStorage.previousPathInfo ? JSON.parse(localStorage.previousPathInfo) : ''
if (previousPathInfo) {
let path = previousPathInfo.path.indexOf('login') === -1 ? previousPathInfo.path : 'index'
let query = previousPathInfo.query ? previousPathInfo.query : {}
this.$router.push({ path: "/"+ path, query: query });
}else {
this.$router.push({ path: "/index" });
}
// let previousPathInfo = localStorage.previousPathInfo ? JSON.parse(localStorage.previousPathInfo) : ''
// if (previousPathInfo) {
// let path = previousPathInfo.path.indexOf('login') === -1 ? previousPathInfo.path : 'index'
// let query = previousPathInfo.query ? previousPathInfo.query : {}
// this.$router.push({ path: "/"+ path, query: query });
// }else {
// this.$router.push({ path: "/index" });
// }
this.$router.push({ path: "/personalCenter" });
//登录成功后跳转页面
// this.$notify.success({
// title:'提示',
......
......@@ -181,7 +181,8 @@ export default {
},
result: null,
orders: [],
pageLoading: false
pageLoading: false,
};
},
components: {
......
<template>
<div class="inerank-container">
<div :style="{height:'100%',width:'100%'}" ref="myLineRank"></div>
</div>
</template>
<script>
export default {
props: {
newdata: {
type: Number,
default: 0
},
olddata: {
type: Number,
default: 0
},
colors:{
type:Array,
default:[]
},
title:{
type:String,
default:""
}
},
data() {
return {
placeHolderStyle: {
normal: {
color: "rgba(0,0,0,0)",
label: { show: false },
labelLine: { show: false }
},
emphasis: {
color: "rgba(0,0,0,0)"
}
}
};
},
mounted() {
this.init();
},
methods: {
init() {
let myChart = this.$echarts.init(this.$refs.myLineRank);
let dataAlias = ["今年", "去年"];
let data2 = [{
name:"今年",
value:this.newdata
}, {
name:"去年",
value:this.olddata,
itemStyle:this.placeHolderStyle
}];
let data3 = [{
name:"去年",
value:this.olddata
},{
name:"今年",
value:this.newdata,
itemStyle:this.placeHolderStyle
}];
let option = {
tooltip: {
show:false
},
graphic: [
{
type: "text",
left:'center',
top: "center",
style: {
text: this.title,
textAlign: "center",
fill: this.colors[0], //文字的颜色
fontSize: 16,
width: 120,
fontFamily: "pingfangR"
}
}
],
calculable: true,
series: [
{
// center: ["25%", "45%"],
name: "订单来源",
type: "pie",
radius: ["80%", "90%"],
hoverAnimation: false,
legendHoverLink:false,
tooltip:false,
startAngle:90,
itemStyle: {
emphasis: {
barBorderRadius: 30
},
normal: {
label: {
show: false
},
labelLine: {
show: false
},
color: new this.$echarts.graphic.LinearGradient(1, 0, 0, 0, [
{ offset: 0, color: "#00BFF9" },
{ offset: 0.35, color: "#0067CC" },
{ offset: 1, color: "#0067CC" }
])
}
},
data: data2
},
{
// center: ["25%", "45%"],
name: "订单来源",
type: "pie",
radius: ["60%", "70%"],
hoverAnimation: false,
legendHoverLink:false,
tooltip:false,
startAngle:90,
itemStyle: {
emphasis: {
barBorderRadius: 30
},
normal: {
label: {
show: false
},
labelLine: {
show: false
},
color: new this.$echarts.graphic.LinearGradient(1, 0, 0, 0, [
{ offset: 0, color: this.colors[1] },
{ offset: 0.35, color: this.colors[0] },
{ offset: 1, color: this.colors[0] }
])
}
},
data: data3
}
]
};
myChart.setOption(option);
}
}
};
</script>
<style>
.inerank-container {
height: 100%;
width: 100%;
}
</style>
<template>
<div class="inerank-container">
<div :style="{height:'100%',width:'100%'}" ref="myLineRank"></div>
</div>
</template>
<script>
export default {
props: {
data: {
type: Array,
default: []
}
},
data() {
return {};
},
mounted() {
this.init();
},
methods: {
init() {
let myChart = this.$echarts.init(this.$refs.myLineRank);
var dataAxis = [];
var data2 = [];
var data4 = [];
var data3 = [];
this.data.forEach(x => {
dataAxis.push(x.Month + "月");
data2.push(x.NowSaleMoney);
data4.push(x.NowSaleDueIn);
data3.push(x.NowSaleGuest);
});
let option = {
title: {
show: false
},
xAxis: {
data: dataAxis,
axisLabel: {
textStyle: {
color: "#DADADA",
fontSize: 12
},
margin: 10,
interval: 0,
show: true
},
type: "category",
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: ["#12397C"]
}
}
},
yAxis: [
{
axisLine: {
show: true,
lineStyle: {
color: ["#12397C"]
}
},
axisTick: {
show: false
},
axisLabel: {
textStyle: {
color: "#DADADA",
fontSize: 12
},
show: true
},
splitLine: {
show: true,
lineStyle: {
color: ["#12397c4d"]
}
},
min:0,
name:"金额(元)",
type:"value"
},
{
axisLine: {
show: true,
lineStyle: {
color: ["#12397C"]
}
},
axisTick: {
show: false
},
axisLabel: {
textStyle: {
color: "#DADADA",
fontSize: 12
},
show: true
},
splitLine: {
show: true,
lineStyle: {
color: ["#12397c4d"]
}
},
min:0,
name:"收客数(人)",
type:"value"
}
],
grid: {
left: "68",
right: "60",
top: "50",
bottom: "30"
},
tooltip: {
trigger: "item",
axisPointer: {
type: "none",
snap: true,
label: {
backgroundColor: "#6a7985"
}
}
},
series: [
{
type: "bar",
itemStyle: {
normal: {
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#4487F0" },
{ offset: 0.3, color: "#4487F0" },
{ offset: 1, color: "#B0D0F8" }
])
}
},
barWidth: 24,
data: data2,
yAxisIndex:0,
animationType: "scale",
animationEasing: "elasticOut",
animationDelay: function(idx) {
return Math.random() * 200;
}
},
{
type: "bar",
itemStyle: {
normal: {
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#FD3C7C" },
{ offset: 0.5, color: "#FD3C7C" },
{ offset: 1, color: "#FFABC7" }
])
}
},
barWidth: 24,
data: data4,
yAxisIndex:0,
animationType: "scale",
animationEasing: "elasticOut",
animationDelay: function(idx) {
return Math.random() * 200;
}
},
{
type: "line",
smooth: true,
symbol:'circle',
symbolSize : 5,
yAxisIndex:1,
// left: "0",
itemStyle: {
normal: {
lineStyle: {
color: "#FFB822"
},
color: "#FFB822"
}
},
data: data3
}
]
};
myChart.setOption(option);
}
}
};
</script>
<style>
.inerank-container {
height: 100%;
width: 100%;
}
</style>
......@@ -31,7 +31,6 @@ export default {
data2.push(t)
}
})
console.log(dataAlias)
let option = {
tooltip: {
trigger: "item",
......
......@@ -157,7 +157,7 @@ export default {
.inerank-container .h-title {
position: absolute;
left: 0%;
bottom: 14px;
bottom: 10px;
font-size: 12px;
color: #46c3f1;
text-align: center;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment