# 浏览器端(非微信内部)唤起微信分享 **Repository Path**: v0n/webWXshare ## Basic Information - **Project Name**: 浏览器端(非微信内部)唤起微信分享 - **Description**: 浏览器端(非微信内部)唤起微信分享 触发手机 UC/QQ 浏览器的原生的微信分享功能 fork 自 gihub https://github.com/R-Von/uc-qq-share-to-wechat - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 3 - **Created**: 2017-12-20 - **Last Updated**: 2022-05-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # uc-qq-share-to-wechat > 触发手机 UC/QQ 浏览器的原生的微信分享功能 本项目 fork 自 github https://github.com/AngusFu/uc-qq-share-to-wechat ## 安装 ```bash npm install --save ucshare ``` ## DEMO 移动端使用QQ浏览器或者UC浏览器 打开 http://v0n.gitee.io/webwxshare/ ![https://qr.api.cli.im/qr?data=http%253A%252F%252Fv0n.gitee.io%252Fwebwxshare%252F&level=H&transparent=false&bgcolor=%23ffffff&forecolor=%23000000&blockpixel=12&marginblock=1&logourl=&size=280&kid=cliim&key=bcf94fca4bd7404071a621b82935760f](https://qr.api.cli.im/qr?data=http%253A%252F%252Fv0n.gitee.io%252Fwebwxshare%252F&level=H&transparent=false&bgcolor=%23ffffff&forecolor=%23000000&blockpixel=12&marginblock=1&logourl=&size=280&kid=cliim&key=bcf94fca4bd7404071a621b82935760f) ```javascript var mShare = require('ucshare'); /** * @param {Object} config 配置对象 参数见示例 * config = { * title : 'Lorem ipsum dolor sit.', * url : 'http://m.ly.com', * desc : 'Lorem ipsum dolor sit.', * img : 'http://img1.40017.cn/cn/s/c/2015/loading.gif', * type : type // 1 ==> 朋友圈 2 ==> 朋友 0 ==> 直接弹出原生 * }; */ var mshare = new mShare({ title : 'Lorem ipsum dolor sit.', url : 'http://m.ly.com', desc : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat inventore minima voluptates.', img : 'http://placehold.it/150x150' }); $('button').click(function () { // 1 ==> 朋友圈 2 ==> 朋友 0 ==> 直接弹出原生 mshare.init(+$(this).data('mshare')); }); ``` ## 说明 * 此插件主要作用是在UC和QQ两个手机浏览器上面触发微信分享到朋友圈或发送给朋友的功能 * 代码主要参考:http://mjs.sinaimg.cn/wap/module/share/201501261608/js/addShare.js * 此外,JefferyWang的项目对我也有一定启示:https://github.com/JefferyWang/nativeShare.js