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

QQ登录

只需一步,快速开始

查看: 1440|回复: 1

[处理中3] 做微信和朋友圈的分享出现了未知错误的弹窗

[复制链接]

1

主题

1

帖子

7

积分

新手上路

Rank: 1

积分
7
QQ
发表于 2017-1-20 22:00:57 | 显示全部楼层 |阅读模式
  1. define(function(require){
  2.         var $ = require("jquery");
  3.         var justep = require("$UI/system/lib/justep");
  4.         require("cordova!com.justep.cordova.plugin.qq");
  5.     require("cordova!com.justep.cordova.plugin.weixin.v3");
  6.        
  7.         var Model = function(){
  8.                 this.callParent();
  9.         };
  10.         var img = "http://106.14.78.41:8088/framexc/upload/176-176.png";
  11.         //朋友圈
  12.         Model.prototype.col1Click = function(event){
  13.         debugger;
  14.                  function success(result) {
  15.                 alert(JSON.stringify(result));
  16.                 window.location.href = './personal-center.w';
  17.             }
  18.             function error(result) {
  19.                 alert(JSON.stringify(result));
  20.                 window.location.href = './personal-center.w';
  21.             }
  22.             navigator.weixin.share({
  23.                 message : {
  24.                     title : "大师帮分享",
  25.                     description : "分享到微信",
  26.                     mediaTagName : "Media Tag Name(optional)",
  27.                     thumb : img,
  28.                     media : {
  29.                         // type: weixin.Type.WEBPAGE, // webpage
  30. //                        webpageUrl : "http://139.196.197.196:8088/framexc/dashibang/newhtml/dashibang-download.html"
  31.                             webpageUrl : "http://106.14.78.41:8088/framexc/dashibang/newhtml/dashibang-download.html"

  32.                     // webpage
  33.                     }
  34.                 },
  35.                 scene : navigator.weixin.Scene.TIMELINE
  36.             }, success, error);
  37.         };
  38.        
  39.         //微信
  40.         Model.prototype.col2Click = function(event){
  41.                  function success(result) {
  42.                 alert(JSON.stringify(result));
  43.             }
  44.             function error(result) {
  45.                 alert(JSON.stringify(result));
  46.             }
  47.             navigator.weixin.share({
  48.                 message : {
  49.                     title : "大师帮分享",
  50.                     description : "分享到微信",
  51.                     mediaTagName : "Media Tag Name(optional)",
  52.                     thumb : img,
  53.                     media : {
  54.                         // type: weixin.Type.WEBPAGE, // webpage
  55. //                        webpageUrl : "http://139.196.197.196:8088/framexc/dashibang/newhtml/dashibang-download.html"
  56.                             webpageUrl : "http://106.14.78.41:8088/framexc/dashibang/newhtml/dashibang-download.html"

  57.                     // webpage
  58.                     }
  59.                 },
  60.                 scene : navigator.weixin.Scene.SESSION
  61.             }, success, error);
  62.         };
  63.        
  64.         //qq空间
  65.         Model.prototype.col4Click = function(event){
  66.                 function success(result) {
  67.                 alert(JSON.stringify(result));
  68.             }
  69.             function error(result) {
  70.                 alert(JSON.stringify(result));
  71.             }
  72.             var args = {};
  73. //            args.url = "http://139.196.197.196:8088/framexc/dashibang/newhtml/dashibang-download.html";//下载路径
  74.             args.url = "http://106.14.78.41:8088/framexc/dashibang/newhtml/dashibang-download.html";//下载路径
  75.             args.title =  "大师帮";
  76.             args.description = "大师帮分享";
  77. //            args.imageUrl = ['http://139.196.197.196:8088/framexc/upload/176-176.png'];
  78.             args.imageUrl = ['http://106.14.78.41:8088/framexc/upload/176-176.png'];

  79.             args.appName = "";
  80.          
  81.             navigator.QQ.shareToQzone(success, error, args);
  82.         };
  83.        
  84.         //qq
  85.         Model.prototype.col3Click = function(event){
  86.             var title = "大师帮分享";
  87.             var picPath = img;
  88.             
  89.             var args = {};
  90. //            args.url = "http://139.196.197.196:8088/framexc/dashibang/newhtml/dashibang-download.html";//下载路径
  91.             args.url = "http://106.14.78.41:8088/framexc/dashibang/newhtml/dashibang-download.html";//下载路径
  92.             
  93.             args.title = title;
  94.             args.description = "";
  95.             args.imageUrl = picPath;
  96.             args.appName = "大师帮";
  97.             navigator.QQ.shareToQQ(function(){
  98.                      justep.Util.hint("分享成功!")
  99.             },function(failReason){
  100.                     console.log(failReason);
  101.             },args);
  102.         };
  103.        

  104.         Model.prototype.button1Click = function(event){
  105.                 this.close();
  106.         };
  107.        

  108.         return Model;
  109. });
复制代码
发表于 2017-1-22 09:47:40 | 显示全部楼层
是按照文档来的吗?
http://docs.wex5.com/wechat-weibo-qq-share/

如果步骤和所设置的参数都一致,建议真机调试看下错误信息
,另外把你的参数拿来!重新打包平台自带案例!是否正常?
/UI2/demo/native/share/index.w
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-7-20 14:54 , Processed in 0.058953 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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