Просмотр исходного кода

wesmiler 更新第5期更新代码合并

wesmiler 4 лет назад
Родитель
Сommit
889be06707

+ 3 - 1
.gitignore

@@ -14,4 +14,6 @@
 /public/*.gz
 /public/*.zip
 /*.gz
-/vendor/*.zip
+/vendor/*.zip
+/public/themes/default/weixin/*.zip
+/*.sql

+ 50 - 0
app/api/controller/MemberController.php

@@ -1087,6 +1087,9 @@ class MemberController extends BaseController
         showJson(1004, 2009);
     }
 
+    /**
+     * 在线认证
+     */
     public function authCheck(){
 
         // 验证
@@ -1627,6 +1630,53 @@ class MemberController extends BaseController
      */
     public function logout()
     {
+        // 验证扣除账号
+        $accountConfig = $siteInfo = cmf_get_option('account_config');
+        $logoutPay = isset($accountConfig['logout_pay']) ? floatval($accountConfig['logout_pay']) : 0;
+        $memberInfo['logout_pay'] = $logoutPay > 0 ? $logoutPay : 1;
+
+        $memberInfo =  Member::where(['id' => $this->userId])
+            ->field('id,redheart,user_nickname,user_status')
+            ->find();
+        $memberInfo = $memberInfo? $memberInfo->toArray() : [];
+        $redheart = isset($memberInfo['redheart'])? $memberInfo['redheart'] : 0;
+        $nickname = isset($memberInfo['user_nickname'])? $memberInfo['user_nickname'] : '';
+        $userStatus = isset($memberInfo['user_status'])? $memberInfo['user_status'] : 0;
+
+        if($userStatus == -1){
+            showJson(1004, 1124);
+        }
+
+        if($redheart < $logoutPay){
+            showJson(1004, 1125);
+        }
+
+        DB::startTrans();
+        if(!Member::where(['id' => $this->userId, 'user_type' => 2])->setDec('redheart', $logoutPay)){
+            DB::rollback();
+            showJson(1004, 2031);
+        }
+
+        // 账户明细
+        $data = [
+            'user_id'=> $this->userId,
+            'type'=> 2,
+            'account_type'=> 1,
+            'change_type'=> 2,
+            'money'=> $logoutPay,
+            'balance'=> $redheart,
+            'remark'=> '用户【'.$nickname.'】注销扣除'.$logoutPay.'颗爱心',
+            'created_at'=> date('Y-m-d H:i:s'),
+            'status'=> 2
+        ];
+        if(!AccountLog::insertGetId($data)){
+            Db::rollback();
+            showJson(1004, 8306);
+        }
+
+        Db::commit();
+
+        // 注销信息
         Member::where(['id' => $this->userId, 'user_type' => 2])
             ->update(['user_status' => -1, 'vip_auth' => 0, 'is_heart' => 0, 'vip_expire' => 0, 'is_reg_profile' => 2, 'is_tuijian' => 0]);
         $cacheKey = "weixin:auth:" . session('openid');

+ 6 - 0
app/weixin/model/Member.php

@@ -313,6 +313,12 @@ class Member extends Model
                 }
             }
 
+            if($type == 1){
+                $accountConfig = $siteInfo = cmf_get_option('account_config');
+                $logoutPay = isset($accountConfig['logout_pay']) ? floatval($accountConfig['logout_pay']) : 0;
+                $memberInfo['logout_pay'] = $logoutPay > 0 ? $logoutPay : 1;
+            }
+
             // 个性标签
             if (isset($info['tags'])) {
                 $info['tags'] = $info['tags'] ? explode(',', $info['tags']) : [];

+ 8 - 0
public/themes/admin_simpleboot3/admin/setting/site.html

@@ -351,6 +351,14 @@
                             </div>
                         </div>
                         <div class="form-group">
+                            <label for="input-logout_pay" class="col-sm-3 control-label">注销账号扣除爱心数量</label>
+                            <div class="col-md-4 col-sm-10">
+                                <input type="text" class="form-control" id="input-logout_pay"
+                                       name="account_config[logout_pay]" value="{$account_config.logout_pay|default='10'}" min="1" max="100000">
+                                <span class="help-block">注销账号扣除爱心数量,最低1个</span>
+                            </div>
+                        </div>
+                        <div class="form-group">
                             <label for="input-min_withdraw" class="col-sm-3 control-label">收益最低提现金额</label>
                             <div class="col-md-4 col-sm-10">
                                 <input type="text" class="form-control" id="input-min_withdraw"

+ 3 - 3
public/themes/default/weixin/auth/idcard.html

@@ -23,9 +23,9 @@
             </ul>
         </div>-->
         <div class="baoc_ann" >
-            <h1 v-if="authInfo.idcard_check != 2 && authInfo.idcard_online_check" @click="authCheck()">审核中,继续验证</h1>
-            <h1 v-else-if="authInfo.idcard_check != 2" @click="authCheck()">开始验证</h1>
-            <h1 v-else >已认证</h1>
+            <h1 v-if="authInfo.idcard_check == 3" @click="authCheck()">重新提交</h1>
+            <h1 v-else-if="authInfo.idcard_check == 2" >已认证</h1>
+            <h1 v-else @click="authCheck()">开始验证</h1>
         </div>
     </div>
 </div>

+ 105 - 0
public/themes/default/weixin/match/test.html

@@ -0,0 +1,105 @@
+<include file="weixin@block:header"/>
+<title>推荐</title>
+<link rel="stylesheet" href="__TMPL__/weixin/public/assets/css/swiper.min.css?v={$version}">
+<link rel="stylesheet" href="__TMPL__/weixin/public/assets/css/match.css?v={$version}">
+<div id="app" v-cloak>
+    <div :class="!hasFollow? 'top_lieb hasFollow' : 'top_lieb'">
+        <ul>
+            <li class="active"><h1><a href="/weixin/match/index?rs=1">单身推荐</a></h1></li>
+            <li><h1><a href="/weixin/match/hearts">怦然心动</a></h1></li>
+            <span class="filter" @click="showFilterBox=showFilterBox?false : true"><img src="__TMPL__/weixin/public/assets/img/search.png"></span>
+        </ul>
+    </div>
+    <div class="followTips" v-if="hasFollow==0">关注拾光公众号,接收微信申请和结果反馈<a @click="showFollow()">立即关注</a><span @click="hasFollow=true">x</span></div>
+    <div :class="'box'+(!hasFollow? ' has' : '')">
+        <div id="recommends" class="recommend-box">
+            <div class="tips" v-if="tipsArr.length>0">
+                <a href="/weixin/member/complain"><span></span></a>
+            </div>
+            <div class="join"><a href="/weixin/activity/book?id=15">我要推荐</a></div>
+            <div v-if="total<=0" class="empty recommends"><span>暂无数据</span></div>
+            <div v-show="total>0" class="swiper-container hearts">
+                <div class="swiper-wrapper ">
+                    <div class="swiper-slide" v-for="(item,k) in dataList" @click="goDetail(item.id)">
+                        <div class="info-box">
+                            <div class="info">
+                                <img class="avatar" :src="item.avatar">
+                                <div class="td_xix">
+                                    <h1>
+                                        <span class="nickname" v-text="item.user_nickname"></span>
+                                        <i v-if="item.idcard_check==2 || item.education_check==2 || item.position_check==2" class="auth" @click.stop="showAuth(item)"><img src="/themes/default/weixin/public/assets/img/auth.png" width="28" height="28"></i>
+                                        <!--                                    <i v-if="item.vip_auth" class="vip-auth"><img  src="/themes/default/weixin/public/assets/img/vip-auth.png" width="24" height="24"><span>已认证</span></i>-->
+                                    </h1>
+                                    <p class="location" v-if="item.distance!=''"><span>距离你 {{item.distance}}{{item.district? '·'+item.district : ''}}</span><span class="pics"><img
+                                            src="/themes/default/weixin/public/assets/img/pic.png">{{item.pic_count}}</span></p>
+                                    <p><span v-text="item.birthday_day?item.birthday_day+'|':''"></span><span
+                                            v-text="item.height_txt?item.height_txt+'|':''"></span><span
+                                            v-text="item.education_txt? item.education_txt+'|':''"></span><span v-text="item.occupation"></span></p>
+                                    <p><span v-text="item.city? '现居'+item.city : ''"></span><span v-text="item.home_province? '·'+item.home_province+'人' : ''"></span>
+                                        <span class="pics" v-if="item.distance==''"><img
+                                                src="/themes/default/weixin/public/assets/img/pic.png">{{item.pic_count}}</span>
+                                    </p></div>
+                            </div>
+                            <div class="desc">
+                                <p v-html="item.introduce? item.introduce: '这个人很懒,什么也没留下~'"></p>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div v-if="status.loaded" class="loaded">
+                已加载完全部
+            </div>
+        </div>
+        <div :class="!hasFollow? 'filterBox has' : 'filterBox'" v-if="showFilterBox">
+            <div class="prxd_box">
+                <ul>
+                    <li>
+                        <div class="prxd_bt"><h1>你希望Ta的年龄是</h1></div>
+                        <div class="prxd_nr">
+                            <h1>年龄</h1>
+                            <img class="minzu" src="__TMPL__/weixin/public/assets/img/tubiao35.png">
+                            <label>
+                                <input id="age_btn" class="tianx tianx select-value9 sel" type="text" name="age"  placeholder="不限"/>
+                                <input id="age" type="text" class="tianx tianx select-value9 input" :data-code="conditions.age" placeholder="不限" readonly>
+                            </label>
+                        </div>
+                    </li>
+                    <li>
+                        <div class="prxd_bt"><h1>你希望Ta的身高是</h1></div>
+                        <div class="prxd_nr">
+                            <h1>身高</h1>
+                            <img class="minzu" src="__TMPL__/weixin/public/assets/img/tubiao35.png">
+                            <label>
+                                <input id="height_btn" class="tianx tianx select-value9 sel" type="text" name="height"  placeholder="不限"/>
+                                <input id="height" type="text" class="tianx tianx select-value9 input" :data-code="conditions.height" placeholder="不限" readonly>
+                            </label>
+                        </div>
+                    </li>
+                    <li>
+                        <div class="prxd_bt"><h1>你希望Ta的学历至少是</h1></div>
+                        <div class="prxd_nr4 choose-item" id="education">
+                            <h1 v-if="educations.length<=0" class="active" data-code="0">不限</h1>
+                            <h1 v-for="(item,k) in educations" :class="k==conditions.education||(conditions.education<=0 && k==0)? 'active' : 'btn'" :data-code="k" v-text="item"></h1>
+                        </div>
+                    </li>
+                    <li>
+                        <div class="prxd_bt"><h1>你希望Ta的婚姻状态是</h1></div>
+                        <div class="prxd_nr3 choose-item" id="married">
+                            <h1 v-for="(item,k) in marrieds" :class="k+1==conditions.married||(conditions.married<=0 && k==0)? 'active' : 'btn'" :data-code="k+1" v-text="item"></h1>
+                        </div>
+                    </li>
+                </ul>
+                <div class="ger_banc">
+                    <h1 class="save" @click="filterSubmit()">筛选</h1>
+                </div>
+            </div>
+        </div>
+
+    </div>
+    <!-- 底部菜单 -->
+    <include file="weixin@block:footer_nav"/>
+</div>
+<script src="__TMPL__/weixin/public/assets/lib/swiper.min.js?v={$version}"></script>
+<script src="__TMPL__/weixin/public/assets/js/match.js?v={$version}"></script>
+<include file="weixin@block:footer"/>

+ 432 - 0
public/themes/default/weixin/public/assets/css/match-test.css

@@ -0,0 +1,432 @@
+/* 首页 */
+html {
+    height: 100%;
+}
+body {
+    /*overflow-y: scroll;*/
+
+}
+.box {
+    padding: 0 15px;
+    overflow-y: scroll !important;
+    height: calc(100% - 134px);
+    position: relative;
+    margin-bottom: 0;
+ }
+.box.recommend {
+    background: none;
+    padding: 0;
+    width: 100%;
+    /*margin-left: 15px;*/
+}
+.box.has {
+    margin-top: 85px;
+    height: calc(100% - 156px);
+}
+.recommend.has {
+    height: calc(100% - 145px);
+}
+.box .swiper-container {
+    height: 100%;
+}
+
+.box .hearts .swiper-slide {
+    height: calc(100% - 20px);
+    width: calc(100% - 30px);
+    margin: 0 auto;
+}
+.recommend-box {
+    height: 100%;
+    position: relative;
+}
+.box .recommends .swiper-slide {
+    height: calc(95% - 20px);
+    /*height: calc(100% - 20px);*/
+    margin: 0 auto;
+}
+.recommend-box .info-box {
+    margin: 0;
+    margin-bottom: 20px;
+    height: calc(100% - 20px);
+    border-radius: 8px;
+    position: relative;
+    border-bottom: 10px solid #dcd8cd;
+    /*height: 100%;*/
+}
+.recommend-box .info-box .info {
+    /*height: 100%;*/
+    /*height: 100%;*/
+}
+.recommend-box .info .avatar {
+    /*border-radius: 8px;*/
+    /*border-bottom-left-radius: 8px;*/
+    /*border-bottom-right-radius: 8px;*/
+}
+.top_lieb ul {
+    position: relative;
+}
+.top_lieb li {
+    background-color: transparent;
+    color: #333;
+}
+.more {
+    text-align: center;
+    margin-top: 20px;
+}
+.more a {
+    color: #f1c21f;
+}
+.top_lieb li.active {
+    background-color: #f1c21f;
+    color: #fff;
+}
+.top_lieb li.active a {
+    color: #fff;
+}
+.top_lieb li a {
+    color: #333;
+}
+.top_lieb ul .filter {
+    position: absolute;
+    right: 4px;
+    top: 8px;
+}
+.top_lieb ul .filter img {
+    width: 24px;
+    height: 24px;
+    display: inline-block;
+}
+.hearts .info-box {
+    /*margin: 0 15px;*/
+    /*margin-left: 15px;*/
+    height: 90%;
+    border-radius: 8px;
+    background-color: #fff;
+    border: 1px solid #e5e2e2;
+    box-shadow: 0px 2px 2px 2px #e7e8e5;
+    position: relative;
+
+}
+.hearts .swiper-wrapper .swiper-slide:first-child .info-box{
+    margin-left: 0;
+}
+.recommend-box .pics {
+    float: right;
+    margin-right: 8px;
+    font-weight: normal;
+    font-size: 14px;
+    line-height: 24px;
+}
+.info-box .info {
+    position: relative;
+    height: calc(100% - 100px);
+}
+.info .avatar {
+    height: 100%;
+    width: 100%;
+    display: block;
+    border-top-left-radius: 8px;
+    border-top-right-radius: 8px;
+}
+.followTips {
+    height: 30px;
+    background: #2f2e2e;
+    width: 100%;
+    position: fixed;
+    top: 0;
+    z-index: 999;
+    color: #fff;
+    text-align: center;
+    line-height: 30px;
+    font-size: 14px;
+}
+.follow img {
+    width: 100%;
+    height: 100%;
+}
+.followTips a {
+    color: #fff;
+    background: #f1c21f;
+    border-radius: 4px;
+    padding: 2px 5px;
+    margin-left: 5px;
+}
+.followTips span {
+    float: right;
+    margin-right: .5rem;
+    border-radius: 100%;
+    display: inline-block;
+    width: 20px;
+    text-align: center;
+    background: #ccc;
+    height: 20px;
+    line-height: 20px;
+    margin-top: 5px;
+}
+.top_lieb.hasFollow {
+    top: 30px;
+}
+.info .td_xix{
+    width: 100%;
+    min-height: 5.2rem;
+    /*background-color: rgba(160, 159, 159, 0.4);*/
+    background-color: rgba(195 ,194 ,194 , 0.37);
+    position: absolute;
+    bottom: 0;
+    color: #fff;
+}
+.info .td_xix h1{
+    font-size: 20px;
+    margin-left: 12px;
+    line-height: 36px;
+    margin-top: 6px;
+    font-weight: bold;
+    color: #fff;
+}
+.info .auth {
+    vertical-align: middle;
+    display: inline-block;
+    /*line-height: 24px;*/
+    height: 28px;
+}
+.info .vip-auth {
+    background-color: #f1c21f;
+    display: inline-block;
+    vertical-align: middle;
+    padding: 2px 6px;
+    border-radius: 6px;
+    line-height: 24px;
+    font-style: normal;
+    font-size: 12px;
+}
+.info .vip-auth img {
+    display: inline-block;
+    vertical-align: middle;
+}
+.info .vip-auth span {
+    display: inline-block;
+    vertical-align: middle;
+    margin-left: 6px;
+    color: #fff;
+}
+.info .td_xix p{
+    font-size: 14px;
+    line-height: 26px;
+    margin-left: 12px;
+    color: #fff;
+}
+.info-box .desc {
+    /*height: 100px;*/
+
+}
+
+.info-box .desc p {
+    margin: 20px;
+    line-height: 28px;
+    text-align: center;
+    color: #666;
+    font-weight: 200;
+    word-break: break-all;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 2;
+    overflow: hidden;
+}
+.info-box .down-more {
+    position: absolute;
+    right: 8px;
+    bottom: 8px;
+   /* position: absolute;
+    bottom: -60px;
+    left: 0;
+    right: 0;
+    margin: auto;
+    width: 36px;*/
+}
+
+.pics {
+    float: right;
+    margin-right: 8px;
+}
+.pics img {
+    width: 24px;
+    height: 24px;
+    vertical-align: middle;
+}
+
+.nomore {
+    padding-left: 15px;
+    background: url('/themes/default/weixin/public/assets/img/recommend_bg.png?v=1') no-repeat 100%/100%;
+    font-size: 16px;
+}
+.nomore .head {
+    text-align: center;
+    margin: 20px;
+    font-size: 20px;
+}
+.nomore .time {
+    margin: 15px 0 20px;
+    text-align: center;
+}
+.nomore .time span {
+    color: red;
+}
+.nomore .tips {
+    margin: 10px auto;
+    line-height: 36px;
+    text-align: center;
+    margin-right: 15px;
+}
+
+.join {
+    position: fixed;
+    z-index: 99;
+    right: 0;
+    background: #e62977;
+    padding: 4px 8px 4px 14px;
+    font-size: 12px;
+    color: #fff;
+    border-radius: 20px 0 0 20px;
+    top: 20%;
+}
+
+.join a {
+    color: #fff;
+}
+
+.top_lieb{height: 46px;background: #fff;width: 100%; position: fixed;top: 0;z-index: 999;border-bottom: 1px solid #e6e6e6;}
+.top_lieb ul{padding: 0 10px;}
+.top_lieb li{float: left;overflow: hidden;width:30%;margin: 0 9%;margin-top:10px;border-radius: 14px;}
+.top_lieb li h1{font-size: 16px;text-align: center;height:26px;margin: auto;line-height: 26px;}
+
+.box{/*padding-left: 15px;*/margin-top:58px;margin-bottom: 49px; background: #fff;overflow: hidden;padding-top: 15px;    position: relative;}
+.tuod_ne{position: relative;width: 100%;margin-bottom: 15px;border-radius: 10px;overflow: hidden;height: 425px;}
+.tuod_ne img{width: 100%;top: 0;position: absolute;width: 100%;height: 100%;}
+.tuod_ne::before{display: block;content: '';width: 100%;padding-top: 100%;}
+
+.item .td_xix{width: 100%; height: 5rem;background-color: rgba(160, 159, 159, 0.4);position: absolute;bottom: 0;}
+.item .td_xix h1{font-size: 16px;margin-left: 12px;line-height: 26px;margin-top: 6px;font-weight: bold;color: #fff;}
+.item .td_xix p{font-size: 14px;line-height: 20px;margin-left: 12px;color: #fff;}
+
+.filterBox {
+    width: 100%;
+    position: fixed;
+    z-index: 100;
+    background-color: rgba(137, 133, 133, 0.38);
+    top: 47px;
+    left: 0;
+    height: 100%;
+}
+.filterBox.has {
+    top: 77px;
+}
+.prxd_box{padding:0 15px;overflow: hidden; background-color: #fff; padding-bottom: 15px}
+.prxd_box ul{margin-top:20px;}
+.prxd_box li{overflow: hidden;}
+
+.prxd_bt{height: 40px; background: #fff;}
+
+.prxd_bt h1{font-size: 14px;color: #333;font-weight: bold;height: 22px;line-height:22px;margin-top: 0px;}
+
+.choose-item h1.active {
+    border: 1px solid #ffd132;
+    color: #fff;
+    background: #ffd132;
+}
+
+.prxd_nr{height: 40px;width: 100%;overflow: hidden;}
+.prxd_nr2,.prxd_nr3 {height: 50px;width: 100%;overflow: hidden;}
+.prxd_nr h1{float: left;font-size: 14px;line-height:40px;}
+.prxd_nr2 h1,.prxd_nr3 h1,.prxd_nr4 h1{float: left;font-size: 12px;padding: 5px 10px;border: 1px solid #ccc;margin-right: 20px;border-radius: 4px;    margin-bottom: 15px;}
+
+.tianx{font-size: 14px;color: #333;width: 55%;height: 40px;float: right;line-height: 40px;margin-right: 15px;text-align: right;border: none;outline: medium;}
+.prxd_nr label {
+    position: relative;
+    display: inline-block;
+    width: 55%;
+    float: right;
+}
+.prxd_nr label input {
+    width: 100%;
+}
+.prxd_nr label input.input {
+    position: absolute;
+    z-index: 1;
+    right: 0;
+}
+.prxd_nr label input.sel {
+    opacity: 0;
+    position: relative;
+    /*position: absolute;*/
+    z-index: 2;
+    right: 0;
+}
+
+.minzu {
+    float: right;
+    width: 12px;
+    margin-top: 14px;
+}
+.tianx {
+    font-size: 14px;
+    color: #333;
+    width: 55%;
+    height: 40px;
+    float: right;
+    line-height: 40px;
+    margin-right: 15px;
+    text-align: right;
+    border: none;
+    outline: medium;
+}
+
+.ger_banc {
+    margin-top: 10px;
+    height: 80px;
+    background: #fff;
+}
+
+.ger_banc h1 {
+    font-size: 18px;
+    height: 40px;
+    line-height: 40px;
+    text-align: center;
+    background: #ffd132;
+    color: #333;
+    border-radius: 6px;
+    margin-top: 20px;
+    padding: 0 20px;
+}
+
+/* 提示 */
+
+.tips {
+    position: fixed;
+    top: 12%;
+    background: #ffd132;
+    z-index: 99;
+    border-radius: 16px;
+    padding: 0px 8px;
+    width: 85%;
+    text-align: center;
+    right: -100%;
+    height: 30px;
+    line-height: 30px;
+    overflow: hidden;
+    display: none;
+}
+
+.tips a {
+    display: block;
+    color: red;
+    width: 100%;
+    min-width: 296px;
+    font-size: 14px;
+}
+
+.tips a em {
+    font-style: normal;
+    max-width: 50px;
+    overflow: hidden;
+}

+ 659 - 35
public/themes/default/weixin/public/assets/js/match-test.js

@@ -2,58 +2,682 @@ var app = new Vue({
     'el': '#app',
     'data': {
         // 当前导航
-        curNav: 'member',
+        curNav: 'match',
+        slideIndex: 0,
+        // 数据请求参数
+        params: {
+            page: 1,
+            historyPage: 0,
+            loadHistory: 0,
+            age: '',
+            height: '',
+            education: 0,
+            married: 0,
+            pageSize: 3,
+            type: 1,
+            lat: '',
+            lng: '',
+        },
+        hasFollow: 0,
+        // 数据列表
+        dataList: [],
+        matchList: [],
+        // 条件参数
+        ages: [],
+        // 身高
+        heights: [],
+        // 收入
+        salarys: ['不限'],
+        // 学历
+        educations: ['不限','大专','本科','硕士及以上'],
+        // 婚姻状态
+        marrieds: [],
+        // 设置的条件
+        conditions: {
+            age: '',
+            year: '',
+            age_txt: '',
+            city: 0,
+            education: 0,
+            height: '',
+            height_txt: '',
+            home_province: 0,
+            salary: 0,
+            salary_txt: '不限',
+            weight: 0,
+            weight_txt: '不限',
+            married: 0,
+            married_txt: '未婚',
+        },
+        // 记录数
+        total: 1,
+        type: 1,
+        loadSlide: false,
+        // 是否已经推荐过
+        redommended: false,
+        showFilterBox: false,
         // 用户信息
         memberInfo: {},
-        selects: ['A','B','C','D','E','F','G','H','I'],
-        selects1: ['A','B','C','D','E','F','G','H','I'],
-        results: [],
+        // 加载状态
+        status: {
+            locading: false,
+            loaded: false,
+        },
+        switchStatus: false,
+        rSwiper: null,
+        timerId: null,
+        tipsTimerId: null,
+        tipsLoadTimerId: null,
+        loadedCount: 0,
+        locaded: false,
+        tipsArr: [],
+        tips: {
+            content: '',
+            left: -95,
+        },
+        tipParams: {
+            page: 1,
+            pageSize: 30
+        },
     },
-    created: function(){
+    created: function () {
+        var reset = getParam('rs');
+        var slideIndex = sessionStorage.getItem('slideIndex');
+        var total = sessionStorage.getItem('total');
+        var dataList = sessionStorage.getItem('dataList')
+        dataList = typeof (dataList) != 'undefined' && dataList != null? JSON.parse(dataList) : []
+        if(dataList && dataList.length>0 && !reset){
+            this.slideIndex = typeof (slideIndex) != 'undefined' && slideIndex>0? slideIndex : 0
+            this.slideIndex = this.slideIndex <= dataList.length? this.slideIndex : 0
+            this.total = typeof (total) != 'undefined' && total>0? total : dataList.length
+            this.params.page = Math.ceil(dataList.length/this.params.pageSize);
+            this.dataList = dataList;
+        }else{
+            this.slideIndex = 0;
+            this.getDataList(false);
+        }
+        this.getInfo();
+        this.getParams();
+        this.initShare();
+
+
+    },
+    updated: function () {
+        var _this = this;
+        _this.initData();
+
+        this.initSwiper()
+
+        // 选项选中
+        $(".choose-item h1").click(function(){
+            $(this).addClass('active').siblings().removeClass('active');
+        });
     },
-    mounted: function(){
+    // 渲染数据
+    mounted: function () {
+        var _this = this;
+
+        _this.timeLockTips();
+
+        // 分类导航切换
+        $(".top_lieb li").click(function () {
+            var type = $(this).index() + 1;
+            $(this).addClass('active').siblings().removeClass('active');
+            _this.type = type;
+            if (_this.type == 2 ) {
+                // _this.hasFollow=1
+            }else{
+                $.hideLoading();
+            }
+        });
 
     },
     methods: {
-        doMatch: function(){
-            var _this = this;
-            var params = [];
-            var count = 0;
-            $(".list").each(function(){
-                var $this = $(this);
-                var uid =$this.find('span').text();
-                var data = {'uid': uid};
-                data.heart_uids = [];
-                console.log(data);
-                $this.find('input').each(function(){
-                    var num = $(this).val();
-                    if(num != ''){
-                        data.heart_uids.push(num);
+        // 获取用户信息
+        getInfo: function () {
+            var _this = this;
+            $.post('/api/member/getInfo', {type: 1,uncheck: true}, function (res) {
+                if (res.code == 'success') {
+                    _this.memberInfo = res.data
+                    _this.hasFollow = typeof(_this.memberInfo.is_follow) != 'undefined'? _this.memberInfo.is_follow : 0;
+                    /*if (_this.memberInfo.user_status != 1) {
+                        _this.matchList = [];
+                        $.showLoading('账号已被冻结,请联系客服', 'text');
+                        setTimeout(function () {
+                            // $.hideLoading();
+                            location.href = '/weixin/page/custom';
+                        }, 500)
+                    }*/
+                } else if (res.code == 'exception') {
+                    var url = res.data.url;
+                    $.showLoading(res.message, 'text');
+                    if (url) {
+                        setTimeout(function () {
+                            $.hideLoading();
+                            location.href = url;
+                        }, 500)
                     }
-                });
+                } else {
+                    $.toast(res.message, 'text');
+                }
+            }, "json");
+        },
+        // 初始化参数
+        getParams: function(){
+            var _this = this;
+            $.post('/api/index/params', {}, function (res) {
+                if (res.code == 'success'){
+                    var paramDatas = res.data;
+                    _this.marrieds = typeof (paramDatas.marrieds) != 'undefined'? paramDatas.marrieds : ["未婚"];
+                    _this.initData();
+                }else{
+                    $.toast(res.message, 'text');
+                }
+            }, "json");
+        },
+        // 获取举报用户
+        getTips: function(){
+            var _this = this
+            $.post('/api/member/complainList', _this.tipParams, function (res) {
+                if (res.code == 'success'){
+                    var dataList = typeof(res.data.data) != 'undefined'? res.data.data : [];
+                    if(dataList.length>0 && res.data.total>0 && _this.tipsArr.length<res.data.total){
+                        if(dataList.length<_this.tipParams.pageSize){
+                            _this.tipsArr = _this.tipsArr.concat(dataList)
+                        }else{
+                            _this.tipsArr = dataList
+                        }
 
-                if(data.heart_uids.length>0){
-                    params.push(data);
-                    count++;
+                        _this.initTips(0)
+                    }else{
+                        clearInterval(_this.tipsLoadTimerId)
+                    }
                 }
-            })
+            }, "json");
+        },
+        timeLockTips(){
+            var _this = this;
+            clearInterval(_this.tipsLoadTimerId)
+            _this.getTips()
+        },
+        // 初始化提示
+        initTips: function(index){
+            var _this = this
+            var num = _this.tipsArr.length
+            if(num>0){
+                var data = typeof(_this.tipsArr[index]) != 'undefined'? _this.tipsArr[index] : {};
+                if(!data){
+                    return false;
+                }
+
+                clearInterval(_this.tipsTimerId)
+                var width = 280;
+                var left = -100;
+                var content = '提示:用户<em>'+data.user_nickname+'</em>因被举报核实已拉黑,点击查看'
+                // _this.tips.content = '提示:用户<em>'+data.user_nickname+'</em>因被举报核实已拉黑,点击查看'
+                var strs = content? content.split('') : [];
+                if(strs.length>9){
+                    width = (strs.length-9)*13.5
+                }
+
+                $(".tips").show();
+                $(".tips").css({width:width+'px'});
+                $(".tips a span").html(content);
+                _this.tipsTimerId = setInterval(function(){
+                    //console.log(left+'++'+index)
+                    if(left>=100){
+                        left = -100;
+                        content = '';
+                        index = index+1>=num? 0 : index+1;
+                        $(".tips").hide();
+                        $(".tips").css({right:left+'%'});
+                        $(".tips a span ").html(content);
+                        _this.initTips(index)
+                        return false;
+                    }
+
+                    left += 0.25;
+                    $(".tips").css({width:width+'px'});
+                    $(".tips").css({right:left+'%'});
+                    $(".tips a span ").html(content);
+                    $(".tips").show();
+                }, 20);
+            }
+
+        },
+        // 初始化筛选数据
+        initData: function(){
+            var _this = this;
+            var ages = [];
+            for(var i=0;i<=72;i++){
+                ages.push(18+i);
+            }
 
-            console.log(params)
-            console.log(params.length)
-            if(count<=0){
-                $.toast('请填写数据', 'text');
+            var conditions = sessionStorage.getItem('conditions');
+            conditions = typeof (conditions) != 'undefined' && conditions != null? JSON.parse(conditions) : {}
+            if(conditions){
+                _this.conditions = conditions
+            }
+
+            var data = _this.conditions.age? _this.conditions.age.toString() : '';
+            data = data? data.split('~'): [];
+            var data1 = typeof(data[0]) != 'undefined'? data[0] : '';
+            var data2 = typeof(data[1]) != 'undefined'? data[1] : '';
+            data2 = data2>data1?data2 : 0;
+            if(data1==0 && data2>0){
+                code = data2+'以下';
+            }else if(data1>0 && data2==0){
+                code = data1+'以上';
+            }else if(data1 && data2 && data2>data1){
+                code = data1+'~'+data2+'岁';
+            }
+
+            $("#age").val(code);
+            $("#age_btn").val(_this.conditions.age);
+            $("#age_btn").picker({
+                title: "请选择年龄",
+                cols: [
+                    {
+                        textAlign: 'center',
+                        values: ages,
+                    },
+                    {
+                        textAlign: 'center',
+                        values: ages,
+                    }
+                ],
+                onChange: function(data){
+                    var code = '';
+                    var data1 = data.cols[0].value;
+                    var data2 = data.cols[1].value;
+                    data1 = data1 =='不限'? 0 : data1;
+                    data2 = data2 =='不限'? 0 : data2;
+                    data2 = data2>data1?data2 : 0;
+                    if(data1==0 && data2>0){
+                        code = data2+'以下';
+                    }else if(data1>0 && data2==0){
+                        code = data1+'以上';
+                    }else if(data1 && data2 && data2>data1){
+                        code = data1+'~'+data2+'岁';
+                    }
+                    $("#age").attr('data-code', data1+'~'+data2);
+                    $("#age").val(code);
+                    // $("#age").val(data1 || data2 && (data2>data1)? data1+'~'+data2 : '');
+                },
+                onConfirm: function(data){
+                    console.log(data)
+                }
+            });
+
+            for (var i = 1; i <= 70; i++) {
+                _this.heights.push((145 + i));
+            }
+
+            var data = _this.conditions.height? _this.conditions.height.toString() : '';
+            data = data? data.split('~'): [];
+            var data1 = typeof(data[0]) != 'undefined'? data[0] : '';
+            var data2 = typeof(data[1]) != 'undefined'? data[1] : '';
+            var code = '';
+            data1 = data1 =='不限' || !data1? 0 : data1;
+            data2 = data2 =='不限' || !data2? 0 : data2;
+            data2 = data2>data1?data2 : 0;
+            if(data1==0 && data2>0){
+                code = data2+'以下';
+            }else if(data1>0 && data2==0){
+                code = data1+'以上';
+            }else if(data1 && data2 && data2>data1){
+                code = data1+'~'+data2+'cm';
+            }
+            $("#height_btn").attr('data-code', _this.conditions.height);
+            $("#height").val(code);
+            $("#height_btn").picker({
+                title: "请选择身高",
+                cols: [
+                    {
+                        textAlign: 'center',
+                        values: _this.heights,
+                    },
+                    {
+                        textAlign: 'center',
+                        values: _this.heights,
+                    }
+                ],
+                onChange: function(data){
+                    var code = '';
+                    var data1 = data.cols[0].value;
+                    var data2 = data.cols[1].value;
+                    data1 = data1 =='不限' || !data1? 0 : data1;
+                    data2 = data2 =='不限' || !data2? 0 : data2;
+                    data2 = data2>data1?data2 : 0;
+                    if(data1==0 && data2>0){
+                        code = data2+'以下';
+                    }else if(data1>0 && data2==0){
+                        code = data1+'以上';
+                    }else if(data1 && data2 && data2>data1){
+                        code = data1+'~'+data2+'cm';
+                    }
+                    $("#height").attr('data-code', data1+'~'+data2);
+                    $("#height").val(code);
+                },
+                onConfirm: function(data){
+
+                },
+            });
+        },
+        // 加载更多
+        loadMore: function(){
+            var _this = this;
+            var slideIndex = _this.dataList.length;
+            _this.status.loaded = false;
+            _this.status.total = 1;
+            _this.params.page++;
+            _this.slideIndex = slideIndex>0? slideIndex : 0
+            _this.getDataList(true);
+        },
+        // 获取列表数据
+        getDataList: function (more) {
+            var _this = this;
+            if(_this.status.loading){
                 return false;
             }
-console.log(params);
-            $.showLoading("数据加载中...");
-            $.post('/api/test/matchUser', {params: params}, function (res) {
+            _this.status.loading = true;
+            if (_this.params.page == 1 ) {
+                _this.dataList = [];
+            }
+            if(_this.params.loadHistory<=0){
+                $.showLoading("数据加载中...");
+            }
+
+            $.post('/api/member/getRecommendList', _this.params, function (res) {
+                _this.status.loading = false;
+                _this.loadSlide = false;
                 $.hideLoading();
-                if (res.code == 'success'){
-                    _this.results = res.data
-                }else{
+                if (res.code == 'success') {
+                    if (res.data === true) {
+                        _this.total = 0;
+                        _this.redommended = true;
+                        _this.status.loaded = false;
+                        return false;
+                    }
+
+                    _this.total = res.data.total;
+                    var dataList = res.data.data;
+                    if (dataList.length <= 0 && _this.params.page > 1) {
+                        _this.showMessage('已加载完全部...', 1500)
+                        _this.status.loaded = true;
+                        return false;
+                    }else if(dataList.length <= 0 && _this.params.page <= 1){
+                        sessionStorage.setItem('page', 0);
+                        sessionStorage.setItem('dataList', null);
+                    }else{
+                        sessionStorage.setItem('page', _this.params.page);
+                    }
+
+                    if (more>0) {
+                        $.each(dataList, function (k, item) {
+                            _this.dataList.push(item);
+                        });
+
+                    }else {
+                        _this.dataList = dataList
+                    }
+
+                    sessionStorage.setItem('dataList', JSON.stringify(_this.dataList));
+                    sessionStorage.setItem('total', _this.total);
+                } else {
                     $.toast(res.message, 'text');
                 }
             }, "json");
+        },
+        initSwiper: function(){
+            var _this = this;
+            this.$nextTick(()=>{
+                console.log(65)
+                console.log(_this.dataList)
+                if(_this.swiper || _this.dataList.length<=0){
+                    return false;
+                }
+                console.log(_this.slideIndex+'+dd+')
+                // 单身推荐列表
+                _this.swiper = new Swiper('.hearts', {
+                    loop: false, // 循环模式选项
+                    autoplay: false,
+                    speed: 200,
+                    direction : 'vertical',
+                    initialSlide: _this.slideIndex,// 默认显示
+                    // freeMode : true,//是否滑动
+                    observer: true,//修改swiper自己或子元素时,自动初始化swiper
+                    observeParents: true,//修改swiper的父元素时,自动初始化swiper
+                    slidesPerView: 'auto',
+                    on: {
+                        slideChange:function(event){
+                            if(_this.switchStatus){
+                                return false;
+                            }
+
+                            _this.switchStatus = true;
+                            let count = _this.dataList.length-1
+                            let swipeDirection = typeof(this.swipeDirection) != 'undefined'? this.swipeDirection : '';
+                            if(!swipeDirection){
+                                console.log('未触发'+this.swipeDirection)
+                                _this.switchStatus = false;
+                                return false;
+                            }
+
+                            if(swipeDirection == 'next'){
+                                console.log(_this.total+'++'+count+'++'+_this.slideIndex)
+                                if(this.realIndex >= count || _this.slideIndex>=count){
+                                    if(_this.total >= (_this.params.page+1*_this.params.pageSize) && !_this.loadSlide){
+                                        _this.switchStatus = false;
+                                        _this.loadSlide = true;
+                                        _this.slideIndex++;
+                                        console.log(_this.slideIndex+'+++')
+                                        sessionStorage.setItem('slideIndex', _this.slideIndex);
+                                        sessionStorage.setItem('dataList', null);
+
+                                        _this.params.page++;
+                                        console.log(_this.dataList)
+                                        _this.getDataList(true)
+                                    }
+                                    _this.switchStatus = false;
+                                    return false;
+                                }else if(count>0){
+                                    _this.slideIndex++;
+                                    sessionStorage.setItem('slideIndex', _this.slideIndex);
+                                    this.slideTo(_this.slideIndex)
+                                    _this.switchStatus = false;
+                                }
+                            }else{
+                                if(this.realIndex <=0 || _this.slideIndex<=0){
+                                    _this.slideIndex = 0;
+                                }else{
+                                    _this.slideIndex = _this.slideIndex-1<=0? 0 : _this.slideIndex-1;
+                                }
+                                console.log('记录')
+                                _this.slideIndex = this.realIndex
+                                sessionStorage.setItem('slideIndex', _this.slideIndex);
+                                this.slideTo(_this.slideIndex)
+                                _this.switchStatus = false;
+                            }
+                            console.log('触摸停止');
+                            console.log(this.swipeDirection)
+                        },
+                    },
+                })
+
+                if(_this.slideIndex>0){
+                    _this.swiper.slideTo(_this.slideIndex)
+                }
+            })
+
+            // 懒加载
+            //this.lazyload();
+
+        },
+        // 提示消息
+        showMessage: function(msg, time){
+            $.showLoading(msg);
+            setTimeout(function(){
+                $.hideLoading();
+            }, time)
+        },
+        // 详情主页
+        goDetail: function (id) {
+            location.href = '/weixin/member/home?id=' + id;
+        },
+        // 筛选
+        filterSubmit: function(){
+            var _this = this;
+            _this.params.age = _this.conditions.age = $("#age").attr('data-code');
+            _this.params.height = _this.conditions.height = $("#height").attr('data-code');
+            _this.params.education = _this.conditions.education = $("#education h1.active").attr('data-code');
+            _this.params.married = _this.conditions.married = $("#married h1.active").attr('data-code');
+            _this.params.page = 1;
+            _this.loaded = false;
+            _this.total = 1;
+            _this.slideIndex = 0;
+            _this.showFilterBox = false;
+            sessionStorage.setItem('conditions', JSON.stringify(_this.conditions));
+            _this.getDataList(0);
+        },
+        showAuth: function(data){
+            $.closeModal();
+            var idcard = data.idcard_check==2? 'idcard active' : 'idcard';
+            var position = data.position_check==2? 'position active' : 'position';
+            var education = data.education_check==2? 'education active' : 'education';
+            var vip = data.vip_auth==1? "<img  class='vip' src='/themes/default/weixin/public/assets/img/auth/vip.png'>" : '';
+            $.modal({
+                id: "autnInfo",
+                close: true,
+                title: "认证信息",
+                text: "<div class='authInfo'><span class='close'>x</span><p class='avatar'><img src='"+data.avatar+"' alt=''>"+vip+"</p>" +
+                    "<p class='info'>" +
+                    "<span class='"+idcard+"'><span class='icon'><img src='/themes/default/weixin/public/assets/img/auth/idcard.png' alt=''></span><span>实名</span></span>" +
+                    "<span class='"+position+"'><span class='icon'><img src='/themes/default/weixin/public/assets/img/auth/position.png' alt=''></span><span>工作</span></span>" +
+                    "<span class='"+education+"'><span class='icon'><img src='/themes/default/weixin/public/assets/img/auth/education.png' alt=''></span><span>学历</span></span>" +
+                    "</p>" +
+                    "</div>",
+                buttons: [
+                    {
+                        text: "关闭", className: "default", onClick: function () {
+                            return false;
+                        }
+                    },
+                    {
+                        text: "我也要认证", className: "warning", onClick: function () {
+                            location.href = '/weixin/auth/index/'
+                        }
+                    }
+                ]
+            });
+
+            $(".authInfo .close").click(function(){
+                $.closeModal();
+            })
+        },
+        showFollow: function(){
+            $.modal({
+                id: "follow",
+                title: "长按关注拾光公众号",
+                text: "<div class='follow'><p><img src='/static/images/qrcode.jpg'></p><p>每天免费为你心动匹配1位优质单身</p></div>",
+                buttons: [
+                    {
+                        text: "取消", className: "default", onClick: function () {
+                            return false;
+                        }
+                    }
+                ]
+            });
+        },
+        // 延迟加载
+        lazyload: function(){
+            var _this = this;
+            var num = $(".tuod_ne .thumb").length; //可见区域高度
+            var seeHeight = document.documentElement.clientHeight; //可见区域高度
+            var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; //滚动条距离顶部高度
+            for (var i = _this.loadedCount; i < num; i++) {
+                var _img = $(".tuod_ne .thumb").eq(i);
+                var src = _img.attr('src');
+                var dataSrc = _img.attr('data-src');
+                var offsetTop = _img.offset().top;
+                if (dataSrc && offsetTop < (seeHeight + scrollTop)) {
+                    if ( dataSrc != src) {
+                        _img.attr('src', dataSrc)
+                    }
+                    _this.loadedCount = i + 1;
+                }
+            }
+        },
+        // 初始化分享
+        initShare: function(){
+            var _this = this;
+            var url = 'http://'+document.domain+'/weixin/match/index';
+            var logo = 'http://'+document.domain+'/themes/default/weixin/public/assets/img/logo.jpg';
+            var sid = getParam('sid');
+            if(sid){
+                url = location.href;
+            }
+            $.post('/api/index/getJssdkParams', {url: url}, function (res) {
+                var params = res.data;
+
+                // 微信JSSDK
+                wx.config({
+                    debug: false, // 是否调试模式
+                    appId: params.appId, // 必填,公众号的唯一标识
+                    timestamp: params.timestamp, // 必填,生成签名的时间戳
+                    nonceStr: params.nonceStr, // 必填,生成签名的随机串
+                    signature: params.signature,// 必填,签名
+                    jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData','getLocation','openLocation'] // 必填,需要使用的JS接口列表
+                });
+
+                // 初始化处理
+                wx.ready(function () {
+                    // 获取定位数据
+                    wx.getLocation({
+                        success: function (res) {
+                            $.post('/api/member/getLocationAddress',{type: 2,lat: res.latitude,lng: res.longitude},function(res){
+                                if(res.code == 'success'){
+                                    var location = res.data.location;
+                                    var lat = typeof(location.location.lat)!='undefined'? location.location.lat : 0;
+                                    var lng = typeof(location.location.lng)!='undefined'? location.location.lng : 0;
+                                    if(lat && lng){
+                                        _this.params.lng = lng
+                                        _this.params.lat = lat
+                                        //_this.getDataList(false);
+
+                                    }
+                                }
+                            },'json');
+                        },
+                        cancel: function (res) {
+                            $.toast('用户拒绝了授权位置信息', 'text');
+                        }
+                    });
+
+                    // 好友
+                    wx.updateAppMessageShareData({
+                        title: '每一位真诚走心的单身,都值得被推荐~', // 分享标题
+                        // desc: '邀请你认识Ta', // 分享描述
+                        desc: '汇聚南宁8090后优质单身青年,本硕博及海占比78%,脱单来这里就够了!', // 分享描述
+                        link: location.href+'&sid='+_this.memberInfo.id, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                        imgUrl: logo, // 分享图标
+                        success: function () {
+                        }
+                    });
+                    // 朋友圈
+                    wx.updateTimelineShareData({
+                        title: '每一位真诚走心的单身,都值得被推荐~', // 分享标题
+
+                        link: location.href+'&sid='+_this.memberInfo.id, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                        //desc: '邀请你一起参加这个有趣的活动,每期都有脱单的哦!', // 分享描述
+                        imgUrl: logo, // 分享图标
+                        success: function () {
+                        }
+                    });
+                });
+
+
+            },"json");
         }
     }
 })

+ 1 - 1
public/themes/default/weixin/public/assets/js/privacy.js

@@ -122,7 +122,7 @@ var app = new Vue({
             $.modal({
                 id: "apply",
                 title: "温馨提示",
-                text: title+"注销将清空您的交友账号所有信息及已充值、购买的所有服务权益(包括但不限于爱心、会员权益、认证资料、个人介绍及照片等),且无法恢复,请谨慎操作!如果您只是暂时不再使用,建议您隐身即可。若发现恶意注销再注册推广红娘分享二维码,直接封号处理!",
+                text: '注销将扣除'+_this.memberInfo.logout_pay+'颗爱心,'+title+"注销将清空您的交友账号所有信息及已充值、购买的所有服务权益(包括但不限于爱心、会员权益、认证资料、个人介绍及照片等),且无法恢复,请谨慎操作!如果您只是暂时不再使用,建议您隐身即可。若发现恶意注销再注册推广红娘分享二维码,直接封号处理!",
                 buttons: [
                     {
                         text: "再想想", className: "default", onClick: function () {

+ 3 - 0
vendor/thinkcmf/cmf/src/lang/zh-cn.php

@@ -83,6 +83,9 @@ return [
     '1022'=> '账号已冻结:因用户投诉实锤违规',
     '1023'=> '账号已冻结:因封号拉黑、违规',
 
+    '1124'=> '账号已注销',
+    '1125'=> '注销账号扣除{:pay}颗爱心,当前余额额不足',
+
 
     /* 代码 */
     '2000'=> '手机号码未修改',