加悬浮按钮

This commit is contained in:
”Rain“ 2024-05-22 21:41:59 +08:00
parent 53e6df2f57
commit 565b581a44
32 changed files with 179 additions and 128 deletions

View File

@ -1,12 +1,4 @@
<template>
<view class="">
<router-view />
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
export default {
globalData: {
siteUrl: '',

View File

@ -55,10 +55,9 @@
} = uni.getSystemInfoSync();
this.windowWidth = windowWidth
this.windowHeight = windowHeight
},
onShow() {
this.projectSn = uni.getStorageSync('devInfoList').projectSn;
this.workerInfoId = uni.getStorageSync('devInfoList').id;
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn;
this.workerInfoId = JSON.parse(uni.getStorageSync('userInfo')).userId;
console.log(JSON.parse(uni.getStorageSync('userInfo')));
},
methods: {
drag_start(event) {
@ -148,127 +147,127 @@
this.orientation();
return
}
emergencyRecordAdd({
projectSn: this.projectSn,
emergencyTypeId: -1,
alarmPersonId: this.workerInfoId,
}).then(result => {
if (result.code == 200) {
// uni.showToast({
// title: ""
// })
that.id = result.result.id;
console.log(result);
} else {
uni.showToast({
title: result.message,
icon: "none"
})
}
}).finally(() => {
uni.showModal({
title: '提示信息',
content: '是否快速报警?',
cancelText: "取消",
confirmText: "确认",
success: function(res) {
if (res.confirm) {
// uni.navigateTo({
// url: `${url}?id=${that.id}`,
// });
uni.showLoading({
title: "报警中..."
})
uni.getLocation({
type: 'gcj02',
// type: 'wgs84',
geocode: true, //true
isHighAccuracy: "true",
accuracy: "best", // 20m
success: function(res) {
console.log(res)
// const latitude = parseFloat(res.latitude);
// const longitude = parseFloat(res.longitude);
that.emergencyInfo.longitude = parseFloat(res
.longitude);
that.emergencyInfo.latitude = parseFloat(res
.latitude);
that.addressList = [
res.address.province,
res.address.city,
res.address.district,
res.address.street,
res.address.poiName,
]
that.emergencyInfo.incidentSite = that
.addressList.map(
item => item).join('')
console.log(111111111);
console.log(that.emergencyInfo.longitude, that
.emergencyInfo.latitude);
uni.showModal({
title: '提示信息',
content: '是否快速报警?',
cancelText: "取消",
confirmText: "确认",
success: function(res) {
if (res.confirm) {
// uni.navigateTo({
// url: `${url}?id=${that.id}`,
// });
emergencyRecordAdd({
projectSn: that.projectSn,
emergencyTypeId: -1,
alarmPersonId: that.workerInfoId,
}).then(result => {
if (result.code == 200) {
// uni.showToast({
// title: ""
// })
that.id = result.result.id;
console.log(result);
uni.showLoading({
title: "报警中..."
})
uni.getLocation({
type: 'gcj02',
// type: 'wgs84',
geocode: true, //true
isHighAccuracy: "true",
accuracy: "best", // 20m
success: function(res) {
console.log(res)
// const latitude = parseFloat(res.latitude);
// const longitude = parseFloat(res.longitude);
that.emergencyInfo.longitude = parseFloat(res
.longitude);
that.emergencyInfo.latitude = parseFloat(res
.latitude);
that.addressList = [
res.address.province,
res.address.city,
res.address.district,
res.address.street,
res.address.poiName,
]
that.emergencyInfo.incidentSite = that
.addressList.map(
item => item).join('')
emergencyRecordEdit({
id: that.id,
projectSn: that.projectSn,
incidentSite: that.emergencyInfo
.incidentSite,
longitude: that.emergencyInfo
.longitude,
latitude: that.emergencyInfo
.latitude,
}).then(result => {
if (result.code == 200) {
uni.showToast({
title: result
.message,
})
emergencyRecordSendNotice({
projectSn: that
.projectSn,
incidentSite: that
.emergencyInfo
.incidentSite,
id: that.id,
}).then(result => {
if (result.code ==
200) {
uni
.hideLoading(); //
} else {
uni.showToast({
title: result
.message,
icon: "none"
})
}
})
} else {
uni.showToast({
title: result
.message,
icon: "none"
})
uni.hideLoading(); //
}
})
console.log(111111111);
console.log(that.emergencyInfo.longitude, that
.emergencyInfo.latitude);
// that.addrDel = res;
},
fail: function() {
uni.showToast({
title: '获取地址失败,将导致部分功能不可用',
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
emergencyRecordEdit({
id: that.id,
projectSn: that.projectSn,
incidentSite: that.emergencyInfo
.incidentSite,
longitude: that.emergencyInfo
.longitude,
latitude: that.emergencyInfo
.latitude,
}).then(result => {
if (result.code == 200) {
uni.showToast({
title: result
.message,
})
emergencyRecordSendNotice({
projectSn: that
.projectSn,
incidentSite: that
.emergencyInfo
.incidentSite,
id: that.id,
}).then(result => {
if (result.code ==
200) {
uni
.hideLoading(); //
} else {
uni.showToast({
title: result
.message,
icon: "none"
})
}
})
} else {
uni.showToast({
title: result
.message,
icon: "none"
})
uni.hideLoading(); //
}
})
// that.addrDel = res;
},
fail: function() {
uni.showToast({
title: '获取地址失败,将导致部分功能不可用',
icon: 'none'
});
}
});
} else {
uni.showToast({
title: result.message,
icon: "none"
})
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
})
}
});
},
}
}

View File

@ -41,10 +41,12 @@
</view>
</view>
<footers :activeTab="'mssage'" v-if="accountType == 5 || accountType == 6 || accountType == 10"></footers>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../components/headers/headers.vue'
import footers from '../../components/footers/footers.vue'
export default {

View File

@ -52,10 +52,12 @@
</view>
<footers v-if="flag" :activeTab="'my'"></footers>
<footers2 v-else></footers2>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import { exitApp } from "@/utils/tool.js"
import footers from "@/components/footers/footers.vue"
import footers2 from "@/components/footers/footers2.vue"

View File

@ -24,10 +24,12 @@
<view><uni-icons2 class="arrowright" type="arrowright" size="20"></uni-icons2></view>
</view>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
components: {

View File

@ -20,10 +20,12 @@
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -31,10 +31,12 @@
<span class="details-remark">{{result.remark}}</span>
</view>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -35,10 +35,12 @@
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -136,10 +136,12 @@
</view>
</uni-popup>
<footers :activeTab="'projectEnd'" v-if="accountType == 5 || accountType == 6 || accountType == 10"></footers>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
import footers from '../../../components/footers/footers.vue'
import checkVersion from '@/pages/lq-upgrade/checkVersion.js'

View File

@ -271,10 +271,12 @@
<canversCom v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import canversCom from "@/pages/videoManage/component/canversCom.vue"
import tkiTree from "@/components/tki-tree/tki-tree.vue"
import headers from '../../../components/headers/headers.vue';

View File

@ -116,10 +116,12 @@
</view>
</template>
</dialogs>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
import dialogs from '../../../components/dialog/dialog.vue'
export default {

View File

@ -42,10 +42,12 @@
</view>
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default{
data(){

View File

@ -27,10 +27,12 @@
</view>
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default{
data(){

View File

@ -39,10 +39,12 @@
</view>
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
data() {

View File

@ -44,10 +44,12 @@
</scroll-view>
<view class="submit-btn" @click="submitForm">提交</view>
<canversCom v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import canversCom from "@/pages/videoManage/component/canversCom.vue"
import headers from '../../../components/headers/headers.vue'
export default{

View File

@ -81,10 +81,12 @@
</view>
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default{
data(){

View File

@ -37,10 +37,12 @@
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default{
data(){

View File

@ -271,10 +271,12 @@
<canversCom v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import canversCom from "@/pages/videoManage/component/canversCom.vue"
import tkiTree from "@/components/tki-tree/tki-tree.vue"
import headers from '../../../components/headers/headers.vue';

View File

@ -42,10 +42,12 @@
</view>
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -41,10 +41,12 @@
</view>
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
data() {

View File

@ -80,10 +80,12 @@
</view>
</view>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
navigationBarTitleText: '页面标题',

View File

@ -80,10 +80,12 @@
</view>
</view>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
navigationBarTitleText: '页面标题',

View File

@ -42,10 +42,12 @@
</view>
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -31,10 +31,12 @@
<span class="details-remark">{{result.remark}}</span>
</view>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -41,10 +41,12 @@
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -20,10 +20,12 @@
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -48,10 +48,12 @@
</view>
</view>
<view class="delete" @click="deleteEvent">删除</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -25,10 +25,12 @@
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {

View File

@ -79,10 +79,12 @@
<view class="submit-btn" @click="submitForm">提交通知</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
data(){

View File

@ -56,10 +56,12 @@
</ul>
</view>
</scroll-view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
data(){

View File

@ -296,10 +296,12 @@
</scroll-view>
<mx-date-picker :show="showPicker" type="rangetime" :value="value" :show-tips="true" :begin-text="'会议开始'" :end-text="'会议结束'" :show-seconds="true" @confirm="ed" @cancel="ed" />
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue";
export default {

View File

@ -302,10 +302,12 @@
</scroll-view>
<mx-date-picker :show="showPicker" type="rangetime" :value="value" :show-tips="true" :begin-text="'会议开始'" :end-text="'会议结束'" :show-seconds="true" @confirm="ed" @cancel="ed" />
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue";
import headers from '../../../components/headers/headers.vue'
export default {