This commit is contained in:
liuye
2024-05-23 09:09:35 +08:00
parent 080206c1c5
commit 69c99d94c5

View File

@@ -45,12 +45,13 @@
</div> </div>
</div> </div>
</div> </div>
<AiLogin ref="login"/>
</div> </div>
</template> </template>
<script> <script>
import {mapState} from "vuex"; import {mapActions, mapState} from "vuex";
const recorderManager = uni.getRecorderManager(); const recorderManager = uni.getRecorderManager();
const innerAudioContext = uni.createInnerAudioContext(); const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true; innerAudioContext.autoplay = true;
@@ -85,13 +86,10 @@ export default {
} }
}, },
computed: { computed: {
...mapState(['user']), ...mapState(['user', 'token']),
}, },
onLoad() { onLoad() {
recorderManager.onStop((res)=> { this.autoLogin().then(() => {
console.log(res)
this.upLoad(res.tempFilePath)
});
this.getHistoryList() this.getHistoryList()
uni.getLocation({ uni.getLocation({
type: 'wgs84', // 返回可以用于uni.openLocation的经纬度默认为wgs84的gps坐标 type: 'wgs84', // 返回可以用于uni.openLocation的经纬度默认为wgs84的gps坐标
@@ -107,6 +105,11 @@ export default {
console.log('获取位置失败:', error); console.log('获取位置失败:', error);
} }
}); });
})
recorderManager.onStop((res)=> {
this.upLoad(res.tempFilePath)
});
}, },
onPullDownRefresh() { onPullDownRefresh() {
if(this.current > this.pages) { if(this.current > this.pages) {
@@ -116,6 +119,7 @@ export default {
this.getHistoryList() this.getHistoryList()
}, },
methods: { methods: {
...mapActions(['autoLogin']),
startRecord() { startRecord() {
if(this.isFlag) return if(this.isFlag) return
this.isStart = true this.isStart = true