AI销管
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

1087 Zeilen
27 KiB

  1. <template>
  2. <view class="pages">
  3. <!-- 日报内容部分 -->
  4. <view class="container" ref="lists">
  5. <!-- 头部日报卡 -->
  6. <view class="c-head-card">
  7. <view class="c-title-text">
  8. {{ projectName }}销讲助手日报
  9. </view>
  10. <text class="date">{{ weekObj.createTime | fomatDate }}</text>
  11. <view class="creative-time">
  12. 生成时间:{{ weekObj.createTime || '--' }}
  13. </view>
  14. </view>
  15. <view class="nodata-box" v-if="nodata">
  16. <image class="img" src="/static/images/nodata.png" mode="" />
  17. <view class="text">此项目今日还没有接待量哦~</view>
  18. </view>
  19. <view v-if="!nodata">
  20. <!-- 循环渲染的数据 -->
  21. <view class="dateList">
  22. <!-- -->
  23. <view class="arrs">
  24. <view class="arrs-items index1">
  25. <view class="left">
  26. 1
  27. </view>
  28. <view class="right">
  29. <view class="r-title">
  30. <text>接待量:</text>
  31. </view>
  32. <view class="r-box">
  33. <view class="r-box-item">
  34. <text>接待量</text><text class="value">{{ weekObj.receptionCount || 0 }}</text>
  35. </view>
  36. <view class="r-box-item">
  37. <text>有效接待</text><text class="value">{{ weekObj.activeCustomer || 0 }}</text>
  38. </view>
  39. <view class="r-box-item-lang">
  40. <view>有效接待率<text class="value">{{ weekObj.validReceptionRate || 0 }}%</text>
  41. </view>
  42. <view class="contrast">对比昨天<text class="value"
  43. :class="{down: weekObj.validReceptionRatePK < 0, up: weekObj.validReceptionRatePK > 0}">{{ weekObj.validReceptionRatePK > 0 ? '+' : '' }}{{ weekObj.validReceptionRatePK || 0 }}%</text>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="arrs-items index2">
  50. <view class="left">
  51. 2
  52. </view>
  53. <view class="right">
  54. <view class="r-title">
  55. <text v-if="!weekObj.orgCode">平均执行率:</text>
  56. <text v-else>销讲执行率:</text>
  57. </view>
  58. <view class="r-box">
  59. <view class="r-box-item-lang">
  60. <view>
  61. <text v-if="!weekObj.orgCode">平均执行率:</text>
  62. <text v-else>销讲执行率:</text>
  63. <text class="value">{{ weekObj.fraction || 0 }}%</text>
  64. </view>
  65. <view class="contrast">对比昨天<text class="value"
  66. :class="{down: weekObj.fractionPK < 0, up: weekObj.fractionPK > 0}">{{ weekObj.fractionPK > 0 ? '+' : '' }}{{ weekObj.fractionPK || 0 }}%</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="arrs-items index3">
  73. <view class="left">
  74. 3
  75. </view>
  76. <view class="right">
  77. <view class="r-title">
  78. <text>平均接待时长:</text>
  79. </view>
  80. <view class="r-box">
  81. <view class="r-box-item-lang">
  82. <view>平均接待时长<text class="value">{{ weekObj.avgDuration || 0 }}min</text></view>
  83. <view class="contrast">对比昨天<text class="value"
  84. :class="{down: weekObj.avgDurationPK < 0, up: weekObj.avgDurationPK > 0}">{{ weekObj.avgDurationPK > 0 ? '+' : '' }}{{ weekObj.avgDurationPK || 0 }}min</text>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="arrs-items index4">
  91. <view class="left">
  92. 4
  93. </view>
  94. <view class="right">
  95. <view class="r-title">
  96. <text v-if="!weekObj.orgCode">销讲维度执行前三:</text>
  97. <text v-else>项目平均执行率排名:</text>
  98. </view>
  99. <template v-if="!weekObj.orgCode">
  100. <view class="ranking">
  101. <block v-for="(rank, rankIndex) in carryOutTop" :key="rankIndex">
  102. <view class="ranking-item">
  103. <view class="serial">
  104. {{ rankIndex+1 }}
  105. </view>
  106. <view class="lside">
  107. {{ rank.title || '--' }}
  108. </view>
  109. <view class="rside">
  110. ({{ rank.value || 0 }}%)
  111. </view>
  112. </view>
  113. </block>
  114. <template v-if="carryOutTop.length == 0">
  115. <view class="empty">
  116. 暂无数据
  117. </view>
  118. </template>
  119. </view>
  120. </template>
  121. <template v-else>
  122. <!-- consultant -->
  123. <view class="ranking">
  124. <block v-for="(rank, rankIndex) in consultant" :key="rankIndex">
  125. <view class="ranking-item">
  126. <view class="serial">
  127. {{ rankIndex+1 }}
  128. </view>
  129. <view class="lside">
  130. {{ rank.title || '--' }}
  131. </view>
  132. <view class="rside">
  133. ({{ rank.value || 0 }}%)
  134. </view>
  135. </view>
  136. </block>
  137. <template v-if="consultant.length == 0">
  138. <view class="empty">
  139. 暂无数据
  140. </view>
  141. </template>
  142. </view>
  143. </template>
  144. </view>
  145. </view>
  146. <view class="arrs-items index5">
  147. <view class="left">
  148. 5
  149. </view>
  150. <view class="right">
  151. <view class="r-title">
  152. <text v-if="!weekObj.orgCode">销讲维度执行弱项前三:</text>
  153. <text v-else>项目平均接访时长排名:</text>
  154. </view>
  155. <template v-if="!weekObj.orgCode">
  156. <view class="ranking">
  157. <block v-for="(rank, rankIndex) in carryOutLast" :key="rankIndex">
  158. <view class="ranking-item">
  159. <view class="serial">
  160. {{ rankIndex+1 }}
  161. </view>
  162. <view class="lside">
  163. {{ rank.title || '--' }}
  164. </view>
  165. <view class="rside">
  166. ({{ rank.value || 0 }}%)
  167. </view>
  168. </view>
  169. </block>
  170. <template v-if="carryOutLast.length == 0">
  171. <view class="empty">
  172. 暂无数据
  173. </view>
  174. </template>
  175. </view>
  176. </template>
  177. <template v-else>
  178. <view class="ranking">
  179. <block v-for="(rank, rankIndex) in recording" :key="rankIndex">
  180. <view class="ranking-item">
  181. <view class="serial">
  182. {{ rankIndex+1 }}
  183. </view>
  184. <view class="lside">
  185. {{ rank.title || '--' }}
  186. </view>
  187. <view class="rside">
  188. ({{ tofixed2(rank.value/60) || 0 }}m)
  189. </view>
  190. </view>
  191. </block>
  192. <template v-if="recording.length == 0">
  193. <view class="empty">
  194. 暂无数据
  195. </view>
  196. </template>
  197. </view>
  198. </template>
  199. </view>
  200. </view>
  201. <view class="arrs-items index6" v-if="!weekObj.orgCode">
  202. <view class="left">
  203. 6
  204. </view>
  205. <view class="right">
  206. <view class="r-title">
  207. <text>置业顾问平均执行率排名:</text>
  208. </view>
  209. <view class="ranking">
  210. <block v-for="(rank, rankIndex) in consultant" :key="rankIndex">
  211. <view class="ranking-item">
  212. <view class="serial">
  213. {{ rankIndex+1 }}
  214. </view>
  215. <view class="lside">
  216. {{ rank.title || '--' }}
  217. </view>
  218. <view class="rside">
  219. ({{ rank.value || 0 }}%)
  220. </view>
  221. </view>
  222. </block>
  223. <template v-if="consultant.length == 0">
  224. <view class="empty">
  225. 暂无数据
  226. </view>
  227. </template>
  228. </view>
  229. </view>
  230. </view>
  231. <view class="arrs-items index7" v-if="!weekObj.orgCode">
  232. <view class="left">
  233. 7
  234. </view>
  235. <view class="right">
  236. <view class="r-title">
  237. <text>置业顾问平均接访时长排名:</text>
  238. </view>
  239. <view class="ranking">
  240. <block v-for="(rank, rankIndex) in recording" :key="rankIndex">
  241. <view class="ranking-item">
  242. <view class="serial">
  243. {{ rankIndex+1 }}
  244. </view>
  245. <view class="lside">
  246. {{ rank.title || '--' }}
  247. </view>
  248. <view class="rside">
  249. ({{ rank.value || 0 }}min)
  250. </view>
  251. </view>
  252. </block>
  253. <template v-if="recording.length == 0">
  254. <view class="empty">
  255. 暂无数据
  256. </view>
  257. </template>
  258. </view>
  259. </view>
  260. </view>
  261. <view class="arrs-items index8">
  262. <view class="left">
  263. <template v-if="!weekObj.orgCode">
  264. 8
  265. </template>
  266. <template v-else>
  267. 6
  268. </template>
  269. </view>
  270. <view class="right">
  271. <view class="r-title">
  272. <text v-if="!weekObj.orgCode">平均执行率最低的顾问:</text>
  273. <text v-else>执行率最低的项目:</text>
  274. </view>
  275. <template v-if="!weekObj.orgCode">
  276. <view class="ranking">
  277. <block v-for="(rank, rankIndex) in lowest" :key="rankIndex">
  278. <view class="ranking-item">
  279. <view class="lside">
  280. {{ rank.title || '--' }}
  281. </view>
  282. <view class="rside value">
  283. {{ rank.value || 0 }}%
  284. </view>
  285. </view>
  286. </block>
  287. <template v-if="lowest.length == 0">
  288. <view class="empty">
  289. 暂无数据
  290. </view>
  291. </template>
  292. </view>
  293. </template>
  294. <template v-else>
  295. <view class="ranking">
  296. <block v-for="(rank, rankIndex) in weekObj.minFraction" :key="rankIndex">
  297. <view class="ranking-item">
  298. <view class="lside">
  299. {{ rankIndex || '--' }}
  300. </view>
  301. <view class="rside value">
  302. {{ rank || 0 }}%
  303. </view>
  304. </view>
  305. </block>
  306. <template v-if="!weekObj.minFraction">
  307. <view class="empty">
  308. 暂无数据
  309. </view>
  310. </template>
  311. </view>
  312. </template>
  313. </view>
  314. </view>
  315. <view class="arrs-items index9">
  316. <view class="left">
  317. <template v-if="!weekObj.orgCode">
  318. 9
  319. </template>
  320. <template v-else>
  321. 7
  322. </template>
  323. </view>
  324. <view class="right">
  325. <view class="r-title">
  326. <text>客户画像触达:</text>
  327. <text class="num value">{{ weekObj.reachSum || 0 }}次</text>
  328. </view>
  329. </view>
  330. </view>
  331. <view class="arrs-items index8" v-if="weekObj.orgCode">
  332. <view class="left">
  333. 8
  334. </view>
  335. <view class="right">
  336. <view class="r-title">
  337. <text>画像一级触达接待前三:</text>
  338. </view>
  339. <view class="ranking">
  340. <block v-for="(rank, rankIndex) in weekObj.level1List" :key="rankIndex">
  341. <view class="ranking-item">
  342. <view class="lside">
  343. {{ rank.name || '--' }}
  344. </view>
  345. <view class="rside value">
  346. ({{ rank.total || 0 }})
  347. </view>
  348. </view>
  349. </block>
  350. <template v-if="!weekObj.level1List || weekObj.level1List.length == 0">
  351. <view class="empty">
  352. 暂无数据
  353. </view>
  354. </template>
  355. </view>
  356. </view>
  357. </view>
  358. <view class="arrs-items index8" v-if="weekObj.orgCode">
  359. <view class="left">
  360. 9
  361. </view>
  362. <view class="right">
  363. <view class="r-title">
  364. <text>画像关键词触达接待前三:</text>
  365. </view>
  366. <view class="ranking">
  367. <block v-for="(rank, rankIndex) in weekObj.level2List" :key="rankIndex">
  368. <view class="ranking-item">
  369. <view class="lside">
  370. {{ rank.name || '--' }}
  371. </view>
  372. <view class="rside value">
  373. ({{ rank.total || 0 }})
  374. </view>
  375. </view>
  376. </block>
  377. <template v-if="!weekObj.level2List || weekObj.level2List.length == 0">
  378. <view class="empty">
  379. 暂无数据
  380. </view>
  381. </template>
  382. </view>
  383. </view>
  384. </view>
  385. <view class="arrs-items index10">
  386. <view class="left">
  387. <template v-if="!weekObj.orgCode">
  388. 12
  389. </template>
  390. <template v-else>
  391. 10
  392. </template>
  393. </view>
  394. <view class="right">
  395. <view class="r-title" @tap="jumpPage">
  396. <text>未标记接待数:</text>
  397. <text class="num value down"
  398. style="font-weight: 500;font-size: 34rpx;">{{ weekObj.unlabelledReceptionNum || 0 }}</text>
  399. <text class="down value">条</text>
  400. </view>
  401. </view>
  402. </view>
  403. <view class="arrs-items index11">
  404. <view class="left">
  405. <template v-if="!weekObj.orgCode">
  406. 13
  407. </template>
  408. <template v-else>
  409. 11
  410. </template>
  411. </view>
  412. <view class="right">
  413. <view class="r-title">
  414. <text>设备情况:</text>
  415. </view>
  416. <view class="r-box">
  417. <view class="r-box-item-lang">
  418. <view>在线<text class="value">{{ weekObj.equipmentInfo.onlineNum || 0 }}</text>
  419. </view>
  420. <view style="margin-left: 24rpx;">
  421. 离线<text class="value">{{ weekObj.equipmentInfo.offlineNum || 0 }}</text>
  422. </view>
  423. </view>
  424. </view>
  425. </view>
  426. </view>
  427. </view>
  428. </view>
  429. </view>
  430. </view>
  431. <!-- 底部按钮 -->
  432. <view class="nav-footer" v-if="!nodata">
  433. <view class="footer-item" @click="toHome">
  434. 回到管理端
  435. </view>
  436. <view class="footer-item" @click="copy" style="margin-left: 24rpx;">
  437. 复制内容
  438. </view>
  439. <view class="footer-item full" style="margin-left: 24rpx;" @tap="forShare">
  440. <button open-type="share" class="fulls">
  441. 一键转发
  442. </button>
  443. </view>
  444. </view>
  445. </view>
  446. </template>
  447. <script>
  448. export default {
  449. data() {
  450. return {
  451. needList: ['XJTop', 'ZXLTop', 'avgJds'], // 需要转换数组的内容
  452. carryOutTop: [], //
  453. carryOutLast: [], //
  454. consultant: [], // 置业顾问排名
  455. recording: [], // 录音排名
  456. lowest: [], // 执行率最低的顾问
  457. building: uni.getStorageSync('buildingID'),
  458. id: '', // 消息id
  459. projectName: '', // 项目名称
  460. weekObj: {}, // 日报详情
  461. nodata: false //有无数据
  462. }
  463. },
  464. onLoad(option) {
  465. if (option.id) this.id = option.id
  466. this.getMessage()
  467. },
  468. onShareAppMessage() {
  469. return {
  470. title: `${this.projectName}销讲助手日报`,
  471. path: `/pages/reportExcel/dayReport?id=${this.id}`
  472. }
  473. },
  474. methods: {
  475. tofixed2(time) {
  476. if (time) {
  477. return time.toFixed(2)
  478. } else {
  479. return 0
  480. }
  481. },
  482. // 对象转url参数F
  483. params(json) {
  484. return Object.keys(json).map(key => key + '=' + json[key]).join('&');
  485. },
  486. //
  487. jumpPage() {
  488. console.log(this.weekObj)
  489. if (this.weekObj.orgCode) {
  490. let obj = {
  491. refresh: 'refresh',
  492. markAdvisor: 0,
  493. validInvalid: 0,
  494. messageType: this.weekObj.messageType,
  495. staTime: this.weekObj.createTime.split(' ')[0],
  496. endtime: this.weekObj.createTime.split(' ')[0],
  497. orgCode: this.weekObj.orgCode,
  498. }
  499. uni.navigateTo({
  500. url: `/pages/center/prohibited/firsts?${this.params(obj)}`
  501. })
  502. }
  503. },
  504. // 项目拷贝
  505. copys() {
  506. let str = `
  507. ${this.projectName}数智工牌日报
  508. 生成时间:${this.weekObj.createTime || '--'}
  509. 1、接待量:${this.weekObj.receptionCount || 0 }
  510. 有效接待:${this.weekObj.activeCustomer || 0}
  511. 有效接待率:${this.weekObj.validReceptionRate || 0}%
  512. 对比昨天:${ this.weekObj.validReceptionRatePK > 0 ? '+' : '' }${ this.weekObj.validReceptionRatePK || 0 }%
  513. 2、平均执行率:${ this.weekObj.fraction || 0 }%
  514. 销讲执行率:${ this.weekObj.fractionPK > 0 ? '+' : '' }${ this.weekObj.fractionPK || 0 }%
  515. 3、平均接待时长:${ this.weekObj.avgDuration || 0 }min
  516. 对比昨天:${this.weekObj.avgDurationPK > 0 ? '+' : '' }${ this.weekObj.avgDurationPK || 0 }min`
  517. if (this.consultant.length > 0) {
  518. str += `
  519. 4、项目平均执行率排名:`
  520. this.consultant.map((item, index) => {
  521. str += `
  522. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  523. })
  524. }
  525. if (this.recording.length > 0) {
  526. str += `
  527. 5、项目平均接访时长排名:`
  528. this.recording.map((item, index) => {
  529. str += `
  530. top${index+1}.${item.title || '--'}${this.tofixed2(item.value/60)||'0'}m`
  531. })
  532. }
  533. if (this.lowest.length > 0) {
  534. str += `
  535. 6、执行率最低的项目:`
  536. for (let i in this.weekObj.minFraction) {
  537. str += `
  538. ${i || '--'}${this.weekObj.minFraction[i]||'0'}%`
  539. }
  540. }
  541. str += `
  542. 7、客户画像触达:${this.weekObj.reachSum || 0}次`
  543. if (this.weekObj.level1List.length > 0) {
  544. str += `
  545. 8、画像一级触达接待前三
  546. `
  547. this.weekObj.level1List.map((item, index) => {
  548. str += `
  549. top${index+1}.${item.name || '--'}${item.total||'0'}%`
  550. })
  551. }
  552. if (this.weekObj.level1List.length > 0) {
  553. str += `
  554. 9、画像关键词触达接待前三
  555. `
  556. this.weekObj.level1List.map((item, index) => {
  557. str += `
  558. top${index+1}.${item.name || '--'}${item.total||'0'}%`
  559. })
  560. }
  561. str += `
  562. 10、未标记接待数:${ this.weekObj.unlabelledReceptionNum || 0 }条
  563. 11、设备情况:
  564. 在线:${this.weekObj.equipmentInfo.onlineNum || 0}
  565. 离线:${this.weekObj.equipmentInfo.offlineNum || 0}`
  566. uni.setClipboardData({
  567. data: str
  568. })
  569. },
  570. forShare() {
  571. this.$u.get("/zkMessage/shareMessage", {
  572. id: this.id,
  573. houseId: uni.getStorageSync('buildingID').id,
  574. username: uni.getStorageSync('weapp_session_userInfo_data').username
  575. })
  576. },
  577. // 跳转首页
  578. toHome() {
  579. uni.navigateTo({
  580. url: '/pages/index/guide'
  581. })
  582. },
  583. // 获取日报详情
  584. getMessage() {
  585. this.$u.get('/zkMessage/findByProjectId', {
  586. id: this.id,
  587. houseId: uni.getStorageSync('buildingID').id,
  588. username: uni.getStorageSync('weapp_session_userInfo_data').username
  589. }).then(res => {
  590. console.log(res)
  591. let data = JSON.parse(res.zkMessage.content)
  592. if (res.zkMessage.content) {
  593. data = JSON.parse(res.zkMessage.content)
  594. this.weekObj = {
  595. ...res.zkMessage,
  596. ...data
  597. }
  598. this.nodata = false
  599. } else {
  600. this.nodata = true
  601. this.weekObj = {
  602. ...res.zkMessage
  603. }
  604. }
  605. this.projectName = res.projectName
  606. this.init()
  607. }).catch(e => {
  608. console.log(e)
  609. })
  610. },
  611. copy() {
  612. if (this.weekObj.orgCode) return this.copys()
  613. let str = `
  614. ${this.projectName}销讲助手日报
  615. 生成时间:${this.weekObj.createTime || '--'}
  616. 1、接待量:${this.weekObj.receptionCount || 0 }
  617. 有效接待:${this.weekObj.activeCustomer || 0}
  618. 有效接待率:${this.weekObj.validReceptionRate || 0}%
  619. 对比昨天:${ this.weekObj.validReceptionRatePK > 0 ? '+' : '' }${ this.weekObj.validReceptionRatePK || 0 }%
  620. 2、平均执行率:${ this.weekObj.fraction || 0 }%
  621. 对比昨天:${ this.weekObj.fractionPK > 0 ? '+' : '' }${ this.weekObj.fractionPK || 0 }%
  622. 3、平均接待时长:${ this.weekObj.avgDuration || 0 }min
  623. 对比昨天:${this.weekObj.avgDurationPK > 0 ? '+' : '' }${ this.weekObj.avgDurationPK || 0 }min`
  624. if (this.carryOutTop.length > 0) {
  625. str += `
  626. 4、销讲维度执行前三:`
  627. this.carryOutTop.map((item, index) => {
  628. str += `
  629. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  630. })
  631. }
  632. if (this.carryOutLast.length > 0) {
  633. str += `
  634. 5、销讲维度执行弱项前三:`
  635. this.carryOutLast.map((item, index) => {
  636. str += `
  637. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  638. })
  639. }
  640. if (this.consultant.length > 0) {
  641. str += `
  642. 6、置业顾问平均执行率排名:`
  643. this.consultant.map((item, index) => {
  644. str += `
  645. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  646. })
  647. }
  648. if (this.recording.length > 0) {
  649. str += `
  650. 7、置业顾问平均接访时长排名:`
  651. this.recording.map((item, index) => {
  652. str += `
  653. top${index+1}.${item.title || '--'}${item.value||'0'}min`
  654. })
  655. }
  656. if (this.lowest.length > 0) {
  657. str += `
  658. 8、平均执行率最低的顾问:`
  659. this.lowest.map((item, index) => {
  660. str += `
  661. ${item.title || '--'}${item.value||'0'}%`
  662. })
  663. }
  664. str += `
  665. 9、客户画像触达:${this.weekObj.reachSum || 0}次
  666. 10、未标记接待数:${ this.weekObj.unlabelledReceptionNum || 0 }条
  667. 11、设备情况:
  668. 在线:${this.weekObj.equipmentInfo.onlineNum || 0}
  669. 离线:${this.weekObj.equipmentInfo.offlineNum || 0}`
  670. uni.setClipboardData({
  671. data: str
  672. })
  673. },
  674. // 分割数组排名前三,倒三
  675. getTopThree() {
  676. if (this.weekObj.XJTopList && this.weekObj.XJTopList.length > 0) {
  677. let arr = this.weekObj.XJTopList.slice(0, 3)
  678. arr.forEach(item => {
  679. if (item.value != 100) {
  680. this.carryOutLast.push(item)
  681. }
  682. })
  683. this.carryOutTop = this.weekObj.XJTopList.reverse().slice(0, 3)
  684. console.log(this.weekObj.XJTopList)
  685. }
  686. if (this.weekObj.ZXLTopList && this.weekObj.ZXLTopList.length > 0) {
  687. this.consultant = this.weekObj.ZXLTopList.reverse().slice(0, 3)
  688. if (this.weekObj.ZXLTopList[this.weekObj.ZXLTopList.length - 1].value != 100) {
  689. this.lowest.push(this.weekObj.ZXLTopList[this.weekObj.ZXLTopList.length - 1])
  690. }
  691. }
  692. if (this.weekObj.avgJdsList && this.weekObj.avgJdsList.length > 0) {
  693. this.recording = this.weekObj.avgJdsList.reverse().slice(0, 3)
  694. }
  695. },
  696. init() {
  697. // 把对象转成数组并在后续的步骤方便处理
  698. this.needList.forEach(item => {
  699. if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
  700. this.weekObj[item + 'List'] = [] // 销讲执行
  701. for (let i in this.weekObj[item]) {
  702. this.weekObj[item + 'List'].push({
  703. title: i,
  704. value: this.weekObj[item][i]
  705. })
  706. }
  707. }
  708. })
  709. this.sortInitArr()
  710. },
  711. // 排序对象转换后的数组
  712. sortInitArr() {
  713. this.needList.forEach(item => {
  714. if (this.weekObj[item + 'List']) {
  715. this.bubbleSort(this.weekObj[item + 'List'])
  716. }
  717. })
  718. this.getTopThree()
  719. },
  720. // 冒泡排序
  721. bubbleSort(arr) {
  722. for (let i = 0; i < arr.length - 1; i += 1) {
  723. //通过 arr.length 次把第一位放到最后,完成排序
  724. //-i是因为最后的位置是会动态改变的,当完成一次后,最后一位会变成倒数第二位
  725. for (let j = 0; j < arr.length - 1 - i; j += 1) {
  726. if (arr[j].value > arr[j + 1].value) {
  727. const temp = arr[j];
  728. arr[j] = arr[j + 1];
  729. arr[j + 1] = temp;
  730. }
  731. }
  732. }
  733. },
  734. },
  735. filters: {
  736. fomatDate(date) {
  737. if (!date) return '--'
  738. let arr = date.split(' ')
  739. let str = arr[0]
  740. let result = str.split('-')
  741. return `${result[1]}-${result[2]}`
  742. }
  743. }
  744. }
  745. </script>
  746. <style lang="scss" scoped>
  747. .pages {
  748. width: 100vw;
  749. min-height: 100vh;
  750. display: flex;
  751. flex-direction: column;
  752. .nav-header {
  753. flex-shrink: 0;
  754. }
  755. .container {
  756. padding: 30rpx 30rpx 0;
  757. flex-grow: 1;
  758. display: flex;
  759. flex-direction: column;
  760. .c-head-card {
  761. padding: 30rpx;
  762. width: 100%;
  763. min-height: 252rpx;
  764. border: 2rpx solid #000000;
  765. border-radius: 12rpx;
  766. box-shadow: 10rpx 10rpx #2671E2;
  767. display: flex;
  768. flex-direction: column;
  769. .c-title-text {
  770. // position: relative;
  771. flex-grow: 1;
  772. font-size: 48rpx;
  773. font-weight: bold;
  774. color: #303030;
  775. }
  776. .date {
  777. // position: absolute;
  778. // right: 0;
  779. // bottom: 6rpx;
  780. font-size: 30rpx;
  781. color: #303030;
  782. }
  783. .creative-time {
  784. margin: 20rpx 0 0 0;
  785. flex-shrink: 0;
  786. }
  787. }
  788. .dateList {
  789. width: 100%;
  790. .arrs {
  791. width: 100%;
  792. .arrs-items {
  793. margin: 40rpx 0 0 0;
  794. display: flex;
  795. min-height: 100rpx;
  796. .left {
  797. flex-shrink: 0;
  798. margin-right: 12rpx;
  799. width: 48rpx;
  800. height: 44rpx;
  801. display: flex;
  802. justify-content: center;
  803. align-items: center;
  804. border-radius: 8rpx;
  805. border: 1rpx solid #999999;
  806. font-size: 32rpx;
  807. }
  808. .right {
  809. flex-grow: 1;
  810. .r-title {
  811. font-size: 32rpx;
  812. height: 44rpx;
  813. display: flex;
  814. align-items: center;
  815. .num {
  816. font-size: 34rpx;
  817. }
  818. }
  819. .r-box {
  820. padding: 21rpx 0 0 0;
  821. display: flex;
  822. flex-wrap: wrap;
  823. .r-box-item {
  824. margin-right: 24rpx;
  825. }
  826. .r-box-item-lang {
  827. margin-top: 19rpx;
  828. width: 100%;
  829. display: flex;
  830. align-items: center;
  831. .contrast {
  832. margin: 0 0 0 24rpx;
  833. display: flex;
  834. align-items: center;
  835. }
  836. .down {
  837. color: #43CD80;
  838. font-size: 34rpx;
  839. }
  840. .up {
  841. font-size: 34rpx;
  842. color: #E7483C;
  843. }
  844. }
  845. }
  846. .ranking {
  847. padding: 21rpx 0 0 0;
  848. display: flex;
  849. flex-direction: column;
  850. .ranking-item {
  851. margin-bottom: 22rpx;
  852. display: flex;
  853. align-items: center;
  854. font-size: 30rpx;
  855. .serial {
  856. flex-shrink: 0;
  857. width: 42rpx;
  858. height: 42rpx;
  859. background: #2671E2;
  860. border-radius: 50%;
  861. display: flex;
  862. justify-content: center;
  863. align-items: center;
  864. color: #fff;
  865. }
  866. .lside {
  867. margin: 0 20rpx;
  868. color: #505050;
  869. }
  870. .rside {
  871. flex-shrink: 0;
  872. font-size: 32rpx;
  873. }
  874. }
  875. }
  876. }
  877. }
  878. }
  879. }
  880. }
  881. .nav-footer {
  882. position: sticky;
  883. bottom: 0;
  884. padding: 32rpx;
  885. width: 100%;
  886. display: flex;
  887. justify-content: center;
  888. background: #fff;
  889. .footer-item {
  890. flex: 1;
  891. height: 88rpx;
  892. display: flex;
  893. justify-content: center;
  894. align-items: center;
  895. color: #2671E2;
  896. border: 2rpx solid #2671E2;
  897. border-radius: 8rpx;
  898. overflow: hidden;
  899. font-size: 32rpx;
  900. &.full {
  901. background: #2671E2;
  902. color: #fff;
  903. .fulls {
  904. box-sizing: border-box;
  905. width: 100%;
  906. height: 100%;
  907. background: transparent;
  908. color: #fff;
  909. font-size: 32rpx;
  910. font-weight: normal;
  911. line-height: 88rpx;
  912. }
  913. }
  914. }
  915. }
  916. .up {
  917. color: #43CD80 !important;
  918. }
  919. .down {
  920. color: #E6273A !important;
  921. }
  922. .empty {
  923. width: 100%;
  924. line-height: 48rpx;
  925. }
  926. .value {
  927. margin-left: 5rpx;
  928. font-size: 30rpx !important;
  929. font-weight: bold !important;
  930. }
  931. .nodata-box {
  932. width: 750rpx;
  933. margin: 20rpx auto 0;
  934. display: flex;
  935. justify-content: center;
  936. align-items: center;
  937. flex-direction: column;
  938. background-color: #fff;
  939. .img {
  940. width: 400rpx;
  941. height: 400rpx;
  942. }
  943. .text {
  944. text-align: center;
  945. font-size: 28rpx;
  946. font-family: PingFangSC-Regular, PingFang SC;
  947. font-weight: 400;
  948. color: #666666;
  949. line-height: 40rpx;
  950. // margin-top: -40rpx;
  951. }
  952. }
  953. }
  954. </style>