Browse Source

Merge branch 'dev2.10.2' of http://192.168.3.207:10080/qmx/jy into dev2.10.2

zhangxinlei1996 5 years ago
parent
commit
29331a9428

+ 34 - 16
src/jfw/modules/app/src/app/front/login.go

@@ -161,13 +161,7 @@ func (l *Login) Login() error {
 			if phone == "" || l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
 				return -1
 			} else {
-				query := map[string]interface{}{
-					"i_appid": 2,
-					"$or": []map[string]interface{}{
-						map[string]interface{}{"s_phone": phone},
-						map[string]interface{}{"s_m_phone": phone}},
-				}
-				user, ok := mongodb.FindOne("user", query)
+				ok, user := getPhoneUser(phone)
 				//登录成功
 				if !ok {
 					return 0
@@ -178,7 +172,7 @@ func (l *Login) Login() error {
 				phoneType := l.GetString("phoneType")
 				channel := l.GetString("channel")
 				deviceId := l.GetString("deviceId")
-				if user == nil || len(*user) == 0 {
+				if user == nil || len(user) == 0 {
 					//clearRidByRid(rid)
 					data := map[string]interface{}{
 						"i_appid":       2,
@@ -204,7 +198,7 @@ func (l *Login) Login() error {
 					}
 				} else {
 					jy.ClearPhoneIdentSession(l.Session())
-					returnSign = afterLogin(*user, l.Session(), rid, oid, phoneType, channel, deviceId, 1, false)
+					returnSign = afterLogin(user, l.Session(), rid, oid, phoneType, channel, deviceId, 1, false)
 					return 1
 				}
 			}
@@ -604,7 +598,12 @@ func (l *Login) ForgetPwd() error {
 				return "codeError"
 			}
 			//手机号是否已被注册
-			if !userIsExists(phone) {
+			if mongodb.Count("user", map[string]interface{}{
+				"i_appid": 2,
+				"$or": []map[string]interface{}{
+					map[string]interface{}{"s_phone": phone},
+					map[string]interface{}{"s_m_phone": phone}},
+			}) == 0 {
 				return "phoneNotExists"
 			} else if jy.SendPhoneIdentCode(phone, l.Session()) {
 				return "y"
@@ -624,14 +623,21 @@ func (l *Login) ForgetPwd() error {
 			if !passwordReg.MatchString(password) {
 				return "passwordError"
 			}
-			if !userIsExists(phone) { //用户已存在
+			ok, user := getPhoneUser(phone)
+			if !ok || user == nil || len(user) == 0 { //用户不存在
 				return "userNotExists"
 			}
-			query := map[string]interface{}{
-				"i_appid": 2,
-				"s_phone": phone,
-			}
-			if mongodb.Update("user", query, map[string]interface{}{"$set": map[string]interface{}{"s_password": qutil.GetMd5String(password), "l_updatepwdtime": time.Now().Unix()}}, false, false) {
+			if mongodb.Update("user", map[string]interface{}{
+				"_id": user["_id"],
+			}, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"s_phone":         phone,
+					"s_password":      qutil.GetMd5String(password),
+					"l_updatepwdtime": time.Now().Unix(),
+				},
+				"$unset": map[string]interface{}{
+					"s_m_phone": "",
+				}}, false, false) {
 				l.DelSession("forgetPwdStep")
 				jy.ClearPhoneIdentSession(l.Session())
 				return "y"
@@ -756,6 +762,18 @@ func (l *Login) Brand() {
 /**********************************************************************
 ***********************************************************************
 ***********************************************************************/
+func getPhoneUser(phone string) (bool, map[string]interface{}) {
+	users, ok := mongodb.Find("user", map[string]interface{}{
+		"i_appid": 2,
+		"$or": []map[string]interface{}{
+			map[string]interface{}{"s_phone": phone},
+			map[string]interface{}{"s_m_phone": phone}},
+	}, `{"s_phone":-1}`, nil, false, 0, 1)
+	if users != nil && len(*users) > 0 {
+		return ok, (*users)[0]
+	}
+	return ok, nil
+}
 
 //手机号用户是否存在
 func userIsExists(phoneNum string) bool {

+ 5 - 5
src/jfw/modules/app/src/web/staticres/jyapp/css/subscribe.css

@@ -856,7 +856,7 @@ font-weight: bold;
   position: relative;
   padding: 12px 10px;
   background: #fff;
-/*      border-bottom: 1px solid #E6E6E6;*/
+      border-bottom: 1px solid #E6E6E6;
 }
 
 /*.filter_tab:after {
@@ -1542,7 +1542,7 @@ body .loading_ p span {
 
 .app-content {
     display: none;
-    justify-content: space-between;
+/*    justify-content: space-between;*/
     flex-direction: column;
     overflow: hidden;
     height: 100%;
@@ -1595,10 +1595,10 @@ html, body {
   background-position: left center;
 }
 .app-layout-header .switch{
-/*  padding: 0px 10px;
+  padding: 0px 10px;
   border-radius: 24px;
   display: flex;
-  position: relative;*/
+  position: relative;
 }
 .app-layout-header .switch>span{
   max-width: 2.5rem;
@@ -1642,7 +1642,7 @@ html, body {
   color: #2ABED1;
 }
 .app-layout-header .only-personal{
-/*  background: linear-gradient(270deg, #F1D090 0%, #FAE7CA 100%);*/
+  background: linear-gradient(270deg, #F1D090 0%, #FAE7CA 100%);
 }
 .vip_report {
   color: #686868;

BIN
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/image/Vector.png


BIN
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/image/entback.png


+ 45 - 13
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -11,6 +11,7 @@
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}"/>
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}"/>
     <script>
+		//
     		function afterReceivePushMessage(type,url){
           if(type=="bid" || type=="vipreport"){
             JyObj.showRedSpotOnMenu("subscribe");
@@ -106,6 +107,7 @@
                 window.location.href = '/jyapp/wxkeyset/keyset/seniorset';
             });
             $(".listcontent").scroll(function () {
+				console.log(3333)
                 scrollTop = $(this).scrollTop();
             });
             this.isCanSwitch=true;
@@ -298,19 +300,47 @@
             $.post("/jyapp/myinfo?t="+new Date().getTime(),null,function(r){
               if(r.userType=="vip"){
                 $(".switch").addClass("only-vip");
-                $(".switch>span").text("VIP订阅");
+                $(".switch").text("VIP订阅").show();
                 $(".switch").click(tosetpage);
                 thisClass.InitVip(r);
+				extend(1);
               }else{
-                $(".switch").addClass("only-personal");
-                $(".switch>span").text("¥5.8 开通VIP");
+				setTimeout(function(){
+					if (scrollTop==0){
+						$(".header_header").show();
+					}
+				},200)
+				$(".switch").addClass("only-personal");
+                $(".switch>span").text("免费试用 VIP");
                 $(".switch").click(tointroducepage);
+                $(".switch_ext").click(tointroducepage);
                 thisClass.InitPersonal(r);
                 userMergeQuery();
+				extend(0);
               }
             });
         }
-
+		function extend(i){
+			window.listScroll = function() {
+				if (i==0){
+				    var nowT = $(".listcontent").scrollTop()
+				    if (nowT > 0) {
+				        $(".header_header").css({height: (60 - nowT) +'px'})
+				        if (nowT > 50) {
+				            $(".header_header").hide();
+							$(".switch").show();
+				        }else{
+							$(".header_header").show();
+							$(".switch").hide();
+						}
+				    } else {
+				        $(".header_header").css({height: (60) +'px'})
+				        $(".header_header").show()
+						$(".switch").hide();
+				    }
+				}
+			 }
+		}
         //页面渲染处理
         function showPage() {
             //时间渲染
@@ -799,8 +829,8 @@
   <ul>
     <li>订阅</li>
     <li>
-      <div class="switch">
-        <span style="display:none;"></span>
+      <div class="switch" style="display:none;">
+        <span></span>
       </div>
     </li>
     <li id="sub_manager">订阅管理</li>
@@ -808,6 +838,13 @@
 </div>
 <div class="app-layout-content-b">
     <div class="app-content">
+		<div class="header_header" style="height: 60px;display:none;">
+			<div class="only-personal" style="position: absolute;top: .2rem;left: 4%;background-image: url(/jyapp/vipsubscribe/image/entback.png);background-size: 100%;;border-radius: 8px;width: 92%;display: flex;align-items: center;justify-content: space-between;height: 44px;">
+				<img style="width: 30px; margin-left: .3rem;" src="/jyapp/vipsubscribe/image/Vector.png">
+				<span style="color:#fff;font-weight: bold;font-size: 15px;text-align: left;width: 3.6rem;">300 组关键词特权</span>
+				<span class="switch_ext" style="border-radius: 32px;display: flex;flex-direction: row;padding: 5px 12px;font-weight: bold;font-size: 12px;color: #FAE7CA;margin-right: .2rem;background: linear-gradient(to bottom, #F1D090 0%, #FAE7CA 100%);color: #33323A;font-family: PingFang SC;font-size: 12px;line-height: 18px;letter-spacing: 0px;text-align: center;">免费试用</span>
+			</div>
+		</div>
         <div class="_header">
             <!-- 筛选条件 -->
             <div class="filter_tab">
@@ -843,13 +880,8 @@
                 </div>
             </div>
         </div>
-        <div class="color_top"></div>
-	    <div class="only-personal" style="position: absolute;top: 1rem;left: 4%;background: linear-gradient(270deg, #F1D090 0%, #FAE7CA 100%);border-radius: 8px;width: 92%;display: flex;align-items: center;justify-content: space-between;height: 48px;">
-			<img style="width: 30px; margin-left: .3rem;" src="/jyapp/vipsubscribe/image/Vector.png">
-			<span style="font-weight: bold;font-size: 15px;text-align: left;width: 3.6rem;">300 组关键词特权</span>
-			<span class="switch" style="background: #33323A;border-radius: 32px;display: flex;flex-direction: row;padding: 5px 12px;font-weight: bold;font-size: 12px;color: #FAE7CA;margin-right: .2rem;">免费试用</span>
-	    </div>
-        <div class="listcontent">
+        <div class="color_top" style="display:none;"></div>
+        <div class="listcontent" onscroll="listScroll()">
             <div id="list"></div>
         </div>