31 44
This commit is contained in:
		@@ -5,8 +5,8 @@
 | 
			
		||||
      <u-tabs :list="tabs" font-size="32" bg-color="#f3f5f7" inactive-color="#999999"
 | 
			
		||||
     :active-item-style="{color: '#222222'}" :is-scroll="true" :current="currIndex" @change="(i) => (currIndex = i)"> </u-tabs>
 | 
			
		||||
    </div>
 | 
			
		||||
    <OnlineClass ref="OnlineClass" @toDetail="toDetail" v-show="currIndex == 0"></OnlineClass>
 | 
			
		||||
    <GeneralLawExam ref="GeneralLawExam" @toTest="toTest" v-show="currIndex == 1"></GeneralLawExam>
 | 
			
		||||
    <OnlineClass ref="OnlineClass" :height="height" @toDetail="toDetail" v-show="currIndex == 0"></OnlineClass>
 | 
			
		||||
    <GeneralLawExam ref="GeneralLawExam" :height="height" @toTest="toTest" v-show="currIndex == 1"></GeneralLawExam>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -19,7 +19,7 @@ export default {
 | 
			
		||||
  customNavigation: true,
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      currIndex: 0,
 | 
			
		||||
      currIndex: 1,
 | 
			
		||||
      tabs: [
 | 
			
		||||
        {
 | 
			
		||||
          name: '在线课堂',
 | 
			
		||||
@@ -28,6 +28,8 @@ export default {
 | 
			
		||||
          name: '普法考试',
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      screenHeight: 0,
 | 
			
		||||
      height: 0,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  onShow() {
 | 
			
		||||
@@ -37,6 +39,11 @@ export default {
 | 
			
		||||
      this.$refs.GeneralLawExam.getList();
 | 
			
		||||
      this.$refs.GeneralLawExam.getUserInfo()
 | 
			
		||||
    }
 | 
			
		||||
    uni.getSystemInfo({
 | 
			
		||||
      success: (res)=> {
 | 
			
		||||
        this.screenHeight = res.screenHeight
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  },
 | 
			
		||||
  components: {
 | 
			
		||||
    OnlineClass,
 | 
			
		||||
@@ -52,6 +59,11 @@ export default {
 | 
			
		||||
          this.$refs.GeneralLawExam.getUserInfo()
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    screenHeight(v) {
 | 
			
		||||
      if(v) {
 | 
			
		||||
        this.height = this.screenHeight - 230
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="classDetail">
 | 
			
		||||
    <u-navbar title="在线课堂" background="#f4f6fa"></u-navbar>
 | 
			
		||||
    <u-navbar title="在线课堂" background="#fff"></u-navbar>
 | 
			
		||||
 | 
			
		||||
    <div class="media">
 | 
			
		||||
      <img :src="data.pictureUrl" alt="" v-if="data.courseType == 0">
 | 
			
		||||
 
 | 
			
		||||
@@ -5,9 +5,9 @@
 | 
			
		||||
      :show-action="false" @search="getList" @clear="title='',getList()"></u-search>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <p class="all_test">全部考试</p>
 | 
			
		||||
    <p class="all_test">全部考试{{height}}</p>
 | 
			
		||||
    <div class="card_list" v-if="testList.length">
 | 
			
		||||
      <scroll-view class="scroll_box" scroll-y>
 | 
			
		||||
      <scroll-view :style="{height: height + 'px'}" scroll-y>
 | 
			
		||||
        <div class="card" v-for="item in testList" :key="item.id">
 | 
			
		||||
          <div class="card_top">
 | 
			
		||||
            <div class="card_title">{{ item.examinationName }}</div>
 | 
			
		||||
@@ -62,6 +62,9 @@
 | 
			
		||||
<script>
 | 
			
		||||
import { mapState } from "vuex"
 | 
			
		||||
export default {
 | 
			
		||||
  props: {
 | 
			
		||||
    height: Number,
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      showAuth: false,
 | 
			
		||||
@@ -76,7 +79,6 @@ export default {
 | 
			
		||||
      flag: false,
 | 
			
		||||
      current: 1,
 | 
			
		||||
      testList: [],
 | 
			
		||||
      height: '',
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
@@ -172,10 +174,6 @@ export default {
 | 
			
		||||
    padding: 8px 32px;
 | 
			
		||||
    box-sizing: border-box;
 | 
			
		||||
 | 
			
		||||
    .scroll_box {
 | 
			
		||||
      height: calc(100% - 230px);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .card {
 | 
			
		||||
      margin-top: 24px;
 | 
			
		||||
      .card_top,
 | 
			
		||||
 
 | 
			
		||||
@@ -7,18 +7,20 @@
 | 
			
		||||
    <p class="all_class">全部课程</p>
 | 
			
		||||
 | 
			
		||||
    <div class="card_list" v-if="classList.length">
 | 
			
		||||
      <div class="card" v-for="item in classList" :key="item.id" @click="handleToDetail(item.id)">
 | 
			
		||||
        <div class="card_left">
 | 
			
		||||
          <img :src="item.pictureUrl" alt="">
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="card_right">
 | 
			
		||||
          <div class="title">{{ item.title }}</div>
 | 
			
		||||
          <div class="num">
 | 
			
		||||
            <div>{{ item.learnerNumber }}人已学习</div>
 | 
			
		||||
            <div v-if="item.videoDuration">视频时长{{ item.videoDuration }}</div>
 | 
			
		||||
      <scroll-view :style="{height: height + 'px'}" scroll-y>
 | 
			
		||||
        <div class="card" v-for="item in classList" :key="item.id" @click="handleToDetail(item.id)">
 | 
			
		||||
          <div class="card_left">
 | 
			
		||||
            <img :src="item.pictureUrl" alt="">
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="card_right">
 | 
			
		||||
            <div class="title">{{ item.title }}</div>
 | 
			
		||||
            <div class="num">
 | 
			
		||||
              <div>{{ item.learnerNumber }}人已学习</div>
 | 
			
		||||
              <div v-if="item.videoDuration">视频时长{{ item.videoDuration }}</div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      </scroll-view>
 | 
			
		||||
    </div>
 | 
			
		||||
    <AiEmpty :description="`暂无数据`" class="emptyWrap" v-else/>
 | 
			
		||||
  </div>
 | 
			
		||||
@@ -26,6 +28,9 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  props: {
 | 
			
		||||
    height: Number,
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      current: 1,
 | 
			
		||||
@@ -33,10 +38,6 @@ export default {
 | 
			
		||||
      classList: [],
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  onLoad() {
 | 
			
		||||
    
 | 
			
		||||
  },
 | 
			
		||||
  
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      this.$instance.post(`/app/appcourseinfo/listByApplet`, null, {
 | 
			
		||||
 
 | 
			
		||||
@@ -9,26 +9,22 @@
 | 
			
		||||
            <div><span class="col_blue">{{ activeIndex + 1 }}</span>/{{ list.length }}</div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="topic">
 | 
			
		||||
            <div>
 | 
			
		||||
              <div >
 | 
			
		||||
                <!-- 题目 -->
 | 
			
		||||
                <div>{{ item.title }}</div>
 | 
			
		||||
                <!-- 单选,判断 -->
 | 
			
		||||
                <div class="answer_list" v-if="item.type==0 || item.type==2">
 | 
			
		||||
                  <div class="answer_item" v-for="(opt,inx) in item.items" :key="inx"
 | 
			
		||||
                  :class="{'Checked': clickIndex === inx, 'Succeed': showAnalysis && opt.checked == 1, 'Error': showAnalysis && clickIndex === inx && opt.checked == 0}"
 | 
			
		||||
                  @click="itemClick(inx)">
 | 
			
		||||
                    {{ opt.sort }}: {{ opt.content}}
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <!-- 多选 -->
 | 
			
		||||
                <div class="answer_list" v-if="item.type==1">
 | 
			
		||||
                  <div class="answer_item" v-for="(opt,inx) in item.items" :key="inx"
 | 
			
		||||
                  :class="{'Checked': opt.isChecked,'Succeed': showAnalysis && opt.checked == 1, 'Error': showAnalysis && opt.isChecked && opt.checked == 0}"
 | 
			
		||||
                  @click="itemClick(inx)">
 | 
			
		||||
                    {{ opt.sort }}: {{ opt.content}}
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            <!-- 题目 -->
 | 
			
		||||
            <div>{{ item.title }}</div>
 | 
			
		||||
            <!-- 单选,判断 -->
 | 
			
		||||
            <div class="answer_list" v-if="item.type==0 || item.type==2">
 | 
			
		||||
              <div class="answer_item" v-for="(opt,inx) in item.items" :key="inx"
 | 
			
		||||
              :class="{'Checked': clickIndex === inx, 'Succeed': showAnalysis && opt.checked == 1, 'Error': showAnalysis && clickIndex === inx && opt.checked == 0}"
 | 
			
		||||
              @click="itemClick(inx)">
 | 
			
		||||
                {{ opt.sort }}: {{ opt.content}}
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <!-- 多选 -->
 | 
			
		||||
            <div class="answer_list" v-if="item.type==1">
 | 
			
		||||
              <div class="answer_item" v-for="(opt,inx) in item.items" :key="inx"
 | 
			
		||||
              :class="{'Checked': opt.isChecked,'Succeed': showAnalysis && opt.checked == 1, 'Error': showAnalysis && opt.isChecked && opt.checked == 0}"
 | 
			
		||||
              @click="itemClick(inx)">
 | 
			
		||||
                {{ opt.sort }}: {{ opt.content}}
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
@@ -42,11 +38,9 @@
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div class="btn" @click="nextTopic" v-if="activeIndex < list.length - 1 && showNext">下一题</div>
 | 
			
		||||
      <div class="btn" v-show="showConfirm" @click="confirm">确定</div>
 | 
			
		||||
      <div class="btn" v-show="showTiJiao" @click="submit">提交</div>
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
    
 | 
			
		||||
  </div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user