AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

712 行
17 KiB

  1. <template>
  2. <view class="main">
  3. <!-- 头部导航 -->
  4. <view class="tab-box">
  5. <u-tabs class="tab-box-utabs" bar-width="120" bar-height="4" :list="tablist" :is-scroll="false"
  6. :current="activeClass" @change="clocktab"></u-tabs>
  7. </view>
  8. <!-- 内容部分 :style="[otherHeight]" -->
  9. <view class="container">
  10. <template v-if="activeClass==0">
  11. <template v-if="alllist.length > 0">
  12. <view class="cented">
  13. <block v-for="(item,index) in alllist" :key="index">
  14. <view class="ceninfo" @click="quclick(item)">
  15. <view class="infoview">
  16. <view class="infozuo">
  17. <view class="infozuochiud2">顾</view>
  18. <view class="infozuochiud1">{{item.jbaName}}</view>
  19. </view>
  20. <view class="infoyou">
  21. <view class="infoyouchiud2">{{ item.studyStatus }}</view>
  22. </view>
  23. </view>
  24. <view class="footerinfo">
  25. <view class="footerinfozuo">
  26. <image src="../../static/images/img/time.png" mode=""></image>
  27. {{item.assignedTime}}
  28. </view>
  29. <view class="footerinfozuo">
  30. <image src="../../static/images/img/voice.png" mode=""></image>
  31. {{ item.duration | formatTime }}min
  32. </view>
  33. <view class="footerinfozuo" style="color: #2671E2;">
  34. <image src="../../static/images/img/percent.png" mode=""></image>
  35. {{ item.fraction || 0 }}%
  36. </view>
  37. </view>
  38. <!-- 底部按钮组 -->
  39. <view class="footicon">
  40. <view class="icon">
  41. <image class="Piabodata-img1" src="../../static/images/img/view.png" mode="">
  42. </image>
  43. <!-- 浏览量 -->
  44. {{ item.pageviews || 0 }}
  45. </view>
  46. <view class="icon">
  47. <image class="Piabodata-img1" src="../../static/images/img/message.png" mode="">
  48. </image>
  49. <!-- 热度 -->
  50. {{ item.commentCount || 0 }}
  51. </view>
  52. <view class="icon">
  53. <image class="Piabodata-img1" src="../../static/images/img/hand.png" mode="">
  54. </image>
  55. <!-- 点赞数 -->
  56. {{ item.likeCount || 0 }}
  57. </view>
  58. </view>
  59. </view>
  60. </block>
  61. </view>
  62. </template>
  63. <view v-else class="empty">
  64. <view style="width: 100%;display: flex;
  65. flex-direction: column;justify-content: center;align-items: center;">
  66. <view style="width: 100%;text-align: center;">
  67. <image style="width: 220rpx;height: 200rpx;"
  68. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode=""></image>
  69. </view>
  70. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据</view>
  71. </view>
  72. </view>
  73. </template>
  74. <template v-if="activeClass==1">
  75. <view class="biaoqianview">
  76. <scroll-view scroll-y="true" class="boxintention">
  77. <block v-for="(item,index) in equinoctial" :key="index">
  78. <view class="boxcenten" :class="{act: index == leftIndex}"
  79. @click="routerclick(item, index)">
  80. <view class="boxcenteninfotext">{{item.name}}</view>
  81. </view>
  82. </block>
  83. </scroll-view>
  84. <scroll-view scroll-y="true" class="rside-scroll">
  85. <template v-if="alllists.length > 0">
  86. <view class="rside-box">
  87. <block v-for="(item,index) in alllists" :key="index">
  88. <view class="ceninfo" @click="quclicks(item)">
  89. <view class="infoview">
  90. <view class="infozuo">
  91. <view class="infozuochiud2">顾</view>
  92. <view class="infozuochiud1">{{item.jbaName}}</view>
  93. </view>
  94. <view class="infoyou">
  95. <view class="infoyouchiud2">{{item.studyStatus}}</view>
  96. </view>
  97. </view>
  98. <view class="footerinfo">
  99. <view class="footerinfozuo">
  100. <image src="../../static/images/img/time.png" mode=""></image>
  101. {{item.assignedTime}}
  102. </view>
  103. </view>
  104. <!-- 底部按钮组 -->
  105. <view class="footicon">
  106. <view class="icon">
  107. <image class="Piabodata-img1" src="../../static/images/img/view.png"
  108. mode=""></image>
  109. <!-- 浏览量 -->
  110. {{item.pageviews || 0 }}
  111. </view>
  112. <view class="icon">
  113. <image class="Piabodata-img1" src="../../static/images/img/message.png"
  114. mode=""></image>
  115. <!-- 热度 -->
  116. {{item.commentCount || 0 }}
  117. </view>
  118. <view class="icon">
  119. <image class="Piabodata-img1" src="../../static/images/img/hand.png"
  120. mode=""></image>
  121. <!-- 点赞数 -->
  122. {{item.likeCount || 0 }}
  123. </view>
  124. </view>
  125. </view>
  126. </block>
  127. </view>
  128. </template>
  129. <view v-else class="empty">
  130. <view style="width: 100%;display: flex;
  131. flex-direction: column;justify-content: center;align-items: center;">
  132. <view style="width: 100%;text-align: center;">
  133. <image style="width: 220rpx;height: 200rpx;"
  134. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode="">
  135. </image>
  136. </view>
  137. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据
  138. </view>
  139. </view>
  140. </view>
  141. </scroll-view>
  142. </view>
  143. </template>
  144. </view>
  145. </view>
  146. </template>
  147. <script>
  148. var config = require("../../config");
  149. var util = require("@/utils/util.js");
  150. export default {
  151. data() {
  152. return {
  153. tablist: [{
  154. name: "优秀案例"
  155. },
  156. {
  157. name: "维度精选"
  158. }
  159. ],
  160. activeClass: 0,
  161. equinoctial: [],
  162. alllist: [], // 一级分类菜单
  163. buildingID: '',
  164. leftIndex: 0, // 左侧滚动区域选中下标
  165. alllists: [], // 二级分类菜单
  166. };
  167. },
  168. computed: {
  169. bgAudioMannager() {
  170. console.log(this.$store.state.bgAudioMannager)
  171. }
  172. },
  173. onPullDownRefresh() {
  174. var i = uni.getStorageSync('fendianindex')
  175. this.buildingID = uni.getStorageSync('buildingID').id;
  176. this.clocktab(i)
  177. this.leftIndex = 0
  178. this.infoinit()
  179. setTimeout(() => {
  180. uni.stopPullDownRefresh()
  181. }, 3000)
  182. },
  183. onShow() {
  184. this.getTabBarBadge()
  185. try {
  186. this.$store.commit('stopAduio')
  187. } catch (e) {
  188. console.log(e)
  189. }
  190. var i = uni.getStorageSync('fendianindex')
  191. this.buildingID = uni.getStorageSync('buildingID').id;
  192. this.clocktab(i)
  193. let left = uni.getStorageSync('left');
  194. if (left != undefined) {
  195. this.leftIndex = left.split(',')[0]
  196. this.getSecond(left.split(',')[1])
  197. this.infoinit(left.split(',')[1])
  198. } else {
  199. this.leftIndex = 0
  200. this.infoinit()
  201. }
  202. this.updateInit()
  203. },
  204. methods: {
  205. updateInit() {
  206. this.$u.get(config.service.notReadNum, {
  207. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  208. projectId: uni.getStorageSync('buildingID').id
  209. }).then(res => {
  210. console.log(res)
  211. if (res > 0) {
  212. uni.setTabBarBadge({ //显示数字
  213. index: 4, //tabbar下标
  214. text: `${res}` //数字
  215. })
  216. } else {
  217. uni.removeTabBarBadge({
  218. index: 4
  219. })
  220. }
  221. }).catch(e => {
  222. uni.removeTabBarBadge({
  223. index: 4
  224. })
  225. })
  226. },
  227. // 跳转部分学习
  228. quclicks(item) {
  229. uni.showLoading({
  230. title: '加载中',
  231. mask: true
  232. });
  233. const parames = {
  234. pageNum: 1,
  235. pageSize: 100,
  236. query: {
  237. whetherFinish: 1,
  238. customerId: item.carId,
  239. id: item.startFile
  240. }
  241. }
  242. this.$u.post("/corpus/fendianFindByPage", parames).then(res => {
  243. var newobj = res[0];
  244. setTimeout(function() {
  245. uni.hideLoading();
  246. }, 2000);
  247. console.log(res)
  248. if (!res[0]) {
  249. uni.showToast({
  250. title: '当前学习案例暂无数据',
  251. icon: 'none'
  252. })
  253. return
  254. }
  255. console.log(this.equinoctial)
  256. console.log(this.leftIndex)
  257. if (res[0].merge == 0) {
  258. uni.navigateTo({
  259. url: `/pages/learning/Equinoctial/index2?customerId=${newobj.customerId}&biaoqian=${this.equinoctial[this.leftIndex || 0].name}&marketingId=${this.equinoctial[this.leftIndex || 0].marketingId}&startTime=${item.startTime}&startFile=${item.startFile}`
  260. })
  261. } else {
  262. uni.navigateTo({
  263. url: `/pages/learning/Equinoctial/index?customerId=${newobj.customerId}&biaoqian=${this.equinoctial[this.leftIndex || 0].name}&marketingId=${this.equinoctial[this.leftIndex || 0].marketingId}&startTime=${item.startTime}&startFile=${item.startFile}`
  264. })
  265. }
  266. })
  267. },
  268. //全部学习跳转
  269. quclick(item) {
  270. uni.showLoading({
  271. title: '加载中',
  272. mask: true
  273. });
  274. const parames = {
  275. pageNum: 1,
  276. pageSize: 100,
  277. query: {
  278. customerId: item.carId,
  279. }
  280. }
  281. var cet = {
  282. bg: 0,
  283. customerId: item.id,
  284. id: ''
  285. }
  286. this.$u.post("/corpus/findByPage", parames).then(res => {
  287. setTimeout(function() {
  288. uni.hideLoading();
  289. }, 2000);
  290. var newobj = res[0];
  291. if (res[0].merge == 0) {
  292. uni.navigateTo({
  293. url: `/pages/learning/Thefulltext/index2?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(cet)}&stateisshow=${"2"}`
  294. })
  295. } else {
  296. uni.navigateTo({
  297. url: `/pages/learning/Thefulltext/index?customerId=${newobj.customerId}`
  298. })
  299. }
  300. })
  301. },
  302. //分点学习点击事件
  303. routerclick(item, index) {
  304. if (this.leftIndex === index) return
  305. this.leftIndex = index
  306. uni.setStorageSync("left", index + ',' + item.marketingId); //写入缓存
  307. this.getSecond(item.marketingId)
  308. },
  309. // tab切换
  310. clocktab(index) {
  311. this.activeClass = index;
  312. if (this.activeClass == 0) {
  313. uni.setStorageSync("fendianindex", 0); //写入缓存
  314. this.ceninit()
  315. } else {
  316. uni.setStorageSync("fendianindex", 1); //写入缓存
  317. this.leftIndex = uni.getStorageSync('left').split(',')[0]
  318. let mid = uni.getStorageSync('left').split(',')[1]
  319. if (mid != undefined) {
  320. this.getSecond(mid)
  321. } else {
  322. this.infoinit()
  323. }
  324. }
  325. },
  326. ceninit() {
  327. let infoobj = {
  328. "pageNum": 1,
  329. "pageSize": 100,
  330. "query": {
  331. "status": 0,
  332. 'itemId': this.buildingID,
  333. }
  334. }
  335. uni.request({
  336. url: config.service.findAllZATD,
  337. method: "POST",
  338. header: {
  339. 'content-type': 'application/json',
  340. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  341. },
  342. data: infoobj,
  343. success: (data) => {
  344. if (data.data.code == 10000) {
  345. this.alllist = data.data.data.results
  346. } else {
  347. uni.showToast({
  348. title: data.data.message,
  349. duration: 2000
  350. });
  351. }
  352. }
  353. })
  354. },
  355. // 获取改学习分类下的数据
  356. getSecond(id) {
  357. let infoobj = {
  358. "pageNum": 1,
  359. "pageSize": 100,
  360. "query": {
  361. "status": 1,
  362. "marketingId": id,
  363. "itemId": this.buildingID
  364. }
  365. }
  366. uni.request({
  367. url: config.service.findAllZATD,
  368. method: "POST",
  369. header: {
  370. 'content-type': 'application/json',
  371. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  372. },
  373. data: infoobj,
  374. success: (data) => {
  375. if (data.data.code == 10000) {
  376. this.alllists = data.data.data.results
  377. } else {
  378. uni.showToast({
  379. title: data.data.message,
  380. duration: 2000
  381. });
  382. }
  383. }
  384. })
  385. },
  386. infoinit(mid) {
  387. let obj = {
  388. itemId: this.buildingID
  389. }
  390. uni.request({
  391. url: config.service.findSelectedLabel,
  392. method: "POST",
  393. data: obj,
  394. header: {
  395. 'content-type': 'application/json',
  396. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  397. },
  398. success: (data) => {
  399. console.log(data.data.data, 'dsadjsakljdskaljdaskljdklsajdklasjkdlsa')
  400. if (data.data.code == 10000) {
  401. if (data.data.data) {
  402. this.equinoctial = data.data.data
  403. if (mid != undefined) {
  404. this.getSecond(mid)
  405. } else {
  406. this.getSecond(data.data.data[0].marketingId)
  407. }
  408. }
  409. } else {
  410. uni.showToast({
  411. title: data.data.message,
  412. duration: 2000
  413. });
  414. }
  415. }
  416. })
  417. }
  418. },
  419. filters: {
  420. //格式化时间
  421. formatTime(num) {
  422. if (!num) return 0
  423. num = parseInt(num);
  424. //格式化时间格式
  425. num = num.toFixed(0);
  426. let second = num % 60;
  427. if (second < 10) second = "0" + second;
  428. let min = Math.floor(num / 60);
  429. if (min < 10) min = "0" + min;
  430. return min + ":" + second;
  431. },
  432. }
  433. }
  434. </script>
  435. <style lang="scss" scoped>
  436. .main {
  437. background: #F8F8F8;
  438. display: flex;
  439. flex-direction: column;
  440. }
  441. .tab-box {
  442. position: sticky;
  443. top: var(--window-top);
  444. z-index: 999;
  445. background: #fff;
  446. width: 100%;
  447. height: 80rpx;
  448. }
  449. .container {
  450. min-height: calc(100vh - 80rpx - 50px);
  451. .cented {
  452. width: 100%;
  453. display: flex;
  454. flex-direction: column;
  455. .ceninfo {
  456. position: relative;
  457. margin-top: 20rpx;
  458. width: 100%;
  459. background: #FFFFFF;
  460. .infoview {
  461. padding: 0 30rpx;
  462. width: 100%;
  463. height: 92rpx;
  464. display: flex;
  465. justify-content: space-between;
  466. border-bottom: 1rpx solid #E0E0E0;
  467. .infozuo {
  468. display: flex;
  469. align-items: center;
  470. .infozuochiud1 {
  471. font-size: 30rpx;
  472. font-weight: 600;
  473. color: #0C0C0C;
  474. }
  475. .infozuochiud2 {
  476. margin: 0 10rpx 0 0;
  477. padding: 5rpx 11rpx;
  478. border-radius: 50%;
  479. border: 1px solid #2671E2;
  480. font-size: 30rpx;
  481. font-weight: 400;
  482. color: #2671E2;
  483. }
  484. }
  485. .infoyou {
  486. height: 100%;
  487. display: flex;
  488. align-items: center;
  489. .infoyouchiud2 {
  490. font-size: 30rpx;
  491. color: #333;
  492. }
  493. }
  494. }
  495. .footerinfo {
  496. padding: 0 30rpx;
  497. width: 100%;
  498. height: 88rpx;
  499. display: flex;
  500. align-items: center;
  501. justify-content: space-between;
  502. border-bottom: 1rpx solid #E0E0E0;
  503. .footerinfozuo {
  504. display: flex;
  505. align-items: center;
  506. font-size: 28rpx;
  507. color: #333;
  508. image {
  509. margin: 0 10rpx 0 0;
  510. width: 32rpx;
  511. height: 32rpx;
  512. }
  513. }
  514. }
  515. .footicon {
  516. padding: 0 80rpx;
  517. height: 88rpx;
  518. display: flex;
  519. align-items: center;
  520. justify-content: space-between;
  521. .icon {
  522. display: flex;
  523. align-items: center;
  524. }
  525. image {
  526. margin-right: 10rpx;
  527. width: 32rpx;
  528. height: 32rpx;
  529. }
  530. }
  531. }
  532. }
  533. .biaoqianview {
  534. width: 100%;
  535. display: flex;
  536. height: calc(100vh - 80rpx - 50px);
  537. .boxintention {
  538. flex-shrink: 0;
  539. width: 160rpx;
  540. height: 100%;
  541. background: #F0F1F5;
  542. .boxcenten {
  543. width: 100%;
  544. height: 100rpx;
  545. background: #F0F1F5;
  546. display: flex;
  547. .boxcenteninfotext {
  548. width: 100%;
  549. height: 100%;
  550. text-indent: 20rpx;
  551. line-height: 100rpx;
  552. font-size: 30rpx;
  553. color: #0C0C0C;
  554. overflow: hidden;
  555. text-overflow: ellipsis;
  556. white-space: nowrap;
  557. }
  558. &.act {
  559. background: #fff;
  560. }
  561. }
  562. }
  563. .rside-scroll {
  564. flex-grow: 1;
  565. padding: 0 0 0 10rpx;
  566. .rside-box {
  567. display: flex;
  568. flex-direction: column;
  569. .ceninfo {
  570. position: relative;
  571. margin-top: 20rpx;
  572. width: 100%;
  573. background: #FFFFFF;
  574. .infoview {
  575. padding: 0 30rpx;
  576. width: 100%;
  577. height: 92rpx;
  578. display: flex;
  579. justify-content: space-between;
  580. border-bottom: 1rpx solid #E0E0E0;
  581. .infozuo {
  582. display: flex;
  583. align-items: center;
  584. .infozuochiud1 {
  585. font-size: 30rpx;
  586. font-weight: 600;
  587. color: #0C0C0C;
  588. }
  589. .infozuochiud2 {
  590. margin: 0 10rpx 0 0;
  591. padding: 5rpx 11rpx;
  592. border-radius: 50%;
  593. border: 1px solid #2671E2;
  594. font-size: 30rpx;
  595. font-weight: 400;
  596. color: #2671E2;
  597. }
  598. }
  599. .infoyou {
  600. height: 100%;
  601. display: flex;
  602. align-items: center;
  603. .infoyouchiud2 {
  604. font-size: 30rpx;
  605. color: #333;
  606. }
  607. }
  608. }
  609. .footerinfo {
  610. padding: 0 30rpx;
  611. width: 100%;
  612. height: 88rpx;
  613. display: flex;
  614. align-items: center;
  615. justify-content: space-between;
  616. border-bottom: 1rpx solid #E0E0E0;
  617. .footerinfozuo {
  618. display: flex;
  619. align-items: center;
  620. font-size: 28rpx;
  621. color: #333;
  622. image {
  623. margin: 0 10rpx 0 0;
  624. width: 32rpx;
  625. height: 32rpx;
  626. }
  627. }
  628. }
  629. .footicon {
  630. padding: 0 80rpx;
  631. height: 88rpx;
  632. display: flex;
  633. align-items: center;
  634. justify-content: space-between;
  635. .icon {
  636. display: flex;
  637. align-items: center;
  638. }
  639. image {
  640. margin-right: 10rpx;
  641. width: 32rpx;
  642. height: 32rpx;
  643. }
  644. }
  645. }
  646. }
  647. }
  648. }
  649. .empty {
  650. height: 50vh;
  651. display: flex;
  652. align-items: center;
  653. }
  654. }
  655. </style>