|
@@ -24,9 +24,9 @@
|
|
|
<img src="../../assets/AIDesign/diagnoseTit.png" class="diagnoseTitBg">
|
|
<img src="../../assets/AIDesign/diagnoseTit.png" class="diagnoseTitBg">
|
|
|
<!-- <van-image class="diagnosis-image" :src="UserFilePathUrl" fit="contain" v-if="UserFilePathUrl"
|
|
<!-- <van-image class="diagnosis-image" :src="UserFilePathUrl" fit="contain" v-if="UserFilePathUrl"
|
|
|
placeholder="加载中..." @click="imgClick(UserFilePathUrl)" id="diagnoseResultImg" /> -->
|
|
placeholder="加载中..." @click="imgClick(UserFilePathUrl)" id="diagnoseResultImg" /> -->
|
|
|
- <img class="diagnosis-image" :src="UserFilePathUrl" v-show="UserFilePathUrl"
|
|
|
|
|
- @click="imgClick(UserFilePathUrl)" style="object-fit: contain;"/>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <img class="diagnosis-image" :src="UserFilePathUrl" v-show="UserFilePathUrl"
|
|
|
|
|
+ @click="imgClick(UserFilePathUrl)" style="object-fit: contain;" />
|
|
|
|
|
+
|
|
|
<p v-show="!apiLoading && StateCode == 2">该建筑的墙面诊断报告如下,长按可保存分享</p>
|
|
<p v-show="!apiLoading && StateCode == 2">该建筑的墙面诊断报告如下,长按可保存分享</p>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="diagnosis-content" v-if="!apiLoading && wallInfo && wallInfo.wallFinishing">
|
|
<div class="diagnosis-content" v-if="!apiLoading && wallInfo && wallInfo.wallFinishing">
|
|
@@ -184,6 +184,7 @@ import { Component, Vue, Ref, Watch } from 'vue-property-decorator';
|
|
|
import html2canvas from 'html2canvas';
|
|
import html2canvas from 'html2canvas';
|
|
|
import { NavBar, Button, Image, Loading, Empty, Toast, ImagePreview } from 'vant';
|
|
import { NavBar, Button, Image, Loading, Empty, Toast, ImagePreview } from 'vant';
|
|
|
import { diagGetEntity, diagGetReadState, diagUpdateReadState } from "@/api/indexAI";
|
|
import { diagGetEntity, diagGetReadState, diagUpdateReadState } from "@/api/indexAI";
|
|
|
|
|
+import { getWxconfig } from '@/utils/index';
|
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
|
declare let wx: any;
|
|
declare let wx: any;
|
|
|
@Component({
|
|
@Component({
|
|
@@ -241,7 +242,7 @@ export default class DiagnosisPage extends Vue {
|
|
|
// }
|
|
// }
|
|
|
// 页面挂载时请求数据
|
|
// 页面挂载时请求数据
|
|
|
created() {
|
|
created() {
|
|
|
- this.getWxconfig();
|
|
|
|
|
|
|
+ getWxconfig();
|
|
|
}
|
|
}
|
|
|
activated() {
|
|
activated() {
|
|
|
// 初始化数据
|
|
// 初始化数据
|
|
@@ -288,7 +289,7 @@ export default class DiagnosisPage extends Vue {
|
|
|
if (response.StatusCode == 200) {
|
|
if (response.StatusCode == 200) {
|
|
|
if (response.Data == null) {
|
|
if (response.Data == null) {
|
|
|
that.isLoading = false;
|
|
that.isLoading = false;
|
|
|
- that.apiLoading= false;
|
|
|
|
|
|
|
+ that.apiLoading = false;
|
|
|
that.regenerateDisable = true;
|
|
that.regenerateDisable = true;
|
|
|
that.StateCode = 1;
|
|
that.StateCode = 1;
|
|
|
if (that.timer) {
|
|
if (that.timer) {
|
|
@@ -344,7 +345,7 @@ export default class DiagnosisPage extends Vue {
|
|
|
} else {
|
|
} else {
|
|
|
this.$toast.fail(response.Info);
|
|
this.$toast.fail(response.Info);
|
|
|
that.isLoading = false;
|
|
that.isLoading = false;
|
|
|
- that.apiLoading= false;
|
|
|
|
|
|
|
+ that.apiLoading = false;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -387,7 +388,7 @@ export default class DiagnosisPage extends Vue {
|
|
|
that.wallInfo = response.Data.WallRepairAnalysis || '';
|
|
that.wallInfo = response.Data.WallRepairAnalysis || '';
|
|
|
}
|
|
}
|
|
|
// that.isLoading = false;
|
|
// that.isLoading = false;
|
|
|
- that.apiLoading= false;
|
|
|
|
|
|
|
+ that.apiLoading = false;
|
|
|
sessionStorage.removeItem("diagnoseSelectedImage");
|
|
sessionStorage.removeItem("diagnoseSelectedImage");
|
|
|
// 生成图片
|
|
// 生成图片
|
|
|
that.longPressTimer = setTimeout(() => {
|
|
that.longPressTimer = setTimeout(() => {
|
|
@@ -406,7 +407,7 @@ export default class DiagnosisPage extends Vue {
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
that.isLoading = false;
|
|
that.isLoading = false;
|
|
|
- that.apiLoading= false;
|
|
|
|
|
|
|
+ that.apiLoading = false;
|
|
|
this.$toast.fail(response.Info);
|
|
this.$toast.fail(response.Info);
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -415,39 +416,6 @@ export default class DiagnosisPage extends Vue {
|
|
|
imgClick(url) {
|
|
imgClick(url) {
|
|
|
ImagePreview([url]);
|
|
ImagePreview([url]);
|
|
|
}
|
|
}
|
|
|
- // 获取微信API授权信息
|
|
|
|
|
- getWxconfig() {
|
|
|
|
|
- const jsApiList = ['getSetting', 'authorize', 'showModal', 'openSetting', 'downloadFile', 'saveImageToPhotosAlbum'];
|
|
|
|
|
- let url = window.location.href.split("#")[0];
|
|
|
|
|
- axios.get(`${process.env.VUE_APP_BASE_API}wx/ticket`, {
|
|
|
|
|
- params: {
|
|
|
|
|
- url: url,
|
|
|
|
|
- agent: 1
|
|
|
|
|
- }
|
|
|
|
|
- }).then(response => {
|
|
|
|
|
- if (response.status == 200) {
|
|
|
|
|
- let qiyeData = response.data.data;
|
|
|
|
|
- wx.agentConfig({
|
|
|
|
|
- debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
|
|
|
- corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
|
|
|
|
|
- agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
|
|
|
|
|
- timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
|
|
|
|
|
- nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
|
|
|
|
|
- signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
|
|
|
|
|
- jsApiList: [...jsApiList], //必填,传入需要使用的接口名称
|
|
|
|
|
- success: function (res) {
|
|
|
|
|
- console.log('获取签名成功');
|
|
|
|
|
- },
|
|
|
|
|
- fail: function (res) {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- if (res.errMsg.indexOf('function not exist') > -1) {
|
|
|
|
|
- alert('版本过低请升级');
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
GetReadStateFn() {
|
|
GetReadStateFn() {
|
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|
|
@@ -614,6 +582,7 @@ export default class DiagnosisPage extends Vue {
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
z-index: 2;
|
|
z-index: 2;
|
|
|
opacity: 0;
|
|
opacity: 0;
|
|
|
|
|
+
|
|
|
img {
|
|
img {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
@@ -642,13 +611,15 @@ export default class DiagnosisPage extends Vue {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- img{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ img {
|
|
|
display: block;
|
|
display: block;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.diagnoseTitBg {
|
|
.diagnoseTitBg {
|
|
|
width: 228px;
|
|
width: 228px;
|
|
|
height: auto;
|
|
height: auto;
|
|
|
- margin:0 auto 15px;
|
|
|
|
|
|
|
+ margin: 0 auto 15px;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|