h5钉钉导航栏实时更新(跟踪标题)标题

在跳转的时候进行钉钉判断,钉钉是根据刷新时页面的标题来定导航栏的,所以我们钉钉只能用widow进行跳转,才能达到实时跟踪

		安装
		npm install dingtalk-jsapi --save
		引入
		import * as dd from 'dingtalk-jsapi';
		
		跳转是判断
        if (dd.env.platform !== "notInDingTalk") {
    
    
            console.log('是钉钉', url)
            window.location.href = url;
        } else {
    
    
            if (type == "redirect") {
    
    
                uni.redirectTo({
    
    
                    url: url,
                });
            } else if (type == "reLaunch") {
    
    
                uni.reLaunch({
    
    
                    url: url,
                });
            } else {
    
    
                uni.navigateTo({
    
    
                    url: url,
                });
            }
        }

猜你喜欢

转载自blog.csdn.net/xiaokangna/article/details/126749693