Browse Source

Merge branch 'master' into HK

lsc 2 years ago
parent
commit
356406211f

File diff suppressed because it is too large
+ 3 - 1
dist/index.html


File diff suppressed because it is too large
+ 6 - 0
dist/report.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-566ac04a.6d7bb2f5.css


BIN
dist/static/img/askAndChoose.6f27c655.png


BIN
dist/static/img/formulaEdi.b6fd7103.png


BIN
dist/static/img/molStr.a170f76c.png


BIN
dist/static/img/timeAxis.62ad5c1e.png


BIN
dist/static/img/noImg.518119e3.png → dist/static/img/undeveloped.bf34befb.png


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.c5498d25.js


+ 1 - 0
dist/static/js/chunk-2bcf596a.45b618af.js

@@ -0,0 +1 @@
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2bcf596a"],{"03af":function(e,t,a){},"2dee":function(e,t,a){},"64fe":function(e,t,a){"use strict";var n=a("2dee"),c=a.n(n);c.a},7431:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"layout-content"},[e.$route.meta.keepAlive?a("keep-alive",[a("router-view")],1):a("router-view")],1),e._e()])},c=[],i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("van-tabbar",{attrs:{fixed:"",route:""},on:{change:e.handleChange},model:{value:e.active,callback:function(t){e.active=t},expression:"active"}},e._l(e.data,(function(t,n){return a("van-tabbar-item",{key:n,attrs:{to:t.to,icon:t.icon}},[e._v(" "+e._s(t.title)+" ")])})),1)],1)},o=[],r=(a("a9e3"),{name:"TabBar",props:{defaultActive:{type:Number,default:0},data:{type:Array,default:function(){return[]}}},data:function(){return{active:this.defaultActive}},methods:{handleChange:function(e){this.$emit("change",e)}}}),u=r,l=(a("cb41"),a("2877")),s=Object(l["a"])(u,i,o,!1,null,"70f5745f",null),f=s.exports,d={name:"AppLayout",data:function(){return{tabbars:[{title:"学习中心",to:{path:"/home"},icon:"home-o"}]}},components:{TabBar:f},methods:{handleChange:function(e){console.log("tab value:",e)}}},v=d,p=(a("64fe"),Object(l["a"])(v,n,c,!1,null,"232f728e",null));t["default"]=p.exports},cb41:function(e,t,a){"use strict";var n=a("03af"),c=a.n(n);c.a}}]);

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-566ac04a.8696a18a.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6637cd0c.cf58617c.js


+ 1 - 0
dist/static/js/chunk-7d027967.7d60579c.js

@@ -0,0 +1 @@
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7d027967"],{"6605e":function(e,t,r){},"9ed6":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"loginBox"},[r("iframe",{attrs:{src:"//edu.cocorobo.cn/course/login?type=2",frameborder:"0"}})])}],c=(r("96cf"),r("1da1")),o=r("5530"),u=r("2f62"),a={data:function(){return{redirect:void 0,timer:null}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:Object(o["a"])(Object(o["a"])({},Object(u["b"])({login:"user/login"})),{},{handleLogin:function(){this.$router.push({path:this.redirect||"/"})},getLogin:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.login();case 2:r=t.sent,r&&e.$router.push({path:e.redirect||"/"});case 4:case"end":return t.stop()}}),t)})))()}}),beforeDestroy:function(){clearInterval(this.timer),this.timer=null},mounted:function(){var e=this;this.getLogin(),this.timer=setInterval((function(){e.getLogin()}),2e3)}},s=a,l=(r("b792"),r("2877")),d=Object(l["a"])(s,n,i,!1,null,"4dc8186e",null);t["default"]=d.exports},b792:function(e,t,r){"use strict";var n=r("6605e"),i=r.n(n);i.a}}]);

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-c8697d60.00324023.js


+ 5 - 0
public/index.html

@@ -25,3 +25,8 @@
     <!-- built files will be auto injected -->
   </body>
 </html>
+<script>
+
+  document.domain = "cocorobo.cn"
+
+</script>

BIN
src/assets/images/tool/secondToolList/formulaEdi.png


BIN
src/assets/images/tool/secondToolList/molStr.png


BIN
src/assets/images/tool/secondToolList/timeAxis.png


BIN
src/assets/images/works/askAndChoose.png


BIN
src/assets/images/works/undeveloped.png


+ 149 - 137
src/const/index.js

@@ -1,138 +1,150 @@
 export const tools = {
-  1: {
-    name: '电子白板',
-    img: require('@/assets/images/tool/secondToolList/whiteBoard.png')
-  },
-  16: {
-    name: '作业提交',
-    img: require('@/assets/images/tool/thirdToolList/work.png')
-  },
-  10: {
-    name: '倒计时',
-    img: require('@/assets/images/tool/thirdToolList/time.png')
-  },
-  49: {
-    name: '学生分组',
-    img: require('@/assets/images/tool/fourthToolList/group.png')
-  },
-  7: {
-    name: '思维网格',
-    img: require('@/assets/images/tool/secondToolList/mindNetwork.png')
-  },
-  52: {
-    name: '文档',
-    img: require('@/assets/images/tool/fourthToolList/text.png')
-  },
-  3: {
-    name: '思维导图',
-    img: require('@/assets/images/tool/secondToolList/mindMapping.png')
-  },
-  4: {
-    name: '问卷调查',
-    img: require('@/assets/images/tool/thirdToolList/ask.png')
-  },
-  45: {
-    name: '选择题',
-    img: require('@/assets/images/tool/thirdToolList/choose.png')
-  },
-  15: {
-    name: '问答工具',
-    img: require('@/assets/images/tool/thirdToolList/answer.png')
-  },
-  50: {
-    name: '批量上传',
-    img: require('@/assets/images/tool/thirdToolList/plwork.png')
-  },
-  40: {
-    name: '个人评价',
-    img: require('@/assets/images/tool/thirdToolList/eval.png')
-  },
-  41: {
-    name: '选择填空',
-    img: require('@/assets/images/tool/thirdToolList/select.png')
-  },
-  47: {
-    name: '连词成句',
-    img: require('@/assets/images/tool/fourthToolList/conSentences.png')
-  },
-  48: {
-    name: '表格',
-    img: require('@/assets/images/tool/fourthToolList/table.png')
-  },
-  18: {
-    name: '训练平台',
-    img: require('@/assets/images/tool/thirdToolList/trainPlatform.png')
-  },
-  21: {
-    name: '编程平台',
-    img: require('@/assets/images/tool/fourthToolList/program.png')
-  },
-  22: {
-    name: 'AI体验',
-    img: require('@/assets/images/tool/fourthToolList/AIprogram2.png')
-  },
-  23: {
-    name: 'Python',
-    img: require('@/assets/images/tool/fourthToolList/Pythonprogram.png')
-  },
-  24: {
-    name: 'AI平台',
-    img: require('@/assets/images/tool/fourthToolList/AIprogram.png')
-  },
-  32: {
-    name: '源码编辑',
-    img: require('@/assets/images/tool/thirdToolList/code.png')
-  },
-  57: {
-    name: 'CocoPi',
-    img: require('@/assets/images/tool/fourthToolList/cocopi.png')
-  },
-  28: {
-    name: '翻译',
-    img: require('@/assets/images/tool/secondToolList/translation.png')
-  },
-  37: {
-    name: '魔盒识字',
-    img: require('@/assets/images/tool/secondToolList/mohe.png')
-  },
-  38: {
-    name: '24点',
-    img: require('@/assets/images/tool/secondToolList/24game.png')
-  },
-  31: {
-    name: '数学画板',
-    img: require('@/assets/images/tool/secondToolList/networkPanel.png')
-  },
-  39: {
-    name: 'GeoGebra',
-    img: require('@/assets/images/tool/secondToolList/GeoGebra.png')
-  },
-  58: {
-    name: '模拟驾驶',
-    img: require('@/assets/images/tool/fourthToolList/car.png')
-  },
-  59: {
-    name: '路径搜索',
-    img: require('@/assets/images/tool/fourthToolList/lineSearch.png')
-  },
-  60: {
-    name: '深度学习',
-    img: require('@/assets/images/tool/fourthToolList/deepLearning.png')
-  },
-  61: {
-    name: '全历史',
-    img: require('@/assets/images/tool/fourthToolList/allHistory.png')
-  },
-  26: {
-    name: '课程设计',
-    img: require('@/assets/images/tool/thirdToolList/courseDesign.png')
-  },
-  25: {
-    name: '目标管理',
-    img: require('@/assets/images/tool/thirdToolList/evalua.png')
-  },
-  63: {
-    name: '交互视频',
-    img: require('@/assets/images/tool/fourthToolList/interVideo.png')
-  }
-}
+    1: {
+        name: '电子白板',
+        img: require('@/assets/images/tool/secondToolList/whiteBoard.png')
+    },
+    16: {
+        name: '作业提交',
+        img: require('@/assets/images/tool/thirdToolList/work.png')
+    },
+    10: {
+        name: '倒计时',
+        img: require('@/assets/images/tool/thirdToolList/time.png')
+    },
+    49: {
+        name: '学生分组',
+        img: require('@/assets/images/tool/fourthToolList/group.png')
+    },
+    7: {
+        name: '思维网格',
+        img: require('@/assets/images/tool/secondToolList/mindNetwork.png')
+    },
+    52: {
+        name: '文档',
+        img: require('@/assets/images/tool/fourthToolList/text.png')
+    },
+    3: {
+        name: '思维导图',
+        img: require('@/assets/images/tool/secondToolList/mindMapping.png')
+    },
+    4: {
+        name: '问卷调查',
+        img: require('@/assets/images/tool/thirdToolList/ask.png')
+    },
+    45: {
+        name: '选择题',
+        img: require('@/assets/images/tool/thirdToolList/choose.png')
+    },
+    15: {
+        name: '问答工具',
+        img: require('@/assets/images/tool/thirdToolList/answer.png')
+    },
+    50: {
+        name: '批量上传',
+        img: require('@/assets/images/tool/thirdToolList/plwork.png')
+    },
+    40: {
+        name: '个人评价',
+        img: require('@/assets/images/tool/thirdToolList/eval.png')
+    },
+    41: {
+        name: '选择填空',
+        img: require('@/assets/images/tool/thirdToolList/select.png')
+    },
+    47: {
+        name: '连词成句',
+        img: require('@/assets/images/tool/fourthToolList/conSentences.png')
+    },
+    48: {
+        name: '表格',
+        img: require('@/assets/images/tool/fourthToolList/table.png')
+    },
+    18: {
+        name: '训练平台',
+        img: require('@/assets/images/tool/thirdToolList/trainPlatform.png')
+    },
+    21: {
+        name: '编程平台',
+        img: require('@/assets/images/tool/fourthToolList/program.png')
+    },
+    22: {
+        name: 'AI体验',
+        img: require('@/assets/images/tool/fourthToolList/AIprogram2.png')
+    },
+    23: {
+        name: 'Python',
+        img: require('@/assets/images/tool/fourthToolList/Pythonprogram.png')
+    },
+    24: {
+        name: 'AI平台',
+        img: require('@/assets/images/tool/fourthToolList/AIprogram.png')
+    },
+    32: {
+        name: '源码编辑',
+        img: require('@/assets/images/tool/thirdToolList/code.png')
+    },
+    57: {
+        name: 'CocoPi',
+        img: require('@/assets/images/tool/fourthToolList/cocopi.png')
+    },
+    28: {
+        name: '翻译',
+        img: require('@/assets/images/tool/secondToolList/translation.png')
+    },
+    37: {
+        name: '魔盒识字',
+        img: require('@/assets/images/tool/secondToolList/mohe.png')
+    },
+    38: {
+        name: '24点',
+        img: require('@/assets/images/tool/secondToolList/24game.png')
+    },
+    31: {
+        name: '数学画板',
+        img: require('@/assets/images/tool/secondToolList/networkPanel.png')
+    },
+    39: {
+        name: 'GeoGebra',
+        img: require('@/assets/images/tool/secondToolList/GeoGebra.png')
+    },
+    58: {
+        name: '模拟驾驶',
+        img: require('@/assets/images/tool/fourthToolList/car.png')
+    },
+    59: {
+        name: '路径搜索',
+        img: require('@/assets/images/tool/fourthToolList/lineSearch.png')
+    },
+    60: {
+        name: '深度学习',
+        img: require('@/assets/images/tool/fourthToolList/deepLearning.png')
+    },
+    61: {
+        name: '全历史',
+        img: require('@/assets/images/tool/fourthToolList/allHistory.png')
+    },
+    26: {
+        name: '课程设计',
+        img: require('@/assets/images/tool/thirdToolList/courseDesign.png')
+    },
+    25: {
+        name: '目标管理',
+        img: require('@/assets/images/tool/thirdToolList/evalua.png')
+    },
+    63: {
+        name: '交互视频',
+        img: require('@/assets/images/tool/fourthToolList/interVideo.png')
+    },
+    66: {
+        name: '公式编辑',
+        img: require('@/assets/images/tool/secondToolList/formulaEdi.png')
+    },
+    67: {
+        name: '分子结构',
+        img: require('@/assets/images/tool/secondToolList/molStr.png')
+    },
+    68: {
+        name: '时间轴',
+        img: require('@/assets/images/tool/secondToolList/timeAxis.png')
+    },
+}

+ 32 - 14
src/views/course/components/ImageComponent.vue

@@ -6,7 +6,7 @@
     </div>
     <div class="imgList">
       <div v-for="(item, index) in imgList" :key="index" class="imgItem">
-        <div class="itemImg" @click="previewImg(pptImgUrl1)">
+        <div class="itemImg" @click="previewImg(item)">
           <img :src="item" alt="" />
         </div>
         <div class="deleteImg" @click="deleteItem(item)">
@@ -19,9 +19,17 @@
 
 <script>
 export default {
+  props: {
+    imgList: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
   data() {
     return {
-      imgList: []
+      // imgList: []
     }
   },
   methods: {
@@ -34,7 +42,10 @@ export default {
       e.target.value = ''
     },
     deleteItem(i) {
-      this.imgList.splice(this.imgList.indexOf(i), 1)
+      const a = JSON.parse(JSON.stringify(this.imgList))
+      a.splice(a.indexOf(i), 1)
+      // this.imgList.splice(this.imgList.indexOf(i), 1)
+      this.$emit('update:imgList', a)
       this.$forceUpdate()
     },
     beforeUpload(event) {
@@ -42,10 +53,10 @@ export default {
       var credentials = {
         accessKeyId: 'AKIATLPEDU37QV5CHLMH',
         secretAccessKey: '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'
-      } //秘钥形式的登录上传
+      } // 秘钥形式的登录上传
       window.AWS.config.update(credentials)
-      window.AWS.config.region = 'cn-northwest-1' //设置区域
-      var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' } }) //选择桶
+      window.AWS.config.region = 'cn-northwest-1' // 设置区域
+      var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' }}) // 选择桶
       var _this = this
       if (file) {
         var params = {
@@ -58,7 +69,7 @@ export default {
           Body: file,
           'Access-Control-Allow-Credentials': '*',
           ACL: 'public-read'
-        } //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+        } // key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
         var options = {
           partSize: 2048 * 1024 * 1024,
           queueSize: 2,
@@ -66,15 +77,22 @@ export default {
         }
         bucket
           .upload(params, options)
-          .on('httpUploadProgress', function (evt) {
-            //这里可以写进度条
+          .on('httpUploadProgress', function(evt) {
+            // 这里可以写进度条
           })
-          .send(function (err, data) {
+          .send(function(err, data) {
             if (err) {
-              _this.$message.error('上传失败')
+              // _this.$message.error('上传失败')
             } else {
-              _this.imgList.push(data.Location)
-              _this.getImage(_this.imgList)
+              _this.$toast({
+                message: '上传成功',
+                type: 'success'
+              })
+              const a = JSON.parse(JSON.stringify(_this.imgList))
+              a.push(data.Location)
+              _this.$emit('update:imgList', a)
+
+              // _this.getImage(_this.imgList)
             }
           })
       }
@@ -136,4 +154,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 291 - 0
src/views/course/components/askPanel.vue

@@ -0,0 +1,291 @@
+<template>
+  <div class="cp-container" v-if="panelVisible">
+    <div class="cp-title">
+      <span class="back" @click="back"></span>
+      <span class="title" v-if="isTeacher">问卷调查作业</span>
+      <span class="title" v-else>问卷调查作业-{{ sStudent.student }}</span>
+      <span class="btn" v-if="type == 1" @click="addPz(type)">提交</span>
+    </div>
+    <div class="cp-box">
+      <div class="cp-quest">标题:{{ askJson.askTitle }}</div>
+      <div class="cp-conent" v-if="type == 1">
+        <div v-for="(item, index) in askJson.askCount" :key="index" class="askBox">
+          <div class="askTitle">
+            {{ index + 1 + '、' }}
+            <div>题目:{{ askJson.askJson[index].askstitle }}</div>
+          </div>
+          <img v-if="askJson.askJson[index].img" :src="askJson.askJson[index].img" />
+          <div class="askBody">
+            <el-radio-group
+              v-model="radio[index]"
+              v-if="askJson.askJson[index].type == '1' || !askJson.askJson[index].type"
+            >
+              <el-radio
+                v-for="(item1, checkIndex) in askJson.askJson[index].checkList"
+                :key="checkIndex"
+                :label="checkIndex"
+                class="redioStyle"
+                ><span v-html="item1"></span
+              ></el-radio>
+            </el-radio-group>
+            <el-checkbox-group v-model="radio[index]" v-if="askJson.askJson[index].type == '2'">
+              <el-checkbox
+                v-for="(item1, checkIndex) in askJson.askJson[index].checkList"
+                :key="checkIndex"
+                :label="checkIndex"
+                class="redioStyle"
+                ><span v-html="item1"></span>
+              </el-checkbox>
+            </el-checkbox-group>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { addCourseWorks, addCourseWorksTeacher } from '@/api/course'
+import { mapGetters } from 'vuex'
+
+export default {
+  props: {
+    panelVisible: {
+      type: Boolean
+    },
+    courseid: {
+      type: String,
+      default: ''
+    },
+    courseType: {
+      type: Number,
+      default: 0
+    },
+    taskCount: {
+      type: Number,
+      default: 0
+    },
+    toolindex: {
+      type: Number
+    },
+    isTeacher: {
+      type: Boolean
+    },
+    askJson: {
+      type: Object
+    },
+    sStudent: {
+      type: Object
+    }
+  },
+  components: {},
+  data() {
+    return {
+      type: 1,
+      message: '',
+      imgList: [],
+      radio: [],
+      askList: []
+    }
+  },
+  computed: {
+    ...mapGetters(['userinfo'])
+  },
+  mounted() {
+    for (var k = 0; k < this.askJson.askJson.length; k++) {
+      if (this.askJson.askJson[k].type == '2') {
+        this.radio.push([])
+      } else {
+        this.radio.push('')
+      }
+    }
+  },
+  methods: {
+    back() {
+      this.$emit('setAskPanelVisible', false)
+    },
+    setType(type) {
+      this.type = type
+    },
+    getImage(imgList) {
+      this.imgList = imgList
+      this.$forceUpdate()
+    },
+    addPz() {
+      if (!this.radio.length) {
+        this.$message.error('请选择选项')
+        return
+      }
+      for (var i = 0; i < this.askJson.askCount; i++) {
+        if ((this.radio[i] instanceof Array && !this.radio[i].length) || (this.radio[i] !== 0 && !this.radio[i])) {
+          this.$message.error('请选择选项')
+          return
+        }
+      }
+      const fun = [addCourseWorks, addCourseWorksTeacher]
+      const askList = [
+        {
+          askJson: this.askJson,
+          anwer: this.radio
+        }
+      ]
+      let params = []
+      if (this.isTeacher) {
+        params = [
+          {
+            uid: this.userinfo.userid,
+            cid: this.courseid,
+            stage: this.courseType,
+            task: this.taskCount,
+            tool: this.toolindex,
+            content: JSON.stringify(askList).replaceAll(/%/g, '%25'),
+            type: 2
+          }
+        ]
+      } else {
+        params = [
+          {
+            uid: this.sStudent.userid,
+            cid: this.courseid,
+            stage: this.courseType,
+            task: this.taskCount,
+            tool: this.toolindex,
+            content: JSON.stringify(askList),
+            type: 2,
+            ateacher: this.userinfo.userid
+          }
+        ]
+      }
+      fun[this.isTeacher ? 0 : 1](params)
+        .then(res => {
+          this.$toast({
+            message: '上传成功',
+            type: 'success'
+          })
+          this.$emit('setAskPanelVisible', false)
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.cp-container {
+  width: 100vw;
+  height: 100vh;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: #fff;
+  z-index: 2;
+  .cp-title {
+    height: 1.5rem;
+    width: 100%;
+    border-bottom: 1px solid #cecece;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    box-sizing: border-box;
+    position: relative;
+    .back {
+      width: 0.3rem;
+      height: 0.3rem;
+      border-top: 2px solid #000000;
+      border-left: 2px solid #000000;
+      position: absolute;
+      transform: rotate(-45deg) translateY(-50%);
+      top: 47%;
+      left: 0.8rem;
+      cursor: pointer;
+    }
+    .title {
+      font-size: 16px;
+    }
+    .btn {
+      font-size: 14px;
+      transform: translateY(-50%);
+      top: 50%;
+      right: 0.8rem;
+      position: absolute;
+      color: #2274ff;
+      cursor: pointer;
+    }
+  }
+  .cp-box {
+    width: 100%;
+    height: calc(100% - 1.5rem);
+    overflow: auto;
+    .type-nav {
+      height: 60px;
+      width: 100%;
+      display: flex;
+      align-items: center;
+      padding: 10px 0.3rem;
+      box-sizing: border-box;
+
+      .type-nav-box {
+        height: 100%;
+        opacity: 0.5;
+        transition: all 0.5s;
+
+        + .type-nav-box {
+          margin-left: 0.3rem;
+        }
+
+        &.active {
+          opacity: 1;
+        }
+        > img {
+          height: 100%;
+        }
+      }
+    }
+    .cp-quest {
+      width: 100%;
+      padding: 10px 15px;
+      font-size: 18px;
+      word-break: break-all;
+      box-sizing: border-box;
+    }
+    .cp-conent {
+      // margin-top: 10px;
+      height: auto;
+      overflow: auto;
+      font-size: 14px;
+      width: 100%;
+      /deep/ .van-field__control {
+        // height: auto !important;
+      }
+      .askBox {
+        padding: 0.26667rem 0.4rem;
+        .askTitle {
+          display: flex;
+        }
+        .askBody {
+          margin-top: 10px;
+          /deep/.redioStyle {
+            margin-bottom: 10px;
+            display: flex;
+            flex-direction: row;
+            flex-wrap: nowrap;
+            align-items: center;
+            .el-radio__label > span,
+            .el-checkbox__label > span {
+              word-break: break-all;
+              white-space: normal;
+            }
+          }
+        }
+      }
+    }
+    .cp-audio {
+      height: calc(100% - 60px);
+      position: relative;
+      width: 100%;
+    }
+  }
+}
+</style>

+ 383 - 0
src/views/course/components/choosePanel.vue

@@ -0,0 +1,383 @@
+<template>
+  <div class="cp-container" v-if="panelVisible">
+    <div class="cp-title">
+      <span class="back" @click="back"></span>
+      <span class="title" v-if="isTeacher">选择题作业</span>
+      <span class="title" v-else>选择题作业-{{ sStudent.student }}</span>
+      <span class="btn" v-if="type == 1" @click="addPz(type)">提交</span>
+    </div>
+    <div class="cp-box">
+      <div class="cp-conent" v-if="type == 1">
+        <div v-for="(item, index) in chooseJson.testJson.testCount" :key="index" class="askBox">
+          <div class="askTitle">
+            {{ index + 1 + '、' }}
+            <div v-if="chooseJson.testJson.testJson[index].type == '1'" style="margin-right: 5px; min-width: 70px">
+              (单选题)
+            </div>
+            <div v-if="chooseJson.testJson.testJson[index].type == '2'" style="margin-right: 5px; min-width: 70px">
+              (多选题)
+            </div>
+            <div>题目:{{ chooseJson.testJson.testJson[index].teststitle }}</div>
+          </div>
+          <img
+            v-if="chooseJson.testJson.testJson[index].img"
+            :src="chooseJson.testJson.testJson[index].img"
+            style="height: 300px; margin-top: 10px; max-width: 100%"
+          />
+          <div
+            class="timuImgBox"
+            v-if="chooseJson.testJson.testJson[index].timuList && chooseJson.testJson.testJson[index].timuList.length"
+          >
+            <div
+              v-for="(timg, tIndex) in chooseJson.testJson.testJson[index].timuList"
+              :key="tIndex"
+              class="timuImg"
+              @click.stop="previewImg(timg.src)"
+            >
+              <img :src="timg.src" alt="" />
+            </div>
+          </div>
+          <div class="askBody">
+            <el-radio-group v-model="radio[index]" v-if="chooseJson.testJson.testJson[index].type == '1'">
+              <div class="radioBox">
+                <el-radio
+                  v-for="(item1, checkIndex1) in chooseJson.testJson.testJson[index].checkList"
+                  :key="checkIndex1"
+                  :label="checkIndex1"
+                  class="redioStyle"
+                >
+                  <div style="margin-right: 10px" v-if="item1 && item1.imgType && item1.imgType == 1">
+                    <div class="inImg" @click.stop="previewImg(item1.src)">
+                      <img :src="item1.src" alt="" />
+                    </div>
+                  </div>
+                  <span v-else v-html="item1"></span>
+                </el-radio>
+              </div>
+            </el-radio-group>
+            <el-checkbox-group v-model="radio[index]" v-if="chooseJson.testJson.testJson[index].type == '2'">
+              <div class="radioBox">
+                <el-checkbox
+                  v-for="(item2, checkIndex2) in chooseJson.testJson.testJson[index].checkList"
+                  :key="checkIndex2"
+                  :label="checkIndex2"
+                  class="redioStyle"
+                >
+                  <div style="margin-right: 10px" v-if="item2 && item2.imgType && item2.imgType == 1">
+                    <div class="inImg" @click.stop="previewImg(item2.src)">
+                      <img :src="item2.src" alt="" />
+                    </div>
+                  </div>
+                  <span v-else v-html="item2"></span>
+                </el-checkbox>
+              </div>
+            </el-checkbox-group>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { addCourseWorks, addCourseWorksTeacher } from '@/api/course'
+import { mapGetters } from 'vuex'
+
+export default {
+  props: {
+    panelVisible: {
+      type: Boolean
+    },
+    courseid: {
+      type: String,
+      default: ''
+    },
+    courseType: {
+      type: Number,
+      default: 0
+    },
+    taskCount: {
+      type: Number,
+      default: 0
+    },
+    toolindex: {
+      type: Number
+    },
+    isTeacher: {
+      type: Boolean
+    },
+    chooseJson: {
+      type: Object
+    },
+    sStudent: {
+      type: Object
+    }
+  },
+  components: {},
+  data() {
+    return {
+      type: 1,
+      message: '',
+      imgList: [],
+      radio: [],
+      chooseList: []
+    }
+  },
+  computed: {
+    ...mapGetters(['userinfo'])
+  },
+  mounted() {
+    for (var k = 0; k < this.chooseJson.testJson.testJson.length; k++) {
+      if (this.chooseJson.testJson.testJson[k].type == '2') {
+        this.radio.push([])
+      } else {
+        this.radio.push('')
+      }
+    }
+  },
+  methods: {
+    back() {
+      this.$emit('setChoosePanelVisible', false)
+    },
+    previewImg(url) {
+      this.$hevueImgPreview(url)
+    },
+    setType(type) {
+      this.type = type
+    },
+    getImage(imgList) {
+      this.imgList = imgList
+      this.$forceUpdate()
+    },
+    addPz() {
+      if (!this.radio.length) {
+        this.$message.error('请选择选项')
+        return
+      }
+      for (var i = 0; i < this.chooseJson.testJson.testCount; i++) {
+        if ((this.radio[i] instanceof Array && !this.radio[i].length) || (this.radio[i] !== 0 && !this.radio[i])) {
+          this.$message.error('请选择选项')
+          return
+        }
+      }
+      const fun = [addCourseWorks, addCourseWorksTeacher]
+      const chooseList = [
+        {
+          testJson: this.chooseJson.testJson,
+          anwer: this.radio
+        }
+      ]
+      let params = []
+      if (this.isTeacher) {
+        params = [
+          {
+            uid: this.userinfo.userid,
+            cid: this.courseid,
+            stage: this.courseType,
+            task: this.taskCount,
+            tool: this.toolindex,
+            content: JSON.stringify(chooseList).replaceAll(/%/g, '%25'),
+            type: 8
+          }
+        ]
+      } else {
+        params = [
+          {
+            uid: this.sStudent.userid,
+            cid: this.courseid,
+            stage: this.courseType,
+            task: this.taskCount,
+            tool: this.toolindex,
+            content: JSON.stringify(chooseList),
+            type: 8,
+            ateacher: this.userinfo.userid
+          }
+        ]
+      }
+      fun[this.isTeacher ? 0 : 1](params)
+        .then(res => {
+          this.$toast({
+            message: '上传成功',
+            type: 'success'
+          })
+          this.$emit('setChoosePanelVisible', false)
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.cp-container {
+  width: 100vw;
+  height: 100vh;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: #fff;
+  z-index: 2;
+  .cp-title {
+    height: 1.5rem;
+    width: 100%;
+    border-bottom: 1px solid #cecece;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    box-sizing: border-box;
+    position: relative;
+    .back {
+      width: 0.3rem;
+      height: 0.3rem;
+      border-top: 2px solid #000000;
+      border-left: 2px solid #000000;
+      position: absolute;
+      transform: rotate(-45deg) translateY(-50%);
+      top: 47%;
+      left: 0.8rem;
+      cursor: pointer;
+    }
+    .title {
+      font-size: 16px;
+    }
+    .btn {
+      font-size: 14px;
+      transform: translateY(-50%);
+      top: 50%;
+      right: 0.8rem;
+      position: absolute;
+      color: #2274ff;
+      cursor: pointer;
+    }
+  }
+  .cp-box {
+    width: 100%;
+    height: calc(100% - 1.5rem);
+    overflow: auto;
+    .type-nav {
+      height: 60px;
+      width: 100%;
+      display: flex;
+      align-items: center;
+      padding: 10px 0.3rem;
+      box-sizing: border-box;
+
+      .type-nav-box {
+        height: 100%;
+        opacity: 0.5;
+        transition: all 0.5s;
+
+        + .type-nav-box {
+          margin-left: 0.3rem;
+        }
+
+        &.active {
+          opacity: 1;
+        }
+        > img {
+          height: 100%;
+        }
+      }
+    }
+    .cp-quest {
+      width: 100%;
+      padding: 10px 15px;
+      font-size: 18px;
+      word-break: break-all;
+      box-sizing: border-box;
+    }
+    .cp-conent {
+      // margin-top: 10px;
+      height: auto;
+      overflow: auto;
+      font-size: 14px;
+      width: 100%;
+      /deep/ .van-field__control {
+        // height: auto !important;
+      }
+      .askBox {
+        padding: 0.26667rem 0.4rem;
+        .askTitle {
+          display: flex;
+        }
+        .askBody {
+          margin-top: 10px;
+          /deep/.redioStyle {
+            margin-bottom: 10px;
+            display: flex;
+            flex-direction: row;
+            flex-wrap: nowrap;
+            align-items: center;
+            .el-radio__label > span,
+            .el-checkbox__label > span {
+              word-break: break-all;
+              white-space: normal;
+            }
+          }
+          .radioBox {
+            display: flex;
+            flex-direction: column;
+            flex-wrap: nowrap;
+            align-items: flex-start;
+          }
+
+          .radioBox > div {
+            margin: 10px 0 0 10px;
+          }
+
+          .radioBox >>> .el-radio__label,
+          .radioBox >>> .el-checkbox__label {
+            display: flex;
+            align-items: center;
+          }
+
+          .radioBox >>> .el-radio__label > span {
+            width: 100%;
+            display: -webkit-box;
+            overflow: hidden;
+            white-space: normal !important;
+            text-overflow: ellipsis;
+            word-wrap: break-word;
+          }
+          .inImg {
+            width: 100px;
+            cursor: pointer;
+          }
+
+          .inImg > img {
+            width: 100%;
+            height: 100%;
+            object-fit: cover;
+          }
+        }
+        .timuImgBox {
+          margin: 10px 0;
+          display: flex;
+          flex-direction: column;
+          flex-wrap: wrap;
+          align-items: flex-start;
+        }
+
+        .timuImg {
+          width: 150px;
+          margin: 5px 0;
+          cursor: pointer;
+        }
+
+        .timuImg > img {
+          width: 100%;
+          height: 100%;
+          object-fit: cover;
+        }
+      }
+    }
+    .cp-audio {
+      height: calc(100% - 60px);
+      position: relative;
+      width: 100%;
+    }
+  }
+}
+</style>

+ 5 - 3
src/views/course/components/commentPanel.vue

@@ -17,7 +17,7 @@
       <div class="cp-conent" v-if="type == 1">
         <van-field v-model="message" rows="20" autosize type="textarea" placeholder="请输入..." />
         <div>
-          <image-component @getImage="getImage"></image-component>
+          <image-component @getImage="getImage" :imgList.sync="imgList"></image-component>
         </div>
       </div>
       <div class="cp-audio" v-if="type == 2">
@@ -78,11 +78,11 @@ export default {
     },
     addPz(type, content) {
       var a = ''
-      if (type === 1 && this.message === '') {
+      if (type === 1 && this.message === '' && !this.imgList.length) {
         this.$toast({ message: '批注不能为空!', type: 'fail' })
         return
       }
-      if (type === 1 && this.message !== '') {
+      if (type === 1 && (this.message !== '' || this.imgList.length)) {
         var img = ''
         for (var i = 0; i < this.imgList.length; i++) {
           img += "<img src='" + this.imgList[i] + "' />"
@@ -106,6 +106,8 @@ export default {
             message: '添加成功',
             type: 'success'
           })
+          this.imgList = []
+          this.message = ''
           this.$emit('setPanelVisible', false)
         })
         .catch(err => {

+ 71 - 11
src/views/course/components/stepsBox.vue

@@ -116,6 +116,30 @@
       :answerQ="answerQ"
       :sStudent="sStudent"
     ></answerPanel>
+    <askPanel
+      v-if="askPanelVisible"
+      @setAskPanelVisible="setAskPanelVisible"
+      :panelVisible="askPanelVisible"
+      :courseid="courseid"
+      :courseType="courseType"
+      :taskCount="taskCount"
+      :toolindex="toolindex"
+      :isTeacher="isTeacher"
+      :askJson="askJson"
+      :sStudent="sStudent"
+    ></askPanel>
+    <choosePanel
+      v-if="choosePanelVisible"
+      @setChoosePanelVisible="setChoosePanelVisible"
+      :panelVisible="choosePanelVisible"
+      :courseid="courseid"
+      :courseType="courseType"
+      :taskCount="taskCount"
+      :toolindex="toolindex"
+      :isTeacher="isTeacher"
+      :chooseJson="chooseJson"
+      :sStudent="sStudent"
+    ></choosePanel>
   </div>
 </template>
 
@@ -134,6 +158,8 @@ import { tools } from '@/const/index'
 import Works from './works.vue'
 import { mapGetters } from 'vuex'
 import answerPanel from './answerPanel.vue'
+import askPanel from './askPanel.vue'
+import choosePanel from './choosePanel.vue'
 
 export default {
   props: {
@@ -170,11 +196,19 @@ export default {
     },
     answerPanelVisible: {
       type: Boolean
+    },
+    askPanelVisible: {
+      type: Boolean
+    },
+    choosePanelVisible: {
+      type: Boolean
     }
   },
   components: {
     Works,
-    answerPanel
+    answerPanel,
+    askPanel,
+    choosePanel
   },
   data() {
     return {
@@ -184,7 +218,7 @@ export default {
       noWorksS: [],
       isWorkTool: [16, 32, 57, 4, 45, 15, 1, 3, 6, 7, 26, 41, 47, 48, 52, 50, 40, 63], //, 49
       canWork: [16, 50], //, 49
-      canWork2: [15],
+      canWork2: [15,4,45],
       fileType: 0,
       tools: tools,
       proVisible: false,
@@ -196,7 +230,9 @@ export default {
       sStudent: {},
       isTeacher: false,
       toolindex: 0,
-      answerQ: ''
+      answerQ: '',
+      askJson: {},
+      chooseJson: {}
     }
   },
   watch: {
@@ -218,7 +254,17 @@ export default {
       if (!newValue) {
         this.getWorks()
       }
-    }
+    },
+    askPanelVisible(newValue) {
+      if (!newValue) {
+        this.getWorks()
+      }
+    },
+    choosePanelVisible(newValue) {
+      if (!newValue) {
+        this.getWorks()
+      }
+    },
   },
   computed: {
     ...mapGetters(['userinfo']),
@@ -236,6 +282,12 @@ export default {
     setPanelVisible(bool) {
       this.$emit('update:answerPanelVisible', bool)
     },
+    setAskPanelVisible(bool) {
+      this.$emit('update:askPanelVisible', bool)
+    },
+    setChoosePanelVisible(bool) {
+      this.$emit('update:choosePanelVisible', bool)
+    },
     arrayToArray(arrayo, arrayt) {
       const array1 = arrayo
       const array2 = arrayt
@@ -540,7 +592,7 @@ export default {
                     wid: works[j].id,
                     works: works[j].content,
                     sName: works[j].name,
-                    type: 2,
+                    type: 4,
                     time: works[j].time,
                     score: works[j].score,
                     img: works[j].img,
@@ -851,7 +903,7 @@ export default {
         window.AWS.config.region = 'cn-northwest-1' // 设置区域
 
         // eslint-disable-next-line prettier/prettier
-        var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' }}) // 选择桶
+        var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' } }) // 选择桶
         var _this = this
         _this.progress = 0
         _this.proVisible = true
@@ -888,13 +940,13 @@ export default {
           }
           bucket
             .upload(params, options)
-            .on('httpUploadProgress', function(evt) {
+            .on('httpUploadProgress', function (evt) {
               // 这里可以写进度条
               // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
               _this.progress = parseInt((evt.loaded / evt.total) * 100)
               _this.isFinishSize = (evt.loaded / 1024 / 1024).toFixed(2)
             })
-            .send(function(err, data) {
+            .send(function (err, data) {
               _this.progress = 100
               _this.isFinishSize = _this.isAllSize
               if (cfindex2 === files.length - 1 || cfindex2 > files.length - 1) {
@@ -1000,7 +1052,7 @@ export default {
       window.AWS.config.region = 'cn-northwest-1' // 设置区域
 
       // eslint-disable-next-line prettier/prettier
-      var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' }}) // 选择桶
+      var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' } }) // 选择桶
       var _this = this
       _this.progress = 0
       _this.proVisible = true
@@ -1034,13 +1086,13 @@ export default {
         }
         bucket
           .upload(params, options)
-          .on('httpUploadProgress', function(evt) {
+          .on('httpUploadProgress', function (evt) {
             // 这里可以写进度条
             // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
             _this.progress = parseInt((evt.loaded / evt.total) * 100)
             _this.isFinishSize = (evt.loaded / 1024 / 1024).toFixed(2)
           })
-          .send(function(err, data) {
+          .send(function (err, data) {
             _this.progress = 100
             _this.isFinishSize = _this.isAllSize
             setTimeout(() => {
@@ -1275,6 +1327,14 @@ export default {
         this.isTeacher = true
         this.answerQ = content.answerQ
         this.setPanelVisible(true)
+      } else if (tool === 4) {
+        this.isTeacher = true
+        this.askJson = content
+        this.setAskPanelVisible(true)
+      }else if(tool == 45){
+        this.isTeacher = true
+        this.chooseJson = content
+        this.setChoosePanelVisible(true)
       }
     }
   },

+ 261 - 4
src/views/course/components/works.vue

@@ -10,7 +10,15 @@
         <img src="@/assets/images/works/answerBgNew.png" alt="" />
         <div class="anwerBox">{{ JSON.parse(work.works)[0].answer }}</div>
       </div>
-      <div class="work" v-else><img src="@/assets/images/works/noImg.png" alt="" /></div>
+      <div class="work" @click="lookAnswer(work.works, work.type)" v-else-if="work.type == 4">
+        <img src="@/assets/images/works/askAndChoose.png" alt="" />
+      </div>
+      <div class="work" @click="lookAnswer(work.works, work.type)" v-else-if="work.type == 8">
+        <img src="@/assets/images/works/askAndChoose.png" alt="" />
+      </div>
+      <div class="work" @click="unDeveloped" v-else>
+        <img src="@/assets/images/works/undeveloped.png" alt="" />
+      </div>
     </div>
     <div class="s-name">
       <span>{{ work.sName }}</span>
@@ -32,13 +40,147 @@
       <div class="wrapper" @click.stop>
         <div class="answerBox">
           <div class="cancel" @click="overlayAnswerShow"></div>
-          <div class="box">
+          <div class="box" @touchmove.stop="">
             <div class="answerTitle">提问: {{ answerJson.answerTitle }}</div>
             <div class="answerContent">{{ answerJson.answer }}</div>
           </div>
         </div>
       </div>
     </van-overlay>
+    <van-overlay :show="askShow" @click="overlayAskShow" style="display: flex; align-items: center">
+      <div class="wrapper" @click.stop>
+        <div class="answerBox">
+          <div class="cancel" @click="overlayAskShow"></div>
+          <div class="box" v-if="Object.keys(askJson).length !== 0" @touchmove.stop="">
+            <div class="answerTitle">标题:{{ askJson.askJson.askTitle }}</div>
+            <div class="answerContent">
+              <div v-for="(item, index) in askJson.askJson.askCount" :key="index" class="askBox">
+                <div class="askT">
+                  {{ index + 1 + '、' }}
+                  <div>题目:{{ askJson.askJson.askJson[index].askstitle }}</div>
+                </div>
+                <img v-if="askJson.askJson.askJson[index].img" :src="askJson.askJson.askJson[index].img" />
+                <div class="askBody">
+                  <el-radio-group
+                    v-model="askRadio[index]"
+                    v-if="askJson.askJson.askJson[index].type == '1' || !askJson.askJson.askJson[index].type"
+                  >
+                    <el-radio
+                      v-for="(item1, checkIndex) in askJson.askJson.askJson[index].checkList"
+                      :key="checkIndex"
+                      :label="checkIndex"
+                      disabled
+                      class="redioStyle"
+                      ><span v-html="item1"></span
+                    ></el-radio>
+                  </el-radio-group>
+                  <el-checkbox-group v-model="askRadio[index]" v-if="askJson.askJson.askJson[index].type == '2'">
+                    <el-checkbox
+                      v-for="(item1, checkIndex) in askJson.askJson.askJson[index].checkList"
+                      :key="checkIndex"
+                      :label="checkIndex"
+                      disabled
+                      class="redioStyle"
+                      ><span v-html="item1"></span>
+                    </el-checkbox>
+                  </el-checkbox-group>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </van-overlay>
+    <van-overlay :show="chooseShow" @click="overlayChooseShow" style="display: flex; align-items: center">
+      <div class="wrapper" @click.stop>
+        <div class="answerBox">
+          <div class="cancel" @click="overlayChooseShow"></div>
+          <div class="box" v-if="Object.keys(chooseJson).length !== 0" @touchmove.stop="">
+            <div class="answerContent">
+              <div v-for="(item, index) in chooseJson.testJson.testCount" :key="index" class="askBox">
+                <div class="askTitle">
+                  {{ index + 1 + '、' }}
+                  <div
+                    v-if="chooseJson.testJson.testJson[index].type == '1'"
+                    style="margin-right: 5px; min-width: 70px"
+                  >
+                    (单选题)
+                  </div>
+                  <div
+                    v-if="chooseJson.testJson.testJson[index].type == '2'"
+                    style="margin-right: 5px; min-width: 70px"
+                  >
+                    (多选题)
+                  </div>
+                  <div>题目:{{ chooseJson.testJson.testJson[index].teststitle }}</div>
+                </div>
+                <img
+                  v-if="chooseJson.testJson.testJson[index].img"
+                  :src="chooseJson.testJson.testJson[index].img"
+                  style="height: 300px; margin-top: 10px; max-width: 100%"
+                />
+                <div
+                  class="timuImgBox"
+                  v-if="
+                    chooseJson.testJson.testJson[index].timuList && chooseJson.testJson.testJson[index].timuList.length
+                  "
+                >
+                  <div
+                    v-for="(timg, tIndex) in chooseJson.testJson.testJson[index].timuList"
+                    :key="tIndex"
+                    class="timuImg"
+                    @click.stop="previewImg(timg.src)"
+                  >
+                    <img :src="timg.src" alt="" />
+                  </div>
+                </div>
+                <div class="askBody">
+                  <el-radio-group v-model="chooseRadio[index]" v-if="chooseJson.testJson.testJson[index].type == '1'">
+                    <div class="radioBox">
+                      <el-radio
+                        v-for="(item1, checkIndex1) in chooseJson.testJson.testJson[index].checkList"
+                        :key="checkIndex1"
+                        :label="checkIndex1"
+                        disabled
+                        class="redioStyle"
+                      >
+                        <div style="margin-right: 10px" v-if="item1 && item1.imgType && item1.imgType == 1">
+                          <div class="inImg" @click.stop="previewImg(item1.src)">
+                            <img :src="item1.src" alt="" />
+                          </div>
+                        </div>
+                        <span v-else v-html="item1"></span>
+                      </el-radio>
+                    </div>
+                  </el-radio-group>
+                  <el-checkbox-group
+                    v-model="chooseRadio[index]"
+                    v-if="chooseJson.testJson.testJson[index].type == '2'"
+                  >
+                    <div class="radioBox">
+                      <el-checkbox
+                        v-for="(item2, checkIndex2) in chooseJson.testJson.testJson[index].checkList"
+                        :key="checkIndex2"
+                        :label="checkIndex2"
+                        disabled
+                        class="redioStyle"
+                      >
+                        <div style="margin-right: 10px" v-if="item2 && item2.imgType && item2.imgType == 1">
+                          <div class="inImg" @click.stop="previewImg(item2.src)">
+                            <img :src="item2.src" alt="" />
+                          </div>
+                        </div>
+                        <span v-else v-html="item2"></span>
+                      </el-checkbox>
+                    </div>
+                  </el-checkbox-group>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </van-overlay>
   </div>
 </template>
 
@@ -80,7 +222,13 @@ export default {
       show: false,
       playerO: {},
       answerShow: false,
-      answerJson: {}
+      askShow: false,
+      chooseShow: false,
+      answerJson: {},
+      askJson: {},
+      chooseJson: {},
+      askRadio: [],
+      chooseRadio: []
     }
   },
   computed: {
@@ -100,6 +248,9 @@ export default {
       // ImagePreview([src]);
       this.$hevueImgPreview({ url: src, clickMaskCLose: true })
     },
+    previewImg(url) {
+      this.$hevueImgPreview(url)
+    },
     mediaPreview(file) {
       console.log(file)
       this.show = true
@@ -113,11 +264,40 @@ export default {
     overlayAnswerShow() {
       this.answerShow = false
     },
+    overlayAskShow() {
+      this.askShow = false
+    },
+    overlayChooseShow() {
+      this.chooseShow = false
+    },
     onPlayerCanplay() {},
     onPlayerPlay() {},
     checkAnswer(work) {
       this.answerJson = JSON.parse(work)[0]
       this.answerShow = true
+    },
+    lookAnswer(work, t) {
+      var a = JSON.parse(work)[0]
+      if (t == 4) {
+        this.askJson = a
+        if (a.anwer instanceof Array) {
+          this.askRadio = a.anwer
+        } else {
+          this.askRadio.push(parseInt(a.anwer))
+        }
+        this.askShow = true
+      } else if (t == 8) {
+        this.chooseJson = a
+        if (a.anwer instanceof Array) {
+          this.chooseRadio = a.anwer
+        } else {
+          this.chooseRadio.push(parseInt(a.anwer))
+        }
+        this.chooseShow = true
+      }
+    },
+    unDeveloped() {
+      this.$toast('手机端暂不支持查看,请前往PC端查看。');
     }
   }
 }
@@ -127,7 +307,7 @@ export default {
 .work-container {
   max-width: 4.5rem;
   width: calc((100% - 20px) / 2);
-  overflow: hidden;
+  // overflow: hidden;
   height: 3rem;
   border-radius: 10px;
   box-shadow: rgb(223, 218, 218) 0px 0px 6px 1px;
@@ -214,6 +394,83 @@ export default {
           word-break: break-all;
           font-size: 18px;
           margin-top: 15px;
+          .askBox {
+            padding: 0.26667rem 0.4rem;
+            .askT,
+            .askTitle {
+              display: flex;
+            }
+            .askBody {
+              margin-top: 10px;
+              /deep/.redioStyle {
+                margin-bottom: 10px;
+                display: flex;
+                flex-direction: row;
+                flex-wrap: nowrap;
+                align-items: center;
+                .el-radio__label > span,
+                .el-checkbox__label > span {
+                  word-break: break-all;
+                  white-space: normal;
+                }
+              }
+
+              .radioBox {
+                display: flex;
+                flex-direction: column;
+                flex-wrap: nowrap;
+                align-items: flex-start;
+              }
+
+              .radioBox > div {
+                margin: 10px 0 0 10px;
+              }
+
+              .radioBox >>> .el-radio__label,
+              .radioBox >>> .el-checkbox__label {
+                display: flex;
+                align-items: center;
+              }
+
+              .radioBox >>> .el-radio__label > span {
+                width: 100%;
+                display: -webkit-box;
+                overflow: hidden;
+                white-space: normal !important;
+                text-overflow: ellipsis;
+                word-wrap: break-word;
+              }
+              .inImg {
+                width: 100px;
+                cursor: pointer;
+              }
+
+              .inImg > img {
+                width: 100%;
+                height: 100%;
+                object-fit: cover;
+              }
+            }
+            .timuImgBox {
+              margin: 10px 0;
+              display: flex;
+              flex-direction: column;
+              flex-wrap: wrap;
+              align-items: flex-start;
+            }
+
+            .timuImg {
+              width: 150px;
+              margin: 5px 0;
+              cursor: pointer;
+            }
+
+            .timuImg > img {
+              width: 100%;
+              height: 100%;
+              object-fit: cover;
+            }
+          }
         }
       }
     }

+ 6 - 2
src/views/course/index.vue

@@ -12,7 +12,7 @@
       </template>
     </head-bar>
     <div class="course-box" ref="cBox">
-      <van-pull-refresh v-model="isLoading" @refresh="onRefresh" :disabled="panelVisible || answerPanelVisible">
+      <van-pull-refresh v-model="isLoading" @refresh="onRefresh" :disabled="panelVisible || answerPanelVisible || askPanelVisible">
         <course-title :chapInfo="chapInfo" :courseType="courseType" :taskCount="taskCount"></course-title>
         <course-content-list v-if="false"></course-content-list>
         <div class="course-type-box">
@@ -31,6 +31,8 @@
           <steps-box
             v-show="type == 1"
             :answerPanelVisible.sync="answerPanelVisible"
+            :askPanelVisible.sync="askPanelVisible"
+            :choosePanelVisible.sync="choosePanelVisible"
             :courseDetail="courseDetail"
             :chapInfo="chapInfo"
             :courseType="courseType"
@@ -115,7 +117,9 @@ export default {
       navVisible: false,
       isLoading: false,
       panelVisible: false,
-      answerPanelVisible: false
+      answerPanelVisible: false,
+      askPanelVisible:false,
+      choosePanelVisible:false
     }
   },
   methods: {

Some files were not shown because too many files changed in this diff