Liaosp`s Blog

Liaosp`s Blog

uniapp 跳转到京东App详情

Subscribe to my newsletter and never miss my upcoming articles

普通连接即可


jumpApp: function() {

    let url =
        "https:\/\/union-click.jd.com\/jdc?e=&p=JF8AAM0DIgZlGmsVAxMGVB1YEgYbAlcrH0paTFhlQh5QQ1AMSwUDUFZOGA5OREdcThlVGloUAxQEUh9SEAANXhBHBiVmQk8BfFx-VnBYAUUMQn8TXxIBEmJyHgtlHlsUAxcHVhNaFjIRBlUbXRUAEwNUK2sVAyJROxtaFAMTDlcYXhMyEzdVHFgWBBMOVx9eEwMQN1UTXyVfSlcLWQJBXURGDUQNJTIiBGUraxUyETcLdVpFUkdQXE5Se1hTUQlEBFFHfANUG1wWBBECZRlaFAAQ";
    let data = {
        category: 'jump',
        des: 'getCoupon',
        url: url.substr(8)
    }
    var openUrl = `openApp.jdMobile://virtual?params=${JSON.stringify(data)}`;
    plus.runtime.openURL(openUrl, function(res) {
        uni.showModal({
            content: '本机未检测到对应客户端,是否打开浏览器访问页面?',
            success: function(res) {
                if (res.confirm) {
                    plus.runtime.openURL(url);
                }
            }
        });

        console.log(res)
    })
}
 
Share this