AI销管
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

learning.vue 17 KiB

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