zoukankan      html  css  js  c++  java
  • uniapp原生sdk插件极光短信·极光短信插件可快速对接收发短信·官方伙伴优雅草发布

    下载地址:https://ext.dcloud.net.cn/plugin?id=4773

    极光短信sdk,支持短信和语音短信,可用于验证码,系统通知,营销推广,极光推送补充

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-DWAENMgh-1618893531451)(https://doc.youyacao.com/server/index.php?s=/api/attachment/visitFile/sign/4c96c2a48609df62a411f3c5a5ef36ea)]

    使用方法:

    请直接下载实例文件

    <template>
        <view>
            <view class="uni-padding-wrap uni-common-mt">   
    		
    		
    		
    						 <button  @tap="initSdk()">initSdk</button> 
    				          <button  @tap="setIntervalTime()">setIntervalTime</button> 	
    						 <button  @tap="getIntervalTime()">getIntervalTime</button> 
    						 <button  @tap="getSmsCodeAsyn()">getSmsCodeAsyn</button>
    						  <button  @tap="getVoiceCode()">getVoiceCode</button> 
    						  <button  @tap="checkSmsCodeAsyn()">checkSmsCodeAsyn</button> 	
    						
    				 	        </view>
        </view>
    </template>
    
    <script>
    	const Jsms = uni.requireNativePlugin('youyacao-Jsms');
    	export default {
    		data() {
    			return {
    				title: 'Hello'
    			}
    		},
    		onLoad() {
    
    		},
    		methods: {
    			initSdk()
    			{
    				Jsms.initSdk({ }, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			setIntervalTime()
    			{
    				Jsms.setIntervalTime({ 
    					IntervalTime:60000 //60秒
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			getIntervalTime()
    			{
    				Jsms.getIntervalTime({ }, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			 getSmsCodeAsyn()
    			 {
    			 
    			 	Jsms.getSmsCodeAsyn({
    					phone:"15159292131",
    					tempId:"1"
    				}, result => {
    			 		const msg = JSON.stringify(result);
    			 		uni.showModal({
    			 			content: msg,
    			 			showCancel: false
    			 		}); 
    			 	}); 
    			 },
    			  getVoiceCode()
    			  {
    			  	Jsms.getVoiceCode({ 
    						phone:"15159292131"
    				}, result => {
    			  		const msg = JSON.stringify(result);
    			  		uni.showModal({
    			  			content: msg,
    			  			showCancel: false
    			  		}); 
    			  	}); 
    			  },
    			  checkSmsCodeAsyn()
    			  {
    			  	Jsms.checkSmsCodeAsyn({
    					phone:"15159292131",
    					code:"123456"
    				}, result => {
    			  		const msg = JSON.stringify(result);
    			  		uni.showModal({
    			  			content: msg,
    			  			showCancel: false
    			  		}); 
    			  	}); 
    			  },
    		}
    	}
    </script>
    
    <style>
    	.content {
    		display: flex;
    		flex-direction: column;
    		align-items: center;
    		justify-content: center;
    	}
    
    	.logo {
    		height: 200upx;
    		width: 200upx;
    		margin-top: 200upx;
    		margin-left: auto;
    		margin-right: auto;
    		margin-bottom: 50upx;
    	}
    
    	.text-area {
    		display: flex;
    		justify-content: center;
    	}
    
    	.title {
    		font-size: 36upx;
    		color: #8f8f94;
    	}
    </style>
    
  • 相关阅读:
    JS元素分组统计
    并发工具类
    【Spring-Cloud】mall eureka微服务模块建立
    【Spring-Cloud】mall父工程建立
    【MySQL】创建函数和存储过程,批量插入大数据
    【JAVA】http 状态
    【JAVA】如何写好代码
    【Docker】dockerfile,支持jdk8、 sshd、 python3.6
    【Hadoop】MapperReduce WordCount 代码示例
    【Hadoop】YARN 完全分布式配置
  • 原文地址:https://www.cnblogs.com/yangqiangche/p/15229773.html
Copyright © 2011-2022 走看看