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.
 
 
 
 

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