Feat(云灵AI):对话接口对接完成

This commit is contained in:
lifizer
2025-04-06 00:05:03 +08:00
parent 30f550ca92
commit 50ff88e7df
9 changed files with 505 additions and 55 deletions
+41 -20
View File
@@ -5,15 +5,6 @@
}"
class="fix-page-bottom"
>
<view v-if="startTaskFlag" class="music-wrap">
<view class="item one" />
<view class="item two" />
<view class="item three" />
<view class="item four" />
<view class="item five" />
<view class="item six" />
<view class="item seven" />
</view>
<view v-if="inputModel === 'input'" class="bottom-body flex-center-between">
<view class="history-wrap" @click="historyViewHandle">
历史
@@ -60,15 +51,44 @@
<view
v-if="inputModel === 'sound'"
class="sound-input-wrap"
@touchstart="startRecord"
@touchend="stopRecord"
>
<image
:src="webUrl + '/icon-20.png'"
class="icon"
mode="widthFix"
/>
按住说话
<view class="toggle-btn">
<image
:src="webUrl + '/aiChat/icon-06.png'"
class="input-icon"
mode="widthFix"
@click="toggleInputModel"
/>
</view>
<view
class="sound-wrap"
@touchstart="startRecord"
@touchend="stopRecord"
>
<view v-if="startTaskFlag" class="music-wrap">
<view class="item one" />
<view class="item two" />
<view class="item three" />
<view class="item four" />
<view class="item five" />
<view class="item six" />
<view class="item seven" />
</view>
<image
:src="webUrl + '/aiChat/microphone-big.png'"
class="icon"
mode="widthFix"
/>
<view v-if="startTaskFlag" class="music-wrap music-wrap2">
<view class="item one" />
<view class="item two" />
<view class="item three" />
<view class="item four" />
<view class="item five" />
<view class="item six" />
<view class="item seven" />
</view>
</view>
</view>
</view>
</template>
@@ -199,10 +219,9 @@ export default {
_this.taskId = ''
_this.clearIntervalFn()
uni.uploadFile({
url: `${VUE_APP_API_URL + settings.sysPrefix}/common/file/local/upload`,
url: `${VUE_APP_API_URL}/api/upload`,
filePath: tempFilePath,
header: {
'client-id': 'app',
Authorization: 'Bearer ' + (_this.token || '')
},
name: 'file',
@@ -220,8 +239,10 @@ export default {
},
renderTransTask(uploadRes) {
const _this = this
const file = JSON.parse(uploadRes.data).link || ''
if (!file) return
makeFileTransTask({
file: `${VUE_APP_API_URL + settings.sysPrefix}` + JSON.parse(uploadRes.data).data.fileUrl
file
}).then(taskRes => {
_this.taskId = taskRes.data
_this.getTransResultReq()