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

View File

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

View File

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

View File

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