Parcourir la Source

添加收藏产品

luyanan 6 ans auparavant
Parent
commit
3d168a392a
3 fichiers modifiés avec 62 ajouts et 2 suppressions
  1. 1 2
      cmp-portal/js/cmp-staff-invite.js
  2. 54 0
      js/userInforShow.js
  3. 7 0
      userInforShow.html

+ 1 - 2
cmp-portal/js/cmp-staff-invite.js

@ -1,7 +1,6 @@
1 1
//接受企业邀请,注册「科袖」
2 2
$(function() {
3
//	var sc = GetQueryString("sc");
4
var sc = '9B9AD50F07A0480E840B178B34516ED8'
3
	var sc = GetQueryString("sc");
5 4
	var companyNameVal, companyPhoneVal, companyscVal, companyPswVal1;
6 5
	var setname = false;
7 6
	var phonePass = false;

+ 54 - 0
js/userInforShow.js

@ -1332,6 +1332,11 @@ $(function() {
1332 1332
					newStr="用户还未收藏任何服务"
1333 1333
					detailService(arr,aimId);
1334 1334
				}
1335
				else if(type==11){
1336
					aimId="attendProduct"
1337
					newStr="用户还未收藏任何产品"
1338
					detailProduct(arr,aimId);
1339
				}
1335 1340
				var liLen=document.getElementById(aimId).querySelectorAll("li").length;
1336 1341
                removeNodata(aimId);
1337 1342
                if($info.length == 0 && liLen == 0 ){
@ -1735,6 +1740,55 @@ $(function() {
1735 1740
				}
1736 1741
			});
1737 1742
		},
1743
		detailProduct=function(arr,obj) {
1744
			oAjax("/ajax/product/qm",{
1745
				id:arr,
1746
			},"get",function(data){
1747
				console.log(data)
1748
				var dataItem=data.data;
1749
				for(var i = 0; i < dataItem.length; i++) {
1750
					var dataStr=dataItem[i]
1751
					var li = document.createElement("li");
1752
					li.className = "mui-table-view-cell";
1753
					var cnt="", rImg = "../images/default-product.jpg";
1754
					if(dataStr.images) {
1755
						var subs = strToAry(dataStr.images)
1756
						if(subs.length > 0) {
1757
							rImg="/data/product" + subs[0]
1758
						}
1759
					}
1760
					if(dataStr.cnt){
1761
						cnt="简介:"+dataStr.cnt
1762
					}
1763
					var strAdd = '';
1764
						strAdd += '<a target="_blank" href="productShow.html?productId='+dataStr.id+'" class="flexCenter urlgo">';
1765
						strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ rImg +')"></div>';
1766
						strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.name +'</p>';
1767
						strAdd += '<p class="h1Font ellipsisSty"><span class="ownerName"></span><em class="authiconNew ownerSty"></em></p>';
1768
						strAdd += '<p class="h2Font ellipsisSty-2">'+ cnt+'</p></div>';
1769
						strAdd += '</a>';
1770
					li.innerHTML = strAdd
1771
					var $itemlist = $(li);
1772
					document.getElementById(obj).appendChild(li);
1773
					(function(mo){
1774
						cacheModel.getCompany(dataStr.owner,function(sc,value){
1775
							if(sc){
1776
								if(value.forShort){
1777
									mo.find(".ownerName").html(value.forShort)
1778
								}else{
1779
									mo.find(".ownerName").html(value.name)
1780
								}
1781
								if(value.authStatus==3) {
1782
									mo.find(".ownerSty").addClass("authicon-com-ok").attr("title","科袖认证企业")
1783
								}
1784
							}else{
1785
								console.log("error")
1786
							}
1787
						})
1788
					})($itemlist);
1789
				}
1790
			});
1791
		},
1738 1792
		proinfo=function(pid, $str) {
1739 1793
			oAjax("/ajax/professor/baseInfo/" + pid,{}, "get", function(data){
1740 1794
                var dataStr = data.data

+ 7 - 0
userInforShow.html

@ -107,6 +107,7 @@
107 107
									<li rel="item8drop4item3" id="collectParTab" data-num="5" class="attentType">我收藏的论文</li>
108 108
									<li rel="item8drop4item5" id="collectDemTab" data-num="7" class="attentType">我收藏的需求</li>
109 109
									<li rel="item8drop4item6" id="collectAnsTab" data-num="9" class="attentType">我收藏的回答</li>
110
									<li rel="item8drop4item8" id="collectProdTab" data-num="11" class="attentType">我收藏的产品</li>
110 111
								</ul>
111 112
							</li>
112 113
							<li rel="item8drop5" class="attendMy" id="tabAttendMy">关注我的人</li>
@ -385,6 +386,12 @@
385 386
							<div id="item8drop4item7" class="coninfocon form-result aboutRes droplistcon">
386 387
								<ul id="attendSer">
387 388
									
389
								</ul>
390
								<button class="js-load-more"></button>
391
							</div>
392
							<div id="item8drop4item8" class="coninfocon form-result aboutRes droplistcon">
393
								<ul id="attendProduct">
394
									
388 395
								</ul>
389 396
								<button class="js-load-more"></button>
390 397
							</div>