Commit 43dea26c25255b2cb3e368f67a85cb0ecaafb668
1 parent
1b069aa3
黄石h5新页面
Showing
1 changed file
with
31 additions
and
2 deletions
src/views/peripheralService/peripheralService.vue
... | ... | @@ -46,8 +46,8 @@ |
46 | 46 | <p class="container-address">位置:{{i.companyAddress}}</p> |
47 | 47 | <p class="container-phone">联系电话:{{i.contactTel}} (李美丽)</p> |
48 | 48 | <div class="address-phone"> |
49 | - <span></span> | |
50 | - <span></span> | |
49 | + <span @click="toLinkApp(i.lonId,i.latId,i.shopName)"></span> | |
50 | + <span @click="callPhone('i.contactTel')"></span> | |
51 | 51 | </div> |
52 | 52 | </div> |
53 | 53 | </li> |
... | ... | @@ -90,6 +90,35 @@ export default { |
90 | 90 | this.queryInsuranceCompanyList(this.carNumber); |
91 | 91 | }, |
92 | 92 | methods: { |
93 | + toLinkApp(lon,lat,name){ | |
94 | + var u = navigator.userAgent, | |
95 | + app = navigator.appVersion; | |
96 | + var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; | |
97 | + var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); | |
98 | + if (isAndroid) { | |
99 | + // alert("我是安卓"); | |
100 | + window.JSInterface.toApp(lon,lat,name); | |
101 | + } | |
102 | + if (isIOS) { | |
103 | + // alert("我是苹果"); | |
104 | + window.webkit.messageHandlers.toApp.postMessage({ "lon": lon, "lat": lat, "name":name}) | |
105 | + } | |
106 | + | |
107 | + }, | |
108 | + callPhone(telNum) { | |
109 | + var u = navigator.userAgent, | |
110 | + app = navigator.appVersion; | |
111 | + var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; | |
112 | + var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); | |
113 | + if (isAndroid) { | |
114 | + // alert("我是安卓"); | |
115 | + window.JSInterface.callAppPhone(telNum); | |
116 | + } | |
117 | + if (isIOS) { | |
118 | + // alert("我是苹果"); | |
119 | + window.webkit.messageHandlers.callAppPhone.postMessage({ "phoneNumber": telNum}) | |
120 | + } | |
121 | + }, | |
93 | 122 | queryInsuranceCompanyList() { // 获取停车记录数据 |
94 | 123 | var salt = this.$utils.myCommonSalt(32); |
95 | 124 | var jsondata = { | ... | ... |