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

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

parent 23747f2d
Pipeline #8678 passed with stage
in 5 minutes and 15 seconds
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
--> -->
<template> <template>
<div id="app"> <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"> <transition :name="transitionName">
<keep-alive :include="cachePage"> <keep-alive :include="cachePage">
<router-view class="router-view" /> <router-view class="router-view" />
...@@ -111,17 +112,21 @@ export default { ...@@ -111,17 +112,21 @@ export default {
<style lang="less"> <style lang="less">
body{
background-color: #f0f1f5;
}
#app { #app {
font-family: "Avenir", Helvetica, Arial, sans-serif; font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
// text-align: center; // text-align: center;
color: #2c3e50; color: #2c3e50;
box-sizing: border-box; // box-sizing: border-box;
overflow: hidden; // overflow: hidden;
position: relative; // position: relative;
overflow: hidden; // overflow: hidden;
height: 100vh; // height: 100vh;
// background-color: #f0f1f5;
// z-index:999999999999 // z-index:999999999999
} }
#app-content { #app-content {
...@@ -132,18 +137,35 @@ export default { ...@@ -132,18 +137,35 @@ export default {
top: 0; top: 0;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
// padding-bottom: 1.3333rem;
height: 100%; // 此处新增height 为了解决ios适配问题
} }
.router-view { .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%; width: 100%;
height: auto; height: auto;
-webkit-overflow-scrolling: touch;
background-color: #f0f1f5;
overflow: auto;
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
margin: 0 auto; margin: 0 auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
background-color: #f0f1f5; padding-bottom: 50px;
overflow: auto; box-sizing: border-box;
} }
.slide-right-enter-active, .slide-right-enter-active,
......
export function timestampToTime (time,type,zero,num) { export function timestampToTime (time,type,zero,num) {
if(!time){return ''} if(!time){return ''}
try{ try{
var date = new Date(time) var date = new Date(time.toString().replace(/-/g, "/"))
if(num&&typeof parseInt(num)=="number"){ 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 yy = date.getFullYear();//年
let mm = date.getMonth()+1;//月 let mm = date.getMonth()+1;//月
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
<div class="icon_wrap_text"> <div class="icon_wrap_text">
<div class="icon_wrap_text1">{{ item.content }}</div> <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-if="item.content=='日查清单'">{{ item.startTime| formatDate }}</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-else>{{ item.startTime| formatDate }}{{ item.validityTime| formatDate }}</span>
</div> </div>
</div> </div>
...@@ -129,7 +129,12 @@ export default { ...@@ -129,7 +129,12 @@ export default {
} }
}); });
} }
} },
filters: {
  formatDate (time) {
     return timestampToTime(time, "DT7", true)
  }
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -426,9 +426,9 @@ export default { ...@@ -426,9 +426,9 @@ export default {
} }
.operation-btn { .operation-btn {
width: 95%; width: 95%;
margin: 10px 10px; margin: 20px 10px 10px;
position: fixed; position: fixed;
bottom: 50px; bottom: 1.3333rem;
right: 0; right: 0;
left: 0; left: 0;
} }
......
...@@ -5,7 +5,8 @@ module.exports = { ...@@ -5,7 +5,8 @@ module.exports = {
proxy: { proxy: {
'/app-api': { '/app-api': {
// target: 'http://192.168.0.108:8096', // 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, // changeOrigin: true,
// logLevel:'debug', // 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