AI销管
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

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