zhgdyunapp_vue3/App.vue

767 lines
17 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script>
export default {
globalData: {
siteUrl: "",
BluetoothState: false, // 蓝牙适配器状态
connectState: false, // 蓝牙连接状态
},
onLaunch: function() {
if (process.env.NODE_ENV === "development") {
// 开发环境
this.globalData.siteUrl = "http://192.168.34.221:9111"; //郭圣熊本地
// this.globalData.siteUrl = 'http://182.90.224.147:100/' //演示平台
// this.globalData.siteUrl = 'http://124.71.178.44:8012/' // 河南
// this.globalData.siteUrl = 'http://182.90.224.237:7000/' //广西联通
// this.globalData.siteUrl = 'http://124.71.67.160:8088/' //中建四局
// this.globalData.siteUrl = 'http://192.168.34.148:6023/' //广西联通/本地
// this.globalData.siteUrl = 'http://8.142.139.165:7080/' // 湖里
// this.globalData.siteUrl = "http://58.34.63.88:9090/"
// this.globalData.siteUrl = 'http://192.168.34.125:6023/'
// this.globalData.siteUrl = 'http://223.82.100.80:9000/'
// this.globalData.siteUrl = 'http://120.236.247.200:9000/'
// this.globalData.siteUrl = 'http://zhgd.loganwy.com/'
// this.globalData.siteUrl = 'http://183.60.227.61:30249/'
// this.globalData.siteUrl = 'http://124.71.178.44:9000/'
// this.globalData.siteUrl = "http://183.95.84.34:7185/"
// this.globalData.siteUrl = "http://36.137.53.203:9090/"
// this.globalData.siteUrl = 'http://124.71.178.44:8/'
// this.globalData.siteUrl = 'http://192.168.34.116:6023/'//邱平毅本地
// Vue.prototype.url_config = 'http://124.71.87.250/'
// this.globalData.siteUrl = 'http://58.250.210.4:9090/'
// this.globalData.siteUrl = 'http://182.90.224.147:18170'//瑞士恒通
// this.globalData.siteUrl = 'https://jxjzhgd.yyvtl.com:8443/'//三江
// this.globalData.siteUrl = 'http://192.168.34.221:8188'//中建四局本地
// this.globalData.siteUrl = 'http://101.43.164.214:12350'//中建五局
// this.globalData.siteUrl = 'http://42.194.144.62:8088'//新中建四局地址
// this.globalData.siteUrl = 'http://192.168.34.221:11111'//郭圣雄三江本地
// this.globalData.siteUrl = 'http://192.168.34.221:30002'//郭圣熊本地
// this.globalData.siteUrl = 'http://182.90.224.147:15551'//成润线上
} else {
// 生产环境
console.log("生产环境");
//this.globalData.siteUrl = 'http://192.168.34.221:9111/' // 雄哥
// this.globalData.siteUrl = 'http://8.142.139.165:7080/' // 湖里
// this.globalData.siteUrl = 'http://182.90.224.147:100/' // 演示平台
// this.globalData.siteUrl = 'http://124.71.178.44:8012/' // 河南
// this.globalData.siteUrl = 'http://192.168.34.148:6023/' //广西联通/本地
// this.globalData.siteUrl = 'http://182.90.224.237:7000/' //广西联通
// this.globalData.siteUrl = 'http://124.71.67.160:8088/' //中建四局
// this.globalData.siteUrl = "http://58.34.63.88:9090/"
// this.globalData.siteUrl = 'http://124.71.178.44:9000/'
// Vue.prototype.url_config = 'http://192.168.34.125:6023/'
// Vue.prototype.url_config = 'http://120.236.247.200:9000/'
// this.globalData.siteUrl = "http://183.95.84.34:7185/"
// this.globalData.siteUrl = "https://183.95.84.34:6183/"
// this.globalData.siteUrl = "http://36.137.53.203:9090/"
// this.globalData.siteUrl = 'http://183.60.227.61:30249/'
// this.globalData.siteUrl = 'http://zhgd.loganwy.com/'
// this.globalData.siteUrl = "http://36.137.53.203:9090/"
// this.globalData.siteUrl = 'http://192.168.34.116:6023/'//邱平毅本地
// Vue.prototype.url_config = 'http://124.71.87.250/'
// Vue.prototype.url_config = 'http://58.250.210.4:9090/'
// this.globalData.siteUrl = 'http://182.90.224.147:18170'//瑞士恒通
// this.globalData.siteUrl = 'https://jxjzhgd.yyvtl.com:8443/'//三江
// this.globalData.siteUrl = 'http://192.168.34.221:8188'//中建四局本地
// this.globalData.siteUrl = 'http://101.43.164.214:12350'//中建五局
// this.globalData.siteUrl = 'http://42.194.144.62:8088'//新中建四局地址
// this.globalData.siteUrl = 'http://192.168.34.221:11111'//郭圣雄三江本地
// this.globalData.siteUrl = 'http://182.90.224.147:15551'//成润线上
// this.globalData.siteUrl = 'http://101.43.164.214:45022/'//盘锦
// this.globalData.siteUrl = 'http://183.249.224.118:9000/'// 嘉兴项目
// this.globalData.siteUrl = 'http://jxj.zhgdyun.com:30250/#/'// 演示平台H5
this.globalData.siteUrl = "http://47.93.215.234:9809/"; // 鞍钢
// this.globalData.siteUrl = 'http://10.168.1.105:11111/'//
}
var systemInfo;
var that = this;
uni.getSystemInfo({
success(res) {
systemInfo = res;
uni.setStorageSync("systemInfo", res);
// if(res.platform.indexOf('android')!=-1&& typeof plus!=="undefined"){
// //获取最新版本
// that.sendRequest({
// url: "xmgl/appVersion/getAppVersion",
// data: {},
// method: "POST",
// success(res2){
// console.log('最新版本',res2)
// //获取当前应用版本
// // console.log('plus.runtime.version',plus.runtime.version)
// if(res2.result&&(res2.result.versionNo!=plus.runtime.version)){
// uni.showModal({
// title:'版本更新',
// content:'更新内容:'+res2.result.versionDescribe,
// confirmText:'更新',
// success(res) {
// if (res.confirm) {
// console.log('用户点击确定');
// uni.downloadFile({
// url: res2.result.downloadUrl,
// success: (res) => {
// if (res.statusCode === 200) {
// console.log('下载成功');
// }
// }
// });
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// })
// }
// }
// })
// }
},
});
// #ifdef APP-PLUS
const _self = this;
// const _handlePush = function(message) {
// // TODO
// console.log(message, "====================================")
// // setTimeout(() => {
// // uni.navigateTo({
// // url: message.payload
// // })
// // }, 1000)
// };
// plus.push.addEventListener('click', _handlePush);
// plus.push.addEventListener('receive', _handlePush);
// ios
// if(uni.getSystemInfoSync().platform == 'ios'){
// plus.push.addEventListener('receive', function(msg){
// plus.push.createMessage(msg.content, JSON.stringify(msg), {title: msg.title});
// });
// console.log('哈哈哈哈哈哈哈',uni.getSystemInfoSync());
// }else{
// console.log('哈哈哈哈哈哈哈',uni.getSystemInfoSync());
// plus.push.addEventListener('click', function(msg){
// // TODO
// console.log(msg, "====================================")
// setTimeout(() => {
// uni.navigateTo({
// url: msg.payload
// })
// },1000)
// });
// }
var payload = "";
plus.push.addEventListener(
"receive",
function(msg) {
console.log("-----------------", msg);
plus.push.createMessage(msg.content, JSON.stringify(msg), {
title: msg.title,
});
payload = msg.payload;
},
false
);
plus.push.addEventListener(
"click",
function(msg) {
// TODO
console.log("888====================", msg);
console.log("777====================", payload);
// let msgData = msg.payload;
uni.navigateTo({
url: "/pages/messageCenter/messageCenter",
});
// setTimeout(() => {
// uni.navigateTo({
// url: payload
// })
// console.log(msgData)
// if(msgData.type == 10){ // 安全
// uni.navigateTo({
// url: '/pages/projectEnd/safeSame/details?id='+msgData.data.id+'&type=' + msgData.data.status
// })
// } else if(msgData.type == 11){ // 质量
// uni.navigateTo({
// url: '/pages/projectEnd/qualityManage/details?id='+msgData.data.id+'&type=' + msgData.data.status
// })
// } else if(msgData.type == 8){ // AI
// uni.navigateTo({
// url: "/pages/alarmPage/disposition/disposition?item="+ encodeURIComponent(JSON.stringify(msgData.data))
// });
// }
// uni.navigateTo({
// url: '/pages/messageCenter/messageCenter'
// })
// }, 1000)
},
false
);
plus.screen.lockOrientation("portrait-primary")
// #endif
},
onShow: function() {
console.log("App Show");
// this.$nextTick(() => {
// var html_ = document.getElementsByTagName('html')[0];
// html_.style.fontSize = this.$pageSize + 'px';
// console.log(this.$pageSize)
// })
},
onHide: function() {
console.log("App Hide");
},
};
</script>
<style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss";
.uni-toast {
width: 220rpx !important;
// height: 250rpx;
.uni-toast__content {
font-size: 24rpx;
}
}
.uni-toast:has(.uni-loading) {
// background-color: transparent !important;
// color: #000000 !important;
display: flex;
flex-direction: column;
align-items: center;
.uni-loading {
width: 200rpx !important;
height: 200rpx !important;
background: rgba(0, 0, 0, 0) url("/static/bthgIcon/loading.gif") no-repeat;
background-size: 100% 100%;
}
}
.uni-toast:has(.uni-icon-success-no-circle) {
background-color: rgba(17, 17, 17, 0.7) !important;
color: #fff !important;
display: flex;
align-items: baseline;
justify-content: center;
padding-top: 14rpx;
padding-bottom: 14rpx;
.uni-icon-success-no-circle {
width: 20rpx !important;
height: 20rpx !important;
background-color: #4bd384;
border-radius: 50%;
margin-top: 0;
margin-right: 10rpx;
}
.uni-icon-success-no-circle::before {
display: none;
}
.uni-toast__content {
margin-bottom: 0;
}
}
.uni-input {
font-size: 32rpx;
line-height: 50rpx;
height: 50rpx;
min-height: 50rpx;
}
/*每个页面公共css */
html {
// background-color: $uni-color-primary;
// background-color: #f3f5fd;
color: $uni-text-color;
}
.bgLightBlue {
background-color: #f3f5fd;
}
uni-page-body,
page {
height: 100%;
// background-color: #f3f5fd;
}
.fullHeight {
height: 100%;
}
.bgWhite {
background-color: white;
}
.btn {
border-radius: 6rpx;
}
.btn[type="primary"] {
background-color: $uni-color-primary;
}
.primaryText {
color: $uni-color-primary;
}
.primaryText2 {
color: $--color-primary2;
}
.primaryText3 {
color: $--color-primary3;
}
.primaryText4 {
color: $--color-primary4;
}
.primaryText5 {
color: $--color-primary5;
}
.redText {
color: $--color-primary6;
}
.fixedHeaderBox {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: white;
z-index: 2;
}
.whiteHeaderBox {
.headerBox {
color: white;
background-color: #2b8df3;
.backImg {
color: white !important;
opacity: 1;
}
}
}
.headerBox {
height: 88rpx;
align-items: center;
background-color: white;
// color: rgba(42, 43, 91, 1);
color: #000000;
justify-content: center;
position: relative;
z-index: 2;
// border-bottom: 1px solid rgba(194, 194, 194, 0.2);
font-size: 32rpx;
.backImg {
width: 48rpx;
height: 48rpx;
position: absolute;
top: 18rpx;
left: 20rpx;
font-size: 48rpx !important;
// opacity: 0.8;
z-index: 999;
}
.headerName {
text-align: center;
// font-size: 36rpx;
line-height: 88rpx;
z-index: 3;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
font-size: 32rpx;
// font-weight: bold;
}
}
.pageContent {
height: calc(100% - 48px);
}
.fixedHeaderPageContent {
padding-top: 48px;
}
.scroll-view_H {
white-space: nowrap;
padding: 0 40rpx 0 0;
width: calc(100% - 40rpx);
background-color: #ffffff;
.scroll-view-item_H {
display: inline-block;
padding: 10rpx 20rpx;
font-size: 14px;
width: 80px;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
.name {
display: inline;
padding: 4rpx 0;
}
&.active {
.name {
font-weight: bold;
border-bottom: 4px solid $uni-color-primary;
}
}
}
}
.blockBox {
background-color: white;
padding: 20rpx;
margin: 20rpx 0;
.blockTitle {
position: relative;
margin-bottom: 20rpx;
.titleName {
color: $uni-text-color;
font-size: 17px;
padding-left: 20rpx;
// border-left: 4rpx solid $uni-color-primary;
font-weight: bold;
position: relative;
&::before {
content: "";
position: absolute;
left: 0;
top: 10%;
width: 6rpx;
height: 80%;
background-color: $uni-color-primary;
}
}
}
}
.dataBox {
display: flex;
align-items: center;
.dataItem {
flex: 1;
text-align: center;
.num {
font-size: 48rpx;
}
.text {
font-size: 24rpx;
color: $uni-text-color;
opacity: 0.8;
}
}
}
.placeholderBox {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
text-align: center;
.noDataImg {
width: 84rpx;
height: 65px;
}
.text {
color: $uni-text-color;
opacity: 0.7;
font-size: 26rpx;
margin-top: 6px;
}
}
.modalBox {
position: fixed;
background-color: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
top: 0;
left: 0;
color: $uni-text-color;
.modalContent {
background-color: white;
position: fixed;
width: calc(90% - 60rpx);
left: 5%;
top: 50%;
padding: 30rpx;
transform: translateY(-50%);
.modalTitle {
font-size: 32rpx;
text-align: center;
border-bottom: 1px solid #ddd;
padding-bottom: 20rpx;
margin-bottom: 25px;
position: relative;
.closeImg {
position: absolute;
right: 0;
top: -10rpx;
opacity: 0.6;
}
}
}
}
.formBox {
margin: 40rpx 30rpx;
.uni-form-item {
display: flex;
align-items: center;
color: $uni-text-color2;
margin-bottom: 30rpx;
}
.uni-form-label {
width: 240rpx;
}
.uni-form-input {
width: calc(100% - 120px);
position: relative;
.uni-input {
height: 70rpx;
border-radius: 70rpx;
border: 1px solid rgba(42, 43, 91, 0.3);
line-height: 70rpx;
padding: 0 30rpx;
overflow: hidden;
&.disabled {
background-color: rgba(216, 216, 216, 0.2);
}
}
.floatBtn {
position: absolute;
right: 0;
top: 0;
height: 100%;
line-height: 70rpx;
padding: 0 30rpx;
border-top-right-radius: 70rpx;
border-bottom-right-radius: 70rpx;
font-size: 30rpx;
color: white;
background-color: $uni-color-primary;
}
}
}
.formBox2 {
margin: 60rpx 40rpx 20rpx;
.uni-form-item {
color: $uni-text-color2;
margin-bottom: 30rpx;
}
.uni-form-label {
font-size: 24rpx;
}
.uni-form-input {
width: 100%;
position: relative;
font-size: 32rpx;
.uni-input {
height: 70rpx;
border-bottom: 1px solid rgba(217, 217, 217, 1);
line-height: 70rpx;
padding: 0 30rpx;
overflow: hidden;
&:disabled {
background-color: rgba(216, 216, 216, 0.3);
}
}
}
}
.cl {
color: rgba(42, 43, 91, 0.3);
}
uni-swiper .uni-swiper-dot {
width: 16rpx;
height: 16rpx;
}
.uni-picker-container {
// .uni-picker-header {
// height: 90rpx;
// // display: block !important;
// }
.uni-picker-action {
line-height: 90rpx;
font-size: 34rpx;
padding: 0 28rpx;
}
.uni-picker-custom {
font-size: 32rpx;
width: 100% !important;
left: 0 !important;
bottom: 0 !important;
top: initial !important;
}
// .uni-picker-content {
// height: 476rpx;
// }
// .uni-picker-item {
// height: 68rpx;
// line-height: 68rpx;
// }
}
.uni-selector-select .uni-picker-select {
max-height: 600rpx;
}
:deep(uni-radio) {
.uni-radio-input {
width: 34rpx;
height: 34rpx;
}
.uni-radio-input.uni-radio-input-checked:before {
font-size: 36rpx;
}
}
.uni-picker-view-indicator {
height: 68rpx;
}
.uni-select {
display: flex;
align-items: center;
justify-content: space-between;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: relative;
.icon-down {
width: 26rpx;
height: 26rpx;
opacity: 0.5;
}
}
.uni-icons_34 {
font-size: 68rpx !important;
}
.uni-icons_30 {
font-size: 60rpx !important;
}
.star {
color: $uni-color-error;
margin-right: 10rpx;
font-size: 32rpx;
vertical-align: middle;
}
.submitBtn {
border-radius: 80rpx;
margin-top: 60rpx;
height: 80rpx;
line-height: 80rpx;
border: 1px solid rgba(43, 141, 243, 1);
&.big {
height: 100rpx;
line-height: 100rpx;
box-shadow: 0px 8rpx 16rpx 0px rgba(43, 141, 243, 0.42);
font-size: 40rpx;
}
}
.deleteBtn {
border-radius: 80rpx;
height: 80rpx;
line-height: 80rpx;
border: 1px solid #e64340;
color: #e64340;
background-color: white;
margin-top: 30rpx;
&.big {
height: 100rpx;
line-height: 100rpx;
font-size: 40rpx;
}
}
.more-btn {
display: flex;
align-items: center;
justify-content: center;
.detail_icon_up {
width: 20rpx;
height: 20rpx;
margin-left: 10rpx;
}
.detail_icon_down {
transform: rotate(180deg);
}
}
.no_data1 {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
color: rgba(0, 0, 0, 0.5);
font-size: 28rpx;
uni-image {
width: 612rpx;
height: 522rpx;
display: block;
margin: 0 auto;
}
}
</style>