<template>
	<view>
		<view class="call_alarm_back" @tap="callAlarm">
			<image mode="widthFix" src="/static/common/alarm.png" style="width: 45upx" />
			<view style="font-size: 22upx; color: #fff">警报</view>
		</view>
	</view>
</template>

<script setup>
// import { ref, watch, reactive, toRefs, onMounted } from "vue";
import request from '/common/request.js';

const callAlarm = () => {
	uni.showLoading({
		content: '加载中',
		mask: true
	});
	request({
		url: '/api/userjs/callPost',
		method: 'GET',
		success: (res) => {
			console.log('警报结果', res);
			uni.showToast({
				title: res.data.msg,
				duration: 1500,
				icon: 'none'
			});
		},
		fail: () => {},
		complete: () => {
			setTimeout(() => {
				uni.hideLoading();
			}, 1500);
		}
	});
};
</script>

<style lang="scss" scoped>
.call_alarm_back {
	display: flex;
	flex-direction: column;
	align-items: center;

	width: 80upx;
	height: 80upx;
	border-radius: 50%;
	background-color: red;
	padding: 10upx;
}
</style>
