| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <template>
- <view class="person_cards_wrap">
- <view class="cards_container">
- <!-- 今天消耗 -->
- <view class="card_item today">
- <view class="card_item_content">
- <view class="card_header">
- <text class="card_title">今天消耗(元)</text>
- </view>
- <view class="card_content">
- <text class="card_value">{{ cardData.todayConsume }}</text>
- </view>
- </view>
- <view class="card_item_content">
- <view class="card_header">
- <text class="card_title">今天业绩(元)</text>
- </view>
- <view class="card_content">
- <text class="card_value">{{ cardData.todayPerformance }}</text>
- </view>
- </view>
- </view>
- <!-- 条数统计 -->
- <view class="card_item card_item_full">
- <view class="card_header count">
- <image class="count_icon" src="../../../static/icons/statistics.png" alt=""></image>
- <text class="card_title">条数统计</text>
- </view>
- <view class="card_content">
- <view class="count_stats">
- <view class="count_item">
- <text class="count_value">{{ cardData.countTypeA }}</text>
- <text class="count_label">A类</text>
- </view>
- <view class="count_item">
- <text class="count_value">{{ cardData.countTypeB }}</text>
- <text class="count_label">B类</text>
- </view>
- <view class="count_item">
- <text class="count_value">{{ cardData.countTypeC }}</text>
- <text class="count_label">C类</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 上门 -->
- <view class="card_item card_item_full">
- <view class="card_content">
- <view class="visit_stats">
- <view class="visit_item">
- <text class="visit_label">上门</text>
- <text class="visit_value visitc_count">{{ cardData.visitCount }}</text>
- </view>
- <view class="visit_item">
- <text class="visit_label">上门率</text>
- <text class="visit_value">{{ cardData.visitRate }}</text>
- </view>
- <view class="visit_item">
- <text class="visit_label">成交率</text>
- <text class="visit_value">{{ cardData.dealRate }}</text>
- </view>
- <view class="visit_item">
- <text class="visit_label">投产比</text>
- <text class="visit_value">{{ cardData.roi }}</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 当前排名 -->
- <view class="card_item card_item_full">
- <view class="card_content">
- <view class="ranking_stats">
- <view class="ranking_info">
- <view class="ranking_icon">
- <image class="ranking_icon_img" src="../../../static/icons/trophy.png" alt=""></image>
- </view>
- <view class="ranking_info_text">
- <text class="card_title">当前排名</text>
- <text class="ranking_text">击败了{{ cardData.beatRate }}%的同事</text>
- </view>
- </view>
- <view class="ranking_details">
- <view class="ranking_detail_item">
- <text class="ranking_detail_value">{{ cardData.level }}</text>
- <text class="ranking_detail_label">等级</text>
- </view>
- <view class="ranking_detail_item">
- <text class="ranking_detail_value">{{ cardData.score }}</text>
- <text class="ranking_detail_label">评分</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 折线图 -->
- <view class="card_item">
- <view class="chart_header">
- <image class="chart_icon" src="../../../static/icons/line.png" alt=""></image>
- <text class="card_title">近7天排名折线图</text>
- </view>
- <view class="charts_box">
- <qiun-data-charts type="line" :chartData="chartData" canvasId="uniqueLineChart" :opts="opts"
- width="700rpx" height="350rpx" backgroundColor="#ffffff" />
- </view>
- </view>
- </view>
- <!-- 最新线索 -->
- <view class="latest_clue" v-if="clueList.length > 0">
- <view class="clue_header">
- <text class="card_title">最新线索</text>
- <view class="more_btn" @click="toPrivateClue">
- <text>更多</text>
- <u-icon name="arrow-right" size="16" color="#2563eb"></u-icon>
- </view>
- </view>
- <view class="clue_list">
- <view class="clue_item" v-for="(item, index) in clueList" :key="index">
- <view class="clue_star">
- <u-icon name="star-fill" size="20" color="#facc15"></u-icon>
- <text class="clue_name">{{ item.star }}</text>
- </view>
- <text class="clue_name">{{ item.name }}</text>
- <view class="clue_info">
- <text class="clue_title">{{ item.prodTitle }}</text>
- <text class="clue_desc">{{ item.desc }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 卡片数据
- cardData: {
- todayConsume: '-',
- todayPerformance: '-',
- countTypeA: '-',
- countTypeB: '-',
- countTypeC: '-',
- visitCount: '-',
- visitRate: '-',
- dealRate: '-',
- roi: '-',
- beatRate: '-',
- level: '-',
- score: '-'
- },
- chartData: {},
- opts: {
- color: ["#1890FF"],
- padding: [10, 10, 0, 0],
- dataLabel: false,
- dataPointShape: false,
- enableScroll: false,
- legend: {
- show: false
- },
- xAxis: {
- disableGrid: true
- },
- yAxis: {
- gridType: "dash",
- dashLength: 2,
- axisLabel:{
- show: false
- }
- },
- extra: {
- line: {
- type: "curve",
- width: 3,
- activeType: "hollow",
- linearType: "custom",
- onShadow: true,
- animation: "horizontal"
- }
- }
- },
- clueList: [],
- };
- },
- methods: {
- getCardData() {
- uni.$u.api.getPersonCards({ userId: this.$store.state.user.userInfo.userId }).then(res => {
- if (res.code === 200) {
- this.cardData = res.data;
- }
- });
- },
- getClueList() {
- uni.$u.api.getPersonLatestClue({ userId: this.$store.state.user.userInfo.userId }).then(res => {
- if (res.code === 200) {
- this.clueList = res.data;
- }
- });
- },
- async getChartData() {
- const res = await uni.$u.api.getPersonRanking({ userId: this.$store.state.user.userInfo.userId });
- if (res.code === 200) {
- let data = {
- categories: res.data.map(item => item.x),
- series: [
- {
- name: "近7天排名",
- data: res.data.map(item => item.y),
- setShadow: [
- 3,
- 8,
- 15,
- "#1890FF"
- ],
- }
- ]
- }
- this.chartData = JSON.parse(JSON.stringify(data))
- }
- },
- // 跳转私有线索页面
- toPrivateClue() {
- uni.switchTab({ url: '/pages/privateClue/index' });
- },
- },
- mounted() {
- this.getCardData();
- this.getClueList();
- this.$nextTick(() => {
- this.getChartData();
- })
- },
- };
- </script>
- <style lang="scss" scoped>
- @import './styles/index.scss';
- </style>
|