diff --git a/fangija-zsyf/css/main.css b/fangija-zsyf/css/main.css
index 1b238fe..25a7c2e 100644
--- a/fangija-zsyf/css/main.css
+++ b/fangija-zsyf/css/main.css
@@ -175,32 +175,7 @@ em.down{color:#88D053;}
.bar-tab:before{background-color:#DCDCDC;transform:scaleY(1);}
.bar-tab .tab-item .icon ~ .tab-label{top:0.05rem;}
-/* 登录 */
-.icon-login01{width:14px;height:20px;background:url(../images/icon-login01.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;}
-.icon-login02{width:15px;height:19px;background:url(../images/icon-login02.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;}
-.icon-login03{width:15px;height:18px;background:url(../images/icon-login03.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;}
-.icon-loginMode01{width:30px;height:24px;background:url(../images/icon-loginMode01.png) no-repeat center center;background-size:100%;}
-.icon-loginMode02{width:30px;height:24px;background:url(../images/icon-loginMode02.png) no-repeat center center;background-size:100%;}
-.icon-loginMode03{width:22px;height:24px;background:url(../images/icon-loginMode03.png) no-repeat center center;background-size:100%;}
-#input_phoneNumber,#input_codeSms,#input_password{left:24px;width:80%;}
-#input_phoneNumber{width:50%;}
-#input_feedback{width:100%;height:100px;}
-.list-block .item-after .icon-eye-grey{width:0.9rem;height:0.65rem;margin-right:0;margin-top:0.25rem;}
-.list-block .item-after .icon-eye-orange{width:0.9rem;height:0.65rem;margin-right:0;margin-top:0.25rem;}
-.sendCode{padding:0 8px;height:27px;background:#fff;border:solid 1px #2db0fc;border-radius:3px;color:#2db0fc;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;}
-.waiting{padding:0 8px;height:27px;background:#0a8ddf;border:solid 1px #0a8ddf;border-radius:3px;color:#fff;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;}
-.agreement{font-size:0.65rem;color:#666;margin-left:0.75rem;}
-.agreement a{font-size:0.65rem;}
-.check{width:18px;height:18px;border:solid 1px #D7D7D7;border-radius:0.05rem;display:inline-block;vertical-align:middle;margin-right:0.2rem;position:relative;}
-.checkImg{width:10px;height:7px;position:absolute;top:5px;left:3px;}
-.loginBox p{text-align:center;margin:0;}
-.loginBox p .button{margin-top:2rem;margin-bottom:0.5rem;}
-.loginBox p a{font-size:0.65rem;color:#AA907A;}
-.loginMode{width:100%;position:absolute;bottom:4.5rem;}
-.loginMode p{font-size:0.65rem;color:#999;text-align:center;}
-.loginMode p a:nth-child(2){margin:0 2rem;}
-.line{width:100%;height:1px;background:#e5e5e5;margin-bottom:1.5rem;position:relative;}
-.line span{position:absolute;top:-10px;left:50%;margin-left:-57.5px;display:block;background:#fff;padding:0 25px;font-size:0.65rem;color:#999;}
+
/* 首页 */
.totalValue{padding:1rem 0;overflow:hidden;}
.totalValue div:first-child{float:left;margin-left:0.75rem;}
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/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/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js
index 2d3743a..7fccf62 100644
--- a/fangija-zsyf/js/login/codeSms.js
+++ b/fangija-zsyf/js/login/codeSms.js
@@ -1,16 +1,87 @@
-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(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 resData = response.data;
+ if (resData.status) {
+ // 用户登录成功的TOKEN
+ var token = resData.data;
+ localStorage.setItem("user_token", token);
+ $.toast(resData.message);
+ back();
+ } else {
+ $.toast(resData.message);
+ }
+ })
+ }
+});
diff --git a/fangija-zsyf/js/login/wxLogin.js b/fangija-zsyf/js/login/wxLogin.js
new file mode 100644
index 0000000..1b144a1
--- /dev/null
+++ b/fangija-zsyf/js/login/wxLogin.js
@@ -0,0 +1,39 @@
+var auths = {}
+function plusReady() {
+ plus.oauth.getServices(function(services) {
+ alert("111111111111111111111111")
+ auths = services;
+ }, function(e) {
+ alert("获取登录服务列表失败:" + e.message + " - " + e.code);
+ });
+}
+document.addEventListener('plusready',plusReady,false);
+// 登录认证
+function webChatLogin(){
+ var auth=auths['weixin'];
+ if(auth){
+ var w=null;
+ if(plus.os.name=="Android"){
+ w=plus.nativeUI.showWaiting();
+ }
+ document.addEventListener("pause",function(){
+ setTimeout(function(){
+ w&&w.close();w=null;
+ },2000);
+ }, false );
+ auth.login(function(){
+ w&&w.close();w=null;
+ userinfo(auth);
+ },function(e){
+ w&&w.close();w=null;
+ $.toast("登录认证失败:["+e.code+"]:"+e.message);
+ });
+ }else{
+ $.toast("无效的登录认证通道!");
+ $.toast("无效的登录认证通道!",null,"登录");
+ }
+}
+
+function authLogin(type) {
+ console.log("hhhhhhhhhhhhhhhhhhh")
+}
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/news/newsDetail.html b/fangija-zsyf/views/news/newsDetail.html
index a7884c1..4418540 100644
--- a/fangija-zsyf/views/news/newsDetail.html
+++ b/fangija-zsyf/views/news/newsDetail.html
@@ -16,6 +16,7 @@
@@ -73,15 +74,22 @@
-
+
+
+
+ {{ newsDzCount }}
+
+
+
+
@@ -116,7 +124,7 @@ $.config = {router: false}