Commit 73f60ee5 authored by godwithdh's avatar godwithdh
parents 7333ec5a 64ec0f9b
module.exports = [
{
name:'main',
component: () => import('@/view/main.vue'),
path:'/main',
children:[
{
path:'/healthCard',
name:'healthCard',
component:()=> import('@/view/healthCard/index.vue'),
meta:{
title: '健康打卡'
}
}
]
},
{
name:'healthCard',
component: () => import('@/view/healthCard/index.vue'),
path:'/healthCard',
children:[
{
path:'statistics/index',
name:'healthCardStatisticsIndex',
component:()=> import('@/view/healthCard/statistics/index.vue'),
meta:{
title: '员工健康'
}
}
]
}
]
\ No newline at end of file
import Vue from 'vue'
import Router from 'vue-router'
import healthRoutes from './health'
Vue.use(Router)
......@@ -419,4 +420,4 @@ let shopVersionRoutes = [
}
]
export default [...tipRoutes,...shopVersionRoutes];
\ No newline at end of file
export default [...tipRoutes,...shopVersionRoutes,...healthRoutes];
\ No newline at end of file
<template>
<div class="healthCard">
<v-app>
<keep-alive>
<router-view></router-view>
</keep-alive>
</v-app>
</div>
</template>
<script>
export default {
name: 'healthCard',
data () {
return {
}
}
}
</script>
<style lang="less">
</style>
<style lang="less" >
@import url('../../../styles/common.less');
#healthCardStatisticsIndex{
background: #f6f5f9;
height:100%;
display: flex;
flex-direction: column;
}
</style>
<template>
<div id="healthCardStatisticsIndex">
</div>
</template>
<script>
import Util from '@/libs/util.js';
import {mapState} from 'vuex';
export default {
name: 'healthCardStatisticsIndex',
data () {
return {
}
},
components:{
},
computed:{
...mapState({
})
},
async mounted(){
},
async activated(){
window.d = this;
},
methods:{
}
}
</script>
\ No newline at end of file
<style lang="less" >
.slide-fade-enter-active {
transition: opacity .5s ease;
}
.slide-fade-leave-active {
transition: opacity .5s ease;
}
.slide-fade-enter, .slide-fade-leave-active {
opacity: 0;
}
h1, h2 {
margin: 0;
padding: 0;
}
img {
display: block;
max-width: 100%;
}
#imageView .imageBox li img{
height:auto !important;
}
#imageView .imageBox li{
display:flex;
align-items:center;
justify-content:center;
}
#specimen{
height:100%;
background: white;
h3{
height:40px;
line-height:40px;
text-align: center;
background:white;
}
.header{
.hdrImg{
width:100%;
height:200px;
display: flex;
justify-content: center;
align-items: center;
background: #eef4fe;
// position: relative;
}
img{
height:200px;
width:100%;
}
// img:after {
// content: "";
// display: inline-block;
// position: absolute;
// z-index: 2;
// top: 0;
// left: calc(50% - 100px);
// width: 200px;
// height: 200px;
// background: url("../../assets/imgErr.png") no-repeat;
// background-position: center;
// background-size: contain;
// background-color: #fff;
// }
}
.info{
.content{
display:flex;
background:white;
padding:16px;
>div{
flex:1
}
}
}
.detail{
background: white;
border-top:1px solid #eef4fe;
.img{
// position: relative;
display: flex;
justify-content: center;
align-items: center;
img{
width: 100%;
max-height:50px;
}
}
// img:after {
// content: "";
// display: inline-block;
// position: absolute;
// z-index: 2;
// top: 0;
// left: 0;
// width: 100%;
// height: 50px;
// background: url("../../assets/imgErr.png") no-repeat;
// background-position: center;
// background-size: contain;
// background-color: #fff;
// }
}
}
</style>
<template>
<div id="specimen" :style="(showHdr || showDtl) ? 'height:100vh;overflow:hidden;' : ''">
<div class="header">
<transition name="slide-fade" class="fadeView">
<!-- <div v-if="showHdr">
<image-view :imgArr="hdr_src"
:showImageView="true"
:imageIndex="imageHdrIndex"
v-on:hideImage="hideImageView('hdr')"></image-view>
</div> -->
<div v-if="showDtl">
<image-view :imgArr="dtl_src"
:showImageView="true"
:imageIndex="imageDtlIndex"
v-on:hideImage="hideImageView('dtl')"></image-view>
</div>
</transition>
<!-- <div class="hdrImg">
<img v-for="(item, index) in [hdr]" v-if="!hdr.isErr" @error="error(item,index,'hdr')" :src="item" @click="selectImg('hdr',index)" :key="index"/>
<img v-else src="../../../assets/imgErr.png"/>
</div> -->
<div class="info">
<h3>参数</h3>
<div class="content">
<div class="left">
<p>产品编号:{{hdr.sSampleMaterialNo}}</p>
<p>产品名称:{{hdr.sSampleMaterialName}}</p>
<p>规格:{{hdr.sConstruction}}</p>
<p>成分:{{hdr.sComponent}}</p>
</div>
<div class="right">
<p>幅宽:{{hdr.sWidth}}</p>
<p>克重:{{hdr.sGMWT}}</p>
</div>
</div>
</div>
</div>
<div class="detail">
<h3>颜色明细</h3>
<div class="detailImg">
<v-container grid-list-md text-xs-center>
<v-layout row wrap>
<v-flex xs3 v-for="(item, index) in dtl_src" :key="index">
<div class="img">
<img :src="item" @error="error(item,index,'dtl')" v-if="!dtl[index].isErr" @click="selectImg('dtl',index)" />
<img v-else src="../../../assets/imgErr.png"/>
</div>
<div style="border:1px solid #ddd;border-top:0;height:20px;font-size:12px;">
{{dtl[index].sColorNo}}
</div>
</v-flex>
</v-layout>
</v-container>
</div>
</div>
</div>
</template>
<script>
import imageView from 'vue-imageview'
import Util from '@/libs/util.js'
export default {
name: 'specimen',
data () {
return {
showHdr:false,
showDtl:false,
imageHdrIndex:0,
imageDtlIndex:0,
hdr_src:[],
dtl_src:[],
sMaterialNo:'',
hdr:{},
dtl:[],
uGuid:'',
host:'https://weixin.huansi.net/apiproxy/huansi/service/proxy/'
}
},
async mounted(){
this.$route.params.uGuid.split('.').map((x,y) => {
this.uGuid += String.fromCharCode(x)
})
window.data = this;
await this.getList();
},
components:{
'image-view': imageView
},
methods:{
error(item,index,type){
if(type == 'hdr'){
this.$set(this.hdr,'isErr',true)
}else{
this.$set(this.dtl[index],'isErr',true)
}
},
async getList(){
this.apiGet(`${this.host}${this.$route.params.userId}/goods/onesample/${this.uGuid}/`,{},true).then(res=>{
this.hdr = res.header;
this.dtl = res.childs;
res.childs.map(v=>{
this.dtl_src.push(`${this.host}${this.$route.params.userId}/goods/image_click/?uGuid=${v.uPictureGuid}&iType=2&random=${Math.random()}`)
})
})
},
showImgView (type) {
if(type == 'hdr'){
this.showHdr = true;
}else{
this.showDtl = true;
}
},
hideImageView (type) {
if(type == 'hdr'){
this.showHdr = false;
}else{
this.showDtl = false;
}
},
selectImg (type,index) {
if(type == 'hdr'){
this.showHdr = true;
this.imageHdrIndex = index;
}else{
this.showDtl = true;
this.imageDtlIndex = index;
}
},
}
}
</script>
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