|
@@ -12,14 +12,19 @@
|
|
|
class="van-icon van-icon-description van-uploader__file-icon"
|
|
class="van-icon van-icon-description van-uploader__file-icon"
|
|
|
></i>
|
|
></i>
|
|
|
<span
|
|
<span
|
|
|
- style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width: 1.8rem;"
|
|
|
|
|
|
|
+ style="
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ width: 1.8rem;
|
|
|
|
|
+ "
|
|
|
>{{ item.name || item.url }}</span
|
|
>{{ item.name || item.url }}</span
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="preview_btn">
|
|
<div class="preview_btn">
|
|
|
- <van-button @click="downLoadFile2(item.url)" type="info" size="mini"
|
|
|
|
|
|
|
+ <!-- <van-button @click="downLoadFile2(item.url)" type="info" size="mini"
|
|
|
>下载</van-button
|
|
>下载</van-button
|
|
|
- >
|
|
|
|
|
|
|
+ > -->
|
|
|
<van-button
|
|
<van-button
|
|
|
:disabled="!checkFileSuffix(item.url)"
|
|
:disabled="!checkFileSuffix(item.url)"
|
|
|
v-if="checkFileSuffix(item.url)"
|
|
v-if="checkFileSuffix(item.url)"
|
|
@@ -33,17 +38,22 @@
|
|
|
</template>
|
|
</template>
|
|
|
</van-field>
|
|
</van-field>
|
|
|
|
|
|
|
|
- <van-popup position="bottom" v-model="filePreview" style="height: 100%;">
|
|
|
|
|
|
|
+ <van-popup position="bottom" v-model="filePreview" style="height: 100%">
|
|
|
<van-sticky>
|
|
<van-sticky>
|
|
|
- <m-header :backUrl="backUrl" :isFixed="false" name="预览" />
|
|
|
|
|
|
|
+ <m-header
|
|
|
|
|
+ :backUrl="backUrl"
|
|
|
|
|
+ :isFixed="false"
|
|
|
|
|
+ :appHide="true"
|
|
|
|
|
+ name="预览"
|
|
|
|
|
+ />
|
|
|
</van-sticky>
|
|
</van-sticky>
|
|
|
<div
|
|
<div
|
|
|
id="previewIframe"
|
|
id="previewIframe"
|
|
|
- style="height: calc(100vh - 0.44rem);"
|
|
|
|
|
|
|
+ style="height: calc(100vh - 0.44rem)"
|
|
|
v-if="filePreview && (fileType == 'xls' || fileType == 'pdf')"
|
|
v-if="filePreview && (fileType == 'xls' || fileType == 'pdf')"
|
|
|
></div>
|
|
></div>
|
|
|
<div
|
|
<div
|
|
|
- style="height: calc(100vh - 0.44rem);"
|
|
|
|
|
|
|
+ style="height: calc(100vh - 0.44rem)"
|
|
|
v-if="filePreview && fileType == 'doc'"
|
|
v-if="filePreview && fileType == 'doc'"
|
|
|
></div>
|
|
></div>
|
|
|
</van-popup>
|
|
</van-popup>
|
|
@@ -51,7 +61,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import MHeader from "@/components/MHeader";
|
|
|
|
|
|
|
+import MHeader from "@/components/header";
|
|
|
import { browser } from "@/common/util";
|
|
import { browser } from "@/common/util";
|
|
|
import { postMessage } from "@/helpers/native-message";
|
|
import { postMessage } from "@/helpers/native-message";
|
|
|
export default {
|
|
export default {
|
|
@@ -104,6 +114,7 @@ export default {
|
|
|
message: "下载中...",
|
|
message: "下载中...",
|
|
|
});
|
|
});
|
|
|
if (browser().isApp) {
|
|
if (browser().isApp) {
|
|
|
|
|
+ this.$toast.clear();
|
|
|
postMessage(
|
|
postMessage(
|
|
|
{ api: "downloadFile", content: { downloadUrl: file } },
|
|
{ api: "downloadFile", content: { downloadUrl: file } },
|
|
|
() => {
|
|
() => {
|
|
@@ -149,11 +160,11 @@ export default {
|
|
|
encodeURIComponent(file);
|
|
encodeURIComponent(file);
|
|
|
}
|
|
}
|
|
|
if (iframe.attachEvent) {
|
|
if (iframe.attachEvent) {
|
|
|
- iframe.attachEvent("onload", function() {
|
|
|
|
|
|
|
+ iframe.attachEvent("onload", function () {
|
|
|
_this.$toast.clear();
|
|
_this.$toast.clear();
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- iframe.onload = function() {
|
|
|
|
|
|
|
+ iframe.onload = function () {
|
|
|
_this.$toast.clear();
|
|
_this.$toast.clear();
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
// setTimeout(() => {
|