edit-sylive-rank

This commit is contained in:
lccsw
2022-12-10 17:28:07 +08:00
committed by lccsw
parent 2b409860ce
commit 2e3ba09cbc
11 changed files with 262 additions and 104 deletions
+35 -22
View File
@@ -34,32 +34,34 @@ class Sylive2_data_entity{
$lists = [];
if($total){
$rows = $this->ci->mdSytActivityKpiData->select_groupby($groupby, $where, $order, $page, $page_size, $select);
$biz_rows = $org_rows = [];
if($groupby=='cfUserId'){//顾问
$user_ids = implode(',',array_column($rows,'cfUserId'));
if($user_ids){
$org_rows = $this->ci->user_model->map('userId','',["userId in ($user_ids)"=>null],'','','','userId,uname as name,headimg');
}
}
$target_rows = [];
if($groupby=='bizId'){
$biz_ids = implode(',',array_column($rows,'bizId'));
$biz_ids && $biz_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
$biz_ids = implode(',',array_column($rows,'tagId'));
$biz_ids && $target_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
}elseif($groupby=='levelId1'||$groupby=='levelId2'||$groupby=='levelId3'){
$biz_ids = implode(',',array_column($rows,'tagId'));
$biz_ids && $target_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
}else{ //顾问
$user_ids = implode(',',array_column($rows,'tagId'));
$user_ids && $target_rows = $this->ci->user_model->map('userId','',["userId in ($user_ids)"=>null],'','','','userId,uname as name,headimg');
}
$num_tip = $where['kpi'] == 'order' ? '单' : '人';
$start = $page>1 ? ($page-1)*$page_size : 0;
foreach ($rows as $key=>$val) {
$name = $tip = $headimg = $biz_name = '';
if($groupby=='cfUserId'){
$org = $org_rows[$val['cfUserId']] ? $org_rows[$val['cfUserId']][0] : [];
$headimg = '';
if($groupby=='bizId'){
$biz = $target_rows[$val['tagId']][0];
$name = $biz['groupsName'];
$tip = $tagId==$val['bizId'] ? '本店' : '';
}elseif($groupby=='levelId1'||$groupby=='levelId2'||$groupby=='levelId3'){
$biz = $target_rows[$val['tagId']][0];
$name = $biz['groupsName'];
}else{
$org = $target_rows[$val['tagId']] ? $target_rows[$val['tagId']][0] : [];
$tip = $tagId==$val['cfUserId'] ? '本人' : '';
$name = $org['name'];
$headimg = $org['headimg'];
}
if($groupby=='bizId'){
$biz = $biz_rows[$val['bizId']][0];
$name = $biz['groupsName'];
$tip = $tagId==$val['bizId'] ? '本店' : '';
}
$lists[] = [
'ranking' => $start+$key+1,
'name' => $name,
@@ -83,20 +85,31 @@ class Sylive2_data_entity{
$lists = [];
if($total){
$rows = $this->ci->groups_user_model->select_groupby($groupby, $where, $order, $page, $page_size, $select);
$biz_rows = [];
$target_rows = [];
if($groupby=='bizId'){
$biz_ids = implode(',',array_column($rows,'bizId'));
$biz_ids && $biz_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
$biz_ids = implode(',',array_column($rows,'tagId'));
$biz_ids && $target_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
}elseif($groupby=='levelId1'||$groupby=='levelId2'||$groupby=='levelId3'){
$biz_ids = implode(',',array_column($rows,'tagId'));
$biz_ids && $target_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
}else{
$biz_ids = implode(',',array_column($rows,'tagId'));
$biz_ids && $target_rows = $this->ci->user_model->map('userId','',["userId in ($biz_ids)"=>null],'','','','userId,uname as name,headimg');
}
$start = $page>1 ? ($page-1)*$page_size : 0;
$num_tip = $kpi == 'order' ? '单' : '人';
foreach ($rows as $key=>$val) {
$tip = $headimg = $name = '';
if($groupby=='bizId'){
$biz = $biz_rows[$val['bizId']][0];
$biz = $target_rows[$val['tagId']][0];
$name = $biz['groupsName'];
$tip = $tagId==$val['bizId'] ? '本店' : '';
}elseif($groupby=='levelId1'||$groupby=='levelId2'||$groupby=='levelId3'){
$biz = $target_rows[$val['tagId']][0];
$name = $biz['groupsName'];
}else{
$biz = $target_rows[$val['tagId']][0];
$name = $biz['name'];
}
$lists[] = [
'ranking' => $start+$key+1,
+17 -1
View File
@@ -145,16 +145,32 @@ class Sylive2_entity{
* @param $a_id
* @return array
*/
public function level_disk($a_id){
public function level_disk($a_id,$groupsLevel=0){
$top_group = $this->ci->groups_model->get(['activityId'=>$a_id,'parentId'=>0],'statisticsType');
$disk = [];
if($top_group['statisticsType']){
$where = ['dictId'=>$top_group['statisticsType']];
$groupsLevel && $where["dictDataCode>"] = $groupsLevel;
$disk = $this->ci->market_sys_dictionary_data_model->map('dictDataCode','dictDataName',$where,'','','','dictDataName,dictDataCode');
}
return $disk;
}
/**
* 获取等级字典
* @param $a_id
* @return array
*/
public function level_disk_lists($a_id){
$top_group = $this->ci->groups_model->get(['activityId'=>$a_id,'parentId'=>0],'statisticsType');
$disk = [];
if($top_group['statisticsType']){
$where = ['dictId'=>$top_group['statisticsType']];
$disk = $this->ci->market_sys_dictionary_data_model->select($where,'','','','dictDataName,dictDataCode');
}
return $disk;
}
public function __get($name)
{
if ('_model' === substr($name, -6)) {
+1 -1
View File
@@ -11,7 +11,7 @@ class Biz extends Admin{
public function index(){
$user = $this->user_model->get(['userId'=>$this->session['userId']]);
$this->data['multi_org'] = $_SESSION[self::SESSION_KEY]['multi_org'] ? 1 : 0;
$this->data['isBiz'] = $user['bizId'] ? 1 : 0;
$this->data['isBiz'] = $user['bizId'] == $user['organizationId'] ? 1 : 0;
$this->show_view('h5/market/sylive2/biz/index');
}
+11 -6
View File
@@ -38,7 +38,7 @@ class Item extends Wx{
$s_time = time() < strtotime($row['timeStart']) ? strtotime($row['timeStart']) - time() : 0;
$is_pay = $this->market_sylive_order_model->count(['itemId'=>$itemId,'activityId'=>$a_id,'status'=>1,'userId'=>$this->uid,'type'=>0]);
if($is_pay){
$url = http_host_com('home').'/h5/market/sylive2/ucenter?skey='.$skey;
$url = http_host_com('home').'/h5/market/sylive2/ucenter/orders?skey='.$skey;
redirect($url);exit;
}
@@ -232,13 +232,18 @@ class Item extends Wx{
//获取验证码
public function get_code(){
$mobile = $this->input->post('mobile');
$a_id = $this->input->post('a_id');
if(!mobile_valid($mobile)){
$this->show_json('',400,'请输入正确的手机号码');
}
//验证是否黑名单用户
// if(!$this->ck_mobile($mobile)){
// $this->show_json('',400,'本次活动仅限受邀客户参加');
// }
$act = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
$jsondata = json_decode($act['jsondata'],true);
if($jsondata['blacklist']){
//验证是否黑名单用户
if(!$this->ck_mobile($mobile)){
$this->show_json('',400,'本次活动仅限受邀客户参加');
}
}
$redis = &load_cache('redis');
$key = "sylive_item_code_{$this->uid}_{$mobile}";
$code = $redis->get($key);
@@ -301,7 +306,7 @@ class Item extends Wx{
$mobile_list[] = trim($item);
}
}
$redis->save($ckey,$mobile_list,2*24*60*60);
$redis->save($ckey,$mobile_list,7*24*60*60);
}
if(in_array($mobile,$mobile_list)){
return false;
+108 -42
View File
@@ -33,9 +33,13 @@ class Stic extends Admin{
$info['banner'] = $jsondata['banner'] ? build_qiniu_image_url($jsondata['banner']) : Sylive_entity::DF_BANNER;
$info['nickname'] = $user['nickname'];
$info['headimg'] = $user['headimg'];
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
$group_lists = $this->sylive2_entity->get_group_lists($group_user['groupsId'],$this->a_id);
$info['group_name'] = implode(' ',array_column($group_lists,'groupsName'));
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid,'status'=>0]);
$info['group_name'] = '';
if($groupsId){
$group_lists = $this->sylive2_entity->get_group_lists($groupsId,$this->a_id);
unset($group_lists[0]);
$info['group_name'] = implode(' ',array_column($group_lists,'groupsName'));
}
$info['groupsId'] = $groupsId ? $groupsId : $group_user['groupsId'];
$info['is_biz'] = $group_user['bizId'] ? 1 : 0;
$info['tab'] = time()>=strtotime($row['timeStart']) ? 2 : 1;
@@ -49,20 +53,18 @@ class Stic extends Admin{
//预约阶段数据
public function lists_ready(){
$groupsId = $this->input->get('groupsId');
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid,'status'=>0]);
!$groupsId && $groupsId = $group_user['groupsId'];
$group_row = $this->groups_model->get(['groupsId'=>$groupsId,'activityId'=>$this->a_id]);
$disk = $this->sylive2_entity->level_disk($this->a_id);
if(!$group_user['bizId']){
$i = $group_row['groupsLevel']+1;
for($i;$i<4;$i++){
if(!$group_user['bizId'] && $disk){
foreach ($disk as $key => $val) {
$where = [
'activityId' => $this->a_id,
'groupsLevel' => $i
'groupsLevel' => $key
];
$level_total = $this->groups_model->count($where);
$title = $disk[$i] ? $disk[$i] : "{$i}";
$h_lists[] = ['title'=> '参与'.$title,'num'=>"{$level_total}"];
$h_lists[] = ['title'=> "参与{$val}",'num'=>"{$level_total}"];
}
}
$where = [
@@ -116,8 +118,8 @@ class Stic extends Admin{
];
$sub_lists[] = ['title'=>'本店','lists'=>$biz];
}
if(!$group_row['ifBiz']){ //当前等级
if(!$group_row['groupsLevel']){//顶级
if($group_row['groupsId']!=$group_user['bizId']){
if(!$group_row['groupsLevel'] && !$group_row['ifBiz']){//顶级
$b_sum = $this->groups_model->sum('browse',['groupsLevel'=>1,'activityId'=>$this->a_id]);
$sub_sum = $this->groups_model->sum('subscribe',['groupsLevel'=>1,'activityId'=>$this->a_id]);
$browse_count = $b_sum['browse'];//浏览数据
@@ -131,7 +133,9 @@ class Stic extends Admin{
['title'=>'预约用户','num'=>"{$subscribe_count}"],
['title'=>'预约率','num'=>$browse_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
];
$sub_lists[] = ['title'=>"所有大区",'lists'=>$biz];
$title = $disk[$group_row['groupsLevel']+1]? '所有'.$disk[$group_row['groupsLevel']+1] : '所有门店';
$group_row['ifBiz'] && $title = $group_row['groupsName'];
$sub_lists[] = ['title'=>"{$title}",'lists'=>$biz];
}
$data = [
'h_lists' => $h_lists,
@@ -143,7 +147,7 @@ class Stic extends Admin{
//直播统计数据
public function lists_live(){
$groupsId = $this->input->get('groupsId');
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid,'status'=>0]);
!$groupsId && $groupsId = $group_user['groupsId'];
$group_row = $this->groups_model->get(['groupsId'=>$groupsId,'activityId'=>$this->a_id]);
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
@@ -194,8 +198,9 @@ class Stic extends Admin{
];
$sub_lists[] = ['title'=>'本店','lists'=>$biz];
}
if(!$group_row['ifBiz']){ //当前等级
if(!$group_row['groupsLevel']){//顶级
if($group_row['groupsId']!=$group_user['bizId']){
$disk = $this->sylive2_entity->level_disk($this->a_id);
if(!$group_row['groupsLevel'] && !$group_row['ifBiz']){//顶级
$b_sum = $this->groups_model->sum('watch',['groupsLevel'=>1,'activityId'=>$this->a_id]);
$sub_sum = $this->groups_model->sum('orderTotal',['groupsLevel'=>1,'activityId'=>$this->a_id]);
$browse_count = $b_sum['watch'];//观看数据
@@ -209,7 +214,9 @@ class Stic extends Admin{
['title'=>'下单数','num'=>"{$subscribe_count}"],
['title'=>'转化率','num'=>$browse_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
];
$sub_lists[] = ['title'=>"所有大区",'lists'=>$biz];
$title = $disk[$group_row['groupsLevel']+1]? '所有'.$disk[$group_row['groupsLevel']+1] : '所有门店';
$group_row['ifBiz'] && $title = $group_row['groupsName'];
$sub_lists[] = ['title'=>"{$title}",'lists'=>$biz];
}
$data = [
'h_lists' => $h_lists,
@@ -226,7 +233,7 @@ class Stic extends Admin{
$type = $this->input->get('type');
!$page && $page=1;
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid,'status'=>0]);
$where = [
'activityId'=>$this->a_id,
'bizId'=>$group_user['bizId'],
@@ -421,11 +428,18 @@ class Stic extends Admin{
if($rows){
foreach ($rows as $item) {
$count = $this->groups_model->count(['activityId'=>$this->a_id,'status'=>0,'parentId'=>$item['groupsId']]);
$url = $note = '';
$url = "/h5/market/sylive2/stic?groupsId={$item['groupsId']}";
if(!$item['ifBiz']){
$note = $disk[$item['groupsLevel']+1] ? $disk[$item['groupsLevel']+1]:'门店';
}else{
$count = '';
}
$lists[] = [
'title' => $item['groupsName'],
'note' => $disk[$item['groupsLevel']+1] ? $disk[$item['groupsLevel']+1]:'下一级组员',
'note' => $note,
'num' => $count,
'url' => $item['groupsLevel']<3 ? "/h5/market/sylive2/stic?groupsId={$item['groupsId']}" : '',
'url' => $url,
];
}
}
@@ -450,18 +464,22 @@ class Stic extends Admin{
$day_list[] = date('Y-m-d',$timeEnd - $i*24*60*60);
}
$this->data['day_list'] = $day_list;
$groups = [
['value'=>0,'title'=>'选择分组'],
];
$group_rows = $this->groups_model->select(['activityId'=>$this->a_id,'groupsLevel'=>1,'status'=>0],'','','','groupsId,groupsName');
if($group_rows){
foreach ($group_rows as $item) {
$groups[] = [
'value' => $item['groupsId'],
'title' => $item['groupsName']
];
$groups = [];
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
if(!$group_user['bizId']){
$disk = $this->sylive2_entity->level_disk($this->a_id);
if($disk){
foreach ($disk as $key=>$item) {
$groups[] = [
'value' => $key,
'type' => 'level',
'title' => $item.'排名'
];
}
}
}
$groups[] = ['value'=>'','type'=>'biz','title'=>'门店排名'];
$groups[] = ['value'=>'','type'=>'user','title'=>'顾问排名'];
$this->data['groups'] = $groups;
//微信分享
$wx_info = $this->share_info($row);
@@ -475,7 +493,6 @@ class Stic extends Admin{
'browse' => 'browse', 'subscribe' => 'subscribe', 'order' => 'orderTotal','watch' => 'watch'
];
$params = $this->input->get();
// $title = $params['gtype']=='gw' ? '顾问' : '门店';
$title = '';
$title_arr = [
'browse' => $title.'<span class="color-00a2ff">浏览</span>排行',
@@ -486,31 +503,55 @@ class Stic extends Admin{
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
$page = $params['page'] ? intval($params['page']) : 1;
$size = 20;
if(strtotime($params['day'])){//根据日期排行
if(strtotime($params['day']) || $params['itemId']){//根据日期排行
$kpi = $params['kpi'];
$select = "bizId,count(id) as t";
$tagId = 0;
$where = [
'activityId' => $this->a_id,
'bizId>' => 0,
'status' => 0,
'day' => date('Y-m-d',strtotime($params['day'])),
'kpi' => $kpi
];
$params['groupIds'] && $where['levelId1'] = $params['groupIds'];
$data = $this->sylive2_data_entity->top_kpidata('bizId',$where,'t desc,id desc',$page,$size,$select,$group_user['bizId']);
if($params['type']=='level'){
$group_by = "levelId{$params['value']}";
$select = "{$group_by} as tagId,count(id) as t";
$where["$group_by>"] = 0;
}elseif($params['type']=='biz'){
$group_by = 'bizId';
$select = "bizId as tagId,count(id) as t";
$where["$group_by>"] = 0;
$tagId = $group_user['bizId'];
}else{
$group_by = 'cfUserId';
$select = "cfUserId as tagId,count(id) as t";
$where["$group_by>"] = 0;
$tagId = $group_user['userId'];
}
strtotime($params['day']) && $where['day'] = date('Y-m-d',strtotime($params['day']));
$params['itemId'] && $where["itemId"] = $params['itemId'];
$data = $this->sylive2_data_entity->top_kpidata($group_by,$where,'t desc,id desc',$page,$size,$select,$tagId);
}else{
$kpi = $map_kpi_biz[$params['kpi']];
$select = "bizId,sum({$kpi}) as t";
$where = [
'activityId' => $this->a_id,
'bizId>' => 0,
'status' => 0
];
$params['groupIds'] && $where['levelId1'] = $params['groupIds'];
$data = $this->sylive2_data_entity->top_groups_user('bizId',$where,'t desc,groupsUserId desc',$page,$size,$select,$params['kpi'],$group_user['bizId']);
if($params['type']=='level'){
$group_by = "levelId{$params['value']}";
$select = "{$group_by} as tagId,sum({$kpi}) as t";
$where["$group_by>"] = 0;
}elseif($params['type']=='biz'){
$group_by = 'bizId';
$select = "bizId as tagId,sum({$kpi}) as t";
$where["$group_by>"] = 0;
}else{
$group_by = 'userId';
$select = "userId as tagId,sum({$kpi}) as t";
$where["$group_by>"] = 0;
}
$data = $this->sylive2_data_entity->top_groups_user($group_by,$where,'t desc,groupsUserId desc',$page,$size,$select,$params['kpi'],$group_user['bizId']);
}
$data['title'] = $title_arr[$params['kpi']];
$data['url'] = "/h5/market/sylive2/stic/rank?type={$params['kpi']}&day={$params['day']}&gtype={$params['gtype']}&show_day=1";
$data['url'] = "/h5/market/sylive2/stic/rank?kpi={$params['kpi']}&day={$params['day']}&index={$params['index']}&show_day=1";
$this->show_json($data,200);
}
@@ -526,8 +567,33 @@ class Stic extends Admin{
for($i=0;$i<8;$i++){
$day_list[] = date('Y-m-d',$timeEnd - $i*24*60*60);
}
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
if(!$group_user['bizId']){
$disk = $this->sylive2_entity->level_disk($this->a_id);
if($disk){
foreach ($disk as $key=>$item) {
$groups[] = [
'value' => $key,
'type' => 'level',
'title' => $item.'排名'
];
}
}
}
$goods = [];
if($params['kpi']=='order'){
$where = [
'activityId' => $this->a_id,
'status' => 0
];
$goods = $this->market_sylive_items_model->select($where,'sort desc,itemId desc',0,0,'itemId,title');
}
$groups[] = ['value'=>'','type'=>'biz','title'=>'门店排名'];
$groups[] = ['value'=>'','type'=>'user','title'=>'顾问排名'];
$this->data['groups'] = $groups;
$this->data['day_list'] = $day_list;
$this->data['params'] = $params;
$this->data['goods'] = $goods;
//微信分享
$wx_info = $this->share_info($row);
$this->data['sign_package'] = $wx_info['sign_package'];
+3 -3
View File
@@ -2,9 +2,9 @@
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/html2canvas.min.js?v123"></script>
<body>
<div id="app" ref="app">
<div class="poster">
<div class="poster2">
<div class="detail-banner relative p-swiper">
<div class="swiper-container left-0 top-0">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide bg-size-cover" v-for="item in list" >
<div class="relative">
@@ -85,7 +85,7 @@
let that = this
let swiper = new Swiper('.p-swiper .swiper-container', {
//loop: true,
//autoHeight: true,
autoHeight: true,
pagination: {
el: '.swiper-pagination',
type: 'fraction',
+1 -1
View File
@@ -7,8 +7,8 @@
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?=$_title?></title>
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?20221210">
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/swiper/css/swiper.min.css">
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?202212091">
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/jquery.3.4.1.min.js"></script>
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/vue.2.6.10.min.js"></script>
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/mDialog.js"></script>
+10 -10
View File
@@ -89,7 +89,7 @@
<label class="text-middle"><input class="text-middle" type="checkbox" v-model="isXYChecked" />
<span class="text-middle ml5">我已阅读并同意</span>
</label>
<a class="text-middle color-ff0000" :href="'/h5/market/sylive/item/agreement?a_id='+info['a_id']">{{info.protocolTitle}}</a>
<a class="text-middle color-ff0000" :href="'/h5/market/sylive2/item/agreement?a_id='+info['a_id']">{{info.protocolTitle}}</a>
</div>
</div>
<div class="mt30">
@@ -273,7 +273,7 @@
} else {
//按钮倒计时
var that = this
$.post('/h5/market/sylive/item/get_code',{'mobile':that.telPhone},function (response){
$.post('/h5/market/sylive2/item/get_code',{'mobile':that.telPhone,'a_id':that.info.a_id},function (response){
mDialog.msg({
duration: 250,
pause: 2000,
@@ -335,7 +335,7 @@
mDialog.msg({
duration: 250,
pause: 2000,
content: "请阅读并同意《关于用户门票须知》"
content: "请阅读并同意《"+this.protocolTitle+"》"
});
}else{
if(that.isSubmit){
@@ -353,7 +353,7 @@
'city' : that.city,
'biz' : that.biz
}
$.post('/h5/market/sylive/item/post_pay',params,function (res){
$.post('/h5/market/sylive2/item/post_pay',params,function (res){
that.isSubmiting = false
if(res.code==200){
that.isShowReg = false
@@ -437,7 +437,7 @@
pause: 2000,
content: '支付成功',
onClose:function(){
window.location = "/h5/market/sylive/ucenter?skey=<?=$info['skey']?>";
window.location = "/h5/market/sylive2/ucenter/orders?skey=<?=$info['skey']?>";
}
});
}
@@ -466,7 +466,7 @@
'id':this.oid
}
var that = this;
$.post('/h5/market/sylive/ucenter/edit_address',params,function (res){
$.post('/h5/market/sylive2/ucenter/edit_address',params,function (res){
that.isSubmiting = false
if(res.code==200){
mDialog.msg({
@@ -474,7 +474,7 @@
pause: 2000,
content: res.msg,
onClose:function(){
window.location = "/h5/market/sylive/ucenter?skey=<?=$info['skey']?>";
window.location = "/h5/market/sylive2/ucenter?skey=<?=$info['skey']?>";
}
});
}else{
@@ -498,7 +498,7 @@
vm.city_arr = vm.biz_arr = {}
vm.biz = vm.city = ''
if (nv != '') {
$.get('/h5/market/sylive/item/biz_info',{'type':'city','p_name':vm.province},function (res){
$.get('/h5/market/sylive2/item/biz_info',{'type':'city','p_name':vm.province},function (res){
vm.city_arr = res.data.lists
},'json')
}
@@ -508,7 +508,7 @@
vm.biz_arr = {};
vm.biz = ''
if (nv != '') {
$.get('/h5/market/sylive/item/biz_info',{'type':'biz','p_name':vm.province,'c_name':vm.city},function (res){
$.get('/h5/market/sylive2/item/biz_info',{'type':'biz','p_name':vm.province,'c_name':vm.city},function (res){
vm.biz_arr = res.data.lists
},'json')
}
@@ -516,5 +516,5 @@
}
})
</script>
<?=$this->load->view('h5/market/sylive/share_script')?>
<?=$this->load->view('h5/market/sylive2/share_script')?>
</body>
+40 -2
View File
@@ -9,6 +9,15 @@
<option :value="item" v-for="item in day_list">{{item}}</option>
</select>
<?}?>
<select class="fn-fr select-more ulib-r10 font-28" @change="changeGroup" v-model="index">
<option :value="key" v-for="(item,key) in groups">{{item.title}}</option>
</select>
</div>
<div class="pt30" v-if="kpi=='order' && goodsList">
<select class="wp100 select-more ulib-r10 font-28" style="width: 100%" @change="changegoods">
<option value="">全部</option>
<option :value="item.itemId" v-for="item in goodsList">{{item.title}}</option>
</select>
</div>
<div class="font-32 color-666" v-for="(item,index) in list">
<div class="pt20 pb20 fn-clear">
@@ -44,6 +53,11 @@
list:[],
checkDate:'<?=$params['day']?>',
day_list : <?=json_encode($day_list,JSON_UNESCAPED_UNICODE)?>,
groups:<?=json_encode($groups,JSON_UNESCAPED_UNICODE)?>,
index:<?=$params['index'] ? $params['index'] : 0?>,
kpi:'<?=$params['kpi']?>',
goodsId:0,
goodsList: <?=json_encode($goods,JSON_UNESCAPED_UNICODE)?>,
},
created(){
@@ -71,10 +85,14 @@
let that=this;
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
var type = this.groups[this.index]['type']
var value = this.groups[this.index]['value']
var params = {
'kpi':'<?=$params['type']?>',
'kpi':'<?=$params['kpi']?>',
'day':that.checkDate,
'gtype':'<?=$params['gtype']?>',
'type':type,
'value':value,
'itemId':that.goodsId,
'page':that.page
}
//请求接口
@@ -102,6 +120,26 @@
this.list = [];
this.getMoreList();
},
changeGroup(e){
this.index = e.target.value;
this.loading = false;
this.isDataEnd = false;
this.isNoData = false;
this.page = 1;
this.list = [];
this.getMoreList();
},
changegoods(e){
if(this.goodsId != e.target.value){;
this.goodsId = e.target.value
this.loading = false;
this.isDataEnd = false;
this.isNoData = false;
this.page = 1;
this.list = [];
this.getMoreList()
}
}
},
})
</script>
+35 -15
View File
@@ -24,7 +24,7 @@
<b class="fn-fl font-40 text-italic" v-html="beginBrowse.title"></b>
<div class="fn-fr">
<select class="select-more box-shadow-lightGray ulib-r10 font-22" @change="handleChange($event,'beginBrowseGroup')">
<option :value="item.value" v-for="item in info.group">{{item.title}}</option>
<option :value="key" v-for="(item,key) in info.group">{{item.title}}</option>
</select>
<select class="select-more box-shadow-lightGray ulib-r10 font-22" @change="handleChange($event,'beginBrowseDate')">
<option :value="item" v-for="item in info.date">{{item}}</option>
@@ -54,7 +54,7 @@
<b class="fn-fl font-40 text-italic" v-html="beginBook.title"></b>
<div class="fn-fr">
<select class="select-more box-shadow-lightGray ulib-r10 font-22" @change="handleChange($event,'beginBookGroup')">
<option :value="item.value" v-for="item in info.group">{{item.title}}</option>
<option :value="key" v-for="(item,key) in info.group">{{item.title}}</option>
</select>
<select class="select-more box-shadow-lightGray ulib-r10 font-22" @change="handleChange($event,'beginBookDate')">
<option :value="item" v-for="item in info.date">{{item}}</option>
@@ -89,7 +89,7 @@
<b class="fn-fl font-40 text-italic" v-html="liveView.title"></b>
<div class="fn-fr">
<select class="select-more box-shadow-lightGray ulib-r10 font-22" @change="handleChange($event,'liveViewGroup')">
<option :value="item.value" v-for="item in info.group">{{item.title}}</option>
<option :value="key" v-for="(item,key) in info.group">{{item.title}}</option>
</select>
<select class="select-more box-shadow-lightGray ulib-r10 font-22" @change="handleChange($event,'liveViewDate')">
<option :value="item" v-for="item in info.date">{{item}}</option>
@@ -119,7 +119,7 @@
<b class="fn-fl font-40 text-italic" v-html="liveOrder.title"></b>
<div class="fn-fr">
<select class="select-more box-shadow-lightGray ulib-r10 font-22" @change="handleChange($event,'liveOrderGroup')">
<option :value="item.value" v-for="item in info.group">{{item.title}}</option>
<option :value="key" v-for="(item,key) in info.group">{{item.title}}</option>
</select>
<select class="select-more box-shadow-lightGray ulib-r10 font-22" @change="handleChange($event,'liveOrderDate')">
<option :value="item" v-for="item in info.date">{{item}}</option>
@@ -263,10 +263,10 @@
this.getBeginBrowse()
this.getBeginBook()
}else if(this.tabid == 2){
this.liveViewDatee = 0
this.liveViewGroupe = 0
this.liveOrderDatee = 0
this.liveOrderGroupe = 0
this.liveViewDate = 0
this.liveViewGroup = 0
this.liveOrderDate = 0
this.liveOrderGroup = 0
this.getLiveView()
this.getLiveOrder()
}
@@ -276,9 +276,14 @@
//预热阶段浏览数据
getBeginBrowse(){
let that=this;
var type = this.info.group[this.beginBrowseGroup]['type']
var value = this.info.group[this.beginBrowseGroup]['value']
//请求接口
var params = {
'kpi':'browse','groupIds':this.beginBrowseGroup,
'kpi':'browse',
'type':type,
'value':value,
'index':this.beginBrowseGroup,
'day':this.beginBrowseDate
}
$.get('/h5/market/sylive2/stic/ajax_rank',params,function (res){
@@ -289,8 +294,13 @@
//预热阶段预约数据
getBeginBook(){
let that=this;
var type = this.info.group[this.beginBookGroup]['type']
var value = this.info.group[this.beginBookGroup]['value']
var params = {
'kpi':'subscribe','groupIds':this.beginBookGroup,
'kpi':'subscribe',
'type':type,
'value':value,
'index':this.beginBookGroup,
'day':this.beginBookDate
}
$.get('/h5/market/sylive2/stic/ajax_rank',params,function (res){
@@ -301,9 +311,14 @@
//直播阶段观看数据
getLiveView(){
let that=this;
var type = this.info.group[this.liveViewGroup]['type']
var value = this.info.group[this.liveViewGroup]['value']
var params = {
'kpi':'watch','groupIds':this.beginBookGroup,
'day':this.beginBookDate
'kpi':'watch',
'type':type,
'value':value,
'index':this.liveViewGroup,
'day':this.liveViewDate
}
$.get('/h5/market/sylive2/stic/ajax_rank',params,function (res){
that.liveView = res.data;
@@ -313,9 +328,14 @@
//预热阶段订单数据
getLiveOrder(){
let that=this;
var type = this.info.group[this.liveOrderGroup]['type']
var value = this.info.group[this.liveOrderGroup]['value']
var params = {
'kpi':'order','groupIds':this.beginBookGroup,
'day':this.beginBookDate
'kpi':'order',
'type':type,
'value':value,
'index':this.liveOrderGroup,
'day':this.liveOrderDate
}
$.get('/h5/market/sylive2/stic/ajax_rank',params,function (res){
that.liveOrder = res.data;
@@ -324,7 +344,7 @@
//选择条件
handleChange(e,key){
console.log(key)
console.log(e)
switch (key) {
case 'beginBrowseDate':
if(this.beginBrowseDate != e.target.value){
File diff suppressed because one or more lines are too long