From 7e20a152ae9254c6d0c6bf711ce1b2b5b7bf5dd2 Mon Sep 17 00:00:00 2001 From: hubingliang Date: Fri, 30 Mar 2018 13:08:29 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/config.js | 2 +- fangija-zsyf/js/login/codeSms.js | 88 ++++++++++++++++--- .../views/{login => user}/codeSms.html | 25 ++---- 3 files changed, 83 insertions(+), 32 deletions(-) rename fangija-zsyf/views/{login => user}/codeSms.html (89%) diff --git a/fangija-zsyf/config.js b/fangija-zsyf/config.js index f7db3e8..e240248 100644 --- a/fangija-zsyf/config.js +++ b/fangija-zsyf/config.js @@ -2,6 +2,6 @@ //var BASE_PATH = "http://192.168.10.128:8084"; //var BASE_PATH = "http://192.168.10.47:8086"; //var BASE_PATH = "http://192.168.10.53:8084"; -var BASE_PATH = "http://192.168.10.170:8084"; +var BASE_PATH = "http://192.168.10.171:8084"; /**是否显示过启动页面**/ var lauchFlag = false; \ No newline at end of file diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index 2d3743a..3258408 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -1,16 +1,80 @@ -export default { - methods: { - checkPhoneNum (phone) { - alert("1111111111111") - } - } -} var sendPhoneCode = new Vue({ el:'#sendPhoneCode', methods:{ - sendCode:function(){ - alert("222222222") - checkPhoneNum("1352222222") - } } -}) \ No newline at end of file +}) + +function sendCode(){ + var mobile = $("#input_phoneNumber").val(); + if(checkPhoneNum(mobile)){ + timer.start(); + axios.post("/rest/user/sendMobileCode", {mobile: mobile}) + .then(function (response) { + var data = response.data + if(data.code==200){ + $.toast("短信验证码发送成功,请注意查收!") + }else{ + $.toast("验证码发送失败") + timer.cancel() + } + }) + } +} +function checkPhoneNum(phone){ + var reg=11&& /^((13|14|15|17|18)[0-9]{1}\d{8})$/; + if(phone==''){ + $.toast("请输入手机号码"); + return false; + }else if(!reg.test(phone)){ + $.toast("手机格式不正确"); + return false; + }else{ + return true; + } +} +//验证码倒计时 +timer = { + countdown:60, + start:function(){ + countdown = 60 + $(".sendCode").hide() + $(".waiting").empty().append(countdown + " s").show() + timer.down() + }, + down:function(){ + countdown -- + $(".waiting").empty().append(countdown + " s") + if(countdown <= 0){ + $(".sendCode").show() + $(".waiting").hide() + }else{ + setTimeout(timer.down, 1000) + } + }, + cancel:function(){ + countdown = 0 + } + } + +/* 错误提示-快捷登录 */ +$("#login_btn").on("click", function () { + var phoneNum = $("#input_phoneNumber").val(); + var code = $("#input_codeSms").val(); + var protocal = $(".check").find(".checkImg").css("display"); + if(phoneNum == ""){ + $.toast("请输入手机号码"); + return false; + } + if(code == ""){ + $.toast("请输入验证码"); + return false; + } + if(protocal != "block"){ + $.toast("请同意服务协议"); + return false; + } + axios.post("/rest/user/sendMobileCode", {mobile: mobile}) + .then(function (response) { + + }) +}); diff --git a/fangija-zsyf/views/login/codeSms.html b/fangija-zsyf/views/user/codeSms.html similarity index 89% rename from fangija-zsyf/views/login/codeSms.html rename to fangija-zsyf/views/user/codeSms.html index f8d4d9e..8815ac2 100644 --- a/fangija-zsyf/views/login/codeSms.html +++ b/fangija-zsyf/views/user/codeSms.html @@ -37,7 +37,7 @@ @@ -92,15 +92,14 @@ $.config = {router: false} + + + From f06397e90cf2d20bacdec52fa10082017464ff55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Fri, 30 Mar 2018 13:11:15 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/common.js | 8 +++-- fangija-zsyf/js/plus.info.js | 41 ++++++++++++++++++++++ fangija-zsyf/views/user/bindingMobile.html | 31 +++++++++++++++- fangija-zsyf/yfindex.html | 21 ++++++----- 4 files changed, 89 insertions(+), 12 deletions(-) create mode 100644 fangija-zsyf/js/plus.info.js diff --git a/fangija-zsyf/js/common.js b/fangija-zsyf/js/common.js index 6f08bb6..1bf58bb 100644 --- a/fangija-zsyf/js/common.js +++ b/fangija-zsyf/js/common.js @@ -61,7 +61,7 @@ var openw=null,waiting=null; * @param {boolean} ns : 是否不自动显示 * @param {JSON} ws : Webview窗口属性 */ -w.clicked=function(id,wa,ns,ws){ +w.clicked=function(id,wa,ns,ws, params,callback,callbackParams){ if(openw){//避免多次打开同一个页面 return null; } @@ -71,7 +71,7 @@ w.clicked=function(id,wa,ns,ws){ ws.scrollIndicator||(ws.scrollIndicator='none'); ws.scalable||(ws.scalable=false); var pre='';//'http://192.168.1.178:8080/h5/'; - openw=plus.webview.create(pre+id,id,ws); + openw=plus.webview.create(pre+id,id,ws,params); ns||openw.addEventListener('loaded',function(){//页面加载完成后才显示 // setTimeout(function(){//延后显示可避免低端机上动画时白屏 openw.show(as); @@ -79,6 +79,10 @@ w.clicked=function(id,wa,ns,ws){ // },200); },false); openw.addEventListener('close',function(){//页面关闭后可再次打开 + //可以设置页面关闭时回调的方法,可以对数据进行重新加载操作 + if(callback){ + callback(callbackParams); + } openw=null; },false); return openw; diff --git a/fangija-zsyf/js/plus.info.js b/fangija-zsyf/js/plus.info.js new file mode 100644 index 0000000..27dcd88 --- /dev/null +++ b/fangija-zsyf/js/plus.info.js @@ -0,0 +1,41 @@ +/** + * 获取手机上的信息,比如位置,手机ID + * @author yinjihuan + */ +//扩展API加载完毕后调用onPlusReady回调函数 +document.addEventListener('plusready', onPlusReady, false); +//扩展API加载完毕,现在可以正常调用扩展API +function onPlusReady(){ + getPosition(); +} +// 获取当前用户位置 +function getPosition(){ + plus.geolocation.getCurrentPosition(function(p){ + province = p.address.province; + city = p.address.city; + region = p.address.district; + }, function(e){ + + }, + { + provider:'baidu', + enableHighAccuracy:true, + coordsType:'bd09ll' + } + ); +} + +function getPushInfo(){ + try { + var info = plus.push.getClientInfo(); + return info.clientid; + }catch(error) { + console.log( error); + } +// console.log( "获取客户端推送标识信息:" ); +// console.log( "token: "+info.token ); +// alert( "clientid: "+info.clientid ); +// console.log( "appid: "+info.appid ); +// console.log( "appkey: "+info.appkey ); + return ""; +} \ No newline at end of file diff --git a/fangija-zsyf/views/user/bindingMobile.html b/fangija-zsyf/views/user/bindingMobile.html index cd2cc36..4976692 100644 --- a/fangija-zsyf/views/user/bindingMobile.html +++ b/fangija-zsyf/views/user/bindingMobile.html @@ -84,6 +84,7 @@ $.config = {router: false} + From bf5ad8ee091a96f2fe6200c9fd2e2d05ecad3049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Fri, 30 Mar 2018 14:32:57 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/axiosPlugin.js | 3 +- fangija-zsyf/views/user/passLogin.html | 159 +++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 fangija-zsyf/views/user/passLogin.html diff --git a/fangija-zsyf/js/axiosPlugin.js b/fangija-zsyf/js/axiosPlugin.js index bfa7c47..8bfca8b 100644 --- a/fangija-zsyf/js/axiosPlugin.js +++ b/fangija-zsyf/js/axiosPlugin.js @@ -3,7 +3,8 @@ axios.defaults.headers.post['Content-Type'] = 'application/json'; // 添加请求拦截器 axios.interceptors.request.use(function (config) { - config.headers.Authorization = '111111111' + var token = localStorage.getItem("user_token"); + config.headers.Authorization = token return config; }, function (error) { return Promise.reject(error); diff --git a/fangija-zsyf/views/user/passLogin.html b/fangija-zsyf/views/user/passLogin.html new file mode 100644 index 0000000..a2c35e6 --- /dev/null +++ b/fangija-zsyf/views/user/passLogin.html @@ -0,0 +1,159 @@ + + + + + + +账号密码登录 + + + + + + + + + + + + + +
+
+
+ +

账号密码登录

+
+
+ + +
+

+ 第三方登录 +

+

+ + + +

+
+
+
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file From 34a1e76c0e11db07601648703c3bd42d55a27893 Mon Sep 17 00:00:00 2001 From: hubingliang Date: Fri, 30 Mar 2018 14:34:28 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB?= =?UTF-8?q?=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/login/codeSms.js | 35 +++++++++++++++------------- fangija-zsyf/js/login/wxLogin.js | 8 +++++++ fangija-zsyf/views/user/codeSms.html | 18 ++++++++++---- 3 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 fangija-zsyf/js/login/wxLogin.js diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index 3258408..5deeffc 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -61,20 +61,23 @@ $("#login_btn").on("click", function () { var phoneNum = $("#input_phoneNumber").val(); var code = $("#input_codeSms").val(); var protocal = $(".check").find(".checkImg").css("display"); - if(phoneNum == ""){ - $.toast("请输入手机号码"); - return false; - } - if(code == ""){ - $.toast("请输入验证码"); - return false; - } - if(protocal != "block"){ - $.toast("请同意服务协议"); - return false; - } - axios.post("/rest/user/sendMobileCode", {mobile: mobile}) - .then(function (response) { - - }) + if(checkPhoneNum(phoneNum)){ + if(code == ""){ + $.toast("请输入验证码"); + return false; + } + if(protocal != "block"){ + $.toast("请同意服务协议"); + return false; + } + axios.post("/rest/user/smsLogin", {mobile: phoneNum,smsCode:code}) + .then(function (response) { + var data = response.data + if(data.status){ + var token = data.data; + }else{ + $.toast("data.message"); + } + }) + } }); diff --git a/fangija-zsyf/js/login/wxLogin.js b/fangija-zsyf/js/login/wxLogin.js new file mode 100644 index 0000000..bcf9faa --- /dev/null +++ b/fangija-zsyf/js/login/wxLogin.js @@ -0,0 +1,8 @@ + +$("#wxLogin").addEventListener('tap',function() { + console.log("微信"); + authLogin('weixin'); +}) +function authLogin(type) { + console.log("hhhhhhhhhhhhhhhhhhh") +} diff --git a/fangija-zsyf/views/user/codeSms.html b/fangija-zsyf/views/user/codeSms.html index 8815ac2..9427781 100644 --- a/fangija-zsyf/views/user/codeSms.html +++ b/fangija-zsyf/views/user/codeSms.html @@ -12,6 +12,7 @@ + @@ -63,7 +64,7 @@ 我已阅读并接受《服务协议》

@@ -71,9 +72,9 @@ 第三方登录

- + - +

@@ -92,13 +93,22 @@ $.config = {router: false} + + + + \ No newline at end of file diff --git a/fangija-zsyf/yfindex.html b/fangija-zsyf/yfindex.html index 6c6500d..020b223 100644 --- a/fangija-zsyf/yfindex.html +++ b/fangija-zsyf/yfindex.html @@ -1253,7 +1253,6 @@ function getPosition(){ $("#input_city").text("北京"); getDistrictList($("#input_city").text(),0,0,"",6,0,0,"");*/ - initBaseInfo(city,region,address,lat,lng); if(city!="上海"){ initRegionSelect(city); @@ -1269,7 +1268,9 @@ function getPosition(){ initRegionSelect(city); localStorage.setItem("init_city", city); addLocation(lat,lng); - initBaseInfo(city,"","",0,0); + initBaseInfo(city,"","",0,0); + $("#ShangHaiDiv").show(); + $("#otherCityDiv").hide(); }, { provider:'baidu', @@ -1703,7 +1704,7 @@ function addItems(number, lastIndex) { ''+ ''; @@ -1803,7 +1804,7 @@ function addItems(number, lastIndex) { dataObj[i].title+''+ '
'+dataObj[i].introduction+'
'+ '
'+ - '
'+ + ''+ '
'+ ''; } @@ -2250,7 +2251,7 @@ $("body").delegate("#select_region .button", "click", function () { var minPrice = 0; var maxPrice = 0; if(select_price.indexOf("以上")!=-1){ - select_price = select_price.replaceAll("以上",""); + select_price = select_price.replace("以上",""); minPrice = parseInt(select_price); maxPrice = 0; }else if(select_price.indexOf("不限")!=-1){ @@ -2325,7 +2326,7 @@ $(".confirm_btn").on("click", function () { var minPrice = 0; var maxPrice = 0; if(select_price.indexOf("以上")!=-1){ - select_price = select_price.replaceAll("以上",""); + select_price = select_price.replace("以上",""); minPrice = parseInt(select_price); maxPrice = 0; }else if(select_price.indexOf("不限")!=-1){ @@ -2378,7 +2379,7 @@ $("#select_order li").on("click", function () { var minPrice = 0; var maxPrice = 0; if(select_price.indexOf("以上")!=-1){ - select_price = select_price.replaceAll("以上",""); + select_price = select_price.replace("以上",""); minPrice = parseInt(select_price); maxPrice = 0; }else if(select_price.indexOf("不限")!=-1){ @@ -2448,7 +2449,7 @@ function getCityPriceLevel(cityParam){ var minPrice = 0; var maxPrice = 0; if(select_price.indexOf("以上")!=-1){ - select_price = select_price.replaceAll("以上",""); + select_price = select_price.replace("以上",""); minPrice = parseInt(select_price); maxPrice = 0; }else if(select_price.indexOf("不限")!=-1){ @@ -2531,16 +2532,20 @@ function openNewsView(newId) { // } // }); clicked('views/news/newsDetail.html',true,false,{},{newsId:newId},function(newId){ - alert(newId); + axios.post("/rest/comment/getCommentCount",{commentObjId : newId}).then(function (response) { + var msg = response.data.message + if(response.data.status){ + $("#visitComment_"+newId).text(response.data.data+"条"); + } + }) + .catch(function (error) { + console.log(error); + }); },newId); var count = parseInt($("#visitCount_"+newId).text().replace("人",""))+1; $("#visitCount_"+newId).text(count+'人'); } -window.addEventListener('refresh', function(e){//执行刷新 - alert("aa"); -}); - diff --git a/fangija-zsyf/views/news/newsDetail.html b/fangija-zsyf/views/news/newsDetail.html index 4418540..d1b53ab 100644 --- a/fangija-zsyf/views/news/newsDetail.html +++ b/fangija-zsyf/views/news/newsDetail.html @@ -42,7 +42,7 @@
- +


更多房产资讯上有房APP