AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

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