|
@@ -3,31 +3,32 @@ import { computed, ref, onMounted } from "vue";
|
|
|
import { apiGetReportDetail } from "@/api/hzyb/report.js";
|
|
|
import { getWxConfig } from '@/api/hzyb/common.js'
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
+import {ImagePreview } from 'vant'
|
|
|
const route = useRoute();
|
|
|
const router=useRouter()
|
|
|
document.title = "报告详情";
|
|
|
|
|
|
localStorage.setItem('hzyb-token',route.query.token)
|
|
|
|
|
|
-// 配置wxjssdk
|
|
|
-const setWxConfig=async ()=>{
|
|
|
- const res=await getWxConfig({token:route.query.token})
|
|
|
- if(res.code===200){
|
|
|
- wx.config({
|
|
|
- debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
|
- appId: res.data.app_id, // 必填,公众号的唯一标识
|
|
|
- timestamp: res.data.timestamp, // 必填,生成签名的时间戳
|
|
|
- nonceStr: res.data.nonce_str, // 必填,生成签名的随机串
|
|
|
- signature: res.data.signature,// 必填,签名
|
|
|
- jsApiList: ['previewImage'] // 必填,需要使用的JS接口列表
|
|
|
- });
|
|
|
- wx.ready(function(){
|
|
|
- // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
|
|
|
- console.log('ready');
|
|
|
- });
|
|
|
- }
|
|
|
-}
|
|
|
-setWxConfig()
|
|
|
+// 配置wxjssdk (没用,本来是为了解决pc上小程序不能使用previewImage 问题)
|
|
|
+// const setWxConfig=async ()=>{
|
|
|
+// const res=await getWxConfig({token:route.query.token})
|
|
|
+// if(res.code===200){
|
|
|
+// wx.config({
|
|
|
+// debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
|
+// appId: res.data.app_id, // 必填,公众号的唯一标识
|
|
|
+// timestamp: res.data.timestamp, // 必填,生成签名的时间戳
|
|
|
+// nonceStr: res.data.nonce_str, // 必填,生成签名的随机串
|
|
|
+// signature: res.data.signature,// 必填,签名
|
|
|
+// jsApiList: ['previewImage'] // 必填,需要使用的JS接口列表
|
|
|
+// });
|
|
|
+// wx.ready(function(){
|
|
|
+// // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
|
|
|
+// console.log('ready');
|
|
|
+// });
|
|
|
+// }
|
|
|
+// }
|
|
|
+// setWxConfig()
|
|
|
|
|
|
let info = ref(null);
|
|
|
let topBg=ref(null)
|
|
@@ -94,7 +95,11 @@ onMounted(()=>{
|
|
|
let itemSrc = $(this).attr('src');
|
|
|
imgArray.push(itemSrc);
|
|
|
});
|
|
|
- wx.previewImage({current:curImageSrc,urls:imgArray});
|
|
|
+ // wx.previewImage({current:curImageSrc,urls:imgArray});
|
|
|
+ ImagePreview({
|
|
|
+ images: imgArray,
|
|
|
+ startPosition: imgArray.indexOf(curImageSrc)||0,
|
|
|
+ });
|
|
|
}
|
|
|
})
|
|
|
})
|