引例:
seajs.use(['publicf', 'jquery', 'cookie', 'velocity'], function (publicf, $, cookie) {
// 二维码分享调用 分享微信
/**
/* 二维码分享调用
/* shareinfo 后台分享数据 object,默认为空 object
/* shareWeibo 是否分享微博,默认不分享
/* shareWeixin 是否分享微信,默认不分享
/* isfshareWeibo 是否强制分享微博,默认不强制,用于在微信上强制分享微博
/* function(shareinfo, shareWeibo, shareWeixin, isfshareWeibo)
*/
publicf.ShareQr({
title: '2017巅峰音乐会',
timetitle: '2017巅峰音乐会',
contents: '',
pic: 'http://static.qr.cntv.cn/2017dfyyh/image/share.jpeg',
link: 'http://' + location.hostname + '/html/2017dfyyh/topmusic.html?v=20170912',
wxMasking: false,
wxdebug: publicf.getParam("debug") ? true : false
}, false, true);
}
public.js包含的公共方法:
d.setWxHeader = function(headerUrl) {设置微信头像}
d.initheader = function(headerName, showHome, showBack, backUrl, showBar, showfooter) {设置头部}
d.user.uid = d.uid = function() { 获取用户uid}
d.user.getUcUrl = d.getUcUrl = function() {获取用户中心跳转地址}
d.user.AmUid = d.AmUid = function(ic, iid){获取匿名uid}
d.user.AmUidnew = d.AmUidnew = function(ic, iid, host) {获取匿名uid}
d.getNowTime = function(expiresdays) {获取时间}
d.user.loadReport = d.loadReport = function(type, uid, columnId, forcedReload) {上报错误标准化弹出框}
d.user.userReportLogin = d.userReportLogin = function(columnId, notreload, callback) {登录动作}
d.user.LoadLoginSea = d.LoadLoginSea = function(rurl, isYuedong, isAndroid, loginAfter) {统一加载登录弹出框}
d.user.LoadPerfectSea = d.LoadPerfectSea = function() {统一完善用户信息弹出框}
d.user.checkUserInfo = d.checkUserInfo = function() {检查用户信息是否完整}
d.share.ShareYuedong = d.ShareYuedong = function(shareinfo) {悦动分享调用}
d.share.AgainShareYuedong = d.AgainShareYuedong = function(shareinfo) {再次设置悦动分享}
d.share.ShareQr = d.ShareQr = function(shareinfo, shareWeibo, shareWeixin, isfshareWeibo) {二维码分享调用}
d.ShareWeibo = function() {分享微博}
d.ShareWeixin = function() {分享微信}
d.isThisClient = function(clientName) {是否指定客户端}
d.getParam = function( indexname , dourl) {获取当前参数}
d.removeUrlParam = function(indexname, dourl) {去掉url中指定参数}
d.reomveUrlParams = function(indexnames, dourl) {去掉url中的多个参数}
d.setRurl = function() {设置返回url}
d.Praise = function(id, callback, action, type, num) {点赞函数}
d.setWxinfno = function(info, backinitStatus) {再次设置微信分享信息}
d.showWxmask = function() {弹出微信引导}
function loginAfter(user) {登录后执行函数}
function sharecallback(sharedata) {微信分享回调js}
网友评论