' + item.Coupon.Code + '
'; html += '第三方優惠券,續商戶職員填寫核銷碼,請移步APP端操作
'; } html += '使用時間:' + item.Coupon.StartDate.slice(0, -3) + ' - ' + item.Coupon.OverdueDate.slice(0, -3) + '
'; html += '使用條款:' + item.Clause + '
'; html += '' + val.Staff.Staff.Name + ' ' + val.Staff.Staff.EnglishName + '
'; strHtml += '' + val.Staff.Staff.ExtTitleCh + '
'; strHtml += '' + val.Building + '
'; if (val.Type == 2 || val.Type == 4) { strHtml += '' + val.Bigdistnam + '-' + val.District + ''; strHtml += '' + toThousands(val.GrossArea) + '呎 | ' + val.CountF + '室' + val.CountT + '廳 | ' + val.PropertyUsage + '
'; } if (val.Type == 4) { strHtml += '' + toThousands(val.GrossArea) + '呎 | ' + val.PropertyUsage + '
'; } if (val.SellType != "放租") { strHtml += '約 HK $' + toPrice(val.AvgPrice) + ' 元/呎(約MOP $' + toPrice(val.AvgPrice * 1.03) + '元/呎)
'; } else { strHtml += '約 HK $' + toPrice(val.AvgRent) + ' 元/呎(約MOP $' + toPrice(val.AvgRent * 1.03) + '元/呎)
'; } strHtml += '(租MOP $' + toPrice(val.MoRent) + '元/月)
'; strHtml += '(售MOP $' + toPrice(val.MoPrice) + '萬)
'; strHtml += '(租MOP $' + toPrice(val.MoRent) + '元/月)
'; strHtml += '(售MOP $' + toPrice(val.MoPrice) + '萬)
'; strHtml += ''; if (val.Type == 2 || val.Type == 4) { if (val.Imgs != null && val.Imgs.length != 0) { strHtml += ''; } else { strHtml += ''; } } else if (val.Type == 1 || val.Type == 3) { if (val.EstatesImgs != null && val.EstatesImgs.length != 0) { strHtml += ''; } else { strHtml += ''; } } strHtml += '
'; if (val.SellType == "放售") { strHtml += ''; } else if (val.SellType == "放租") { strHtml += ''; } else if (val.SellType == "租售") { strHtml += ''; } else { strHtml += ''; } if (val.BuildingStatus != 0) { strHtml += ''; } strHtml += '' + val.Building + '
'; if (val.Type == 2 || val.Type == 4) { strHtml += '' + val.Bigdistnam + '-'+ val.District + ''; strHtml += '' + toThousands(val.GrossArea) + '呎 | ' + val.CountF + '室' + val.CountT + '廳 | ' + val.PropertyUsage+'
'; } if (val.Type == 4) { strHtml += '' + toThousands(val.GrossArea) + '呎 | ' + val.PropertyUsage + '
'; } if (val.SellType != "放租") { strHtml += '約 HK $' + toThousands(val.AvgPrice) + ' 元/呎(約MOP $' + toPrice(val.AvgPrice * 1.03) + '元/呎)
'; } else { strHtml += '約 HK $' + toThousands(val.AvgRent) + ' 元/呎(約MOP $' + toPrice(val.AvgRent * 1.03) + '元/呎)
'; } strHtml += '(租MOP $' + toPrice(val.MoRent) + '元/月)
'; strHtml += '(售MOP $' + toPrice(val.MoPrice) + '萬)
'; strHtml += '(租MOP $' + toPrice(val.MoRent) + '元/月)
'; strHtml += '(售MOP $' + toPrice(val.MoPrice) + '萬)
'; strHtml += '' + val.Staff.Name + '
'; if (val.Staff.EnglishName == null) { strHtml += ''; } else { strHtml += '
' + val.Staff.EnglishName + '
'; } strHtml += '' + item.Staff.Staff.Name + ' ' + item.Staff.Staff.EnglishName +'
'; html += '' + item.Staff.Staff.ExtTitleCh +'
'; html += '' + item.Building + '
'; if (item.Bigdistnam != null && item.District != null) { html += '' + item.District + '-' + item.Bigdistnam + ''; } if (item.Type == 2 || item.Type == 4) { html += '' + toThousands(item.GrossArea) + '呎 | ' + item.CountF + '室' + item.CountT + '廳 | ' + item.PropertyUsage + '
'; } if (item.Type == 4) { html += '' + toThousands(item.GrossArea) + '呎 | ' + item.PropertyUsage + '
'; } if (SellType == 1) { html += '約 HK $' + toPrice(item.AvgPrice) + ' 元/呎(約MOP $' + toPrice(item.AvgPrice * 1.03) + '元/呎)
'; } else if (SellType == 2) { html += '約 HK $' + toPrice(item.AvgRent) + ' 元/呎(約MOP $' + toPrice(item.AvgRent * 1.03) + '元/呎)
'; } else { html += '约 HK $' + toPrice(item.AvgPrice) + '元/呎 (約MOP $' + toPrice(item.AvgPrice * 1.03) + '元/呎)
'; } html += '(租MOP $' + toPrice(item.MoRent) + '元/月)
'; html += '( 售MOP $' + toPrice(item.MoPrice) + '萬 )
'; html += '(租MOP $' + toPrice(item.MoRent) + '元/月)
'; html += '(售MOP $' + toPrice(item.MoPrice) + '萬)
'; html += '使用時間:' + val.Coupon.ReceiveDate.slice(0, -3) + '
'; html += '過期時間:' + val.Coupon.OverdueDate.slice(0, -3) + '
'; html += '詳細信息'; html += '' + val.VolumeName + '
'; html += ''; if (val.Coupon.Type == 0) { html += '立即使用'; } else if (val.Coupon.Type == -1) { html += '已過期'; } else if (val.Coupon.Type == 1) { html += '已使用'; } html += ''; html += '申請時間:' + val.CreateAt.slice(0, 11) + '
'; if (val.EvaDate != null && val.EvaDate != "") { html += '估價時間:' + val.EvaDate.slice(0, 11) + '
'; } html += '請加我微信
右鍵保存圖片
'; if (sessions[i].lastMsg != undefined) { parentStr += '' + diffTime(sessions[i].lastMsg.time) + ''; } else { parentStr += ''; } parentStr += '
'; if (sessions[i].lastMsg != undefined) { if (sessions[i].lastMsg.type == "text") { parentStr += '' + sessions[i].lastMsg.text + '
'; } else if (sessions[i].lastMsg.type == "audio") { parentStr += '[語音]
'; } else if (sessions[i].lastMsg.type == "video") { parentStr += '[視頻]
'; } else if (sessions[i].lastMsg.type == "image") { parentStr += '[圖片]
'; } else if (sessions[i].lastMsg.type == "location") { parentStr += '[位置]
'; } else if (sessions[i].lastMsg.type == "tip") { parentStr += '' + sessions[i].lastMsg.tip + '
'; } else if (sessions[i].lastMsg.type == "custom") { parentStr += '' + sessions[i].lastMsg.pushContent + '
'; } else { parentStr += '' + sessions[i].lastMsg.text + '
'; } parentStr += '' + staffName + '
'; } else { if (jobId.length > 7) { if (data.flow == "in") { parentdiv += '' + staffName + '
'; } else { parentdiv += '' + userName + '
'; } } else { parentdiv += '' + userName + '
'; } } parentdiv += '' + item.BuildingTitle + '
'; if (item.Type == 1) { parentdiv += ''; } else if (item.Type == 5) { parentdiv += ''; } parentdiv += ''; } else if (item.Type == 2 || item.Type == 3 || item.Type == 4) { //房源、视频搵楼、工商铺 if (item.Type == 2) { parentdiv += ''; } else if (item.Type == 3) { parentdiv += ''; } else if (item.Type == 4) { parentdiv += ''; } parentdiv += '租HK $' + toPrice(item.Rent) + '元(租MOP $' + toPrice(item.MoRent) + '元)
'; } else if (item.SellType == "租售") { parentdiv += '售HK $' + toPrice(item.Price) + '萬(售MOP $' + toPrice(item.MoPrice) + '萬)
'; parentdiv += '租HK $' + toPrice(item.Rent) + '元(租MOP $' + toPrice(item.MoRent) + '元)
'; } else { parentdiv += '售HK $' + toPrice(item.Price) + '萬(售MOP $' + toPrice(item.MoPrice) + '萬)
'; } } parentdiv += '商鋪編號#' + item.PropertyNo + '
'; } parentdiv += ''; if (item.GrossArea != "" && item.GrossArea != 0) { parentdiv += '約' + toThousands(Math.round(item.GrossArea)) + '呎'; } if (item.CountF != null && item.CountF != 0 && item.CountT != null && item.CountT != 0) { parentdiv += ' / '; if (item.CountF != null && item.CountF != 0) { parentdiv += item.CountF + '房'; } if (item.CountT != null && item.CountT != 0) { parentdiv += item.CountT + '廳'; } } parentdiv += '
'; if (item.PropertyUsage != "") { parentdiv += ''; } parentdiv += '' + item.lastMsg.text + '
'; } else if (item.lastMsg.type == "audio") { aHtml = '[語音]
'; } else if (item.lastMsg.type == "video") { aHtml = '[視頻]
'; } else if (item.lastMsg.type == "image") { aHtml = '[圖片]
'; } else if (item.lastMsg.type == "location") { aHtml = '[位置]
'; } else if (item.lastMsg.type == "tip") { aHtml = '' + item.lastMsg.tip + '
'; } else if (item.lastMsg.type == "custom") { aHtml = '' + item.lastMsg.pushContent + '
'; } else { aHtml = '' + item.lastMsg.text + '
'; } } strHtml.append(aHtml); }); updateSessionsUI(data.sessions[0], 2); $("#chatNum").html(num); if (num == 0) { $("#chatNum").hide(); } else { $("#chatNum").show(); } pushMsg(msg); } //用户名片渲染 function onUsers(users, type, teamId, index) { if (index != 1) { data.users = nim.mergeUsers(data.users, users); staffInfo = users; var prefix = "team-"; if (type == "edit") { // editUsers(users, teamId); var $person = $("#" + prefix + teamId); if (users.alias != undefined) { $person.find(".name label").html(users.alias); $person.attr("onclick", "OpenChat('" + teamId + "',0,'" + users.alias + "')"); } else { $person.find(".name label").html(users.nick); $person.attr("onclick", "OpenChat('" + teamId + "',0,'" + users.nick + "')"); } if (users.avatar != '') { $person.find(".head_contianer").find("img").attr("src", users.avatar); } else { $person.find(".head_contianer").find("img").attr("src", "/images/User/head.png"); } $person.find(".name span").html(diffTime(users.updateTime)); } } } //push信息上云信 function pushMsg(msgs) { console.log("推入云信:"); if (!Array.isArray(msgs)) { msgs = [msgs]; } var sessionId = msgs[0].sessionId; data.msgs = data.msgs || {}; data.msgs[sessionId] = nim.mergeMsgs(data.msgs[sessionId], msgs); } function UnixToDate(unixTime, isFull, timeZone) { if (typeof (timeZone) == 'number') { unixTime = parseInt(unixTime) + parseInt(timeZone) * 60 * 60; } var time = new Date(unixTime); var ymdhis = ""; ymdhis += time.getFullYear() + "-"; if (time.getDate() < 10) { ymdhis += "0" + (time.getMonth() + 1) + "-"; } else { ymdhis += (time.getMonth() + 1) + "-"; } if (time.getDate() < 10) { ymdhis += "0" + time.getDate(); } else { ymdhis += time.getDate(); } if (isFull === true) { ymdhis += " " + time.getHours() + ":"; if (time.getMinutes() < 10) { ymdhis += "0" + time.getMinutes(); } else { ymdhis += time.getMinutes(); } } return ymdhis; } //打开聊天框 function OpenChat(Id, type, name) { teamId = Id; listArray = []; nim.getTeamMembers({ teamId: teamId, done: getTeamMembersDoneMsg }); headImg = staffInfo.avatar; if (type == 1 || type == 2 || type == 3) { sendText(type, teamId); } nim.resetSessionUnread('team-' + teamId); // localMsgs("team-" + teamId, teamId) $("#team-" + teamId).find(".head_contianer").attr("data-id", "0"); $("#team-" + teamId).find(".head_contianer span").remove(); $("#chatNum").hide(); $(".onchat > .name").html(name); $(".Contact").css("display", "block"); $(".chat").css("width", "700px"); $(".person").css("width", "280px") } //关闭聊天框 function CloseChat() { $(".Contact").css("display", "none"); $(".chat").css("width", "280px"); $(".person").css("width","280px") } function OpenPerson() { $(".chat").css("display", "flex"); } //关闭联系人列表 function ClosePerson() { $(".chat").css("display", "none"); } $("#obs").click(function () { nim.resetSessionUnread('team-' + teamId); $("#team-" + teamId).find(".head_contianer").attr("data-id", "0"); $("#team-" + teamId).find(".head_contianer span").remove(); }); //播放语音 $('.content').on('click', '.audioBox span', function () { var currentNode = $(this); var audioEle = $(this).siblings('.audio'); playAudio(currentNode, audioEle); }); function playAudio(currentNode, audioEle) { /*jquery对象转换成js对象*/ var player = audioEle[0]; if (player.paused) { /*如果已经暂停*/ $(".audioBox span").removeClass('audioPlay'); $(".audioBox span").siblings('.audio')[0].pause(); player.play(); /*播放*/ currentNode.addClass('audioPlay'); } else { player.pause();/*暂停*/ currentNode.removeClass('audioPlay'); } // 录音播放结束停止动画 player.addEventListener('ended', function () { currentNode.removeClass('audioPlay'); }, false); } function getBase64(img) {//传入图片路径,返回base64 function getBase64Image(img, width, height) {//width、height调用时传入具体像素值,控制大小 ,不传则默认图像大小 var canvas = document.createElement("canvas"); canvas.width = width ? width : img.width; canvas.height = height ? height : img.height; var ctx = canvas.getContext("2d"); ctx.drawImage(img, 0, 0, canvas.width, canvas.height); var dataURL = canvas.toDataURL(); return dataURL; } var image = new Image(); image.crossOrigin = ''; image.src = img; var deferred = $.Deferred(); if (img) { image.onload = function () { deferred.resolve(getBase64Image(image));//将base64传给done上传处理 } return deferred.promise();//问题要让onload完成后再return sessionStorage['imgTest'] } } }