index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view class="person_cards_wrap">
  3. <view class="cards_container">
  4. <!-- 今天消耗 -->
  5. <view class="card_item today">
  6. <view class="card_item_content">
  7. <view class="card_header">
  8. <text class="card_title">今天消耗(元)</text>
  9. </view>
  10. <view class="card_content">
  11. <text class="card_value">{{ cardData.todayConsume }}</text>
  12. </view>
  13. </view>
  14. <view class="card_item_content">
  15. <view class="card_header">
  16. <text class="card_title">今天业绩(元)</text>
  17. </view>
  18. <view class="card_content">
  19. <text class="card_value">{{ cardData.todayPerformance }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 条数统计 -->
  24. <view class="card_item card_item_full">
  25. <view class="card_header count">
  26. <i class="iconfont icon-crm-tongji" style="font-size: 30rpx;color: #4c8afe;"></i>
  27. <text class="card_title">条数统计</text>
  28. </view>
  29. <view class="card_content">
  30. <view class="count_stats">
  31. <view class="count_item">
  32. <text class="count_value">{{ cardData.countTypeA }}</text>
  33. <text class="count_label">A类</text>
  34. </view>
  35. <view class="count_item">
  36. <text class="count_value">{{ cardData.countTypeB }}</text>
  37. <text class="count_label">B类</text>
  38. </view>
  39. <view class="count_item">
  40. <text class="count_value">{{ cardData.countTypeC }}</text>
  41. <text class="count_label">C类</text>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 上门 -->
  47. <view class="card_item card_item_full">
  48. <view class="card_content">
  49. <view class="visit_stats">
  50. <view class="visit_item">
  51. <text class="visit_label">上门</text>
  52. <text class="visit_value visitc_count">{{ cardData.visitCount }}</text>
  53. </view>
  54. <view class="visit_item">
  55. <text class="visit_label">上门率</text>
  56. <text class="visit_value">{{ cardData.visitRate }}</text>
  57. </view>
  58. <view class="visit_item">
  59. <text class="visit_label">成交率</text>
  60. <text class="visit_value">{{ cardData.dealRate }}</text>
  61. </view>
  62. <view class="visit_item">
  63. <text class="visit_label">投产比</text>
  64. <text class="visit_value">{{ cardData.roi }}</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- 当前排名 -->
  70. <view class="card_item card_item_full">
  71. <view class="card_content">
  72. <view class="ranking_stats">
  73. <view class="ranking_info">
  74. <view class="ranking_icon">
  75. <i class="iconfont icon-crm-jiangbei" style="font-size: 30rpx;color: #ca8a04;"></i>
  76. </view>
  77. <view class="ranking_info_text">
  78. <text class="card_title">当前排名</text>
  79. <text class="ranking_text">击败了{{ cardData.beatRate }}%的同事</text>
  80. </view>
  81. </view>
  82. <view class="ranking_details">
  83. <view class="ranking_detail_item">
  84. <text class="ranking_detail_value">{{ cardData.level }}</text>
  85. <text class="ranking_detail_label">等级</text>
  86. </view>
  87. <view class="ranking_detail_item">
  88. <text class="ranking_detail_value">{{ cardData.score }}</text>
  89. <text class="ranking_detail_label">评分</text>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. <!-- 折线图 -->
  96. <view class="card_item">
  97. <view class="chart_header">
  98. <i class="iconfont icon-crm-tubiao-zhexiantu" style="font-size: 30rpx;color: #6b7280;"></i>
  99. <text class="card_title">近7天排名折线图</text>
  100. </view>
  101. <view class="charts_box">
  102. <qiun-data-charts type="line" :chartData="chartData" canvasId="uniqueLineChart" :opts="opts"
  103. width="700rpx" height="350rpx" backgroundColor="#ffffff" />
  104. </view>
  105. </view>
  106. </view>
  107. <!-- 最新线索 -->
  108. <view class="latest_clue" v-if="clueList.length > 0">
  109. <view class="clue_header">
  110. <text class="card_title">最新线索</text>
  111. <view class="more_btn" @click="toPrivateClue">
  112. <text>更多</text>
  113. <u-icon name="arrow-right" size="16" color="#2563eb"></u-icon>
  114. </view>
  115. </view>
  116. <view class="clue_list">
  117. <view class="clue_item" v-for="(item, index) in clueList" :key="index">
  118. <view class="clue_star">
  119. <u-icon name="star-fill" size="20" color="#facc15"></u-icon>
  120. <text class="clue_name">{{ item.star }}</text>
  121. </view>
  122. <text class="clue_name">{{ item.name }}</text>
  123. <view class="clue_info">
  124. <text class="clue_title">{{ item.prodTitle }}</text>
  125. <text class="clue_desc">{{ item.desc }}</text>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. export default {
  134. data() {
  135. return {
  136. // 卡片数据
  137. cardData: {
  138. todayConsume: '-',
  139. todayPerformance: '-',
  140. countTypeA: '-',
  141. countTypeB: '-',
  142. countTypeC: '-',
  143. visitCount: '-',
  144. visitRate: '-',
  145. dealRate: '-',
  146. roi: '-',
  147. beatRate: '-',
  148. level: '-',
  149. score: '-'
  150. },
  151. chartData: {
  152. categories: [],
  153. series: [
  154. {
  155. name: "核心数据",
  156. data: [],
  157. color: "#1890ff"
  158. }
  159. ]
  160. },
  161. opts: {
  162. padding: [5, 0, 10, -20],
  163. backgroundColor: "#ffffff",
  164. xAxis: {
  165. axisLine: { show: true, color: "#e5e5e5", width: 1 },
  166. gridLine: { show: true, color: "#f5f5f5", width: 1 },
  167. label: { fontSize: 24, color: "#666666", margin: 15 },
  168. tickLine: { show: false },
  169. lineStyle: {
  170. type: 'solid'
  171. },
  172. axisLabel: {
  173. padding: [0, 0, 0, -20]
  174. }
  175. },
  176. yAxis: {
  177. axisLine: { show: true, color: "#e5e5e5", width: 1 },
  178. gridLine: { show: true, color: "#f5f5f5", width: 1 },
  179. label: { fontSize: 24, color: "#666666", margin: 15 },
  180. tickLine: { show: false },
  181. splitNumber: 4,
  182. min: 0,
  183. max: 200
  184. },
  185. series: {
  186. line: {
  187. width: 6, // 折线宽度,确保可见
  188. smooth: true, // 先设为直线,便于调试,后续可改为true
  189. showSymbol: true, // 显示数据点,确保折线锚点可见
  190. symbol: "circle",
  191. symbolSize: 24,
  192. symbolColor: "#ffffff",
  193. symbolBorderColor: "#1890ff",
  194. symbolBorderWidth: 8,
  195. area: {
  196. show: false,
  197. color: "linear-gradient(to bottom, rgba(24,144,255,0.2), rgba(24,144,255,0))"
  198. }
  199. }
  200. },
  201. // 提示框:确保悬浮正常显示
  202. tooltip: {
  203. show: true,
  204. backgroundColor: "rgba(0,0,0,0.7)",
  205. borderRadius: 6,
  206. padding: [8, 12],
  207. labelFontSize: 22,
  208. labelColor: "#ffffff"
  209. },
  210. legend: {
  211. show: false,
  212. position: "top-right",
  213. fontSize: 24,
  214. color: "#666666",
  215. margin: [0, 20, 0, 0]
  216. },
  217. title: {
  218. show: false,
  219. name: "趋势折线图",
  220. fontSize: 28,
  221. color: "#333333",
  222. align: "left",
  223. margin: [0, 0, 15, 0]
  224. }
  225. },
  226. clueList: [],
  227. };
  228. },
  229. methods: {
  230. getCardData() {
  231. uni.$u.api.getPersonCards().then(res => {
  232. if (res.code === 200) {
  233. this.cardData = res.data;
  234. }
  235. });
  236. },
  237. getClueList() {
  238. uni.$u.api.getPersonLatestClue().then(res => {
  239. if (res.code === 200) {
  240. this.clueList = res.data;
  241. }
  242. });
  243. },
  244. getChartData() {
  245. uni.$u.api.getPersonRanking().then(res => {
  246. if (res.code === 200) {
  247. this.chartData.categories = res.data.map(item => item.x);
  248. this.chartData.series[0].data = res.data.map(item => item.y);
  249. }
  250. });
  251. },
  252. // 跳转私有线索页面
  253. toPrivateClue() {
  254. uni.switchTab({ url: '/pages/privateClue/index' });
  255. },
  256. },
  257. mounted() {
  258. // this.getCardData();
  259. // this.getClueList();
  260. // this.getChartData();
  261. },
  262. };
  263. </script>
  264. <style lang="scss" scoped>
  265. @import './styles/index.scss';
  266. </style>