瀏覽代碼

增加录音播放按钮

seimin 2 年之前
父節點
當前提交
9439028c18

+ 46 - 1
src/views/incidentList.vue

@@ -96,7 +96,10 @@
96
                     >{{ item.place.area.area }} {{ item.place.place }}
96
                     >{{ item.place.area.area }} {{ item.place.place }}
97
                     {{ item.houseNumber }}</span
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
                 </div>
103
                 </div>
101
                 <div class="btns">
104
                 <div class="btns">
102
                   <cube-form-group
105
                   <cube-form-group
@@ -178,6 +181,11 @@
178
       :operate="models1.operate"
181
       :operate="models1.operate"
179
       textName="textarea"
182
       textName="textarea"
180
     ></showModel>
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
   </div>
189
   </div>
182
 </template>
190
 </template>
183
 <script>
191
 <script>
@@ -192,6 +200,8 @@ import LoadIng from "./../views/loading.vue";
192
 export default {
200
 export default {
193
   data() {
201
   data() {
194
     return {
202
     return {
203
+      audioSrc:'',//音频路径
204
+      audioMask:false,//音频
195
       modelsData: null, //点击弹窗的那一项数据
205
       modelsData: null, //点击弹窗的那一项数据
196
       modelsData1: null, //点击弹窗的那一项数据
206
       modelsData1: null, //点击弹窗的那一项数据
197
       // 弹窗model
207
       // 弹窗model
@@ -278,6 +288,30 @@ export default {
278
     }
288
     }
279
   },
289
   },
280
   methods: {
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
     ok(selectUserId) {
316
     ok(selectUserId) {
283
       console.log(selectUserId);
317
       console.log(selectUserId);
@@ -630,6 +664,17 @@ export default {
630
 };
664
 };
631
 </script>
665
 </script>
632
 <style lang="stylus" rel="stylesheet/stylus" scoped>
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
 .btns{
678
 .btns{
634
   display: flex;
679
   display: flex;
635
   justify-content: space-between
680
   justify-content: space-between

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

@@ -55,6 +55,12 @@
55
           <ul class="icon_lists dib-box">
55
           <ul class="icon_lists dib-box">
56
           
56
           
57
             <li class="dib">
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
               <span class="icon dash">&#xe600;</span>
64
               <span class="icon dash">&#xe600;</span>
59
                 <div class="name">加</div>
65
                 <div class="name">加</div>
60
                 <div class="code-name">&amp;#xe600;</div>
66
                 <div class="code-name">&amp;#xe600;</div>
@@ -114,9 +120,9 @@
114
 <pre><code class="language-css"
120
 <pre><code class="language-css"
115
 >@font-face {
121
 >@font-face {
116
   font-family: 'dash';
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
 </code></pre>
127
 </code></pre>
122
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
128
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -143,6 +149,15 @@
143
         <ul class="icon_lists dib-box">
149
         <ul class="icon_lists dib-box">
144
           
150
           
145
           <li class="dib">
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
             <span class="icon dash dash-jia"></span>
161
             <span class="icon dash dash-jia"></span>
147
             <div class="name">
162
             <div class="name">
148
163
@@ -234,6 +249,14 @@
234
           
249
           
235
             <li class="dib">
250
             <li class="dib">
236
                 <svg class="icon svg-icon" aria-hidden="true">
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
                   <use xlink:href="#dash-jia"></use>
260
                   <use xlink:href="#dash-jia"></use>
238
                 </svg>
261
                 </svg>
239
                 <div class="name">加</div>
262
                 <div class="name">加</div>

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

@@ -1,8 +1,8 @@
1
 @font-face {
1
 @font-face {
2
   font-family: "dash"; /* Project id 2879659 */
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
 .dash {
8
 .dash {
@@ -13,6 +13,10 @@
13
   -moz-osx-font-smoothing: grayscale;
13
   -moz-osx-font-smoothing: grayscale;
14
 }
14
 }
15
 
15
 
16
+.dash-dianbohuifang:before {
17
+  content: "\e601";
18
+}
19
+
16
 .dash-jia:before {
20
 .dash-jia:before {
17
   content: "\e600";
21
   content: "\e600";
18
 }
22
 }

File diff suppressed because it is too large
+ 1 - 1
static/css/fontnew/iconfont.js


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

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

二進制
static/css/fontnew/iconfont.ttf


二進制
static/css/fontnew/iconfont.woff


二進制
static/css/fontnew/iconfont.woff2