AI销管
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.

learning.vue 14 KiB

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