更新
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
<view class="list">
|
||||
<view class="item" v-for="item,index in infoList" :key="index">
|
||||
<text>{{item.title}}</text>
|
||||
<text v-if="item.type == 'text'">{{item.value}}</text>
|
||||
<text v-if="item.type == 'date'" :style="{ color: dateHandle(item.value) }">{{item.value}}</text>
|
||||
<text v-if="item.type == 'selector'">{{item.value}}</text>
|
||||
<text v-if="item.type === 'text'">{{item.value}}</text>
|
||||
<text v-if="item.type === 'date'" :style="{ color: dateHandle(item.value) }">{{item.value}}</text>
|
||||
<text v-if="item.type === 'selector'">{{item.value}}</text>
|
||||
<text v-if="item.type == 'number'">{{ item.value }}</text>
|
||||
<template v-if="item.type == 'file'">
|
||||
<template v-if="item.type === 'file'">
|
||||
<text v-if="!item.value">暂无</text>
|
||||
<template v-else>
|
||||
<view v-if="item.value.endsWith('png') || item.value.endsWith('jpg')" class="file"
|
||||
@@ -23,10 +23,36 @@
|
||||
</view>
|
||||
<view v-else class="file-download" @click="seeDocument(item.value)">
|
||||
<image src="https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/oms-file.png"></image>
|
||||
<image src="https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/eye.png"></image>
|
||||
<view>
|
||||
<view>{{altHandle(item.value)}}</view>
|
||||
<text>点击在线预览</text>
|
||||
</view>
|
||||
<!-- <image src="https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/eye.png"></image> -->
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
<view v-if="item.type === 'filelist'" style="padding-left: 200rpx;">
|
||||
<text v-if="!item.value.length">暂无</text>
|
||||
<template v-else>
|
||||
<template v-for="(_item, _index) in item.value">
|
||||
<view :key="_index" v-if="_item.endsWith('png') || _item.endsWith('jpg')" class="file"
|
||||
style="margin-bottom:10rpx" @click="seePicture(_item)">
|
||||
<image :src="_item"></image>
|
||||
<text>{{_item | nameFilters}}</text>
|
||||
</view>
|
||||
<view :key="_index" v-else class="file-download special" @click="seeDocument(_item)">
|
||||
<image src="https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/oms-file.png">
|
||||
</image>
|
||||
<view>
|
||||
<view>{{altHandle(_item)}}</view>
|
||||
<text>点击在线预览</text>
|
||||
</view>
|
||||
<!-- <image src="https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/eye.png"></image> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popup" background-color="#fff">
|
||||
@@ -55,7 +81,8 @@
|
||||
this.styles = uni.getMenuButtonBoundingClientRect()
|
||||
|
||||
if (option.details) {
|
||||
this.infoList = JSON.parse(option.details)
|
||||
console.log('option', decodeURIComponent(option.details))
|
||||
this.infoList = JSON.parse(decodeURIComponent(option.details))
|
||||
}
|
||||
console.log(this.infoList)
|
||||
},
|
||||
@@ -67,6 +94,10 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
altHandle(item) {
|
||||
let arr = item.split('/')
|
||||
return arr[arr.length - 1]
|
||||
},
|
||||
dateHandle(val) {
|
||||
let dueTime = new Date(val).getTime()
|
||||
return this.today > dueTime ? '#ff0000' : '#333'
|
||||
@@ -89,7 +120,7 @@
|
||||
console.log(_res1)
|
||||
},
|
||||
fail: (_res2) => {
|
||||
console.log('_res2',_res2)
|
||||
console.log('_res2', _res2)
|
||||
uni.showToast({
|
||||
title: '该文件格式暂不支持在线预览',
|
||||
icon: 'none'
|
||||
@@ -188,24 +219,56 @@
|
||||
}
|
||||
|
||||
.file-download {
|
||||
display: inline;
|
||||
// display: inline;
|
||||
// display: flex;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
display: inline-flex;
|
||||
|
||||
|
||||
image {
|
||||
&:nth-of-type(1) {
|
||||
// margin-right: 15rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
>image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
>view {
|
||||
flex: 1;
|
||||
margin-left: 10rpx;
|
||||
padding-top: 7rpx;
|
||||
|
||||
>view {
|
||||
|
||||
width: 300rpx;
|
||||
font-size: 22rpx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
&:nth-of-type(2) {
|
||||
position: relative;
|
||||
left: -5rpx;
|
||||
bottom: -5rpx;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
>text {
|
||||
margin-top: 30rpx;
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
// image {
|
||||
// &:nth-of-type(1) {
|
||||
// // margin-right: 15rpx;
|
||||
// width: 80rpx;
|
||||
// height: 80rpx;
|
||||
// border-radius: 10rpx;
|
||||
// }
|
||||
|
||||
// &:nth-of-type(2) {
|
||||
// position: relative;
|
||||
// left: -5rpx;
|
||||
// bottom: -5rpx;
|
||||
// width: 32rpx;
|
||||
// height: 32rpx;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -174,7 +174,7 @@
|
||||
},
|
||||
jump(item) {
|
||||
uni.navigateTo({
|
||||
url: `./details?details=${item.details}`
|
||||
url: `./details?details=${encodeURIComponent(item.details)}`
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user