Prechádzať zdrojové kódy

Wesmiler 时光单身NN2019120501项目迁移

wesmiler 5 rokov pred
rodič
commit
71d4c43865

+ 7 - 0
app/api/controller/MarketController.php

@@ -291,5 +291,12 @@ class MarketController extends MarketBaseController
         }
     }
 
+    public function getInviteList(){
+        $type = input('type', 1);
+        if (!in_array($type, [1,2])) {
+            showJson(1004, 4010);
+        }
+    }
+
 }
 

+ 11 - 8
app/api/controller/NotifyController.php

@@ -23,10 +23,14 @@ class NotifyController extends Controller
     {
         $this->scene = 'books';
         $postStr = file_get_contents('php://input');
+        $postData =$postStr? json_decode($postStr, true) : [];
+        $outTradeNo = isset($postData['out_trade_no']) ? $postData['out_trade_no'] : '';
+        if(empty($postData) || empty($outTradeNo)){
+            //禁止引用外部xml实体
+            libxml_disable_entity_loader(true);
+            $postData = (array)(simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA));
+        }
 
-        //禁止引用外部xml实体
-        libxml_disable_entity_loader(true);
-        $postData = (array)(simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA));
         $outTradeNo = isset($postData['out_trade_no']) ? $postData['out_trade_no'] : '';
         $taskNo = $outTradeNo ? $outTradeNo : date('YmdHis');
         PRedis::set('payments:'.$this->scene.':result_'.$taskNo, ['result'=> $postData], 7200);
@@ -35,7 +39,7 @@ class NotifyController extends Controller
             $orderInfo = Books::getInfo(['order_sn'=> $outTradeNo]);
 
             // 验证参数
-            PRedis::set('payments:'.$this->scene.':order_'.$taskNo, ['result'=> $postData, 'order'=> $orderInfo], 24*3600);
+            PRedis::set('payments:'.$this->scene.':order_'.$taskNo, ['result'=> $postData, 'order'=> $orderInfo], 7200);
             $orderStatus = isset($orderInfo['status']) ? intval($orderInfo['status']) : 0;
             if (empty($orderInfo)) {
                 Payment::rebackOk();
@@ -44,7 +48,7 @@ class NotifyController extends Controller
 
             // 验证订单状态是否可处理
             if ($orderStatus != 1) {
-                Books::saveData(['order_sn' => $outTradeNo],['remark'=> '支付回调:订单已处理']);
+                Books::saveData(['order_sn' => $outTradeNo],['remark'=> '订单已处理']);
                 Payment::rebackOk();
                 return false;
             }
@@ -55,9 +59,8 @@ class NotifyController extends Controller
             $orderMoney = isset($orderInfo['money']) ? moneyFormat($orderInfo['money']) : 0.00;
             $credit = isset($orderInfo['credit']) ? moneyFormat($orderInfo['credit']) : 0.00;
             $orderAmount = moneyFormat($orderMoney + $credit);
-            if (!$payDebug && $orderAmount * 100 != $payMoney) {
-                Books::saveData(['order_sn' => $outTradeNo],['remark'=> '支付回调:订单支付金额不匹配:实际支付'.$payMoney.'+订单金额'.$orderMoney]);
-                PRedis::set('payments:'.$this->scene.':money_'.$taskNo, ['remark'=> "订单金额错误:\n支付金额:" . $payMoney . "\n订单金额:" . $orderMoney], 7200);
+            if (!$payDebug && intval($orderAmount * 100) != intval($payMoney)) {
+                PRedis::set('payments:'.$this->scene.':money_'.$taskNo, ['remark'=> "订单金额错误:\n支付金额:" . $payMoney . "\n订单金额:" . $orderMoney.'|'.$orderAmount], 7200);
                 return false;
             }
 

+ 9 - 0
app/weixin/controller/MemberController.php

@@ -82,6 +82,15 @@ class MemberController extends BaseController
     }
 
     /**
+     * 怦然心动
+     * @return mixed
+     */
+    public function heartbeat()
+    {
+        return $this->fetch();
+    }
+
+    /**
      * 团队邀请
      * @return mixed
      */

+ 123 - 67
app/weixin/model/Member.php

@@ -89,7 +89,7 @@ class Member extends Model
     {
         $userName = isset($params['mobile']) ? trim($params['mobile']) : '';
         $password = isset($params['password']) ? trim($params['password']) : '';
-        $field = 'id,user_login,sex,agent_type,agent_status,user_nickname,avatar,openid,is_reg_profile,user_pass,user_type,score,balance,user_status';
+        $field = 'id,user_login,sex,user_nickname,avatar,openid,user_pass,user_type,score,balance,user_status';
         $userInfo = Member::where(['user_login' => $userName])->field($field)->find();
         $userPass = isset($userInfo['user_pass']) ? $userInfo['user_pass'] : '';
         $userStatus = isset($userInfo['user_status']) ? intval($userInfo['user_status']) : 0;
@@ -155,7 +155,7 @@ class Member extends Model
      */
     public static function getInfo($where, $field = "")
     {
-        $field = $field ? $field : 'id,openid,user_nickname,user_type,agent_status,agent_type,avatar,user_login,collect_expire,user_status,real_name,redheart,is_reg_profile,mobile,balance,user_status,is_heart,vip_auth,vip_expire,is_follow,freezing_choose';
+        $field = $field ? $field : 'id,openid,user_nickname,user_type,avatar,user_login,collect_expire,user_status,real_name,redheart,is_reg_profile,mobile,balance,user_status,is_heart,vip_auth,vip_expire,is_follow,freezing_choose';
         $info = self::where($where)->field($field)->order('user_status desc,id desc')->find();
         return $info ? $info->toArray() : [];
     }
@@ -409,62 +409,6 @@ class Member extends Model
     }
 
     /**
-     * 余额明细
-     * @param $params
-     * @param int $pageSize
-     * @return mixed
-     */
-    public static function getBalanceLog($params, $pageSize = 15)
-    {
-        $where = [];
-        $userId = isset($params['user_id']) ? $params['user_id'] : 0;
-        if ($userId) {
-            $where['b.user_id'] = $userId;
-        }
-        $changeType = isset($params['change_type']) ? $params['change_type'] : 0;
-        if ($changeType) {
-            $where['b.change_type'] = $changeType;
-        }
-        $type = isset($params['type']) ? $params['type'] : 0;
-        $model = db('user_balance_log')->alias('b')
-            ->leftJoin('user u','u.id=b.source_uid')
-            ->where($where)
-            ->where(function($query) use ($type){
-                if($type == 'income'){
-                    $query->where('b.type', '>', 1);
-                } else if ($type){
-                    $type = is_array($type)? $type : [$type];
-                    $query->whereIn('b.type', $type);
-                }
-            });
-
-        $types = config('weixin.incomeTypes');
-        $dataList = $model->field('b.id,b.type,b.order_sn,b.change as money,b.change_type,b.balance,b.remark,b.description,b.create_time,status,u.user_nickname')
-            ->where('b.status', 'lt', 4)
-            ->order("b.create_time desc")
-            ->paginate($pageSize)
-            ->each(function ($item, $k) use($types){
-                $item['format_time'] = $item['create_time']? date('Y年m月d日 H点i分', $item['create_time']) : '';
-                $item['money'] = floatval($item['money']);
-
-                $type = isset($item['type'])? $item['type'] : 0;
-                $item['typeName'] = isset($types[$type])? $types[$type] : '';
-                return $item;
-            });
-
-        $dataList = $dataList ? $dataList->toArray() : [];
-        if($dataList){
-            $total = $model->where('b.status',2)->sum('b.change');
-            $dataList['total_money'] = moneyFormat($total);
-            $total = $model->where('b.status',1)->sum('b.change');
-            $dataList['nopay_money'] = moneyFormat($total);
-        }
-
-        return $dataList;
-    }
-
-
-    /**
      * 推荐用户
      * @param $params 参数
      * @param $page   分页
@@ -481,7 +425,7 @@ class Member extends Model
             return $dataList;
         }
 
-        $where = ['m.is_tuijian' => 1,'m.is_heart'=> 1, 'm.is_reg_profile' => 1, 'm.user_status' => 1, 'm.user_type' => 2];
+        $where = ['m.is_tuijian' => 1,'is_heart'=> 1, 'm.is_reg_profile' => 1, 'm.user_status' => 1, 'm.user_type' => 2];
 
         // 匹配当前用户信息:性别
         $sex = 0;
@@ -662,8 +606,8 @@ class Member extends Model
             $hasMatchData = Predis::get("hearts:hasMeatch:{$userId}");
             $ids = isset($hasMatchData['ids'])? $hasMatchData['ids'] : '';
             $ids = $ids? explode(',', $ids) : [];
-            $expire = isset($hasMatchData['expire'])? $hasMatchData['expire'] : 0;
-            if(time() > $expire || !$isVip){
+            $hasExpire = isset($hasMatchData['expire'])? $hasMatchData['expire'] : 0;
+            if(time() > $hasExpire || !$isVip){
                 $ids = [];
             }
 
@@ -798,6 +742,118 @@ class Member extends Model
                 ->column('m.id');
 
             PRedis::set('hearts:query:' . $userId, Member::getLastSql(), 6 * 3600);
+            if(empty($recommendIds)){
+                $recommendIds = Member::alias('m')
+                    ->join('user_profile up', 'up.userid=m.id', 'left')
+                    ->where($where)
+                    ->where(function ($query) use ($sex) {
+                        return $query->where('m.sex', 'in', [0, $sex]);
+                    })
+                    ->where(function ($query) use ($ids) {
+                        // 过滤一星期内已经推荐过的
+                        if($ids){
+                            return $query->where('m.id', 'not in', $ids);
+                        }else{
+                            return $query->where('m.id', '>', 0);
+                        }
+                    })
+                    ->where(function ($query) use ($conditions, $memberInfo, $ageGap) {
+                        $querys = $query;
+                        // 年龄
+                        /*$age = isset($memberInfo['age']) ? intval($memberInfo['age']) : 0;
+                        $cage = isset($conditions['age']) ? intval($conditions['age']) : 0;
+                        if ($cage) {
+                            $dataArr = config('weixin.ages');
+                            $datas = isset($dataArr[$cage]) ? $dataArr[$cage] : [];
+                            $data1 = isset($datas['value1']) ? $datas['value1'] : 0;
+                            $data2 = isset($datas['value2']) ? $datas['value2'] : 0;
+                            if ($data2) {
+                                $querys = $querys->where('up.age', '>=', $data1)->where('up.age', '<=', $data2);
+                            } else if ($data1) {
+                                $querys = $querys->where('up.age', '>=', $data1);
+                            }
+                        } else if ($age && $ageGap) {
+                            $querys = $querys->where('up.age', '>=', ($age - $ageGap))->where('up.age', '<=', ($age + $ageGap));
+                        }*/
+
+                        // 年龄
+                        $year = isset($conditions['year']) ? trim($conditions['year']) : '';
+                        if ($year) {
+                            $year = explode('~', $year);
+                            $data1 = isset($year[0]) ? intval($year[0]) : 0;
+                            $data2 = isset($year[1]) ? intval($year[1]) : 0;
+                            if ($data2) {
+                                $data1 = $data1 ? strtotime($data1 . '-01-01') : 0;
+                                $data2 = $data2 ? strtotime(($data2 + 1) . '-01-01') : 0;
+                                $querys = $querys->where('m.birthday', '>=', $data1 . '')->where('m.birthday', '<=', $data2);
+                            } else if ($data1) {
+                                $data1 = $data1 ? strtotime($data1 . '-01-01') : 0;
+                                $querys = $querys->where('m.birthday', '>=', $data1);
+                            }
+                        }
+
+                        // 身高
+                        $height = isset($conditions['height']) ? trim($conditions['height']) : '';
+                        if ($height) {
+                            $height = explode('~', $height);
+                            $data1 = isset($height[0]) ? intval($height[0]) : 0;
+                            $data2 = isset($height[1]) ? intval($height[1]) : 0;
+                            if ($data2) {
+                                $querys = $querys->where('up.height', '>=', $data1)->where('up.height', '<=', $data2);
+                            } else if ($data1) {
+                                $querys = $querys->where('up.height', '>=', $data1);
+                            }
+                        }
+
+                        // 收入
+                        $salary = isset($conditions['salary']) ? intval($conditions['salary']) : 0;
+                        if ($height<=0 && $salary) {
+                            $dataArr = config('weixin.salarys');
+                            $datas = isset($dataArr[$salary]) ? $dataArr[$salary] : [];
+                            $data1 = isset($datas['value']) ? $datas['value'] : 0;
+                            $data2 = isset($datas['value2']) ? $datas['value2'] : 0;
+                            if ($data2) {
+                                $querys = $querys->where('up.salary', '>=', $data1)->where('up.salary', '<=', $data2);
+                            } else if ($data1) {
+                                $querys = $querys->where('up.salary', '=', $data1);
+                            }
+                        }
+
+                        // 所在城市
+                        $city = isset($memberInfo['city']) ? trim($memberInfo['city']) : '';
+                        $cityValue = isset($conditions['city']) ? trim($conditions['city']) : '';
+                        if ($cityValue > 0 && $city) {
+                            $querys = $querys->where('up.city', '=', $city);
+                        }
+
+
+                        // 婚姻状态
+                        $married = isset($conditions['married']) ? intval($conditions['married']) : 0;
+                        if ($married > 0) {
+                            $querys = $querys->where('up.married', '>=', $married);
+                        }
+
+                        // 学历
+                        $education = isset($conditions['education']) ? intval($conditions['education']) : 0;
+                        if ($education > 0) {
+                            if($married >0 && $education==3){
+                                $querys = $querys->where('up.education', '>=', 1);
+                            }else if($married <=0){
+                                //  硕士及以上或按学历匹配
+                                $op = $education == 3 ? '>=' : '=';
+                                $querys = $querys->where('up.education', $op, $education);
+                            }
+
+                        }
+
+                        return $querys;
+                    })
+                    ->orderRaw('rand()')
+                    ->limit($recommendNum)
+                    ->column('m.id');
+            }
+
+
             if ($recommendIds) {
                 // 更新推荐日期
                 Member::where(['id' => $userId])->update(['heart_recommend_at' => date('Y-m-d H:i:s')]);
@@ -871,9 +927,9 @@ class Member extends Model
             if($updated && $recommendIds){
                 if($ids){
                     $newIds = array_merge($ids, $recommendIds);
-                    Predis::set("hearts:hasMeatch:{$userId}", ['ids'=>implode(',', $newIds), 'expire'=> $expire], 7*24*3600);
+                    Predis::set("hearts:hasMeatch:{$userId}", ['ids'=>implode(',', $newIds), 'expire'=> $hasExpire], 3*24*3600);
                 }else{
-                    Predis::set("hearts:hasMeatch:{$userId}", ['ids'=>implode(',', $recommendIds), 'expire'=> time()+7*24*3600], 7*24*3600);
+                    Predis::set("hearts:hasMeatch:{$userId}", ['ids'=>implode(',', $recommendIds), 'expire'=> time()+3*24*3600], 3*24*3600);
                 }
             }
 
@@ -979,13 +1035,13 @@ class Member extends Model
                 $collectTime = isset($siteInfo['collect_time']) ? intval($siteInfo['collect_time']) : 0;
                 $collectTime = $collectTime ? $collectTime : 6;
                 Member::saveData(['id' => $userId], ['collect_expire' => time() + $collectTime * 3600]);
-                
+
                 $memberInfo = Member::where(['id'=> $userId])->field('collect_expire,vip_auth,vip_expire')->find();
-        $vipAuth = isset($memberInfo['vip_auth']) ? intval($memberInfo['vip_auth']) : 0;
-        $vipExpire = isset($memberInfo['vip_expire']) ? $memberInfo['vip_expire'] : 0;
+                $vipAuth = isset($memberInfo['vip_auth']) ? intval($memberInfo['vip_auth']) : 0;
+                $vipExpire = isset($memberInfo['vip_expire']) ? $memberInfo['vip_expire'] : 0;
                 if(!$vipAuth || $vipExpire < time()){
                     UserCollect::where(['user_id' => $userId])
-                      ->update(['status' => 2, 'updated_at' => date('Y-m-d H:i:s')]);
+                        ->update(['status' => 2, 'updated_at' => date('Y-m-d H:i:s')]);
                 }
             }
 

+ 29 - 14
public/themes/default/weixin/market/team.html

@@ -1,25 +1,31 @@
 <include file="weixin@block:header"/>
 <!--<title>我的团队</title>-->
-<link rel="stylesheet" href="__TMPL__/weixin/public/assets/css/member-activity.css?v={$version}">
+<link rel="stylesheet" href="__TMPL__/weixin/public/assets/css/team.css?v={$version}">
 <div id="app" v-cloak>
     <div class="fanhui2"><h1>我的团队</h1>
         <a href="/weixin/member/index"><img src="__TMPL__/weixin/public/assets/img/tubiao37.png"></a>
     </div>
     <div class="huxian">
         <ul>
-            <li class="active">我的成员</li>
-            <li>团队成员</li>
+            <li class="active">团队成员</li>
             <li>粉丝会员</li>
         </ul>
     </div>
     <div class="main">
-        <div class="invite">
+        <div class="invite" v-if="params.type==1">
             <div class="yaoqrk">
-                <a href="/weixin/market/invite"><h2>立即分享邀请扩充您的团队获得更多收益</h2><img  src="__TMPL__/weixin/public/assets/img/tubiao42.png"></a>
+                <p>通过我的团队邀请码注册成为我的下属分销会员的用户,累计推广团队成员:<span>0</span>人,<a href="/weixin/market/team_invite">邀请更多成员</a></p>
+
+            </div>
+        </div>
+        <div class="invite" v-if="params.type==2">
+            <div class="yaoqrk">
+                <p>通过我的推广邀请码注册成为普通会员的用户,累计推广男会员:<span>0</span>人,女会员:<span>0</span>人,vip会员:<span>0</span>人,<a :href="'/weixin/market/invite?sid='+memberInfo.id">邀请更多会员</a></p>
+
             </div>
         </div>
         <div class="huodo_lb">
-            <ul>
+            <ul v-if="params.type==1">
                 <li v-if="dataList.length<=0" class="empty"><span>暂无数据</span></li>
                 <li v-else v-for="(item,k) in dataList">
                     <div class="biaot" @click="detail(item.id)">
@@ -28,22 +34,31 @@
                             <span v-if="item.is_signin == 1">待参加</span>
                             <span v-else-if="item.is_signin == 2">已签到</span>
                         </div>
-                        <!--<div class="tomin" v-if="item.book_num">
-                            <img v-for="(val,kk) in item.book_list" :src="val.avatar" onerror="this.src='__TMPL__/weixin/public/assets/img/tubiao7.png'">
-                            <p>等<span v-text="item.book_num"></span>人已报名</p>
+                    </div>
+                    <h1 v-text="item.title"></h1>
+                    <div class="hdbt"><img src="/themes/default/weixin/public/assets/img/tubiao41.png"><p>{{item.start_at}} 至 {{item.end_at}}</p></div>
+                    <div class="hdbt"><img src="__TMPL__/weixin/public/assets/img/tubiao40.png"><p v-text="item.address? item.address : '暂无'"></p></div>
+                </li>
+                <li v-if="status.loaded && dataList.length>0" class="loaded"><span>已加载完全部</span></li>
+            </ul>
+            <ul v-if="params.type==2">
+                <li v-if="dataList.length<=0" class="empty"><span>暂无数据</span></li>
+                <li v-else v-for="(item,k) in dataList">
+                    <div class="biaot" @click="detail(item.id)">
+                        <img class="hdzut" :src="item.thumb" onerror="this.src='__TMPL__/weixin/public/assets/img/no-pic.png'">
+                        <div :class="item.is_signin==1? 'zhuangt status1':'zhuangt status2'">
+                            <span v-if="item.is_signin == 1">待参加</span>
+                            <span v-else-if="item.is_signin == 2">已签到</span>
                         </div>
-                        <div v-else class="tomin">
-                            <p>暂无报名</p>
-                        </div>-->
                     </div>
                     <h1 v-text="item.title"></h1>
                     <div class="hdbt"><img src="/themes/default/weixin/public/assets/img/tubiao41.png"><p>{{item.start_at}} 至 {{item.end_at}}</p></div>
                     <div class="hdbt"><img src="__TMPL__/weixin/public/assets/img/tubiao40.png"><p v-text="item.address? item.address : '暂无'"></p></div>
                 </li>
-                <li v-if="status.loaded" class="loaded"><span>已加载完全部</span></li>
+                <li v-if="status.loaded && dataList.length>0" class="loaded"><span>已加载完全部</span></li>
             </ul>
         </div>
     </div>
 </div>
-<script src="__TMPL__/weixin/public/assets/js/member-activity.js?v={$version}"></script>
+<script src="__TMPL__/weixin/public/assets/js/team.js?v={$version}"></script>
 <include file="weixin@block:footer"/>

+ 39 - 0
public/themes/default/weixin/market/team_invite.html

@@ -0,0 +1,39 @@
+<include file="weixin@block:header"/>
+<!--<title>我的爱心</title>-->
+<link rel="stylesheet" href="__TMPL__/weixin/public/assets/css/team-invite.css?v={$version}">
+<div id="app" v-cloak v-if="memberInfo.id">
+    <div class="main" >
+        <div class="fanhui2" >
+            <a class="back" href="/weixin/market/index"><img src="__TMPL__/weixin/public/assets/img/back.png"></a>
+            <a class="close" @click="showAlbum=false"><img src="__TMPL__/weixin/public/assets/img/close.png"></a>
+        </div>
+        <div id="share" class="share">
+            <div class="box">
+                <div id="invite" class="content" >
+                    <div class="invite-box album-box">
+                        <img class="bg" :src="albumInfo.url"/>
+                        <div :class="'text-box template-'+albumInfo.type">
+                            <div class="hiden"></div>
+                            <div class="text">
+                                <div id="qrcode" class="qrcode">
+                                    <p class="img">
+                                        <img :src="memberInfo.qrcode" >
+                                    </p>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div id="shareImg" class="shareImg" v-show="showAlbum">
+                    <img class="album" src="" alt="">
+                </div>
+            </div>
+        </div>
+        <div class="actions">
+            <span>生成分销海报</span>
+        </div>
+    </div>
+</div>
+<script src="__TMPL__/weixin/public/assets/lib/html2canvas.min.js?v={$version}"></script>
+<script src="__TMPL__/weixin/public/assets/js/team-invite.js?v={$version}"></script>
+<include file="weixin@block:footer"/>

+ 1 - 1
public/themes/default/weixin/public/assets/css/market-invite.css

@@ -236,7 +236,7 @@ head{width: 100%;height: 100%;overflow: hidden;}
 }
 
 .album-box .template-3 .qrcode img {
-    top: 29.5rem;
+    bottom: 2.5rem;
     margin: 0;
     width: 3.75rem;
     height: 3.75rem;

+ 347 - 0
public/themes/default/weixin/public/assets/css/team-invite.css

@@ -0,0 +1,347 @@
+html{height: 100%}
+body{background: #fff;overflow: hidden;}
+head{width: 100%;height: 100%;overflow: hidden;}
+.fanhui2 {
+    position: relative;
+    background: none;
+}
+.fanhui2 a {
+    overflow: hidden;
+    display: block;
+    height: 100%;
+}
+.fanhui2 img {
+    top: 10px;
+    left: 10px;
+    width: 36px;
+}
+
+.fanhui2 .close img {
+    top: 12px;
+    left: auto;
+    width: 32px;
+    right: 10px;
+}
+.main {
+    margin: 0;
+    height: 100%;
+    overflow: hidden;
+}
+.aix_box{width: 100%;height: 310px;overflow: hidden;background: #efefef;}
+.aix_box img{width: 100%;display: block;height: 180px;border-radius: 0 0 10px 10px;}
+
+.aix_nr{margin:0 15px;background: #fff;border-radius: 6px;margin-top: -280px;position: relative;padding-bottom: 8px;}
+
+.aix_cz{overflow: hidden;height: 40px;border-bottom: 1px solid #ffcb18;margin:0 15px;padding:15px 0;}
+.aix_cz img{width: 40px;margin-top:5px;float: left;}
+.aix_cz h1{font-weight: bold;color:#ffcb18;margin-left: 20px;float: left;font-size: 26px;line-height: 40px;}
+.aix_cz h2{font-size: 14px;background: #ffcb18;float: right;padding: 6px 10px;border-radius: 4px;margin-top: 6px;}
+
+.aix_nr ul{margin-top: 10px;overflow: hidden;}
+.aix_nr li{overflow: hidden;height: 40px;padding: 0 15px;}
+.aix_nr li h1{font-size: 16px;color: #666;line-height: 40px;float: left;}
+.aix_nr li h1 b{color:#f2447d;font-size: 20px;margin-left: 4px;}
+.aix_nr li h2{padding: 4px 10px;border-radius: 4px;color: #ffcb18;border: 1px solid #ffcb18;font-size: 14px;float: right;margin-top: 5px;}
+.aix_nr h2 a {
+    color: #333;
+}
+.aix_nr ul h2 a {
+    color: #ffcb18;
+}
+
+.share {
+    position: fixed;
+    width: 100%;
+    top: 0;
+    height: 100%;
+    background: rgba(145, 143, 143, .6);
+    z-index: 96;
+    overflow: hidden;
+    /*display: none;*/
+}
+
+.share .box {
+    background: #fff;
+    border-radius: 2px;
+    height: 100%;
+}
+
+.share .content {
+    width: 100%;
+    height: 100%;
+    position: relative;
+}
+
+.share .content img {
+    /*width: 100%;*/
+}
+
+.share .tips {
+    margin-top: 10px;
+    text-align: center;
+}
+.share .btn {
+    margin: 10px auto;
+    width: 100%;
+    text-align: center;
+    padding-bottom: 10px;
+}
+
+.share .btn a {
+    background: #ffd132;
+    padding: 6px 20px;
+    border-radius: 2px;
+    color: #fff;
+}
+
+.invite {
+    position: fixed;
+    width: 100%;
+    top: 0;
+    z-index: 8;
+    overflow: hidden;
+    overflow-y: scroll;
+    display: none;
+}
+
+.invite-box {
+    margin: 0 auto;
+    text-align: center;
+    /*margin-top: 40px;*/
+    height: 100%;
+    background: #fff;
+    border-radius: 2px;
+    position: absolute;
+    width: 100%;
+    top: 0;
+    left: 0;
+}
+.invite-box .bg {
+    width: 100%;
+    position: absolute;
+    left: 0;
+    top: 0;
+    height: 100%;
+    z-index: 2;
+}
+.text-box {
+    top: 0;
+    position: absolute;
+    width: 100%;
+    z-index: 10;
+    left: 0;
+    height: 100%;
+}
+/*.avatar {
+    padding-top: 30px;
+    margin-bottom: 10px;
+}*/
+.share .content .avatar img {
+    width: 4.5rem;
+    height: 4.5rem;
+    border-radius: 100%;
+    border: 1px solid #ccc;
+    background: #fff;
+    margin-top: .5rem;
+    /*margin-top: .75rem;*/
+}
+.text .item {
+    margin-bottom: .5rem;
+    font-size: .635rem;
+}
+
+.text .qrcode {
+    /*margin: 10px auto;*/
+    margin-bottom: .5rem;
+}
+.text .qrcode p {
+    font-size: .635rem;
+}
+.text .qrcode img {
+    width: 8rem;
+    height: 8rem;
+    margin-top: 1rem;
+}
+
+.link a {
+    margin: 0 5px;
+}
+
+.shareImg {
+    width: 82%;
+    position: fixed;
+    z-index: 99;
+    background-color: #5a574a4f;
+    margin: auto;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    height: 82%;
+    padding: 2%;
+}
+
+.shareImg .album {
+    width: 100%;
+    height: 100%;
+}
+
+.shareImg .close {
+    width: 30px;
+    height: 30px;
+    position: absolute;
+    top: -20px;
+    right: -20px;
+}
+
+.erweim_box{width: 100%;background: #fff;margin-top: 10px;text-align: center;}
+.erweim_box img{width: 50%;margin-top: 30px;}
+.jiaj{font-size: 20px;color: #333;margin: auto;background:#ffcb18;border-radius: 4px; width: 160px;line-height: 42px;margin-top:15px;}
+
+
+.tanc{width: 100%;height: 100%; background-color: rgba(39, 39, 39, 0.8);position: fixed;top: 0; z-index: 998;}
+.tanc img{width: 100%;display: block;overflow: hidden;}
+.album-box .hiden {
+    width: 100%;
+    height: calc(100% - 6rem);
+}
+.album-box .text-box .qrcode {
+    /*width: 6rem;*/
+    position: relative;
+    height: 6rem;
+    margin: 0;
+}
+.album-box .text-box .qrcode .img {
+    height: 100%;
+    width: 100%;
+}
+.album-box .text-box .qrcode img {
+    position: absolute;
+    width: 6rem;
+    margin: 0 auto;
+    height: 6rem;
+}
+
+.album-box .template-1 .qrcode img {
+    bottom: 0.25rem;
+    margin: 0;
+    right: 2rem;
+}
+
+.album-box .template-2 .qrcode img {
+    bottom: 0.5rem;
+    margin: auto;
+    right: 0;
+    left: 0;
+}
+
+.album-box .template-3 .qrcode img {
+    top: 29.5rem;
+    margin: 0;
+    width: 3.75rem;
+    height: 3.75rem;
+    right: 0.75rem;
+}
+
+
+.actions {
+    width: 100%;
+    bottom: 10px;
+    position: absolute;
+    height: 100%;
+    z-index: 97;
+}
+
+.actions span {
+    min-width: 100px;
+    display: inline-block;
+    padding: 2px 4px;
+    text-align: center;
+    border-radius: 4px;
+    background-color: #f1c21f;
+    color: #fff;
+    margin: 0 auto;
+}
+.actions .switch {
+    border-top-left-radius: 0;
+    border-bottom-left-radius: 0;
+    left: 0;
+}
+.actions .make {
+    border-top-right-radius: 0;
+    border-bottom-right-radius: 0;
+    right: 0;
+}
+
+
+.template {
+    position: absolute;
+    bottom: 0;
+    width: 100%;
+    background-color: #ffd132;
+    z-index: 100;
+    height: 156px;
+    border-top: 3px solid #e62977;
+    padding: 6px 0;
+}
+.template .title {
+    height: 36px;
+    line-height: 36px;
+    text-align: center;
+}
+.template .title span {
+    display: inline-block;
+    float: right;
+    margin-right: 8px;
+    background: #0bb20c;
+    color: #fff;
+    text-align: center;
+    border-radius: 4px;
+    padding: 2px 4px;
+    height: 24px;
+    line-height: 24px;
+}
+.template .bgs {
+    height: 120px;
+}
+.template .bgs span {
+    display: inline-block;
+    margin-right: 3%;
+    height: 100%;
+    position: relative;
+}
+
+.template .bgs span:first-child {
+    margin-left: 3%;
+}
+
+.template .bgs span .icon {
+    display: block;
+    width: 30px;
+    height: 30px;
+    position: absolute;
+    top: 6px;
+    left: 6px;
+    background: #fff;
+    border-radius: 100%;
+}
+
+.template .bgs span .bg {
+    display: block;
+    width: 100%;
+    height: 100%;
+}
+
+@media screen and (max-width:325px){
+    .album-box .template-1 .qrcode img {
+        width: 100px;
+        height: 100px;
+        bottom: 5px;
+    }
+
+    .album-box .template-3 .qrcode img {
+        width: 55px;
+        height: 55px;
+        bottom: 45px;
+    }
+}

+ 115 - 0
public/themes/default/weixin/public/assets/css/team.css

@@ -0,0 +1,115 @@
+.huxian{background: #fff;height: 45px;margin-top: 40px;position: fixed;z-index: 9999;width: 100%;}
+.huxian ul{padding: 0 15px;overflow: hidden;}
+.huxian li{font-size: 16px;color: #333;float: left;overflow: hidden;width: 49.8%;text-align: center;line-height: 43px;}
+.huxian li.active {
+    color: #ffd132;
+}
+
+.invite {
+    width: 100%;
+    position: relative;
+    top: 50px;
+    font-size: 14px;
+    text-align: left;
+}
+.invite .yaoqrk {
+    height: 36px;
+    line-height: 36px;
+    margin: 0 10px;
+    display: block;
+}
+.invite .yaoqrk a {
+    width: 100%;
+    color: #ffd132;
+    text-decoration: underline;
+}
+
+/*	会员列表*/
+.fanhui2{position: fixed;top: 0;width: 100%;padding: 0;z-index: 9999;}
+.fanhui2 img{margin-left: 15px;}
+
+.huodo_lb{padding: 0 15px;margin-bottom: 20px;overflow: hidden;margin-top:90px;}
+.huodo_lb li{
+    overflow: hidden;
+    width: 100%;
+    margin-top: 15px;
+    background: #fff;
+    display: block;
+    border-radius: 6px;
+}
+
+.biaot{
+    width: 100%;
+    height: 160px;
+    overflow: hidden;
+    position: relative;
+    border-bottom: 1px solid #ccc;
+    background: #fff;
+}
+.hdzut{width: 100%;display: block;height: 100%;opacity: 0.8;}
+.zhuangt{position: absolute;top: 10px;right: 0;background:#e62977;padding:4px 8px 4px  14px;font-size: 12px;color: #fff;border-radius: 20px 0 0 20px;}
+.tomin{width: 100%;height: 34px;position: absolute;bottom: 0;}
+.tomin img{width: 22px;height: 22px;float: left;overflow: hidden;border-radius: 50%;border: 1px solid #fff;margin-left:6px;}
+
+.tomin p{font-size: 14px;color: #fff;line-height: 24px;margin-left:10px;float: left;}
+
+.hdbt{width:100%;overflow: hidden;}
+.hdbt img{
+    width: 20px;
+    height: 20px;
+    float: left;
+    margin-top: 8px;
+    margin-left: 4px;
+}
+.hdbt p{
+    font-size: 14px;
+    line-height: 36px;
+    color: #999;
+    margin-left: 4px;
+    float: left;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 1;
+    overflow: hidden;
+    max-width: 80%;
+}
+
+.huodo_lb li h1{
+    width: 95%;
+    font-size: 16px;
+    line-height: 36px;
+    color: #333;
+    font-weight: bold;
+    word-break: break-all;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 1;
+    overflow: hidden;
+    margin-left: 4px;
+}
+
+.huodo_lb li.loaded {
+    background: none;
+}
+
+.huodo_lb li.empty {
+    background: none;
+}
+
+
+
+.huodo_lb .status0 {
+    /*background: #d4d4d4;*/
+    background: #ffd132;
+}
+
+.huodo_lb .status1 {
+    background: #e62977;
+}
+
+.huodo_lb .status2 {
+    /*background: #ffd132;*/
+    background: #d4d4d4;
+}

+ 1 - 1
public/themes/default/weixin/public/assets/js/market-invite.js

@@ -117,7 +117,7 @@ var app = new Vue({
 
                 // 微信JSSDK
                 wx.config({
-                    debug: true, // 是否调试模式
+                    debug: false, // 是否调试模式
                     appId: params.appId, // 必填,公众号的唯一标识
                     timestamp: params.timestamp, // 必填,生成签名的时间戳
                     nonceStr: params.nonceStr, // 必填,生成签名的随机串

+ 159 - 0
public/themes/default/weixin/public/assets/js/team-invite.js

@@ -0,0 +1,159 @@
+var app = new Vue({
+    'el': '#app',
+    'data': {
+        // 当前导航
+        curNav: 'member',
+        // 用户信息
+        memberInfo: {},
+        // 网站信息
+        siteInfo: {},
+        // 加载图片
+        loadimg1: false,
+        loadimg2: false,
+        confirmIcon:{
+            no: '/themes/default/weixin/public/assets/img/confirm_no.png',
+            yes: '/themes/default/weixin/public/assets/img/confirm_yes.png',
+        },
+        albumInfo: {id: 1, url: '/themes/default/weixin/public/assets/img/album_bg/bg1.jpg', type: 1},
+        bgList: [
+            {id: 1, url: '/themes/default/weixin/public/assets/img/album_bg/bg1.jpg', type: 1},
+            {id: 2, url: '/themes/default/weixin/public/assets/img/album_bg/bg2.jpg', type: 2},
+            {id: 3, url: '/themes/default/weixin/public/assets/img/album_bg/bg3.jpg', type: 3},
+        ],
+        macked: false,
+        showAlbum: false,
+        showTemplate: false,
+        timerId: null,
+        count: 0,
+    },
+    created: function () {
+        var _this = this;
+        var sid = getParam('sid')
+        sid = typeof(sid) != 'undefined'? sid : 0;
+        _this.getSiteInfo();
+        _this.getInfo(sid);
+
+    },
+    methods: {
+        // 获取用户信息
+        getSiteInfo: function () {
+            var _this = this;
+            $.post('/api/index/getSiteInfo', {}, function (res) {
+                if (res.code == 'success') {
+                    _this.siteInfo = res.data
+                } else {
+                    $.toast(res.message, 'text');
+                }
+            }, "json");
+        },
+        // 获取用户信息
+        getInfo: function (sid) {
+            var _this = this;
+            $.showLoading("数据加载中...");
+            $.post('/api/market/getInfo', {type: 2, id: sid}, function (res) {
+                $.hideLoading();
+                if (res.code == 'success') {
+                    if(res.data.id<=0 || typeof(res.data.id) == 'undefined'){
+                        $.showLoading('参数错误,用户不存在', 'text');
+                        setTimeout(function () {
+                            location.href = '/weixin/market/index';
+                        }, 1000)
+                        return false;
+                    }
+
+                    _this.memberInfo = res.data
+                    _this.memberInfo.qrcode = _this.memberInfo.qrcode? _this.memberInfo.qrcode : '/themes/default/weixin/public/assets/img/qrcode.jpg'
+                    _this.initShare()
+                } else {
+                    $.toast(res.message, 'text');
+                }
+            }, "json");
+        },
+        // 切换选择模板
+        switchTemplate: function(){
+            this.showAlbum = false
+            this.showTemplate = this.showTemplate? false : true
+            console.log(this.showAlbum+"++")
+        },
+        // 选择背景模板
+        switchBg: function(data){
+            this.albumInfo = data
+        },
+        // 合成海报
+        makeAlbum: function () {
+            var _this = this;
+            _this.showTemplate = false;
+            $.showLoading('图片合成中');
+            $("body").css('overflow','hidden');
+            var $shareImg = document.getElementById('invite');
+            setTimeout(function(){
+            	//window.pageYOffset = 0;
+			    document.documentElement.scrollTop = 0
+			    document.body.scrollTop = 0
+                html2canvas($shareImg,{useCORS: true}).then(function (canvas) {
+                    $.hideLoading();
+                    const context = canvas.getContext('2d');
+                    var src = canvas.toDataURL('image/jpeg');
+                    $("#shareImg .album").attr("src", src);
+                    _this.showAlbum = true;
+                    _this.maked = true;
+                    $.showLoading('图片合成成功,长按保存或分享给Ta');
+                    setTimeout(function (){
+                        $.hideLoading();
+                    }, 1500)
+                });
+            }, 500)
+
+        },
+        // 初始化分享
+        initShare: function(){
+            var _this = this;
+            var url = location.href;
+            var patt = /sid\=[0-9]+/
+            url = patt.test(url)? url : url+'sid='+_this.memberInfo.id;
+            var logo = 'http://'+document.domain+'/themes/default/weixin/public/assets/img/logo.jpg';
+            $.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'] // 必填,需要使用的JS接口列表
+                });
+
+                // 初始化处理
+                wx.ready(function () {
+                    // 好友
+                    wx.updateAppMessageShareData({
+                        title: _this.memberInfo.user_nickname+'邀请您加入南宁拾光婚恋', // 分享标题
+                        // desc: '邀请你认识Ta', // 分享描述
+                        desc: '汇聚南宁8090后优质单身青年,本硕博及海占比78%,脱单来这里就够了!', // 分享描述
+                        link: url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                        imgUrl: logo, // 分享图标
+                        success: function () {
+                        }
+                    });
+                    // 朋友圈
+                    wx.updateTimelineShareData({
+                        title: '汇聚南宁8090后优质单身青年,本硕博及海占比78%,脱单来这里就够了!', // 分享标题
+
+                        link: url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                        //desc: '邀请你一起参加这个有趣的活动,每期都有脱单的哦!', // 分享描述
+                        imgUrl: logo, // 分享图标
+                        success: function () {
+                        }
+                    });
+                });
+
+
+            },"json");
+        }
+    },
+    watch: {
+
+    }
+})

+ 120 - 0
public/themes/default/weixin/public/assets/js/team.js

@@ -0,0 +1,120 @@
+var app = new Vue({
+    'el': '#app',
+    'data': {
+        // 数据请求参数
+        params: {
+            page: 1,
+            pageSize: 12,
+            type: 1,
+        },
+        // 数据列表
+        dataList: [],
+        // 用户信息
+        memberInfo: {},
+        // 加载状态
+        status: {
+            locading: false,
+            loaded: false,
+        },
+    },
+    created: function(){
+        this.getMemberInfo();
+        this.getDataList(false);
+    },
+    // 渲染数据
+    mounted: function(){
+        var _this = this;
+        // 分类导航切换
+        $(".huxian li").click(function(){
+            var type = $(this).index()+1;
+            $(this).addClass('active').siblings().removeClass('active');
+            _this.params.page = 1;
+            _this.params.type = type;
+            _this.status.loaded = false;
+            _this.dataList = [];
+            _this.getDataList(false);
+        });
+
+        // 滚动加载更多
+        $(window).scroll(function(){
+            var scrollHeight = $(this).scrollTop();
+            var height = $('body')[0].scrollHeight;
+            var docHeight = $(this).outerHeight();
+            if(docHeight+scrollHeight >= height){
+                if(_this.status.loading || _this.status.loaded){
+                    return false;
+                }
+                _this.params.page++;
+                _this.getDataList(true);
+            }
+        })
+    },
+    methods: {
+        // 获取用户信息
+        getMemberInfo: function(){
+            var _this = this;
+            $.post('/api/member/getInfo', {}, function (res) {
+                if (res.code == 'success'){
+                    _this.memberInfo = res.data
+                }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");
+        },
+        // 获取列表数据
+        getDataList: function(more){
+            var _this = this;
+            _this.status.loading = true;
+            if(_this.params.page == 1){
+                _this.dataList = [];
+            }
+            if(_this.status.loaded){
+                return false;
+            }
+            $.showLoading("数据加载中...");
+            $.post('/api/market/getInviteList', _this.params, function (res) {
+                _this.status.loading = false;
+                $.hideLoading();
+                if (res.code == 'success') {
+                    var dataList = res.data.data;
+                    if(dataList.length<=0 && _this.params.page > 1){
+                        _this.status.loaded = true;
+                        return false;
+                    }
+                    if(more){
+                        $.each(dataList, function(k,item){
+                            _this.dataList.push(item);
+                        });
+
+                    }else{
+                        _this.dataList = dataList
+                    }
+                }else{
+                    $.toast(res.message, 'text');
+                }
+            }, "json");
+        },
+        // 去报名
+        detail: function(id){
+            if(id != 15){
+                location.href = '/weixin/activity/bookdetail?id='+id;
+            }
+            /*if(this.params.type == 2){
+                location.href = '/weixin/activity/bookdetail?id='+id;
+            }else if(this.params.type == 3){
+                location.href = '/weixin/activity/bookdetail?id='+id;
+            }else{
+                location.href = '/weixin/activity/book?id='+id;
+            }*/
+        }
+    }
+});