Просмотр исходного кода

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

xuchunyang лет назад: 8
Родитель
Сommit
78f2363946
5 измененных файлов с 25 добавлено и 16 удалено
  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,7 +112,7 @@ mui.ready(function() {
112 112
				share.send(msg, function() {
113 113
					plus.nativeUI.closeWaiting();
114 114
					//var strtmp = "分享到\"" + share.description + "\"成功! ";
115
					shareAddIntegral();
115
					shareAddIntegral(1);
116 116
					/*plus.nativeUI.toast(strtmp, {
117 117
						verticalAlign: 'center'
118 118
					});*/

+ 1 - 5
app/js/professorArticle.js

@ -461,11 +461,7 @@ mui.plusReady(function() {
461 461
		};
462 462
		share.send(msg, function() {
463 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 465
		}, function(e) {
470 466
			plus.nativeUI.closeWaiting();
471 467
			if(e.code == -2) {

+ 3 - 2
app/js/proinfobrow.js

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

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

@ -85,8 +85,8 @@ function ifiosAmdandroid(test){
85 85
	}
86 86
}
87 87

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

121 121
//用户分享专家到微信后增加积分
122
function shareAddIntegral() {
122
function shareAddIntegral(num) {
123 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 136
		dataType: 'json', //数据格式类型
126 137
		type: 'POST', //http请求类型
127 138
		timeout: 10000, //超时设置
@ -132,9 +143,9 @@ function shareAddIntegral() {
132 143
		success: function(data) {
133 144
			console.log(data)
134 145
			if(data.success && data.data) {
135
				plus.nativeUI.toast("成功分享专家信息到微信", toastStyle);
146
				plus.nativeUI.toast(title, toastStyle);
136 147
			} else {
137
				plus.nativeUI.toast("分享超过5次,不能再获得积分和成长值", toastStyle);
148
				plus.nativeUI.toast("分享超过10次,不能再获得积分和成长值", toastStyle);
138 149
			}
139 150
		},
140 151
		error: function() {

+ 3 - 2
app/js/resinforbrow.js

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