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.
 
 
 

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