|
@@ -68,26 +68,31 @@
|
|
|
pb50px: type != 'exam',
|
|
|
}"
|
|
|
>
|
|
|
- <span class="problem-type">{{
|
|
|
+ <!-- <text class="problem-type">{{
|
|
|
problemList[problemListIndex].questionType | questionType
|
|
|
- }}</span>
|
|
|
+ }}</text>
|
|
|
<text
|
|
|
style="background: #9c5fed"
|
|
|
v-if="problemList[problemListIndex].isNew"
|
|
|
class="problem-type"
|
|
|
>新规题</text
|
|
|
- >
|
|
|
+ > -->
|
|
|
<!-- <text>{{ problemListIndex + 1 }}、</text> -->
|
|
|
- <text class="problem-issue"
|
|
|
+ <rich-text style="font-size: 42rpx; vertical-align: top" :nodes="createProblemTypeHtml(problemList[problemListIndex]) +
|
|
|
+ (problemListIndex + 1) +
|
|
|
+ '、' +
|
|
|
+ problemList[problemListIndex].issue
|
|
|
+ "></rich-text>
|
|
|
+ <!-- <text class="problem-issue"
|
|
|
>{{ problemListIndex + 1 }}、{{
|
|
|
problemList[problemListIndex].issue
|
|
|
}}</text
|
|
|
- >
|
|
|
+ > -->
|
|
|
<view v-if="problemList[problemListIndex].image" class="problem-img">
|
|
|
- <image
|
|
|
- mode="widthFix"
|
|
|
- :src="problemList[problemListIndex].image"
|
|
|
- ></image>
|
|
|
+ <image mode="widthFix" v-if="getFileType(problemList[problemListIndex].image) == 'image'"
|
|
|
+ :src="problemList[problemListIndex].image"></image>
|
|
|
+ <video :controls="false" autoplay loop v-if="getFileType(problemList[problemListIndex].image) == 'video'"
|
|
|
+ :src="problemList[problemListIndex].image"></video>
|
|
|
</view>
|
|
|
<view v-if="!hiddenFunction" class="funcicon-list">
|
|
|
<view
|
|
@@ -1033,6 +1038,41 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ getFileType(src) {
|
|
|
+ let suffix = src.substring(src.lastIndexOf(".") + 1);
|
|
|
+ let type = "";
|
|
|
+ switch (suffix) {
|
|
|
+ case "mp4":
|
|
|
+ case "WebM":
|
|
|
+ case "Ogg":
|
|
|
+ type = "video";
|
|
|
+ break;
|
|
|
+ case "png":
|
|
|
+ case "jpg":
|
|
|
+ case "webp":
|
|
|
+ type = "image";
|
|
|
+ break;
|
|
|
+ case "pdf":
|
|
|
+ type = "pdf";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ type = "other";
|
|
|
+ }
|
|
|
+ return type;
|
|
|
+ },
|
|
|
+ createProblemTypeHtml(item) {
|
|
|
+ let html = ''
|
|
|
+ //#9c5fed
|
|
|
+ html = item.isNew?'<span style="font-size: 11px;color: #fff;background:#9c5fed;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">新规题</span>':''
|
|
|
+ if (item.questionType == 1) {
|
|
|
+ return html+'<span style="font-size: 11px;color: #fff;background: #2878ff;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">判断题</span>';
|
|
|
+ } else if(item.questionType==2){
|
|
|
+ return html+'<span style="font-size: 11px;color: #fff;background: #2878ff;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">选择题</span>';
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return html+'<span style="font-size: 11px;color: #fff;background: #2878ff;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">多选题</span>';
|
|
|
+ }
|
|
|
+ },
|
|
|
getUseTime(leftTime, useTime) {
|
|
|
this.useTime = useTime;
|
|
|
},
|