Browse Source

文章,资源,专家,分享增积分

xuchunyang 8 years ago
parent
commit
78f2363946
5 changed files with 25 additions and 16 deletions
  1. 1 1
      app/js/mycard.js
  2. 1 5
      app/js/professorArticle.js
  3. 3 2
      app/js/proinfobrow.js
  4. 17 6
      app/js/public/base.js
  5. 3 2
      app/js/resinforbrow.js

+ 1 - 1
app/js/mycard.js

112
				share.send(msg, function() {
112
				share.send(msg, function() {
113
					plus.nativeUI.closeWaiting();
113
					plus.nativeUI.closeWaiting();
114
					//var strtmp = "分享到\"" + share.description + "\"成功! ";
114
					//var strtmp = "分享到\"" + share.description + "\"成功! ";
115
					shareAddIntegral();
115
					shareAddIntegral(1);
116
					/*plus.nativeUI.toast(strtmp, {
116
					/*plus.nativeUI.toast(strtmp, {
117
						verticalAlign: 'center'
117
						verticalAlign: 'center'
118
					});*/
118
					});*/

+ 1 - 5
app/js/professorArticle.js

461
		};
461
		};
462
		share.send(msg, function() {
462
		share.send(msg, function() {
463
			plus.nativeUI.closeWaiting();
463
			plus.nativeUI.closeWaiting();
464
			var strtmp = "分享到\"" + share.description + "\"成功! ";
465
			console.log(strtmp);
466
			plus.nativeUI.toast(strtmp, {
467
				verticalAlign: 'center'
468
			});
464
			shareAddIntegral(3);
469
		}, function(e) {
465
		}, function(e) {
470
			plus.nativeUI.closeWaiting();
466
			plus.nativeUI.closeWaiting();
471
			if(e.code == -2) {
467
			if(e.code == -2) {

+ 3 - 2
app/js/proinfobrow.js

691
		};
691
		};
692
		share.send(msg, function() {
692
		share.send(msg, function() {
693
			plus.nativeUI.closeWaiting();
693
			plus.nativeUI.closeWaiting();
694
			var strtmp = "分享到\"" + share.description + "\"成功! ";
694
			/*var strtmp = "分享到\"" + share.description + "\"成功! ";
695
			console.log(strtmp);
695
			console.log(strtmp);
696
			plus.nativeUI.toast(strtmp, {
696
			plus.nativeUI.toast(strtmp, {
697
				verticalAlign: 'center'
697
				verticalAlign: 'center'
698
			});
698
			});*/
699
			shareAddIntegral(1);
699
		}, function(e) {
700
		}, function(e) {
700
			plus.nativeUI.closeWaiting();
701
			plus.nativeUI.closeWaiting();
701
			if(e.code == -2) {
702
			if(e.code == -2) {

+ 17 - 6
app/js/public/base.js

85
	}
85
	}
86
}
86
}
87

87

88
//遮罩模态框
89
/*var promptBlock = document.getElementsByClassName("promptBlock");
88
/*//遮罩模态框
89
var promptBlock = document.getElementsByClassName("promptBlock");
90
var model = mui.createMask(modelClose);//创建遮罩
90
var model = mui.createMask(modelClose);//创建遮罩
91
function modelClose(){
91
function modelClose(){
92
	for(var i=0;i<promptBlock.length;i++){
92
	for(var i=0;i<promptBlock.length;i++){
119
}
119
}
120

120

121
//用户分享专家到微信后增加积分
121
//用户分享专家到微信后增加积分
122
function shareAddIntegral() {
122
function shareAddIntegral(num) {
123
	var userId = plus.storage.getItem('userid');
123
	var userId = plus.storage.getItem('userid');
124
	mui.ajax(baseUrl + "/ajax/growth/sharePro", {
124
	var burl,title;
125
	if(num==1){
126
		burl = "/ajax/growth/sharePro";
127
		title = "成功分享专家信息到微信";
128
	}else if(num==2){
129
		burl = "/ajax/growth/shareRes";
130
		title = "成功分享资源信息到微信";
131
	}else if(num==3){
132
		burl = "/ajax/growth/shareArticle";
133
		title = "成功分享文章信息到微信";
134
	}
135
	mui.ajax(baseUrl + burl, {
125
		dataType: 'json', //数据格式类型
136
		dataType: 'json', //数据格式类型
126
		type: 'POST', //http请求类型
137
		type: 'POST', //http请求类型
127
		timeout: 10000, //超时设置
138
		timeout: 10000, //超时设置
132
		success: function(data) {
143
		success: function(data) {
133
			console.log(data)
144
			console.log(data)
134
			if(data.success && data.data) {
145
			if(data.success && data.data) {
135
				plus.nativeUI.toast("成功分享专家信息到微信", toastStyle);
146
				plus.nativeUI.toast(title, toastStyle);
136
			} else {
147
			} else {
137
				plus.nativeUI.toast("分享超过5次,不能再获得积分和成长值", toastStyle);
148
				plus.nativeUI.toast("分享超过10次,不能再获得积分和成长值", toastStyle);
138
			}
149
			}
139
		},
150
		},
140
		error: function() {
151
		error: function() {

+ 3 - 2
app/js/resinforbrow.js

503
		};
503
		};
504
		share.send(msg, function() {
504
		share.send(msg, function() {
505
			plus.nativeUI.closeWaiting();
505
			plus.nativeUI.closeWaiting();
506
			var strtmp = "分享到\"" + share.description + "\"成功! ";
506
			/*var strtmp = "分享到\"" + share.description + "\"成功! ";
507
			console.log(strtmp);
507
			console.log(strtmp);
508
			plus.nativeUI.toast(strtmp, {
508
			plus.nativeUI.toast(strtmp, {
509
				verticalAlign: 'center'
509
				verticalAlign: 'center'
510
			});
510
			});*/
511
			shareAddIntegral(2);
511
		}, function(e) {
512
		}, function(e) {
512
			plus.nativeUI.closeWaiting();
513
			plus.nativeUI.closeWaiting();
513
			if(e.code == -2) {
514
			if(e.code == -2) {