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,8 +46,8 @@ | ||
46 | <p class="container-address">位置:{{i.companyAddress}}</p> | 46 | <p class="container-address">位置:{{i.companyAddress}}</p> |
47 | <p class="container-phone">联系电话:{{i.contactTel}} (李美丽)</p> | 47 | <p class="container-phone">联系电话:{{i.contactTel}} (李美丽)</p> |
48 | <div class="address-phone"> | 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 | </div> | 51 | </div> |
52 | </div> | 52 | </div> |
53 | </li> | 53 | </li> |
@@ -90,6 +90,35 @@ export default { | @@ -90,6 +90,35 @@ export default { | ||
90 | this.queryInsuranceCompanyList(this.carNumber); | 90 | this.queryInsuranceCompanyList(this.carNumber); |
91 | }, | 91 | }, |
92 | methods: { | 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 | queryInsuranceCompanyList() { // 获取停车记录数据 | 122 | queryInsuranceCompanyList() { // 获取停车记录数据 |
94 | var salt = this.$utils.myCommonSalt(32); | 123 | var salt = this.$utils.myCommonSalt(32); |
95 | var jsondata = { | 124 | var jsondata = { |