AI销管
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

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