|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632 |
- <template>
- <view class="main">
- <!-- 头部导航 -->
- <view class="tab-box">
- <u-tabs class="tab-box-utabs" bar-width="120" bar-height="4" :list="tablist" :is-scroll="false"
- :current="activeClass" @change="clocktab"></u-tabs>
- </view>
- <!-- 内容部分 :style="[otherHeight]" -->
- <view class="container">
- <template v-if="activeClass==0">
- <view class="cented">
- <block v-for="(item,index) in alllist" :key="index">
- <view class="ceninfo" @click="quclick(item)">
- <view class="infoview">
- <view class="infozuo">
- <view class="infozuochiud2">顾</view>
- <view class="infozuochiud1">{{item.jbaName}}</view>
- </view>
- <view class="infoyou">
- <view class="infoyouchiud2">{{ item.studyStatus }}</view>
- </view>
- </view>
- <view class="footerinfo">
- <view class="footerinfozuo">
- <image src="../../static/images/img/time.png" mode=""></image>
- {{item.assignedTime}}
- </view>
- <view class="footerinfozuo">
- <image src="../../static/images/img/voice.png" mode=""></image>
- {{ item.duration | formatTime }}min
- </view>
- <view class="footerinfozuo" style="color: #2671E2;">
- <image src="../../static/images/img/percent.png" mode=""></image>
- {{ item.fraction || 0 }}%
- </view>
- </view>
- <!-- 底部按钮组 -->
- <view class="footicon">
- <view class="icon">
- <image class="Piabodata-img1" src="../../static/images/img/view.png" mode="">
- </image>
- <!-- 浏览量 -->
- {{ item.pageviews || 0 }}
- </view>
- <view class="icon">
- <image class="Piabodata-img1" src="../../static/images/img/message.png" mode="">
- </image>
- <!-- 热度 -->
- {{ item.commentCount || 0 }}
- </view>
- <view class="icon">
- <image class="Piabodata-img1" src="../../static/images/img/hand.png" mode="">
- </image>
- <!-- 点赞数 -->
- {{ item.likeCount || 0 }}
- </view>
- </view>
- </view>
- </block>
- </view>
- </template>
-
- <template v-if="activeClass==1">
- <view class="biaoqianview">
- <scroll-view scroll-y="true" class="boxintention">
- <block v-for="(item,index) in equinoctial" :key="index">
- <view class="boxcenten" :class="{act: index == leftIndex}"
- @click="routerclick(item, index)">
- <view class="boxcenteninfotext">{{item.name}}</view>
- </view>
- </block>
- </scroll-view>
-
- <scroll-view scroll-y="true" class="rside-scroll">
- <view class="rside-box">
- <block v-for="(item,index) in alllists" :key="index">
- <view class="ceninfo" @click="quclicks(item)">
- <view class="infoview">
- <view class="infozuo">
- <view class="infozuochiud2">顾</view>
- <view class="infozuochiud1">{{item.jbaName}}</view>
- </view>
- <view class="infoyou">
- <view class="infoyouchiud2">未学习</view>
- </view>
- </view>
- <view class="footerinfo">
- <view class="footerinfozuo">
- <image src="../../static/images/img/time.png" mode=""></image>
- {{item.assignedTime}}
- </view>
- </view>
- <!-- 底部按钮组 -->
- <view class="footicon">
- <view class="icon">
- <image class="Piabodata-img1" src="../../static/images/img/view.png"
- mode=""></image>
- <!-- 浏览量 -->
- {{item.pageviews || 0 }}
- </view>
- <view class="icon">
- <image class="Piabodata-img1" src="../../static/images/img/message.png"
- mode=""></image>
- <!-- 热度 -->
- {{item.commentCount || 0 }}
- </view>
- <view class="icon">
- <image class="Piabodata-img1" src="../../static/images/img/hand.png"
- mode=""></image>
- <!-- 点赞数 -->
- {{item.likeCount || 0 }}
- </view>
- </view>
- </view>
- </block>
- </view>
- </scroll-view>
- </view>
- </template>
- </view>
-
- <!-- 底部导航栏 -->
- <u-tabbar :isBtnTop="false" class="tabbar" :mid-button="true" activeColor="#1296db" inactiveColor="#999999"
- v-model="current" :list="tabbarList"></u-tabbar>
- </view>
- </template>
-
- <script>
- var config = require("../../config");
- var util = require("@/utils/util.js");
- import tabbarList from '@/utils/tabbar.js'
- export default {
- data() {
- return {
- // tabbar配置项
- current: 3,
- tabbarList: tabbarList,
- //--- end --- tabbar配置项
- tablist: [{
- name: "优秀案例"
- },
- {
- name: "维度精选"
- }
- ],
- activeClass: 0,
- equinoctial: [],
- alllist: [], // 一级分类菜单
- buildingID: '',
- leftIndex: 0, // 左侧滚动区域选中下标
- alllists: [], // 二级分类菜单
- };
- },
-
- onPullDownRefresh() {
- var i = uni.getStorageSync('fendianindex')
- this.buildingID = uni.getStorageSync('buildingID').id;
- this.clocktab(i)
- this.leftIndex = 0
- this.infoinit()
-
- setTimeout(() => {
- uni.stopPullDownRefresh()
- }, 3000)
- },
-
- onShow() {
- var i = uni.getStorageSync('fendianindex')
- this.buildingID = uni.getStorageSync('buildingID').id;
- this.clocktab(i)
- this.leftIndex = 0
- this.infoinit()
- },
-
- methods: {
- // 跳转部分学习
- quclicks(item) {
- uni.showLoading({
- title: '加载中',
- mask: true
- });
-
- const parames = {
- pageNum: 1,
- pageSize: 100,
- query: {
- whetherFinish: 1,
- customerId: item.carId,
- id: item.startFile
- }
- }
- var cet = {
- bg: 0,
- customerId: item.id,
- id: ''
- }
- this.$u.post("/corpus/fendianFindByPage", parames).then(res => {
- var newobj = res[0];
- setTimeout(function() {
- uni.hideLoading();
- }, 2000);
- if (res[0].merge == 0) {
- uni.navigateTo({
- url: `/pages/learning/Equinoctial/index2?customerId=${newobj.customerId}&biaoqian=${this.equinoctial[this.leftIndex].name}&startTime=${item.startTime}&startFile=${item.startFile}`
- })
- } else {
- uni.navigateTo({
- url: `/pages/learning/Equinoctial/index?customerId=${newobj.customerId}&biaoqian=${this.equinoctial[this.leftIndex].name}&startTime=${item.startTime}&startFile=${item.startFile}`
- })
- }
- })
- },
-
- //全部学习跳转
- quclick(item) {
- uni.showLoading({
- title: '加载中',
- mask: true
- });
- const parames = {
- pageNum: 1,
- pageSize: 100,
- query: {
- customerId: item.carId,
- }
- }
- var cet = {
- bg: 0,
- customerId: item.id,
- id: ''
- }
- this.$u.post("/corpus/findByPage", parames).then(res => {
- setTimeout(function() {
- uni.hideLoading();
- }, 2000);
- var newobj = res[0];
- if (res[0].merge == 0) {
- uni.navigateTo({
- url: `/pages/learning/Thefulltext/index2?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(cet)}&stateisshow=${"2"}`
- })
- } else {
- uni.navigateTo({
- url: `/pages/learning/Thefulltext/index?customerId=${newobj.customerId}`
- })
- }
- })
- },
- //分点学习点击事件
- routerclick(item, index) {
- if (this.leftIndex === index) return
- this.leftIndex = index
- this.getSecond(this.equinoctial[index].marketingId)
- // // return
- // uni.navigateTo({
- // url: "/pages/learning/Equinoctiallearning?id=" + item.marketingId + "&biaoqian=" + item.name
- // })
- },
- // tab切换
- clocktab(index) {
- this.activeClass = index;
- if (this.activeClass == 0) {
- uni.setStorageSync("fendianindex", 0); //写入缓存
- this.ceninit()
- } else {
- uni.setStorageSync("fendianindex", 1); //写入缓存
- this.infoinit()
- }
- },
-
- ceninit() {
- let infoobj = {
- "pageNum": 1,
- "pageSize": 100,
- "query": {
- "status": 0,
- 'itemId': this.buildingID,
- }
- }
- uni.request({
- url: config.service.findAllZATD,
- method: "POST",
- header: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
- },
- data: infoobj,
- success: (data) => {
- if (data.data.code == 10000) {
- this.alllist = data.data.data.results
- } else {
- uni.showToast({
- title: data.data.message,
- duration: 2000
- });
- }
- }
- })
- },
-
- // 获取改学习分类下的数据
- getSecond(id) {
- let infoobj = {
- "pageNum": 1,
- "pageSize": 100,
- "query": {
- "status": 1,
- "marketingId": id,
- "itemId": this.buildingID
- }
- }
- uni.request({
- url: config.service.findAllZATD,
- method: "POST",
- header: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
- },
- data: infoobj,
- success: (data) => {
- console.log(data.data.data.results,
- "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq");
- if (data.data.code == 10000) {
- this.alllists = data.data.data.results
- } else {
- uni.showToast({
- title: data.data.message,
- duration: 2000
- });
- }
- }
- })
- },
-
-
- infoinit() {
- let obj = {
- itemId: this.buildingID
- }
- uni.request({
- url: config.service.findSelectedLabel,
- method: "POST",
- data: obj,
- header: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
- },
- success: (data) => {
- if (data.data.code == 10000) {
- this.equinoctial = data.data.data
- this.getSecond(data.data.data[0].marketingId)
- } else {
- uni.showToast({
- title: data.data.message,
- duration: 2000
- });
- }
- }
- })
- }
- },
-
- filters: {
- //格式化时间
- formatTime(num) {
- if (!num) return 0
- num = parseInt(num);
- //格式化时间格式
- num = num.toFixed(0);
- let second = num % 60;
- if (second < 10) second = "0" + second;
- let min = Math.floor(num / 60);
- if (min < 10) min = "0" + min;
- return min + ":" + second;
- },
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .main {
- background: #F8F8F8;
- display: flex;
- flex-direction: column;
- }
-
- .tab-box {
- position: sticky;
- top: var(--window-top);
- z-index: 999;
- background: #fff;
- width: 100%;
- height: 80rpx;
- }
-
- .container {
- min-height: calc(100vh - 80rpx - 50px);
-
- .cented {
- width: 100%;
- display: flex;
- flex-direction: column;
-
- .ceninfo {
- position: relative;
- margin-top: 20rpx;
- width: 100%;
- background: #FFFFFF;
-
- .infoview {
- padding: 0 30rpx;
- width: 100%;
- height: 92rpx;
- display: flex;
- justify-content: space-between;
- border-bottom: 1rpx solid #E0E0E0;
-
- .infozuo {
- display: flex;
- align-items: center;
-
- .infozuochiud1 {
- font-size: 30rpx;
- font-weight: 600;
- color: #0C0C0C;
- }
-
- .infozuochiud2 {
- margin: 0 10rpx 0 0;
- padding: 5rpx 11rpx;
- border-radius: 50%;
- border: 1px solid #2671E2;
- font-size: 30rpx;
- font-weight: 400;
- color: #2671E2;
- }
- }
-
- .infoyou {
- height: 100%;
- display: flex;
- align-items: center;
-
- .infoyouchiud2 {
- font-size: 30rpx;
- color: #333;
- }
- }
- }
-
- .footerinfo {
- padding: 0 30rpx;
- width: 100%;
- height: 88rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-bottom: 1rpx solid #E0E0E0;
-
- .footerinfozuo {
- display: flex;
- align-items: center;
- font-size: 28rpx;
- color: #333;
-
- image {
- margin: 0 10rpx 0 0;
- width: 32rpx;
- height: 32rpx;
- }
- }
- }
-
- .footicon {
- padding: 0 80rpx;
- height: 88rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- .icon {
- display: flex;
- align-items: center;
- }
-
- image {
- margin-right: 10rpx;
- width: 32rpx;
- height: 32rpx;
- }
- }
- }
-
- }
-
- .biaoqianview {
- width: 100%;
- display: flex;
- height: calc(100vh - 80rpx - 50px);
-
- .boxintention {
- flex-shrink: 0;
- width: 160rpx;
- height: 100%;
- background: #F0F1F5;
-
- .boxcenten {
- width: 100%;
- height: 100rpx;
- background: #F0F1F5;
- display: flex;
-
- .boxcenteninfotext {
- width: 100%;
- height: 100%;
- text-indent: 20rpx;
- line-height: 100rpx;
- font-size: 30rpx;
- color: #0C0C0C;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- &.act {
- background: #fff;
- }
- }
- }
-
- .rside-scroll {
- flex-grow: 1;
- padding: 0 0 0 10rpx;
-
- .rside-box {
- display: flex;
- flex-direction: column;
-
- .ceninfo {
- position: relative;
- margin-top: 20rpx;
- width: 100%;
- background: #FFFFFF;
-
- .infoview {
- padding: 0 30rpx;
- width: 100%;
- height: 92rpx;
- display: flex;
- justify-content: space-between;
- border-bottom: 1rpx solid #E0E0E0;
-
- .infozuo {
- display: flex;
- align-items: center;
-
- .infozuochiud1 {
- font-size: 30rpx;
- font-weight: 600;
- color: #0C0C0C;
- }
-
- .infozuochiud2 {
- margin: 0 10rpx 0 0;
- padding: 5rpx 11rpx;
- border-radius: 50%;
- border: 1px solid #2671E2;
- font-size: 30rpx;
- font-weight: 400;
- color: #2671E2;
- }
- }
-
- .infoyou {
- height: 100%;
- display: flex;
- align-items: center;
-
- .infoyouchiud2 {
- font-size: 30rpx;
- color: #333;
- }
- }
- }
-
- .footerinfo {
- padding: 0 30rpx;
- width: 100%;
- height: 88rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-bottom: 1rpx solid #E0E0E0;
-
- .footerinfozuo {
- display: flex;
- align-items: center;
- font-size: 28rpx;
- color: #333;
-
- image {
- margin: 0 10rpx 0 0;
- width: 32rpx;
- height: 32rpx;
- }
- }
- }
-
- .footicon {
- padding: 0 80rpx;
- height: 88rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- .icon {
- display: flex;
- align-items: center;
- }
-
- image {
- margin-right: 10rpx;
- width: 32rpx;
- height: 32rpx;
- }
- }
- }
- }
- }
- }
-
- }
- </style>
|