Coder Social home page Coder Social logo

aipaw / eeui-plugin-qq Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 3.71 MB

QQ登录、分享插件(含:Android、iOS)

License: MIT License

Java 19.70% Ruby 0.80% Objective-C 75.82% JavaScript 3.68%
eeui eeui-plugin qq tencent app mobile weex weex-plugin

eeui-plugin-qq's Introduction

QQ登录、分享插件

安装

eeui plugin install https://github.com/aipaw/eeui-plugin-qq

卸载

eeui plugin uninstall https://github.com/aipaw/eeui-plugin-qq

引用

const qq = app.requireModule("eeui/qq");

参数配置

eeui.config.js文件添加以下参数:


tencent: {
    ios: {
        appid: "ios的appid",
    },
    android: {
        appid: "android的appid",
    }
}

QQ登录

qq.login QQ登录

/**
 * @param callback  回调事件
 */
qq.login(callback(result))

callback 回调result说明
{
    status: "success",    //状态,success|error
    body: "登录成功",      //状态描述
    
    //以下参数仅:status=success有
    openid: "...",      
    access_token: "...",
    expires_in: 7200,           //过期时间
    create_at: 1520492050,      //创建时间戳
}

退出登录

qq.logout 退出登录

qq.logout()

获取用户信息

qq.getUserInfo 获取用户信息

/**
 * @param callback  回调事件
 */
qq.getUserInfo(callback(result))

callback 回调result说明
{
    status: "success",    //状态,success|error
    body: "获取成功",      //状态描述
    
    //..... status=success 会返回用户昵称头像等信息
}

分享给好友

qq.share分享给好友

/**
 * @param params    详细参数
 * @param callback  回调事件
 */
qq.share({params}, callback(result))

params 参数说明
属性名 类型 必须 描述 默认值
title String 分享标题 -
url String 分享地址 -
desc String 分享描述 -
imgUrl String 缩略图 -
callback 回调result说明
{
    status: "success",    //状态,success|error
    body: "",             //状态描述
}

分享到QQ空间

qq.shareToQzone 分享到QQ空间

/**
 * @param params    详细参数
 * @param callback  回调事件
 */
qq.shareToQzone({params}, callback(result))

params 参数说明
属性名 类型 必须 描述 默认值
title String 分享标题 -
url String 分享地址 -
desc String 分享描述 -
callback 回调result说明
{
    status: "success",    //状态,success|error
    body: "",             //状态描述
}

eeui-plugin-qq's People

Contributors

aipaw avatar kuaifan avatar xiaomipatchrom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.