This commit is contained in:
weipengfei 2023-11-18 11:43:30 +08:00
parent 6a055ac24d
commit 52e145e4e9
4 changed files with 37 additions and 10 deletions

View File

@ -16,9 +16,9 @@ function baseRequestTwo(url, method, data, {
}) {
return new Promise((reslove, reject) => {
// uni.showLoading({
// title: '加载中'
// })
uni.showLoading({
title: '加载中'
})
uni.request({
// url: Url + '/api/v1' + url,
url: Url + url,
@ -26,6 +26,7 @@ function baseRequestTwo(url, method, data, {
data: method != 'GET' ? data || {} : {},
params: method == 'GET' ? data : {},
success: (res) => {
uni.hideLoading()
if (noVerify)
reslove(res.data);
else if (res.data.code == -1) {
@ -51,9 +52,9 @@ function baseRequestTwo(url, method, data, {
},
fail: (message) => {
// uni.hideLoading()
uni.showToast({
title: '网络错误',
icon: 'none'
uni.showModal({
title: '请求错误',
content: JSON.stringify(message)
})
reject('请求失败');
}

View File

@ -10,6 +10,9 @@
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"compatible":{
"ignoreVersion": true //trueHBuilderX1.9.0
},
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
@ -41,9 +44,13 @@
]
},
/* ios */
"ios" : {},
"ios" : {
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {}
"sdkConfigs" : {
"ad" : {}
}
}
},
/* */

View File

@ -3,7 +3,9 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "里海AI远程控制"
"navigationBarTitleText": "里海AI远程控制",
"navigationBarBackgroundColor": "#282c35",
"navigationBarTextStyle": "white"
}
}
],

View File

@ -1,5 +1,5 @@
<template>
<view>
<view class="page">
<view class="body">
<view class="btn end" @click="stopPlay('re-play')">
重新播放
@ -19,6 +19,9 @@
<view class="btn re" @click="reRecord">
重新录制
</view>
<view class="btn reload" @click="reload">
刷新页面
</view>
<view class="btn" :class="{end:recordStatus=='end'}" @click="startRecord">
{{recordStatus=='start'?'开始录音':'结束录音'}}
</view>
@ -53,10 +56,21 @@ const stopPlay = async (e)=>{
await indexPush({name: e});
}
const reload = async ()=>{
await indexPush({name: 'reload'});
}
</script>
<style scoped lang="scss">
page{
background-color: #282c35;
}
.page{
width: 100vw;
height: 100vh;
background-color: #282c35;
}
.body{
height: 80vh;
display: flex;
@ -92,4 +106,7 @@ const stopPlay = async (e)=>{
.stop{
background-color: #f3405d;
}
.reload{
background-color: #ff0000;
}
</style>