Compare commits
4 Commits
fa1bce7667
...
a3e41aee85
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3e41aee85 | ||
|
|
2c1de9b107 | ||
|
|
0e6b6d7ffa | ||
|
|
1165188074 |
@@ -3,9 +3,13 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
|
<meta name="viewport"
|
||||||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
|
||||||
<title>房屋征收</title>
|
<title>房屋征收</title>
|
||||||
<script type="text/javascript" src="https://d.alicdn.com/alilog/mlog/aplus.js?id=202951085"></script>
|
<script type="text/javascript" src="https://d.alicdn.com/alilog/mlog/aplus.js?id=202951085"></script>
|
||||||
|
<script type="text/javascript" src="//jssdk.yyhj.zjzwfw.gov.cn/jsbridge/v2.0.0/bridge.min.js"></script>
|
||||||
|
<!-- 引入ZWJSBridge -->
|
||||||
|
<script type="text/javascript" src="//assets.zjzwfw.gov.cn/assets/ZWJSBridge/1.0.1/zwjsbridge.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -46,6 +50,7 @@
|
|||||||
arguments: [{
|
arguments: [{
|
||||||
is_auto: false
|
is_auto: false
|
||||||
}, {
|
}, {
|
||||||
|
isMini: true,
|
||||||
miniAppId: "2001833218", //'应用开发管理平台-应用 ID
|
miniAppId: "2001833218", //'应用开发管理平台-应用 ID
|
||||||
miniAppName: "房屋征收"
|
miniAppName: "房屋征收"
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -289,15 +289,15 @@ export default {
|
|||||||
idCard: "加载中...",
|
idCard: "加载中...",
|
||||||
userName: "加载中...",
|
userName: "加载中...",
|
||||||
policiesRegulationsLists: {
|
policiesRegulationsLists: {
|
||||||
totalCount: 0
|
totalCount: 0,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
ticket: "8a118afe7bda7976017bf14c94de35e0-ticket"
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
this.onInit();
|
this.onInit();
|
||||||
console.log("this", this);
|
console.log("this", this);
|
||||||
|
this.setLocationAplus();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
@@ -308,10 +308,11 @@ export default {
|
|||||||
dataType: "JSON",
|
dataType: "JSON",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: {
|
data: {
|
||||||
ticket: this.ticket
|
ticket: this.$route.query.ticket,
|
||||||
|
//ticket: "8a118a427bda7bed017bed084ec10622-ticket"
|
||||||
},
|
},
|
||||||
appKey: "es4b8zmz+2001833218+dehllx",
|
appKey: "es4b8zmz+2001833218+dehllx",
|
||||||
onSuccess: data => {
|
onSuccess: (data) => {
|
||||||
console.log("首页数据", data);
|
console.log("首页数据", data);
|
||||||
if (data.data && data.data.success == true) {
|
if (data.data && data.data.success == true) {
|
||||||
this.data = data.data.data;
|
this.data = data.data.data;
|
||||||
@@ -327,16 +328,16 @@ export default {
|
|||||||
} else console.log("用户无数据,不展示");
|
} else console.log("用户无数据,不展示");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFail: err => {
|
onFail: (err) => {
|
||||||
console.log("用户无数据,不展示");
|
console.log("用户无数据,不展示");
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 跳转项目详情
|
// 跳转项目详情
|
||||||
gotoProject(type) {
|
gotoProject(type) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: "projectSelect",
|
name: "projectSelect",
|
||||||
params: { type: type, ticket: this.ticket }
|
params: { type: type, ticket: this.$route.query.ticket },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 加载项目数统计信息
|
// 加载项目数统计信息
|
||||||
@@ -356,21 +357,58 @@ export default {
|
|||||||
// 设置用户信息埋点
|
// 设置用户信息埋点
|
||||||
aplus_queue.push({
|
aplus_queue.push({
|
||||||
action: "aplus.setMetaInfo",
|
action: "aplus.setMetaInfo",
|
||||||
arguments: ["_hold", "BLOCK"]
|
arguments: ["_hold", "BLOCK"],
|
||||||
});
|
});
|
||||||
aplus_queue.push({
|
aplus_queue.push({
|
||||||
action: "aplus.setMetaInfo",
|
action: "aplus.setMetaInfo",
|
||||||
arguments: ["_user_nick", userName] // this.userInfoData.username],
|
arguments: ["_user_nick", userName], // this.userInfoData.username],
|
||||||
});
|
});
|
||||||
aplus_queue.push({
|
aplus_queue.push({
|
||||||
action: "aplus.setMetaInfo",
|
action: "aplus.setMetaInfo",
|
||||||
arguments: ["_user_id", Userid]
|
arguments: ["_user_id", Userid],
|
||||||
});
|
});
|
||||||
aplus_queue.push({
|
aplus_queue.push({
|
||||||
action: "aplus.setMetaInfo",
|
action: "aplus.setMetaInfo",
|
||||||
arguments: ["_hold", "START"]
|
arguments: ["_hold", "START"],
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
setLocationAplus() {
|
||||||
|
ZWJSBridge.onReady(() => {
|
||||||
|
console.log("初始化完成后,执行bridge方法");
|
||||||
|
ZWJSBridge.getUserType()
|
||||||
|
.then((result1) => {
|
||||||
|
console.log(result1);
|
||||||
|
//经纬度
|
||||||
|
ZWJSBridge.getLocation()
|
||||||
|
.then((result2) => {
|
||||||
|
console.log(result2);
|
||||||
|
debugger;
|
||||||
|
aplus_queue.push({
|
||||||
|
action: "aplus.sendPV",
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
is_auto: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
isMini: true,
|
||||||
|
miniAppId: "2001833218", //'应用开发管理平台-应用 ID
|
||||||
|
miniAppName: "房屋征收",
|
||||||
|
long: result2.longitude,
|
||||||
|
lati: result2.latitude,
|
||||||
|
userType: result1.userType,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -15,13 +15,15 @@
|
|||||||
import pdf from "vue-pdf";
|
import pdf from "vue-pdf";
|
||||||
import jquery from "jquery";
|
import jquery from "jquery";
|
||||||
import html2canvas from "html2canvas";
|
import html2canvas from "html2canvas";
|
||||||
|
import axios from "axios";
|
||||||
|
import request from "@/common/util";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
pdf
|
pdf,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
url: ""
|
url: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -30,7 +32,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 截图
|
// 截图
|
||||||
html2canvas(this.$refs.content).then(canvas => {
|
html2canvas(this.$refs.content).then((canvas) => {
|
||||||
canvas.id = "mycanvas";
|
canvas.id = "mycanvas";
|
||||||
const base64 = canvas.toDataURL("image/png");
|
const base64 = canvas.toDataURL("image/png");
|
||||||
jquery("a").prop("href", base64);
|
jquery("a").prop("href", base64);
|
||||||
@@ -39,12 +41,74 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
onInit() {
|
onInit() {
|
||||||
this.onLoadData();
|
this.onLoadData();
|
||||||
|
request({
|
||||||
|
url: "http://localhost:5566/agreement/info",
|
||||||
|
method: "post",
|
||||||
|
data: {
|
||||||
|
ticket: "8a1188557bda7894017bed584f803119-ticket",
|
||||||
|
id: "C655515B-FD91-48F2-BD79-EAABAFB7077C",
|
||||||
|
},
|
||||||
|
headers: { "Content-Type": "application/json; charset=UTF-8" },
|
||||||
|
responseType: "arraybuffer", //一定要设置响应类型,否则页面会是空白pdf
|
||||||
|
}).then((result) => {
|
||||||
|
const binaryData = [];
|
||||||
|
binaryData.push(result.data);
|
||||||
|
//获取blob链接
|
||||||
|
this.url = window.URL.createObjectURL(
|
||||||
|
new Blob(binaryData, { type: "application/pdf" })
|
||||||
|
);
|
||||||
|
// if (pdfUrl) {
|
||||||
|
// this.handlePrint(pdfUrl);
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
// axios({
|
||||||
|
// method: "post",
|
||||||
|
// url: "http://10.19.94.9:7099/api/agreement/info",
|
||||||
|
// responseType: "blob",
|
||||||
|
// data: {
|
||||||
|
// ticket: "8a1188557bda7894017bed584f803119-ticket",
|
||||||
|
// id: "C655515B-FD91-48F2-BD79-EAABAFB7077C",
|
||||||
|
// },
|
||||||
|
// }).then((res) => {
|
||||||
|
// debugger;
|
||||||
|
// console.log(res);
|
||||||
|
// if (!res) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// let blob = new Blob([res.data], {
|
||||||
|
// type: "application/octet-stream",
|
||||||
|
// });
|
||||||
|
// let url = window.URL.createObjectURL(blob);
|
||||||
|
// let link = document.createElement("a");
|
||||||
|
// link.style.display = "none";
|
||||||
|
// link.href = url;
|
||||||
|
// document.body.appendChild(link);
|
||||||
|
// link.click();
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
handlePrint(pdf) {
|
||||||
|
if (document.getElementById("print-iframe")) {
|
||||||
|
document.body.removeChild(document.getElementById("print-iframe"));
|
||||||
|
}
|
||||||
|
//判断iframe是否存在,不存在则创建iframe
|
||||||
|
let iframe = document.getElementById("print-iframe");
|
||||||
|
if (!iframe) {
|
||||||
|
iframe = document.createElement("IFRAME");
|
||||||
|
let doc = null;
|
||||||
|
iframe.setAttribute("src", pdf);
|
||||||
|
iframe.setAttribute("id", "print-iframe");
|
||||||
|
document.body.appendChild(iframe);
|
||||||
|
doc = iframe.contentWindow.document;
|
||||||
|
doc.close();
|
||||||
|
iframe.contentWindow.focus();
|
||||||
|
}
|
||||||
|
iframe.contentWindow.print();
|
||||||
},
|
},
|
||||||
onLoadData() {
|
onLoadData() {
|
||||||
console.log(this.$route.params);
|
// console.log(this.$route.params);
|
||||||
this.url = this.$route.params.url;
|
// this.url = this.$route.params.url;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user