|
@@ -23,6 +23,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ console.log(this.IsPC())
|
|
|
this.width = document.body.clientWidth + 'px';
|
|
|
},
|
|
|
mounted() {
|
|
@@ -44,17 +45,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ IsPC() {
|
|
|
+ var userAgentInfo = navigator.userAgent;
|
|
|
+ var Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"];
|
|
|
+ var flag = true;
|
|
|
+ for (var v = 0; v < Agents.length; v++) {
|
|
|
+ if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
|
|
+ flag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ },
|
|
|
init() {
|
|
|
// 开发者自行判断调用这个方法的时机
|
|
|
openTryoutSku({
|
|
|
// corpId可以从应用首页的url上获取到
|
|
|
corpId: this.corpId,
|
|
|
- // corpId: 'ding18d2ac9042d997e5f5bf40eda33b7ba0',
|
|
|
+ // corpId: 'ding897857ddc9137670ffe93478753d9884',
|
|
|
// 应用的appId
|
|
|
appId: 55493,
|
|
|
// 从应用首页的url上获取到,url上参数名为 purchaseToken。
|
|
|
// purchaseToken如何配置参照下文”配置入口地址“章节。
|
|
|
- // token: this.token,
|
|
|
+ token: this.token,
|
|
|
miniAppId: this.type == 'APP' ? 5000000000104741 : '' // 如果是三方小程序应用,需要设置一下自身的miniAppId。H5微应用可以不设置这个参数
|
|
|
}).then(res => {
|
|
|
const {
|
|
@@ -70,7 +83,12 @@ export default {
|
|
|
if (this.type == 'APP') {
|
|
|
close({});
|
|
|
} else {
|
|
|
- openLink({ url:'https://pc.dd.g107.com?corpId=' + corpId }).then(() => close({}));
|
|
|
+ if(this.IsPC()){
|
|
|
+ window.location.replace('https://pc.dd.g107.com?corpId=' + corpId)
|
|
|
+ }else{
|
|
|
+ openLink({ url:'https://pc.dd.g107.com?corpId=' + corpId }).then(() => close({}));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
})
|