|
@@ -30,13 +30,9 @@
|
|
|
autoplay
|
|
|
:src="item.mp3url"
|
|
|
></audio>
|
|
|
- <div>
|
|
|
+ <div v-if="item.content">
|
|
|
<span>{{ item.content }}</span>
|
|
|
- <i
|
|
|
- v-if="item.content"
|
|
|
- class="el-icon-document-copy"
|
|
|
- @click="copy(item)"
|
|
|
- ></i>
|
|
|
+ <i class="el-icon-document-copy" @click="copy(item)"></i>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="header-img">
|
|
@@ -96,14 +92,7 @@ export default {
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- questionList: [
|
|
|
- { type: 0, mp3url: "" },
|
|
|
- {
|
|
|
- type: "selectLand",
|
|
|
- content: "sss",
|
|
|
- data: { rwbsm: "5f3d25e556374e78966feca5a64fa887" },
|
|
|
- },
|
|
|
- ],
|
|
|
+ questionList: [],
|
|
|
defaultMsg:
|
|
|
"我要在抱坡区进行选址,用地面积30到50亩,选择居住用地,距离幼儿园200米,距离医院300米,距离火葬场大于5000米",
|
|
|
sendContent: "",
|
|
@@ -162,24 +151,7 @@ export default {
|
|
|
stop() {
|
|
|
let _this = this;
|
|
|
record.stopRecorder(function (res) {
|
|
|
- console.log("-blob----", res);
|
|
|
- _this.questionList.push({
|
|
|
- type: 0,
|
|
|
- mp3url: (window.URL || webkitURL).createObjectURL(res.blob),
|
|
|
- mstatus: 0,
|
|
|
- });
|
|
|
- let mindex = _this.questionList.length - 1;
|
|
|
- /**处理 */
|
|
|
- uploadAudio(res.formData)
|
|
|
- .then((ares) => {
|
|
|
- if (ares.status == 200) {
|
|
|
- _this.questionList[mindex].content = ares.data.voiceMsg;
|
|
|
- _this.sendToBackend(ares.data.voiceMsg, mindex);
|
|
|
- } else {
|
|
|
- _this.$message.error(ares.data.msg);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ _this.upload(res);
|
|
|
});
|
|
|
this.spdisabled = false;
|
|
|
},
|
|
@@ -212,6 +184,25 @@ export default {
|
|
|
this.stop();
|
|
|
}
|
|
|
},
|
|
|
+ upload({ blob, formData }) {
|
|
|
+ this.questionList.push({
|
|
|
+ type: 0,
|
|
|
+ mp3url: (window.URL || webkitURL).createObjectURL(blob),
|
|
|
+ mstatus: 0,
|
|
|
+ });
|
|
|
+ let mindex = this.questionList.length - 1;
|
|
|
+ /**处理 */
|
|
|
+ uploadAudio(formData)
|
|
|
+ .then((ares) => {
|
|
|
+ if (ares.status == 200) {
|
|
|
+ this.questionList[mindex].content = ares.data.voiceMsg;
|
|
|
+ this.sendToBackend(ares.data.voiceMsg, mindex);
|
|
|
+ } else {
|
|
|
+ this.$message.error(ares.data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
sendToBackend(msg, mindex) {
|
|
|
this.questionList[mindex].mstatus = 0;
|
|
|
GetMsg(msg)
|
|
@@ -365,6 +356,9 @@ export default {
|
|
|
i {
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
+ .el-icon-warning {
|
|
|
+ color: #ff6666;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
audio {
|
|
@@ -415,9 +409,6 @@ export default {
|
|
|
font-size: 40px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
- .el-icon-warning {
|
|
|
- color: red;
|
|
|
- }
|
|
|
.no {
|
|
|
color: #2f2f39;
|
|
|
}
|