Commit d519b1e1 authored by 王李辉's avatar 王李辉

ios高度适配和时间格式化问题

parent 23747f2d
Pipeline #8678 passed with stage
in 5 minutes and 15 seconds
......@@ -9,7 +9,8 @@
-->
<template>
<div id="app">
<div :style="{ height: showTab ?appHeight:'100%' }" id="app-content">
<!-- :style="{ height: showTab ?appHeight:'100%' }" 之前是给id为app-content 设置的内联样式 id="app-content" -->
<div>
<transition :name="transitionName">
<keep-alive :include="cachePage">
<router-view class="router-view" />
......@@ -111,17 +112,21 @@ export default {
<style lang="less">
body{
background-color: #f0f1f5;
}
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
// text-align: center;
color: #2c3e50;
box-sizing: border-box;
overflow: hidden;
position: relative;
overflow: hidden;
height: 100vh;
// box-sizing: border-box;
// overflow: hidden;
// position: relative;
// overflow: hidden;
// height: 100vh;
// background-color: #f0f1f5;
// z-index:999999999999
}
#app-content {
......@@ -132,18 +137,35 @@ export default {
top: 0;
width: 100%;
overflow: hidden;
// padding-bottom: 1.3333rem;
height: 100%; // 此处新增height 为了解决ios适配问题
}
.router-view {
// width: 100%;
// height: 100%;
// position: absolute;
// top: 0;
// bottom: 0;
// margin: 0 auto;
// -webkit-overflow-scrolling: touch;
// background-color: #f0f1f5;
// overflow: auto;
width: 100%;
height: auto;
-webkit-overflow-scrolling: touch;
background-color: #f0f1f5;
overflow: auto;
position: absolute;
top: 0;
bottom: 0;
margin: 0 auto;
-webkit-overflow-scrolling: touch;
background-color: #f0f1f5;
overflow: auto;
padding-bottom: 50px;
box-sizing: border-box;
}
.slide-right-enter-active,
......
export function timestampToTime (time,type,zero,num) {
if(!time){return ''}
try{
var date = new Date(time)
var date = new Date(time.toString().replace(/-/g, "/"))
if(num&&typeof parseInt(num)=="number"){
date = new Date(new Date(time).getTime()+num*60*60*24*1000)//时间戳以毫秒为单位,也可用其他日期格式
date = new Date(new Date(time.toString().replace(/-/g, "/")).getTime()+num*60*60*24*1000)//时间戳以毫秒为单位,也可用其他日期格式
}
let yy = date.getFullYear();//年
let mm = date.getMonth()+1;//月
......
......@@ -24,8 +24,8 @@
<div class="icon_wrap_text">
<div class="icon_wrap_text1">{{ item.content }}</div>
<span class="icon_wrap_text2" v-if="item.content=='日查清单'">{{util.timestampToTime(item.startTime,'DT7',true)}}</span>
<span class="icon_wrap_text2" v-else>{{util.timestampToTime(item.startTime,'DT7',true)}}{{util.timestampToTime(item.validityTime,'DT7',true)}}</span>
<span class="icon_wrap_text2" v-if="item.content=='日查清单'">{{ item.startTime| formatDate }}</span>
<span class="icon_wrap_text2" v-else>{{ item.startTime| formatDate }}{{ item.validityTime| formatDate }}</span>
</div>
</div>
......@@ -129,7 +129,12 @@ export default {
}
});
}
}
},
filters: {
  formatDate (time) {
     return timestampToTime(time, "DT7", true)
  }
},
};
</script>
<style lang="less" scoped>
......
......@@ -426,9 +426,9 @@ export default {
}
.operation-btn {
width: 95%;
margin: 10px 10px;
margin: 20px 10px 10px;
position: fixed;
bottom: 50px;
bottom: 1.3333rem;
right: 0;
left: 0;
}
......
......@@ -5,7 +5,8 @@ module.exports = {
proxy: {
'/app-api': {
// target: 'http://192.168.0.108:8096',
target: 'http://192.168.15.146:8096',
target: 'http://192.168.124.7:8096',
// target: 'http://192.168.15.169:8096',
// changeOrigin: true,
// logLevel:'debug',
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment