AI销管
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

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