askbot-dragon 1.7.91-beta → 1.7.93-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
/> -->
|
|
14
14
|
<video
|
|
15
15
|
controls="controls"
|
|
16
|
-
:controlslist="
|
|
16
|
+
:controlslist="controlAttributes"
|
|
17
17
|
:raw-controls="true"
|
|
18
18
|
x5-video-player-type="h5-page"
|
|
19
19
|
style="object-fit: contain;width: calc(100vw - 139px);height: 160px;background-color: black;border-radius: 10px;max-width: 230px;padding-left: 10px"
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
return {
|
|
43
43
|
videoSrc:'',
|
|
44
44
|
poster:'',
|
|
45
|
-
isFullscreen:false
|
|
45
|
+
isFullscreen:false,
|
|
46
|
+
isAndroid:false
|
|
46
47
|
}
|
|
47
48
|
},
|
|
48
49
|
watch: {
|
|
@@ -56,6 +57,13 @@
|
|
|
56
57
|
},
|
|
57
58
|
src() {
|
|
58
59
|
return this.url ? this.url : this.localUrl;
|
|
60
|
+
},
|
|
61
|
+
controlAttributes(){
|
|
62
|
+
/* 安卓手机自定义了全屏样式,所以禁掉原生的全屏 */
|
|
63
|
+
const attributes = []
|
|
64
|
+
if (this.isAndroid) attributes.push('nofullscreen')
|
|
65
|
+
if (this.nodownload&&'nodownload') attributes.push('nodownload')
|
|
66
|
+
return attributes.join(' ')
|
|
59
67
|
}
|
|
60
68
|
},
|
|
61
69
|
mounted() {
|
|
@@ -73,6 +81,7 @@
|
|
|
73
81
|
const videoContainer = document.getElementById(containerId);
|
|
74
82
|
// 仅在 Android 设备尝试自动全屏
|
|
75
83
|
const isAndroid = /Android/i.test(navigator.userAgent);
|
|
84
|
+
this.isAndroid = isAndroid;
|
|
76
85
|
if (isAndroid){
|
|
77
86
|
video.addEventListener('play', () => {
|
|
78
87
|
// 仅在全屏请求由用户触发时有效(如点击播放按钮后)
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="imageSelectionAnswer">
|
|
3
|
+
<div class="imageSelectionText" v-if="msg.content.prompt">
|
|
4
|
+
{{msg.content.prompt}}
|
|
5
|
+
</div>
|
|
6
|
+
<div class="imageList">
|
|
7
|
+
<div class="imageItem"
|
|
8
|
+
v-for="(item,index) in msg.content.options"
|
|
9
|
+
:key="index"
|
|
10
|
+
:class="disabled ? 'disabledItem' : ''"
|
|
11
|
+
>
|
|
12
|
+
<el-image
|
|
13
|
+
style="width: 60px; height: 60px"
|
|
14
|
+
:src="item.url"
|
|
15
|
+
fit="cover">
|
|
16
|
+
</el-image>
|
|
17
|
+
<div class="checkIcon"
|
|
18
|
+
:class="checkImage === item.url ? 'activeCheckIcon' : 'noCheckIcon'"
|
|
19
|
+
@click="selectImage(item)"
|
|
20
|
+
>
|
|
21
|
+
<div class="centerIcon" v-if="checkImage === item.url">
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="answerButton" :class="disabled ? 'disabledButton' : ''">
|
|
27
|
+
<div class="buttonText"
|
|
28
|
+
v-for="(item,index) in msg.content.buttonList"
|
|
29
|
+
:key="index"
|
|
30
|
+
@click="imageSelectionConfirm"
|
|
31
|
+
>
|
|
32
|
+
{{ item.name }}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
export default {
|
|
40
|
+
name: "imageSelectionAnswer",
|
|
41
|
+
data(){
|
|
42
|
+
return{
|
|
43
|
+
checkImage:""
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
props:{
|
|
47
|
+
answer:{
|
|
48
|
+
type:Object,
|
|
49
|
+
default(){
|
|
50
|
+
return{}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
disabled:{
|
|
54
|
+
type:Boolean,
|
|
55
|
+
default:false
|
|
56
|
+
},
|
|
57
|
+
msg:{
|
|
58
|
+
type:Object,
|
|
59
|
+
default(){
|
|
60
|
+
return{}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
methods:{
|
|
65
|
+
selectImage(item){
|
|
66
|
+
if (this.disabled){
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
this.checkImage = item.url;
|
|
70
|
+
this.$emit('selectImage',item)
|
|
71
|
+
},
|
|
72
|
+
imageSelectionConfirm(){
|
|
73
|
+
if (this.disabled){
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
this.$emit('imageSelectionConfirm',this.msg,this.checkImage)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style scoped lang="less">
|
|
83
|
+
.imageSelectionAnswer{
|
|
84
|
+
.imageSelectionText{
|
|
85
|
+
padding-bottom: 10px;
|
|
86
|
+
}
|
|
87
|
+
.imageList{
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: flex-start;
|
|
91
|
+
flex-wrap: wrap;
|
|
92
|
+
background-color: #ffffff;
|
|
93
|
+
.imageItem{
|
|
94
|
+
position: relative;
|
|
95
|
+
margin-right: 10px;
|
|
96
|
+
margin-bottom: 5px;
|
|
97
|
+
margin-top: 5px;
|
|
98
|
+
.checkIcon{
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: 0;
|
|
101
|
+
right: 0;
|
|
102
|
+
width: 15px;
|
|
103
|
+
height: 15px;
|
|
104
|
+
border-radius: 8px;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
flex: none;
|
|
109
|
+
}
|
|
110
|
+
.activeCheckIcon{
|
|
111
|
+
background: #366AFF;
|
|
112
|
+
border: 1px solid #366AFF;
|
|
113
|
+
.centerIcon{
|
|
114
|
+
width: 6px;
|
|
115
|
+
height: 6px;
|
|
116
|
+
background: #FFFFFF;
|
|
117
|
+
border-radius: 50%;
|
|
118
|
+
flex: none;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.noCheckIcon{
|
|
122
|
+
background: #FFFFFF;
|
|
123
|
+
border: 1px solid #EBEDF4;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
.answerButton{
|
|
128
|
+
padding: 10px 0;
|
|
129
|
+
width: 100%;
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
.buttonText{
|
|
134
|
+
padding: 0 4px;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
.disabledItem{
|
|
139
|
+
.checkIcon{
|
|
140
|
+
background-color: #edf2fc!important;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
.disabledButton{
|
|
145
|
+
border-top: 1px solid #EEEEEE;
|
|
146
|
+
.buttonText{
|
|
147
|
+
color: #A9B3C6;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</style>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="multipleChoiceAnswer">
|
|
3
|
+
<div class="multipleText" v-if="msg.content.prompt">
|
|
4
|
+
{{msg.content.prompt}}
|
|
5
|
+
</div>
|
|
6
|
+
<div class="multipleList" :class="msg.content.options && msg.content.options.length == 0 ? 'disabledMultiple' : ''">
|
|
7
|
+
<el-checkbox-group v-model="checkList">
|
|
8
|
+
<el-checkbox
|
|
9
|
+
:label="item._metadata.id"
|
|
10
|
+
v-for="item in msg.content.options"
|
|
11
|
+
:key="item._metadata.id"
|
|
12
|
+
:disabled="disabled"
|
|
13
|
+
>
|
|
14
|
+
<el-avatar :size="16" :src="item.url" style="margin-right: 4px;flex: none"></el-avatar>
|
|
15
|
+
{{ item.text }}
|
|
16
|
+
</el-checkbox>
|
|
17
|
+
</el-checkbox-group>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="answerButton" :class="disabled ? 'disabledButton' : ''">
|
|
20
|
+
<div class="buttonText"
|
|
21
|
+
v-for="(item,index) in msg.content.buttonList"
|
|
22
|
+
:key="index"
|
|
23
|
+
@click="multipleChoiceConfirm"
|
|
24
|
+
>
|
|
25
|
+
{{ item.name }}
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
export default {
|
|
33
|
+
name: "multipleChoiceAnswer",
|
|
34
|
+
data(){
|
|
35
|
+
return{
|
|
36
|
+
checkList:[]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
props:{
|
|
40
|
+
disabled:{
|
|
41
|
+
type:Boolean,
|
|
42
|
+
default:false
|
|
43
|
+
},
|
|
44
|
+
msg:{
|
|
45
|
+
type:Object,
|
|
46
|
+
default(){
|
|
47
|
+
return{}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
methods:{
|
|
52
|
+
multipleChoiceConfirm(){
|
|
53
|
+
if (this.disabled){
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
this.$emit('multipleChoiceConfirm',this.msg,this.checkList)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<style scoped lang="less">
|
|
63
|
+
.multipleChoiceAnswer{
|
|
64
|
+
.multipleText{
|
|
65
|
+
margin-bottom: 10px;
|
|
66
|
+
}
|
|
67
|
+
.multipleList{
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-items: flex-start;
|
|
70
|
+
border-bottom: 1px solid #EEEEEE;
|
|
71
|
+
padding: 8px 0;
|
|
72
|
+
background-color: #ffffff;
|
|
73
|
+
/deep/.el-checkbox-group{
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
.el-checkbox{
|
|
78
|
+
margin-right: 0!important;
|
|
79
|
+
margin-bottom: 10px;
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
.el-checkbox__label{
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
color: #000000;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
.answerButton{
|
|
91
|
+
padding: 10px 0;
|
|
92
|
+
width: 100%;
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
.buttonText{
|
|
97
|
+
padding: 0 4px;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
.disabledMultiple{
|
|
103
|
+
/deep/.el-checkbox__input{
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
/deep/.el-checkbox__label{
|
|
107
|
+
padding-left: 0;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
.disabledButton{
|
|
111
|
+
.buttonText{
|
|
112
|
+
color: #A9B3C6;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="singleChoiceAnswer">
|
|
3
|
+
<div class="singleChoiceText" v-if="msg.content.prompt">
|
|
4
|
+
{{msg.content.prompt}}
|
|
5
|
+
</div>
|
|
6
|
+
<div class="optionsList">
|
|
7
|
+
<div
|
|
8
|
+
v-for="(option, index) in msg.content.options"
|
|
9
|
+
class="optionsItem"
|
|
10
|
+
:key="index"
|
|
11
|
+
@click="handleClick(option)"
|
|
12
|
+
>
|
|
13
|
+
<span> {{ option.text }}</span>
|
|
14
|
+
<i class="arsenal_icon arsenalangle-right-solid"></i>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
name: "singleChoiceAnswer",
|
|
23
|
+
props:{
|
|
24
|
+
msg:{
|
|
25
|
+
type:Object,
|
|
26
|
+
default(){
|
|
27
|
+
return{}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
disabled:{
|
|
31
|
+
type:Boolean,
|
|
32
|
+
default:false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
methods:{
|
|
36
|
+
handleClick(item){
|
|
37
|
+
if (this.disabled){
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
this.$emit('singleChoice',item,this.msg)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style scoped lang="less">
|
|
47
|
+
.singleChoiceAnswer{
|
|
48
|
+
|
|
49
|
+
.singleChoiceText{
|
|
50
|
+
padding-bottom: 10px;
|
|
51
|
+
}
|
|
52
|
+
.optionsList {
|
|
53
|
+
padding-top: 4px;
|
|
54
|
+
|
|
55
|
+
.optionsItem {
|
|
56
|
+
line-height: 25px;
|
|
57
|
+
background-color: #ffffff;
|
|
58
|
+
color: #366aff;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
padding: 8px 0;
|
|
64
|
+
i {
|
|
65
|
+
padding-left: 10px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</style>
|