個人信息完善資料有助於提供更優質的服務

頭像
更換
姓名
手機號
修改
WeChat

我的喜愛(

全選 已選0
'; html += '
'; html += '
'; html += '
'; if (item.IsThird == true) { html += '
'; } if (item.Coupon.Type == 1) { //已使用 html += '
'; } else if (item.Coupon.Type == -1) { //已過期 html += '
'; } html += ''; html += '
'; html += '

' + item.Coupon.Code + '

'; html += '
'; html += '
'; if (item.IsThird == true) { html += '

第三方優惠券,續商戶職員填寫核銷碼,請移步APP端操作

'; } html += '

使用時間:' + item.Coupon.StartDate.slice(0, -3) + ' - ' + item.Coupon.OverdueDate.slice(0, -3) + '

'; html += '

使用條款:' + item.Clause + '

'; html += '
'; html += '
'; } }); $(".Coupon-box").html(html); } else if (data == "tradingStatus") { JumpUrl = id; } } //修改手機號 function editPhone() { var areaBox = $("#areaBox").val(); var uphone = $(".editPhone #ephone").val().trim(); var code = $(".editPhone #Code").val().trim(); var pattern = ''; if (uphone == '') { alert("手機號碼不能為空!"); return false; } if (areaBox == '+853') { //澳门手机号(八位数,6开头) pattern = /^(853)?6\d{7}$/; } else if (areaBox == '+852') { //香港手机号(八位数,6,9开头) pattern = /^([6|9])\d{7}$/; } else { //大陸手機號碼 pattern = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/; } if (!pattern.test(uphone)) { alert("手機號碼驗證錯誤!"); return false; } if (code == '') { alert("驗證碼不能為空!"); return false; } $.ajax({ url: vUrl + "/Api/AppUser/ModifyPhone", type: "post", data: { "AreaCode": areaBox, "Phone": uphone, "Code": code }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { alert(result.Message); $("#ephone").val(''); $("#Code").val(''); $("#sendCode").removeAttr("disabled");//移除disabled属性 $("#sendCode").css("color", "#495057"); $("#sendCode").css("font-size", "1rem"); $("#sendCode").css("cursor", "pointer"); $("#sendCode").html("獲取驗證碼"); clearInterval(timer);//清楚定时器 if (result.success == true) { Close(); getUserInfo(); } } else { alert(res.error_msg) } } }); } //修改姓名 function editName() { var uName = $(".editName #eName").val().trim(); if (uName == '') { alert("姓名不能為空!"); return false; } $.ajax({ url: vUrl + "/Api/AppUser/EditAppUser", type: "post", data: { "Name": uName }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { $("#eName").val(''); if (res.success == true) { alert(res.data.value); Close(); getUserInfo(); } else { alert(res.error_msg) } } }); } function getFileFromUrl(url, fileName) { return new Promise((resolve, reject) => { var blob = null; var xhr = new XMLHttpRequest(); xhr.open("GET", url); xhr.setRequestHeader('Accept', 'image/png'); xhr.responseType = "blob"; // 加载时处理 xhr.onload = () => { // 获取返回结果 blob = xhr.response; let file = new File([blob], fileName, { type: 'image/png' }); // 返回结果 resolve(file); }; xhr.onerror = (e) => { reject(e) }; // 发送 xhr.send(); }); } function UploadHeaderImg(Path) { $.ajax({ url: vUrl + "/api/AppUser/UploadHeaderImg", type: "post", data: { "ID": null, "FileName": null, "Path": Path }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { $(".infoBox #img,.headPic img").attr("src", Path); $('.editUser').fadeOut().find(".headBox").hide(); } else { alert(res.error_msg) } } }); } //获取个人信息 var InfoUser = { "Name": "", "MobileArea": "", "MobileNumber": "", }; function getUserInfo() { $.ajax({ url: vUrl + "/Api/AppUser/GetAppUserSimple", type: "get", data: { "KeyId": account }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { for (var attr in InfoUser) { InfoUser[attr] = res.data[attr]; } $("#topbar-login").html(res.data.Name); $("#uName").attr("value", res.data.Name); $("#uPhone").attr("value", res.data.MobileNumber); if (res.data.WeChat == null) { $("#WeChat").attr("value", "未綁定"); } else { $("#WeChat").attr("value", "已綁定"); } $(".headPic img,.userInfo #img").attr("src", res.data.HeaderImg); $(".cLeft .title").html(res.data.Name + ''); $(".cLeft #info").attr("data-id", +res.data.MineCode); $("#MyCode").html(res.data.MineCode); $(".cLeft #info").attr("data-info", +res.data.SuperiorCode); $("input[name='onlinesaleName']").val(res.data.Name); $("#sc-select").val(res.data.MobileArea).trigger("change"); $(".hidde_ipt .os-iphone").val(res.data.MobileNumber); } else { alert(res.error_msg) } } }); } //获取验证码 function GetPhoneCode() { var areaBox = $("#areaBox").val(); var uphone = $(".editPhone #ephone").val().trim(); var data = { "AreaCode": areaBox, "Phone": uphone } $.ajax({ url: vUrl + "/api/Common/SendVerificationCode", type: "POST", data: data, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { btnDisabled(); if (res.success == true) { alert(res.data.value); } else { alert(res.error_msg); } } }); } //是否禁用按钮 function btnDisabled() { var mydate = new Date();//获取当前时间 mydate.setMinutes(mydate.getMinutes() + 1); //当前时间加1分钟 var end_time = new Date(mydate).getTime();//月份是实际月份-1 var sys_second = ((end_time - new Date().getTime()) / 1000); timer = setInterval(function () { if (sys_second > 1) { sys_second -= 1; var second = Math.floor(sys_second % 60); $("#sendCode").attr("disabled", "true");//添加disabled属性 $("#sendCode").css("color", "gray"); $("#sendCode").css("font-size", "0.8rem"); $("#sendCode").css("cursor", "not-allowed"); $("#sendCode").html(second + "s后重新獲取"); } else { $("#sendCode").removeAttr("disabled");//移除disabled属性 $("#sendCode").css("color", "#495057"); $("#sendCode").css("font-size", "1rem"); $("#sendCode").css("cursor", "pointer"); $("#sendCode").html("獲取驗證碼"); clearInterval(timer);//清楚定时器 } }, 1000); } //复制邀请码 function copyUrl() { var val = document.getElementById('MyCode'); window.getSelection().selectAllChildren(val); document.execCommand("Copy"); alert("拷貝成功!") } // 我的喜爱 //MyFavorite(); function MyFavorite() { $.ajax({ url: vUrl + "/api/BuildingFavorite/QueryFavorite", type: "post", data: { "UserKeyId": account, "PageIndex": pageIndex, "PageSize": pageSize, }, headers: { "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { var listData = res.data.result; var countNum = res.data.total; if (countNum == 0) { $("#pages").hide(); } else { $("#pages").show(); } layui.use(['laypage'], function () { var laypage = layui.laypage; laypage.render({ elem: 'pages' , theme: '#c00' , limit: pageSize , curr: pageIndex , count: countNum , jump: function (obj, first) { pageCurr = obj.curr; getList(pageCurr); } }); }) } } }); } function getList(pageIndex) { $.ajax({ url: vUrl + "/api/BuildingFavorite/QueryFavorite", type: "post", data: { "UserKeyId": account, "PageIndex": pageIndex, "PageSize": pageSize, }, headers: { "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { var strHtml = ''; loveData = res.data.result; if (res.data.result != 0) { $("#love").html(res.data.total); } else { $("#love").html(0); } if ((res.data.total / pageSize) <= 1) { $("#pages").hide(); } else { $("#pages").show(); } if (loveData.length != 0) { //(1为新盛,2为房源,3为查图则,4为工商铺) var url = "/Project/BuildingDetails";//網上揾樓 var toUrl = '/EstatesHandBook/details';//焦点新盘/樓盤 var shopUrl = '/Shops/details'; //工商铺 jQuery.each(loveData, function (i, val) { if (val.Type == 1 || val.Type == 3) { strHtml += ''; } else if (val.Type == 2) { strHtml += ''; } else if (val.Type == 4) { strHtml += ''; } strHtml += ''; strHtml += ''; strHtml += '
'; strHtml += '
'; strHtml += '
'; strHtml += '
'; if (val.Staff != null) { strHtml += '
'; strHtml += '
'; strHtml += ''; strHtml += '
'; strHtml += '
'; strHtml += '

' + val.Staff.Staff.Name + ' ' + val.Staff.Staff.EnglishName + '

'; strHtml += '

' + val.Staff.Staff.ExtTitleCh + '

'; strHtml += '
'; 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 += '
'; strHtml += '
'; strHtml += '

' + val.Building + '

'; if (val.Type == 2 || val.Type == 4) { strHtml += '' + val.Bigdistnam + '-' + val.District + ''; strHtml += '
'; if (val.Type == 2) { 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 += '
'; } if (val.LookCount != 0 && val.LookCount != null && val.IsLooked == true) { strHtml += '
帶看次數:' + val.LookCount + '
'; } strHtml += '
'; if (val.IsHot == true) { strHtml += '筍盤'; } if (val.Type == 1) { strHtml += '新盤'; } else if (val.Type == 3) { strHtml += '樓盤'; } if ((val.SellType != "放租" && val.Type == 2) || (val.SellType != "放租" && val.Type == 4)) { strHtml += '按揭計算器'; } strHtml += '
'; strHtml += '
'; if (val.Type == 2 || val.Type == 4) { strHtml += '
'; if (val.SellType == "放租") { strHtml += '
'; strHtml += '

租HK $' + toPrice(val.Rent) + '元/月

'; strHtml += '

(租MOP $' + toPrice(val.MoRent) + '元/月)

'; strHtml += '
'; } else if (val.SellType == "租售") { strHtml += '
'; strHtml += '

售HK $' + toPrice(val.Price) + '萬

'; strHtml += '

(售MOP $' + toPrice(val.MoPrice) + '萬)

'; strHtml += '

租HK $' + toPrice(val.Rent) + '元/月

'; strHtml += '

(租MOP $' + toPrice(val.MoRent) + '元/月)

'; strHtml += '
'; } else { strHtml += '
'; strHtml += '

售HK $' + toPrice(val.Price) + '萬

'; strHtml += '

(售MOP $' + toPrice(val.MoPrice) + '萬)

'; strHtml += '
'; } } strHtml += '
'; strHtml += '
'; strHtml += '
'; }); $(".myLove .houseList").html(strHtml); } } } }); } //获取浏览记录 var listResult = []; function queryBrowserHistory(pageIndex, pageSize) { $(".history .houseList").empty(); $.ajax({ url: vUrl + "/api/PropertyBrowserHistory/QueryBrowserHistory", type: "post", data: { "UserKeyId": account, "PageIndex": pageIndex, "PageSize": pageSize, }, headers: { "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { var countNum = res.data.total; layui.use(['laypage'], function () { var laypage = layui.laypage; laypage.render({ elem: 'hPages' , theme: '#c00' , limit: pageSize , curr: pageIndex , count: countNum , jump: function (obj, first) { pageCurr = obj.curr; getHistoryList(pageCurr, pageSize); } }); }) } } }); } function getHistoryList(pageIndex, pageSize) { $.ajax({ url: vUrl + "/api/PropertyBrowserHistory/QueryBrowserHistory", type: "post", data: { "UserKeyId": account, "PageIndex": pageIndex, "PageSize": pageSize, }, headers: { "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { listResult = res; var listData = res.data.result; var strHtml = ''; if (res.data.result != 0) { $("#browse").html(res.data.total); } else { $("#browse").html(0); } var listData = res.data.result; var countNum = res.data.total; if ((countNum / pageSize) <= 1) { $("#hPages").hide(); } else { $("#hPages").show(); } if (listData.length != 0) { //(1为新盛,2为房源,3为查图则,4为工商铺) var url = "/Project/BuildingDetails";//網上揾樓 var toUrl = '/EstatesHandBook/details';//焦点新盘/樓盤 var shopUrl = '/Shops/details'; //工商铺 jQuery.each(listData, function (i, val) { if (val.Type == 1 || val.Type == 3) { strHtml += ''; } else if (val.Type == 2) { strHtml += ''; } else if (val.Type == 4) { strHtml += ''; } strHtml += '
'; strHtml += '
'; 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 += '
'; strHtml += '
'; strHtml += '

' + val.Building + '

'; if (val.Type == 2 || val.Type == 4) { strHtml += '' + val.Bigdistnam + '-'+ val.District + ''; strHtml += '
'; if (val.Type == 2) { 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 += '
'; } if (val.LookCount != 0 && val.LookCount != null && val.IsLooked == true) { strHtml += '
帶看次數:' + val.LookCount + '
'; } strHtml += '
'; if (val.IsHot == true) { strHtml += '筍盤'; } if (val.Type == 1) { strHtml += '新盤'; }else if (val.Type == 3) { strHtml += '樓盤'; } if ((val.SellType != "放租" && val.Type == 2) || (val.SellType != "放租" && val.Type == 4)) { strHtml += '按揭計算器'; } strHtml += '
'; strHtml += '
'; if (val.Type == 2 || val.Type == 4) { strHtml += '
'; if (val.SellType == "放租") { strHtml += '
'; strHtml += '

租HK $' + toPrice(val.Rent) + '元/月

'; strHtml += '

(租MOP $' + toPrice(val.MoRent) + '元/月)

'; strHtml += '
'; } else if (val.SellType == "租售") { strHtml += '
'; strHtml += '

售HK $' + toPrice(val.Price) + '萬

'; strHtml += '

(售MOP $' + toPrice(val.MoPrice) + '萬)

'; strHtml += '

租HK $' + toPrice(val.Rent) + '元/月

'; strHtml += '

(租MOP $' + toPrice(val.MoRent) + '元/月)

'; strHtml += '
'; } else { strHtml += '
'; strHtml += '

售HK $' + toPrice(val.Price) + '萬

'; strHtml += '

(售MOP $' + toPrice(val.MoPrice) + '萬)

'; strHtml += '
'; } strHtml += '
' + UnixToDate(val.CreatedTime, true) + '
'; } else { strHtml += '
'; strHtml += '
' + UnixToDate(val.CreatedTime, true) + '
'; } strHtml += '
'; strHtml += '
'; strHtml += ''; }); $(".history .houseList").html(strHtml); } } } }); } //获取经纪人列表 var listData = []; function getAgentList(pageIndex, pageSize, name) { $.ajax({ url: vUrl + "/api/Staff/GetStaffList", type: "post", data: { "PageIndex": pageIndex, "PageSize": pageSize, "Status": 1, "AgencyType": 1, "Name": name, "OrderSort": "", "OrderBy": "", "CS_LABEL_TYPE": null }, headers: { "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { var listData = res.data.result; var countNum = res.data.total; if ((countNum / pageSize) <= 1) { $("#aPages").hide(); } else { $("#aPages").show(); } layui.use(['laypage'], function () { var laypage = layui.laypage; laypage.render({ elem: 'aPages' , theme: '#c00' , limit: pageSize , curr: pageIndex , count: countNum , jump: function (obj, first) { pageCurr = obj.curr; getAList(pageCurr, pageSize, name); } }); }) } } }); } function getAList(pageIndex, pageSize, name) { $.ajax({ url: vUrl + "/api/Staff/GetStaffList", type: "post", data: { "PageIndex": pageIndex, "PageSize": pageSize, "Status": 1, "AgencyType": 1, "Name": name, "OrderSort": "", "OrderBy": "", "CS_LABEL_TYPE": null }, headers: { "centa_sign": EncodeStr, }, success: function (res) { if (res.success == true) { listData = res; var agentList = res.data.result; var strHtml = ''; if (agentList.length > 0) { jQuery.each(agentList, function (i, val) { strHtml += '
  • '; strHtml += ''; strHtml += '
    '; if (val.Staff.HeaderImg != '' && val.Staff.HeaderImg != null) { strHtml += ''; } else { strHtml += ''; } strHtml += '
    '; strHtml += '
    '; strHtml += '

    ' + val.Staff.Name + '

    '; if (val.Staff.EnglishName == null) { strHtml += '

     

    '; } else { strHtml += '

    ' + val.Staff.EnglishName + '

    '; } strHtml += '
    '; strHtml += ''; strHtml += '
  • '; }); $(".agent-list ul").html(strHtml); } else { strHtml += '
    暫無數據
    '; $(".agent-list").html(strHtml); } } } }); } //我的推广-获取我邀请的人 function getInvitationUserList(code) { $.ajax({ url: vUrl + "/Api/Invitation/GetInvitationUserList", type: "get", data: { "Code": code }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { if (res.data.length != 0) { $("#spread").html(res.data.length); } else { $("#spread").html(0); } var strHtml = ''; if (res.data.length > 0) { jQuery.each(res.data, function (i, val) { strHtml += '
  • '; strHtml += '
    '; strHtml += '' + val.Name + ''; strHtml += '' + val.CreatedTime + ''; strHtml += '
  • '; }); $(".spread .inviteList ul").html(strHtml); } else { strHtml += '
    暫無邀请人
    '; $(".spread .inviteList ul").html(strHtml); } } }); } //我的推广-获取我的邀请人 function getInvitationUser(code) { $.ajax({ url: vUrl + "/api/Invitation/GetInvitationUser", type: "get", data: { "Code": code }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { if (res.success != false) { $(".rInfo .name").html(res.data.Name); $(".rInfo .date").html(res.data.CreatedTime); $(".rInfo .agent-photo").attr("src",res.data.HeaderImg); } else { $(".rInfo").hide(); } } }); } //获取我的看楼记录 var listLook = []; function queryPropertyLook(pageIndex, pageSize, SellType, UserKeyId) { $.ajax({ url: vUrl + "/api/LookPropertyRecord/QueryPropertyLook", type: "post", data: { "UserKeyId": account, "PageIndex": pageIndex, "PageSize": pageSize, "SellType": SellType //0为看笔记, 1为售, 2为租, 3为租售 }, headers: { "centa_sign": EncodeStr, }, success: function (res) { console.log(res); var countNum = res.data.total; listLook = res; if (res.data.result != 0) { $("#look").html(res.data.total); } else { $("#look").html(0); } if (countNum == 0) { $("#bPages").hide(); } else { $("#bPages").show(); } layui.use(['laypage'], function () { var laypage = layui.laypage; laypage.render({ elem: 'bPages' , theme: '#c00' , limit: pageSize , curr: pageIndex , count: countNum , jump: function (obj, first) { pageCurr = obj.curr; getPList(pageCurr, pageSize, SellType, UserKeyId); } }); }) } }); } function getPList(pageIndex, pageSize, SellType, UserKeyId) { $.ajax({ url: vUrl + "/api/LookPropertyRecord/QueryPropertyLook", type: "post", data: { "UserKeyId": account, "PageIndex": pageIndex, "PageSize": pageSize, "SellType": SellType //0为看笔记, 1为售, 2为租, 3为租售 }, headers: { "centa_sign": EncodeStr, }, success: function (res) { listLook = res; var list = res.data.result; var html = ''; if (res.data.result.length != 0) { $("#look").html(res.data.total); } else { $("#look").html(0); } if ((res.data.total / pageSize) <= 1) { $("#bPages").hide(); } else { $("#bPages").show(); } if (list.length != 0) { jQuery.each(list, function (i, val) { html += '
    '; html += '' + val.LookDate + ' (' + val.data.length + '個)'; html += '
    '; //(1为新盛,2为房源,3为查图则,4为工商铺) var url = "/Project/BuildingDetails";//網上揾樓 var toUrl = '/EstatesHandBook/details';//焦点新盘/樓盤 var shopUrl = '/Shops/details'; //工商铺 var JumpUrl = ""; jQuery.each(val.data, function (j, item) { if (item.Type == 1 || item.Type == 3) { JumpUrl = '' + toUrl + '?id=' + item.PropertyNo + ''; } else if (item.Type == 2) { JumpUrl = '' + url + '?id=' + item.PropertyNo + ''; } else if (item.Type == 4) { JumpUrl = '' + shopUrl + '?KeyId=' + item.PropertyNo + ''; } if (item.SellTypeIng != item.SellType) { //如果添加睇樓后,该楼盘又改变了交易类型,则点击提示“該房源交易類型已發生改變!" html += '
    '; } else { html += ''; } html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += ''; html += '
    '; html += '
    '; html += '

    ' + item.Staff.Staff.Name + ' ' + item.Staff.Staff.EnglishName +'

    '; html += '

    ' + item.Staff.Staff.ExtTitleCh +'

    '; html += '
    '; html += '
    '; if (item.Type == 2 || item.Type == 4) { if (item.Imgs != null && item.Imgs.length != 0) { html += ''; } else { html += ''; } } else if (item.Type == 1 || item.Type == 3) { if (item.EstatesImgs != null && item.EstatesImgs.length != 0) { html += ''; } else { html += ''; } } html += '
    '; if (item.SellType == "放租") { html += ''; } else if (item.SellType == "租售") { html += ''; } else { html += ''; } if (item.BuildingStatus != 0) { html += ''; } html += '
    '; html += '
    '; html += '

    ' + item.Building + '

    '; if (item.Bigdistnam != null && item.District != null) { html += '' + item.District + '-' + item.Bigdistnam + ''; } if (item.Type == 2 || item.Type == 4) { html += '
    '; if (item.Type == 2) { 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 += '
    '; } if (item.LookCount != 0 && item.LookCount != null && item.IsLooked == true) { html += '
    帶看次數:' + item.LookCount + '
    '; } html += '
    '; if (item.IsHot == true) { html += '筍盤'; } if (item.Type == 1) { html += '新盤'; } else if (item.Type == 3) { html += '樓盤'; } if ((item.SellType != "放租" && item.Type == 2) || (item.SellType != "放租" && item.Type == 4)) { html += '按揭計算器'; } html += '
    '; html += '
    '; html += '
    '; if (item.Type == 2 || item.Type == 4) { if (item.SellType == "放租") { html += '
    '; html += '

    租HK $' + toPrice(item.Rent) + '元/月

    '; html += '

    (租MOP $' + toPrice(item.MoRent) + '元/月)

    '; html += '
    '; } else if (item.SellType == "租售") { html += '
    '; html += '

    售HK $' + toPrice(item.Price) + '萬

    '; html += '

    ( 售MOP $' + toPrice(item.MoPrice) + '萬 )

    '; html += '

    租HK $' + toPrice(item.Rent) + '元/月

    '; html += '

    (租MOP $' + toPrice(item.MoRent) + '元/月)

    '; html += '
    '; } else { html += '
    '; html += '

    售HK $' + toPrice(item.Price) + '萬

    '; html += '

    (售MOP $' + toPrice(item.MoPrice) + '萬)

    '; html += '
    '; } } html += '
    '; html += '
    '; html += '
    '; }); $("#propertyLook").html(html); }); } else { html += '
    暫無數據
    '; $("#propertyLook").html(html); } } }); } //跳转睇楼详情 function JumpPropertyLookInfo() { window.location.href = JumpUrl; } //互动记录 function getBingAgency(pageIndex, pageSize) { $.ajax({ url: vUrl + "/api/Staff/GetBingStaffList", type: "post", data: { "PageIndex": pageIndex, "PageSize": pageSize }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { listLook = res; var countNum = res.data.total; if ((countNum / pageSize) < 2) { $("#rPages").hide(); } else { $("#rPages").show(); } layui.use(['laypage'], function () { var laypage = layui.laypage; laypage.render({ elem: 'rPages' , theme: '#c00' , limit: pageSize , curr: pageIndex , count: countNum , jump: function (obj, first) { pageCurr = obj.curr; goLookPage(pageCurr, pageSize); } }); }) } }); } function goLookPage(pageIndex, pageSize) { $.ajax({ url: vUrl + "/api/Staff/GetBingStaffList", type: "post", data: { "PageIndex": pageIndex, "PageSize": pageSize }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { var list = res.data.result; var html = ''; if (list.length != 0) { $("#record").html(res.data.total); } else { $("#record").html(0); } if ((res.data.total / pageSize) <= 1) { $("#rPages").hide(); } else { $("#rPages").show(); } if (res.data.total > 0) { jQuery.each(list, function (i, val) { html += '
  • '; html += '
    '; html += '' + val.Staff.Name + '  ' + val.Staff.EnglishName + ''; if (val.Staff.Telephone != null) { html += '' + val.Staff.Telephone + ''; } else { html += '--'; } html += '
    '; html += '直聊'; var url = "https://wa.me/+" + val.Staff.WhatsAppPhone + "?text=Hi,我在互動記錄,見到您,想查詢 %23"; html += 'WhatsApp'; html += '我的推介'; html += '
    '; html += '
  • '; }); $(".record .inviteList ul").html(html); } else { html += '
    暫無數據
    '; $(".record .inviteList ul").html(html); } } }); } //获取优惠券 var list = []; function getCouponList(pageIndex, pageSize, type){ $.ajax({ url: vUrl + "/Api/Coupon/GetCouponList", type: "post", data: { "type": type, //不传为全部,0未使用,1已使用,-1已过期 "PageIndex": pageIndex, "PageSize": pageSize }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { listLook = res; var countNum = res.data.total; layui.use(['laypage'], function () { var laypage = layui.laypage; laypage.render({ elem: 'cPages' , theme: '#c00' , limit: pageSize , curr: pageIndex , count: countNum , jump: function (obj, first) { pageCurr = obj.curr; goCouponPage(pageCurr, pageSize, type); } }); }) } }); } function goCouponPage(pageCurr, pageSize, type) { $.ajax({ url: vUrl + "/Api/Coupon/GetCouponList", type: "post", data: { "type": type, //不传为全部,0未使用,1已使用,-1已过期 "PageIndex": pageCurr, "PageSize": pageSize }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { list = res.data.result; if (res.data.total != 0) { $("#coupon").html(res.data.total); } else { $("#coupon").html(0); } if ((res.data.total / pageSize) <= 1) { $("#cPages").hide(); } else { $("#cPages").show(); } var html = ''; if (res.data.total > 0) { jQuery.each(list, function (i, val) { html += '
  • '; html += '
    ' + val.VolumeType + '
    '; if (val.IsThird == true) { html += '
    '; } html += '
    '; html += '
    '; html += '
    '; html += ''; html += '
    '; html += '
    '; if (val.Remarks != null) { html += '

    ' + val.Remarks + '

    '; } html += '

    使用時間:' + val.Coupon.ReceiveDate.slice(0, -3) + '

    '; html += '

    過期時間:' + val.Coupon.OverdueDate.slice(0, -3) + '

    '; html += '詳細信息'; html += '
    '; html += '
    '; if (val.Coupon.Type != 0) { html += '
    '; } else { 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 += '
    '; html += '
    '; html += '
    ' + val.Clause + '
    '; html += ''; }); $(".c-build-coupon ul").html(html); //优惠券打开详细信息 $(".couponInfo span").click(function () { $(this).toggleClass("cur"); $(this).parents("li").find(".couponDec").slideToggle(); }); $(".couponRight span").click(function () { console.log(123); }); } else { html += '
    暫無數據
    '; $(".c-build-coupon ul").html(html); } } }); } //获取估价记录 function getEvaluateList(pageIndex, pageSize) { $.ajax({ url: vUrl + "/Api/Evaluation/GetPagedList", type: "post", data: { "PageIndex": pageIndex, "PageSize": pageSize }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { console.log(res); var countNum = res.data.total; layui.use(['laypage'], function () { var laypage = layui.laypage; laypage.render({ elem: 'cPages' , theme: '#c00' , limit: pageSize , curr: pageIndex , count: countNum , jump: function (obj, first) { pageCurr = obj.curr; goEvaluatePage(pageCurr, pageSize); } }); }) } }); } function goEvaluatePage(pageCurr, pageSize) { $.ajax({ url: vUrl + "/Api/Evaluation/GetPagedList", type: "post", data: { "PageIndex": pageCurr, "PageSize": pageSize }, headers: { "UserKeyId": account, "centa_sign": EncodeStr, }, success: function (res) { list = res.data.result; if (res.data.total != 0) { $("#evaluate").html(res.data.total); } else { $("#evaluate").html(0); } if ((res.data.total / pageSize) <= 1) { $("#ePages").hide(); } else { $("#ePages").show(); } var html = ''; if (res.data.total > 0) { jQuery.each(list, function (i, val) { html += '
  • '; html += '
    '; html += '' + val.PropertyName + ''; if (val.IsEva == true) { html += '' + val.EvaMoney + '萬'; } else if (val.IsEva == false) { html += '' + val.EvaReason + ''; } else { html += '正在估價'; } html += '
    '; html += '

    申請時間:' + val.CreateAt.slice(0, 11) + '

    '; if (val.EvaDate != null && val.EvaDate != "") { html += '

    估價時間:' + val.EvaDate.slice(0, 11) + '

    '; } html += '
  • '; }); $(".evaluateList ul").html(html); } else { html += '
    暫無數據
    '; $(".evaluateList ul").html(html); } } }); }

    請加微信

    右鍵保存圖片

    close
    '; parentStr += '
    '; parentStr += '

    '; 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 += '
    '; } parentStr += ''; parentStr += ''; } if (num == 0) { $("#chatNum").hide(); } else { $("#chatNum").html(num); $("#chatNum").show(); } list.html(parentStr); } else if (type == 2) { if (sessions.lastMsg != undefined) { if (sessions.lastMsg.status == "success") { //聊天详情 getChatList(sessions.lastMsg, listNum); } } } else if (type == 3) { //聊天详情 getChatList(sessions, teamId); } } //批量加载会话消息 function batchUpdateSessionUI(arr) { $(".content .notice").empty(); if (arr.length > 0) { listNum = arr.length; for (var i = arr.length - 1; i >= 0; i--) { if (arr[i].status == "success") { //聊天详情 getChatList(arr[i], i) if (arr[i].geo != undefined) { LoadMap("map" + i, arr[i].geo.lng, arr[i].geo.lat); } } } } } //聊天详情 function getChatList(data, index) { let objInfo = listArray.find(o => o.account === staffNo); if (objInfo != undefined) { if (objInfo.alias != undefined && jobId.length < 7) { staffName = objInfo.alias; } else { staffName = objInfo.nick; } } else { staffName = data.fromNick; } userName = ""; let UserInfo = listArray.find(o => o.account === data.from); if (UserInfo != undefined) { if (UserInfo.alias != undefined) { userName = UserInfo.alias; } else { userName = UserInfo.nick; } } else { userName = data.fromNick; } if (data.type != "notification") { var content = $(".content .notice"); var result = ""; var direction = ""; var parentdiv = ''; if (data.custom != undefined) { if (data.from != account) { if (jobId.length > 7) { direction = "left"; result = "left"; } else { direction = "right"; result = "chat"; } } else { direction = "left"; result = "left"; } parentdiv += '
    '; parentdiv += '
    ' + diffTime(data.time) + '
    '; if (UserInfo != undefined) { if (UserInfo.avatar != undefined && UserInfo.avatar != "") { parentdiv += ''; } else { parentdiv += ''; } } else { parentdiv += ''; } } else if (data.type == "tip") { result = "center"; direction = "center"; parentdiv += '
    '; parentdiv += '
    ' + diffTime(data.time) + '
    '; } else { if (data.flow == "out") {//发送方 result = "chat"; direction = "right"; } else if (data.flow == "in") {//接收 result = "left"; direction = "left"; } parentdiv += '
    '; parentdiv += '
    ' + diffTime(data.time) + '
    '; if (jobId.length > 7) { if (data.flow == "in") { if (objInfo != undefined) { if (objInfo.avatar != undefined && objInfo.avatar != "") { parentdiv += ''; } else { parentdiv += ''; } } } else { if (UserInfo != undefined) { if (UserInfo.avatar != undefined && UserInfo.avatar != "") { parentdiv += ''; } else { parentdiv += ''; } } } } else { if (UserInfo != undefined) { if (UserInfo.avatar != undefined && UserInfo.avatar != "") { parentdiv += ''; } else { parentdiv += ''; } } } } parentdiv += '
    '; if (data.type != "tip") { if (data.custom != undefined) { parentdiv += '

    ' + staffName + '

    '; } else { if (jobId.length > 7) { if (data.flow == "in") { parentdiv += '

    ' + staffName + '

    '; } else { parentdiv += '

    ' + userName + '

    '; } } else { parentdiv += '

    ' + userName + '

    '; } } parentdiv += '
    '; } else { parentdiv += '
    '; } parentdiv += '
    '; if (data.type == "text") { parentdiv += '
    ' + data.text + '
    '; } else if (data.type == "image") { parentdiv += '
    '; parentdiv += ''; parentdiv += '
    '; } else if (data.type == "audio") { parentdiv += '
    '; parentdiv += '
    '; parentdiv += ''; parentdiv += ''; parentdiv += '' + Math.trunc((data.file.dur) / 1000) + ''; parentdiv += '"'; parentdiv += ''; parentdiv += ''; parentdiv += '
    '; parentdiv += '
    '; } else if (data.type == "video") { parentdiv += '
    '; parentdiv += '
    '; } else if (data.type == "tip") { parentdiv += '
    ' + data.tip + '
    '; } else if (data.geo != undefined) { parentdiv += '' } else if (data.type = "custom") { if (data.content != undefined) { var item = JSON.parse(data.content); parentdiv += '
    '; if (item.Type == 1 || item.Type == 5) { //新盘、查图则 parentdiv += ''; parentdiv += '
    '; parentdiv += ''; parentdiv += '
    '; 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 += '

    ' + item.BuildingTitle + '

    '; if (item.Type != 3) { if (item.SellType == "放租") { 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 += '
    '; parentdiv += '
    '; if (item.PropertyNo != "") { 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 += '
    '; parentdiv += ''; parentdiv += '
    '; parentdiv += '
    '; } parentdiv += '
    '; parentdiv += '
    '; } } parentdiv += '
    ' parentdiv += '
    ' content.append(parentdiv); var temMsgList = document.getElementById('msgEnd'); temMsgList.scrollIntoView(); } } function LoadMap(Mapid, PosX, PosY) { var PosX = PosX; var PosY = PosY; var map = new BMap.Map(Mapid); // 创建Map实例 map.centerAndZoom(new BMap.Point(PosX, PosY), 17); // 初始化地图,设置中心点坐标和地图级别 var icon = new BMap.Icon('../../images/base/location.png', new BMap.Size(32, 32)); mPotion = new BMap.Point(PosX, PosY); var mkr = new BMap.Marker(mPotion, { icon: icon }); MyMarker = mkr; map.addOverlay(mkr); } function onRoamingMsgs(obj) { console.log('漫游消息', obj.msgs); pushMsg(obj.msgs); } function onOfflineMsgs(obj) { console.log('离线消息', obj.msgs); pushMsg(obj.msgs); } function onMsg(msg) { //console.log('收到消息', msg, msg.type, msg.text); data.sessions = nim.mergeSessions(data.sessions, data.sessions); var num = 0; data.sessions.forEach((item, index, arr) => { num += item.unread; var html = $("#" + item.id).find(".head_contianer"); if (item.unread != 0) { if (html.attr("data-id") == 0) { html.append("" + item.unread + ""); } else { html.find("span").html(item.unread); } html.attr("data-id", item.unread); } var strHtml = $("#" + item.id).find(".right_contianer"); var aHtml = ""; if (item.lastMsg != undefined) { strHtml.find(".chat_dialog").remove(); if (item.lastMsg.type == "text") { aHtml = '

    ' + 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'] } } }