|
|
@@ -768,7 +768,8 @@ import { |
|
|
|
createVideoApi, |
|
|
|
getModelDetailByIdApi, |
|
|
|
getLanguageApi, |
|
|
|
checkVideoApi |
|
|
|
checkVideoApi, |
|
|
|
reduceUserPoinsApi |
|
|
|
} from "@/apis/createVideo"; |
|
|
|
import { useI18n } from "vue-i18n"; |
|
|
|
import Recorder from "js-audio-recorder"; //mp3插件 |
|
|
@@ -1747,6 +1748,33 @@ function createWS() { |
|
|
|
if (event.data == "___talk_end___") { |
|
|
|
sendLoading.value = false; |
|
|
|
mySocket.close(); |
|
|
|
// 金币扣除 |
|
|
|
ElMessageBox.confirm( |
|
|
|
lanChange.value == "zh-cn" ? '需要扣一个金币,是否继续?' : 'Need to deduct a gold coin, do you want to continue?', |
|
|
|
lanChange.value == "zh-cn" ? '提示' : 'Tip', |
|
|
|
{ |
|
|
|
confirmButtonText: 'OK', |
|
|
|
cancelButtonText: 'Cancel', |
|
|
|
type: 'warning', |
|
|
|
} |
|
|
|
).then(() => { |
|
|
|
let userPoinsVal = localStorage.getItem('userPoinsVal') // 当前币值 |
|
|
|
if (Number(userPoinsVal) <= 0){ |
|
|
|
ElMessage({ |
|
|
|
type: 'error', |
|
|
|
message: lanChange.value == "zh-cn" ? '金币不足!' : 'Insufficient gold coins!', |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
reduceUserPoinsApi().then(res => { |
|
|
|
if (res.code === 200){ |
|
|
|
ElMessage({ |
|
|
|
type: 'success', |
|
|
|
message: '操作成功!', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
return; |
|
|
|
} |
|
|
|
answerContent.value = answerContent.value + event.data; |
|
|
|