feat(图表): 为LineHol组件添加barColor属性并优化页面布局
- 在LineHol和LineHolYellow组件中新增barColor属性,支持自定义柱状图颜色 - 调整indexRelease.vue页面布局,移除部分注释代码 - 修改顶部导航标题为"编辑精选" - 优化搜索跳转逻辑,使用Session替代uni.getStorageSync
This commit is contained in:
parent
28409ef3b2
commit
2a851c74a0
|
|
@ -21,6 +21,10 @@ const props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
|
barColor: {
|
||||||
|
type: String,
|
||||||
|
default: "#3C74F1",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
@ -127,10 +131,10 @@ const initChart = () => {
|
||||||
show: true,
|
show: true,
|
||||||
},
|
},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: "#3C74F1",
|
color: props.barColor,
|
||||||
normal: {
|
normal: {
|
||||||
borderRadius: [0, 4, 4, 0],
|
borderRadius: [0, 4, 4, 0],
|
||||||
color: "#3C74F1",
|
color: props.barColor,
|
||||||
// color: function (params) {
|
// color: function (params) {
|
||||||
// return colorList[params.dataIndex];
|
// return colorList[params.dataIndex];
|
||||||
// },
|
// },
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ const props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
|
barColor: {
|
||||||
|
type: String,
|
||||||
|
default: "#3C74F1",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
|
|
@ -95,7 +99,7 @@ const initChart = () => {
|
||||||
color: "#FFCE34",
|
color: "#FFCE34",
|
||||||
normal: {
|
normal: {
|
||||||
borderRadius: [0, 4, 4, 0],
|
borderRadius: [0, 4, 4, 0],
|
||||||
color: "#3C74F1",
|
color: props.barColor,
|
||||||
// color: function (params) {
|
// color: function (params) {
|
||||||
// return colorList[params.dataIndex];
|
// return colorList[params.dataIndex];
|
||||||
// },
|
// },
|
||||||
|
|
@ -129,7 +133,6 @@ onMounted(async () => {
|
||||||
// await getData();
|
// await getData();
|
||||||
// initChart();
|
// initChart();
|
||||||
// }, 5000);
|
// }, 5000);
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- banner end -->
|
<!-- banner end -->
|
||||||
|
|
||||||
<view class="">
|
<view>
|
||||||
<view class="tag">
|
<!-- <view class="tag">
|
||||||
<view class="r_tag_img">
|
<view class="r_tag_img">
|
||||||
<img :src="tagicon_1_bg" class="tag_bk" />
|
<img :src="tagicon_1_bg" class="tag_bk" />
|
||||||
<view class="tag_content">
|
<view class="tag_content">
|
||||||
|
|
@ -20,7 +20,6 @@
|
||||||
<text class="tag_title">行业分类贴标</text>
|
<text class="tag_title">行业分类贴标</text>
|
||||||
|
|
||||||
<view style="display: flex; margin-top: 15rpx">
|
<view style="display: flex; margin-top: 15rpx">
|
||||||
<!-- <text class="tag_num">{{ topNum.leftNum }}</text> -->
|
|
||||||
<countTo :startVal="lastLeftNum" :endVal="topNum.leftNum" :duration="5000" class="tag_num"></countTo>
|
<countTo :startVal="lastLeftNum" :endVal="topNum.leftNum" :duration="5000" class="tag_num"></countTo>
|
||||||
|
|
||||||
<text class="tag_status">已处理</text>
|
<text class="tag_status">已处理</text>
|
||||||
|
|
@ -39,7 +38,6 @@
|
||||||
<view class="tag_item_left">
|
<view class="tag_item_left">
|
||||||
<text class="tag_title">概念标签贴标</text>
|
<text class="tag_title">概念标签贴标</text>
|
||||||
<view style="display: flex; margin-top: 15rpx">
|
<view style="display: flex; margin-top: 15rpx">
|
||||||
<!-- <text class="tag_num">{{ topNum.rightNum }}</text> -->
|
|
||||||
<countTo :startVal="lastRightNum" :endVal="topNum.rightNum" :duration="5000" class="tag_num"></countTo>
|
<countTo :startVal="lastRightNum" :endVal="topNum.rightNum" :duration="5000" class="tag_num"></countTo>
|
||||||
|
|
||||||
<text class="tag_status">已处理</text>
|
<text class="tag_status">已处理</text>
|
||||||
|
|
@ -51,14 +49,14 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="background-color: white; margin-top: 40rpx">
|
<view style="background-color: white; margin-top: -100rpx; position: relative; z-index: 9999">
|
||||||
<indexMenuTitle title="近7天热度统计"></indexMenuTitle>
|
<indexMenuTitle title="近7天热度统计"></indexMenuTitle>
|
||||||
<LineHol v-if="lineTabIndex === 0" :data="lineTopData"></LineHol>
|
<LineHol v-if="lineTabIndex === 0" barColor="#3C74F1" :data="lineTopData"></LineHol>
|
||||||
<LineHol v-else-if="lineTabIndex === 1" :data="lineTopData"></LineHol>
|
<LineHol v-else-if="lineTabIndex === 1" barColor="#FFCC65" :data="lineTopData"></LineHol>
|
||||||
<LineHolYellow v-else-if="lineTabIndex === 2" :data="lineTopData"></LineHolYellow>
|
<LineHolYellow v-else-if="lineTabIndex === 2" barColor="#8B2DD4" :data="lineTopData"></LineHolYellow>
|
||||||
|
|
||||||
<div style="display: flex; justify-content: center; margin-bottom: 20px; margin-top: 20px">
|
<div style="display: flex; justify-content: center; margin-bottom: 20px; margin-top: 20px">
|
||||||
<div class="tabs">
|
<div class="tabs">
|
||||||
|
|
@ -69,19 +67,18 @@
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="background-color: white; margin-top: 40rpx">
|
<!-- <view style="background-color: white; margin-top: 40rpx">
|
||||||
<indexMenuTitle title="资讯评分分布区间"></indexMenuTitle>
|
<indexMenuTitle title="资讯评分分布区间"></indexMenuTitle>
|
||||||
<Line style="margin-top: 30rpx" :data="lineData"></Line>
|
<Line style="margin-top: 30rpx" :data="lineData"></Line>
|
||||||
|
|
||||||
<view
|
<view style="display: flex; flex-direction: column; text-align: center; justify-content: center; align-items: center; padding-bottom: 30rpx">
|
||||||
style="display: flex; flex-direction: column; text-align: center; justify-content: center; align-items: center; padding-bottom: 30rpx">
|
|
||||||
<InfoSummary style="width: 85%" :count="newsNum"></InfoSummary>
|
<InfoSummary style="width: 85%" :count="newsNum"></InfoSummary>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<view style="background-color: white; padding-top: 40rpx">
|
<view style="background-color: white; padding-top: 40rpx">
|
||||||
<view style="width: 100vw; display: flex; justify-content: space-between; align-items: center">
|
<view style="width: 100vw; display: flex; justify-content: space-between; align-items: center">
|
||||||
<indexMenuTitle title="编辑精选 Top20" style="margin-top: 10rpx"></indexMenuTitle>
|
<indexMenuTitle title="编辑精选" style="margin-top: 10rpx"></indexMenuTitle>
|
||||||
<view class="r_sreach">
|
<view class="r_sreach">
|
||||||
<!-- <image class="top_bk" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png"></image> -->
|
<!-- <image class="top_bk" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png"></image> -->
|
||||||
<!-- <image class="logo_text" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png"> </image> -->
|
<!-- <image class="logo_text" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png"> </image> -->
|
||||||
|
|
@ -101,8 +98,11 @@
|
||||||
|
|
||||||
<view class="logout" @click="loginOut" v-if="Session.get('token')">退出登录</view>
|
<view class="logout" @click="loginOut" v-if="Session.get('token')">退出登录</view>
|
||||||
|
|
||||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
<LoginPopup
|
||||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
:show="LoginShow"
|
||||||
|
@handlePopupClose="handlePopupClose"
|
||||||
|
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||||
|
@handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -291,14 +291,12 @@ async function getLineDataFn() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function goSreach() {
|
function goSreach() {
|
||||||
if (uni.getStorageSync("token")) {
|
if (Session.get("token")) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/sreachReq/index",
|
url: "/pages/sreachReq/index",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
LoginShow.value = true;
|
||||||
url: "/pages/login/indexMini",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue