submitBtn.vue
3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<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>