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.
 
 
 

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