diff --git a/src/plugins/vant.js b/src/plugins/vant.js index 276423b..a0cfb25 100644 --- a/src/plugins/vant.js +++ b/src/plugins/vant.js @@ -31,7 +31,8 @@ import { Rate, Search, DropdownMenu, - DropdownItem + DropdownItem, + ImagePreview } from 'vant' import 'vant/lib/index.css' Vue.use(Button) @@ -64,4 +65,5 @@ Vue.use(Button) .use(Rate) .use(Search) .use(DropdownMenu) - .use(DropdownItem) \ No newline at end of file + .use(DropdownItem) + .use(ImagePreview) \ No newline at end of file diff --git a/src/views/HotlineDetail/index.vue b/src/views/HotlineDetail/index.vue index 0ed1f0f..46efcbc 100644 --- a/src/views/HotlineDetail/index.vue +++ b/src/views/HotlineDetail/index.vue @@ -157,10 +157,21 @@
不合规诉求申请说明:
{{ item.nonComplianceNote }}
- - +
+
+
+ 图片: +
+ Image +
+
+
+ {{file.attachmentType === 'voice'?'音频':'附件'}}: + {{file.attachmentName}} +
+
+
- @@ -322,8 +333,7 @@ import { getUserInfo } from '@/api/user' import throttle from 'lodash/debounce' import { icEventList,agencyGridDepttree,process,reply,refund,multiReply } from '@/api/service' import { uploadvariedfile } from '@/api/basic' -import { Dialog } from 'vant'; - +import { ImagePreview } from 'vant'; export default { data() { return { @@ -480,6 +490,66 @@ export default { }, methods: { + handelClickDownFile(message) { + if (this.iosAgent()) { + console.log("input 复制方式 " + message); + let inputObj = document.createElement("input"); + inputObj.value = message; + document.body.appendChild(inputObj); + inputObj.select(); + inputObj.setSelectionRange(0, inputObj.value.length); + this._execCommand('Copy'); + document.body.removeChild(inputObj); + } else { + console.log("document 复制方式 " + message); + let domObj = document.createElement("span"); + domObj.innerHTML = message; + document.body.appendChild(domObj); + let selection = window.getSelection(); + let range = document.createRange(); + range.selectNodeContents(domObj); + selection.removeAllRanges(); + selection.addRange(range); + this._execCommand('Copy'); + document.body.removeChild(domObj); + } + }, + _execCommand(action) { + let is = document.execCommand(action); + if (is) { + this.$toast("复制成功,请打开浏览器预览") + } else { + // this.$toast("复制成功") + } + }, + iosAgent() { + return navigator.userAgent.match(/(iPhone|iPod|iPad);?/i); + }, + previewImg(url){ + ImagePreview({ + images:[url] + }); + }, + // handelClickDownFile(url){ + // this.$wx.setClipboardData({ + // data: url, + // success: function (res) { + // this.$wx.getClipboardData({ + // success: function (res) { + // wx.showToast({ + // title: '复制成功' + // }) + // } + // }) + // }, + // fail:function(err){ + // console.log(err); + // wx.showToast({ + // title: '复制失败' + // }) + // } + // }) + // }, async getUserInfo() { let { data, code, msg } = await getUserInfo() if (code == 0) {