add-sylive-team

This commit is contained in:
lccsw
2022-10-24 14:52:01 +08:00
parent 8b29965bf4
commit c5cee4aa65
24 changed files with 2419 additions and 65 deletions
+72 -3
View File
@@ -230,8 +230,8 @@ class Syt extends CI_Controller
$this->load->model('market/market_sylive_order_model');
//商家订单过期
$where = [
'expire_time>' => 0,
'expire_time<' => time(),
'expireTime>' => 0,
'expireTime<' => time(),
'status' => 0
];
$this->mdSytActivityOrders->update(['status'=>-1],$where);
@@ -241,6 +241,75 @@ class Syt extends CI_Controller
'expire_time<' => time(),
'status' => 0
];
$this->market_sylive_order_model->update(['status'=>-1],$where);
$rows = $this->market_sylive_order_model->select($where,'id asc',1,20);
if($rows){
foreach ($rows as $key => $val) {
$res = $this->market_sylive_order_model->update(['status'=>-1],['id'=>$val['id']]);
if($res){
$up_data = [
'stock = stock+1' => null
];
$this->market_sylive_activity_model->update($up_data,['activityId'=>$val['item_id']]);
}
}
}
}
//关联观看日志
public function union_user(){
$this->load->library('market/sylive_entity');
$this->load->model('market/market_sylive_user_model', 'user_model');
$this->load->model('market/market_sylive_activity_user_model', 'act_user_model');
$this->load->model('market/market_sylive_viewlog_model');
$size = 30;
$t1 = 'lc_market_sylive_viewlog';
$t2 = 'lc_live_polyv_viewlog';
$t3 = 'lc_market_sylive_activity';
$where = [
"$t2.id>" => 0,
"$t2.id is null" => null
];
$fileds = "{$t2}.*,{$t3}.activityId";
$rows = $this->db->select($fileds)->from("$t3")
->join("$t2", "{$t2}.channelId={$t3}.activityId", 'left')
->join("$t1", "{$t1}.vlog_id={$t2}.id", 'left')
->where($where)->order_by("{$t2}.id asc")->limit($size, 0)
->get()->result_array();
if (!$rows) {
echo "不存在直播日志数据";
}else{
foreach ($rows as $key => $value) {
$ac_user = $p_user = '';
$addData = [
'vlog_id' => $value['id'],
'a_id' => $value['activityId'],
'playId' => $value['playId'],
'playDuration' => $value['playDuration'],
'stayDuration' => $value['stayDuration'],
'c_time' => time()
];
$user = $this->user_model->get(['unionid'=>$value['param1']]);
$user && $ac_user = $this->act_user_model->get(['activityId'=>$value['activityId'],'userId'=>$user['userId']]);
if($ac_user['channelId']){
$p_user = $this->user_model->get(['userId'=>$ac_user['channelId']]);
}
if($p_user['teamId']){
$addData['type'] = 1;
$team_lists = $this->sylive_entity->get_team_lists($p_user['teamId']);
$area_id = $team_lists[0]['teamId']; //大团长id
$biz_id = $team_lists[1]['teamId']; //团长id
}
if($p_user['organizationId']){
$addData['type'] = 0;
$team_lists = $this->sylive_entity->get_level_lists($p_user['organizationId']);
$area_id = $team_lists[0]['teamId']; //大团长id
$biz_id = $team_lists[1]['teamId']; //团长id
}
$area_id && $addData['area_id'] = $area_id;
$biz_id && $addData['biz_id'] = $biz_id;
$user && $addData['userId'] = $user['userId'];
$this->market_sylive_viewlog_model->add($addData);
}
}
}
}
+251 -15
View File
@@ -15,10 +15,13 @@ class Sylive_entity{
$this->ci->load->model('market/market_sylive_user_model', 'user_model');
$this->ci->load->model('market/market_sylive_activity_model');
$this->ci->load->model('market/market_sylive_activity_biz_model','mdSytActivityBiz');
$this->ci->load->model('market/market_sylive_activity_team_model','mdSytActivityTeam');
$this->ci->load->model('market/market_sylive_activity_kpidata_model','mdSytActivityKpiData');
$this->ci->load->model('market/market_sylive_organization_model');
$this->ci->load->model('market/market_sylive_activity_orders_model','mdSytActivityOrders');
$this->ci->load->model('live/Live_polyv_viewlog_model', 'mdPolyvViewlog');
$this->ci->load->model('market/market_sylive_team_model');
$this->ci->load->model('market/market_sylive_viewlog_model');
}
/**
@@ -88,7 +91,6 @@ class Sylive_entity{
* @return int
*/
public function get_level_lists($organizationId,$data=[]){
$this->ci->load->model('market/market_sylive_organization_model');
$row = $this->ci->market_sylive_organization_model->get(['organizationId'=>$organizationId],'organizationId,parentId,organizationName');
if(!$row){
return $data;
@@ -112,10 +114,16 @@ class Sylive_entity{
public function kpi_log($params)
{
if(!$params['cf_uid']){
$group_id = $this->get_level($params['uid']);
if($group_id<4){
$params['cf_uid'] = $params['uid'];
$u_row = $this->user_model->get(['userId'=>$params['uid']]);
if($params['teamId']){
$t_level_id = $this->get_team_level($u_row['teamId']);
$params['cf_uid'] = $t_level_id<3 ? $params['uid'] : 0;
}
if($params['organizationId']){
$group_id = $this->get_level($u_row['organizationId']);
$params['cf_uid'] = $group_id<4 ? $params['uid'] : 0;
}
}
if ($params['a_id'] && $params['uid'] && $params['cf_uid']) {
$user = $this->user_model->get(['userId'=>$params['cf_uid']]);
@@ -129,16 +137,25 @@ class Sylive_entity{
return array('code' => 0, 'msg' => '无活动或未在活动时间内');
}
}
$re_kpi = $this->ci->mdSytActivityKpiData->get(array("a_id" => $params['a_id'], 'uid' => $params['uid'], 'kpi' => $params['kpi']));
$type = $user['organizationId'] > 0 ? 0 : 1; //0门店 1团队
$re_kpi = $this->ci->mdSytActivityKpiData->get(array("a_id" => $params['a_id'], 'uid' => $params['uid'], 'kpi' => $params['kpi'],'type'=>$type));
if ($re_kpi) {//已添加过活动kpi(访活动只记录一次用户kpi记录)
return array('code' => 0, 'msg' => '已添加过' . $params['kpi'] . '记录');
}
$level_lists = $this->get_level_lists($user['organizationId']);
if($level_lists){
//获取大区id
$area_id = $level_lists[1]['organizationId'];
//获取店铺id
$biz_id = $level_lists[2]['organizationId'];
if($type){
$team_lists = $this->get_team_lists($user['teamId']);
if($team_lists) {
$area_id = $team_lists[0]['teamId']; //大团长id
$biz_id = $team_lists[1]['teamId']; //团长id
}
}else{
$level_lists = $this->get_level_lists($user['organizationId']);
if($level_lists){
//获取大区id
$area_id = $level_lists[1]['organizationId'];
//获取店铺id
$biz_id = $level_lists[2]['organizationId'];
}
}
//增加记录
$addData = [
@@ -146,6 +163,7 @@ class Sylive_entity{
'uid' => $params['uid'],
'cf_uid' => $params['cf_uid'],
'kpi' => $params['kpi'],
'type' => $type,
'c_time' => time()
];
$area_id && $addData['area_id'] = $area_id;
@@ -156,11 +174,16 @@ class Sylive_entity{
if (!$id) {
return array('code' => 0, 'msg' => '添加记录失败');
}
if($this->map_kpi_biz[$params['kpi']] && $biz_id){//更新门店统计数据
if($this->map_kpi_biz[$params['kpi']] && $biz_id && !$addData['type']){//更新门店统计数据
$up_key = $this->map_kpi_biz[$params['kpi']];
$update[$up_key] = $this->ci->mdSytActivityKpiData->count(['a_id'=>$params['a_id'],'biz_id'=>$biz_id,'kpi'=>$params['kpi']]);
$update[$up_key] = $this->ci->mdSytActivityKpiData->count(['a_id'=>$params['a_id'],'biz_id'=>$biz_id,'kpi'=>$params['kpi'],'type'=>0]);
$this->ci->mdSytActivityBiz->update($update,['activityId'=>$params['a_id'],'bizId'=>$biz_id]);
}
if($this->map_kpi_biz[$params['kpi']] && $biz_id && $addData['type']) {//更新团队统计数据
$up_key = $this->map_kpi_biz[$params['kpi']];
$update[$up_key] = $this->ci->mdSytActivityKpiData->count(['a_id'=>$params['a_id'],'biz_id'=>$biz_id,'kpi'=>$params['kpi'],'type'=>1]);
$this->ci->mdSytActivityTeam->update($update,['activityId'=>$params['a_id'],'teamId2'=>$biz_id]);
}
return array('code' => 1, 'msg' => '添加记录成功');
} else {
return array('code' => 0, 'msg' => '参数错误');
@@ -177,7 +200,7 @@ class Sylive_entity{
$total = $this->ci->mdSytActivityBiz->count($where);
$field = $this->map_kpi_biz[$type];
if($total && $field){
$rows = $this->ci->mdSytActivityBiz->select($where,"{$field} desc",$page,$size);
$rows = $this->ci->mdSytActivityBiz->select($where,"{$field} desc,id desc",$page,$size);
$biz_ids = implode(',',array_column($rows,'bizId'));
$org_rows = [];
if($biz_ids){
@@ -222,7 +245,8 @@ class Sylive_entity{
$where = [
'a_id' => $aid,
'kpi' => $type,
'biz_id' => $biz_id
'biz_id' => $biz_id,
'type' => 0,
];
$t_rows = $this->ci->mdSytActivityKpiData->select_groupby('cf_uid',$where,'total desc',$page,$size,'cf_uid,count(id) as total');
$map = [];
@@ -323,6 +347,218 @@ class Sylive_entity{
return $data;
}
/**
* @param $teamId 团队id
* @param $level 0大团长 1团长 2团员 3普通用户
* @return int|mixed
*/
public function get_team_level($teamId,$level=0){
if(!$teamId){
return 3;
}
$row = $this->ci->market_sylive_team_model->get(['teamId'=>$teamId],'teamId,parentId');
if(!$row){
return 3;
}
if($row['parentId']){
$temp = $level+1;
return $this->get_team_level($row['parentId'],$temp);
}
return $level;
}
/**
* 获取等级数据
* @param $teamId 团队id
* @param $data
* @return int
*/
public function get_team_lists($teamId,$data=[]){
$row = $this->ci->market_sylive_team_model->get(['teamId'=>$teamId],'teamId,parentId,teamName');
if(!$row){
return $data;
}else{
array_unshift($data,$row);
if($row['parentId']){
return $this->get_team_lists($row['parentId'],$data);
}else{
return $data;
}
}
}
/**
* 判断团长活动是否有权限
* @param $organizationId
* @param $level
* @param $a_id
* @return int
*/
public function team_act_role($organizationId,$level,$a_id){
$where['activityId'] = $a_id;
if($level==2){ //团员
$where["teamId2 in (select parentId from lc_market_sylive_team where teamId={$organizationId} and status=0)"] = null;
}elseif($level==1){ //团长
$where['teamId2'] = $organizationId;
}else{ //大团长
$where["teamId1"] = $organizationId;
}
$act = $this->ci->mdSytActivityTeam->get($where,'activityId');
return $act ? true : false;
}
//团队排行数据
public function top_team_lists($aid,$type='browse',$page=1,$size=10,$teamId=0){
$lists = [];
$where = [
'activityId' => $aid,
'status' => 0
];
$total = $this->ci->mdSytActivityTeam->count($where);
$field = $this->map_kpi_biz[$type];
if($total && $field){
$rows = $this->ci->mdSytActivityTeam->select($where,"{$field} desc,id desc",$page,$size);
$team_ids = implode(',',array_column($rows,'teamId2'));
$org_rows = [];
if($team_ids){
$org_rows = $this->ci->market_sylive_team_model->map('teamId','teamName',["teamId in ($team_ids)"],'','','','teamId,teamName');
}
$start = $page>1 ? ($page-1)*$size : 0;
foreach ($rows as $key=>$val) {
$lists[] = [
'ranking' => $start+$key+1,
'name' => $org_rows[$val['teamId2']] ? $org_rows[$val['teamId2']] : '',
'num' => $val[$this->map_kpi_biz[$type]].'人',
'tip' => $teamId==$val['teamId2'] ? '我的团队' : '',
];
}
}
$data = [
'total' => $total,
'lists' => $lists
];
return $data;
}
//团队用户排行数据
public function top_team_user($aid,$teamId,$uid,$type='browse',$page=1,$size=50){
$where = [
'parentId' => $teamId
];
$orgs = $this->ci->market_sylive_team_model->select($where,'',0,0,'teamId');
$org_ids = 0;
if($orgs){
$org_arr_ids = array_column($orgs,'teamId');
$org_arr_ids[] = $teamId;
$org_ids = implode($org_arr_ids,',');
}
$where = [
"teamId>" => 0,
"teamId in ({$org_ids})" => null
];
$total = $this->ci->user_model->count($where);
$lists = [];
if($total){
$rows = $this->ci->user_model->select($where,'userId desc',$page,$size,'userId,uname,nickname,headimg');
$where = [
'a_id' => $aid,
'kpi' => $type,
'biz_id' => $teamId,
'type' => 1,
];
$t_rows = $this->ci->mdSytActivityKpiData->select_groupby('cf_uid',$where,'total desc',$page,$size,'cf_uid,count(id) as total');
$map = [];
if($t_rows){
foreach($t_rows as $item) {
$map[$item['cf_uid']] = null !== $item['total'] ? $item['total'] : $item;
}
}
foreach ($rows as $item) {
$total = $map[$item['userId']] ? $map[$item['userId']] : '0';
$lists[] = [
'uid' => $item['userId'],
'name' => $item['uname'] ? $item['uname'] : $item['nickname'],
'headimg' => $item['headimg'] ? $item['headimg'] : self::DEFAULT_HEAD,
'total' => $total,
'num' => "{$total}",
'tip' => $uid == $item['userId'] ? '本人' : '',
];
}
$edit = array_column($lists,'total');
array_multisort($edit,SORT_DESC,$lists);
}
$data = [
'total' => $total,
'lists' => $lists
];
return $data;
}
//用户用户观看次数排行
public function top_team_view_num($where,$page=1,$size=10){
$total = $this->ci->market_sylive_viewlog_model->count($where);
$lists = [];
if($total){
$rows = $this->ci->market_sylive_viewlog_model->select_groupby('userId',$where,'total desc',$page,$size,'userId,count(id) as total');
$uids = implode(",",array_unique(array_column($rows,'userId')));
$users = [];
if($uids){
$where = [
"userId in ('$uids')" => null,
];
$users = $this->ci->user_model->map('userId','',$where,'','','','userId,unionid,uname,nickname,headimg');
}
foreach ($rows as $item) {
$user = $users[$item['userId']] ? $users[$item['userId']][0] : [];
$total = $item['total'];
$lists[] = [
'uid' => $user['userId'],
'name' => $user['nickname'] ? $user['nickname'] : '',
'headimg' => $user['headimg'] ? $user['headimg'] : self::DEFAULT_HEAD,
'total' => $total,
'num' => "{$total}",
];
}
}
$data = [
'total' => $total,
'lists' => $lists
];
return $data;
}
//用户用户观看时长排行
public function top_team_view_time($where,$page=1,$size=10){
$total = $this->ci->market_sylive_viewlog_model->count($where);
$lists = [];
if($total){
$rows = $this->ci->market_sylive_viewlog_model->select_groupby('userId',$where,'total desc',$page,$size,'userId,sum(playDuration) as total');
$uids = implode(",",array_unique(array_column($rows,'userId')));
$users = [];
if($uids){
$where = [
"userId in ('$uids')" => null,
];
$users = $this->ci->user_model->map('userId','',$where,'','','','userId,unionid,uname,nickname,headimg');
}
foreach ($rows as $item) {
$user = $users[$item['userId']] ? $users[$item['userId']][0] : [];
$total = $item['total'];
$lists[] = [
'uid' => $user['userId'],
'name' => $user['nickname'] ? $user['nickname'] : '',
'headimg' => $user['headimg'] ? $user['headimg'] : self::DEFAULT_HEAD,
'total' => $total,
'num' => "{$total}",
];
}
}
$data = [
'total' => $total,
'lists' => $lists
];
return $data;
}
public function __get($name)
{
if ('_model' === substr($name, -6)) {
@@ -0,0 +1,13 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Market_sylive_viewlog_model extends HD_Model
{
private $table_name = 'lc_market_sylive_viewlog';
public function __construct()
{
parent::__construct($this->table_name, 'default');
}
}
+37 -4
View File
@@ -5,7 +5,8 @@ require_once COMMPATH . 'third_party/phpqrcode/phpqrcode.php';
class Act extends Wx {
private $group_id;
private $group_id = 4;
private $teamLevel = 3;
private $secretkey = '7a23vx9257';
private $item_banner = ['https://qs.haodian.cn/web/images/project/H5-ShiYu/goods.jpg'];
private $template_id = 'DO0B9IYYub1d0oNvy9czzGbe6_1EU8PQmnLEoDOcmXA';
@@ -23,9 +24,18 @@ class Act extends Wx {
$skey = $this->input->get('skey');
$param = $this->myencryption->base64url_decode($skey);
$a_id = intval($param['a_id']);//活动id
$this->group_id = $this->sylive_entity->get_level($this->session['org_id']);
if($this->group_id<4 && $a_id && !$this->sylive_entity->act_role($this->session['org_id'],$this->group_id,$a_id)){
$this->group_id = 4;
if($this->session['org_id']){
$this->group_id = $this->sylive_entity->get_level($this->session['org_id']);
var_dump($this->group_id);
if($this->group_id<4 && $a_id && !$this->sylive_entity->act_role($this->session['org_id'],$this->group_id,$a_id)){
$this->group_id = 4;
}
}
if($this->session['teamId']){ //团长
$this->teamLevel = $this->sylive_entity->get_team_level($this->session['teamId']);
if($this->teamLevel<3 && $a_id && !$this->sylive_entity->team_act_role($this->session['teamId'],$this->teamLevel,$a_id)){
$this->teamLevel = 3;
}
}
}
@@ -51,8 +61,12 @@ class Act extends Wx {
$act_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$a_id]);
//一次性订阅
$re_s = $this->mdSytSubscribemsg->get(array('a_id' => $a_id, 'uid' => $this->uid));
$is_show_code = false; //是否显示二维码
if ($re_s) {
$subscribemsg = '已订阅直播';
$p_user = [];
$act_user['channelId'] && $p_user = $this->user_model->get(['userId'=>$act_user['channelId']]);
$p_user['teamId'] && $is_show_code = true;
} else {
if(!$user['nickname'] && !$user['headimg']){
$subscribemsg = http_host_com('home')."/h5/market/sylive/act/userinfo?skey={$skey}&type=sub";
@@ -83,6 +97,10 @@ class Act extends Wx {
$info['org_id'] = $this->session['org_id'];
$info['subscribemsg'] = $subscribemsg;
$info['statisticsurl'] = $info['shareurl'] = $info['code'] = '';
if($this->teamLevel<3){
$info['shareurl'] = '/h5/market/sylive/act/share?skey='.$info['skey'];
$info['statisticsurl'] = '/h5/market/sylive/tstic?skey='.$info['skey'];
}
if($this->group_id<4){
$info['shareurl'] = '/h5/market/sylive/act/share?skey='.$info['skey'];
$info['statisticsurl'] = '/h5/market/sylive/stic?skey='.$info['skey'];
@@ -102,6 +120,7 @@ class Act extends Wx {
//微信分享
$wx_info = $this->share_info($row);
$info['is_pay'] = $is_pay ? 1 : 0;
$info['show_code'] = $is_show_code ? 1 : 0;
$this->data['info'] = $info;
$this->data['sign_package'] = $wx_info['sign_package'];
$this->data['share'] = $wx_info['share'];
@@ -284,6 +303,7 @@ class Act extends Wx {
'price' => $item['price'] ? $item['price'] : '',
'content' => $item['introduction'] ? $item['introduction'] : '',
'banner' => $banner,
'stock' => $row['stock'],
'skey' => $skey,
'validity' => $validity,
'introTitle' => '权益说明',
@@ -324,6 +344,7 @@ class Act extends Wx {
}
$unpay = $this->market_sylive_order_model->get(['item_id'=>$a_id,'status'=>0,'uid'=>$this->uid,'expire_time>'=>time()]);
if(!$unpay){
$this->market_sylive_order_model->db->trans_begin();
$this->load->helper('order');
$unpay = [
'sid' => create_order_no('350200','market'),
@@ -336,10 +357,22 @@ class Act extends Wx {
];
$name && $unpay['uname'] = $name;
$mobile && $unpay['mobile'] = $mobile;
$act_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$a_id]);
$p_user = [];
$act_user['channelId'] && $p_user = $this->user_model->get(['userId'=>$act_user['channelId']]);
$p_user['teamId'] && $unpay['cfrom'] = 1;
$oid = $this->market_sylive_order_model->add($unpay);
if(!is_numeric($oid)){
$this->market_sylive_order_model->db->trans_rollback();
$this->show_json('',400,'创建订单失败');
}
$this->market_sylive_activity_model->update(['stock = stock-1' =>null],['activityId'=>$a_id]);
$res = $this->market_sylive_activity_model->db->affected_rows();
if(!$res){
$this->market_sylive_order_model->db->trans_rollback();
$this->show_json('',400,'已售罄');
}
$this->market_sylive_order_model->db->trans_commit();
}
$user = $this->user_model->get(['userId'=>$this->uid]);
$notify_url = http_host_com('home').'/h5/market/sylive/notify';
+3 -1
View File
@@ -106,7 +106,8 @@ class Biz extends Admin {
$count_live = $this->market_sylive_activity_model->count($where);
$where = [
'kpi' => 'order',
"area_id" => $area_id
"area_id" => $area_id,
'type' => 0
];
$count_order = $this->mdSytActivityKpiData->count($where);
$count = [
@@ -134,6 +135,7 @@ class Biz extends Admin {
];
$count_live = $this->market_sylive_activity_model->count($where);
$where = [
'type' => 0,
'kpi' => 'order',
" area_id in (select organizationId from lc_market_sylive_organization where parentId={$this->session['org_id']} and status=0)" => null
];
+8 -7
View File
@@ -174,7 +174,7 @@ class Admin extends Common{
if(!in_array($method,$this->white_login_method) && !$this->uid){
$ret = $this->set_auth();
$openid = $ret['openid'];
$row_wechat = $this->user_model->get(['openid' => $openid,'organizationId>'=>0,'status>='=>0]);
$row_wechat = $this->user_model->get(['openid' => $openid,'(organizationId>0 or teamId>0)'=>null,'status>='=>0]);
if(!$row_wechat){
$_SESSION[self::WX_SESSION] = $ret;
header('Location:/h5/market/sylive/login');exit;
@@ -183,9 +183,9 @@ class Admin extends Common{
throw new Hd_exception('该账户禁用', 400);
}
$this->uid = $row_wechat['userId'];
$this->session = $_SESSION[self::SESSION_KEY] = ['uid' => $this->uid,'org_id'=>$row_wechat['organizationId']];
$this->session = $_SESSION[self::SESSION_KEY] = ['uid' => $this->uid,'org_id'=>$row_wechat['organizationId'],'teamId'=>$row_wechat['teamId']];
}
if(!$this->session['org_id']){
if(!$this->session['org_id'] && !$this->session['teamId']){
header('Location:/h5/market/sylive/login');exit;
}
return $this->$method();
@@ -222,7 +222,7 @@ class Wx extends Common{
$ret['headimgurl'] && $add['headimg'] = strval($ret['headimgurl']);
$ret['unionid'] && $add['unionid'] = $ret['unionid'];
$this->uid = $this->user_model->add($add);
$row_wechat['organizationId'] = 0;
$row_wechat['teamId'] = $row_wechat['organizationId'] = 0;
if (!$this->uid) {
debug_log("[error]# " . $this->mdWeixinUsers->db->last_query(), __FUNCTION__, $this->log_dir);
}
@@ -239,17 +239,18 @@ class Wx extends Common{
"createTime" => date('Y-m-d H:i:s')
];
if($param['cf_uid']){
$p_user = $this->user_model->get(['userId'=>$param['cf_uid']],'userId,organizationId');
$p_user = $this->user_model->get(['userId'=>$param['cf_uid']],'userId,organizationId,teamId');
$p_act_user = $this->act_user_model->get(['userId'=>$param['cf_uid']],'userId,channelId');
$p_act_user['channelId'] && $act_data['channelId'] = $p_act_user['channelId'];
if(!$p_user['channelId'] && $p_user['organizationId']>0){
if(!$p_user['channelId'] && ($p_user['organizationId']>0||$p_user['teamId']>0)){
$act_data['channelId'] = $p_user['userId'];
}
$act_data['pid'] = $p_user['userId'];
}
$this->act_user_model->add($act_data);
}
$this->session = $_SESSION[self::SESSION_KEY] = ['uid' => $this->uid,'org_id'=>$row_wechat['organizationId']];
$_SESSION[self::SESSION_KEY] = ['uid' => $this->uid,'org_id'=>$row_wechat['organizationId'],'teamId'=>$row_wechat['teamId']];
echo ("<script>setTimeout('window.location.reload()', 1);</script>");exit;
}
return $this->$method();
} catch(Hd_exception $e){//处理异常
+6 -5
View File
@@ -4,6 +4,7 @@ class Login extends CI_Controller{
const WX_SESSION = "market_wx_info";
protected $secret = "market_sylive_h5";
protected $log_dir = 'market/sylive';
public function __construct(){
parent::__construct();
@@ -21,11 +22,11 @@ class Login extends CI_Controller{
if(!$code || $code!=$redis->get($key)){
$this->show_json('',400,'请输入正确的验证码');
}
$user=$this->user_model->get(array('mobile' => $mobile,'organizationId>'=>0));
$user=$this->user_model->get(array('mobile' => $mobile,'(organizationId>0 or teamId>0)'=> null));
if($user['status']){
$this->show_json('',400,'用户已禁用');
}
$_SESSION['market_sylive_session'] = ['uid' => $user['userId'],'org_id'=>$user['organizationId']];
$_SESSION['market_sylive_session'] = ['uid' => $user['userId'],'org_id'=>$user['organizationId'],'teamId'=>$user['teamId']];
$this->show_json('',200,'登录成功');
}else{
$wx_info = $_SESSION[self::WX_SESSION];
@@ -49,7 +50,7 @@ class Login extends CI_Controller{
if($user['openid']){
return ['code' => 0,'msg' => '该用户已绑定公众号'];
}
$is_bind = $this->user_model->count(['openid'=>$wx_info['openid'],'organizationId>'=>0,'status>='=>0]); //是否绑定
$is_bind = $this->user_model->count(['openid'=>$wx_info['openid'],'(organizationId>0 or teamId>0)'=>null,'status>='=>0]); //是否绑定
if($is_bind){
return ['code' => 0,'msg' => '该公众号已存在绑定账号'];
}
@@ -61,7 +62,7 @@ class Login extends CI_Controller{
$wx_info['unionid'] && $update['unionid'] = $wx_info['unionid'];
$this->user_model->update($update,['userId'=>$user['userId']]);
//删除普通账户
$this->user_model->update(['status'=>-1],['openid'=>$wx_info['openid'],'organizationId'=>0,'status>='=>0]);
$this->user_model->update(['status'=>-1],['openid'=>$wx_info['openid'],'status>='=>0,'organizationId'=>0,'teamId'=>0]);
return ['code' => 1,'msg' => '绑定成功'];
}
//获取验证码
@@ -70,7 +71,7 @@ class Login extends CI_Controller{
if(!mobile_valid($mobile)){
$this->show_json('',400,'请输入正确的手机号码');
}
$user=$this->user_model->get(array('mobile' => $mobile, 'status' => 0,'organizationId>'=>0));
$user=$this->user_model->get(array('mobile' => $mobile, 'status' => 0,'(organizationId>0 or teamId>0)'=>null));
if(!$user){
$this->show_json('',400,'用户不存在');
}
+15 -7
View File
@@ -34,15 +34,15 @@ class Stic extends Admin{
$this->data['sign_package'] = $wx_info['sign_package'];
$this->data['share'] = $wx_info['share'];
if($this->group_id==3){ //顾问
$browse_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'browse','cf_uid'=>$this->uid]);
$subscribe_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'subscribe','cf_uid'=>$this->uid]);
$browse_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'browse','cf_uid'=>$this->uid,'type'=>0]);
$subscribe_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'subscribe','cf_uid'=>$this->uid,'type'=>0]);
$info['begin'] = [
['title' => '访问用户', 'num' => "{$browse_count}",'url'=>'/h5/market/sylive/stic/users?type=owner&kpi=browse&a_id='.$a_id],
['title' => '预约用户', 'num' => "{$subscribe_count}",'url'=>'/h5/market/sylive/stic/users?type=owner&kpi=subscribe&a_id='.$a_id],
['title' => '预约率', 'num' => $browse_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
];
$watch_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'watch','cf_uid'=>$this->uid]);
$order_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'order','cf_uid'=>$this->uid]);
$watch_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'watch','cf_uid'=>$this->uid,'type'=>0]);
$order_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'order','cf_uid'=>$this->uid,'type'=>0]);
$info['live'] = [
['title' => '观看用户', 'num' => "{$watch_count}",'url' => '/h5/market/sylive/stic/users?type=owner&kpi=watch&a_id='.$a_id],
['title' => '下单用户', 'num' => "{$order_count}",'url' => '/h5/market/sylive/stic/users?type=owner&kpi=order&a_id='.$a_id],
@@ -67,6 +67,7 @@ class Stic extends Admin{
$cell3 = $cell2 = [];
if($this->group_id<2){ //所有大区
$where = [
'type' => 0,
'a_id' => $a_id,
'kpi' => 'browse',
];
@@ -99,7 +100,8 @@ class Stic extends Admin{
$where = [
'a_id' => $a_id,
'kpi' => 'browse',
'cf_uid' => $this->uid
'cf_uid' => $this->uid,
'type' => 0
];
$owner_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
@@ -113,7 +115,8 @@ class Stic extends Admin{
$where = [
'a_id' => $a_id,
'kpi' => 'browse',
'biz_id' => $this->session['org_id']
'biz_id' => $this->session['org_id'],
'type' => 0
];
$browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
@@ -167,6 +170,7 @@ class Stic extends Admin{
$view_num = $view_time = [];
if($this->group_id<2){ //所有大区
$where = [
'type' => 0,
'a_id' => $a_id,
'kpi' => 'watch',
];
@@ -197,6 +201,7 @@ class Stic extends Admin{
['title' => '参与人数', 'num' => "{$gw_count}"],
];
$where = [
'type' => 0,
'a_id' => $a_id,
'kpi' => 'watch',
'cf_uid' => $this->uid
@@ -211,6 +216,7 @@ class Stic extends Admin{
];
}else{ //门店
$where = [
'type' => 0,
'a_id' => $a_id,
'kpi' => 'watch',
'biz_id' => $this->session['org_id']
@@ -332,7 +338,8 @@ class Stic extends Admin{
$where = [
'a_id'=>$a_id,
// 'kpi'=>'watch',
'cf_uid'=>$this->uid
'cf_uid'=>$this->uid,
'type' => 0,
];
if($type==1){ //预热
$where['c_time<='] = strtotime($row['timeStart']);
@@ -443,6 +450,7 @@ class Stic extends Admin{
}
$page = $params['page'] ? intval($params['page']) : 1;
$where = [
'type' => 0,
'a_id' => $params['a_id'],
'kpi' => $params['kpi'],
];
+152
View File
@@ -0,0 +1,152 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once 'Common.php';
class Team extends Admin{
private $teamLevel;
private $liche_img = 'https://qs.haodian.cn/web/images/project/H5-ShiYu/goodslogo.jpg';
public function __construct(){
parent::__construct();
$this->load->model('market/market_sylive_activity_model');
$this->load->model('market/market_sylive_team_model');
$this->load->library('market/sylive_entity');
$this->load->library('MyEncryption');
$this->teamLevel = $this->sylive_entity->get_team_level($this->session['teamId']);
}
public function index(){
if($this->teamLevel>0){
throw new Hd_exception('权限不足',400);
}
$row = $this->market_sylive_team_model->get(['teamId'=>$this->session['teamId']]);
$info['nickname'] = $row['teamName'];
$info['headimg'] = $this->liche_img;
$info['tab'] = [
['id'=>1,'title'=>'团队'],
['id'=>2,'title'=>'活动'],
];
$this->data['info'] = $info;
//微信分享
$wx_info = $this->share_info();
$this->data['sign_package'] = $wx_info['sign_package'];
$this->show_view('h5/market/sylive/team/index');
}
//活动列表
public function lists(){
if($this->teamLevel==1){
$team_id = $this->session['teamId'];
}elseif($this->teamLevel==2) {
$biz_row = $this->market_sylive_team_model->get(['teamId'=>$this->session['teamId']]);
$team_id = $biz_row['parentId'];
}else{
$team_id = $this->input->get('team_id');
}
$row = $this->market_sylive_team_model->get(['teamId'=>$team_id]);
$this->data['headimg'] = $this->liche_img;
$this->data['biz_name'] = $row['teamName'];
$this->data['team_id'] = $this->input->get('team_id');
$this->data['teamLevel'] = $this->teamLevel;
//微信分享
$wx_info = $this->share_info();
$this->data['sign_package'] = $wx_info['sign_package'];
$this->show_view('h5/market/sylive/team/lists');
}
//团队列表
public function team_list(){
$page = $this->input->get('page');
!$page && $page = 1;
$size = 20;
$where = [
'status' => 0,
'parentId' => $this->session['teamId'],
];
$total = $this->market_sylive_team_model->count($where);
$lists = [];
if($total){
$rows = $this->market_sylive_team_model->select($where,'sortNumber asc,teamId desc',$page,$size);
foreach ($rows as $val) {
$where = [
'status' => 0,
"activityId in (select activityId from lc_market_sylive_activity_team where teamId2={$val['teamId']})" => null
];
$activitynum = $this->market_sylive_activity_model->count($where);
$where = [
'status' => 0,
"teamId in (select teamId from lc_market_sylive_team where parentId={$val['teamId']})" => null
];
$storenum = $this->user_model->count($where);//团员
$temp = [
'title' => $val['teamName'],
'storenum' => $storenum,
'activitynum' => $activitynum,
'url' => '/h5/market/sylive/team/lists?team_id='.$val['teamId'],
'state' => [],
];
$lists[] = $temp;
}
}
$data['list'] = $lists;
$data['total'] = $total;
$this->show_json($data,200);
}
//活动列表
public function act_list(){
$team_id = $this->input->get('team_id');
$page = $this->input->get('page');
!$page && $page = 1;
$size = 20;
$where = [
'status' => 0
];
if($this->teamLevel==2){ //团员
$where["activityId in (select activityId from lc_market_sylive_activity_team where
teamId2 in (select parentId from lc_market_sylive_team where teamId={$this->session['teamId']} and status=0)
)"] = null;
}elseif($this->teamLevel==1 || $team_id){ //团长
$s_t_id = $team_id ? $team_id : $this->session['teamId'];
$where["activityId in (select activityId from lc_market_sylive_activity_team where
teamId2 in (select teamId from lc_market_sylive_team where teamId={$s_t_id} and status=0)
)"] = null;
}else{ //大团长
$where["activityId in (select activityId from lc_market_sylive_activity_team where
teamId1 in (select teamId from lc_market_sylive_team where teamId={$this->session['teamId']} and status=0)
)"] = null;
}
// $where = ['status'=>0];
$total = $this->market_sylive_activity_model->count($where);
$lists = [];
if($total){
$rows = $this->market_sylive_activity_model->select($where,'timeStart desc',$page,$size,'activityId,title,timeStart,timeEnd');
foreach ($rows as $val) {
$s_time = strtotime($val['timeStart']);
$e_time = strtotime($val['timeEnd']);
$n_time = time();
if($n_time>=$s_time&&$n_time<=$e_time){
$state = ['title'=>'活动进行中','class'=>'bg-fe9538'];
}elseif($n_time<$s_time){
$state = ['title'=>'活动预热中','class'=>'bg-ff5a5a'];
}else{
$state = ['title'=>'活动已结束','class'=>'bg-fccba0'];
}
$skey = $this->myencryption->base64url_encode("a_id=" . $val['activityId']);
$url = '/h5/market/sylive/act?skey='.$skey;
$stat_url = '/h5/market/sylive/tstic?skey='.$skey;
$temp = [
'title' => $val['title'],
'time' => date('m-d H:i',$s_time).'~'.date('m-d H:i',$e_time),
'url' => $url,
'stat_url' => $stat_url,
'state' => $state,
];
$lists[] = $temp;
}
}
$data['list'] = $lists;
$data['total'] = $total;
$this->show_json($data,200);
}
}
+524
View File
@@ -0,0 +1,524 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once 'Common.php';
class Tstic extends Admin{
private $teamLevel;
public function __construct(){
parent::__construct();
$this->load->model('market/market_sylive_organization_model');
$this->load->model('market/market_sylive_activity_model');
$this->load->model('market/market_sylive_activity_biz_model','mdSytActivityBiz');
$this->load->model('market/market_sylive_activity_kpidata_model','mdSytActivityKpiData');
$this->load->model('market/market_sylive_team_model');
$this->load->model('live/Live_polyv_session_model', 'mdPolyvSession');
$this->load->library('market/sylive_entity');
$this->teamLevel = $this->sylive_entity->get_team_level($this->session['teamId']);
$this->data['skey'] = $this->input->get('skey');
}
//顾问
public function index(){
if($this->teamLevel>2){
throw new Hd_exception('权限不足',400);
}
$param = $this->myencryption->base64url_decode($this->data['skey']);
$a_id = intval($param['a_id']);//活动id
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
if(!$row){
throw new Hd_exception('参数错误',400);
}
$info['tab'] = time()>=strtotime($row['timeStart']) ? 2 : 1;
//微信分享
$wx_info = $this->share_info($row);
$this->data['sign_package'] = $wx_info['sign_package'];
$this->data['share'] = $wx_info['share'];
if($this->teamLevel==2){ //团员
$browse_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'browse','cf_uid'=>$this->uid,'type'=>1]);
$subscribe_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'subscribe','cf_uid'=>$this->uid,'type'=>1]);
$info['begin'] = [
['title' => '访问用户', 'num' => "{$browse_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=browse&a_id='.$a_id],
['title' => '预约用户', 'num' => "{$subscribe_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=subscribe&a_id='.$a_id],
['title' => '预约率', 'num' => $browse_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
];
$watch_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'watch','cf_uid'=>$this->uid,'type'=>1]);
$order_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'order','cf_uid'=>$this->uid,'type'=>1]);
$info['live'] = [
['title' => '观看用户', 'num' => "{$watch_count}",'url' => '/h5/market/sylive/tstic/users?type=owner&kpi=watch&a_id='.$a_id],
['title' => '下单用户', 'num' => "{$order_count}",'url' => '/h5/market/sylive/tstic/users?type=owner&kpi=order&a_id='.$a_id],
['title' => '转化率', 'num' => $watch_count ? round($order_count/$watch_count*100,2)."%" : 0],
];
$this->data['info'] = $info;
$this->show_view('h5/market/sylive/tstic/index');
}else{ //团长和大团长
$this->data['info'] = $info;
$this->show_view('h5/market/sylive/tstic/area');
}
}
public function lists_ready(){
$skey = $this->input->get('skey');
$param = $this->myencryption->base64url_decode($skey);
$a_id = intval($param['a_id']);//活动id
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
if(!$row && $this->teamLevel>=3){
$this->show_json([],200);
}
$cell3 = $cell2 = [];
if(!$this->teamLevel){ //大团长
$where = [
'type' => 1,
'a_id' => $a_id,
'kpi' => 'browse',
'area_id' => $this->session['teamId']
];
$browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
$subscribe_count = $this->mdSytActivityKpiData->count($where); //预约用户
// $sql = "select count(distinct areaId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
// $area_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
// $sql = "select count(distinct bizId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
// $biz_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
// $where = [
// 'status' => 0,
// "organizationId in (select organizationId from lc_market_sylive_organization where
// parentId in (select bizId from lc_market_sylive_activity_biz where activityId={$a_id} and status=0)
// )" => null
// ];
// $gw_count = $this->user_model->count($where); //顾问
// $cell2 = [
// ['title' => '参与大区', 'num' => "{$area_count['total']}个"],
// ['title' => '参与门店', 'num' => "{$biz_count['total']}家"],
// ['title' => '参与人数', 'num' => "{$gw_count}人"],
// ];
$where = [
'type' => 1,
'a_id' => $a_id,
'kpi' => 'browse',
'biz_id' => $this->uid
];
$owner_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
$owner_subscribe_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$cell3 = [
['title' => '访问用户', 'num' => "{$owner_browse_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=browse&a_id='.$a_id],
['title' => '预约用户', 'num' => "{$owner_subscribe_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=subscribe&a_id='.$a_id],
['title' => '预约率', 'num' => $owner_browse_count ? round($owner_subscribe_count/$owner_browse_count*100,2)."%" : 0],
];
}else{ //团长
$where = [
'type' => 1,
'a_id' => $a_id,
'kpi' => 'browse',
'biz_id' => $this->session['teamId'],
];
$browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
$subscribe_count = $this->mdSytActivityKpiData->count($where); //浏览数据
}
$cell1 = [
['title' => '访问用户', 'num' => "{$browse_count}",'url'=>'/h5/market/sylive/tstic/users?type=all&kpi=browse&a_id='.$a_id],
['title' => '预约用户', 'num' => "{$subscribe_count}",'url'=>'/h5/market/sylive/tstic/users?type=all&kpi=subscribe&a_id='.$a_id],
['title' => '预约率', 'num' => $subscribe_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
];
if($this->teamLevel==1){ //团长
$teamId = $this->session['teamId'];
}else{ //大团长
$teamId = 0;
}
$browse_lists = $this->sylive_entity->top_team_lists($a_id,'browse',1,10,$teamId);
$browse = [
'title' => '团队<span class="color-00a2ff">浏览</span>排行',
'url' => '/h5/market/sylive/tstic/rank?type=browse&skey='.$skey,
'list' => $browse_lists['lists']
];
$book_lists = $this->sylive_entity->top_team_lists($a_id,'subscribe',1,10,$teamId);
$book = [
'title' => '团队<span class="color-00a2ff">预约</span>排行',
'url' => '/h5/market/sylive/tstic/rank?type=subscribe&skey='.$skey,
'list' => $book_lists['lists']
];
$data = [
'cell1' => $cell1,
'cell2' => $cell2,
'cell3' => $cell3,
'browse' => $browse,
'book' => $book
];
$this->show_json($data,200);
}
//直播统计数据
public function lists_live(){
$skey = $this->input->get('skey');
$param = $this->myencryption->base64url_decode($skey);
$a_id = intval($param['a_id']);//活动id
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
if(!$row && $this->teamLevel>=3){
$this->show_json([],200);
}
$cell4 = $cell3 = [];
$view_num = $view_time = [];
if(!$this->teamLevel){ //大团长
$where = [
'type' => 1,
'a_id' => $a_id,
'kpi' => 'watch',
'area_id' => $this->session['teamId']
];
$view_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'order';
$order_count = $this->mdSytActivityKpiData->count($where); //预约用户
// $sql = "select count(distinct areaId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
// $area_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
// $sql = "select count(distinct bizId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
// $biz_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
// $where = [
// 'status' => 0,
// "organizationId in (select organizationId from lc_market_sylive_organization where
// parentId in (select bizId from lc_market_sylive_activity_biz where activityId={$a_id} and status=0)
// )" => null
// ];
// $gw_count = $this->user_model->count($where); //顾问
// $cell3 = [
// ['title' => '参与大区', 'num' => "{$area_count['total']}个"],
// ['title' => '参与门店', 'num' => "{$biz_count['total']}家"],
// ['title' => '参与人数', 'num' => "{$gw_count}人"],
// ];
$where = [
'type' => 1,
'a_id' => $a_id,
'kpi' => 'watch',
'cf_uid' => $this->uid
];
$owner_view_count = $this->mdSytActivityKpiData->count($where); //观看数据
$where['kpi'] = 'order';
$owner_order_count = $this->mdSytActivityKpiData->count($where); //下单数据
$cell4 = [
['title' => '观看用户', 'num' => "{$owner_view_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=watch&a_id='.$a_id],
['title' => '下单用户', 'num' => "{$owner_order_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=order&a_id='.$a_id],
['title' => '转化率', 'num' => $owner_view_count ? round($owner_order_count/$owner_view_count*100,2)."%" : 0],
];
}else{ //团长
$where = [
'type' => 1,
'a_id' => $a_id,
'kpi' => 'watch',
'biz_id' => $this->session['teamId'],
];
$view_count = $this->mdSytActivityKpiData->count($where); //观看数据
$where['kpi'] = 'order';
$order_count = $this->mdSytActivityKpiData->count($where); //下单数据
$where = [
'type' => 1,
'a_id' => $a_id,
'biz_id' => $this->session['teamId'],
];
$view_num_lists = $this->sylive_entity->top_team_view_num($where,1,10);
$view_num = [
'title' => '客户<span class="color-00a2ff">观看次数</span>排行',
'url' => '',
'list' => $view_num_lists['lists']
];
$view_time_lists = $this->sylive_entity->top_team_view_time($where,1,10);
$view_time = [
'title' => '客户<span class="color-00a2ff">观看时长</span>排行',
'url' => '',
'list' => $view_time_lists['lists']
];
}
$cell1 = [
['title' => '观看用户', 'num' => "{$view_count}",'url'=>'/h5/market/sylive/tstic/users?type=all&kpi=watch&a_id='.$a_id],
['title' => '下单用户', 'num' => "{$order_count}",'url'=>'/h5/market/sylive/tstic/users?type=all&kpi=order&a_id='.$a_id],
['title' => '转化率', 'num' => $view_count ? round($order_count/$view_count*100,2)."%" : 0],
];
$poly_row = $this->mdPolyvSession->get(['channelId'=>$row['channelId']]);
$duration = $poly_row['duration'] ? intval($poly_row['duration']/60) : "0";
$livePV = $poly_row['livePV'] ? $poly_row['livePV'] : 0;
$avg_UV_time = $poly_row['liveUV'] ? intval($poly_row['totalPlayDuration']/$poly_row['liveUV']) : 0;
$cell2 = [
['title' => '直播时长', 'num' => "{$duration}分钟"],
['title' => '人均观看', 'num' => "{$avg_UV_time}"],
['title' => '观看次数', 'num' => "{$livePV}"],
];
if($this->teamLevel==1){ //团长
$teamId = $this->session['teamId'];
}else{ //大团长
$teamId = 0;
}
$watch_lists = $this->sylive_entity->top_team_lists($a_id,'watch',1,10,$teamId);
$view = [
'title' => '团队<span class="color-00a2ff">观看</span>排行',
'url' => '/h5/market/sylive/tstic/rank?type=watch&skey='.$skey,
'list' => $watch_lists['lists']
];
$order_lists = $this->sylive_entity->top_team_lists($a_id,'order',1,10,$teamId);
$order = [
'title' => '团队<span class="color-00a2ff">订单</span>排行',
'url' => '/h5/market/sylive/tstic/rank?type=order&skey='.$skey,
'list' => $order_lists['lists']
];
$data = [
'cell1' => $cell1,
'cell2' => $cell2,
'cell3' => $cell3,
'cell4' => $cell4,
'view' => $view,
'order' => $order,
'view_num' => $view_num,
'view_time' => $view_time,
];
$this->show_json($data,200);
}
//排名列表
public function rank(){
$title_arr = [
'browse' => '团队<span class="color-00a2ff">浏览</span>排行',
'subscribe' => '团队<span class="color-00a2ff">预约</span>排行',
'watch' => '团队<span class="color-00a2ff">观看</span>排行',
'order' => '团队<span class="color-00a2ff">订单</span>排行'
];
$params = $this->input->get();
if($this->input->is_ajax_request()){
$page = $params['page'] ? intval($params['page']) : 1;
$info = $this->myencryption->base64url_decode($params['skey']);
$a_id = intval($info['a_id']);//活动id
if($this->teamLevel==1){ //团长
$teamId = $this->session['teamId'];
}else{ //大团长
$teamId = 0;
}
$type = $params['type'] ? $params['type'] : 'browse';
$data = $this->sylive_entity->top_team_lists($a_id,$type,$page,20,$teamId);
$data['title'] = $title_arr[$type];
$this->show_json($data,200);
}
$param = $this->myencryption->base64url_decode($this->data['skey']);
$a_id = intval($param['a_id']);//活动id
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
if(!$row){
throw new Hd_exception('参数错误',400);
}
$this->data['params'] = $params;
//微信分享
$wx_info = $this->share_info($row);
$this->data['sign_package'] = $wx_info['sign_package'];
$this->data['share'] = $wx_info['share'];
$this->show_view('h5/market/sylive/tstic/rank');
}
public function event(){
$map_kpi_name = [
'browse' => '浏览了活动页', 'subscribe' => '订阅了直播通知', 'order' => '直播间下单','watch' => '进入了直播间'
];
$skey = $this->input->get('skey');
$page = $this->input->get('page');
$type = $this->input->get('type');
!$page && $page=1;
$param = $this->myencryption->base64url_decode($skey);
$a_id = intval($param['a_id']);//活动id
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
$where = [
'type' => 1,
'a_id'=>$a_id,
'cf_uid'=>$this->uid
];
if($type==1){ //预热
$where['c_time<='] = strtotime($row['timeStart']);
}else{ //开始
$where['c_time>='] = strtotime($row['timeStart']);
}
$total = $this->mdSytActivityKpiData->count($where);
$lists = [];
if($total){
$rows = $this->mdSytActivityKpiData->select($where,'id desc',$page,10,'uid,kpi,c_time');
$users = [];
$uids = implode(',',array_unique(array_column($rows,'uid')));
if($uids){
$where = [
"userId in ($uids)" => null,
];
$users = $this->user_model->map('userId','nickname',$where,'','','','userId,nickname');
}
foreach ($rows as $key => $val) {
$nickname = $users[$val['uid']] ? $users[$val['uid']] : "用户{$val['uid']}";
$lists[] = [
'nickname' => $nickname,
'action' => $map_kpi_name[$val['kpi']],
'time' => friendly_date($val['c_time']),
];
}
}
$data = [
'lists' => $lists,
'total' => $total
];
if($this->teamLevel==2){ //团员
$t_row = $this->market_sylive_team_model->get(['teamId'=>$this->session['teamId']],'parentId');
$teamId = $t_row['parentId'];
}elseif($this->teamLevel==1){ //团长
$teamId = $this->session['teamId'];
}else{//大团长
$teamId = 0;
}
if($type==1){
$b_rows = $this->sylive_entity->top_team_user($a_id,$teamId,$this->uid,'browse');
$data['browse'] = [
'title' => '团队<span class="color-00a2ff">浏览</span>排行',
'list' => $b_rows['lists']
];
$sub_rows = $this->sylive_entity->top_team_user($a_id,$teamId,$this->uid,'subscribe');
$data['book'] = [
'title' => '团队<span class="color-00a2ff">预约</span>排行',
'list' => $sub_rows['lists']
];
}else{
$view_rows = $this->sylive_entity->top_team_user($a_id,$teamId,$this->uid,'watch');
$data['view'] = [
'title' => '团队<span class="color-00a2ff">观看</span>排行',
'list' => $view_rows['lists']
];
$order_rows = $this->sylive_entity->top_team_user($a_id,$teamId,$this->uid,'order');
$data['order'] = [
'title' => '团队<span class="color-00a2ff">订单</span>排行',
'list' => $order_rows['lists']
];
$where = [
'a_id' => $a_id,
'type' => 1,
'biz_id' => $teamId,
];
$view_num_lists = $this->sylive_entity->top_team_view_num($where,1,10);
$data['view_num'] = [
'title' => '团队<span class="color-00a2ff">观看次数</span>排行',
'list' => $view_num_lists['lists']
];
$view_time_lists = $this->sylive_entity->top_team_view_time($where,1,10);
$data['view_time'] = [
'title' => '团队<span class="color-00a2ff">观看时长</span>排行',
'url' => '',
'list' => $view_time_lists['lists']
];
}
$this->show_json($data,200);
}
public function users(){
$map_kpi_name = [
'browse' => '访问用户', 'subscribe' => '预约用户', 'order' => '下单用户','watch' => '观看用户'
];
$params = $this->input->get();
$a_id = intval($params['a_id']);//活动id
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
if(!$row){
throw new Hd_exception('参数错误',400);
}
$title = $map_kpi_name[$params['kpi']];
$tab = [
['id'=>1,'title'=>'客户列表']
];
if($this->teamLevel==1){ //团长
$tab[] = ['id'=>2,'title'=>'团员数据'];
}
$this->data['title'] = $title;
$this->data['tab'] = $tab;
$this->data['params'] = $params;
//微信分享
$wx_info = $this->share_info($row);
$this->data['sign_package'] = $wx_info['sign_package'];
$this->data['share'] = $wx_info['share'];
$this->show_view('h5/market/sylive/tstic/users');
}
public function user_lists(){
$params = $this->input->get();
if($params['tabid']==2){ //顾问数据
$this->gw_lists();
}
$page = $params['page'] ? intval($params['page']) : 1;
$where = [
'type' => 1,
'a_id' => $params['a_id'],
'kpi' => $params['kpi'],
];
if($params['type']=='all' && $this->teamLevel<2){ //所有
if(!$this->teamLevel){ //大团长
$where["area_id"] = $this->session['teamId'];
}elseif($this->teamLevel==1){ //团长
$where["biz_id"] = $this->session['teamId'];
}else{ //团员
$where['cf_uid'] = $this->uid;
}
}else{ //只显示个人
$where['cf_uid'] = $this->uid;
}
$total = $this->mdSytActivityKpiData->count($where);
$lists = [];
if($total){
$rows = $this->mdSytActivityKpiData->select($where,'id desc',$page,20,'uid,cf_uid,c_time');
$uids_arr = array_column($rows,'uid');
if($this->teamLevel==1){
$gw_uids_arr = array_column($rows,'cf_uid');
$uids_arr = array_merge($uids_arr,$gw_uids_arr);
}
$uids = implode(',',array_unique($uids_arr));
$users = [];
if($uids){
$where = [
"userId in ($uids)" => null,
];
$users = $this->user_model->map('userId','',$where,'','','','userId,uname,nickname,headimg');
}
foreach ($rows as $key => $item) {
$user = $users[$item['uid']] ? $users[$item['uid']][0] : [];
$nickname = $user['nickname'] ? $user['nickname'] : '用户'.$user['userId'];
$headimg = $user['headimg'] ? $user['headimg'] : 'https://thirdwx.qlogo.cn/mmopen/vi_32/Q3auHgzwzM483tlYWFg5RWQ1Xat94ib82prnDSicm2GHuxI49swU08N2I1aHb7B1gmicyxXF8R1BsVWahU9SiaPEzA/132';
$cf_uname = '';
if($this->teamLevel==1){ //团长
$cf_user = $users[$item['cf_uid']] ? $users[$item['cf_uid']][0] : [];
$cf_uname = $cf_user['uname'] ? "({$cf_user['uname']})" : "";
}
$lists[] = [
'nickname' => $nickname,
'headimg' => $headimg,
'time' => $cf_uname.friendly_date($item['c_time'],'normal',1)
];
}
}
$data = [
'total' => $total,
'lists' => $lists
];
$this->show_json($data,200);
}
public function gw_lists(){
$params = $this->input->get();
if($this->teamLevel==2){ //团员
$t_row = $this->market_sylive_team_model->get(['teamId'=>$this->session['teamId']],'parentId');
$teamId = $t_row['parentId'];
}elseif($this->teamLevel==1){ //团长
$teamId = $this->session['teamId'];
}else{//大团长
$teamId = 0;
}
$res = $this->sylive_entity->top_team_user($params['a_id'],$teamId,$this->uid,$params['kpi']);
$lists = [];
if($res['lists']){
foreach ($res['lists'] as $item) {
$lists[] = [
'nickname' => $item['name'],
'headimg' => $item['headimg'],
'time' => $item['num']
];
}
}
$data = [
'total' => $res['total'],
'lists' => $lists
];
$this->show_json($data,200);
}
}
@@ -10,6 +10,14 @@ class Welcome extends Admin {
}
public function index(){
if($this->session['teamId']){ //团队首页
$teamLevel = $this->sylive_entity->get_team_level($this->session['teamId']);
if($teamLevel>0){ //团长和团员 首页
header('Location:/h5/market/sylive/team/lists');exit;
}else{ // 团队列表
header('Location:/h5/market/sylive/team');exit;
}
}
$group_id = $this->sylive_entity->get_level($this->session['org_id']);
if($group_id==2 || $group_id==3){ //顾问和店长 店铺首页
header('Location:/h5/market/sylive/biz');exit;
+27 -14
View File
@@ -44,15 +44,28 @@
<div class="msgBg" @click="closeCode"></div>
<div class="msgMain">
<div class="content">
<div class="word">
<div class="pt10 text-center">
<img class='inline-block img-220x220' :src='info.code' />
<div class="word text-center">
<div class="font-40">企微福利官二维码</div>
<div class="mt20 font-22 line-height-15 color-666">
<div class="mt10">
<span>您的</span><div class="inline-block relative tx-shadow-e5"><span class="relative z-index-1 color-333">50积分</span></div><span>奖励即将到账</span>
</div>
<div class="mt10">添加[东风EV官方企微号]即刻领取</div>
<div class="mt10">
<span>更有</span><div class="inline-block relative tx-shadow-e5"><span class="relative z-index-1 color-333">100%中奖</span></div><span>惊喜等着您</span>
</div>
</div>
<div class="mt20 pt10 text-center">
<img class='inline-block imgsize-360X360' :src='info.code' />
</div>
<div class="pt10 pb20 pl20 pr20 font-24 color-fe9538 line-height-15">
<img class="imgsize-24X24 text-middle" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/df-code.jpg" alt="#" />
<span class="text-middle">长按识别二维码领福利</span>
</div>
<div class="pt30 pb20 pl20 pr20 font-24 color-666 line-height-15">长按识别二维码,关注狸车服务号。即可接收直播提醒,还有更多福利不定期放送哦~</div>
</div>
<div class="opt pl40 pr40">
<a class="block bg-1a1a1a pt25 pb25 text-center font-32 color-fff ulib-r750" @click="closeCode" href="javascript:" >知道了</a>
</div>
<!-- <div class="opt pl40 pr40">
<a class="block bg-1a1a1a pt25 pb25 text-center font-32 color-fff ulib-r750" @click="closeCode" href="javascript:" >知道了</a>
</div> -->
</div>
</div>
@@ -118,16 +131,16 @@
clearInterval(this.bundleIntervalEvent);
},
methods: {
showCode: function() {
let that = this;
if (that.info.subscribemsg == '已订阅直播') {
mDialog.msg({content: that.info.subscribemsg});
return;
}
if (!that.mp_app_id) {
window.location.href = "" + that.info.subscribemsg;
return;
if(that.info.show_code){
this.msgisShowCode = true
}else{
mDialog.msg({content: that.info.subscribemsg});
}
}else{
window.location.href = that.info.subscribemsg;
}
},
closeCode: function() {
+7 -4
View File
@@ -30,10 +30,13 @@
</div>
<div class="fixed left-0 bottom-0 right-0 inner30 bg-fff z-index-2" >
<a class="block bg-1a1a1a pt20 pb20 text-center color-fff ulib-r10" v-if="info.e_time>0" @click="showReg" href="javascript:void(0)">
<div class="font-32">立即支付<span>{{info.price}}</span></div>
<div class="mt10 font-20 color-888" v-html="showTime"></div>
</a>
<template v-if="info.e_time>0">
<a class="block bg-1a1a1a pt20 pb20 text-center color-fff ulib-r10" v-if="info.stock>0" @click="showReg" href="javascript:void(0)">
<div class="font-32">立即支付<span>{{info.price}}</span></div>
<div class="mt10 font-20 color-888" v-html="showTime"></div>
</a>
<div class="bg-999 pt30 pb30 text-center color-fff ulib-r10" v-else>已售罄</div>
</template>
<div class="bg-999 pt30 pb30 text-center color-fff ulib-r10" v-else>活动已结束</div>
</div>
+1 -1
View File
@@ -140,7 +140,7 @@
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
+1 -1
View File
@@ -147,7 +147,7 @@
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
+1 -1
View File
@@ -298,7 +298,7 @@
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
+1 -1
View File
@@ -253,7 +253,7 @@
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
+1 -1
View File
@@ -72,7 +72,7 @@
methods: {
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
+218
View File
@@ -0,0 +1,218 @@
<body class="bg-f6">
<div id="app" ref="app">
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top" style="background-image:url(https://qs.haodian.cn/web/images/project/H5-ShiYu/theme-bg.png?v=221008)">
<div class="pt30 pb30">
<div class="pl30 pr30">
<img class="text-middle imgsize-35X35 ulib-r750" :src="info.headimg" alt="#" />
<span class="text-middle font-22 color-fff">{{info.nickname}}</span>
<a class="fn-fr font-22 color-fff bg-000-op50 ulib-r750 pt5 pb5 pl10 pr10" href="javascript:;" @click="logout()">
<span class="text-middle ml10">退出</span>
</a>
</div>
<div class="fn-flex mt40 text-center color-fff">
<div class="fn-flex-item" v-for="item in info.count">
<div class="font-40">{{item.num}}</div>
<div class="mt15 font-28">
<i :class="'iconfont font-24 text-middle ' + item.icon"></i><span class="ml5 text-middle">{{item.title}}</span>
</div>
</div>
</div>
</div>
<div id="main" class="bg-fff mt10 ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:75vh;">
<div v-if="tabFixed">
<div class="height-60"></div>
<div class="fixed top-0 left-0 right-0 z-index-10 bg-fff pl30 pr30 pt20 pb20">
<div class="relative height-60 ml50 mr50 fn-flex text-center">
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
<div :class="'glider glider-'+tabIndex"></div>
</div>
</div>
</div>
<div v-else class="relative height-60 ml50 mr50 fn-flex text-center">
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
<div :class="'glider glider-'+tabIndex"></div>
</div>
<div class="pt30">
<!--大区列表-->
<div v-if="tabid==1">
<a class="block relative mb30 bg-f9 pt20 pb20 pl30 pr200 ulib-r20" v-for="(item,index) in list" :href="item.url">
<div class="font-32">{{item.title}}</div>
<div class="mt20 font-22 color-999">
<span><i class="iconfont icon-mendian text-middle"></i><span class="text-middle ml10 font-22">团员</span><span class="text-middle ml10 font-22">{{item.storenum}}</span></span>
<span class="ml20"><i class="iconfont icon-huodong text-middle"></i><span class="text-middle ml10 font-22">活动</span><span class="text-middle ml10 font-22">{{item.activitynum}}</span></span>
</div>
<div class="absolute right-0 box-middle pr30">
<span :class="'inline-block pl10 pr10 line-height-15 text-middle ulib-r750 font-22 color-fff '+item.state.class" v-if="item.state.title">{{item.state.title}}</span>
<i class="text-middle iconfont icon-gengduo text-middle font-28 color-666"></i>
</div>
</a>
</div>
<!--end大区列表-->
<!--活动列表列表-->
<div v-if="tabid==2">
<div class="relative mb30 bg-f9 pt20 pb20 pl30 pr80 ulib-r20" v-for="(item,index) in list">
<div class="space-nowrap">
<a class="inline-block actitle font-32" :href="item.url">{{item.title}}</a>
<a class="inline-block vertical10" :href="item.stat_url">
<div class="inline-block pl20 pr20 line-height-15 text-middle ulib-r750 font-22 color-fff bg-fe9538"><i class="iconfont icon-shuju text-middle"></i><span class="text-middle ml5">数据</span></div>
</a>
</div>
<a class="block mt10 font-22 color-999" :href="item.url">
{{item.time}}
<i class="absolute right-0 mr20 box-middle iconfont icon-gengduo font-26 color-666"></i>
</a>
</div>
</div>
<!--end活动列表-->
</div>
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span></div>
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd && list.length>10">我们是有底线的</div>
</mugen-scroll>
</div>
</div>
</div>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
tabFixed:false,
tabIndex:0,
tabid:'1',//1大区列表 /2活动列表
info:'',//基础信息
loading: false,
isDataEnd: false,
isNoData: false,
page: 1, //页数
size: 20, //每页取多少个数据
list:[],
},
created(){
},
computed: {
},
mounted() {
window.addEventListener('scroll', this.handleScroll, true)
this.getInfo()
},
beforeDestroy() {
},
//离开页面时
destroyed () {
window.removeEventListener('scroll', this.handleScroll)
},
methods: {
//获取基础信息
getInfo(){
var that = this;
that.info = <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>
},
//tab切换
changeTab(id,index){
if(id != this.tabid&&!this.loading){
if(this.tabFixed){
let mainoffsetTop = document.querySelector('#main').offsetTop
$('html,body').animate({scrollTop: mainoffsetTop+5},500);
}
this.tabid = id
this.tabIndex = index
this.isDataEnd = false
this.isNoData = false
this.page = 1
this.list = []
if(this.tabid == 1){
this.getRegionList()
}else if(this.tabid == 2){
this.getActivityList()
}
}
},
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
} else {
this.tabFixed = false
}
},
//拉取数据
fetchData: function() {
if(this.tabid == 1){
this.getRegionList()
}else if(this.tabid == 2){
this.getActivityList()
}
},
//获取大区列表
getRegionList(){
let that=this;
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
$.get('/h5/market/sylive/team/team_list',{'page':that.page},function (result) {
that.loading = false;
that.page = that.page + 1;
that.list = that.list.concat(result.data.list);
if (result.data.total == 0) {
that.isNoData = true;
} else if (that.list.length == result.data.total) {
that.isDataEnd = true;
}
},'json')
}
},
//获取活动列表
getActivityList(){
let that=this;
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
//请求接口
$.get('/h5/market/sylive/team/act_list',{'page':that.page},function (result) {
that.loading = false;
that.page = that.page + 1;
that.list = that.list.concat(result.data.list);
if (result.data.total == 0) {
that.isNoData = true;
} else if (that.list.length == result.data.total) {
that.isDataEnd = true;
}
},'json')
}
},
logout(){
$.get('/h5/market/sylive/login/logout',function (response) {
if(response.code==200){
mDialog.msg({
duration: 250,
pause: 2000,
content: response.msg,
onClose:function(){
window.location = '/h5/market/sylive/login'
}
});
}else{
mDialog.msg({
duration: 250,
pause: 2000,
content: response.msg
});
}
},'json')
},
},
})
</script>
<?=$this->load->view('h5/market/sylive/hidden_wx_share')?>
</body>
+139
View File
@@ -0,0 +1,139 @@
<body class="bg-f6">
<div id="app" ref="app">
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb50" style="background-image:url(https://qs.haodian.cn/web/images/project/H5-ShiYu/theme-bg.png?v=221008)">
<div class="pt30 pb60">
<div class="relative pl30 pr30 fn-clear">
<?if($teamLevel<1){?>
<a class="fn-fr font-22 color-fff bg-000-op50 ulib-r750 pt5 pb5 pl10 pr10" href="/h5/market/sylive/team">
<i class="iconfont icon-qiehuan text-middle"></i><span class="text-middle ml10">切换团队</span>
</a>
<?}else{?>
<a class="fn-fr font-22 color-fff bg-000-op50 ulib-r750 pt5 pb5 pl10 pr10" href="javascript:;" @click="logout()">
<span class="text-middle ml10">退出</span>
</a>
<?}?>
</div>
</div>
<div class="relative bg-fff mt10 ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:75vh;">
<img class="absolute top--60 box-center bds-1-fff imgsize-120X120 ulib-r750 z-index-1" :src="info.logo" alt="#" />
<div class="pt50 font-36 text-center">{{info.title}}</div>
<div class="pt50">
<!--活动列表列表-->
<div :class="['relative mb30 bg-f9 pt20 pb20 pl30 ulib-r20 ',item.pay_status == 0 ? 'pr200' : 'pr100']" v-for="(item,index) in list">
<div class="space-nowrap">
<a class="inline-block actitle font-32" href="javascript:;" @click="gourl(item.url)">{{item.title}}</a>
<a class="inline-block vertical10" href="javascript:;" @click="gourl(item.stat_url)">
<div class="inline-block pl20 pr20 line-height-15 text-middle ulib-r750 font-22 color-fff bg-fe9538"><i class="iconfont icon-shuju text-middle"></i><span class="text-middle ml5">数据</span></div>
</a>
</div>
<a class="block mt10 font-22 color-999" href="javascript:;" @click="gourl(item.url)">
{{item.time}}
<a :href="item.url" class="absolute right-0 mr20 box-middle iconfont icon-gengduo font-26 color-666"></a>
</a>
</div>
<!--end活动列表-->
</div>
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span></div>
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd && list.length>10">我们是有底线的</div>
</mugen-scroll>
</div>
</div>
<?if($group_id<2){?>
<?$this->load->view('h5/market/sylive/nav')?>
<?}?>
</div>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
info:'',//基础信息
loading: false,
isDataEnd: false,
isNoData: false,
page: 1, //页数
size: 10, //每页取多少个数据
list:[],
},
created(){
},
computed: {
},
mounted() {
this.getInfo()
},
beforeDestroy() {
},
//离开页面时
destroyed () {
},
methods: {
//获取基础信息
getInfo(){
this.info = {
title:"<?=$biz_name?>",
logo:"<?=$headimg?>",
}
},
//拉取数据
fetchData: function() {
this.getActivityList()
},
//获取大区列表
getActivityList(){
let that=this;
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
//请求接口
//请求接口
$.get('/h5/market/sylive/team/act_list',{'team_id':<?=$team_id ? $team_id : 0?>,'page':that.page},function (result) {
that.loading = false;
that.page = that.page + 1;
that.list = that.list.concat(result.data.list);
if (result.data.total == 0) {
that.isNoData = true;
} else if (that.list.length == result.data.total) {
that.isDataEnd = true;
}
},'json')
}
},
logout(){
$.get('/h5/market/sylive/login/logout',function (response) {
if(response.code==200){
mDialog.msg({
duration: 250,
pause: 2000,
content: response.msg,
onClose:function(){
window.location = '/h5/market/sylive/login'
}
});
}else{
mDialog.msg({
duration: 250,
pause: 2000,
content: response.msg
});
}
},'json')
},
gourl(url){
if(url){
window.location = url
}
}
},
})
</script>
<?=$this->load->view('h5/market/sylive/hidden_wx_share')?>
</body>
+360
View File
@@ -0,0 +1,360 @@
<body class="bg-fff">
<div id="app" ref="app">
<div class="container bg-size-fullwidth bg-no-repeat bg-pos-top pb130" :style="'background-image:url('+info.theme+')'">
<div class="h-290"></div>
<div id="main" class="bg-fff mb30 ml30 mr30 inner30 box-shadow-lightGray ulib-r20" style="min-height:72vh;">
<div v-if="tabFixed">
<div class="height-60"></div>
<div class="fixed top-0 left-0 right-0 z-index-10 bg-fff pl30 pr30 pt20 pb20">
<div class="relative height-60 ml50 mr50 fn-flex text-center">
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
<div :class="'glider glider-'+tabIndex"></div>
</div>
</div>
</div>
<div v-else class="relative height-60 ml50 mr50 fn-flex text-center">
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
<div :class="'glider glider-'+tabIndex"></div>
</div>
<!--预热阶段-->
<div v-if="tabid==1">
<div class="relative mt30 bg-fff5ec overflowhidden ulib-r20" v-if="begin.cell3 && begin.cell3.length>0">
<div class="orderTip text-center font-24 color-fff bg-ff5a5a">我的</div>
<div class="fn-flex pl20 pr20 text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in begin.cell3" :href="item.url">
<div class="font-32 color-fe9538">{{item.num}}</div>
<div class="mt10 font-22 color-666">{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i></div>
</a>
</div>
</div>
<div class="mt30 overflowhidden ulib-r20">
<div class="bg-fff5ec fn-flex text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in begin.cell1" :href="item.url">
<div class="font-32 color-fe9538">{{item.num}}</div>
<div class="mt10 font-22 color-666">
{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i>
</div>
</a>
</div>
<div class="bg-f6 fn-flex text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in begin.cell2" :href="item.url">
<div class="font-32">{{item.num}}</div>
<div class="mt10 font-22 color-666">{{item.title}}</div>
</a>
</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="begin.browse.title"></b>
<a class="mt5 fn-fr font-28" :href="begin.browse.url">查看更多<i class="iconfont icon-gengduo"></i></a>
</div>
<div v-if="begin.browse.list.length>0">
<div class="font-32 color-666" v-for="(item,index) in begin.browse.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="begin.book.title"></b>
<a class="mt5 fn-fr font-28" :href="begin.book.url">查看更多<i class="iconfont icon-gengduo"></i></a>
</div>
<div v-if="begin.book.list.length>0">
<div class="font-32 color-666" v-for="(item,index) in begin.book.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
</div>
<!-- end 预热阶段-->
<!--直播阶段-->
<div v-if="tabid==2">
<div class="mt30 bg-f9 inner20 overflowhidden text-center font-24 color-666 ulib-r20">直播结束后2小时同步完整数据</div>
<div class="relative mt30 bg-fff5ec overflowhidden ulib-r20" v-if="live.cell4 && live.cell4.length>0">
<div class="orderTip text-center font-24 color-fff bg-ff5a5a">我的</div>
<div class="fn-flex pl20 pr20 text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in live.cell4" :href="item.url">
<div class="font-32 color-fe9538">{{item.num}}</div>
<div class="mt10 font-22 color-666">{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i></div>
</a>
</div>
</div>
<div class="mt30 overflowhidden ulib-r20" v-if="live.cell1 && live.cell1.length>0">
<div class="bg-fff5ec fn-flex text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in live.cell1" :href="item.url">
<div class="font-32 color-fe9538">{{item.num}}</div>
<div class="mt10 font-22 color-666">
{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i>
</div>
</a>
</div>
<div class="bg-f6 fn-flex text-center" v-if="live.cell2 && live.cell2.length>0">
<a class="fn-flex-item pt40 pb40" v-for="item in live.cell2" :href="item.url">
<div class="font-32">{{item.num}}</div>
<div class="mt10 font-22 color-666">{{item.title}}</div>
</a>
</div>
<div class="bg-fff5ec fn-flex text-center" v-if="live.cell3 && live.cell3.length>0">
<a class="fn-flex-item pt40 pb40" v-for="item in live.cell3" :href="item.url">
<div class="font-32">{{item.num}}</div>
<div class="mt10 font-22 color-666">{{item.title}}</div>
</a>
</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="live.view">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="live.view.title"></b>
<a class="mt5 fn-fr font-28" :href="live.view.url">查看更多<i class="iconfont icon-gengduo"></i></a>
</div>
<div v-if="live.view.list.length>0">
<div class="font-32 color-666" v-for="(item,index) in live.view.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="live.order">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="live.order.title"></b>
<a class="mt5 fn-fr font-28" :href="live.order.url">查看更多<i class="iconfont icon-gengduo"></i></a>
</div>
<div v-if="live.order.list.length>0">
<div class="font-32 color-666" v-for="(item,index) in live.order.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="live.view_num && live.view_num.list">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="live.view_num.title"></b>
<a class="mt5 fn-fr font-28" v-if="live.view_num.url" :href="live.view_num.url">查看更多<i class="iconfont icon-gengduo"></i></a>
</div>
<div v-if="live.view_num.list.length>0">
<div class="font-32 color-666" v-for="(item,index) in live.view_num.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
</div>
<!-- end 直播阶段-->
</div>
<div class="fixed left-0 bottom-0 right-0 inner30 bg-fff" ><a class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r10" :href="info.url">进入活动</a></div>
</div>
<?$this->load->view('h5/market/sylive/nav');?>
</div>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
tabFixed:false,
tabIndex:0,
tabid:'<?=$info['tab']?>',//1预热阶段 /2直播阶段
info:'',
loading: false,
begin:{
cell1:[],
cell2:[],
browse:{
title:'',
url:'',
list:[],
},
book:{
title:'',
url:'',
list:[],
}
},
live:{
cell1:[],
cell2:[],
cell3:[],
view:{
title:'',
url:'',
list:[],
},
order:{
title:'',
url:'',
list:[],
},
view_num:{
title:'',
url:'',
list:[],
},
view_time:{
title:'',
url:'',
list:[],
}
},
},
created(){
},
computed: {
},
mounted() {
window.addEventListener('scroll', this.handleScroll, true)
this.getInfo()
if(this.tabid == 1){
this.getBegin()
}else if(this.tabid == 2){
this.tabIndex = 1
this.getLive()
}
},
beforeDestroy() {
},
//离开页面时
destroyed () {
window.removeEventListener('scroll', this.handleScroll)
},
methods: {
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
} else {
this.tabFixed = false
}
},
//获取基础信息
getInfo(){
this.info = {
theme:'https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/upload-1.jpg',
tab:[
{
id:'1',
title:'预热阶段',
},
{
id:'2',
title:'直播阶段',
},
],
url:'/h5/market/sylive/act?skey=<?=$skey?>',
}
},
//tab切换
changeTab(id,index){
if(id != this.tabid&&!this.loading){
if(this.tabFixed){
let mainoffsetTop = document.querySelector('#main').offsetTop
$('html,body').animate({scrollTop: mainoffsetTop+5},500);
}
this.tabid = id
this.tabIndex = index
if(this.tabid == 1){
this.getBegin()
}else if(this.tabid == 2){
this.getLive()
}
}
},
//预热阶段数据
getBegin(){
let that=this;
if (!that.loading) {
that.loading = true;
//请求接口
$.get('/h5/market/sylive/tstic/lists_ready',{'skey':'<?=$skey?>'},function (result){
that.loading = false;
if(result.data){
that.begin = result.data
}
console.dir(that.begin)
},'json');
}
},
//直播阶段数据
getLive(){
let that=this;
if (!that.loading) {
that.loading = true;
//请求接口
$.get('/h5/market/sylive/tstic/lists_live',{'skey':'<?=$skey?>'},function (result){
that.loading = false;
if(result.data){
that.live = result.data
}
},'json');
}
},
},
})
</script>
<?=$this->load->view('h5/market/sylive/share_script')?>
</body>
+360
View File
@@ -0,0 +1,360 @@
<body class="bg-fff">
<div id="app" ref="app">
<div class="container bg-size-fullwidth bg-no-repeat bg-pos-top pb130" :style="'background-image:url('+info.theme+')'">
<div class="h-290"></div>
<div id="main" class="bg-fff mb30 ml30 mr30 inner30 box-shadow-lightGray ulib-r20" style="min-height:72vh;">
<div v-if="tabFixed">
<div class="height-60"></div>
<div class="fixed top-0 left-0 right-0 z-index-10 bg-fff pl30 pr30 pt20 pb20">
<div class="relative height-60 ml50 mr50 fn-flex text-center">
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
<div :class="'glider glider-'+tabIndex"></div>
</div>
</div>
</div>
<div v-else class="relative height-60 ml50 mr50 fn-flex text-center">
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
<div :class="'glider glider-'+tabIndex"></div>
</div>
<!--预热阶段-->
<div v-if="tabid==1">
<div class="mt30 overflowhidden ulib-r20">
<div class="bg-fff5ec fn-flex text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in begin.cell1" :href="item.url">
<div class="font-32 color-fe9538">{{item.num}}</div>
<div class="mt10 font-22 color-666">
{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i>
</div>
</a>
</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="begin.browse.list.length>0">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="begin.browse.title"></b>
</div>
<div class="font-32 color-666" v-for="(item,index) in begin.browse.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="begin.book.list.length>0">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="begin.book.title"></b>
</div>
<div class="font-32 color-666" v-for="(item,index) in begin.book.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
</div>
<!-- end 预热阶段-->
<!--直播阶段-->
<div v-if="tabid==2">
<div class="mt30 overflowhidden ulib-r20">
<div class="bg-fff5ec fn-flex text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in live.cell1" :href="item.url">
<div class="font-32 color-fe9538">{{item.num}}</div>
<div class="mt10 font-22 color-666">
{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i>
</div>
</a>
</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="live.view.title"></b>
</div>
<div class="font-32 color-666" v-for="(item,index) in live.view.list" v-if="live.view.list.length>0">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="live.order.title"></b>
</div>
<div class="font-32 color-666" v-for="(item,index) in live.order.list" v-if="live.order.list.length>0">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="live.view_num">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="live.view_num.title"></b>
</div>
<div class="font-32 color-666" v-for="(item,index) in live.view_num.list" v-if="live.view_num.list.length>0">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="live.view_time">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="live.view_time.title"></b>
</div>
<div class="font-32 color-666" v-for="(item,index) in live.view_time.list" v-if="live.view_time.list.length>0">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
</div>
</div>
<!-- end 直播阶段-->
<!--实时动态-->
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20">
<div class="pb20 fn-clear">
<b class="fn-fl font-40 text-italic" v-html="dynamic.title"></b>
</div>
<div class="font-28" v-for="(item,index) in dynamic.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp60 text-nowrap">
<span class="text-middle">{{item.nickname}}</span>
<span class="text-middle color-666">{{item.action}}</span>
</div>
<div class="fn-fr">{{item.time}}</div>
</div>
</div>
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span></div>
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd && dynamic.list.length>10">我们是有底线的</div>
</mugen-scroll>
</div>
<!-- end 实时动态-->
</div>
<div class="fixed left-0 bottom-0 right-0 inner30 bg-fff" ><a class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r10" :href="info.url">进入活动</a></div>
</div>
<?$this->load->view('h5/market/sylive/nav');?>
</div>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
tabFixed:false,
tabIndex:0,
tabid:'<?=$info['tab']?>',//1预热阶段 /2直播阶段
info:{
theme:'',
tab:[],
},
loading: false,
begin:{
cell1:<?=json_encode($info['begin'])?>,
browse:{
title:'',
list:[],
},
book:{
title:'',
list:[],
}
},
live:{
cell1:<?=json_encode($info['live'])?>,
view:{
title:'',
list:[],
},
order:{
title:'',
list:[],
},
view_num:{
title:'',
list:[],
},
view_time:{
title:'',
list:[],
}
},
isDataEnd: false,
isNoData: false,
page: 1, //页数
size: 10, //每页取多少个数据
dynamic:{
title:'',
list:[],
},
},
created(){
},
computed: {
},
mounted() {
window.addEventListener('scroll', this.handleScroll, true)
this.getInfo()
if(this.tabid == 2){
this.tabIndex = 1
}
},
beforeDestroy() {
},
//离开页面时
destroyed () {
window.removeEventListener('scroll', this.handleScroll)
},
methods: {
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
} else {
this.tabFixed = false
}
},
//获取基础信息
getInfo(){
this.info = {
theme:'https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/upload-1.jpg',
tab:[
{
id:'1',
title:'预热阶段',
},
{
id:'2',
title:'直播阶段',
},
],
url:'/h5/market/sylive/act?skey=<?=$skey?>',
}
},
//tab切换
changeTab(id,index){
if(id != this.tabid&&!this.loading){
if(this.tabFixed){
let mainoffsetTop = document.querySelector('#main').offsetTop
$('html,body').animate({scrollTop: mainoffsetTop+5},500);
}
this.tabid = id
this.tabIndex = index
this.loading = false
this.isDataEnd = false
this.isNoData = false
this.page= 1
this.dynamic = {title:'', list:[]}
if(this.tabid == 1){
this.getBegin()
}else if(this.tabid == 2){
this.getLive()
}
}
},
//预热阶段数据
getBegin(){
let that=this;
if (!that.loading) {
that.getDynamicList()
that.loading = false;
}
},
//直播阶段数据
getLive(){
let that=this;
if (!that.loading) {
that.getDynamicList()
that.loading = false;
}
},
//拉取数据
fetchData: function() {
this.getDynamicList()
},
//获取实时动态
getDynamicList(){
let that=this;
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
//请求接口
$.get('/h5/market/sylive/tstic/event',{'skey':'<?=$skey?>','page':that.page,'type':that.tabid},function (res){
that.loading = false;
that.page = that.page + 1;
that.dynamic.title = '实时<span class="color-00a2ff">动态</span>';
that.dynamic.list = that.dynamic.list.concat(res.data.lists);
if(that.tabid==1){ //预热
that.begin.browse = res.data.browse
that.begin.book = res.data.book
}else{ // 直播
that.live.view = res.data.view
that.live.order = res.data.order
that.live.view_num = res.data.view_num
that.live.view_time = res.data.view_time
}
if (res.data.total == 0) {
that.isNoData = true;
} else if (that.dynamic.list.length == res.data.total) {
that.isDataEnd = true;
}
},'json');
}
},
},
})
</script>
<?=$this->load->view('h5/market/sylive/share_script')?>
</body>
@@ -0,0 +1,84 @@
<body class="bg-f6">
<div id="app" ref="app">
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pt30 pb50">
<div class="relative bg-fff ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:90vh;">
<div class="pt10 pb20 text-center"><b class="font-40 text-italic" v-html="title"></b></div>
<div class="font-32 color-666" v-for="(item,index) in list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<span class="text-middle">{{item.name}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
</div>
<div class="fn-fr">{{item.num}}</div>
</div>
</div>
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span></div>
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd && list.length>20">我们是有底线的</div>
</mugen-scroll>
</div>
</div>
</div>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
loading: false,
isDataEnd: false,
isNoData: false,
page: 1, //页数
size: 20, //每页取多少个数据
title:'',
list:[],
},
created(){
},
computed: {
},
mounted() {
},
beforeDestroy() {
},
//离开页面时
destroyed () {
},
methods: {
//拉取数据
fetchData: function() {
this.getMoreList()
},
//获取大区列表
getMoreList(){
let that=this;
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
//请求接口
$.get('/h5/market/sylive/tstic/rank',{'skey':'<?=$params['skey']?>','type':'<?=$params['type']?>','page':that.page},function (res){
that.loading = false;
that.page = that.page + 1;
that.title = res.data.title
that.list = that.list.concat(res.data.lists);
if (res.data.total == 0) {
that.isNoData = true;
} else if (that.list.length == res.data.total) {
that.isDataEnd = true;
}
},'json');
}
},
},
})
</script>
<?=$this->load->view('h5/market/sylive/share_script')?>
</body>
+130
View File
@@ -0,0 +1,130 @@
<body class="bg-f6">
<div id="app" ref="app">
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pt30 pb50">
<div id="main" class="relative bg-fff ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:90vh;">
<template v-if="tab.length>1">
<div class="pt10 pb20 text-center"><b class="font-40" v-html="title"></b></div>
<div v-if="tabFixed">
<div class="height-60"></div>
<div class="fixed top-0 left-0 right-0 z-index-10 bg-fff pl30 pr30 pt20 pb20">
<div class="relative height-60 ml50 mr50 fn-flex text-center">
<div class="fn-flex-item" v-for="(item,index) in tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
<div :class="'glider glider-'+tabIndex"></div>
</div>
</div>
</div>
<div v-else class="relative height-60 ml50 mr50 fn-flex text-center">
<div class="fn-flex-item" v-for="(item,index) in tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
<div :class="'glider glider-'+tabIndex"></div>
</div>
</template>
<template v-else>
<div class="pt10 pb20 text-center"><b class="font-40 text-italic" v-html="title"></b></div>
</template>
<div class="pt30 pb20 fn-flex font-28 color-666" v-for="(item,index) in list">
<div class="fn-flex-item text-nowrap" flexsize="3">
<img class="imgsize-32X32 text-middle ulib-r750 bds-1-eee" :src="item.headimg" alt="#" />
<span class="text-middle">{{item.nickname}}</span>
</div>
<div class="fn-flex-item text-right" flexsize="5">{{item.time}}</div>
</div>
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span></div>
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd&&list.length>10">我们是有底线的</div>
</mugen-scroll>
</div>
</div>
<?$this->load->view('h5/market/sylive/nav');?>
</div>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
tabFixed:false,
tab:<?=json_encode($tab,JSON_UNESCAPED_UNICODE)?>,
tabIndex:0,
tabid:'1',//1观看用户 /2顾问数据
loading: false,
isDataEnd: false,
isNoData: false,
page: 1, //页数
size: 20, //每页取多少个数据
title:'<?=$title?>',
list:[],
},
created(){
},
computed: {
},
mounted() {
},
beforeDestroy() {
},
//离开页面时
destroyed () {
},
methods: {
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
if (scrollTop > mainoffsetTop) {
this.tabFixed = true
} else {
this.tabFixed = false
}
},
//tab切换
changeTab(id,index){
if(id != this.tabid&&!this.loading){
if(this.tabFixed){
let mainoffsetTop = document.querySelector('#main').offsetTop
$('html,body').animate({scrollTop: mainoffsetTop+5},500);
}
this.tabid = id;
this.tabIndex = index;
this.loading = false;
this.isDataEnd = false;
this.isNoData = false;
this.page = 1;
this.list = [];
this.fetchData()
}
},
//拉取数据
fetchData: function() {
this.getActivityList()
},
//获取大区列表
getActivityList(){
let that=this;
//请求接口
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
//请求接口
$.get('/h5/market/sylive/tstic/user_lists',{'a_id':'<?=$params['a_id']?>','type':'<?=$params['type']?>','kpi':'<?=$params['kpi']?>','page':that.page,'tabid':that.tabid},function (res){
that.loading = false;
that.page = that.page + 1;
that.list = that.list.concat(res.data.lists);
if (res.data.total == 0) {
that.isNoData = true;
} else if (that.list.length == res.data.total) {
that.isDataEnd = true;
}
},'json');
}
},
},
})
</script>
<?=$this->load->view('h5/market/sylive/share_script')?>
</body>