askbot-dragon 0.6.24 → 0.6.28

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.
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <div
3
+ class="action-satisfaction"
4
+ >
5
+ <p class="satisfaction-des" v-html="msg.content.satisfactionDes"></p>
6
+ <p
7
+ class="statisfaction-item"
8
+ @click="
9
+ sendSatisfaction(
10
+ 'USER_ACTION_TO_SATISFACTION_V2',
11
+ '满意',
12
+ msg.content.satisfactoryAnswer,
13
+ null,
14
+ msg.apiKey
15
+ )
16
+ "
17
+ >
18
+ 满意<i class="arsenal_icon arsenalangle-right-solid"></i>
19
+ </p>
20
+ <p
21
+ class="statisfaction-item"
22
+ @click="
23
+ sendSatisfaction(
24
+ 'USER_ACTION_TO_SATISFACTION_V2',
25
+ '不满意',
26
+ msg.content.unsatisfiedAnswer,
27
+ msg.content.answerRadio,
28
+ msg.apiKey
29
+ )
30
+ "
31
+ >
32
+ 不满意<i class="arsenal_icon arsenalangle-right-solid"></i>
33
+ </p>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ export default {
39
+ name: "actionSatisfaction",
40
+ props:['msg'],
41
+ methods:{
42
+ sendSatisfaction(type, choose, answer, answerRadio,answerApiKey){
43
+ this.$emit('sendSatisfaction',type, choose, answer, answerRadio,answerApiKey)
44
+ }
45
+ }
46
+ }
47
+ </script>
48
+
49
+ <style scoped lang="less">
50
+ @import url(../assets/less/converSationContainer/common);
51
+ .action-satisfaction{
52
+ .satisfaction-des{
53
+ word-wrap: break-word;
54
+ word-break: break-all;
55
+ overflow: hidden;
56
+ padding: 8px 0 10px 0;
57
+ height: auto;
58
+ border-bottom: 1px solid #EEEEEE;
59
+ }
60
+ .statisfaction-item{
61
+ padding: 8px 0;
62
+ height: 25px;
63
+ line-height: 25px;
64
+ background-color: #ffffff;
65
+ color: #366aff;
66
+ cursor:pointer;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: space-between;
70
+ }
71
+ .end{
72
+ border-bottom-left-radius: 25px !important;
73
+ border-bottom-right-radius: 25px !important;
74
+ }
75
+ }
76
+ </style>
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <div
3
+ class="action-send-to-bot"
4
+ >
5
+ <p class="bot-des" v-html="msg.content.description"></p>
6
+ <div class="options-list">
7
+ <p
8
+ v-for="(option, index) in msg.content.options"
9
+ class="options-item"
10
+ :key="msg.nodeId + '_' + index"
11
+ @click="$emit('onRadioClick2', option.content, option.name, msg.apiKey)"
12
+ >
13
+ {{ option.name }}<i class="arsenal_icon arsenalangle-right-solid"></i>
14
+ </p>
15
+ </div>
16
+
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ name: "actionSendToBot",
23
+ props:['msg']
24
+ }
25
+ </script>
26
+
27
+ <style scoped lang="less">
28
+ .action-send-to-bot{
29
+ .bot-des {
30
+ word-wrap: break-word;
31
+ word-break: break-all;
32
+ overflow: hidden;
33
+ padding: 8px 10px 10px 0;
34
+ height: auto;
35
+ border-bottom: 1px solid #EEEEEE;
36
+ }
37
+ .options-list{
38
+ /* padding-top: 10px;*/
39
+ /*padding-right: 10px;*/
40
+ .options-item{
41
+ padding: 8px 0;
42
+ height: 25px;
43
+ line-height: 25px;
44
+ background-color: #ffffff;
45
+ color: #366aff;
46
+ cursor:pointer;
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: space-between;
50
+ i{
51
+ padding-left: 10px;
52
+ }
53
+ }
54
+ }
55
+ }
56
+ </style>
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <div class="answer-dissatisfaction">
3
+ <p class="satisfaction-reply-text" v-html="msg.content.replyText"></p>
4
+ <p
5
+ v-for="(option, index) in msg.content.replyOptions"
6
+ class="statisfaction-item"
7
+ :key="index"
8
+ @click="sendDissatisfaction(option,msg.apiKey)">
9
+ {{ option.name }}<i class="arsenal_icon arsenalangle-right-solid"></i>
10
+ </p>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ name: "answerDissatisfaction",
17
+ data(){
18
+ return{
19
+
20
+ }
21
+ },
22
+ props:['msg'],
23
+ methods:{
24
+ sendDissatisfaction(option,apiKey){
25
+ this.$emit('sendDissatisfaction',option,apiKey)
26
+ /*let value = JSON.stringify({
27
+ input: option.name,
28
+ reply_text: option.answer
29
+ });
30
+ this.$emit('sendMessage','USER_ACTION_TO_DISSATISFACTION_V2',value,null,apiKey);*/
31
+ }
32
+ }
33
+ }
34
+ </script>
35
+
36
+ <style scoped lang="less">
37
+ .answer-dissatisfaction{
38
+ .satisfaction-reply-text{
39
+ word-wrap: break-word;
40
+ word-break: break-all;
41
+ overflow: hidden;
42
+ padding: 8px 0 10px 0;
43
+ height: auto;
44
+ border-bottom: 1px solid #EEEEEE;
45
+ }
46
+ .statisfaction-item{
47
+ padding: 8px 0;
48
+ height: 25px;
49
+ line-height: 25px;
50
+ background-color: #ffffff;
51
+ color: #366aff;
52
+ cursor:pointer;
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: space-between;
56
+ }
57
+ .end{
58
+ border-bottom-left-radius: 25px !important;
59
+ border-bottom-right-radius: 25px !important;
60
+ }
61
+ }
62
+ </style>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div id="answer-radio">
3
+ <p class="radio-description" v-html="msg.content.description"></p>
4
+ <div class="options-list">
5
+ <div
6
+ v-for="(option, index) in msg.content.options"
7
+ class="options-item"
8
+ :key="msg.nodeId + '_' + index"
9
+ @click="
10
+ $emit(
11
+ 'onRadioClick',msg.id +'_' + index + '_' + option.value + '_' + option.name,option.name, msg.apiKey,msg.actionCategory
12
+ )">
13
+ {{ option.name }}<i class="arsenal_icon arsenalangle-right-solid"></i>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ export default {
21
+ name: "answerRadio",
22
+ data(){
23
+ return{
24
+
25
+ }
26
+ },
27
+ props:['msg']
28
+ }
29
+ </script>
30
+
31
+ <style scoped lang="less">
32
+ #answer-radio{
33
+ .radio-description {
34
+ word-wrap: break-word;
35
+ word-break: break-all;
36
+ overflow: hidden;
37
+ /*padding: 8px 10px 10px 0;*/
38
+ padding-bottom: 10px;
39
+ height: auto;
40
+ border-bottom: 1px solid #EEEEEE;
41
+ }
42
+ .options-list{
43
+ /* padding-top: 10px;*/
44
+ /*padding-right: 10px;*/
45
+ .options-item{
46
+ padding: 8px 0;
47
+ height: 25px;
48
+ line-height: 25px;
49
+ background-color: #ffffff;
50
+ color: #366aff;
51
+ cursor:pointer;
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: space-between;
55
+ i{
56
+ padding-left: 10px;
57
+ }
58
+ }
59
+ .end{
60
+ border-bottom-left-radius: 25px !important;
61
+ border-bottom-right-radius: 25px !important;
62
+ }
63
+ }
64
+ }
65
+ </style>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <div
3
+ v-loading="loading"
4
+ :element-loading-text="showProgress">
5
+ <!-- <video-player
6
+ class="video-player vjs-custom-skin"
7
+ x5-video-player-type="h5"
8
+ :options="videoOptions(msg.content,msg.type)"
9
+ @pause="statechanged"
10
+ /> -->
11
+ <video
12
+ :src="src"
13
+ controls="controls"
14
+ x5-video-player-type="h5-page"
15
+ style="object-fit: contain;width: 240px;height: 160px;background-color: black;border-radius: 17px"
16
+ class="video-player vjs-custom-skin"
17
+ :id="msg.keyId"/>
18
+ </div>
19
+ </template>
20
+ <script>
21
+ export default {
22
+ name: "ask_video",
23
+ props: ["msg", "url", "localUrl", "progress"],
24
+ data() {
25
+ return {
26
+ }
27
+ },
28
+ watch: {
29
+ },
30
+ computed: {
31
+ showProgress() {
32
+ return parseInt(this.progress * 100);
33
+ },
34
+ loading() {
35
+ return this.url == null || this.url === "";
36
+ },
37
+ src() {
38
+ return (this.url != null && this.url !== '') ? this.url : this.localUrl;
39
+ }
40
+ }
41
+
42
+ }
43
+ </script>
44
+ <style scoped lang="less">
45
+
46
+ </style>
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <div class="association-intention">
3
+ <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && !(msg.recommend&& msg.recommend.status)">
4
+ <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)"></p>
5
+ </div>
6
+ <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && (msg.recommend&& msg.recommend.status)">
7
+ <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)" class="answer-rich-text"></p>
8
+ <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
9
+ </div>
10
+ <div v-if="msg.type === 'answer_rich_text' && !(msg.content.recommend != undefined && msg.content.recommend.status)">
11
+ <p v-html="$options.filters.imageStyle(msg.content.html)"></p>
12
+ </div>
13
+ <div v-else-if="msg.type == 'answer_rich_text' && (msg.content.recommend != undefined && msg.content.recommend.status)">
14
+ <p v-html="$options.filters.imageStyle(msg.content.html)" class="answer-rich-text"></p>
15
+ <Recommend :msg="msg.content" @onRadioClickReco="onRadioClickReco"></Recommend>
16
+ </div>
17
+ <div v-else-if="msgType === 'answer_image'" >
18
+ <div
19
+ class="association-img"
20
+ >
21
+ <!-- LPY 原生宽度适配有bug,弃用 -->
22
+ <img
23
+ :src="msg.content.url"
24
+ style="height: auto; width: auto;max-width: 240px;border-radius: 17px"
25
+ @click="onImageClick(msg.content.url)"
26
+ class="img-class"
27
+ />
28
+ </div>
29
+ <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
30
+ </div>
31
+ <div v-else-if="msgType === 'answer_video' || msgType === 'user_video' || msgType === 'VIDEO'">
32
+ <div class="association-img">
33
+ <ask-video :msg="msg" :url="msg.content.url" :local-url="msg.content.localUrl"
34
+ :progress="msg.content.progress"></ask-video>
35
+ </div>
36
+ <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
37
+ </div>
38
+ </div>
39
+ </template>
40
+
41
+ <script>
42
+ import askVideo from "./askVideo";
43
+ import Recommend from "./recommend";
44
+ export default {
45
+ name: "associationIntention",
46
+ components: {Recommend, askVideo},
47
+ props: ["msg",'msgType'],
48
+ filters: {
49
+ imageStyle: function (html) {
50
+ //富文本内图片自适应高度宽度
51
+ const regex = new RegExp("<img", "gi");
52
+ return html.replace(
53
+ regex,
54
+ "<img style='max-width: 100%;' onclick='imageOnClick(this)'"
55
+ );
56
+ },
57
+ },
58
+ mounted() {
59
+ console.debug('msg',this.msg)
60
+ },
61
+ methods:{
62
+ // 将匹配结果替换表情图片
63
+ emotion (res) {
64
+ console.log('res:'+res);
65
+ let word = res.replace(/\/#|\/;/gi,'')
66
+ console.log('word:'+word);
67
+ const list = ['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴', '睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过', '酷', '冷汗', '抓狂', '吐', '偷笑', '可爱', '白眼', '傲慢', '饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂', '疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见', '擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠', '鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀', '西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰', '凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀', '足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强', '弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你', '不', '可以', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈', '磕头', '回头', '跳绳', '挥手', '激动', '街舞', '献吻', '左太极', '右太极']
68
+ let index = list.indexOf(word)
69
+ return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${index+1}.png" align="middle">`
70
+ },
71
+ onRadioClickReco(id, name, apikey) {
72
+ this.$emit("onRadioClick", id, name, apikey);
73
+ },
74
+ onImageClick(url){
75
+ console.debug('onImageClick',url)
76
+ },
77
+ }
78
+ }
79
+ </script>
80
+
81
+
82
+ <style scoped lang="less">
83
+ @import "../assets/less/converSationContainer/common";
84
+ .association-intention{
85
+ .association-img{
86
+ /*display: flex;
87
+ align-items: center;
88
+ justify-content: center;*/
89
+ .options-list{
90
+ padding-top: 8px;
91
+ }
92
+ }
93
+ .answer-rich-text{
94
+ padding-bottom: 12px;
95
+ border-bottom: 1px solid #EEEEEE;
96
+ }
97
+ }
98
+
99
+ </style>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div class="bot-action-satisfator">
3
+ <div class="replay">
4
+ <p class="reply-text" v-html="msg.content.reply_text"></p>
5
+ <div v-if="
6
+ msg.content.reply_options != null &&
7
+ msg.content.reply_options.length > 0
8
+ ">
9
+ <p
10
+
11
+ v-for="(option, index) in msg.content.reply_options"
12
+ class="statisfaction-item"
13
+ :key="index"
14
+ @click="
15
+ onSatisfactionClick(
16
+ 'user_action_to_unsatisfactory',
17
+ option.name,
18
+ option.answer, null,msg.apiKey
19
+ )
20
+ "
21
+ >
22
+ {{ option.name }}<i class="arsenal_icon arsenalangle-right-solid"></i>
23
+ </p>
24
+ </div>
25
+
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ export default {
32
+ name: "botActionSatisfactor",
33
+ props:['msg'],
34
+ methods:{
35
+ onSatisfactionClick(type, choose, answer, answerRadio,answerApiKey) {
36
+ this.$emit("onSatisfactionClick", type, choose, answer, answerRadio,answerApiKey);
37
+ },
38
+ }
39
+ }
40
+ </script>
41
+
42
+ <style scoped lang="less">
43
+ @import "../assets/less/converSationContainer/common";
44
+ .bot-action-satisfator{
45
+ .reply-text{
46
+ word-wrap: break-word;
47
+ word-break: break-all;
48
+ overflow: hidden;
49
+ padding: 8px 0 10px 0;
50
+ height: auto;
51
+ border-bottom: 1px solid #EEEEEE;
52
+ }
53
+ .statisfaction-item{
54
+ padding: 8px 0;
55
+ height: 25px;
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
+ }
64
+ .end{
65
+ border-bottom-left-radius: 25px !important;
66
+ border-bottom-right-radius: 25px !important;
67
+ }
68
+ }
69
+ </style>
@@ -234,7 +234,8 @@
234
234
  display: flex;
235
235
  -ms-flex-align: start;
236
236
  align-items: flex-start;
237
- max-width: 80%;
237
+ /*max-width: 80%;*/
238
+ max-width: calc(100vw - 50px);
238
239
  .media-body-image{
239
240
  background-color: #F4F8FC;
240
241
  border: 1px solid #F4F8FC;
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <div id="feedBack" class="companyNotRem" :class="{phoneClass:isPhone,companyClass:isCompany,notClick:isDisabled===true}">
3
- <span class="marginRight" >
4
- <el-button round class="btnClass" @click="positiveFeedback(feedBack,1)" v-html="feedBack.positiveFeedback.text" v-if="positiveClick ===false">{{feedBack.positiveFeedback.text}}</el-button>
5
- <el-button round class="btnClassActive" v-html="feedBack.positiveFeedback.text" v-if="positiveClick ===true">{{feedBack.positiveFeedback.text}}</el-button>
3
+ <span :class="!positiveClick?'feed-positive-button':'feed-check-positive-button'">
4
+ <el-button round class="btnClass" @click="positiveFeedback(feedBack,1)" v-html="feedBack.positiveFeedback.text" v-if="!positiveClick">{{feedBack.positiveFeedback.text}}</el-button>
5
+ <el-button round class="btnClassActive" v-html="feedBack.positiveFeedback.text" v-else>{{feedBack.positiveFeedback.text}}</el-button>
6
6
  </span>
7
- <span class="marginRight">
8
- <el-button round class="btnClass" @click="positiveFeedback(feedBack,2)" v-html="feedBack.negativeFeedback.text" v-if="negativeClick ===false">{{feedBack.negativeFeedback.text}}</el-button>
9
- <el-button round class="btnClassActive" v-html="feedBack.negativeFeedback.text" v-if="negativeClick ===true">{{feedBack.negativeFeedback.text}}</el-button>
7
+ <span :class="!negativeClick?'feed-negative-button':'feed-check-negative-button'">
8
+ <el-button round class="btnClass" @click="positiveFeedback(feedBack,2)" v-html="feedBack.negativeFeedback.text" v-if="!negativeClick">{{feedBack.negativeFeedback.text}}</el-button>
9
+ <el-button round class="btnClassActive" v-html="feedBack.negativeFeedback.text" v-else>{{feedBack.negativeFeedback.text}}</el-button>
10
10
  </span>
11
11
  </div>
12
12
  </template>
@@ -82,40 +82,66 @@ name: "feedBack",
82
82
  </script>
83
83
 
84
84
  <style scoped lang="less">
85
-
85
+ #feedBack{
86
+ .feed-positive-button{
87
+ background: #FFFFFF;
88
+ margin-right: 8px;
89
+ /deep/.el-button{
90
+ border: 1px solid #BBCDFF;
91
+ color: #366aff;
92
+ border-radius: 14px;
93
+ font-weight: 400;
94
+ }
95
+ }
96
+ .feed-check-positive-button{
97
+ margin-right: 8px;
98
+ /deep/.el-button{
99
+ border: 1px solid #4C61E1;
100
+ color: #FFFFFF;
101
+ background-color: #4C61E1;
102
+ border-radius: 14px;
103
+ font-weight: 400;
104
+ }
105
+ }
106
+ .feed-check-negative-button{
107
+ /deep/.el-button{
108
+ border: 1px solid #4C61E1;
109
+ color: #FFFFFF;
110
+ background-color: #4C61E1;
111
+ border-radius: 14px;
112
+ font-weight: 400;
113
+ }
114
+ }
115
+ .feed-negative-button{
116
+ background: #FFFFFF;
117
+ /deep/.el-button{
118
+ border: 1px solid #BEC5DB;
119
+ color: #616161;
120
+ border-radius: 14px;
121
+ font-weight: 400;
122
+ }
123
+ }
124
+ /deep/.el-button.is-round{
125
+ padding: 9px 20px;
126
+ }
127
+ }
86
128
  .phoneClass{
87
129
  width: 100vw;
88
130
  text-align: center;
89
131
  margin: 0 auto;
90
132
  line-height: 56px;
91
- .marginRight{
92
- margin-right: 10px;
93
- margin-left: 10px;
94
- }
95
133
  .el-button{
96
134
  min-width: 60px;
97
135
  height: 36px;
98
136
  line-height: 0.9;
99
137
  }
100
138
  }
101
- .btnClass{
102
- color: #4C61E1;
103
- border-color: #4C61E1
104
- }
105
- .btnClassActive{
106
- color: #ffffff;
107
- background-color: #4C61E1
108
- }
109
139
  .companyClass{
110
140
  /* min-width: 300px;*/
111
141
  width: 370px;
112
142
  text-align: center;
113
143
  margin: 0 auto;
114
144
  line-height: 56px;
115
- .marginRight{
116
- margin-right: 10px;
117
- margin-left: 10px;
118
- }
119
145
  .el-button{
120
146
  min-width: 60px;
121
147
  height: 36px;
@@ -125,10 +151,4 @@ name: "feedBack",
125
151
  .notClick{
126
152
  pointer-events: none;
127
153
  }
128
- .positiveActive{
129
- color: red;
130
- }
131
- .negativeActive{
132
- color: red;
133
- }
134
154
  </style>