Skip to content

5+ APP接入

本插件用于uniapp 开发的安卓/IOS项目, 5+APP,wap2app 项目; 用此插件不用打自定义基座;

下载地址:

https://res.dankex.cn/sdk/dankex-plus.js

TIP

请确保已完成落地页面的websdk部署, 还没部署 请点击这里>>

VUE引用

html
<template>
    <view>
        <button @click="download">下载APP </button>
    </view>
</template>
<script>
    import * as DankeXPlus from '@/common/dankex-plus';
    export default {
        data() {
            return {					
            }
        },
        onLoad() {		
            DankeXPlus.getInstallQuery({
				appkey:'your appkey',
				success(query){				
					console.log('query=',query) 
				} 
			})		
        },
        methods: { 
        }
    }
</script>
<template>
    <view>
        <button @click="download">下载APP </button>
    </view>
</template>
<script>
    import * as DankeXPlus from '@/common/dankex-plus';
    export default {
        data() {
            return {					
            }
        },
        onLoad() {		
            DankeXPlus.getInstallQuery({
				appkey:'your appkey',
				success(query){				
					console.log('query=',query) 
				} 
			})		
        },
        methods: { 
        }
    }
</script>

传统页面

html
 
<!DOCTYPE html>
<html lang="en"> 
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>APP - 注册</title>
	<script type="text/javascript" src="https://res.dankex.cn/sdk/dankex-plus.js"></script> 
</head>
<body>
	<button  onclick="reg()">注册</button> 
</body> 
</html> 
<script> 	
DankeXPlus.getInstallQuery({
    appkey:'your appkey',
    success(query){
            var params=URLSearchParams(query);
            //存储到storage 
            localStorage.setItem('code',params.get('code'));
    } 
})	;
function reg(){
    var code=localStorage.getItem('code')
    //提交注册
    //...
}
</script>
 
<!DOCTYPE html>
<html lang="en"> 
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>APP - 注册</title>
	<script type="text/javascript" src="https://res.dankex.cn/sdk/dankex-plus.js"></script> 
</head>
<body>
	<button  onclick="reg()">注册</button> 
</body> 
</html> 
<script> 	
DankeXPlus.getInstallQuery({
    appkey:'your appkey',
    success(query){
            var params=URLSearchParams(query);
            //存储到storage 
            localStorage.setItem('code',params.get('code'));
    } 
})	;
function reg(){
    var code=localStorage.getItem('code')
    //提交注册
    //...
}
</script>