luyanan 7 vuotta sitten
vanhempi
commit
ef33cb1535
5 muutettua tiedostoa jossa 81 lisäystä ja 70 poistoa
  1. 4 4
      css/genindex.css
  2. 1 1
      css/share.css
  3. 52 52
      js/discover.js
  4. 2 1
      js/public/zoomify.js
  5. 22 12
      js/qa-show.js

+ 4 - 4
css/genindex.css

@ -916,10 +916,10 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
916 916
.item_detail .h1Font{font-weight:normal;font-size:24px;line-height:34px;color:#000;margin-bottom:10px;}
917 917
.item_detail .list_con{font-size: 15px;color: #333;line-height: 26px;margin: 6px 0;text-align:justify}
918 918
.item_info{margin:10px 0 6px;font-size:14px;color:#888888;}
919
.list_image{display: none;}
919
.list-main .list_image{display: none;}
920 920
.list_image li{display: inline-block;float:left; width:26%; -webkit-box-sizing: border-box;box-sizing: border-box;position: relative;}
921 921
.list_image li>.imgspan{display: block;width: 97%;height:120px;margin-bottom:10px;background-size: cover;background-position: center;}
922
.list_image li>.imgspan img{opacity: 0;width:100%}
922
.list_image li>.imgspan img{opacity: 0;width:100%;height:100%}
923 923
924 924
.list_hander{margin:10px 0;position: relative;}
925 925
.list_hander .goSpan span{margin:0 6px 0 0;width: 102px;}
@ -944,7 +944,7 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
944 944
.qa-question{width:100%;font-size: 16px;line-height: 28px;color: #333;}
945 945
.list-hold .qa-owner{min-height: 50px;margin:6px 0 10px;position: relative;}
946 946
.list-hold .qa-owner .goSpan{position: absolute;right: 0; top:50%;margin-top:-17px;}
947
.list-hold .qa-owner .goSpan>span{margin: 0px;width: 100px;}
947
.list-hold .qa-owner .goSpan>span{margin: 0px;width: 100px;background-position: 26px center;}
948 948
.list-hold .qa-owner .owner-head.useHead{width:50px;height:50px;margin-top:-25px}
949 949
.list-hold .qa-owner .owner-info{padding-left:60px;width: 100%;padding-right:100px;}
950 950
.list-hold .owner-name{float: none;}
@ -958,7 +958,7 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
958 958
.hold-icon{position:relative;top:3px;display:inline-block;width:15px;height:15px;background-size: 100% auto;background-repeat: no-repeat;}
959 959
.icon-zan{background-image:url(../images/qa-icon-zan.png);background-position:0 -14px;}
960 960
.icon-cai{background-image:url(../images/qa-icon-cai.png);background-position:0 -13px;}
961
.holdSpan .noZan,.holdSpan .noCai{background:none;padding:7px 6px;cursor:auto;}
961
.holdSpan .noZan,.holdSpan .noCai{cursor:auto;}
962 962
.holdSpan>div.active{color: #FFFFFF;background:#ff9900;}
963 963
.holdSpan>div.active .icon-zan{background-image:url(../images/qa-icon-zan.png);background-position:0 0;}
964 964
.holdSpan>div.active .icon-cai{background-image:url(../images/qa-icon-cai.png);background-position:0 1px;}

+ 1 - 1
css/share.css

@ -450,7 +450,7 @@ ul.mui-table-view>li:last-child:after{background: none;}
450 450
.item-btn{overflow: hidden;}
451 451
.list_image li,.item-btn li{display: inline-block;float:left; width: 33.3%; -webkit-box-sizing: border-box;box-sizing: border-box;position: relative;}
452 452
.list_image li>.imgspan{display: block;width: 98%;height:90px;background-size: cover;background-position: center;}
453
.list_image li>.imgspan img{opacity: 0;width: 100%;}
453
.list_image li>.imgspan img{opacity: 0;width: 100%;height:100%}
454 454
455 455
.item-btn{margin:6px -16px -15px -15px;border-top:1px solid #e5e5e5;}
456 456
.item-btn li{border-right:1px solid #e5e5e5;height: 46px;}

+ 52 - 52
js/discover.js

@ -81,56 +81,56 @@ $(function() {
81 81
		});
82 82
	
83 83
		// 当有文件添加进来的时候
84
		uploader.on('fileQueued', function(file) {
85
			fileId = file.id;
86
			var $len = $("#fileList").find("img").length;
87
			if($len == 0 || $len == 1) {
88
				var oRemove = $("#fileList").find("dd");
89
				oRemove.eq(oRemove.length - 1).remove();
90
			} 
91
			var $li = $(
92
					'<dd>' +
93
						'<div class="imgItem" id="' + file.id + '">'+
94
							'<img />' +
95
						'</div>'+
96
					'</dd>'
97
				),
98
				$btns = $('<div class="file-panel">' +
99
					'<span class="cancel"></span>' +
100
					'</div>').appendTo($li),
101
				$img = $li.find('img');
102
			var $list = $("#fileList");
103
			if($len == 1) {
104
				$list.find("dd").eq(0).after($li)
105
			} else if($len == 2) {
106
				$list.find("dd").eq(1).after($li)
107
			} else {
108
				$list.prepend($li);
109
			}
110
	
111
			// 创建缩略图
112
			// 如果为非图片文件,可以不用调用此方法。
113
			// thumbnailWidth x thumbnailHeight 为 100 x 100
114
			uploader.makeThumb(file, function(error, src) {
115
				if(error) {
116
					$img.replaceWith('<span>不能预览</span>');
117
					return;
118
				}
119
				$img.attr('src', src);
120
			}, 1, 1);
121
		});
122
		uploader.onError = function(code) {
123
			console.log(code)
124
			$.MsgBox.Alert('提示', '请上传jpg、jpeg、png格式的图片,大小不超过2M')
125
		};
126
		uploader.on('uploadSuccess', function(file, data) {
127
			if(data.success) {
128
					uploader.removeFile(fileId);
129
					var cacheImageKey = temp.push(data.data[0].cacheKey);
130
			}else{
131
				$.MsgBox.Alert('提示', '只支持jpeg/jpg/png格式的图片');
132
			}
133
		});
84
//		uploader.on('fileQueued', function(file) {
85
//			fileId = file.id;
86
//			var $len = $("#fileList").find("img").length;
87
//			if($len == 0 || $len == 1) {
88
//				var oRemove = $("#fileList").find("dd");
89
//				oRemove.eq(oRemove.length - 1).remove();
90
//			} 
91
//			var $li = $(
92
//					'<dd>' +
93
//						'<div class="imgItem" id="' + file.id + '">'+
94
//							'<img />' +
95
//						'</div>'+
96
//					'</dd>'
97
//				),
98
//				$btns = $('<div class="file-panel">' +
99
//					'<span class="cancel"></span>' +
100
//					'</div>').appendTo($li),
101
//				$img = $li.find('img');
102
//			var $list = $("#fileList");
103
//			if($len == 1) {
104
//				$list.find("dd").eq(0).after($li)
105
//			} else if($len == 2) {
106
//				$list.find("dd").eq(1).after($li)
107
//			} else {
108
//				$list.prepend($li);
109
//			}
110
//	
111
//			// 创建缩略图
112
//			// 如果为非图片文件,可以不用调用此方法。
113
//			// thumbnailWidth x thumbnailHeight 为 100 x 100
114
//			uploader.makeThumb(file, function(error, src) {
115
//				if(error) {
116
//					$img.replaceWith('<span>不能预览</span>');
117
//					return;
118
//				}
119
//				$img.attr('src', src);
120
//			}, 1, 1);
121
//		});
122
//		uploader.onError = function(code) {
123
//			console.log(code)
124
//			$.MsgBox.Alert('提示', '请上传jpg、jpeg、png格式的图片,大小不超过2M')
125
//		};
126
//		uploader.on('uploadSuccess', function(file, data) {
127
//			if(data.success) {
128
//					uploader.removeFile(fileId);
129
//					var cacheImageKey = temp.push(data.data[0].cacheKey);
130
//			}else{
131
//				$.MsgBox.Alert('提示', '只支持jpeg/jpg/png格式的图片');
132
//			}
133
//		});
134 134
		/*删除图片*/
135 135
		$("#fileList").on("click", ".cancel", function() {
136 136
			var flag=$(this).attr("flag");
@ -680,7 +680,7 @@ $(function() {
680 680
        if (dataStr.num > 0) {
681 681
            hd = '<span>回答 ' + dataStr.num + '</span>'
682 682
        }
683
        var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.id+'">'
683
        var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.id+'" class="flexCenter">'
684 684
        	strAdd += '<div class="lefthead qa-Head" style="background-image:url('+ baImg +')"><span class="columTag">问答</span></div>';
685 685
			strAdd += '<div class="centercon centercon2"><p class="h1font ellipsisSty-2">'+ dataStr.title +'</p>';
686 686
			strAdd += '<div class="h2font showInfo clearfix">'
@ -694,7 +694,7 @@ $(function() {
694 694
	}
695 695

696 696
	function otherQa(dataStr,listLi){
697
        var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.qid+'&topid='+dataStr.id+'">'+
697
        var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.qid+'&topid='+dataStr.id+'" class="flexCenter">'+
698 698
            '<div class="madiaInfo">' +
699 699
            '<div class="ellipsisSty qa-question"></div>' +
700 700
            '<div class="flexCenter qa-owner">' +

+ 2 - 1
js/public/zoomify.js

@ -76,7 +76,7 @@
76 76
		var that      = this,
77 77
			transform = this.$image.css('transform');
78 78
			this.$image.css("opacity",1)
79
		
79
			this.$image.css("height","auto")
80 80
		this.transition(this.$image, 'none');
81 81
		this.transform('none');
82 82
		
@ -109,6 +109,7 @@
109 109
	Zoomify.prototype.zoomOut = function () {
110 110
		var that = this;
111 111
		this.$image.css("opacity",0)
112
		this.$image.css("height","100%")
112 113
		
113 114
		this._zooming = true;
114 115
		this.$image.trigger('zoom-out.zoomify');

+ 22 - 12
js/qa-show.js

@ -14,7 +14,7 @@ $(function() {
14 14
	if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
15 15
	 	location.href="http://" + hurl + "/e/wen.html?id="+questionId;
16 16
	}
17
	var rows = 2,
17
	var rows = 10,
18 18
		dataO = {
19 19
			time: "",
20 20
			id: "",
@ -312,14 +312,10 @@ $(function() {
312 312
			var zancai='<div class="zan canZan"><em class="hold-icon icon-zan"></em><span class="agreeCount"></span></div>'+
313 313
						'<div class="cai canCai"><em class="hold-icon icon-cai"></em></div>'
314 314
			if(dataStr.uid==userid){
315
				var ballot=""
316
				if(dataStr.ballot>0){
317
					ballot=dataStr.ballot
318
				}
319 315
				opertStr='<span class="xiugai">修改</span><span class="shanchu">删除</span>'
320 316
				time="修改于 "+commenTime(dataStr.modifyTime)
321 317
				zancai='<div class="zan noZan"><em class="hold-icon icon-zan"></em><span class="agreeCount"></span></div>'+
322
						'<div class="cai noCai"><em class="hold-icon icon-cai"></em> <span>'+ballot+'</span></div>'
318
						'<div class="cai noCai"><em class="hold-icon icon-cai"></em></div>'
323 319
			}
324 320
			liStr.className="list-qa"
325 321
			liStr.setAttribute("data-id", dataStr.id);
@ -347,9 +343,9 @@ $(function() {
347 343
	            	'<div class="operateBlock tip-offs floatR">'+opertStr+'</div>'+
348 344
				'</div>'
349 345
			
350
			liStr.innerHTML = '<div class="madiaInfo answerInfo"><a target="_blank" href="/qa-show.html?id='+dataStr.qid+'&topid='+dataStr.id+'">' +
346
			liStr.innerHTML = '<div class="madiaInfo answerInfo">' +
351 347
				'<div class="flexCenter qa-owner"></div>' +
352
				'<p class="qa-con ellipsisSty-3">' + (dataStr.cnt).replace(/\n/g,"<br />") + '</p></a>' +
348
				'<p class="qa-con">' + (dataStr.cnt).replace(/\n/g,"<br />") + '</p>' +
353 349
				'<div class="item_info"><span class="time">' + time + '</span></div>'+
354 350
				operatStr+
355 351
				'</div>'+
@ -449,9 +445,9 @@ $(function() {
449 445
			$str.find(".collectBtn").on('click', function() {
450 446
				if(userid && userid != null && userid != "null") {
451 447
					if($(this).is('.icon-collected')){
452
						cancelCollectionAbout(anid,$(this),8)
448
						cancelCollectionAbout(anid,$(this),9)
453 449
					} else {
454
						collectionAbout(anid,$(this),8);
450
						collectionAbout(anid,$(this),9);
455 451
					}
456 452
				}else{
457 453
					quickLog();
@ -471,7 +467,7 @@ $(function() {
471 467
				}
472 468
			});
473 469
			//点赞回答
474
			$str.find(".zan").on("click",function(){
470
			$str.find(".canZan").on("click",function(){
475 471
				if(userid && userid != null && userid != "null") {
476 472
					if($(this).is('.active')){
477 473
						oAjax('/ajax/question/answer/agree/cancle', {
@ -479,7 +475,7 @@ $(function() {
479 475
							"uid":userid,
480 476
							"uname":username
481 477
						}, "POST", function(res) {
482
							$str.find(".zan").removeClass("active")
478
							$str.find(".canZan").removeClass("active")
483 479
						})
484 480
					}else{
485 481
						oAjax('/ajax/question/answer/agree', {
@ -632,6 +628,20 @@ $(function() {
632 628
				if(Fflag){
633 629
					inviteStatus(dataStr.id, $str);
634 630
				}
631
				//关注专家
632
				$str.find(".attenSpan").on('click', function() {
633
					if(userid && userid != null && userid != "null") {
634
						if($(this).is('.attenedSpan')){
635
							cancelCollectionAbout(dataStr.id,$(this),1)
636
						} else {
637
							collectionAbout(dataStr.id,$(this),1);
638
						}
639
					}else{
640
						quickLog();
641
						operatTab();
642
						closeLog();
643
					}
644
				});
635 645
			});
636 646
		},
637 647
		isAgree=function(id,$str){