Quellcode durchsuchen

增加录音播放按钮

seimin vor 2 Jahren
Ursprung
Commit
9439028c18

+ 46 - 1
src/views/incidentList.vue

@@ -96,7 +96,10 @@
96 96
                     >{{ item.place.area.area }} {{ item.place.place }}
97 97
                     {{ item.houseNumber }}</span
98 98
                   >
99
-                  <span>{{ item.acceptDate | timeFormat("MM-dd HH:mm") }}</span>
99
+                  <span>
100
+                    <i v-if="item.callID" @click.stop="showAudio(item.callID)" class="dash dash-dianbohuifang"></i>
101
+                    {{ item.acceptDate | timeFormat("MM-dd HH:mm") }}
102
+                  </span>
100 103
                 </div>
101 104
                 <div class="btns">
102 105
                   <cube-form-group
@@ -178,6 +181,11 @@
178 181
       :operate="models1.operate"
179 182
       textName="textarea"
180 183
     ></showModel>
184
+    <div class="mask" v-if="audioMask" @click="hideAudio()">
185
+      <audio controls autoplay="autoplay" id="bgMusic">
186
+        <source :src="audioSrc" type="audio/mpeg">
187
+      </audio>
188
+    </div>
181 189
   </div>
182 190
 </template>
183 191
 <script>
@@ -192,6 +200,8 @@ import LoadIng from "./../views/loading.vue";
192 200
 export default {
193 201
   data() {
194 202
     return {
203
+      audioSrc:'',//音频路径
204
+      audioMask:false,//音频
195 205
       modelsData: null, //点击弹窗的那一项数据
196 206
       modelsData1: null, //点击弹窗的那一项数据
197 207
       // 弹窗model
@@ -278,6 +288,30 @@ export default {
278 288
     }
279 289
   },
280 290
   methods: {
291
+    // 播放音频
292
+    showAudio(callID){
293
+      const toast = this.$createToast({
294
+        txt: "Loading...",
295
+        mask: true
296
+      });
297
+      toast.show();
298
+      this.$http
299
+        .post("service/bpm/data/fetchDataList/callrecord", {idx: 0, sum: 1, callrecord: {callAccept: callID}})
300
+        .then(res => {
301
+          toast.hide();
302
+          if (res.data.status == 200) {
303
+            res.data.list = res.data.list || [];
304
+            if(res.data.list.length){
305
+                this.audioMask = true;
306
+                this.audioSrc = this.$host+res.data.list[0].recordingFileName;
307
+            }
308
+          }
309
+        });
310
+    },
311
+    // 隐藏音频组件
312
+    hideAudio(){
313
+      this.audioMask=false;
314
+    },
281 315
     //确定
282 316
     ok(selectUserId) {
283 317
       console.log(selectUserId);
@@ -630,6 +664,17 @@ export default {
630 664
 };
631 665
 </script>
632 666
 <style lang="stylus" rel="stylesheet/stylus" scoped>
667
+.mask{
668
+  width: 100%;
669
+  height: 100%;
670
+  position: fixed;
671
+  top: 0;
672
+  background: rgba(0,0,0,.5);
673
+  z-index: 999;
674
+  display: flex;
675
+  align-items: center;
676
+  justify-content: center;
677
+}
633 678
 .btns{
634 679
   display: flex;
635 680
   justify-content: space-between

+ 26 - 3
static/css/fontnew/demo_index.html

@@ -55,6 +55,12 @@
55 55
           <ul class="icon_lists dib-box">
56 56
           
57 57
             <li class="dib">
58
+              <span class="icon dash">&#xe601;</span>
59
+                <div class="name">点播回放</div>
60
+                <div class="code-name">&amp;#xe601;</div>
61
+              </li>
62
+          
63
+            <li class="dib">
58 64
               <span class="icon dash">&#xe600;</span>
59 65
                 <div class="name">加</div>
60 66
                 <div class="code-name">&amp;#xe600;</div>
@@ -114,9 +120,9 @@
114 120
 <pre><code class="language-css"
115 121
 >@font-face {
116 122
   font-family: 'dash';
117
-  src: url('iconfont.woff2?t=1672887795273') format('woff2'),
118
-       url('iconfont.woff?t=1672887795273') format('woff'),
119
-       url('iconfont.ttf?t=1672887795273') format('truetype');
123
+  src: url('iconfont.woff2?t=1681130959360') format('woff2'),
124
+       url('iconfont.woff?t=1681130959360') format('woff'),
125
+       url('iconfont.ttf?t=1681130959360') format('truetype');
120 126
 }
121 127
 </code></pre>
122 128
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -143,6 +149,15 @@
143 149
         <ul class="icon_lists dib-box">
144 150
           
145 151
           <li class="dib">
152
+            <span class="icon dash dash-dianbohuifang"></span>
153
+            <div class="name">
154
+              点播回放
155
+            </div>
156
+            <div class="code-name">.dash-dianbohuifang
157
+            </div>
158
+          </li>
159
+          
160
+          <li class="dib">
146 161
             <span class="icon dash dash-jia"></span>
147 162
             <div class="name">
148 163
@@ -234,6 +249,14 @@
234 249
           
235 250
             <li class="dib">
236 251
                 <svg class="icon svg-icon" aria-hidden="true">
252
+                  <use xlink:href="#dash-dianbohuifang"></use>
253
+                </svg>
254
+                <div class="name">点播回放</div>
255
+                <div class="code-name">#dash-dianbohuifang</div>
256
+            </li>
257
+          
258
+            <li class="dib">
259
+                <svg class="icon svg-icon" aria-hidden="true">
237 260
                   <use xlink:href="#dash-jia"></use>
238 261
                 </svg>
239 262
                 <div class="name">加</div>

+ 7 - 3
static/css/fontnew/iconfont.css

@@ -1,8 +1,8 @@
1 1
 @font-face {
2 2
   font-family: "dash"; /* Project id 2879659 */
3
-  src: url('iconfont.woff2?t=1672887795273') format('woff2'),
4
-       url('iconfont.woff?t=1672887795273') format('woff'),
5
-       url('iconfont.ttf?t=1672887795273') format('truetype');
3
+  src: url('iconfont.woff2?t=1681130959360') format('woff2'),
4
+       url('iconfont.woff?t=1681130959360') format('woff'),
5
+       url('iconfont.ttf?t=1681130959360') format('truetype');
6 6
 }
7 7
 
8 8
 .dash {
@@ -13,6 +13,10 @@
13 13
   -moz-osx-font-smoothing: grayscale;
14 14
 }
15 15
 
16
+.dash-dianbohuifang:before {
17
+  content: "\e601";
18
+}
19
+
16 20
 .dash-jia:before {
17 21
   content: "\e600";
18 22
 }

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
static/css/fontnew/iconfont.js


+ 7 - 0
static/css/fontnew/iconfont.json

@@ -6,6 +6,13 @@
6 6
   "description": "引入一个新的字体图标",
7 7
   "glyphs": [
8 8
     {
9
+      "icon_id": "13159546",
10
+      "name": "点播回放",
11
+      "font_class": "dianbohuifang",
12
+      "unicode": "e601",
13
+      "unicode_decimal": 58881
14
+    },
15
+    {
9 16
       "icon_id": "1302",
10 17
       "name": "加",
11 18
       "font_class": "jia",

BIN
static/css/fontnew/iconfont.ttf


BIN
static/css/fontnew/iconfont.woff


BIN
static/css/fontnew/iconfont.woff2