提交 5279e6da 编写于 作者: 张敬贤's avatar 张敬贤

fix

上级 8f4348f7
...@@ -40,8 +40,8 @@ vueApp.$rocNative.appInit(); ...@@ -40,8 +40,8 @@ vueApp.$rocNative.appInit();
vueApp.$rocNative.on('wx_ready', function () { vueApp.$rocNative.on('wx_ready', function () {
console.log('-wx_ready-', window._picaWechat); console.log('-wx_ready-', window._picaWechat);
vueApp.$rocNative.WXInstance.miniProgram.getEnv(function(res) { vueApp.$rocNative.WXInstance.miniProgram.getEnv(function(res) {
console.log(res.miniprogram); // true console.log('_miniprogram', res.miniprogram); // true
window.miniprogram = res.miniprogram; window._miniprogram = res.miniprogram;
}); });
}); });
......
...@@ -220,16 +220,6 @@ export default { ...@@ -220,16 +220,6 @@ export default {
const latitude = this.detailInfo.latitude; const latitude = this.detailInfo.latitude;
const longitude = this.detailInfo.longitude; const longitude = this.detailInfo.longitude;
if (window.miniProgram) {
const addressInfo = {
address: this.detailInfo.hospitalAddress,
latitude: this.detailInfo.latitude,
longitude: this.detailInfo.longitude,
name: this.detailInfo.hospitalName,
};
this.$rocNative.WXInstance.miniProgram.openLocation(addressInfo);
return;
}
if (geolocation && geolocation.lat && geolocation.lng) { if (geolocation && geolocation.lat && geolocation.lng) {
// https://uri.amap.com/navigation // https://uri.amap.com/navigation
} else { } else {
...@@ -259,8 +249,8 @@ export default { ...@@ -259,8 +249,8 @@ export default {
}, },
bindingCode() { bindingCode() {
const { pprotocolType, detectionServiceRecordId } = this.detailInfo; const { pprotocolType, detectionServiceRecordId } = this.detailInfo;
console.log('window.miniProgram', window.miniProgram); console.log('window.miniProgram', window._miniprogram);
if (window.miniProgram) { if (window._miniprogram) {
this.$rocNative.WXInstance.miniProgram.navigateTo({ this.$rocNative.WXInstance.miniProgram.navigateTo({
url:`/pagesInsurance/binding-code/index?yunOrderNo=${this.yunOrderNo}&detectionRecordId=${detectionServiceRecordId}&pprotocolType=${pprotocolType}` url:`/pagesInsurance/binding-code/index?yunOrderNo=${this.yunOrderNo}&detectionRecordId=${detectionServiceRecordId}&pprotocolType=${pprotocolType}`
}); });
...@@ -276,6 +266,16 @@ export default { ...@@ -276,6 +266,16 @@ export default {
} }
}, },
navigation() { navigation() {
if (window._miniprogram) {
const addressInfo = {
address: this.detailInfo.hospitalAddress,
latitude: this.detailInfo.latitude,
longitude: this.detailInfo.longitude,
name: this.detailInfo.hospitalName,
};
this.$rocNative.WXInstance.miniProgram.openLocation(addressInfo);
return;
}
this.showSsheet = true; this.showSsheet = true;
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册