submitBtn.vue 3.06 KB
<template>
	<view class="submit-btn-form">
		<view class="submit-btn-form-container">
      <view class="submitBtn" @click="goBackPage">{{ t('app.common.back') }}</view>
      <view class="submitBtn submitBtnSubmit" @click="handleInspection">{{ t('app.common.viewVideo') }}</view>
      
      
		<!-- 	<uv-button class="submitBtn" text="返回" style="margin-right: 10px;" :customStyle="backCustomStyle" ></uv-button>
      <uv-button class="submitBtn submitBtnSubmit" type="primary" text="查看视频" :customStyle="submitCustomStyle" @click="handleInspection"></uv-button>
      -->
			
		</view>
	</view>
</template>

<script setup>
	import { nextTick, onMounted, ref, } from 'vue';
	import { getStageObj } from '@/utils'
	import { doGetPatrolGateApi } from '@/api';
  import {
    t
  } from '@/plugins/index.js'
	const props = defineProps({
	  detailData: {
	    type: Object,
	    default: () => {}
	  },
	})
	const videoObj = ref({})
	// const backCustomStyle = ref({
 //    'width':'calc(50% - 10px)',
	// 	'height':'48px',
	// 	'background':' #F2F3F6',
	// 	'border-radius': '8px',
	// 	'border':'0px',
	// })
	// const submitCustomStyle = ref({
	// 	'height':'48px',
	// 	'background': 'linear-gradient( 270deg, #387CF5 0%, #5B9FF7 100%)',
	// 	'border-radius': '8px',
	// 	'border':'0px',
	// })
	// 返回上一页
	function goBackPage() {
		uni.navigateBack({
			delta: 1,
		});
	}
	// 查看视频
	function handleInspection(data) {
		console.log('handleInspection', videoObj.value)
		const strData = JSON.stringify(videoObj.value)
		console.log('strData', strData)
		// 存储数据到localstorage中
    uni.setStorageSync('inspectionCurrentMonitor',strData)
    nextTick(()=>{
      uni.navigateTo({
        url: `/subPackages/accountGroup/pages/inspection/inspectionPlayer`,
      })
    })
	}
	// 查询监控点信息
	function getPatrolGate(id) {
		doGetPatrolGateApi(id).then(res => {
			console.log('doGetPatrolGateApi', res)
			videoObj.value = res.data ||{}
			videoObj.value.origin = 'processing'
		})
	}
	onMounted(() => {
		if(props&&props.detailData){
      uni.setStorageSync('inspectionDetailData',JSON.stringify(props.detailData))
      nextTick(()=>{
        getPatrolGate(props.detailData.gateId)
      })
		}
	})
</script>

<style lang="scss" scoped>
	.submit-btn-form {
		position: fixed;
		bottom: 10px;
		width: calc(100vw - 20px);
		// position: sticky;
		// bottom: 200px;
		background: white;
		z-index: 100;
		padding: 10px;
	}
	.submit-btn-form-container {
		width: 100%;
		display: flex;
    gap: 10px;
		justify-content: space-between;
		align-items: center;
	}
	.submitBtn{
		// width: 46vw;
		flex: 1;
		height: 48px;
    line-height: 48px;
    text-align: center;
		background: #F2F3F6;
		border-radius: 8px;
		font-family: PingFangSC, PingFang SC;
		font-size: 16px;
	}
	.submitBtnSubmit{
		color: #FFFFFF;
		background: linear-gradient( 270deg, #387CF5 0%, #5B9FF7 100%);
	}
</style>
<style>
	.submitBtn .uv-button .uv-button__text{
		font-size: 16px!important;
		color: #90949D!important;
	}
	.submitBtnSubmit .uv-button .uv-button__text{
		color: #FFFFFF!important;
	}
</style>