起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

123
返回列表 发新帖
楼主: 小马甲~-~

[处理中3] 微信QQ分享大BUG!!!!求帮忙

[复制链接]

25

主题

128

帖子

356

积分

中级会员

Rank: 3Rank: 3

积分
356
QQ
 楼主| 发表于 2016-12-7 15:26:56 | 显示全部楼层
liangyongfei 发表于 2016-12-7 14:49
是分享出去之后,打开页面报错的吗???
错误信息似乎是调用baasServer的时候出错了!
你可以调试看看, ...

我把我的测试页面代码给你看看
第一个方法是分享方法

  Model.prototype.weixinClick = function(event) {
//                share.shareTo({
//                        scene : "timeline"
//                });
                function success(result) {
                }
                function error(result) {
                }
                var url = window.location.href;
                alert('调用分享到微信朋友圈');
                if (!navigator.weixin) {
                        return;
                }
                function success(result) {
                        alert(JSON.stringify(result));
                }
                function error(result) {
                        alert(JSON.stringify(result));
                }
                /*
                 * Scene: { SESSION: 0, // 聊天界面 TIMELINE: 1, // 朋友圈 FAVORITE: 2 // 收藏 },
                 * Type: { APP: 1, EMOTION: 2, FILE: 3, IMAGE: 4, MUSIC: 5, VIDEO: 6,
                 * WEBPAGE: 7 },
                 */
                 alert("分享的路径是  "+url)
                var weixin = navigator.weixin;
                weixin.share({
                        message : {
                                title : "WeX5开发指南", // 标题
                                description : "分享到微信", // 描述,分享到朋友圈的时候描述不可见,分享给朋友时可见
                                mediaTagName : "轻松生活",
                                thumb : 'file:///C:\Users\Administrator\AppData\Roaming\Tencent\QQ\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pnghttp://wex5.com/cn/wp-content/uploads/2015/03/wen-xin-2.png',//location.origin + require.toUrl('./img/weixin.jpg'), // 图标,图标不能大于30KB,
                                // location.origin
                                // +
                                // require.toUrl('./');
                                media : {
                                       // type : weixin.Type.WEBPAGE, // webpage
                                        // 设置分享类型,webpage为url
                                        webpageUrl :  utils.getShareUrl(url)
                                // Utils.getShareUrl()
                                // 设置当前页面为分享url,Utils.getShareUrl("[img]file:///C:\Users\ADMINI~1\AppData\Local\Temp\[5UQ[BL(6~BS2JV6W}N6[%S.png[/img]http://www.baidu.com")
                                // 设置指定url为分享页面
                                // webpage
                                }
                        },
                        scene : navigator.weixin.Scene.TIMELINE
                }, success, error);

        };





第二个方法是 model时间里面 回来的方法

Model.prototype.modelLoad = function(event){
                alert("modelLoad111");
                var self = this;
                var url = window.location.href;
                alert(url)
                base.ready(function() {
                //        self.ready.set(true);
                        share.onMenuShareTimeline({
                                title : 'WeX5开发指南',
                                link :  utils.getShareUrl(url),
                                imgUrl : 'file:///C:\Users\Administrator\AppData\Roaming\Tencent\QQ\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pnghttp://wex5.com/cn/wp-content/uploads/2015/03/wen-xin-2.png',
                                trigger : function(res) {
                                        // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容,因为客户端分享操作是一个同步操作,这时候使用ajax的回包会还没有返回
                                        alert('用户点击分享到朋友圈');
                                },
                                success : function(res) {
                                        alert('已分享');
                                },
                                cancel : function(res) {
                                        alert('已取消');
                                },
                                fail : function(res) {
                                        alert(JSON.stringify(res));
                                }
                        });
                        });

};

回复 支持 反对

使用道具 举报

发表于 2016-12-7 16:17:38 | 显示全部楼层
小马甲~-~ 发表于 2016-12-7 15:26
我把我的测试页面代码给你看看
第一个方法是分享方法

你打印下:
window.location.href;
是什么吧!肯定是不一样的!
在微信中打开的url地址  肯定不一样!
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

25

主题

128

帖子

356

积分

中级会员

Rank: 3Rank: 3

积分
356
QQ
 楼主| 发表于 2016-12-7 16:31:46 | 显示全部楼层
liangyongfei 发表于 2016-12-7 16:17
你打印下:
window.location.href;
是什么吧!肯定是不一样的!

http://localhost:8080/x5/UI2/v_/eduApp/index.w
原始的地址 这是我这个页面的地址
后台报错 是 error 40125
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2025-2-5 22:57 , Processed in 0.053147 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表