|
@@ -353,11 +353,18 @@ var browser = {
|
|
|
return "";
|
|
|
},
|
|
|
|
|
|
- replaceQueryString (url, name, value) {
|
|
|
- const re = new RegExp(name + '=[^&]*', 'gi')
|
|
|
- return url.replace(re, name + '=' + value)
|
|
|
+ replaceQueryString(url, name, value) {
|
|
|
+ const re = new RegExp(name + "=[^&]*", "gi");
|
|
|
+ return url.replace(re, name + "=" + value);
|
|
|
},
|
|
|
openLink(mglink, h5link, appLink) {
|
|
|
+ if (this.getURLParam("isBuyerApp") === "1") {
|
|
|
+ if (appLink) {
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: appLink,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.detectWeixin()) {
|
|
|
//ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
|
|
|
wx.miniProgram.getEnv((res) => {
|
|
@@ -370,12 +377,16 @@ var browser = {
|
|
|
}
|
|
|
} else {
|
|
|
if (h5link) {
|
|
|
- window.open(h5link,'_blank')
|
|
|
+ if (this.detectIOS()) {
|
|
|
+ window.location.href = h5link;
|
|
|
+ } else {
|
|
|
+ window.open(h5link, "_blank");
|
|
|
+ }
|
|
|
}
|
|
|
// 不在小程序里
|
|
|
}
|
|
|
});
|
|
|
- } else if(this.detectApp()){
|
|
|
+ } else if (this.getURLParam("isMiniApp") === "1") {
|
|
|
if (appLink) {
|
|
|
wx.miniProgram.navigateTo({
|
|
|
url: appLink,
|
|
@@ -383,7 +394,11 @@ var browser = {
|
|
|
}
|
|
|
} else {
|
|
|
if (h5link) {
|
|
|
- window.open(h5link, '_blank')
|
|
|
+ if (this.detectIOS()) {
|
|
|
+ window.location.href = h5link;
|
|
|
+ } else {
|
|
|
+ window.open(h5link, "_blank");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|