|
- define(function(require){
- var $ = require("jquery");
- var justep = require("$UI/system/lib/justep");
- require("cordova!com.justep.cordova.plugin.qq");
- require("cordova!com.justep.cordova.plugin.weixin.v3");
-
- var Model = function(){
- this.callParent();
- };
- var img = "http://106.14.78.41:8088/framexc/upload/176-176.png";
- //朋友圈
- Model.prototype.col1Click = function(event){
- debugger;
- function success(result) {
- alert(JSON.stringify(result));
- window.location.href = './personal-center.w';
- }
- function error(result) {
- alert(JSON.stringify(result));
- window.location.href = './personal-center.w';
- }
- navigator.weixin.share({
- message : {
- title : "大师帮分享",
- description : "分享到微信",
- mediaTagName : "Media Tag Name(optional)",
- thumb : img,
- media : {
- // type: weixin.Type.WEBPAGE, // webpage
- // webpageUrl : "http://139.196.197.196:8088/framexc/dashibang/newhtml/dashibang-download.html"
- webpageUrl : "http://106.14.78.41:8088/framexc/dashibang/newhtml/dashibang-download.html"
- // webpage
- }
- },
- scene : navigator.weixin.Scene.TIMELINE
- }, success, error);
- };
-
- //微信
- Model.prototype.col2Click = function(event){
- function success(result) {
- alert(JSON.stringify(result));
- }
- function error(result) {
- alert(JSON.stringify(result));
- }
- navigator.weixin.share({
- message : {
- title : "大师帮分享",
- description : "分享到微信",
- mediaTagName : "Media Tag Name(optional)",
- thumb : img,
- media : {
- // type: weixin.Type.WEBPAGE, // webpage
- // webpageUrl : "http://139.196.197.196:8088/framexc/dashibang/newhtml/dashibang-download.html"
- webpageUrl : "http://106.14.78.41:8088/framexc/dashibang/newhtml/dashibang-download.html"
- // webpage
- }
- },
- scene : navigator.weixin.Scene.SESSION
- }, success, error);
- };
-
- //qq空间
- Model.prototype.col4Click = function(event){
- function success(result) {
- alert(JSON.stringify(result));
- }
- function error(result) {
- alert(JSON.stringify(result));
- }
- var args = {};
- // args.url = "http://139.196.197.196:8088/framexc/dashibang/newhtml/dashibang-download.html";//下载路径
- args.url = "http://106.14.78.41:8088/framexc/dashibang/newhtml/dashibang-download.html";//下载路径
- args.title = "大师帮";
- args.description = "大师帮分享";
- // args.imageUrl = ['http://139.196.197.196:8088/framexc/upload/176-176.png'];
- args.imageUrl = ['http://106.14.78.41:8088/framexc/upload/176-176.png'];
- args.appName = "";
-
- navigator.QQ.shareToQzone(success, error, args);
- };
-
- //qq
- Model.prototype.col3Click = function(event){
- var title = "大师帮分享";
- var picPath = img;
-
- var args = {};
- // args.url = "http://139.196.197.196:8088/framexc/dashibang/newhtml/dashibang-download.html";//下载路径
- args.url = "http://106.14.78.41:8088/framexc/dashibang/newhtml/dashibang-download.html";//下载路径
-
- args.title = title;
- args.description = "";
- args.imageUrl = picPath;
- args.appName = "大师帮";
- navigator.QQ.shareToQQ(function(){
- justep.Util.hint("分享成功!")
- },function(failReason){
- console.log(failReason);
- },args);
- };
-
- Model.prototype.button1Click = function(event){
- this.close();
- };
-
- return Model;
- });
复制代码 |
|