add-sylive-2
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
/**
|
||||
* 私域直播
|
||||
*/
|
||||
class Sylive2_data_entity{
|
||||
|
||||
const DF_IMG = 'https://qs.haodian.cn/web/images/project/H5-ShiYu/goodslogo.jpg'; //东风图标
|
||||
|
||||
private $ci;
|
||||
private $map_kpi_biz = [
|
||||
'browse' => 'browse', 'subscribe' => 'subscribe', 'order' => 'orderTotal','watch' => 'watch'
|
||||
];
|
||||
|
||||
public function __construct(){
|
||||
$this->ci = &get_instance();
|
||||
$this->ci->load->model('market/market_sylive_user_model', 'user_model');
|
||||
$this->ci->load->model('market/market_sylive_activity_user_model', 'act_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('market/market_sylive_viewlog_model');
|
||||
$this->load->model('market/market_sylive_groups_model', 'groups_model');
|
||||
$this->load->model('market/market_sylive_groups_user_model', 'groups_user_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function top_kpidata($groupby,$where,$order,$page=1,$page_size=20,$select='',$tagId=0){
|
||||
$total = $this->ci->mdSytActivityKpiData->count($where,$groupby);
|
||||
$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');
|
||||
}
|
||||
}
|
||||
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');
|
||||
}
|
||||
$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] : [];
|
||||
$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,
|
||||
'num' => $val['t'].$num_tip,
|
||||
'headimg' => $headimg,
|
||||
'tip' => $tip,
|
||||
];
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'total' => $total,
|
||||
'lists' => $lists
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function top_groups_user($groupby,$where,$order,$page=1,$page_size=20,$select='',$kpi,$tagId=0){
|
||||
$total = $this->ci->groups_user_model->count($where,$groupby);
|
||||
$lists = [];
|
||||
if($total){
|
||||
$rows = $this->ci->groups_user_model->select_groupby($groupby, $where, $order, $page, $page_size, $select);
|
||||
$biz_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');
|
||||
}
|
||||
|
||||
$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];
|
||||
$name = $biz['groupsName'];
|
||||
$tip = $tagId==$val['bizId'] ? '本店' : '';
|
||||
}
|
||||
$lists[] = [
|
||||
'ranking' => $start+$key+1,
|
||||
'name' => $name,
|
||||
'num' => $val['t'].$num_tip,
|
||||
'headimg' => $headimg,
|
||||
'tip' => $tip,
|
||||
];
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'total' => $total,
|
||||
'lists' => $lists
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
public function __get($name)
|
||||
{
|
||||
if ('_model' === substr($name, -6)) {
|
||||
return $this->ci->$name;
|
||||
} elseif ('load' == $name) {
|
||||
return $this->ci->load;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* 私域直播
|
||||
*/
|
||||
class Sylive2_entity{
|
||||
|
||||
private $ci;
|
||||
private $map_kpi_biz = [
|
||||
'browse' => 'browse', 'subscribe' => 'subscribe', 'order' => 'orderTotal','watch' => 'watch'
|
||||
];
|
||||
|
||||
public function __construct(){
|
||||
$this->ci = &get_instance();
|
||||
$this->ci->load->model('market/market_sylive_user_model', 'user_model');
|
||||
$this->ci->load->model('market/market_sylive_activity_user_model', 'act_user_model');
|
||||
$this->ci->load->model('market/market_sylive_groups_model', 'groups_model');
|
||||
$this->ci->load->model('market/market_sylive_groups_user_model', 'groups_user_model');
|
||||
$this->ci->load->model('market/market_sys_dictionary_data_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级数据
|
||||
* @param $groupsId
|
||||
* @param $data
|
||||
* @return int
|
||||
*/
|
||||
public function get_group_lists($groupsId,$a_id,$data=[]){
|
||||
$row = $this->ci->groups_model->get(['groupsId'=>$groupsId,'activityId'=>$a_id],'groupsId,parentId,groupsName');
|
||||
if(!$row){
|
||||
return $data;
|
||||
}else{
|
||||
array_unshift($data,$row);
|
||||
if($row['parentId']){
|
||||
return $this->get_group_lists($row['parentId'],$a_id,$data);
|
||||
}else{
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加kpi记录
|
||||
* @param $params
|
||||
* @return array
|
||||
*/
|
||||
public function kpi_log($params)
|
||||
{
|
||||
if ($params['a_id'] && $params['uid'] && $params['cf_uid']) {
|
||||
$user = $this->user_model->get(['userId'=>$params['cf_uid']]);
|
||||
$act_user = $this->act_user_model->get(['activityId'=>$params['a_id'],'userId'=>$params['cf_uid']]);
|
||||
if(!$user || !$act_user){
|
||||
return array('code' => 0, 'msg' => '顾问不存在');
|
||||
}
|
||||
if(!in_array($params['kpi'],['order'])){ //订单可添加多条kpi
|
||||
$re_kpi = $this->ci->mdSytActivityKpiData->get(array("activityId" => $params['a_id'], 'userId' => $params['uid'], 'kpi' => $params['kpi']));
|
||||
if ($re_kpi) {//已添加过活动kpi(访活动只记录一次用户kpi记录)
|
||||
return array('code' => 0, 'msg' => '已添加过' . $params['kpi'] . '记录');
|
||||
}
|
||||
}
|
||||
//增加记录
|
||||
$addData = [
|
||||
'activityId' => $params['a_id'],
|
||||
'userId' => $user['userId'],
|
||||
'cfUserId' => $act_user['userId'],
|
||||
'kpi' => $params['kpi'],
|
||||
'createTime' => time(),
|
||||
'day' => date('Y-m-d')
|
||||
];
|
||||
$act_user['bizId'] && $addData['bizId'] = $act_user['bizId'];
|
||||
$act_user['levelId1'] && $addData['levelId1'] = $act_user['levelId1'];
|
||||
$act_user['levelId2'] && $addData['levelId2'] = $act_user['levelId2'];
|
||||
$act_user['levelId3'] && $addData['levelId3'] = $act_user['levelId3'];
|
||||
$params['tagId'] && $addData['tagId'] = $params['tagId'];
|
||||
$params['itemId'] && $addData['itemId'] = $params['itemId'];
|
||||
$jsondata = $params['jsondata'] ? $params['jsondata'] : [];
|
||||
$jsondata && $addData['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
$id = $this->ci->mdSytActivityKpiData->add($addData);
|
||||
if (!$id) {
|
||||
return array('code' => 0, 'msg' => '添加记录失败');
|
||||
}
|
||||
$this->kpi_count($params['a_id'],$params['kpi'],$params['cf_uid']);
|
||||
return array('code' => 1, 'msg' => '添加记录成功');
|
||||
} else {
|
||||
return array('code' => 0, 'msg' => '参数错误');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新统计数据
|
||||
* @param $a_id
|
||||
* @param $kpi
|
||||
* @param $cf_uid
|
||||
* @return array
|
||||
*/
|
||||
public function kpi_count($a_id,$kpi,$cf_uid){
|
||||
if($this->map_kpi_biz[$kpi] && $cf_uid && $a_id){
|
||||
$up_key = $this->map_kpi_biz[$kpi];
|
||||
$total = $this->ci->mdSytActivityKpiData->count(['activityId'=>$a_id,'cfUserId'=>$cf_uid,'kpi'=>$kpi]);
|
||||
$update = [
|
||||
$up_key => $total
|
||||
];
|
||||
//更新活动用户表统计数据
|
||||
$this->ci->act_user_model->update($update,['activityId'=>$a_id,'userId'=>$cf_uid]);
|
||||
//更新分组用户统计
|
||||
$this->ci->groups_user_model->update($update,['activityId'=>$a_id,'userId'=>$cf_uid]);
|
||||
//更新分组统计
|
||||
$group_user = $this->groups_user_model->get(['activityId'=>$a_id,'userId'=>$cf_uid]);
|
||||
if($group_user['levelId1']){
|
||||
$total = $this->ci->mdSytActivityKpiData->count(['activityId'=>$a_id,'levelId1'=>$group_user['levelId1'],'kpi'=>$kpi]);
|
||||
$update = [
|
||||
$up_key => $total
|
||||
];
|
||||
$this->ci->groups_model->update($update,['activityId'=>$a_id,'groupsId'=>$group_user['levelId1']]);
|
||||
}
|
||||
if($group_user['levelId2']){
|
||||
$total = $this->ci->mdSytActivityKpiData->count(['activityId'=>$a_id,'levelId2'=>$group_user['levelId2'],'kpi'=>$kpi]);
|
||||
$update = [
|
||||
$up_key => $total
|
||||
];
|
||||
$this->ci->groups_model->update($update,['activityId'=>$a_id,'groupsId'=>$group_user['levelId2']]);
|
||||
}
|
||||
if($group_user['levelId3']){
|
||||
$total = $this->ci->mdSytActivityKpiData->count(['activityId'=>$a_id,'levelId3'=>$group_user['levelId3'],'kpi'=>$kpi]);
|
||||
$update = [
|
||||
$up_key => $total
|
||||
];
|
||||
$this->ci->groups_model->update($update,['activityId'=>$a_id,'groupsId'=>$group_user['levelId3']]);
|
||||
}
|
||||
//更新门店
|
||||
if($group_user['bizId']){
|
||||
$total = $this->ci->mdSytActivityKpiData->count(['activityId'=>$a_id,'bizId'=>$group_user['bizId'],'kpi'=>$kpi]);
|
||||
$update = [
|
||||
$up_key => $total
|
||||
];
|
||||
$this->ci->groups_model->update($update,['activityId'=>$a_id,'groupsId'=>$group_user['bizId']]);
|
||||
}
|
||||
return ['code'=>1,'msg'=>'更新成功'];
|
||||
}else{
|
||||
return ['code'=>0,'msg'=>'参数错误'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级字典
|
||||
* @param $a_id
|
||||
* @return array
|
||||
*/
|
||||
public function level_disk($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->map('dictDataCode','dictDataName',$where,'','','','dictDataName,dictDataCode');
|
||||
}
|
||||
return $disk;
|
||||
}
|
||||
|
||||
public function __get($name)
|
||||
{
|
||||
if ('_model' === substr($name, -6)) {
|
||||
return $this->ci->$name;
|
||||
} elseif ('load' == $name) {
|
||||
return $this->ci->load;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,439 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
require_once 'Common.php';
|
||||
require_once COMMPATH . 'third_party/phpqrcode/phpqrcode.php';
|
||||
|
||||
class Act extends Wx {
|
||||
|
||||
private $item_banner = ['https://qs.haodian.cn/web/images/project/H5-ShiYu/goods.jpg'];
|
||||
private $template_id = 'DO0B9IYYub1d0oNvy9czzGbe6_1EU8PQmnLEoDOcmXA';
|
||||
private $a_id,$skey;
|
||||
|
||||
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_subscribemsg_model','mdSytSubscribemsg');
|
||||
$this->load->model('market/market_sylive_activity_kpidata_model','mdSytActivityKpiData');
|
||||
$this->load->model('market/market_sylive_order_model');
|
||||
$this->load->library('market/sylive_entity');
|
||||
$this->load->library('market/sylive2_entity');
|
||||
$this->load->library('qiniu');
|
||||
$this->skey = $this->input->get('skey');
|
||||
$param = $this->myencryption->base64url_decode($this->skey);
|
||||
$this->a_id = intval($param['a_id']);//活动id
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$alert_code = $this->input->get('alert_code');
|
||||
if (!$this->a_id) {
|
||||
throw new Hd_exception("参数错误", 400);
|
||||
}
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$user = $this->user_model->get(['userId'=>$this->uid],'unionid,nickname,headimg');
|
||||
$timeStart = strtotime($row['timeStart']);
|
||||
$info['s_time'] = time() < $timeStart ? $timeStart-time() : 0;
|
||||
$info['bg'] = $row['bgImg'] ? build_qiniu_image_url($row['bgImg']) : '';
|
||||
$info['content'] = $row['introduction'];
|
||||
$act_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$this->a_id]);
|
||||
//一次性订阅
|
||||
$re_s = $this->mdSytSubscribemsg->get(array('activityId' => $this->a_id, 'userId' => $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/sylive2/act/userinfo?skey={$this->skey}&type=sub";
|
||||
}else{
|
||||
$this->load->config('wechat');
|
||||
$config = $this->config->item('hdy');
|
||||
$sub_redirect_url = urlencode(http_host_com('home') . '/h5/market/sylive2/act/subscribemsg?skey=' . $this->skey
|
||||
. '&s_time=' . $row['timeStart']);
|
||||
$subscribemsg = "https://mp.weixin.qq.com/mp/subscribemsg?action=get_confirm&appid={$config['appid']}&scene=0&template_id={$this->template_id}&redirect_url={$sub_redirect_url}&reserved=test#wechat_redirect";
|
||||
}
|
||||
}
|
||||
//浏览
|
||||
$params = array('a_id' => $this->a_id, 'uid' => $this->uid,'cf_uid' => $act_user['channelId'], 'kpi' => 'browse');
|
||||
$this->sylive2_entity->kpi_log($params);
|
||||
$live_status = 0; //直播未开始
|
||||
if(time()>strtotime($row['timeStart']) && time()<=strtotime($row['timeEnd'])){ //直播期间人数
|
||||
$row['liveStatus']!=1 && $this->market_sylive_activity_model->update(['liveStatus'=>1],['activityId'=>$this->a_id]); //更新直播间状态
|
||||
$live_status = 1; //直播中
|
||||
}
|
||||
if(time()>strtotime($row['timeEnd'])){ //直播结束
|
||||
$row['liveStatus']!=2 && $this->market_sylive_activity_model->update(['liveStatus'=>2],['activityId'=>$this->a_id]); //更新直播间状态
|
||||
$live_status = 2; //直播结束
|
||||
}
|
||||
$share_skey = "a_id=" . $this->a_id . "&cf_uid=" . $this->uid;
|
||||
$info['live_status'] = $live_status;
|
||||
$info['skey'] = $this->myencryption->base64url_encode($share_skey);
|
||||
$info['a_id'] = $this->a_id;
|
||||
$info['subscribemsg'] = $subscribemsg;
|
||||
$info['statisticsurl'] = $info['shareurl'] = $info['code'] = '';
|
||||
if($act_user['groupsId']){
|
||||
$info['shareurl'] = '/h5/market/sylive2/act/share?skey='.$info['skey'];
|
||||
$info['statisticsurl'] = "/h5/market/sylive2/stic?a_id={$this->a_id}";
|
||||
$info['rankingurl'] = "/h5/market/sylive2/stic/ranking?a_id={$this->a_id}";
|
||||
}
|
||||
|
||||
$info['channelImg'] = build_qiniu_image_url($row['channelImg']);
|
||||
$userid = $user['unionid'] ? $user['unionid'] : $this->uid;
|
||||
$ts = time()*1000;
|
||||
$sign = md5($this->secretkey.$userid.$this->secretkey.$ts);
|
||||
if(!$user['nickname'] && !$user['headimg']){
|
||||
$info['live_url'] = http_host_com('home').'/h5/market/sylive2/act/userinfo?skey='.$this->skey;
|
||||
}else{
|
||||
$info['live_url'] = "https://live.haodian.cn/watch/{$row['channelId']}?userid={$userid}&ts={$ts}&sign={$sign}";
|
||||
}
|
||||
$info['my_url'] = http_host_com('home')."/h5/market/sylive2/act/userinfo?skey={$this->skey}&type=my";
|
||||
//微信分享
|
||||
$wx_info = $this->share_info($row);
|
||||
$info['show_code'] = $is_show_code ? 1 : 0;
|
||||
$info['alert_code'] = $alert_code ? 1 : 0;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||
$this->data['share'] = $wx_info['share'];
|
||||
$this->data['_title'] = $row['title'];
|
||||
$this->data['skey'] = $info['skey'];
|
||||
$this->show_view('h5/market/sylive2/act/index');
|
||||
}
|
||||
|
||||
//获取最新订阅用户
|
||||
public function subscribemsg_lists(){
|
||||
$map_kpi_name = [
|
||||
'browse' => '进入了直播间', 'subscribe' => '预约了直播通知'
|
||||
];
|
||||
$a_id = $this->input->get('a_id');
|
||||
$live_status = $this->input->get('live_status');
|
||||
$field = 'userId,createTime,kpi';
|
||||
$lists = [];
|
||||
$where = [
|
||||
'activityId' => $a_id,
|
||||
'kpi' => 'subscribe'
|
||||
];
|
||||
if($live_status){
|
||||
$where['kpi'] = 'browse';
|
||||
}
|
||||
$rows = $this->mdSytActivityKpiData->select($where,'id desc',1,30,$field);
|
||||
if($rows){
|
||||
$users = [];
|
||||
$uids = implode(',',array_unique(array_column($rows,'userId')));
|
||||
if($uids){
|
||||
$where = [
|
||||
"userId in ($uids)" => null,
|
||||
];
|
||||
$users = $this->user_model->map('userId','nickname',$where,'','','','userId,nickname');
|
||||
}
|
||||
foreach ($rows as $item) {
|
||||
$nickname = $users[$item['userId']] ? $users[$item['userId']] : "用户{$item['userId']}";
|
||||
$lists[] = [
|
||||
'name' => $nickname,
|
||||
'tip' => $map_kpi_name[$item['kpi']],
|
||||
];
|
||||
}
|
||||
}
|
||||
$data['lists'] = $lists;
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:获取授权发送一次性订阅接口
|
||||
* Created on: 2020/11/26 17:11
|
||||
* Created by: dengbw
|
||||
*/
|
||||
public function subscribemsg()
|
||||
{
|
||||
$skey = $this->input->get('skey');
|
||||
$s_time = $this->input->get('s_time');//直播时间
|
||||
$param = $this->myencryption->base64url_decode($skey);
|
||||
$a_id = intval($param['a_id']);//活动id
|
||||
$action = $this->input->get('action');
|
||||
$show_code = 0;
|
||||
if ($s_time && $action == "confirm") {
|
||||
$add_data['activityId'] = $a_id;
|
||||
$add_data['openId'] = $this->input->get('openid');
|
||||
$add_data['scene'] = $this->input->get('scene');
|
||||
$re_s = $this->mdSytSubscribemsg->get($add_data);
|
||||
if (!$re_s) {
|
||||
$add_data['userId'] = $this->uid;
|
||||
$add_data['templateId'] = $this->input->get('template_id');
|
||||
$add_data['url'] = http_host_com('home') . "/h5/market/sylive2/act?skey=" . $this->myencryption->base64url_encode("a_id=" . $a_id);;
|
||||
$add_data['timeStart'] = $s_time;
|
||||
$add_data['createTime'] = time();
|
||||
$add_data['status'] = 0;
|
||||
$id = $this->mdSytSubscribemsg->add($add_data);
|
||||
if ($id) {
|
||||
$act_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$a_id]);
|
||||
//订阅用户加统计
|
||||
$params = array('a_id' => $a_id, 'uid' => $this->uid,'cf_uid' => $act_user['channelId'], 'kpi' => 'subscribe');
|
||||
$this->sylive2_entity->kpi_log($params);
|
||||
$p_user = [];
|
||||
$act_user['channelId'] && $p_user = $this->user_model->get(['userId'=>$act_user['channelId']]);
|
||||
$p_user['teamId'] && $show_code = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$url = http_host_com('home') . "/h5/market/sylive2/act?skey={$skey}&alert_code={$show_code}";
|
||||
redirect($url);
|
||||
}
|
||||
|
||||
public function share(){
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$shareImg = json_decode($row['shareImg'],true);
|
||||
$shareTitle = $row['shareTitle'] ? json_decode($row['shareTitle'],true) : [];
|
||||
$lists = [];
|
||||
if($shareImg){
|
||||
$share_skey = "a_id=" . $this->a_id . "&cf_uid=" . $this->uid;
|
||||
$share_url = http_host_com('home') . "/h5/market/sylive2/act?skey=" . $this->myencryption->base64url_encode($share_skey);
|
||||
$errorCorrectionLevel = 'L'; //容错级别
|
||||
$matrixPointSize = 5; //生成图片大小
|
||||
//生成二维码图片
|
||||
$file_name = md5($share_url).'.png';
|
||||
$file_path = "temp/{$file_name}";
|
||||
if (!file_exists(FCPATH.'temp/')) {
|
||||
$oldumask = umask(0);
|
||||
mkdir(FCPATH.'temp/', 0777, true);
|
||||
umask($oldumask);
|
||||
}
|
||||
QRcode::png($share_url, FCPATH.$file_path, $errorCorrectionLevel, $matrixPointSize, 1);
|
||||
$res = $this->qiniu->save($file_name, file_get_contents(FCPATH.$file_path));
|
||||
if($res['url']){
|
||||
@unlink(FCPATH.$file_path);
|
||||
$qr_code = build_qiniu_image_url($res['url']);
|
||||
}else{
|
||||
$qr_code = '/h5/market/sylive2/myqrcode/get?url=' . $share_url;
|
||||
}
|
||||
foreach ($shareImg as $item) {
|
||||
$img_url = build_qiniu_image_url($item);
|
||||
$img_info = file_get_contents($img_url.'?imageInfo');
|
||||
if($img_info){
|
||||
$img_info = json_decode($img_info,true);
|
||||
}
|
||||
$lists[] = [
|
||||
"img" => $img_url,
|
||||
"code" => $qr_code,
|
||||
'width' => $img_info['width'] ? $img_info['width'] : 750,
|
||||
'height' => $img_info['height'] ? $img_info['height'] : 1130,
|
||||
];
|
||||
}
|
||||
}
|
||||
$user = $this->user_model->get(['userId'=>$this->uid],'uname,nickname');
|
||||
$act_row = $this->act_user_model->get(['id'=>$this->act_uid],'groupsId');
|
||||
if($act_row['groupsId']){
|
||||
$group_lists = $this->sylive2_entity->get_group_lists($act_row['groupsId'],$this->a_id);
|
||||
$this->data['posterTip'] = "{$group_lists[0]['groupsName']}{$user['uname']}诚挚邀请您参与";
|
||||
}else{
|
||||
$this->data['posterTip'] = "{$user['nickname']}诚挚邀请您参与";
|
||||
}
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['shareTitle'] = $shareTitle;
|
||||
//微信分享
|
||||
$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/sylive2/act/share');
|
||||
}
|
||||
|
||||
public function item(){
|
||||
$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){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$item = $jsondata['item'] ? $jsondata['item'] : [];
|
||||
$is_pay = $this->market_sylive_order_model->count(['itemId'=>$a_id,'status'=>1,'userId'=>$this->uid,'type'=>0]);
|
||||
if($is_pay){
|
||||
$url = http_host_com('home').'/h5/market/sylive2/ucenter/mygift?skey='.$skey;
|
||||
redirect($url);exit;
|
||||
}
|
||||
$e_time = time() < strtotime($row['timeEnd']) ? strtotime($row['timeEnd']) - time() : 0;
|
||||
$banner = $this->item_banner;
|
||||
$validity = '';
|
||||
if($item['useTimeStart'] || $item['useTimeEnd']){
|
||||
$useTimeStart = date('Y-m-d',strtotime($item['useTimeStart']));
|
||||
$useTimeEnd = date('Y-m-d',strtotime($item['useTimeEnd']));
|
||||
$validity = "有效期 {$useTimeStart} - {$useTimeEnd}";
|
||||
}
|
||||
$info = [
|
||||
'title' => $item['title'] ? $item['title'] : '',
|
||||
'e_time' => $e_time,
|
||||
'price' => $item['price'] ? $item['price'] : '',
|
||||
'content' => $item['introduction'] ? $item['introduction'] : '',
|
||||
'banner' => $banner,
|
||||
'stock' => $row['stock'],
|
||||
'skey' => $skey,
|
||||
'validity' => $validity,
|
||||
'introTitle' => '权益说明',
|
||||
];
|
||||
$this->data['info'] = $info;
|
||||
$this->data['_title'] = $row['title'];
|
||||
//微信分享
|
||||
$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/sylive2/act/item');
|
||||
}
|
||||
|
||||
//支付
|
||||
public function post_pay(){
|
||||
$redis = load_cache('redis');
|
||||
$redis_obj = $redis->redis();
|
||||
$skey = $this->input->post('skey');
|
||||
$name = $this->input->post('name');
|
||||
$mobile = $this->input->post('telPhone');
|
||||
$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->show_json('',400,'参数错误');
|
||||
}
|
||||
$mb_key = 'SYLIVE_ITEM_AID_'.$a_id;
|
||||
if(!mobile_valid($mobile)){
|
||||
$this->show_json('',400,'请输入正确手机号');
|
||||
}
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$item = $jsondata['item'] ? $jsondata['item'] : [];
|
||||
//判断是否已支付
|
||||
$o_row = $this->market_sylive_order_model->get(['itemId'=>$a_id,'status'=>1,'userId'=>$this->uid,'type'=>0]);
|
||||
if($o_row){
|
||||
$this->show_json('',400,'已支付,请勿重复支付');
|
||||
}
|
||||
$pay_price = $item['price'];
|
||||
if($pay_price<=0){
|
||||
$this->show_json('',400,'无需支付');
|
||||
}
|
||||
if($row['stock']<=0){
|
||||
$this->show_json('',400,'已售罄');
|
||||
}
|
||||
$unpay = $this->market_sylive_order_model->get(['itemId'=>$a_id,'status'=>0,'userId'=>$this->uid,'expireTime>'=>time(),'type'=>0]);
|
||||
if(!$unpay){
|
||||
$mb_count = $redis_obj->sCard($mb_key); //获取集合中用户数量
|
||||
if($mb_count && $mb_count>$row['stock']+10){
|
||||
$mb = $redis_obj->sMembers($mb_key);
|
||||
$this->show_json('',400,'已售罄:'.json_encode($mb,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
try {
|
||||
$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']]);
|
||||
$this->market_sylive_order_model->db->trans_begin();
|
||||
//限购一件
|
||||
$u_row = $this->market_sylive_order_model->get(['itemId'=>$a_id,'status>='=>0,'userId'=>$this->uid]);
|
||||
if($u_row){
|
||||
throw new Exception('限购一件');
|
||||
}
|
||||
$this->load->helper('order');
|
||||
$unpay = [
|
||||
'sid' => create_order_no('350200','market'),
|
||||
'userId' => $this->uid,
|
||||
'itemId' => $a_id,
|
||||
'itemTitle' => $item['title'],
|
||||
'totalPrice' => $pay_price,
|
||||
'expireTime' => time()+5*60,//订单过期时间
|
||||
'createTime' => date('Y-m-d H:i:s')
|
||||
];
|
||||
$name && $unpay['uname'] = $name;
|
||||
$mobile && $unpay['mobile'] = $mobile;
|
||||
$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();
|
||||
throw new Exception('创建订单失败');
|
||||
}
|
||||
$this->market_sylive_activity_model->update(['stock = stock-1' =>null],['activityId'=>$a_id,'stock>'=>0]);
|
||||
$res = $this->market_sylive_activity_model->db->affected_rows();
|
||||
if(!$res){
|
||||
throw new Exception('已售罄');
|
||||
}
|
||||
$this->market_sylive_order_model->db->trans_commit();
|
||||
$redis_obj->sRem($mb_key,$this->uid); //删除集合
|
||||
}catch (Exception $e){
|
||||
$redis_obj->sRem($mb_key,$this->uid); //删除集合
|
||||
$this->market_sylive_order_model->db->trans_rollback();
|
||||
$this->show_json('',400,$e->getMessage());
|
||||
}
|
||||
}
|
||||
$user = $this->user_model->get(['userId'=>$this->uid]);
|
||||
$notify_url = http_host_com('home').'/h5/market/sylive2/notify';
|
||||
$other_data = [];
|
||||
$pay_config = $this->market_sylive_activity_model->pay_config($row['mchId']);
|
||||
$pay_config && $other_data['pay_config'] = $pay_config;
|
||||
$result = $this->unorder($unpay['sid'],$unpay['totalPrice'],$user['openid'],$unpay['itemTitle'],$notify_url,$unpay['expireTime'],$other_data);
|
||||
if(!$result['code']){
|
||||
$this->show_json('',400,$result['msg']);
|
||||
}
|
||||
$this->show_json($result['data'],200,'操作成功');
|
||||
}
|
||||
|
||||
//获取微信用户信息
|
||||
public function userinfo(){
|
||||
$ret = $this->set_auth('',1);
|
||||
if($ret){
|
||||
$update = [
|
||||
"sex" => $ret['sex'] ? 1 : 0,
|
||||
];
|
||||
$ret['nickname'] && $update['nickname'] = strval($ret['nickname']);
|
||||
$ret['headimgurl'] && $update['headimg'] = strval($ret['headimgurl']);
|
||||
$ret['unionid'] && $update['unionid'] = $ret['unionid'];
|
||||
$this->user_model->update($update,['userId'=>$this->uid]);
|
||||
}
|
||||
$skey = $this->input->get('skey');
|
||||
$type = $this->input->get('type');
|
||||
if (!$skey) {
|
||||
throw new Hd_exception("参数错误", 400);
|
||||
}
|
||||
$param = $this->myencryption->base64url_decode($skey);
|
||||
$a_id = intval($param['a_id']);//活动id
|
||||
if (!$a_id) {
|
||||
throw new Hd_exception("参数错误", 400);
|
||||
}
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
if($type=='sub'){ //订阅跳转
|
||||
$this->load->config('wechat');
|
||||
$config = $this->config->item('hdy');
|
||||
$sub_redirect_url = urlencode(http_host_com('home') . '/h5/market/sylive2/act/subscribemsg?skey=' . $skey
|
||||
. '&s_time=' . $row['timeStart']);
|
||||
$subscribemsg = "https://mp.weixin.qq.com/mp/subscribemsg?action=get_confirm&appid={$config['appid']}&scene=0&template_id={$this->template_id}&redirect_url={$sub_redirect_url}&reserved=test#wechat_redirect";
|
||||
redirect($subscribemsg);
|
||||
}elseif($type=='my'){ //跳转我的
|
||||
$my_url = http_host_com('home')."/h5/market/sylive2/ucenter?skey={$skey}";
|
||||
redirect($my_url);
|
||||
}else{
|
||||
$user = $this->user_model->get(['userId'=>$this->uid],'unionid,nickname,headimg');
|
||||
$userid = $user['unionid'] ? $user['unionid'] : $this->uid;
|
||||
$ts = time()*1000;
|
||||
$sign = md5($this->secretkey.$userid.$this->secretkey.$ts);
|
||||
$live_url = "https://live.haodian.cn/watch/{$row['channelId']}?userid={$userid}&ts={$ts}&sign={$sign}";
|
||||
redirect($live_url);
|
||||
}
|
||||
}
|
||||
//进入直播间统计
|
||||
public function golive(){
|
||||
$params = $this->input->get();
|
||||
$a_id = $params['a_id'];
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
|
||||
if($row && time()>strtotime($row['timeStart']) && time()<=strtotime($row['timeEnd'])){
|
||||
$act_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$a_id]);
|
||||
$this->sylive2_entity->kpi_log(['a_id' => $a_id, 'uid' => $this->uid,'cf_uid' => $act_user['channelId'], 'kpi' => 'watch']);
|
||||
$this->show_json([],200,'操作成功');
|
||||
}else{
|
||||
$this->show_json([],400,'参数错误');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
require_once 'Common.php';
|
||||
|
||||
class Biz extends Admin{
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
//活动列表
|
||||
public function index(){
|
||||
$this->data['multi_org'] = $_SESSION[self::SESSION_KEY]['multi_org'] ? 1 : 0;
|
||||
$this->show_view('h5/market/sylive2/biz/index');
|
||||
}
|
||||
|
||||
public function act_list(){
|
||||
$page = $this->input->get('page');
|
||||
$size = $this->input->get('size');
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 20;
|
||||
$where = [
|
||||
'userId' => $this->uid,
|
||||
'status' => 0,
|
||||
];
|
||||
$total = $this->groups_user_model->count($where);
|
||||
$rows = $this->groups_user_model->select($where,'activityId desc',$page,$size);
|
||||
$lists = [];
|
||||
if($rows){
|
||||
$act_ids = implode(',',array_unique(array_column($rows,'activityId')));
|
||||
$act_rows = [];
|
||||
if($act_ids){
|
||||
$where = [
|
||||
"activityId in ({$act_ids})" => null,
|
||||
];
|
||||
}
|
||||
$act_ids && $act_rows = $this->market_sylive_activity_model->map('activityId','',$where,'','','','activityId,title,timeStart,timeEnd,jsondata');
|
||||
foreach ($rows as $item) {
|
||||
$act = $act_rows[$item['activityId']] ? $act_rows[$item['activityId']][0] : [];
|
||||
if($act){
|
||||
$jsondata = json_decode($act['jsondata'],true);
|
||||
$banner = $jsondata['banner'] ? build_qiniu_image_url($jsondata['banner']) : '';
|
||||
$lists[] = [
|
||||
'title' => $act['title'],
|
||||
'img' => $banner,
|
||||
'time' => date('Y-m-d H:i',strtotime($act['timeStart'])).'-'.date('Y-m-d H:i',strtotime($act['timeEnd'])),
|
||||
'url' => "/h5/market/sylive2/biz/userinfo?a_id={$item['activityId']}"
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'list' => $lists,
|
||||
'total' => $total
|
||||
];
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
//获取微信用户信息
|
||||
public function userinfo(){
|
||||
if(!$_SESSION[self::SESSION_KEY]['all_info']){
|
||||
$ret = $this->set_auth('',1);
|
||||
if($ret){
|
||||
$update = [
|
||||
"sex" => $ret['sex'] ? 1 : 0,
|
||||
];
|
||||
$ret['nickname'] && $update['nickname'] = strval($ret['nickname']);
|
||||
$ret['headimgurl'] && $update['headimg'] = strval($ret['headimgurl']);
|
||||
$ret['unionid'] && $update['unionid'] = $ret['unionid'];
|
||||
$this->user_model->update($update,['userId'=>$this->uid]);
|
||||
}
|
||||
$_SESSION[self::SESSION_KEY]['all_info'] =1;
|
||||
}
|
||||
$a_id = $this->input->get('a_id');
|
||||
$my_url = http_host_com('home')."/h5/market/sylive2/stic?a_id={$a_id}";
|
||||
redirect($my_url);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
defined('APPPATH') OR exit('No direct script access allowed');
|
||||
/**
|
||||
* User: lcc
|
||||
* Date: 2022/09/18
|
||||
* Time: 17:13
|
||||
*/
|
||||
abstract class Common extends CI_Controller{
|
||||
|
||||
const SESSION_KEY = 'market_sylive_session';
|
||||
|
||||
protected $data;
|
||||
protected $white_login_method=[]; //授权白名单
|
||||
protected $uid;
|
||||
protected $mobile;
|
||||
protected $act_uid;
|
||||
protected $session;
|
||||
protected $log_dir = 'market/sylive';
|
||||
protected $secret = "market_sylive_h5_test";
|
||||
protected $secretkey = '7a23vx9257';
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$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_groups_model', 'groups_model');
|
||||
$this->load->model('market/market_sylive_groups_user_model', 'groups_user_model');
|
||||
$this->load->model('market/market_sylive_activity_model');
|
||||
|
||||
$this->load->library('hd_exception');
|
||||
$this->load->library('MyEncryption');
|
||||
session_start();
|
||||
if ($_SESSION[self::SESSION_KEY]) {
|
||||
$this->session = $_SESSION[self::SESSION_KEY];
|
||||
$this->uid = $this->session['userId'];
|
||||
$this->act_uid = $this->session['act_uid'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $view
|
||||
*/
|
||||
protected function show_view($view){
|
||||
$this->load->view('h5/market/sylive2/header',$this->data);
|
||||
$this->load->view($view);
|
||||
$this->load->view('h5/market/sylive2/footer');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $data
|
||||
* @param int $code
|
||||
* @param string $msg
|
||||
* @param string $url
|
||||
*/
|
||||
protected function show_json($data, $code = 200, $msg = 'success', $url = '')
|
||||
{
|
||||
if(!isset($data['code'])){
|
||||
$data = array('data' => $data, 'code' => $code, 'msg' => $msg, 'url' => $url);
|
||||
}
|
||||
|
||||
exit(json_encode($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $url 回调url地址
|
||||
* @param $auth 是否信息授权
|
||||
* @return void
|
||||
* @throws Hd_exception
|
||||
*/
|
||||
protected function set_auth($url='',$auth=0){
|
||||
$this->load->helper('url');
|
||||
$this->load->config('wechat');
|
||||
$config = $this->config->item('hdy');
|
||||
$code = $this->input->get('code');
|
||||
!$url && $url = http_host_com('home').$_SERVER['REQUEST_URI'];
|
||||
$auth && $url = $_SERVER['QUERY_STRING'] ? $url."&auth={$auth}" : $url."?auth={$auth}";
|
||||
if ($code) {//授权码获取微信信息
|
||||
$auth_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$config['appid']}&secret={$config['appSecret']}&code={$code}&grant_type=authorization_code";
|
||||
$res = file_get_contents($auth_url);
|
||||
$ret = json_decode($res, true);
|
||||
$access_token = $ret['access_token'];
|
||||
$openid = $ret['openid'];
|
||||
$unionid = $ret['unionid'];
|
||||
if($this->input->get('auth') && $access_token){
|
||||
$u_info_url = "https://api.weixin.qq.com/sns/userinfo?access_token={$access_token}&openid={$openid}&lang=zh_CN";
|
||||
$u_ret = file_get_contents($u_info_url);
|
||||
$ret = json_decode($u_ret,true);
|
||||
}
|
||||
if(!$openid){
|
||||
debug_log("[error]# " . $res, __FUNCTION__, $this->log_dir);
|
||||
throw new Hd_exception('获取用户信息失败', 400);
|
||||
}
|
||||
return $ret;
|
||||
} elseif ($auth) {//信息授权获取用户微信昵称/头像
|
||||
$redirect_uri = urlencode($url);
|
||||
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$config['appid']}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect&forcePopup=true";
|
||||
redirect($auth_url);
|
||||
} else{//静默授权获取用户openid
|
||||
$redirect_uri = urlencode($url);
|
||||
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$config['appid']}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
|
||||
redirect($auth_url);
|
||||
}
|
||||
}
|
||||
//微信分享信息
|
||||
protected function share_info($act_row=[]){
|
||||
$a_id = $act_row['activityId'];
|
||||
$share_skey = "a_id=" . $a_id . "&cf_uid=" . $this->uid;
|
||||
$this->load->library('Jssdk');
|
||||
$jssdk = new Jssdk('liche');
|
||||
$sign_package = $jssdk->getSignPackage();
|
||||
$share = [];
|
||||
if($act_row){
|
||||
//微信分享
|
||||
$share_url = http_host_com('home') . "/h5/market/sylive2/act?skey=" . $this->myencryption->base64url_encode($share_skey);
|
||||
$shareTitle = $act_row['shareTitle'] ? json_decode($act_row['shareTitle'],true) : [];
|
||||
$share = array(
|
||||
'title' => $act_row['title'],
|
||||
"img" => $act_row['sharePhoto'] ? build_qiniu_image_url($act_row['sharePhoto']) : '',
|
||||
"desc" => $shareTitle[array_rand($shareTitle)],
|
||||
"url" => $share_url
|
||||
);
|
||||
}
|
||||
return ['sign_package' => $sign_package ,'share' => $share];
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信下单
|
||||
* @param $trade_no
|
||||
* @param $price
|
||||
* @param $openid
|
||||
* @param $body
|
||||
* @param $notify_url
|
||||
* @param $expire_time
|
||||
* @param $attach
|
||||
* @param $wx_type
|
||||
* @param $other_data
|
||||
* @return array|false
|
||||
* @throws WxPayException
|
||||
*/
|
||||
protected function unorder($trade_no,$price,$openid,$body,$notify_url,$expire_time,$other_data=[]){
|
||||
if(!$body){return false;}
|
||||
require_once APPPATH."../api/third_party/WXpay/WxPay.Api.php";
|
||||
if($other_data['pay_config'] && file_exists($other_data['pay_config'])){
|
||||
require_once $other_data['pay_config'];
|
||||
}else{
|
||||
require_once APPPATH."../api/third_party/WXconfig/hdy_WxPay.Config.php";
|
||||
}
|
||||
$config = new WxPayConfig();
|
||||
$wxpay = new WxPayUnifiedOrder();
|
||||
$wxpay->SetVersion('1.0');
|
||||
$wxpay->SetBody($body); //简单描述
|
||||
$other_data['attach'] && $wxpay->SetAttach($other_data['attach']); //附加信息
|
||||
$wxpay->SetNotify_url($notify_url);
|
||||
$wxpay->SetOut_trade_no($trade_no); //订单号
|
||||
$wxpay->SetTotal_fee($price * 100); //支付价格
|
||||
$wxpay->SetTime_start(date("YmdHis")); //交易起始时间
|
||||
$wxpay->SetTime_expire(date('YmdHis',$expire_time)); //交易结束时间
|
||||
$wxpay->SetTrade_type("JSAPI"); //设置交易类型
|
||||
$wxpay->SetOpenid($openid); //openid
|
||||
$return = WxPayApi::unifiedOrder($config, $wxpay); //统一支付
|
||||
if($return['result_code'] == 'SUCCESS') {
|
||||
$wxpay_api = new WxPayJsApiPay();
|
||||
$jsApiParameters = WxPayApi::GetJsApiParameters($return, $config, $wxpay_api);
|
||||
$jsApiParameters = json_decode($jsApiParameters, true);
|
||||
return ['code'=>1,'data'=>$jsApiParameters,'msg'=>'下单成功'];
|
||||
}else{
|
||||
$msg = $return['return_msg'] ? $return['return_msg'].$return['err_code_des'] : $return['return_msg'];
|
||||
return ['code'=>0,'data'=>[],'msg'=>$msg];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Admin extends Common{
|
||||
const WX_SESSION = "market_wx_info";
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function _remap($method){
|
||||
try{
|
||||
$this->session = $_SESSION[self::SESSION_KEY];
|
||||
$this->mobile = $this->session['mobile'];
|
||||
if(!in_array($method,$this->white_login_method) && !$_SESSION[self::SESSION_KEY]['mobile'] && !$this->uid){
|
||||
$ret = $this->set_auth();
|
||||
$openid = $ret['openid'];
|
||||
$row_wechat = $this->user_model->get(['openid' => $openid,'status'=>0,'organizationId>'=>0]);
|
||||
if(!$row_wechat){
|
||||
$_SESSION[self::WX_SESSION] = $ret;
|
||||
header('Location:/h5/market/sylive2/login');exit;
|
||||
}
|
||||
$_SESSION[self::SESSION_KEY]['mobile'] = $row_wechat['mobile'];
|
||||
$org_url = http_host_com('home')."/h5/market/sylive2";
|
||||
redirect($org_url);
|
||||
}
|
||||
return $this->$method();
|
||||
} catch(Hd_exception $e){//处理异常
|
||||
$msg = $e->getMessage();
|
||||
$data = array('heading' => 'Warning', 'message' => $msg);
|
||||
return $this->load->view('errors/html/error_404',$data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Wx extends Common{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function _remap($method){
|
||||
try{
|
||||
if(!$this->act_uid){
|
||||
$this->session = $this->uid = '';
|
||||
}
|
||||
if(!in_array($method,$this->white_login_method) && !$this->uid){
|
||||
$ret = $this->set_auth();
|
||||
$openid = $ret['openid'];
|
||||
$skey = $this->input->get('skey');
|
||||
$param = $this->myencryption->base64url_decode($skey);
|
||||
//找管理员角色
|
||||
$where = [
|
||||
'activityId' => $param['a_id'],
|
||||
'status' => 0,
|
||||
"userId in (select `userId` from lc_market_sylive_user where openid='{$openid}')" => null
|
||||
];
|
||||
$row_wechat = $this->groups_user_model->get($where);
|
||||
if(!$row_wechat){
|
||||
$row_wechat = $this->user_model->get(['status'=>0,'openid'=>$openid]);//普通用户角色
|
||||
}
|
||||
if(!$row_wechat){ //创建用户
|
||||
$add = array(
|
||||
"openid" => $openid,
|
||||
"sex" => $ret['sex'] ? 1 : 0,
|
||||
"createTime" => date('Y-m-d H:i:s')
|
||||
);
|
||||
$ret['nickname'] && $add['nickname'] = strval($ret['nickname']);
|
||||
$ret['headimgurl'] && $add['headimg'] = strval($ret['headimgurl']);
|
||||
$ret['unionid'] && $add['unionid'] = $ret['unionid'];
|
||||
$this->uid = $this->user_model->add($add);
|
||||
if (!$this->uid) {
|
||||
debug_log("[error]# " . $this->mdWeixinUsers->db->last_query(), __FUNCTION__, $this->log_dir);
|
||||
}
|
||||
}else{
|
||||
$this->uid = $row_wechat['userId'];
|
||||
}
|
||||
$act_user = $this->act_user_model->get(['activityId'=>$param['a_id'],'userId'=>$this->uid]);
|
||||
if(!$act_user && $param['a_id']){
|
||||
$act_data = [
|
||||
'activityId' => $param['a_id'],
|
||||
'userId' => $this->uid,
|
||||
"createTime" => date('Y-m-d H:i:s')
|
||||
];
|
||||
$row_wechat['bizId'] && $act_data['bizId'] = $row_wechat['bizId'];
|
||||
$row_wechat['groupsId'] && $act_data['groupsId'] = $row_wechat['groupsId'];
|
||||
$row_wechat['levelId1'] && $act_data['levelId1'] = $row_wechat['levelId1'];
|
||||
$row_wechat['levelId2'] && $act_data['levelId2'] = $row_wechat['levelId2'];
|
||||
$row_wechat['levelId3'] && $act_data['levelId3'] = $row_wechat['levelId3'];
|
||||
if($param['cf_uid']){
|
||||
$p_act_user = $this->act_user_model->get(['userId'=>$param['cf_uid']],'userId,channelId');
|
||||
if($p_act_user['channelId']){
|
||||
$act_data['channelId'] = $p_act_user['channelId'];
|
||||
}else{
|
||||
$p_act_user['groupsId'] && $act_data['channelId'] = $p_act_user['userId'];
|
||||
}
|
||||
$act_data['pid'] = $p_act_user['userId'];
|
||||
}
|
||||
$row_wechat['groupsId'] && $act_data['channelId'] = $this->uid;//管理员自己归属到自己
|
||||
$act_user['id'] = $this->act_user_model->add($act_data);
|
||||
}
|
||||
$_SESSION[self::SESSION_KEY]['userId'] = $this->uid;
|
||||
$_SESSION[self::SESSION_KEY]['act_uid'] = $act_user['id'];
|
||||
echo ("<script>setTimeout('window.location.reload()', 1);</script>");exit;
|
||||
}
|
||||
return $this->$method();
|
||||
} catch(Hd_exception $e){//处理异常
|
||||
$msg = $e->getMessage();
|
||||
$data = array('heading' => 'Warning', 'message' => $msg);
|
||||
return $this->load->view('errors/html/error_404',$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class Login extends CI_Controller{
|
||||
|
||||
const SESSION_KEY = 'market_sylive_session';
|
||||
const WX_SESSION = "market_wx_info";
|
||||
protected $secret = "market_sylive_h5";
|
||||
protected $log_dir = 'market/sylive';
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
session_start();
|
||||
$this->load->model('market/market_sylive_user_model', 'user_model');
|
||||
$this->load->library('hd_exception');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
if($this->input->is_ajax_request()){
|
||||
$redis = &load_cache('redis');
|
||||
$code = $this->input->post('code');
|
||||
$mobile = $this->input->post('mobile');
|
||||
$key = "sylive_login_code_".$mobile;
|
||||
if(!$code || $code!=$redis->get($key)){
|
||||
$this->show_json('',400,'请输入正确的验证码');
|
||||
}
|
||||
$user=$this->user_model->get(['mobile' => $mobile,'status'=>0,'organizationId>'=>0]);
|
||||
if(!$user){
|
||||
$this->show_json('',400,'用户不存在');
|
||||
}
|
||||
$_SESSION[self::SESSION_KEY] = ['mobile' => $user['mobile']];
|
||||
$redis->delete($key);
|
||||
$this->show_json('',200,'登录成功');
|
||||
}else{
|
||||
$wx_info = $_SESSION[self::WX_SESSION];
|
||||
if($wx_info['nickname'] || $wx_info['headimgurl']){
|
||||
$data['auth_userinfo'] = true;
|
||||
}
|
||||
//微信分享
|
||||
$this->load->library('Jssdk');
|
||||
$jssdk = new Jssdk('liche');
|
||||
$sign_package = $jssdk->getSignPackage();
|
||||
$data['sign_package'] = $sign_package;
|
||||
$this->load->view('h5/market/sylive2/login',$data);
|
||||
}
|
||||
}
|
||||
//绑定微信openid
|
||||
private function bind_openid($mobile){
|
||||
$wx_info = $_SESSION[self::WX_SESSION];
|
||||
if(!$wx_info['openid']){
|
||||
return ['code' => 0,'msg' => '不存在公众号信息,无需绑定'];
|
||||
}
|
||||
if(!$mobile){
|
||||
return ['code' => 0,'msg' => '参数错误'];
|
||||
}
|
||||
$is_bind = $this->user_model->count(["openid!=''"=>null,'status'=>0,'mobile'=>$mobile,'organizationId>'=>0]); //已被绑定
|
||||
if($is_bind){
|
||||
$row = $this->user_model->get(['mobile'=>$mobile,"openid!=''"=>null,'status'=>0]);
|
||||
if($row['openid']!=$wx_info['openid']){
|
||||
return ['code' => 0,'msg' => '该公众号已存在绑定账号'];
|
||||
}
|
||||
}
|
||||
$update = [
|
||||
'openid' => $wx_info['openid']
|
||||
];
|
||||
$wx_info['nickname'] && $update['nickname'] = strval($wx_info['nickname']);
|
||||
$wx_info['headimgurl'] && $update['headimg'] = strval($wx_info['headimgurl']);
|
||||
$wx_info['unionid'] && $update['unionid'] = $wx_info['unionid'];
|
||||
$this->user_model->update($update,['mobile'=>$mobile,'status'=>0,'organizationId>'=>0]);
|
||||
return ['code' => 1,'msg' => '绑定成功'];
|
||||
}
|
||||
//获取验证码
|
||||
public function get_code(){
|
||||
$mobile = $this->input->post('mobile');
|
||||
if(!mobile_valid($mobile)){
|
||||
$this->show_json('',400,'请输入正确的手机号码');
|
||||
}
|
||||
$user=$this->user_model->get(array('mobile' => $mobile, 'status' => 0,'organizationId>=' => 0));
|
||||
|
||||
if(!$user){
|
||||
$this->show_json('',400,'用户不存在');
|
||||
}
|
||||
$redis = &load_cache('redis');
|
||||
$key = "sylive_login_code_".$mobile;
|
||||
$code = $redis->get($key);
|
||||
if(!$code){
|
||||
$this->load->helper('string');
|
||||
$code = random_string('numeric', 4);
|
||||
$redis->save($key, $code, 60*5);
|
||||
}
|
||||
$content = "【好店云】您的验证码为: {$code},五分钟之内有效,请勿泄露于他人,!";
|
||||
b2m_send_sms($mobile,$content);
|
||||
$this->show_json('',200, '验证码已发送');
|
||||
}
|
||||
|
||||
private function show_json($data, $code = 200, $msg = 'success', $url = ''){
|
||||
if(!isset($data['code'])){
|
||||
$data = array('data' => $data, 'code' => $code, 'msg' => $msg, 'url' => $url);
|
||||
}
|
||||
|
||||
exit(json_encode($data));
|
||||
}
|
||||
|
||||
//获取微信用户信息
|
||||
public function userinfo(){
|
||||
$ret = $this->set_auth('',1);
|
||||
if($ret){
|
||||
$_SESSION[self::WX_SESSION] = $ret;
|
||||
$mobile = $_SESSION[self::SESSION_KEY]['mobile'];
|
||||
$this->bind_openid($mobile);
|
||||
$url = http_host_com('home').'/h5/market/sylive2';
|
||||
redirect($url);
|
||||
}
|
||||
}
|
||||
public function logout(){
|
||||
$_SESSION[self::SESSION_KEY] = '';
|
||||
$this->show_json('',200, '退出成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $url 回调url地址
|
||||
* @param $auth 是否信息授权
|
||||
* @return void
|
||||
* @throws Hd_exception
|
||||
*/
|
||||
protected function set_auth($url='',$auth=0){
|
||||
$this->load->helper('url');
|
||||
$this->load->config('wechat');
|
||||
$config = $this->config->item('hdy');
|
||||
$code = $this->input->get('code');
|
||||
!$url && $url = http_host_com('home').$_SERVER['REQUEST_URI'];
|
||||
$auth && $url = $_SERVER['QUERY_STRING'] ? $url."&auth={$auth}" : $url."?auth={$auth}";
|
||||
if ($code) {//授权码获取微信信息
|
||||
$auth_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$config['appid']}&secret={$config['appSecret']}&code={$code}&grant_type=authorization_code";
|
||||
$res = file_get_contents($auth_url);
|
||||
$ret = json_decode($res, true);
|
||||
$access_token = $ret['access_token'];
|
||||
$openid = $ret['openid'];
|
||||
$unionid = $ret['unionid'];
|
||||
if($this->input->get('auth') && $access_token){
|
||||
$u_info_url = "https://api.weixin.qq.com/sns/userinfo?access_token={$access_token}&openid={$openid}&lang=zh_CN";
|
||||
$u_ret = file_get_contents($u_info_url);
|
||||
$ret = json_decode($u_ret,true);
|
||||
}
|
||||
if(!$openid){
|
||||
debug_log("[error]# " . $res, __FUNCTION__, $this->log_dir);
|
||||
throw new Hd_exception('获取用户信息失败', 400);
|
||||
}
|
||||
return $ret;
|
||||
} elseif ($auth) {//信息授权获取用户微信昵称/头像
|
||||
$redirect_uri = urlencode($url);
|
||||
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$config['appid']}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect&forcePopup=true";
|
||||
redirect($auth_url);
|
||||
} elseif (!$this->session) {//静默授权获取用户openid
|
||||
$redirect_uri = urlencode($url);
|
||||
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$config['appid']}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
|
||||
redirect($auth_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,537 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
require_once 'Common.php';
|
||||
|
||||
class Stic extends Admin{
|
||||
|
||||
private $a_id;
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('market/market_sylive_activity_kpidata_model','mdSytActivityKpiData');
|
||||
$this->load->model('market/market_sylive_items_model');
|
||||
$this->load->model('market/market_sylive_order_model');
|
||||
$this->load->model('live/Live_polyv_session_model', 'mdPolyvSession');
|
||||
$this->load->library('market/sylive_entity');
|
||||
$this->load->library('market/sylive2_entity');
|
||||
$this->load->library('market/sylive2_data_entity');
|
||||
$this->a_id = $this->input->get('a_id');
|
||||
$this->a_id && $_SESSION[self::SESSION_KEY]['a_id'] = $this->a_id;
|
||||
!$this->a_id && $this->a_id = $_SESSION[self::SESSION_KEY]['a_id'];
|
||||
$skey = $this->myencryption->base64url_encode("a_id=" . $this->a_id);
|
||||
$this->data['act_url'] = "/h5/market/sylive2/act?skey={$skey}";
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$groupsId = $this->input->get('groupsId');
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$user = $this->user_model->get(['userId'=>$this->uid],'nickname,headimg');
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$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'));
|
||||
$info['groupsId'] = $groupsId ? $groupsId : $group_user['groupsId'];
|
||||
$info['is_biz'] = $group_user['bizId'] ? 1 : 0;
|
||||
$info['tab'] = time()>=strtotime($row['timeStart']) ? 2 : 1;
|
||||
$this->data['info'] = $info;
|
||||
//微信分享
|
||||
$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/sylive2/stic/index');
|
||||
}
|
||||
//预约阶段数据
|
||||
public function lists_ready(){
|
||||
$groupsId = $this->input->get('groupsId');
|
||||
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
|
||||
!$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++){
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'groupsLevel' => $i
|
||||
];
|
||||
$level_total = $this->groups_model->count($where);
|
||||
$title = $disk[$i] ? $disk[$i] : "{$i}级";
|
||||
$h_lists[] = ['title'=> '参与'.$title,'num'=>"{$level_total}个"];
|
||||
}
|
||||
}
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'status' => 0,
|
||||
'ifBiz>' => 0
|
||||
];
|
||||
$biz_total = $this->groups_model->count($where);
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'status' => 0,
|
||||
'bizId>' => 0
|
||||
];
|
||||
$gw_total = $this->groups_user_model->count($where);
|
||||
$where["userId in (select cfUserId from lc_market_sylive_activity_kpidata where activityId={$this->a_id})"] = null;
|
||||
$kgw_total = $this->groups_user_model->count($where);
|
||||
$h_lists[] = ['title'=>'参与门店','num'=>"{$biz_total}个"];
|
||||
$h_lists[] = ['title'=>'参与顾问','num'=>"{$gw_total}个"];
|
||||
$h_lists[] = ['title'=>'开工顾问','num'=>"{$kgw_total}个"];
|
||||
$h_lists[] = ['title'=>'开工率','num'=>$gw_total ? round($kgw_total/$gw_total*100,2)."%" : 0];
|
||||
//我的
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'kpi' => 'browse',
|
||||
'cfUserId' => $this->uid,
|
||||
];
|
||||
$owner_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
|
||||
$where['kpi'] = 'subscribe';
|
||||
$owner_subscribe_count = $this->mdSytActivityKpiData->count($where); //订阅数据
|
||||
$mine = [
|
||||
['title'=>'访问用户','num'=>"{$owner_browse_count}人",'url'=>'/h5/market/sylive2/stic/users?type=owner&kpi=browse'],
|
||||
['title'=>'预约用户','num'=>"{$owner_subscribe_count}人",'url'=>'/h5/market/sylive2/stic/users?type=owner&kpi=subscribe'],
|
||||
['title'=>'预约率','num'=>$owner_browse_count ? round($owner_subscribe_count/$owner_browse_count*100,2)."%" : 0],
|
||||
];
|
||||
$sub_lists = [
|
||||
['title'=>'我的','lists'=>$mine],
|
||||
];
|
||||
if($group_user['bizId']){
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'kpi' => 'browse',
|
||||
'bizId' => $group_user['bizId'],
|
||||
];
|
||||
$biz_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
|
||||
$where['kpi'] = 'subscribe';
|
||||
$biz_subscribe_count = $this->mdSytActivityKpiData->count($where); //订阅数据
|
||||
$biz = [
|
||||
['title'=>'访问用户','num'=>"{$biz_browse_count}人",'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$group_user['bizId']}&kpi=browse"],
|
||||
['title'=>'预约用户','num'=>"{$biz_subscribe_count}人",'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$group_user['bizId']}&kpi=subscribe"],
|
||||
['title'=>'预约率','num'=>$biz_browse_count ? round($biz_subscribe_count/$biz_browse_count*100,2)."%" : 0],
|
||||
];
|
||||
$sub_lists[] = ['title'=>'本店','lists'=>$biz];
|
||||
}
|
||||
if(!$group_row['ifBiz']){ //当前等级
|
||||
if(!$group_row['groupsLevel']){//顶级
|
||||
$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'];//浏览数据
|
||||
$subscribe_count = $sub_sum['subscribe'];//订阅数据
|
||||
}else{
|
||||
$browse_count = $group_row['browse'];//浏览数据
|
||||
$subscribe_count = $group_row['subscribe'];//订阅数据
|
||||
}
|
||||
$biz = [
|
||||
['title'=>'访问用户','num'=>"{$browse_count}人"],
|
||||
['title'=>'预约用户','num'=>"{$subscribe_count}人"],
|
||||
['title'=>'预约率','num'=>$browse_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
|
||||
];
|
||||
$sub_lists[] = ['title'=>"所有大区",'lists'=>$biz];
|
||||
}
|
||||
$data = [
|
||||
'h_lists' => $h_lists,
|
||||
'sub_lists' => $sub_lists,
|
||||
];
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
//直播统计数据
|
||||
public function lists_live(){
|
||||
$groupsId = $this->input->get('groupsId');
|
||||
$group_user = $this->groups_user_model->get(['activityId'=>$this->a_id,'userId'=>$this->uid]);
|
||||
!$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]);
|
||||
//我的
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'kpi' => 'watch',
|
||||
'cfUserId' => $this->uid,
|
||||
];
|
||||
$owner_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
|
||||
$where['kpi'] = 'order';
|
||||
$owner_subscribe_count = $this->mdSytActivityKpiData->count($where); //订阅数据
|
||||
$mine = [
|
||||
['title'=>'观看用户','num'=>"{$owner_browse_count}人",'url'=>'/h5/market/sylive2/stic/users?type=owner&kpi=watch'],
|
||||
['title'=>'下单数','num'=>"{$owner_subscribe_count}人",'url'=>'/h5/market/sylive2/stic/users?type=owner&kpi=order'],
|
||||
['title'=>'转化率','num'=>$owner_browse_count ? round($owner_subscribe_count/$owner_browse_count*100,2)."%" : 0],
|
||||
];
|
||||
$sub_lists = [
|
||||
['title'=>'我的','lists'=>$mine],
|
||||
];
|
||||
$total_play = $this->mdPolyvSession->sum('totalPlayDuration',['channelId'=>$row['channelId']]);
|
||||
$duration = $this->mdPolyvSession->sum('duration',['channelId'=>$row['channelId']]);
|
||||
$pv = $this->mdPolyvSession->sum('livePV',['channelId'=>$row['channelId']]);
|
||||
$uv = $this->mdPolyvSession->sum('liveUV',['channelId'=>$row['channelId']]);
|
||||
$duration = $duration['duration'] ? intval($duration['duration']/60) : "0";
|
||||
$livePV = $pv['livePV'] ? $pv['livePV'] : 0;
|
||||
$avg_UV_time = $uv['liveUV'] ? intval($total_play['totalPlayDuration']/$uv['liveUV']) : 0;
|
||||
$avg_UV_time = intval($avg_UV_time/60);
|
||||
$h_lists = [
|
||||
['title' => '直播时长', 'num' => "{$duration}分钟"],
|
||||
['title' => '人均观看', 'num' => "{$avg_UV_time}分钟"],
|
||||
['title' => '观看次数', 'num' => "{$livePV}次"],
|
||||
];
|
||||
if($group_user['bizId']){ //门店和顾问
|
||||
$biz_id = $group_user['bizId'];
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'kpi' => 'watch',
|
||||
'bizId' => $biz_id,
|
||||
];
|
||||
$biz_browse_count = $this->mdSytActivityKpiData->count($where); //观看数据
|
||||
$where['kpi'] = 'order';
|
||||
$biz_subscribe_count = $this->mdSytActivityKpiData->count($where); //下单数据
|
||||
$biz = [
|
||||
['title'=>'观看用户','num'=>"{$biz_browse_count}人",'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$biz_id}&kpi=watch"],
|
||||
['title'=>'下单数','num'=>"{$biz_subscribe_count}人",'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$biz_id}&kpi=order"],
|
||||
['title'=>'转化率','num'=>$biz_browse_count ? round($biz_subscribe_count/$biz_browse_count*100,2)."%" : 0],
|
||||
];
|
||||
$sub_lists[] = ['title'=>'本店','lists'=>$biz];
|
||||
}
|
||||
if(!$group_row['ifBiz']){ //当前等级
|
||||
if(!$group_row['groupsLevel']){//顶级
|
||||
$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'];//观看数据
|
||||
$subscribe_count = $sub_sum['orderTotal'];//下单数据
|
||||
}else{
|
||||
$browse_count = $group_row['watch'];//观看数据
|
||||
$subscribe_count = $group_row['orderTotal'];//下单数据
|
||||
}
|
||||
$biz = [
|
||||
['title'=>'观看用户','num'=>"{$browse_count}人"],
|
||||
['title'=>'下单数','num'=>"{$subscribe_count}人"],
|
||||
['title'=>'转化率','num'=>$browse_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
|
||||
];
|
||||
$sub_lists[] = ['title'=>"所有大区",'lists'=>$biz];
|
||||
}
|
||||
$data = [
|
||||
'h_lists' => $h_lists,
|
||||
'sub_lists' => $sub_lists,
|
||||
];
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
public function event(){
|
||||
$map_kpi_name = [
|
||||
'browse' => '浏览了活动页', 'subscribe' => '订阅了直播通知', 'order' => '直播间下单','watch' => '进入了直播间'
|
||||
];
|
||||
$page = $this->input->get('page');
|
||||
$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]);
|
||||
$where = [
|
||||
'activityId'=>$this->a_id,
|
||||
'bizId'=>$group_user['bizId'],
|
||||
];
|
||||
if($type==1){ //预热
|
||||
$where['createTime<='] = strtotime($row['timeStart']);
|
||||
}else{ //开始
|
||||
$where['createTime>='] = strtotime($row['timeStart']);
|
||||
}
|
||||
$total = $this->mdSytActivityKpiData->count($where);
|
||||
$lists = [];
|
||||
if($total){
|
||||
$rows = $this->mdSytActivityKpiData->select($where,'id desc',$page,10,'userId,kpi,createTime');
|
||||
$users = [];
|
||||
$uids = implode(',',array_unique(array_column($rows,'userId')));
|
||||
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['userId']] ? $users[$val['userId']] : "用户{$val['userId']}";
|
||||
$lists[] = [
|
||||
'nickname' => $nickname,
|
||||
'action' => $map_kpi_name[$val['kpi']],
|
||||
'time' => friendly_date($val['createTime']),
|
||||
];
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'lists' => $lists,
|
||||
'total' => $total
|
||||
];
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
public function users(){
|
||||
$map_kpi_name = [
|
||||
'browse' => '访问用户', 'subscribe' => '预约用户', 'order' => '下单数','watch' => '观看用户'
|
||||
];
|
||||
$params = $this->input->get();
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$title = $map_kpi_name[$params['kpi']];
|
||||
$tab = [
|
||||
['id'=>1,'title'=>'客户列表']
|
||||
];
|
||||
if($params['type']=='biz' && $params['type_id']){ //显示顾问数据
|
||||
$tab[] = ['id'=>2,'title'=>'顾问数据'];
|
||||
}
|
||||
$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');
|
||||
}
|
||||
$this->data['title'] = $title;
|
||||
$this->data['tab'] = $tab;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['goods'] = $goods;
|
||||
//微信分享
|
||||
$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/sylive2/stic/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' => 0,
|
||||
'activityId' => $this->a_id,
|
||||
'kpi' => $params['kpi'],
|
||||
];
|
||||
if($params['type']=='biz'){
|
||||
$where['bizId'] = $params['type_id'];
|
||||
}else{
|
||||
$where['cfUserId'] = $this->uid;
|
||||
}
|
||||
if($params['kpi']=='order' && $params['itemId']){
|
||||
$where["tagId in (select id from lc_market_sylive_order where itemId={$params['itemId']} and activityId={$this->a_id})"] = null;
|
||||
}
|
||||
$total = $this->mdSytActivityKpiData->count($where);
|
||||
$lists = [];
|
||||
if($total){
|
||||
$rows = $this->mdSytActivityKpiData->select($where,'id desc',$page,20,'userId,cfUserId,createTime,jsondata');
|
||||
$uids_arr = array_column($rows,'userId');
|
||||
if($params['type']=='biz'){
|
||||
$gw_uids_arr = array_column($rows,'cfUserId');
|
||||
$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) {
|
||||
$jsondata = json_decode($item['jsondata'],true);
|
||||
$user = $users[$item['userId']] ? $users[$item['userId']][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($params['type']=='biz'){ //店长
|
||||
$cf_user = $users[$item['cfUserId']] ? $users[$item['cfUserId']][0] : [];
|
||||
$cf_uname = $cf_user['uname'] ? $cf_user['uname'] : "";
|
||||
}
|
||||
$mobile = $name = '';
|
||||
if($params['kpi']=='order' && $jsondata['order_id']){
|
||||
$order = $this->market_sylive_order_model->get(['id'=>$jsondata['order_id']],'uname,mobile');
|
||||
$name = $order['uname'] ? $order['uname'] : '';
|
||||
$mobile = $order['mobile'] ? $order['mobile'] : '';
|
||||
}
|
||||
$lists[] = [
|
||||
'nickname' => $nickname,
|
||||
'name' => $name,
|
||||
'mobile' => $mobile,
|
||||
'headimg' => $headimg,
|
||||
'cf_uname' => $cf_uname,
|
||||
'time' => friendly_date($item['createTime'],'normal',1)
|
||||
];
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'total' => $total,
|
||||
'lists' => $lists
|
||||
];
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
public function gw_lists(){
|
||||
$params = $this->input->get();
|
||||
$page = $params['page'] ? $params['page'] : 1;
|
||||
$size = $params['size'] ? $params['size'] : 20;
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'kpi' => $params['kpi']
|
||||
];
|
||||
if($params['type']=='biz' && $params['type_id']){
|
||||
$biz_id = $params['type_id'];
|
||||
$where['bizId'] = $biz_id;
|
||||
}
|
||||
$params['itemId'] && $where['itemId'] = $params['itemId'];
|
||||
$groupby = 'cfUserId';
|
||||
$teamId = $this->uid;
|
||||
$select = 'bizId as teamId2,cfUserId,count(id) as t';
|
||||
$order = 't desc,id desc';
|
||||
$res = $this->sylive2_data_entity->top_kpidata($groupby,$where,$order,$page,$size,$select,$teamId);
|
||||
$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);
|
||||
}
|
||||
|
||||
//分组列表
|
||||
public function group_lists(){
|
||||
$params = $this->input->get();
|
||||
$page = $params['page'] ? $params['page'] : 1;
|
||||
$size = 20;
|
||||
|
||||
$disk = $this->sylive2_entity->level_disk($this->a_id);
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'parentId' => $params['groupsId'],
|
||||
'status' => 0
|
||||
];
|
||||
$total = $this->groups_model->count($where);
|
||||
$rows = $this->groups_model->select($where,'sortNumber desc',$page,$size);
|
||||
$lists = [];
|
||||
if($rows){
|
||||
foreach ($rows as $item) {
|
||||
$count = $this->groups_model->count(['activityId'=>$this->a_id,'status'=>0,'parentId'=>$item['groupsId']]);
|
||||
$lists[] = [
|
||||
'title' => $item['groupsName'],
|
||||
'note' => $disk[$item['groupsLevel']+1] ? $disk[$item['groupsLevel']+1]:'下一级组员',
|
||||
'num' => $count,
|
||||
'url' => $item['groupsLevel']<3 ? "/h5/market/sylive2/stic?groupsId={$item['groupsId']}" : '',
|
||||
];
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'total' => $total,
|
||||
'list' => $lists
|
||||
];
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
public function ranking(){
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$info['banner'] = $jsondata['banner'] ? build_qiniu_image_url($jsondata['banner']) : Sylive_entity::DF_BANNER;
|
||||
$this->data['info'] = $info;
|
||||
$day_list = ['全部'];
|
||||
$timeEnd = strtotime($row['timeEnd']);//直播结束往前七天
|
||||
for($i=0;$i<8;$i++){
|
||||
$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']
|
||||
];
|
||||
}
|
||||
}
|
||||
$this->data['groups'] = $groups;
|
||||
//微信分享
|
||||
$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/sylive2/stic/ranking');
|
||||
}
|
||||
|
||||
public function ajax_rank(){
|
||||
$map_kpi_biz = [
|
||||
'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>排行',
|
||||
'subscribe' => $title.'<span class="color-00a2ff">预约</span>排行',
|
||||
'watch' => $title.'<span class="color-00a2ff">观看</span>排行',
|
||||
'order' => $title.'<span class="color-00a2ff">订单</span>排行'
|
||||
];
|
||||
$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'])){//根据日期排行
|
||||
$kpi = $params['kpi'];
|
||||
$select = "bizId,count(id) as t";
|
||||
$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']);
|
||||
}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']);
|
||||
}
|
||||
$data['title'] = $title_arr[$params['kpi']];
|
||||
$data['url'] = "/h5/market/sylive2/stic/rank?type={$params['kpi']}&day={$params['day']}>ype={$params['gtype']}&show_day=1";
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
public function rank(){
|
||||
$params = $this->input->get();
|
||||
!$params['day'] && $params['day'] = '全部';
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$day_list = ['全部'];
|
||||
$timeEnd = strtotime($row['timeEnd']);//直播结束往前七天
|
||||
for($i=0;$i<8;$i++){
|
||||
$day_list[] = date('Y-m-d',$timeEnd - $i*24*60*60);
|
||||
}
|
||||
$this->data['day_list'] = $day_list;
|
||||
$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/sylive2/stic/rank');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
require_once 'Common.php';
|
||||
|
||||
class Ucenter extends Wx{
|
||||
|
||||
private $a_id,$skey;
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('market/market_sylive_items_model');
|
||||
$this->load->model('market/market_sylive_order_model');
|
||||
$this->load->model('market/market_sylive_activity_model');
|
||||
$this->load->library('market/sylive_entity');
|
||||
$this->skey = $this->input->get('skey');
|
||||
$param = $this->myencryption->base64url_decode($this->skey);
|
||||
$this->a_id = intval($param['a_id']);//活动id
|
||||
$this->data['skey'] = $this->skey;
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$params = $this->input->get();
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$lists = [];
|
||||
|
||||
$lists[] = ['title'=>'我的权益','url'=>"/h5/market/sylive2/ucenter/orders?skey={$params['skey']}"];
|
||||
$lists[] = ['title'=>'我的抽奖','url'=>"/h5/market/sylive2/ucenter/win?skey={$params['skey']}"];
|
||||
$jsondata['serviceLink'] && $lists[] = ['title'=>'联系客服','url'=>$jsondata['serviceLink']];
|
||||
|
||||
$user = $this->user_model->get(['userId'=>$this->uid],'unionid,nickname,headimg');
|
||||
$info = [
|
||||
'title' => $user['nickname'],
|
||||
'logo' => $user['headimg'],
|
||||
'list' => $lists
|
||||
];
|
||||
$this->data['info'] = $info;
|
||||
$this->data['params'] = $params;
|
||||
$this->show_view('h5/market/sylive2/ucenter/index');
|
||||
}
|
||||
|
||||
//我的抽奖
|
||||
public function win(){
|
||||
$this->show_view('h5/market/sylive2/ucenter/win');
|
||||
}
|
||||
|
||||
public function ajax_win(){
|
||||
$params = $this->input->get();
|
||||
$page = $params['page'] ? $params['page'] : 1;
|
||||
$size = $params['size'] ? $params['size'] : 20;
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'userId' => $this->uid,
|
||||
'win' => 1
|
||||
];
|
||||
$total = $this->market_sylive_order_model->count($where);;
|
||||
$lists = [];
|
||||
if($total){
|
||||
$rows = $this->market_sylive_order_model->select($where,'id desc',$page,$size,'id,sid,winType');
|
||||
foreach ($rows as $key => $val) {
|
||||
$winType = $this->market_sylive_order_model->winTypeAry($this->a_id,$val['winType']);
|
||||
$lists[] = [
|
||||
'id' => $val['id'],
|
||||
'img' => $winType['img'],
|
||||
'title' => $winType['tag'],
|
||||
'goods' => $winType['title']
|
||||
];
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'total' => $total,
|
||||
'lists' => $lists
|
||||
];
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
//我的订单
|
||||
public function orders(){
|
||||
$this->show_view('h5/market/sylive2/ucenter/orders');
|
||||
}
|
||||
|
||||
//订单详情
|
||||
public function detail(){
|
||||
$oid = $this->input->get('id');
|
||||
$order = $this->market_sylive_order_model->get(['id'=>$oid,'userId' => $this->uid]);
|
||||
if(!$order){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$item = $this->market_sylive_items_model->get(['itemId'=>$order['itemId']]);
|
||||
$validity = '';
|
||||
if($item['useStart'] || $item['useEnd']){
|
||||
$useTimeStart = date('Y-m-d',strtotime($item['useStart']));
|
||||
$useTimeEnd = date('Y-m-d',strtotime($item['useEnd']));
|
||||
$validity = "有效期 {$useTimeStart} - {$useTimeEnd}";
|
||||
}
|
||||
$order_jsondata = json_decode($order['jsondata'],true);
|
||||
$order = [
|
||||
'id' => $order['id'],
|
||||
'uname' => $order['uname'] ? $order['uname'] : '',
|
||||
'utel' => $order['mobile'] ? $order['mobile'] : '',
|
||||
'slogan' => '尊享您的直播好礼',
|
||||
'valid_time' => $validity,
|
||||
'sid' => $order['sid'],
|
||||
'c_time' => date('Y-m-d H:i:s'),
|
||||
'region' => $order_jsondata['address']['region'] ? $order_jsondata['address']['region'] : '',
|
||||
'detail' => $order_jsondata['address']['detail'] ? $order_jsondata['address']['detail'] : ''
|
||||
];
|
||||
$if_pid = 0;
|
||||
$ac_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$this->a_id],'channelId');
|
||||
$ac_user['channelId'] && $pid_user = $this->user_model->get(['userId'=>$ac_user['channelId']],'uname,organizationId,mobile,headimg');
|
||||
$logo = $gw_tel = $gw_slogan = $gw_title = '';
|
||||
if($ac_user['channelId'] && $pid_user['organizationId']>0){
|
||||
$group_id = $this->sylive_entity->get_level($pid_user['organizationId']);
|
||||
if($group_id==3){ //顾问
|
||||
$if_pid = 1;
|
||||
$where = [
|
||||
"organizationId in (select parentId from lc_market_sylive_organization where organizationId={$pid_user['organizationId']})" => null
|
||||
];
|
||||
$org = $this->market_sylive_organization_model->get($where);
|
||||
}elseif($group_id==2){ //店长
|
||||
$if_pid = 1;
|
||||
$where = [
|
||||
"organizationId" => $pid_user['organizationId']
|
||||
];
|
||||
$org = $this->market_sylive_organization_model->get($where);
|
||||
}
|
||||
$gw_title = $pid_user['uname'];
|
||||
$gw_slogan = $org['organizationName'];
|
||||
$gw_tel = $pid_user['mobile'];
|
||||
$logo = $pid_user['headimg'];
|
||||
}
|
||||
$info = [
|
||||
'bg' => "https://qs.haodian.cn/web/images/project/H5-ShiYu/mine-bg.jpg",
|
||||
'logo' => $logo,
|
||||
'if_pid' => $if_pid,
|
||||
'title' => $gw_title,
|
||||
'slogan' => $gw_slogan,
|
||||
'cust_tel' => $gw_tel,
|
||||
'introTitle' => '权益说明',
|
||||
'content' => $item['descrip'] ? $item['descrip'] : '',
|
||||
'order' => $order,
|
||||
'skey' => $this->data['skey'],
|
||||
'ifAddress' => $item['ifAddress']
|
||||
];
|
||||
$this->data['info'] = $info;
|
||||
$this->show_view('h5/market/sylive2/ucenter/detail');
|
||||
}
|
||||
|
||||
public function ajax_order(){
|
||||
$params = $this->input->get();
|
||||
$page = $params['page'] ? $params['page'] : 1;
|
||||
$size = $params['size'] ? $params['size'] : 20;
|
||||
$where = [
|
||||
'activityId' => $this->a_id,
|
||||
'userId' => $this->uid,
|
||||
'type' => 0,
|
||||
'status' => 1
|
||||
];
|
||||
$total = $this->market_sylive_order_model->count($where);
|
||||
$lists = [];
|
||||
if($total){
|
||||
$rows = $this->market_sylive_order_model->select($where,'id desc',$page,$size);
|
||||
$item_ids = implode(',',array_unique(array_column($rows,'itemId')));
|
||||
$item_rows = [];
|
||||
if($item_ids){
|
||||
$item_rows = $this->market_sylive_items_model->map('itemId','',["itemId in ({$item_ids})"],'',0,0,'itemId,imgs');
|
||||
}
|
||||
foreach ($rows as $val) {
|
||||
$item = $item_rows[$val['itemId']] ? $item_rows[$val['itemId']][0] : [];
|
||||
$imgs = json_decode($item['imgs'],true);
|
||||
$img = $imgs['banner'][0] ? build_qiniu_image_url($imgs['banner'][0]) : '';
|
||||
$lists[] = [
|
||||
'sid' => $val['sid'],
|
||||
'img' => $img,
|
||||
'title' => $val['itemTitle'],
|
||||
'time' => date('Y.m.d H:i:s',strtotime($val['createTime'])),
|
||||
'price' => $val['totalPrice'],
|
||||
'url' => "/h5/market/sylive2/ucenter/detail?skey={$this->skey}&id={$val['id']}"
|
||||
];
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'total' => $total,
|
||||
'lists' => $lists
|
||||
];
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
//修改地址
|
||||
public function edit_address(){
|
||||
$params = $this->input->post();
|
||||
if(!$params['region']||!$params['address']){
|
||||
$this->show_json([],400,'参数错误');
|
||||
}
|
||||
$order = $this->market_sylive_order_model->get(['userId'=>$this->uid,'status'=>1,'id'=>$params['id']]);
|
||||
if(!$order){
|
||||
$this->show_json([],400,'订单不存在');
|
||||
}
|
||||
$jsondata = json_decode($order['jsondata'],true);
|
||||
$jsondata['address']['region'] = $params['region'];
|
||||
$jsondata['address']['detail'] = $params['address'];
|
||||
$update = [
|
||||
'jsondata' => json_encode($jsondata,JSON_UNESCAPED_UNICODE)
|
||||
];
|
||||
$this->market_sylive_order_model->update($update,['id'=>$order['id']]);
|
||||
$this->show_json([],200,'保存成功');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
require_once 'Common.php';
|
||||
|
||||
class Welcome extends Admin {
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('market/market_sylive_organization_model');
|
||||
$this->load->library('market/sylive_entity');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$where = [
|
||||
'mobile' => $this->mobile,
|
||||
'organizationId>' => 0,
|
||||
'status' => 0
|
||||
];
|
||||
$gu_rows = $this->user_model->select($where,'userId desc','','','userId,mobile,organizationId');
|
||||
if(count($gu_rows)>1){ //多个机构
|
||||
$org_lists = [];
|
||||
foreach ($gu_rows as $key => $val) {
|
||||
$levl_rows = $this->sylive_entity->get_level_lists($val['organizationId']);
|
||||
$levl_top = $levl_rows[0];
|
||||
$temp = [
|
||||
'logo' => $levl_top['logo'] ? build_qiniu_image_url($levl_top['logo']) : '',
|
||||
'url' => "/h5/market/sylive2/welcome/org?org_id={$levl_top['organizationId']}&userId={$val['userId']}"
|
||||
];
|
||||
|
||||
$org_lists[$temp['organizationId']] = $temp;
|
||||
}
|
||||
$_SESSION[self::SESSION_KEY]['multi_org'] = 1;
|
||||
$this->data['org_lists'] = $org_lists;
|
||||
//微信分享
|
||||
$wx_info = $this->share_info();
|
||||
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||
$this->show_view('h5/market/sylive2/index');
|
||||
}else{ //只存在一个机构
|
||||
$levl_rows = $this->sylive_entity->get_level_lists($gu_rows[0]['organizationId']);
|
||||
$levl_top = $levl_rows[0];
|
||||
$org_url = http_host_com('home')."/h5/market/sylive2/welcome/org?org_id={$levl_top['organizationId']}&userId={$gu_rows[0]['userId']}";
|
||||
redirect($org_url);
|
||||
}
|
||||
}
|
||||
//登录机构
|
||||
public function org(){
|
||||
$this->session['org_id'] = $this->input->get('org_id');
|
||||
$this->session['userId'] = $this->input->get('userId');
|
||||
$_SESSION[self::SESSION_KEY] = $this->session;
|
||||
$org_url = http_host_com('home')."/h5/market/sylive2/biz";
|
||||
redirect($org_url);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
<body class="bg-fff">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-fff" id="app" ref="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top" :style="'background-image:url('+info.bg+')'">
|
||||
<div class="absolute top-0 right-0 bg-fff mt40 mr25 pl20 pr20 ulib-r750 fn-flex overflowhidden font-20">
|
||||
<a class="fn-flex-item pt10 pb10 pl20 pr20" v-if="info.statisticsurl" :href="info.statisticsurl">
|
||||
<img class="imgsize-40X40" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shuju.png" alt="#">
|
||||
<div class="text-middle">数据</div>
|
||||
</a>
|
||||
<a class="fn-flex-item pt10 pb10 pl20 pr20" v-if="info.rankingurl" :href="info.rankingurl">
|
||||
<img class="imgsize-40X40" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-paihang.png" alt="#">
|
||||
<div class="text-middle">排行</div>
|
||||
</a>
|
||||
<a class="fn-flex-item pt10 pb10 pl20 pr20" v-if="info.shareurl" :href="info.shareurl">
|
||||
<img class="imgsize-40X40" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-fenxiang.png" alt="#">
|
||||
<div class="text-middle">分享</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="height-1200"></div>
|
||||
|
||||
<div class="fixed left-0 bottom-0 right-0 inner20 bg-fff ulib-rt20 z-index-4 fn-flex text-center" >
|
||||
<div class="relative fn-flex-item pl20 pr20" flexsize="0" v-for="item in info.menu">
|
||||
<a v-if="item.type==1" :href="item.url">
|
||||
<img class="imgsize-50X50" :src="item.icon" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">{{item.title}}</div>
|
||||
</a>
|
||||
<div v-else-if="item.type==2">
|
||||
<img class="imgsize-50X50" :src="item.icon" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">{{item.title}}</div>
|
||||
<div class="absolute top-0 left-0 right-0 bottom-0 overflowhidden z-index-1">
|
||||
<wx-open-launch-weapp
|
||||
id='launch-btn'
|
||||
:username="item.wechat_ghid"
|
||||
:path="item.wechat_path"
|
||||
>
|
||||
<template>
|
||||
<button class="btn" style="width:100px;height:60px;opacity:0"></button>
|
||||
</template>
|
||||
<script type="text/wxtag-template">
|
||||
<button class="btn" style="width:100px;height:60px;opacity:0"></button>
|
||||
</script>
|
||||
</wx-open-launch-weapp>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="fn-flex-item pl20 pr20" flexsize="0" :href="info.my_url">
|
||||
<img class="imgsize-50X50" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-wode.png" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">我的</div>
|
||||
</a>
|
||||
|
||||
<div class="fn-flex-item pl20" flexsize="1">
|
||||
<template v-if="info.live_status<2">
|
||||
<a class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r20" v-if="info.live_status==1" href="javascript:;" @click="goLive">进入直播间</a>
|
||||
<a class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r20" v-else href="javascript:;" @click="showCode">
|
||||
<i class="iconfont icon-tixing mr10"></i>开播提醒
|
||||
</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r20" href="javascript:;">活动已结束</a>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--直播字幕-->
|
||||
<div>
|
||||
<div class="notice-shadow"></div>
|
||||
<div class="notice bg-000-op10 pl20 pr20 line-height-17 font-28 ulib-r750 z-index-1" :style="'animation-delay:'+item.delay+'s;'" v-for="(item,index) in notice1">
|
||||
<span class="color-333">{{item.name}}</span>
|
||||
<span class="ml10 color-333">{{item.tip}}</span>
|
||||
</div>
|
||||
<div class="notice bg-000-op10 pl20 pr20 line-height-17 font-28 ulib-r750 z-index-1" :style="'animation-delay:'+item.delay+'s;'" v-for="(item,index) in notice2">
|
||||
<span class="color-333">{{item.name}}</span>
|
||||
<span class="ml10 color-333">{{item.tip}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="msgisShowCode?'display:block':'display:none'" v-if="msgisShowCode">
|
||||
<div class="msgBg" @click="closeCode"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word text-center">
|
||||
<div class="mt20 font-22 line-height-15 color-666">
|
||||
<div class="mt10">
|
||||
看直播,好礼享不停!
|
||||
</div>
|
||||
<div class="mt10">添加【东风EV官方企微号】</div>
|
||||
<div class="mt10">
|
||||
了解更多惊喜内幕!
|
||||
</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/icon-finger2.png" alt="#" />
|
||||
<span class="text-middle">长按识别二维码添加</span>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
info:'',
|
||||
page:1,
|
||||
notice1:[],
|
||||
notice2:[],
|
||||
code:'',
|
||||
msgisShowCode: false,
|
||||
noticeTime: null,
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getInfo()
|
||||
this.getNotice()
|
||||
if(this.info.alert_code){
|
||||
mDialog.msg({content: '预约成功'});
|
||||
}
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.notice1= []
|
||||
this.notice2= []
|
||||
clearTimeout(this.noticeTime);
|
||||
},
|
||||
methods: {
|
||||
|
||||
showCode: function() {
|
||||
var that = this
|
||||
if (that.info.subscribemsg == '已订阅直播') {
|
||||
// if(that.info.show_code){
|
||||
// this.msgisShowCode = true
|
||||
// }else{
|
||||
mDialog.msg({content: that.info.subscribemsg});
|
||||
// }
|
||||
}else{
|
||||
window.location.href = that.info.subscribemsg;
|
||||
}
|
||||
},
|
||||
closeCode: function() {
|
||||
this.msgisShowCode = false
|
||||
},
|
||||
|
||||
//获取基础信息
|
||||
getInfo(){
|
||||
this.info = <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>;
|
||||
this.info['menu'] = [
|
||||
{
|
||||
type:'2',
|
||||
icon:'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shijia.png',
|
||||
title:'约试驾',
|
||||
wechat_ghid:'gh_54cc250f3a1a',
|
||||
wechat_path:'subpackage/pages/testDrive/testDrive',
|
||||
},
|
||||
{
|
||||
type:'1',
|
||||
icon:'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shangpin.png',
|
||||
title:'热商品',
|
||||
url:'goods.html',
|
||||
},
|
||||
]
|
||||
// this.info = {
|
||||
// state:0,//0未开始,1直播中,2结束
|
||||
// bg:"https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/linebg.jpg",
|
||||
// shareurl:'poster.html',
|
||||
// statisticsurl:'221201-statistics-home.html',
|
||||
// rankingurl:'221201-statistics-ranking.html',
|
||||
// code:'https://qs.haodian.cn/web/images/project/H5-ShiYu/wx-code.png',
|
||||
// menu:[
|
||||
// {
|
||||
// type:'2',
|
||||
// icon:'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shijia.png',
|
||||
// title:'约试驾',
|
||||
// wechat_ghid:'gh_54cc250f3a1a',
|
||||
// wechat_path:'subpackage/pages/testDrive/testDrive',
|
||||
// },
|
||||
// {
|
||||
// type:'1',
|
||||
// icon:'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shangpin.png',
|
||||
// title:'热商品',
|
||||
// url:'goods.html',
|
||||
// },
|
||||
// ],
|
||||
// }
|
||||
},
|
||||
|
||||
//获取底部订阅提示
|
||||
getNotice(){
|
||||
let that = this
|
||||
if(that.info.live_status==2){
|
||||
return '';
|
||||
}
|
||||
$.get('/h5/market/sylive2/act/subscribemsg_lists',{'a_id':that.info.a_id,'live_status':that.info.live_status},function (result){
|
||||
that.notice = result.data.lists
|
||||
that.page = that.page + 1
|
||||
|
||||
alldelay = 0
|
||||
that.notice.forEach(item => {
|
||||
item.delay = alldelay + Math.floor(Math.random() * (3))/10 + 1
|
||||
alldelay = item.delay
|
||||
})
|
||||
|
||||
if(that.page%2 ==0){
|
||||
that.notice2 = that.notice
|
||||
setTimeout(function () {
|
||||
that.notice1= []
|
||||
}, 6000);
|
||||
}else{
|
||||
that.notice1 = that.notice
|
||||
setTimeout(function () {
|
||||
that.notice2= []
|
||||
}, 6000);
|
||||
}
|
||||
setTimeout(function () {
|
||||
that.getNotice()
|
||||
}, (alldelay<20?20:alldelay)*1000);
|
||||
},'json')
|
||||
},
|
||||
|
||||
//进入直播间
|
||||
goLive(){
|
||||
$.get('/h5/market/sylive2/act/golive',{'a_id':this.info.a_id},function (result){
|
||||
window.location.href = "<?=$info['live_url']?>"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Vue.config.ignoredElements = ['wx-open-launch-weapp', 'wx-open-subscribe'];
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -0,0 +1,223 @@
|
||||
<body class="bg-f6">
|
||||
<div id="app" ref="app">
|
||||
<div class="container relative pb130">
|
||||
<!--轮播-->
|
||||
<div class="goods-banner relative imgsize-750X680 z-index-0" v-if='info.banner.length>1'>
|
||||
<div class="swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<div class="swiper-slide" v-for="item in info.banner">
|
||||
<img class="imgsize-750X680" :src="item" alt="#" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-pagination ulib-rl750 font-22 color-fff"></div>
|
||||
</div>
|
||||
<div v-else><img class="imgsize-750X680" :src="info.banner[0]" alt="#" /></div>
|
||||
<!--end 轮播-->
|
||||
<div class="relative pl30 pr30 pb30 z-index-1 goods-con">
|
||||
<div class="relative bg-fff mb30 ml30 mr30 inner40 pr220 ulib-r20 box-shadow-darkGray">
|
||||
<div class="font-36">{{info.title}}</div>
|
||||
<div class="mt10 font-22 color-999">{{info.validity}}</div>
|
||||
<div class="absolute right-0 box-middle mr30 color-c4302c">
|
||||
<span class="font-28">¥</span>
|
||||
<span class="font-64">{{info.price}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative bg-fff mb30 ml30 mr30 inner40 ulib-r20 box-shadow-darkGray">
|
||||
<div class="pb20 text-center"><div class="inline-block relative pl10 pr10 introTitle font-36"><span class="relative z-index-1">{{info.introTitle}}</span></div></div>
|
||||
<div class="line-height-17 font-28 color-666 text-break space-pre-line rich-text-img" v-html="info.content"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fixed left-0 bottom-0 right-0 inner30 bg-fff z-index-2" >
|
||||
<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>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowReg?'display:block':'display:none'" v-if="isShowReg">
|
||||
<div class="msgBg" @click="closeReg"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word">
|
||||
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="text" v-model="name" placeholder="请输入您的姓名" />
|
||||
</div>
|
||||
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="tel" v-model="telPhone" placeholder="请输入手机号" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt20 opt pl40 pr40">
|
||||
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r750" @click="toPay()">确定支付</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
// info:{
|
||||
// title:"纳米Box 轻Young空间",
|
||||
// e_time: 5,
|
||||
// price:9.9,
|
||||
// validity:'有效期 2022-08-01 -2022 -08-31',
|
||||
// introTitle:'权益说明',
|
||||
// content:'纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。',
|
||||
// "banner": [
|
||||
// "https://img.zcool.cn/community/0144975f5d8a2711013e3187fe2bb7.jpg@1280w_1l_2o_100sh.jpg",
|
||||
// "https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/v-5.jpg",
|
||||
// ],
|
||||
// },
|
||||
info : <?=json_encode($info)?>,
|
||||
bundleIntervalEvent: '',//倒计时
|
||||
isShowReg: false,
|
||||
name: '',
|
||||
telPhone: '',
|
||||
isSubmiting: false,
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
//用计算属性显示结果
|
||||
showTime() {
|
||||
//剩余秒数<=0
|
||||
if (this.info.e_time <= 0) {
|
||||
return "活动已结束";
|
||||
}
|
||||
// 剩余秒数>0
|
||||
else {
|
||||
let day = Math.floor(this.info.e_time / 86400);
|
||||
let hour = Math.floor((this.info.e_time % 86400) / 3600);
|
||||
let min = Math.floor(((this.info.e_time % 86400) % 3600) / 60);
|
||||
let sec = Math.floor(((this.info.e_time % 86400) % 3600) % 60);
|
||||
if(day>0){
|
||||
return ("<span class='text-middle'>距抢购结束还有</span><em class='text-middle pl5 pr5'>"+day+ "</em><em class='text-middle'>天</em><em class='text-middle pl5 pr5'>"+(hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='text-middle pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(hour>0){
|
||||
return ("<span class='text-middle'>距抢购结束还有</span><em class='text-middle color-ff7200 pl5 pr5'>"+(hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(min>0){
|
||||
return ("<span class='text-middle'>距抢购结束还有</span><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(sec>0){
|
||||
return ("<span class='text-middle'>距抢购结束还有</span><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
let that = this
|
||||
let swiper = new Swiper('.goods-banner .swiper-container', {
|
||||
//loop: true,
|
||||
//autoHeight: true,
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
type: 'fraction',
|
||||
},
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
on: {
|
||||
slideChangeTransitionEnd: function(){
|
||||
that.activeIndex = this.activeIndex
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//倒计时
|
||||
this.bundleIntervalEvent = setInterval(this.intervalEvent, 1000);
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.bundleIntervalEvent);
|
||||
},
|
||||
methods: {
|
||||
|
||||
showReg: function() {
|
||||
this.isShowReg = true
|
||||
},
|
||||
closeReg: function() {
|
||||
this.isShowReg = false
|
||||
},
|
||||
|
||||
toPay() {
|
||||
var that = this
|
||||
if (!this.name) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入您的姓名"
|
||||
});
|
||||
}else if (!/^1[3456789]\d{9}$/.test(this.telPhone)) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
}else{
|
||||
if(that.isSubmit){
|
||||
return ''
|
||||
}
|
||||
that.isSubmiting = true
|
||||
$.post('/h5/market/sylive/act/post_pay',{'skey':'<?=$info['skey']?>','name':that.name,'telPhone':that.telPhone},function (res){
|
||||
that.isSubmiting = false
|
||||
this.isShowReg = false
|
||||
if(res.code==200){
|
||||
var jsondata = res.data;
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest',
|
||||
jsondata,
|
||||
function(res){
|
||||
if(res.err_msg == "get_brand_wcpay_request:ok" ){//前端返回成功支付
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "恭喜您购买成功",
|
||||
onClose:function(){
|
||||
window.location = "/h5/market/sylive/act/ucenter?skey=<?=$info['skey']?>";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
mDialog.msg({content: "支付失败"});
|
||||
}
|
||||
}
|
||||
);
|
||||
}else{
|
||||
mDialog.msg({content: res.msg});
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
},
|
||||
|
||||
//直播倒计时
|
||||
intervalEvent() {
|
||||
if (this.info.e_time > 0) {
|
||||
this.info.e_time--;
|
||||
} else {
|
||||
clearInterval(this.bundleIntervalEvent);
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -0,0 +1,153 @@
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/clipboard.min.js"></script>
|
||||
<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="detail-banner relative p-swiper">
|
||||
<div class="swiper-container left-0 top-0">
|
||||
<div class="swiper-wrapper">
|
||||
<div class="swiper-slide bg-size-cover" v-for="item in list" >
|
||||
<div class="relative">
|
||||
<img class="wp100 block" style="pointer-events:none;" :src="item.img" />
|
||||
<div class="absolute left-0 right-0 bottom-0 mb30 text-center font-22 color-fff">{{posterTip}}</div>
|
||||
<img class="absolute right-0 bottom-0 mr40 mb80 imgsize-160X160" style="pointer-events:none;" :src="item.code" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-pagination ulib-rl750"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="bts-1-eee inner30">
|
||||
<div class="text-center">分享文案</div>
|
||||
<div class="mt30 relative bds-1-eee inner30 pr200 ulib-r20 font-28" v-for="(item,index) in shareTx">
|
||||
<span>{{item}}</span>
|
||||
<a class="absolute right-0 box-middle mr30 inline-block pl30 pr30 line-height-17 bg-eee ulib-r750 J_copy" :data-clipboard-text="item">复制</a>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div @click="showPoster">
|
||||
<div style="height:70px;"></div>
|
||||
<div class="fixed left-0 bottom-0 right-0 bg-000-op80 pt20 pb20 pl30 pr30 text-center z-index-4">
|
||||
<button class="wp100 bg-fff border-none pt30 pb30 font-32 color-1a1a1a ulib-r10">生成海报</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="msgisShowPoster?'display:block':'display:none'">
|
||||
<div class="msgBgPoster" @click="closePoster"></div>
|
||||
<div class="msgMain">
|
||||
<i @click="closePoster" class="posterClose" v-if="posterSrc"><span></span></i>
|
||||
<div class="msgPoster">
|
||||
<div class="postercon overflowhidden ulib-r20">
|
||||
<div style="display:none;">
|
||||
<canvas id="canvas"></canvas>
|
||||
</div>
|
||||
<div v-if="posterSrc"><img class="wp100 ulib-r20" :src='posterSrc' alt="" /></div>
|
||||
</div>
|
||||
<div class="pt30 pb10 text-center text-center font-30 color-fff" v-if="posterSrc">
|
||||
<img class="inline-block imgsize-42X42 text-middle" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-finger.png" alt="" />
|
||||
<span class="ml10 text-middle">长按图片保存到手机发送给好友</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
list:<?=json_encode($lists,JSON_UNESCAPED_UNICODE)?>,
|
||||
msgisShowPoster: false,
|
||||
canW:750,
|
||||
canH:0,
|
||||
activeIndex:0,
|
||||
posterSrc:'',
|
||||
posterTip:'<?=$posterTip?>',
|
||||
shareTx:<?=json_encode($shareTitle,JSON_UNESCAPED_UNICODE)?>,
|
||||
},
|
||||
mounted() {
|
||||
//复制文字
|
||||
let clipboardDemos = new ClipboardJS('.J_copy');
|
||||
clipboardDemos.on('success', function (e) {
|
||||
e.clearSelection();
|
||||
var msgDia = mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "复制成功!"
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
let that = this
|
||||
let swiper = new Swiper('.p-swiper .swiper-container', {
|
||||
//loop: true,
|
||||
//autoHeight: true,
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
type: 'fraction',
|
||||
},
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
on: {
|
||||
slideChangeTransitionEnd: function(){
|
||||
that.activeIndex = this.activeIndex
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
showPoster: function() {
|
||||
this.posterSrc= ''
|
||||
this.draw()
|
||||
},
|
||||
closePoster: function() {
|
||||
this.msgisShowPoster = false
|
||||
},
|
||||
|
||||
//海报生成
|
||||
draw() {
|
||||
let that = this
|
||||
let imgloading = mDialog.load({
|
||||
shade: false,
|
||||
text: "生成中...",
|
||||
offset: ["35%", "40%"],
|
||||
});
|
||||
that.canH = that.list[that.activeIndex].height/that.list[that.activeIndex].width*that.canW
|
||||
$("#canvas").attr({
|
||||
'width': that.canW,
|
||||
'height': that.canH,
|
||||
});
|
||||
let canvas = document.getElementById('canvas');
|
||||
let ctx = canvas.getContext("2d");
|
||||
let imgBg = new Image();
|
||||
imgBg.setAttribute("crossOrigin",'Anonymous')//如果二维码图片域名跨域,则保留此代码
|
||||
imgBg.src = that.list[that.activeIndex].img
|
||||
imgBg.onload = function () {
|
||||
ctx.drawImage(imgBg, 0, 0, that.list[that.activeIndex].width, that.list[that.activeIndex].height, 0, 0, that.canW, that.canH)
|
||||
let codeimg = new Image();
|
||||
codeimg.setAttribute("crossOrigin",'Anonymous')//如果二维码图片域名跨域,则保留此代码
|
||||
codeimg.src = that.list[that.activeIndex].code
|
||||
codeimg.onload = function () {
|
||||
ctx.fillStyle="#fff";
|
||||
ctx.textAlign="center";
|
||||
ctx.font="22px Georgia";
|
||||
ctx.fillText(that.posterTip,that.canW/2,that.canH-34,);
|
||||
ctx.drawImage(codeimg,that.canW-200, that.canH-240, 160, 160)
|
||||
setTimeout(function () {
|
||||
that.posterSrc = canvas.toDataURL("image/jpg")
|
||||
that.msgisShowPoster = true;
|
||||
mDialog.close(imgloading);
|
||||
}, 200);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -0,0 +1,75 @@
|
||||
<body class="bg-f6">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-f6" id="app" ref="app">
|
||||
<div>
|
||||
<wx-open-launch-weapp
|
||||
id='launch-btn'
|
||||
:username="wechat_ghid1"
|
||||
:path="wechat_url1">
|
||||
<template>
|
||||
<button class="btn" style="width:300px;height:60px;">链接测试东风</button>
|
||||
</template>
|
||||
<script type="text/wxtag-template">
|
||||
<button class="btn" style="width:300px;height:60px;">链接测试东风</button>
|
||||
</script>
|
||||
</wx-open-launch-weapp>
|
||||
</div>
|
||||
<div style="margin-top:50px;">
|
||||
<wx-open-launch-weapp
|
||||
id='launch-btn'
|
||||
:username="wechat_ghid2"
|
||||
:path="wechat_url2">
|
||||
<template>
|
||||
<button class="btn" style="width:300px;height:60px;">链接测试美家卡</button>
|
||||
</template>
|
||||
<script type="text/wxtag-template">
|
||||
<button class="btn" style="width:300px;height:60px;">链接测试美家卡</button>
|
||||
</script>
|
||||
</wx-open-launch-weapp>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
wechat_ghid1:'gh_54cc250f3a1a',
|
||||
wechat_url1:'subpackage/pages/testDrive/testDrive',
|
||||
wechat_ghid2:'gh_083b599d5bd3',
|
||||
wechat_url2:'pages/test/index',
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
})
|
||||
Vue.config.ignoredElements = ['wx-open-launch-weapp', 'wx-open-subscribe'];
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
wx.config({
|
||||
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
|
||||
appId: "<?=$sign_package['appId']?>", // 必填,公众号的唯一标识
|
||||
timestamp: "<?=$sign_package['timestamp']?>", // 必填,生成签名的时间戳
|
||||
nonceStr: "<?=$sign_package['nonceStr']?>", // 必填,生成签名的随机串
|
||||
signature: "<?=$sign_package['signature']?>",// 必填,签名
|
||||
jsApiList: ["openLocation", "updateAppMessageShareData", "updateTimelineShareData"], // 必填,需要使用的JS接口列表
|
||||
openTagList: ['wx-open-launch-weapp'] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
|
||||
});
|
||||
wx.ready(function () {
|
||||
});
|
||||
wx.error(function (res) {
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
@@ -0,0 +1,96 @@
|
||||
<body class="bg-f6">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-f6" id="app" ref="app">
|
||||
<div class="container">
|
||||
<div class="pt30 pl30 pr30 fn-clear">
|
||||
<a class="block fn-fl pt10 pb10 pl20 pr20 bg-ccc font-28 ulib-r750" href="javascript:;" @click="logout()">
|
||||
<i class="iconfont icon-tuichu text-middle"></i><span class="ml5 text-middle">退出</span>
|
||||
</a>
|
||||
<?if($multi_org){?>
|
||||
<a class="block fn-fr pt10 pb10 pl20 pr20 bg-333 font-28 color-fff ulib-r750" href="/h5/market/sylive2">
|
||||
<i class="iconfont icon-qiehuan1 text-middle"></i><span class="ml5 text-middle">切换机构</span>
|
||||
</a>
|
||||
<?}?>
|
||||
</div>
|
||||
<div class="inner30 pt0">
|
||||
<a class="block mt30 pb30 bg-fff overflowhidden box-shadow-lightGray ulib-r20" :href="item.url" v-for="(item,index) in list">
|
||||
<img class="imgsize-690X310" :src="item.img" alt="#">
|
||||
<div class="mt20 pl30 pr30 font-30 color-333">{{item.title}}</div>
|
||||
<div class="mt10 pl30 pr30 font-24 color-999">{{item.time}}</div>
|
||||
</a>
|
||||
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"><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: {
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1,
|
||||
size: 20,
|
||||
list:[],
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
//拉取数据
|
||||
fetchData: function() {
|
||||
this.getOrderList()
|
||||
},
|
||||
|
||||
//获取大区列表
|
||||
getOrderList(){
|
||||
let that=this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive2/biz/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/sylive2/login/logout', function (response) {
|
||||
if (response.code == 200) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg,
|
||||
onClose: function () {
|
||||
window.location = '/h5/market/sylive2/login'
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg
|
||||
});
|
||||
}
|
||||
}, 'json')
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
@@ -0,0 +1 @@
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
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?20221106">
|
||||
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/swiper/css/swiper.min.css">
|
||||
<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>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/swiper/js/swiper.min.js"></script>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript//vue-mugen-scroll.js"></script>
|
||||
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
</head>
|
||||
@@ -0,0 +1,18 @@
|
||||
<script type="text/javascript">
|
||||
wx.config({
|
||||
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
|
||||
appId: "<?=$sign_package['appId']?>", // 必填,公众号的唯一标识
|
||||
timestamp: "<?=$sign_package['timestamp']?>", // 必填,生成签名的时间戳
|
||||
nonceStr: "<?=$sign_package['nonceStr']?>", // 必填,生成签名的随机串
|
||||
signature: "<?=$sign_package['signature']?>",// 必填,签名
|
||||
jsApiList: ["hideAllNonBaseMenuItem", "hideMenuItems"], // 必填,需要使用的JS接口列表
|
||||
openTagList: ['wx-open-launch-weapp'] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
|
||||
});
|
||||
wx.ready(function () {
|
||||
wx.hideAllNonBaseMenuItem();
|
||||
});
|
||||
wx.error(function (res) {
|
||||
console.log('res', res);
|
||||
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,45 @@
|
||||
<body class="bg-fff">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-fff" id="app" ref="app">
|
||||
<div class="absolute tp20 left-0 right-0 text-center">
|
||||
<div class="font-40">请选择机构登录</div>
|
||||
<div class="mt20 font-28 color-666">您的账号存在多个机构</div>
|
||||
<div class="opt-line"></div>
|
||||
</div>
|
||||
<div class="absolute bp20 left-0 right-0 pl100 pr100 text-center fn-flex fn-flex-wrap">
|
||||
<a class="block wp50" :href="item.url" v-for="item in list">
|
||||
<img class='inline-block imgsize-210X210' :src='item.logo' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
list:[],
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getList(){
|
||||
// this.list = [
|
||||
// {
|
||||
// url:'221201-activityList.html',
|
||||
// img:'https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/v-1.png',
|
||||
// },
|
||||
// {
|
||||
// url:'221201-activityList.html',
|
||||
// img:'https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/v-2.png',
|
||||
// },
|
||||
// ]
|
||||
this.list = <?=json_encode($org_lists,JSON_UNESCAPED_UNICODE)?>
|
||||
}
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive2/hidden_wx_share')?>
|
||||
</body>
|
||||
@@ -0,0 +1,20 @@
|
||||
<body class="bg-f6">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-f6" id="app" ref="app">
|
||||
<div class="container relative">
|
||||
<div class="relative bg-fff mt30 mb30 ml30 mr30 inner40 ulib-r20 box-shadow-darkGray">
|
||||
<div class="mt10 pb20 text-center"><div class="inline-block relative pl10 pr10 introTitle font-36">
|
||||
<span class="relative z-index-1"><?=$info['title']?></span></div>
|
||||
</div>
|
||||
<div class="line-height-20 font-28 color-666 text-break rich-text-img">
|
||||
<?=$info['content']?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="javascript:history.back(-1)">
|
||||
<i class="iconfont icon-shouye text-middle font-36"></i>
|
||||
<div class="font-22">返回</div>
|
||||
</a>
|
||||
</div>
|
||||
</body>
|
||||
@@ -0,0 +1,520 @@
|
||||
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/LArea/css/LArea.css">
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LAreaData1.js"></script>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LAreaData2.js"></script>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LArea.js"></script>
|
||||
<body class="bg-f6">
|
||||
<div id="app" ref="app">
|
||||
<div class="container relative pb130">
|
||||
<!--轮播-->
|
||||
<div class="goods-banner relative imgsize-750X680 z-index-0" v-if='info.banner && info.banner.length>1'>
|
||||
<div class="swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<div class="swiper-slide" v-for="item in info.banner">
|
||||
<img class="imgsize-750X680" :src="item" alt="#" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-pagination ulib-rl750 font-22 color-fff"></div>
|
||||
</div>
|
||||
<div v-else><img class="imgsize-750X680" :src="info.banner[0]" alt="#" /></div>
|
||||
<!--end 轮播-->
|
||||
<div class="relative pb30 z-index-1 goods-con">
|
||||
<div class="relative bg-fff mb30 ml30 mr30 inner40 pr220 ulib-r20 box-shadow-darkGray">
|
||||
<div class="font-32 line-height-13 ">{{info.title}}</div>
|
||||
<div class="mt10 font-22 color-999">{{info.validity}}</div>
|
||||
<div class="absolute right-0 box-middle mr30 color-c4302c">
|
||||
<span class="font-24">¥</span>
|
||||
<span class="font-48 text-bold">{{info.price}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative bg-fff mb30 ml30 mr30 inner40 ulib-r20 box-shadow-darkGray">
|
||||
<div class="pb20 text-center">
|
||||
<div class="inline-block relative pl10 pr10 introTitle font-36">
|
||||
<span class="relative z-index-1">{{info.introTitle}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-height-17 font-28 color-666 text-break space-pre-line rich-text-img" v-html="info.content"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fixed left-0 bottom-0 right-0 inner30 bg-fff z-index-2" >
|
||||
<template v-if="info.s_time>0">
|
||||
<a class="block bg-999 pt20 pb20 text-center color-fff ulib-r10" href="javascript:void(0)">
|
||||
<div class="font-32">立即支付<span>{{info.price}}</span>元</div>
|
||||
<div class="mt10 font-20 color-fff" v-html="showTime"></div>
|
||||
</a>
|
||||
</template>
|
||||
<template v-else-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>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowReg?'display:block':'display:none'" v-if="isShowReg">
|
||||
<div class="msgBg" @click="closeReg"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word">
|
||||
<div class="relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="text" v-model="name" placeholder="请输入您的姓名" />
|
||||
</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="tel" oninput="if(value.length>11)value=value.slice(0,11)" v-model="telPhone" placeholder="请输入手机号" />
|
||||
</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10 pr200">
|
||||
<div><input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="number" oninput="if(value.length>4)value=value.slice(0,4)" v-model="vCode" placeholder="请输入验证码" /></div>
|
||||
<a :class="[codeState ?'color-333':'color-999','absolute right-0 mr20 box-middle font-30']" @click="getcode()">{{codeTx}}</a>
|
||||
</div>
|
||||
<div class="mt30 fn-flex" v-if="info.need_shop">
|
||||
<select class="fn-flex-item height-70 wp25 pt10 pb10 mr20 select-more ulib-r10 font-30" v-model="province">
|
||||
<option value="">选择省</option>
|
||||
<option v-for="item in province_arr" :value="item.name">{{item.name}}</option>
|
||||
</select>
|
||||
<select class="fn-flex-item height-70 wp25 pt10 pb10 mr20 select-more ulib-r10 font-30" v-model="city">
|
||||
<option value="">选择市</option>
|
||||
<option v-for="item in city_arr" :value="item.name">{{item.name}}</option>
|
||||
</select>
|
||||
<select class="fn-flex-item height-70 wp25 pt10 pb10 select-more ulib-r10 font-30" v-model="biz">
|
||||
<option value="">选择店</option>
|
||||
<option v-for="item in biz_arr" :value="item.name">{{item.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mt30 pl5 font-26 color-666">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt30">
|
||||
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="toPay()">确定支付</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="msg fn-hide" :style="isShowSuccess?'display:block':'display:none'" v-if="isShowSuccess">
|
||||
<div class="msgBg" @click="closeSuccess()"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word text-center">
|
||||
<div class="font-36">支付成功</div>
|
||||
<div class="mt15 font-22 color-999">请输入您的收货地址</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input id="region" class="wp100 inner30 font-28 bg-f6 border-none ulib-r10" type="text" readonly="" v-model="region" placeholder="选择省/市/区" />
|
||||
<input id="regionvalue" type="hidden" v-model="regionvalue"/>
|
||||
</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-28 bg-f6 border-none ulib-r10" type="text" v-model="address" placeholder="请输入详细地址" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt30">
|
||||
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="postAddress()">确认</a>
|
||||
</div>
|
||||
<div class="mt30 text-center">
|
||||
<a class="font-24 text-underline" @click="goLive()">不了,看完直播再说></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
// info:{
|
||||
// title:"纳米Box 轻Young空间",
|
||||
// e_time: 5,
|
||||
// price:9.9,
|
||||
// validity:'有效期 2022-08-01 -2022 -08-31',
|
||||
// introTitle:'权益说明',
|
||||
// content:'纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。',
|
||||
// "banner": [
|
||||
// "https://img.zcool.cn/community/0144975f5d8a2711013e3187fe2bb7.jpg@1280w_1l_2o_100sh.jpg",
|
||||
// "https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/v-5.jpg",
|
||||
// ],
|
||||
// },
|
||||
info : <?=json_encode($info)?>,
|
||||
bundleIntervalEvent: '',//倒计时
|
||||
isShowReg: false,
|
||||
name: '',
|
||||
telPhone: '',
|
||||
isSubmiting: false,
|
||||
vCode:'',
|
||||
codeState:true,
|
||||
codeTx:'立即获取',
|
||||
isXYChecked: false,
|
||||
region:'',
|
||||
regionvalue:'',
|
||||
address:'',
|
||||
isShowSuccess: false,
|
||||
province_arr:<?=json_encode($province_arr,JSON_UNESCAPED_UNICODE)?>,
|
||||
city_arr:<?=json_encode($city_arr,JSON_UNESCAPED_UNICODE)?>,
|
||||
biz_arr:<?=json_encode($biz_arr,JSON_UNESCAPED_UNICODE)?>,
|
||||
province:'',
|
||||
city:'',
|
||||
biz:'',
|
||||
oid:0,
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
//用计算属性显示结果
|
||||
showTime() {
|
||||
//剩余秒数<=0
|
||||
if(this.info.s_time>0){
|
||||
let day = Math.floor(this.info.s_time / 86400);
|
||||
let hour = Math.floor((this.info.s_time % 86400) / 3600);
|
||||
let min = Math.floor(((this.info.s_time % 86400) % 3600) / 60);
|
||||
let sec = Math.floor(((this.info.s_time % 86400) % 3600) % 60);
|
||||
if(day>0){
|
||||
return ("<span class='text-middle'>距抢购开始还有</span><em class='text-middle pl5 pr5'>"+day+ "</em><em class='text-middle'>天</em><em class='text-middle pl5 pr5'>"+(hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='text-middle pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(hour>0){
|
||||
return ("<span class='text-middle'>距抢购开始还有</span><em class='text-middle color-ff7200 pl5 pr5'>"+(hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(min>0){
|
||||
return ("<span class='text-middle'>距抢购开始还有</span><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(sec>0){
|
||||
return ("<span class='text-middle'>距抢购开始还有</span><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}
|
||||
}else if(this.info.e_time <= 0) {
|
||||
return "活动已结束";
|
||||
} else {// 剩余秒数>0
|
||||
let day = Math.floor(this.info.e_time / 86400);
|
||||
let hour = Math.floor((this.info.e_time % 86400) / 3600);
|
||||
let min = Math.floor(((this.info.e_time % 86400) % 3600) / 60);
|
||||
let sec = Math.floor(((this.info.e_time % 86400) % 3600) % 60);
|
||||
if(day>0){
|
||||
return ("<span class='text-middle'>距抢购结束还有</span><em class='text-middle pl5 pr5'>"+day+ "</em><em class='text-middle'>天</em><em class='text-middle pl5 pr5'>"+(hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='text-middle pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(hour>0){
|
||||
return ("<span class='text-middle'>距抢购结束还有</span><em class='text-middle color-ff7200 pl5 pr5'>"+(hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(min>0){
|
||||
return ("<span class='text-middle'>距抢购结束还有</span><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}else if(sec>0){
|
||||
return ("<span class='text-middle'>距抢购结束还有</span><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
||||
10 ? "0" : "") + sec+"</em><em class='text-middle'>秒</em>");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
let that = this
|
||||
let swiper = new Swiper('.goods-banner .swiper-container', {
|
||||
//loop: true,
|
||||
//autoHeight: true,
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
type: 'fraction',
|
||||
},
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
on: {
|
||||
slideChangeTransitionEnd: function(){
|
||||
that.activeIndex = this.activeIndex
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//倒计时
|
||||
this.bundleIntervalEvent = setInterval(this.intervalEvent, 1000);
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.bundleIntervalEvent);
|
||||
},
|
||||
methods: {
|
||||
showReg: function() {
|
||||
this.isShowReg = true
|
||||
},
|
||||
closeReg: function() {
|
||||
this.isShowReg = false
|
||||
},
|
||||
countDownTime(time) {
|
||||
let that = this;
|
||||
if (time > 1) {
|
||||
time--;
|
||||
this.codeState = false;
|
||||
this.codeTx = time + "s后重新获取";
|
||||
Timer = setTimeout(function() {
|
||||
that.countDownTime(time);
|
||||
}, 1000)
|
||||
} else {
|
||||
clearTimeout(Timer);
|
||||
that.codeState = true;
|
||||
that.codeTx = "立即获取";
|
||||
}
|
||||
},
|
||||
|
||||
getcode() {
|
||||
if(!this.codeState) return;
|
||||
if (!/^1[3456789]\d{9}$/.test(this.telPhone)) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
} else {
|
||||
//按钮倒计时
|
||||
var that = this
|
||||
$.post('/h5/market/sylive/item/get_code',{'mobile':that.telPhone},function (response){
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg
|
||||
});
|
||||
if(response.code==200){
|
||||
that.countDownTime(91)
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
},
|
||||
toPay() {
|
||||
var that = this
|
||||
if(this.info.need_shop){
|
||||
if(!this.province){
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请选择省份"
|
||||
});
|
||||
return ''
|
||||
}
|
||||
if(!this.city){
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请选择城市"
|
||||
});
|
||||
return ''
|
||||
}
|
||||
if(!this.biz){
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请选择门店"
|
||||
});
|
||||
return ''
|
||||
}
|
||||
}
|
||||
if (!this.name) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入您的姓名"
|
||||
});
|
||||
}else if (!/^1[3456789]\d{9}$/.test(this.telPhone)) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
}else if(!this.vCode) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入验证码"
|
||||
});
|
||||
}else if(!this.isXYChecked) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请阅读并同意《关于用户门票须知》"
|
||||
});
|
||||
}else{
|
||||
if(that.isSubmit){
|
||||
return ''
|
||||
}
|
||||
|
||||
that.isSubmiting = true
|
||||
var params = {
|
||||
'skey':'<?=$info['skey']?>',
|
||||
'itemId':'<?=$info['itemId']?>',
|
||||
'name':that.name,
|
||||
'telPhone':that.telPhone,
|
||||
'code' : that.vCode,
|
||||
'province' : that.province,
|
||||
'city' : that.city,
|
||||
'biz' : that.biz
|
||||
}
|
||||
$.post('/h5/market/sylive/item/post_pay',params,function (res){
|
||||
that.isSubmiting = false
|
||||
if(res.code==200){
|
||||
that.isShowReg = false
|
||||
var jsondata = res.data.wxjson;
|
||||
that.oid = res.data.oid
|
||||
WeixinJSBridge.invoke('getBrandWCPayRequest', jsondata, function(res){
|
||||
if(res.err_msg == "get_brand_wcpay_request:ok" ){//前端返回成功支付
|
||||
that.showSuccess()
|
||||
}else{
|
||||
mDialog.msg({content: "支付失败"});
|
||||
}
|
||||
}
|
||||
);
|
||||
}else{
|
||||
mDialog.msg({content: res.msg});
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
},
|
||||
|
||||
//直播倒计时
|
||||
intervalEvent() {
|
||||
if (this.info.s_time > 0){
|
||||
this.info.s_time--;
|
||||
}else if (this.info.e_time > 0) {
|
||||
this.info.e_time--;
|
||||
} else {
|
||||
clearInterval(this.bundleIntervalEvent);
|
||||
}
|
||||
},
|
||||
|
||||
//关闭支付成功提示
|
||||
closeSuccess: function() {
|
||||
this.isShowSuccess = false
|
||||
},
|
||||
showSuccess: function (){
|
||||
if(this.info.ifAddress>0){ //需要填写收货地址
|
||||
this.isShowSuccess = true;
|
||||
//选择省市初始化
|
||||
setTimeout(function () {
|
||||
let area = new LArea();
|
||||
area.init({
|
||||
'trigger': '#region', //触发选择控件的文本框,同时选择完毕后name属性输出到该位置
|
||||
'valueTo': '#regionvalue', //选择完毕后id属性输出到该位置
|
||||
'keys': {
|
||||
id: 'value',
|
||||
name: 'text'
|
||||
}, //绑定数据源相关字段 id对应valueTo的value属性输出 name对应trigger的value属性输出
|
||||
'type': 2,
|
||||
'data': [provs_data, citys_data, dists_data]
|
||||
});
|
||||
if(that.region !=''){
|
||||
for(var i in provs_data){
|
||||
if(provs_data[i].text==that.region.split(",")[0]){
|
||||
var x=i;
|
||||
var city=citys_data[provs_data[i].value];
|
||||
for(var j in city){
|
||||
if(city[j].text==that.region.split(",")[1]){
|
||||
var y=j;
|
||||
var district=dists_data[city[j].value];
|
||||
for(var k in district){
|
||||
if(district[k].text==that.region.split(",")[2]){
|
||||
var z=k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
area.value=[x,y,z];//控制初始位置,注意:该方法并不会影响到input的value
|
||||
}else{
|
||||
area.value=[12,1,1];//控制初始位置,注意:该方法并不会影响到input的value
|
||||
}
|
||||
area.success = function(){
|
||||
that.regionvalue = $("#regionvalue").val();
|
||||
}
|
||||
}, 200)
|
||||
}else{
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: '支付成功',
|
||||
onClose:function(){
|
||||
window.location = "/h5/market/sylive/ucenter?skey=<?=$info['skey']?>";
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//提交地址
|
||||
postAddress() {
|
||||
if (this.isSubmiting) return;
|
||||
if (!this.region) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请选择所在地区"
|
||||
});
|
||||
}else if (!this.address) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入详细地址"
|
||||
});
|
||||
}else{
|
||||
this.isSubmiting = true
|
||||
var params = {
|
||||
'skey':'<?=$skey?>',
|
||||
'region':this.region,
|
||||
'address':this.address,
|
||||
'id':this.oid
|
||||
}
|
||||
var that = this;
|
||||
$.post('/h5/market/sylive/ucenter/edit_address',params,function (res){
|
||||
that.isSubmiting = false
|
||||
if(res.code==200){
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: res.msg,
|
||||
onClose:function(){
|
||||
window.location = "/h5/market/sylive/ucenter?skey=<?=$info['skey']?>";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: res.msg
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
},
|
||||
//跳转直播间
|
||||
goLive(){
|
||||
window.location = this.info.live_url;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'province': function (nv, ov) {
|
||||
var vm = this;
|
||||
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){
|
||||
vm.city_arr = res.data.lists
|
||||
},'json')
|
||||
}
|
||||
},
|
||||
'city': function (nv, ov) {
|
||||
var vm = this;
|
||||
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){
|
||||
vm.biz_arr = res.data.lists
|
||||
},'json')
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -0,0 +1,160 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
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?20221106">
|
||||
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/swiper/css/swiper.min.css">
|
||||
<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>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/swiper/js/swiper.min.js"></script>
|
||||
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
</head>
|
||||
<body class="bg-fff">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-fff" id="app" ref="app">
|
||||
<div class="container relative bg-repeat-y bg-size-fullwidth bg-pos-center" style="background-image:url(https://qs.haodian.cn/web/images/project/H5-ShiYu/loginbg2.jpg?v=221008)">
|
||||
<div class="absolute box-middle left-0 right-0 pl80 pr80 pb220">
|
||||
<div class="color-fff">
|
||||
<div class="font-52">手机号登录</div>
|
||||
<div class="mt20 font-28">欢迎使用好店云-私域直播系统</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="relative mt50 bg-fff-op15 ulib-r750">
|
||||
<input class="wp100 pt30 pb30 pl40 pr20 bg-transparent border-none font-32 color-fff placeholder-color-ccc" type="tel" v-model="telPhone" placeholder="请输入手机号" />
|
||||
</div>
|
||||
<div class="relative mt50 bg-fff-op15 ulib-r750">
|
||||
<input class="wp100 pt30 pb30 pl40 pr40 bg-transparent border-none font-32 color-fff placeholder-color-ccc" type="number" oninput="if(value.length>4)value=value.slice(0,4)" v-model="vCode" placeholder="请输入验证码" />
|
||||
<div class="absolute right-0 box-middle mr30 font-32 color-fff" @click="getcode()">{{codeTx}}</div>
|
||||
</div>
|
||||
<button class="mt50 wp100 bg-fff-op80 border-none pt30 pb30 font-32 color-333 ulib-r750" @click="submit()">立即登录</button>
|
||||
<!--
|
||||
<div class="mt50 text-center font-24 color-fff">
|
||||
<label>
|
||||
<input type="checkbox" class="checkbox-input" v-model="rememberMe" />
|
||||
<span>记住账号</span>
|
||||
</label>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="absolute bottom-0 left-0 right-0 pl40 pr40 pb80 text-center color-fff">
|
||||
<div class="font-22">powered by haodian.cn</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
telPhone:'',
|
||||
vCode:'',
|
||||
codeState:true,
|
||||
codeTx:'获取验证码',
|
||||
isSubmiting: false,
|
||||
rememberMe: true,
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
var Timer;
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
countDownTime(time) {
|
||||
let that = this;
|
||||
if (time > 1) {
|
||||
time--;
|
||||
this.codeState = false;
|
||||
this.codeTx = time + "s后重新获取";
|
||||
Timer = setTimeout(function() {
|
||||
that.countDownTime(time);
|
||||
}, 1000)
|
||||
} else {
|
||||
clearTimeout(Timer);
|
||||
that.codeState = true;
|
||||
that.codeTx = "获取验证码";
|
||||
}
|
||||
},
|
||||
|
||||
getcode() {
|
||||
if (!this.codeState) return;
|
||||
if (!/^1[3456789]\d{9}$/.test(this.telPhone)) {
|
||||
//alert('请输入正确手机号')
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
} else {
|
||||
//按钮倒计时
|
||||
var that = this;
|
||||
$.post('/h5/market/sylive2/login/get_code',{'mobile':this.telPhone},function (response){
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg
|
||||
});
|
||||
if(response.code==200){
|
||||
that.countDownTime(91)
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
if (this.isSubmiting) return;
|
||||
if (!/^1[3456789]\d{9}$/.test(this.telPhone)) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
}else if (!this.vCode) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入验证码"
|
||||
});
|
||||
}else{
|
||||
// this.isSubmiting = true
|
||||
$.post('/h5/market/sylive2/login',{'mobile':this.telPhone,'code':this.vCode,'remember':this.rememberMe},function (response){
|
||||
if(response.code==200){
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg,
|
||||
onClose:function(){
|
||||
window.location = "/h5/market/sylive2/login/userinfo"
|
||||
}
|
||||
});
|
||||
}else{
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg
|
||||
});
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive2/hidden_wx_share')?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive2/stic">
|
||||
<i class="iconfont icon-shouye text-middle font-36"></i>
|
||||
<div class="font-22">首页</div>
|
||||
</a>
|
||||
@@ -0,0 +1,4 @@
|
||||
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive2/ucenter?skey=<?=$skey?>">
|
||||
<i class="iconfont icon-wode text-middle font-36"></i>
|
||||
<div class="font-22">我的</div>
|
||||
</a>
|
||||
@@ -0,0 +1,60 @@
|
||||
<script type="text/javascript">
|
||||
wx.config({
|
||||
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
|
||||
appId: "<?=$sign_package['appId']?>", // 必填,公众号的唯一标识
|
||||
timestamp: "<?=$sign_package['timestamp']?>", // 必填,生成签名的时间戳
|
||||
nonceStr: "<?=$sign_package['nonceStr']?>", // 必填,生成签名的随机串
|
||||
signature: "<?=$sign_package['signature']?>",// 必填,签名
|
||||
jsApiList: [
|
||||
"openLocation", "updateAppMessageShareData", "updateTimelineShareData",
|
||||
"hideAllNonBaseMenuItem","showMenuItems"
|
||||
], // 必填,需要使用的JS接口列表
|
||||
openTagList: ['wx-open-launch-weapp'] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
|
||||
});
|
||||
wx.ready(function () {
|
||||
wx.hideAllNonBaseMenuItem();
|
||||
wx.showMenuItems({
|
||||
menuList: [
|
||||
'menuItem:share:appMessage', 'menuItem:share:timeline','menuItem:share:qq',
|
||||
'menuItem:share:weiboApp','menuItem:share:facebook','menuItem:share:QZone',
|
||||
] // 要显示的菜单项,所有 menu 项见附录3
|
||||
});
|
||||
//自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容
|
||||
wx.updateTimelineShareData({
|
||||
title: '<?=$share['title']?>', // 分享标题
|
||||
link: '<?=$share['url']?>', // 分享链接
|
||||
imgUrl: '<?=$share['img']?>', // 分享图标
|
||||
desc: '<?=$share['desc']?>', // 分享描述
|
||||
success: function () {
|
||||
// 用户成功分享后执行的回调函数
|
||||
alert(option.title);
|
||||
option.success()
|
||||
},
|
||||
cancel: function () {
|
||||
// 用户取消分享后执行的回调函数
|
||||
option.error()
|
||||
}
|
||||
});
|
||||
//自定义“分享给朋友”及“分享到QQ”按钮的分享内容
|
||||
wx.updateAppMessageShareData({
|
||||
title: '<?=$share['title']?>', // 分享标题
|
||||
desc: '<?=$share['desc']?>', // 分享描述
|
||||
link: '<?=$share['url']?>', // 分享链接
|
||||
imgUrl: '<?=$share['img']?>', // 分享图标
|
||||
success: function () {
|
||||
// 用户成功分享后执行的回调函数
|
||||
alert(option.title);
|
||||
option.success()
|
||||
},
|
||||
cancel: function () {
|
||||
// 用户取消分享后执行的回调函数
|
||||
option.error()
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
wx.error(function (res) {
|
||||
console.log('res', res);
|
||||
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,365 @@
|
||||
<body class="bg-fff">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-fff" id="app" ref="app">
|
||||
<div class="container pb130">
|
||||
<div class="bg-eee-fff">
|
||||
<div class="inner20 fn-flex">
|
||||
<div class="fn-flex-item relative inner10 bg-333 mr30 ulib-r750 fn-clear" flexsize="4">
|
||||
<img class='block fn-fl imgsize-32X32 ulib-r750' :src='info.headimg' />
|
||||
<div class="absolute left-0 box-middle wp90 pl50">
|
||||
<div class="text-nowrap font-22 color-ddd"><span class="color-fff">{{info.nickname}}·</span><span class="color-ddd">{{info.group}}</span></div>
|
||||
</div>
|
||||
<a class="block fn-fr relative bg-fff imgsize-32X32 ulib-r750" @click="logout()"><i class="absolute box-center-middle iconfont font-24 icon-tuichu1"></i></a>
|
||||
</div>
|
||||
<a class="fn-flex-item pt10 pb10 bg-ccc text-center font-28 ulib-r750" href="/h5/market/sylive2/biz" flexsize="1">
|
||||
<i class="iconfont icon-huodong2 text-middle"></i>
|
||||
<span class="text-middle">活动</span>
|
||||
</a>
|
||||
</div>
|
||||
<img class='block imgsize-750X340 ulib-rt20' :src='info.theme' />
|
||||
<div id="main" class="inner30">
|
||||
<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 glider2-'+tabIndex"></div>
|
||||
</div>
|
||||
<!--预热阶段-->
|
||||
<div v-if="tabid==1">
|
||||
<div class="mt30 bts-4-333 bbs-4-ff9d47 bg-fff overflowhidden ulib-r20">
|
||||
<div class="relative bbs-1-f4f4f4 last-b-none fn-flex text-center" v-if="role==2 || biz_id>0">
|
||||
<a class="fn-flex-item pt40 pb40" v-for="item in h_lists" >
|
||||
<div class="font-32">{{item.num}}</div>
|
||||
<div class="mt10 font-22 color-666">{{item.title}}</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="relative fn-flex fn-flex-wrap text-center" v-else>
|
||||
<a class="wp33 pt40 pb40 bbs-1-f4f4f4" v-for="item in h_lists">
|
||||
<div class="font-32">{{item.num}}</div>
|
||||
<div class="mt10 font-22 color-666">{{item.title}}</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="relative bg-f6 bbs-1-fff last-b-none fn-flex text-center" v-for="item in sub_lists">
|
||||
<div class="absolute top-0 box-center cell-tt pl5 pr5 font-22 color-fff">{{item.title}}</div>
|
||||
<a class="fn-flex-item pt40 pb40" v-for="val in item.lists" :href="val.url">
|
||||
<div class="font-32 color-ff9d47">{{val.num}}</div>
|
||||
<div class="mt10 font-22 color-666">
|
||||
{{val.title}}
|
||||
<i v-if="val.url" class="iconfont icon-gengduo"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end 预热阶段-->
|
||||
<!--直播阶段-->
|
||||
<div v-if="tabid==2">
|
||||
|
||||
<div class="mt30 bg-fff inner20 overflowhidden text-center font-24 color-666 ulib-r20">直播结算后6小时同步数据</div>
|
||||
|
||||
<div class="mt30 bts-4-333 bbs-4-ff9d47 bg-fff overflowhidden ulib-r20">
|
||||
<div class="relative fn-flex fn-flex-wrap text-center">
|
||||
<a class="wp33 pt40 pb40 bbs-1-f4f4f4" v-for="item in h_lists" :href="item.url">
|
||||
<div class="font-32">{{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="relative bg-f6 bbs-1-fff last-b-none fn-flex text-center" v-for="item in sub_lists">
|
||||
<div class="absolute top-0 box-center cell-tt pl5 pr5 font-22 color-fff">{{item.title}}</div>
|
||||
<a class="fn-flex-item pt40 pb40" v-for="val in item.lists" :href="val.url">
|
||||
<div class="font-32 color-ff9d47">{{val.num}}</div>
|
||||
<div class="mt10 font-22 color-666">
|
||||
{{val.title}}
|
||||
<i v-if="val.url" class="iconfont icon-gengduo"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end 直播阶段-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--列表-->
|
||||
<div class="inner30 pt10" v-if="role == '1'">
|
||||
<div>
|
||||
<a class="block relative mb30 bg-f6 inner30 ulib-r20 box-shadow-lightGray" :href="[item.url ? item.url:'javascript:;']" v-for="(item,index) in list">
|
||||
<div class="text-nowrap wp60 font-32">{{item.title}}</div>
|
||||
<div class="absolute right-0 box-middle font-28">
|
||||
<span>{{item.note}}</span>
|
||||
<span class="pl15 pr15 color-ff9d47">{{item.num}}</span>
|
||||
<i class="iconfont icon-gengduo color-666" v-if="item.url"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"><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 class="ml30 mr30 mb20 relative bg-fff inner40 pr30 overflowhidden box-shadow-lightGray ulib-r20" v-else-if="role == '2'">
|
||||
<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"><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 class="fixed left-0 bottom-0 right-0 pt20 pb30 bg-fff-op95 text-center font-22 fn-flex" >
|
||||
<a class="fn-flex-item" href="/h5/market/sylive2/stic">
|
||||
<img class="imgsize-50X50" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-home-ac.png" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">首页</div>
|
||||
</a>
|
||||
<a class="fn-flex-item" href="<?=$act_url?>">
|
||||
<img class="imgsize-50X50" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-activity.png" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">活动</div>
|
||||
</a>
|
||||
<a class="fn-flex-item" href="/h5/market/sylive2/stic/ranking">
|
||||
<img class="imgsize-50X50" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking.png" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">排行</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
tabFixed:false,
|
||||
tabIndex:0,
|
||||
tabid:'<?=$info['tab']?>',//1预热阶段 /2直播阶段
|
||||
info:'',
|
||||
load: false,
|
||||
h_lists : [],
|
||||
sub_lists:[],
|
||||
// begin:{
|
||||
// cell1:[],
|
||||
// cell2:[],
|
||||
// },
|
||||
live:{
|
||||
cell1:[],
|
||||
cell2:[],
|
||||
cell3:[],
|
||||
},
|
||||
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1, //页数
|
||||
size: 20, //每页取多少个数据
|
||||
list:[],
|
||||
|
||||
role:'<?=$info['is_biz'] ? 2 : 1?>', //用户角色 2门店和顾问 1其它角色
|
||||
biz_id : <?=$info['biz_id'] ? $info['biz_id'] : 0?>,
|
||||
groupsId: '<?=$info['groupsId']?>',
|
||||
dynamic:{
|
||||
title:'',
|
||||
list:[],
|
||||
},
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('scroll', this.handleScroll, true)
|
||||
this.getInfo()
|
||||
if(this.tabid == 2){
|
||||
this.tabIndex = 1
|
||||
this.getLive()
|
||||
}else{
|
||||
this.getBegin()
|
||||
}
|
||||
// this.getBegin()
|
||||
},
|
||||
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 = {
|
||||
nickname:"<?=$info['nickname']?>",
|
||||
headimg:"<?=$info['headimg']?>",
|
||||
group:'<?=$info['group_name']?>',
|
||||
theme:'<?=$info['banner']?>',
|
||||
tab:[
|
||||
{
|
||||
id:'1',
|
||||
title:'预热阶段',
|
||||
},
|
||||
{
|
||||
id:'2',
|
||||
title:'直播阶段',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
//tab切换
|
||||
changeTab(id,index){
|
||||
if(id != this.tabid&&!this.load){
|
||||
if(this.tabFixed){
|
||||
let mainoffsetTop = document.querySelector('#main').offsetTop
|
||||
$('html,body').animate({scrollTop: mainoffsetTop+5},500);
|
||||
}
|
||||
this.tabid = id
|
||||
this.tabIndex = index
|
||||
this.isNoData = false
|
||||
this.isDataEnd = false
|
||||
this.dynamic.list = []
|
||||
this.page = 1
|
||||
this.h_lists = []
|
||||
this.sub_lists = []
|
||||
this.list = []
|
||||
if(this.tabid == 1){
|
||||
this.getBegin()
|
||||
}else if(this.tabid == 2){
|
||||
this.getLive()
|
||||
}
|
||||
if(this.role == '1'){
|
||||
this.getGroupList()
|
||||
}else if (this.role == '2'){
|
||||
this.getDynamicList() //动态
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//预热阶段数据
|
||||
getBegin(){
|
||||
let that=this;
|
||||
$.get('/h5/market/sylive2/stic/lists_ready',{'groupsId':that.groupsId},function (result) {
|
||||
that.h_lists = result.data.h_lists
|
||||
that.sub_lists = result.data.sub_lists
|
||||
},'json')
|
||||
},
|
||||
|
||||
//拉取数据
|
||||
fetchData: function() {
|
||||
if(this.role == '1'){
|
||||
//门店列表
|
||||
this.getGroupList()
|
||||
}else if(this.role == '2'){
|
||||
//动态
|
||||
this.getDynamicList()
|
||||
}
|
||||
},
|
||||
|
||||
//直播阶段数据
|
||||
getLive(){
|
||||
let that=this;
|
||||
$.get('/h5/market/sylive2/stic/lists_live',{'groupsId':that.groupsId},function (result) {
|
||||
that.h_lists = result.data.h_lists
|
||||
that.sub_lists = result.data.sub_lists
|
||||
},'json')
|
||||
},
|
||||
|
||||
//获取大区列表
|
||||
getGroupList(){
|
||||
let that=this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive2/stic/group_lists',{'page':that.page,'groupsId':that.groupsId},function (res){
|
||||
that.loading = false;
|
||||
that.page = that.page + 1;
|
||||
that.list = that.list.concat(res.data.list);
|
||||
if (res.data.total == 0) {
|
||||
that.isNoData = true;
|
||||
} else if (that.list.length == res.data.total) {
|
||||
that.isDataEnd = true;
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
},
|
||||
|
||||
//获取实时动态
|
||||
getDynamicList(){
|
||||
let that=this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive2/stic/event',{'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 (res.data.total == 0) {
|
||||
that.isNoData = true;
|
||||
} else if (that.dynamic.list.length == res.data.total) {
|
||||
that.isDataEnd = true;
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
$.get('/h5/market/sylive2/login/logout', function (response) {
|
||||
if (response.code == 200) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg,
|
||||
onClose: function () {
|
||||
window.location = '/h5/market/sylive2/login'
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg
|
||||
});
|
||||
}
|
||||
}, 'json')
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
</body>
|
||||
@@ -0,0 +1,109 @@
|
||||
<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 fn-clear <?=$params['show_day'] ? '' : 'text-center '?>">
|
||||
<b class="font-40 text-italic <?=$params['show_day'] ? 'fn-fl' : ''?>" v-html="title"></b>
|
||||
<?if($params['show_day']){?>
|
||||
<select class="fn-fr select-more ulib-r10 font-28" @change="changeCheckDate" v-model="checkDate">
|
||||
<option :value="item" v-for="item in day_list">{{item}}</option>
|
||||
</select>
|
||||
<?}?>
|
||||
</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:[],
|
||||
checkDate:'<?=$params['day']?>',
|
||||
day_list : <?=json_encode($day_list,JSON_UNESCAPED_UNICODE)?>,
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
//离开页面时
|
||||
destroyed () {
|
||||
},
|
||||
methods: {
|
||||
|
||||
//拉取数据
|
||||
fetchData: function() {
|
||||
this.getMoreList()
|
||||
},
|
||||
|
||||
//获取大区列表
|
||||
getMoreList(){
|
||||
let that=this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
var params = {
|
||||
'kpi':'<?=$params['type']?>',
|
||||
'day':that.checkDate,
|
||||
'gtype':'<?=$params['gtype']?>',
|
||||
'page':that.page
|
||||
}
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive2/stic/ajax_rank',params,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');
|
||||
}
|
||||
},
|
||||
//选择日期
|
||||
changeCheckDate(e){
|
||||
this.checkDate = e.target.value;
|
||||
this.loading = false;
|
||||
this.isDataEnd = false;
|
||||
this.isNoData = false;
|
||||
this.page = 1;
|
||||
this.list = [];
|
||||
this.getMoreList();
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -0,0 +1,392 @@
|
||||
<body class="bg-fff">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-fff" id="app" ref="app">
|
||||
<div class="container pb130 bg-eee-fff">
|
||||
<img class='block imgsize-750X340' :src='info.theme' />
|
||||
<div id="main"class="inner30">
|
||||
<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 glider2-'+tabIndex"></div>
|
||||
</div>
|
||||
<!--预热阶段-->
|
||||
<div v-if="tabid==1">
|
||||
<div class="mt30 relative bg-fff inner40 pr30 overflowhidden box-shadow-lightGray ulib-r20">
|
||||
<div class="pb20 fn-clear">
|
||||
<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>
|
||||
</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>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pr10" v-if="beginBrowse.lists && beginBrowse.lists.length>0">
|
||||
<div class="font-32 color-666" v-for="(item,index) in beginBrowse.lists">
|
||||
<div class="inner20 fn-clear ulib-r20" :class="index==0?'bg-fff7f1':''">
|
||||
<a class="fn-fl block wp70 text-nowrap" :href="item.url">
|
||||
<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>
|
||||
<i class="iconfont icon-gengduo text-middle font-24 color-666"></i>
|
||||
</a>
|
||||
<div class="fn-fr">{{item.num}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="gengduo block absolute bottom-0 box-center pl10 text-center font-22 color-fff" :href="beginBrowse.url">查看更多<i class="iconfont icon-gengduo"></i></a>
|
||||
</div>
|
||||
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 relative bg-fff inner40 overflowhidden box-shadow-lightGray ulib-r20">
|
||||
<div class="pb20 fn-clear">
|
||||
<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>
|
||||
</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>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="beginBook.lists && beginBook.lists.length>0">
|
||||
<div class="font-32 color-666" v-for="(item,index) in beginBook.lists">
|
||||
<div class="inner20 fn-clear ulib-r20" :class="index==0?'bg-fff7f1':''">
|
||||
<a class="fn-fl block wp70 text-nowrap" :href="item.url">
|
||||
<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>
|
||||
<i class="iconfont icon-gengduo text-middle font-24 color-666"></i>
|
||||
</a>
|
||||
<div class="fn-fr">{{item.num}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="gengduo block absolute bottom-0 box-center pl10 text-center font-22 color-fff" :href="beginBook.url">查看更多<i class="iconfont icon-gengduo"></i></a>
|
||||
</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 relative bg-fff inner40 pr30 overflowhidden box-shadow-lightGray ulib-r20">
|
||||
<div class="pb20 fn-clear">
|
||||
<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>
|
||||
</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>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pr10" v-if="liveView.lists && liveView.lists.length>0">
|
||||
<div class="font-32 color-666" v-for="(item,index) in liveView.lists">
|
||||
<div class="inner20 fn-clear ulib-r20" :class="index==0?'bg-fff7f1':''">
|
||||
<a class="fn-fl block wp70 text-nowrap" :href="item.url">
|
||||
<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>
|
||||
<i class="iconfont icon-gengduo text-middle font-24 color-666"></i>
|
||||
</a>
|
||||
<div class="fn-fr">{{item.num}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="gengduo block absolute bottom-0 box-center pl10 text-center font-22 color-fff" :href="liveView.url">查看更多<i class="iconfont icon-gengduo"></i></a>
|
||||
</div>
|
||||
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 relative bg-fff inner40 overflowhidden box-shadow-lightGray ulib-r20">
|
||||
<div class="pb20 fn-clear">
|
||||
<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>
|
||||
</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>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="liveOrder.lists && liveOrder.lists.length>0">
|
||||
<div class="font-32 color-666" v-for="(item,index) in liveOrder.lists">
|
||||
<div class="inner20 fn-clear ulib-r20" :class="index==0?'bg-fff7f1':''">
|
||||
<a class="fn-fl block wp70 text-nowrap" :href="item.url">
|
||||
<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>
|
||||
<i class="iconfont icon-gengduo text-middle font-24 color-666"></i>
|
||||
</a>
|
||||
<div class="fn-fr">{{item.num}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="gengduo block absolute bottom-0 box-center pl10 text-center font-22 color-fff" :href="liveOrder.url">查看更多<i class="iconfont icon-gengduo"></i></a>
|
||||
</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 pt20 pb30 bg-fff-op95 text-center font-22 fn-flex" >
|
||||
<a class="fn-flex-item" href="/h5/market/sylive2/stic">
|
||||
<img class="imgsize-50X50" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-home-ac.png" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">首页</div>
|
||||
</a>
|
||||
<a class="fn-flex-item" href="<?=$act_url?>">
|
||||
<img class="imgsize-50X50" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-activity.png" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">活动</div>
|
||||
</a>
|
||||
<a class="fn-flex-item" href="/h5/market/sylive2/stic/ranking">
|
||||
<img class="imgsize-50X50" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking.png" alt="#">
|
||||
<div class="space-nowrap con-min60 font-22">排行</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
tabFixed:false,
|
||||
tabIndex:0,
|
||||
tabid:'1',//1预热阶段 /2直播阶段
|
||||
info:'',
|
||||
loading: false,
|
||||
beginBrowseDate:0,
|
||||
beginBrowseGroup:0,
|
||||
beginBookDate:0,
|
||||
beginBookGroup:0,
|
||||
beginBrowse:{
|
||||
title:'',
|
||||
url:'',
|
||||
list:[],
|
||||
},
|
||||
beginBook:{
|
||||
title:'',
|
||||
url:'',
|
||||
list:[],
|
||||
},
|
||||
liveViewDate:0,
|
||||
liveViewGroup:0,
|
||||
liveOrderDate:0,
|
||||
liveOrderGroup:0,
|
||||
liveView:{
|
||||
title:'',
|
||||
url:'',
|
||||
list:[],
|
||||
},
|
||||
liveOrder:{
|
||||
title:'',
|
||||
url:'',
|
||||
list:[],
|
||||
},
|
||||
time1:''
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('scroll', this.handleScroll, true)
|
||||
this.getInfo()
|
||||
this.getBeginBrowse()
|
||||
this.getBeginBook()
|
||||
},
|
||||
//离开页面时
|
||||
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:'<?=$info['banner']?>',
|
||||
tab:[
|
||||
{
|
||||
id:'1',
|
||||
title:'预热阶段',
|
||||
},
|
||||
{
|
||||
id:'2',
|
||||
title:'直播阶段',
|
||||
},
|
||||
],
|
||||
date:<?=json_encode($day_list,JSON_UNESCAPED_UNICODE)?>,
|
||||
group:<?=json_encode($groups,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
|
||||
if(this.tabid == 1){
|
||||
this.beginBrowseDate = 0
|
||||
this.beginBrowseGroup = 0
|
||||
this.beginBookDate = 0
|
||||
this.beginBookGroup = 0
|
||||
this.getBeginBrowse()
|
||||
this.getBeginBook()
|
||||
}else if(this.tabid == 2){
|
||||
this.liveViewDatee = 0
|
||||
this.liveViewGroupe = 0
|
||||
this.liveOrderDatee = 0
|
||||
this.liveOrderGroupe = 0
|
||||
this.getLiveView()
|
||||
this.getLiveOrder()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//预热阶段浏览数据
|
||||
getBeginBrowse(){
|
||||
let that=this;
|
||||
//请求接口
|
||||
var params = {
|
||||
'kpi':'browse','groupIds':this.beginBrowseGroup,
|
||||
'day':this.beginBrowseDate
|
||||
}
|
||||
$.get('/h5/market/sylive2/stic/ajax_rank',params,function (res){
|
||||
that.beginBrowse = res.data;
|
||||
},'json');
|
||||
},
|
||||
|
||||
//预热阶段预约数据
|
||||
getBeginBook(){
|
||||
let that=this;
|
||||
var params = {
|
||||
'kpi':'subscribe','groupIds':this.beginBookGroup,
|
||||
'day':this.beginBookDate
|
||||
}
|
||||
$.get('/h5/market/sylive2/stic/ajax_rank',params,function (res){
|
||||
that.beginBook = res.data;
|
||||
},'json');
|
||||
},
|
||||
|
||||
//直播阶段观看数据
|
||||
getLiveView(){
|
||||
let that=this;
|
||||
var params = {
|
||||
'kpi':'watch','groupIds':this.beginBookGroup,
|
||||
'day':this.beginBookDate
|
||||
}
|
||||
$.get('/h5/market/sylive2/stic/ajax_rank',params,function (res){
|
||||
that.liveView = res.data;
|
||||
},'json');
|
||||
},
|
||||
|
||||
//预热阶段订单数据
|
||||
getLiveOrder(){
|
||||
let that=this;
|
||||
var params = {
|
||||
'kpi':'order','groupIds':this.beginBookGroup,
|
||||
'day':this.beginBookDate
|
||||
}
|
||||
$.get('/h5/market/sylive2/stic/ajax_rank',params,function (res){
|
||||
that.liveOrder = res.data;
|
||||
},'json');
|
||||
},
|
||||
|
||||
//选择条件
|
||||
handleChange(e,key){
|
||||
console.log(key)
|
||||
switch (key) {
|
||||
case 'beginBrowseDate':
|
||||
if(this.beginBrowseDate != e.target.value){
|
||||
this.beginBrowseDate = e.target.value
|
||||
console.log(key)
|
||||
this.getBeginBrowse()
|
||||
}
|
||||
break;
|
||||
case 'beginBrowseGroup':
|
||||
if(this.beginBrowseGroup != e.target.value){
|
||||
this.beginBrowseGroup = e.target.value
|
||||
console.log(key)
|
||||
this.getBeginBrowse()
|
||||
}
|
||||
break;
|
||||
case 'beginBookDate':
|
||||
if(this.beginBookDate != e.target.value){
|
||||
this.beginBookDate = e.target.value
|
||||
console.log(key)
|
||||
this.getBeginBook()
|
||||
}
|
||||
break;
|
||||
case 'beginBookGroup':
|
||||
if(this.beginBookGroup != e.target.value){
|
||||
this.beginBookGroup = e.target.value
|
||||
console.log(key)
|
||||
this.getBeginBook()
|
||||
}
|
||||
break;
|
||||
case 'liveViewDate':
|
||||
if(this.liveViewDate != e.target.value){
|
||||
this.liveViewDate = e.target.value
|
||||
console.log(key)
|
||||
this.getLiveView()
|
||||
}
|
||||
break;
|
||||
case 'liveViewGroup':
|
||||
if(this.liveViewGroup != e.target.value){
|
||||
this.liveViewGroup = e.target.value
|
||||
console.log(key)
|
||||
this.getLiveView()
|
||||
}
|
||||
break;
|
||||
case 'liveOrderDate':
|
||||
if(this.liveOrderDate != e.target.value){
|
||||
this.liveOrderDate = e.target.value
|
||||
console.log(key)
|
||||
this.getLiveOrder()
|
||||
}
|
||||
break;
|
||||
case 'liveOrderGroup':
|
||||
if(this.liveOrderGroup != e.target.value){
|
||||
this.liveOrderGroup = e.target.value
|
||||
console.log(key)
|
||||
this.getLiveOrder()
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
</body>
|
||||
@@ -0,0 +1,169 @@
|
||||
<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>
|
||||
<div class="pt30" v-if="kpi=='order' && goodsList">
|
||||
<select class="wp100 select-more ulib-r10 font-28" @change="changegoods">
|
||||
<option value="">全部</option>
|
||||
<option :value="item.itemId" v-for="item in goodsList">{{item.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="pt10 pb20 text-center"><b class="font-40 text-italic" v-html="title"></b></div>
|
||||
</template>
|
||||
<?if($params['kpi']=='order'){?>
|
||||
<div v-for="(item,index) in list">
|
||||
<div class="pt30 pb20 fn-flex font-28 color-666" >
|
||||
<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.cf_uname}}</div>
|
||||
</div>
|
||||
<div class="pb20 fn-flex font-28 color-666" >
|
||||
<div class="fn-flex-item text-nowrap" flexsize="5">
|
||||
{{item.name}} {{item.mobile}}
|
||||
</div>
|
||||
<div class="fn-flex-item text-right" flexsize="3">{{item.time}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<?}else{?>
|
||||
<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.cf_uname}} {{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/sylive2/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:[],
|
||||
kpi:'<?=$params['kpi']?>',
|
||||
goodsList: <?=json_encode($goods,JSON_UNESCAPED_UNICODE)?>,
|
||||
goodsId:'',
|
||||
},
|
||||
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/sylive2/stic/user_lists',{'type':'<?=$params['type']?>','type_id':'<?=$params['type_id']?>','kpi':'<?=$params['kpi']?>','page':that.page,'tabid':that.tabid,'itemId':that.goodsId},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');
|
||||
}
|
||||
},
|
||||
//选择日期
|
||||
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.getActivityList()
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -0,0 +1,234 @@
|
||||
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/LArea/css/LArea.css">
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LAreaData1.js"></script>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LAreaData2.js"></script>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LArea.js"></script>
|
||||
<body class="bg-f6">
|
||||
<div id="app" ref="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb40" :style="'background-image:url('+info.bg+')'">
|
||||
<div class="relative height-710">
|
||||
<div class="pt90 pl100 pr100 fn-clear">
|
||||
<div class="fn-fl font-18">订单号 {{info.order.sid}}</div>
|
||||
<div class="fn-fr font-18"><i class="iconfont icon-time"></i> {{info.order.c_time}}</div>
|
||||
</div>
|
||||
<div class="uinfo absolute wp100 pr100 pl100">
|
||||
<div class="space-nowrap"><span>{{info.order.uname}}</span><span class="font-28">·{{info.order.utel}}</span></div>
|
||||
<template v-if="info.ifAddress>0">
|
||||
<div class="mt10 uinfoadd font-22 ulib-rl750" v-if="show_address" @click="showAdd()"><i class="iconfont mr5 icon-dizhi"></i>{{show_address}}</div>
|
||||
<div class="mt10 uinfoadd font-22 ulib-rl750" v-else @click="showAdd()"><i class="iconfont mr5 icon-zengjia"></i>(完善收货地址)</div>
|
||||
</template>
|
||||
</div>
|
||||
<!-- <div class="uinfo absolute box-center pt15 pb15 pl30 pr30 font-32 ulib-r750 space-nowrap">{{info.order.uname}} · {{info.order.utel}}</div>-->
|
||||
<div class="odslogan absolute box-center text-center color-e4bc93 space-nowrap">
|
||||
<div class="pb10 bbs-1-e4bc93 font-48">{{info.order.slogan}}</div>
|
||||
<div class="mt10 font-24">{{info.order.valid_time}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative bg-fff mb30 ml30 mr30 inner40 pl150 pr220 ulib-r20 box-shadow-darkGray" v-if="info.if_pid">
|
||||
<img class="absolute left-0 box-middle ml35 imgsize-90X90 ulib-r750 bds-1-eee" :src="info.logo" :alt="info.title" />
|
||||
<div>
|
||||
<span class="font-36 text-middle">{{info.title}}</span>
|
||||
<span class="inline-block pl10 pr10 line-height-15 text-middle ulib-r750 font-22 color-fff bg-1a1a1a">专属顾问</span>
|
||||
</div>
|
||||
<div class="mt10 font-22 color-999">{{info.slogan}}</div>
|
||||
<a class="absolute right-0 box-middle mr30" :href="'tel:'+info.cust_tel">
|
||||
<img class="imgsize-60X60" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/tel.png" alt="拨打电话" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="relative bg-fff mb30 ml30 mr30 inner40 ulib-r20 box-shadow-darkGray">
|
||||
<div class="pb20 text-center"><div class="inline-block relative pl10 pr10 introTitle font-36"><span class="relative z-index-1">{{info.introTitle}}</span></div></div>
|
||||
<div class="line-height-17 font-28 color-666 text-break space-pre-line rich-text-img" v-html="info.content"></div>
|
||||
</div>
|
||||
</div>
|
||||
<? $this->load->view('h5/market/sylive2/nav_my') ?>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowAdd?'display:block':'display:none'" v-if="isShowAdd">
|
||||
<div class="msgBg" @click="isShowAdd=!isShowAdd"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word text-center">
|
||||
<div class="mt15 font-22 color-999">请输入您的收货地址</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input id="region" class="wp100 inner30 font-28 bg-f6 border-none ulib-r10" type="text" readonly="" v-model="region" placeholder="选择省/市/区" />
|
||||
<input id="regionvalue" type="hidden" v-model="regionvalue"/>
|
||||
</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-28 bg-f6 border-none ulib-r10" type="text" v-model="address" placeholder="请输入详细地址" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt30">
|
||||
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="postAddress()">确认</a>
|
||||
</div>
|
||||
<!--
|
||||
<div class="mt30 text-center">
|
||||
<a class="font-24 text-underline" @click="isShowAdd=!isShowAdd">不了,看完直播再说></a>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
// info:{
|
||||
// bg:"https://qs.haodian.cn/web/images/project/H5-ShiYu/mine-bg.jpg",
|
||||
// logo:"https://qs.haodian.cn/web/images/project/H5-ShiYu/goodslogo.jpg",
|
||||
// title:"东风·纳米",
|
||||
// slogan:"东风EV·您的专属的福利官",
|
||||
// cust_tel:'15355555555',
|
||||
// introTitle:'权益说明',
|
||||
// content:'纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。',
|
||||
// order:{
|
||||
// uname:'张大三',
|
||||
// utel:'13459***382',
|
||||
// slogan:'尊享您的直播好礼',
|
||||
// valid_time:'2022-08-01-2022-08-31',
|
||||
// oid:'XM202210111563586',
|
||||
// c_time:'2022-10-11 15:35:52',
|
||||
// }
|
||||
// },
|
||||
info : <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>,
|
||||
region:'<?=$info['order']['region']?>',
|
||||
regionvalue:'',
|
||||
address:'<?=$info['order']['detail']?>',
|
||||
show_address:'<?=$info['order']['region'] ? $info['order']['region']." ".$info['order']['detail'] : ''?>',
|
||||
isShowAdd: false,
|
||||
isSubmiting: false,
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
let swiper = new Swiper('.goods-banner .swiper-container', {
|
||||
//loop: true,
|
||||
//autoHeight: true,
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
type: 'fraction',
|
||||
},
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
on: {
|
||||
slideChangeTransitionEnd: function(){
|
||||
that.activeIndex = this.activeIndex
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
showAdd: function() {
|
||||
this.isShowAdd = true
|
||||
let that = this;
|
||||
//选择省市初始化
|
||||
setTimeout(function () {
|
||||
let area = new LArea();
|
||||
area.init({
|
||||
'trigger': '#region', //触发选择控件的文本框,同时选择完毕后name属性输出到该位置
|
||||
'valueTo': '#regionvalue', //选择完毕后id属性输出到该位置
|
||||
'keys': {
|
||||
id: 'value',
|
||||
name: 'text'
|
||||
}, //绑定数据源相关字段 id对应valueTo的value属性输出 name对应trigger的value属性输出
|
||||
'type': 2,
|
||||
'data': [provs_data, citys_data, dists_data]
|
||||
});
|
||||
|
||||
if(that.region !=''){
|
||||
for(var i in provs_data){
|
||||
if(provs_data[i].text==that.region.split(",")[0]){
|
||||
var x=i;
|
||||
var city=citys_data[provs_data[i].value];
|
||||
for(var j in city){
|
||||
if(city[j].text==that.region.split(",")[1]){
|
||||
var y=j;
|
||||
var district=dists_data[city[j].value];
|
||||
for(var k in district){
|
||||
if(district[k].text==that.region.split(",")[2]){
|
||||
var z=k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
area.value=[x,y,z];//控制初始位置,注意:该方法并不会影响到input的value
|
||||
}else{
|
||||
//area.value=[12,1,1];//控制初始位置,注意:该方法并不会影响到input的value
|
||||
}
|
||||
area.success = function(){
|
||||
that.regionvalue = $("#regionvalue").val();
|
||||
}
|
||||
}, 200)
|
||||
},
|
||||
//提交地址
|
||||
postAddress() {
|
||||
if (this.isSubmiting) return;
|
||||
if (!this.region) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请选择所在地区"
|
||||
});
|
||||
}else if (!this.address) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入详细地址"
|
||||
});
|
||||
}else{
|
||||
this.isSubmiting = true
|
||||
var params = {
|
||||
'skey':'<?=$skey?>',
|
||||
'region':this.region,
|
||||
'address':this.address,
|
||||
'id':this.info.order.id
|
||||
}
|
||||
var that = this;
|
||||
$.post('/h5/market/sylive2/ucenter/edit_address',params,function (res){
|
||||
that.isSubmiting = false
|
||||
if(res.code==200){
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: res.msg,
|
||||
onClose:function(){
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: res.msg
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
//提交数据
|
||||
// mDialog.msg({
|
||||
// duration: 250,
|
||||
// pause: 2000,
|
||||
// content: "提交成功"
|
||||
// });
|
||||
// this.isShowAdd = false
|
||||
// this.isSubmiting = false
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive2/share_script')?>
|
||||
</body>
|
||||
@@ -0,0 +1,73 @@
|
||||
<body class="bg-f6">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-f6" 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/mine-bg2.jpg)">
|
||||
<div class="pt50 pl30 pr30 text-center">
|
||||
<img class="bds-1-fff imgsize-120X120 ulib-r750" :src="info.logo" alt="#" />
|
||||
<div class="pt10 font-36 text-center">{{info.title}}</div>
|
||||
<div class="mt40"><img class="block wp100" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/mine-theme.png" alt="尊享您的直播好礼" /></div>
|
||||
</div>
|
||||
<div class="bg-fff ml30 mr30 pt20 pb20 pl40 pr40 ulib-r20 box-shadow-darkGray">
|
||||
<!--活动列表列表-->
|
||||
<a class="block relative pt30 pb30 bbs-1-eee last-b-none" :href="item.url" v-for="(item,index) in info.list">
|
||||
<span class="font-32">{{item.title}}</span>
|
||||
<i class="absolute box-middle right-0 iconfont icon-gengduo"></i>
|
||||
</a>
|
||||
<!--end活动列表-->
|
||||
</div>
|
||||
</div>
|
||||
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive2/act?skey=<?=$params['skey']?>">
|
||||
<i class="iconfont icon-shouye text-middle font-36"></i>
|
||||
<div class="font-22">首页</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
info:{
|
||||
list:[],
|
||||
},//基础信息
|
||||
},
|
||||
mounted() {
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
|
||||
//获取基础信息
|
||||
getInfo(){
|
||||
// this.info = {
|
||||
// title:"厦门狸车店",
|
||||
// logo:"https://qs.haodian.cn/web/images/project/H5-ShiYu/goodslogo.jpg",
|
||||
// list:[
|
||||
// {
|
||||
// title:'我的权益',
|
||||
// url:'mygift.html',
|
||||
// },
|
||||
// {
|
||||
// title:'我的订单',
|
||||
// url:'#',
|
||||
// },
|
||||
// {
|
||||
// title:'我的券',
|
||||
// url:'#',
|
||||
// },
|
||||
// {
|
||||
// title:'联系客服',
|
||||
// url:'#',
|
||||
// },
|
||||
// {
|
||||
// title:'数据统计',
|
||||
// url:'#',
|
||||
// },
|
||||
// ],
|
||||
// }
|
||||
this.info = <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
@@ -0,0 +1,78 @@
|
||||
<body class="bg-f6">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-f6" id="app" ref="app">
|
||||
<div class="container">
|
||||
<div class="inner30 pt0">
|
||||
<a class="block mt30 pl30 pr30 bg-fff ulib-r20" :href="item.url" v-for="(item,index) in list">
|
||||
<div class="bbs-1-eee pt20 pb20 font-22 color-999">订单编号 {{item.sid}}</div>
|
||||
<div class="relative pt30 pb30 fn-clear">
|
||||
<img class="fn-fl imgsize-185X170 ulib-r5" :src="item.img" alt="#">
|
||||
<div class="pl210">
|
||||
<div class="line-clamp-2 font-32 line-height-13">{{item.title}}</div>
|
||||
<div class="mt5 font-22 color-999">订单时间 {{item.time}}</div>
|
||||
<div class="absolute left-0 bottom-0 pl210 pb30 text-bold color-fe9538">
|
||||
<span class="font-28">¥</span><span class="ml5 font-40">{{item.price}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"><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>
|
||||
<? $this->load->view('h5/market/sylive2/nav_my') ?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1,
|
||||
size: 20,
|
||||
list:[],
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
//拉取数据
|
||||
fetchData: function() {
|
||||
this.getOrderList()
|
||||
},
|
||||
|
||||
//获取大区列表
|
||||
getOrderList(){
|
||||
let that=this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
var params = {
|
||||
'skey':'<?=$skey?>',
|
||||
'page':that.page
|
||||
}
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive2/ucenter/ajax_order',params,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>
|
||||
</body>
|
||||
@@ -0,0 +1,104 @@
|
||||
<body class="bg-f6">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-f6" id="app" ref="app">
|
||||
<div class="container">
|
||||
<div class="inner30 pt0">
|
||||
<a class="block mt30 inner30 bg-fff ulib-r20" :href="item.url" v-for="(item,index) in list">
|
||||
<div class="relative overflowhidden ulib-r10">
|
||||
<div class="orderTip2 text-center font-24 color-fff bg-ff5a5a" v-if="item.title">{{item.title}}</div>
|
||||
<img class="imgsize-630X340 ulib-r10" :src="item.img" alt="#">
|
||||
</div>
|
||||
<div class="mt15 text-center font-30 color-333">{{item.goods}}</div>
|
||||
<div class="mt15 text-center font-20 color-bbb">*抽奖礼品需提车后才能享受</div>
|
||||
</a>
|
||||
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"><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>
|
||||
<? $this->load->view('h5/market/sylive2/nav_my') ?>
|
||||
|
||||
<script>
|
||||
let hostUrl = ''
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1,
|
||||
size: 20,
|
||||
list:[],
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
//拉取数据
|
||||
fetchData: function() {
|
||||
this.getOrderList()
|
||||
},
|
||||
|
||||
//获取大区列表
|
||||
getOrderList(){
|
||||
let that=this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求接口
|
||||
var params = {
|
||||
'skey':'<?=$skey?>',
|
||||
'page':that.page
|
||||
}
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive2/ucenter/ajax_win',params,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');
|
||||
|
||||
//请求接口成功后
|
||||
// that.loading = false;
|
||||
// that.page = that.page + 1;
|
||||
//
|
||||
// let res = {}
|
||||
// res.data = {
|
||||
// list:[
|
||||
// {
|
||||
// id:'111',
|
||||
// img:'http://simg.mo.xmfish.com/quan/2022_08/179c0eb5f189c356571868bf48e38828.jpg',
|
||||
// title:'一等奖',
|
||||
// goods:'小米电动车',
|
||||
// },
|
||||
// {
|
||||
// id:'111',
|
||||
// img:'https://img.zcool.cn/community/01f3bc63523e7c000e061000ee6483.jpg?x-oss-process=image/auto-orient,1',
|
||||
// title:'五等奖',
|
||||
// goods:'电饭煲一个',
|
||||
// },
|
||||
//
|
||||
// ],
|
||||
// total:20,
|
||||
// },
|
||||
//
|
||||
// that.list = that.list.concat(res.data.list);
|
||||
// if (res.data.total == 0) {
|
||||
// that.isNoData = true;
|
||||
// } else if (that.list.length == res.data.total) {
|
||||
// that.isDataEnd = true;
|
||||
// }
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
@@ -0,0 +1,320 @@
|
||||
<body class="bg-f6">
|
||||
<div id="app" ref="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb150">
|
||||
<div class="inner30 fn-flex">
|
||||
<div class="fn-flex-item wp50 mr20">
|
||||
<div class="mt10 text-nowrap">
|
||||
<img class="text-middle imgsize-40X40 ulib-r750" :src="info.logo" alt="#"/>
|
||||
<span class="text-middle font-28">{{info.title}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fn-flex-item wp50 relative pt10 pb10 pl50 pr20 bg-ddd ulib-r750">
|
||||
<div class="absolute box-middle left-0 font-24 color-999 pl15 pr10 brs-1-999"><i
|
||||
class="iconfont icon-sousuo"></i></div>
|
||||
<input class="wp90 bg-ddd bds-1-ddd font-22 ulib-r750" type="search" class="ipt-seach"
|
||||
placeholder="请输入顾问姓名" v-model="keyWord" @input="searchHandler"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative bg-fff ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:75vh;">
|
||||
<div>
|
||||
<!--顾问列表-->
|
||||
<div class="relative mb30 bg-f9 pt20 pb20 pl30 pr200 ulib-r20" v-for="(item,index) in list">
|
||||
<div>
|
||||
<div class="font-28">{{item.uname}}·{{item.mobile}}</div>
|
||||
<div class="mt10 font-22 color-999" v-if="item.wxuname">
|
||||
<img class="text-middle imgsize-30X30 ulib-r750" :src="item.wxheadimg" alt="#"/>
|
||||
<span class="text-middle">{{item.wxuname}}</span>
|
||||
</div>
|
||||
<div class="mt10 font-22 color-999" v-else>暂未绑定微信</div>
|
||||
</div>
|
||||
<div class="absolute box-middle right-0 mr30 space-nowrap font-26">
|
||||
<a class="text-middle" href="javascript:void(0);" v-if="!item.wxuname" @click="showForm(index)">修改</a>
|
||||
<span class="text-middle font-22 pl5 pr5" v-if="!item.wxuname">|</span>
|
||||
<a class="text-middle" href="javascript:void(0);" @click="showDel(index)">删除</a>
|
||||
<span class="text-middle font-22 pl5 pr5">|</span>
|
||||
<a class="text-middle color-ffa85a" href="javascript:void(0);" v-if="item.status==1"
|
||||
@click=showAble(index)>启用</a>
|
||||
<a class="text-middle color-ffa85a" href="javascript:void(0);" v-else-if="item.status==0"
|
||||
@click=showAble(index)>禁用</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"><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 class="fixed left-0 bottom-0 right-0 inner30 pt15 bg-fff z-index-2">
|
||||
<div class="pb15 text-center font-22 color-999">
|
||||
<i class="iconfont icon-xinxi text-middle"></i>
|
||||
<span class="text-middle">绑定微信后,信息无法修改</span>
|
||||
</div>
|
||||
<a class="block bg-1a1a1a pt25 pb25 text-center font-36 color-fff ulib-r10" @click="showForm(-1)"
|
||||
href="javascript:void(0)">新增顾问</a>
|
||||
</div>
|
||||
<? $this->load->view('h5/market/sylive/nav') ?>
|
||||
<div class="msg fn-hide" :style="isShowForm?'display:block':'display:none'" v-if="isShowForm">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word">
|
||||
<div class="relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="text" v-model="uname"
|
||||
placeholder="请输入顾问姓名"/>
|
||||
</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="tel" v-model="mobile"
|
||||
placeholder="请输入手机号"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt30">
|
||||
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="submit()">{{formIndex>-1?'修改':'新增'}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowDel?'display:block':'display:none'" v-if="isShowDel">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content" style="padding:0;">
|
||||
<div class="pt60 pb60 pl40 pr40 text-center font-32">确认删除{{list[delIndex].uname}}"吗?"</div>
|
||||
<div class="fn-flex bts-1-eee text-center font-28">
|
||||
<a class="fn-flex-item pt30 pb30" href="javascript:void(0);" @click="delOpt()">确定</a>
|
||||
<a class="fn-flex-item pt30 pb30 bls-1-eee color-999" href="javascript:void(0);" @click="closeOpt">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowAble?'display:block':'display:none'" v-if="isShowAble">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content" style="padding:0;">
|
||||
<div class="pt60 pb60 pl40 pr40 text-center font-32">
|
||||
{{list[ableIndex].status==1?'确认启用':'确认禁用'}}{{list[ableIndex].uname}}"吗?"
|
||||
</div>
|
||||
<div class="fn-flex bts-1-eee text-center font-28">
|
||||
<a class="fn-flex-item pt30 pb30" href="javascript:void(0);" @click="ableOpt()">确定</a>
|
||||
<a class="fn-flex-item pt30 pb30 bls-1-eee color-999" href="javascript:void(0);" @click="closeOpt">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function _Debounce(fn, t) {
|
||||
let delay = t || 500;
|
||||
let timer;
|
||||
return function () {
|
||||
let args = arguments;
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
timer = null;
|
||||
fn.apply(this, args);
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
keyWord: '',
|
||||
info: {},
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1, //页数
|
||||
size: 10, //每页取多少个数据
|
||||
list: [],
|
||||
uname: '',
|
||||
mobile: '',
|
||||
isSubmiting: false,
|
||||
isRefresh: false,//是否是刷新列表,用于操作后刷新列表
|
||||
isShowForm: false,
|
||||
isShowDel: false,
|
||||
isShowAble: false,
|
||||
formIndex: -1,
|
||||
delIndex: -1,
|
||||
ableIndex: -1,
|
||||
},
|
||||
mounted() {
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
//获取基础信息
|
||||
getInfo() {
|
||||
this.info = {
|
||||
title: "<?=$biz_name?>",
|
||||
logo: "<?=$headimg?>",
|
||||
}
|
||||
},
|
||||
//拉取数据
|
||||
fetchData: function () {
|
||||
this.getStaffList()
|
||||
},
|
||||
//顾问列表
|
||||
searchHandler: _Debounce(function () {
|
||||
this.loading = false;
|
||||
this.isDataEnd = false;
|
||||
this.isNoData = false;
|
||||
this.page = 1;
|
||||
this.list = [];
|
||||
this.getStaffList()
|
||||
}, 250),
|
||||
//顾问列表
|
||||
getStaffList() {
|
||||
let that = this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求参数
|
||||
let params = {};
|
||||
params['keyWord'] = that.keyWord;
|
||||
params['biz_id'] = <?=$biz_id?>;
|
||||
if (this.isRefresh) {//刷新列表参数
|
||||
this.page = this.page - 1;
|
||||
params['page'] = 1;
|
||||
params['size'] = this.page * this.size;
|
||||
} else {
|
||||
params['page'] = this.page;
|
||||
params['size'] = this.size;
|
||||
}
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive/user/lists', params, function (result) {
|
||||
that.loading = false;
|
||||
that.isRefresh = false;
|
||||
if (result.code == 200) {
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
mDialog.msg({content: result.msg});
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
},
|
||||
//关闭弹框
|
||||
closeOpt: function () {
|
||||
this.isShowForm = false;
|
||||
this.isShowDel = false;
|
||||
this.isShowAble = false;
|
||||
},
|
||||
//显示新增编辑弹框
|
||||
showForm(index) {
|
||||
this.formIndex = index;
|
||||
this.isShowForm = true;
|
||||
if (index > -1) {
|
||||
this.uname = this.list[index].uname;
|
||||
this.mobile = this.list[index].mobile;
|
||||
}
|
||||
},
|
||||
//提交新增编辑弹框
|
||||
submit() {
|
||||
let that = this;
|
||||
if (that.isSubmiting) return;
|
||||
if (!that.uname) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入顾问姓名"
|
||||
});
|
||||
} else if (!/^1[3456789]\d{9}$/.test(that.mobile)) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
} else {
|
||||
that.isSubmiting = true;
|
||||
let url = '/h5/market/sylive/user/add';
|
||||
let params = {};
|
||||
params['uname'] = that.uname;
|
||||
params['mobile'] = that.mobile;
|
||||
params['biz_id'] = <?=$biz_id?>;
|
||||
if (that.formIndex > -1) {
|
||||
url = '/h5/market/sylive/user/edit';
|
||||
params['userId'] = this.list[that.formIndex].userId;
|
||||
}
|
||||
$.post(url, params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
that.isSubmiting = false;
|
||||
if (response.code == 200) {
|
||||
that.isShowForm = false;
|
||||
that.uname = '';
|
||||
that.mobile = '';
|
||||
that.loading = false;
|
||||
that.isDataEnd = false;
|
||||
that.isNoData = false;
|
||||
that.page = 1;
|
||||
that.list = [];
|
||||
that.getStaffList();
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
},
|
||||
//显示启用禁用确认框
|
||||
showAble(index) {
|
||||
this.ableIndex = index;
|
||||
this.isShowAble = true;
|
||||
},
|
||||
//启用禁用
|
||||
ableOpt() {
|
||||
//请求参数delOpt
|
||||
let that = this;
|
||||
let params = {};
|
||||
params['userId'] = that.list[that.ableIndex].userId;
|
||||
params['status'] = that.list[that.ableIndex].status == 1 ? 0 : 1;
|
||||
//执行接口
|
||||
$.post('/h5/market/sylive/user/status', params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
if (response.code == 200) {
|
||||
that.list[that.ableIndex].status = that.list[that.ableIndex].status == 1 ? 0 : 1;
|
||||
that.isShowAble = false;
|
||||
}
|
||||
}, 'json');
|
||||
},
|
||||
//删除确认框
|
||||
showDel(index) {
|
||||
this.delIndex = index;
|
||||
this.isShowDel = true;
|
||||
},
|
||||
//删除
|
||||
delOpt() {
|
||||
let that = this;
|
||||
//请求参数
|
||||
let params = {};
|
||||
params['userId'] = that.list[that.delIndex].userId;
|
||||
params['status'] = -1;
|
||||
$.post('/h5/market/sylive/user/status', params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
if (response.code == 200) {
|
||||
that.isShowDel = false;
|
||||
that.isRefresh = true;
|
||||
that.loading = false;
|
||||
that.isDataEnd = false;
|
||||
that.isNoData = false;
|
||||
that.list = [];
|
||||
that.getStaffList();
|
||||
}
|
||||
}, 'json');
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?= $this->load->view('h5/market/sylive/hidden_wx_share') ?>
|
||||
</body>
|
||||
@@ -0,0 +1,319 @@
|
||||
<body class="bg-f6">
|
||||
<div id="app" ref="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb150">
|
||||
<div class="inner30 fn-flex">
|
||||
<div class="fn-flex-item wp50 mr20">
|
||||
<div class="mt10 text-nowrap">
|
||||
<img class="text-middle imgsize-40X40 ulib-r750" :src="info.logo" alt="#"/>
|
||||
<span class="text-middle font-28">{{info.title}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fn-flex-item wp50 relative pt10 pb10 pl50 pr20 bg-ddd ulib-r750">
|
||||
<div class="absolute box-middle left-0 font-24 color-999 pl15 pr10 brs-1-999"><i
|
||||
class="iconfont icon-sousuo"></i></div>
|
||||
<input class="wp90 bg-ddd bds-1-ddd font-22 ulib-r750" type="search" class="ipt-seach"
|
||||
placeholder="请输入团员姓名" v-model="keyWord" @input="searchHandler"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative bg-fff ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:75vh;">
|
||||
<div>
|
||||
<!--团员列表-->
|
||||
<div class="relative mb30 bg-f9 pt20 pb20 pl30 pr200 ulib-r20" v-for="(item,index) in list">
|
||||
<div>
|
||||
<div class="font-28">{{item.uname}}·{{item.mobile}}</div>
|
||||
<div class="mt10 font-22 color-999" v-if="item.wxuname">
|
||||
<img class="text-middle imgsize-30X30 ulib-r750" :src="item.wxheadimg" alt="#"/>
|
||||
<span class="text-middle">{{item.wxuname}}</span>
|
||||
</div>
|
||||
<div class="mt10 font-22 color-999" v-else>暂未绑定微信</div>
|
||||
</div>
|
||||
<div class="absolute box-middle right-0 mr30 space-nowrap font-26">
|
||||
<a class="text-middle" href="javascript:void(0);" v-if="!item.wxuname" @click="showForm(index)">修改</a>
|
||||
<span class="text-middle font-22 pl5 pr5" v-if="!item.wxuname">|</span>
|
||||
<a class="text-middle" href="javascript:void(0);" @click="showDel(index)">删除</a>
|
||||
<span class="text-middle font-22 pl5 pr5">|</span>
|
||||
<a class="text-middle color-ffa85a" href="javascript:void(0);" v-if="item.status==1"
|
||||
@click=showAble(index)>启用</a>
|
||||
<a class="text-middle color-ffa85a" href="javascript:void(0);" v-else-if="item.status==0"
|
||||
@click=showAble(index)>禁用</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"><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 class="fixed left-0 bottom-0 right-0 inner30 pt15 bg-fff z-index-2">
|
||||
<div class="pb15 text-center font-22 color-999">
|
||||
<i class="iconfont icon-xinxi text-middle"></i>
|
||||
<span class="text-middle">绑定微信后,信息无法修改</span>
|
||||
</div>
|
||||
<a class="block bg-1a1a1a pt25 pb25 text-center font-36 color-fff ulib-r10" @click="showForm(-1)"
|
||||
href="javascript:void(0)">新增团员</a>
|
||||
</div>
|
||||
<div class="msg fn-hide" :style="isShowForm?'display:block':'display:none'" v-if="isShowForm">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word">
|
||||
<div class="relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="text" v-model="uname"
|
||||
placeholder="请输入团员姓名"/>
|
||||
</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="tel" v-model="mobile"
|
||||
placeholder="请输入手机号"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt30">
|
||||
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="submit()">{{formIndex>-1?'修改':'新增'}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowDel?'display:block':'display:none'" v-if="isShowDel">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content" style="padding:0;">
|
||||
<div class="pt60 pb60 pl40 pr40 text-center font-32">确认删除{{list[delIndex].uname}}"吗?"</div>
|
||||
<div class="fn-flex bts-1-eee text-center font-28">
|
||||
<a class="fn-flex-item pt30 pb30" href="javascript:void(0);" @click="delOpt()">确定</a>
|
||||
<a class="fn-flex-item pt30 pb30 bls-1-eee color-999" href="javascript:void(0);" @click="closeOpt">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowAble?'display:block':'display:none'" v-if="isShowAble">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content" style="padding:0;">
|
||||
<div class="pt60 pb60 pl40 pr40 text-center font-32">
|
||||
{{list[ableIndex].status==1?'确认启用':'确认禁用'}}{{list[ableIndex].uname}}"吗?"
|
||||
</div>
|
||||
<div class="fn-flex bts-1-eee text-center font-28">
|
||||
<a class="fn-flex-item pt30 pb30" href="javascript:void(0);" @click="ableOpt()">确定</a>
|
||||
<a class="fn-flex-item pt30 pb30 bls-1-eee color-999" href="javascript:void(0);" @click="closeOpt">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function _Debounce(fn, t) {
|
||||
let delay = t || 500;
|
||||
let timer;
|
||||
return function () {
|
||||
let args = arguments;
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
timer = null;
|
||||
fn.apply(this, args);
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
keyWord: '',
|
||||
info: {},
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1, //页数
|
||||
size: 10, //每页取多少个数据
|
||||
list: [],
|
||||
uname: '',
|
||||
mobile: '',
|
||||
isSubmiting: false,
|
||||
isRefresh: false,//是否是刷新列表,用于操作后刷新列表
|
||||
isShowForm: false,
|
||||
isShowDel: false,
|
||||
isShowAble: false,
|
||||
formIndex: -1,
|
||||
delIndex: -1,
|
||||
ableIndex: -1,
|
||||
},
|
||||
mounted() {
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
//获取基础信息
|
||||
getInfo() {
|
||||
this.info = {
|
||||
title: "<?=$team_name?>",
|
||||
logo: "<?=$headimg?>",
|
||||
}
|
||||
},
|
||||
//拉取数据
|
||||
fetchData: function () {
|
||||
this.getStaffList()
|
||||
},
|
||||
//团员列表
|
||||
searchHandler: _Debounce(function () {
|
||||
this.loading = false;
|
||||
this.isDataEnd = false;
|
||||
this.isNoData = false;
|
||||
this.page = 1;
|
||||
this.list = [];
|
||||
this.getStaffList()
|
||||
}, 250),
|
||||
//团员列表
|
||||
getStaffList() {
|
||||
let that = this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求参数
|
||||
let params = {};
|
||||
params['keyWord'] = that.keyWord;
|
||||
params['team_id'] = <?=$team_id?>;
|
||||
if (this.isRefresh) {//刷新列表参数
|
||||
this.page = this.page - 1;
|
||||
params['page'] = 1;
|
||||
params['size'] = this.page * this.size;
|
||||
} else {
|
||||
params['page'] = this.page;
|
||||
params['size'] = this.size;
|
||||
}
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive/userTeam/lists', params, function (result) {
|
||||
that.loading = false;
|
||||
that.isRefresh = false;
|
||||
if (result.code == 200) {
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
mDialog.msg({content: result.msg});
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
},
|
||||
//关闭弹框
|
||||
closeOpt: function () {
|
||||
this.isShowForm = false;
|
||||
this.isShowDel = false;
|
||||
this.isShowAble = false;
|
||||
},
|
||||
//显示新增编辑弹框
|
||||
showForm(index) {
|
||||
this.formIndex = index;
|
||||
this.isShowForm = true;
|
||||
if (index > -1) {
|
||||
this.uname = this.list[index].uname;
|
||||
this.mobile = this.list[index].mobile;
|
||||
}
|
||||
},
|
||||
//提交新增编辑弹框
|
||||
submit() {
|
||||
let that = this;
|
||||
if (that.isSubmiting) return;
|
||||
if (!that.uname) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入团员姓名"
|
||||
});
|
||||
} else if (!/^1[3456789]\d{9}$/.test(that.mobile)) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
} else {
|
||||
that.isSubmiting = true;
|
||||
let url = '/h5/market/sylive/userTeam/add';
|
||||
let params = {};
|
||||
params['uname'] = that.uname;
|
||||
params['mobile'] = that.mobile;
|
||||
params['team_id'] = <?=$team_id?>;
|
||||
if (that.formIndex > -1) {
|
||||
url = '/h5/market/sylive/userTeam/edit';
|
||||
params['userId'] = this.list[that.formIndex].userId;
|
||||
}
|
||||
$.post(url, params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
that.isSubmiting = false;
|
||||
if (response.code == 200) {
|
||||
that.isShowForm = false;
|
||||
that.uname = '';
|
||||
that.mobile = '';
|
||||
that.loading = false;
|
||||
that.isDataEnd = false;
|
||||
that.isNoData = false;
|
||||
that.page = 1;
|
||||
that.list = [];
|
||||
that.getStaffList();
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
},
|
||||
//显示启用禁用确认框
|
||||
showAble(index) {
|
||||
this.ableIndex = index;
|
||||
this.isShowAble = true;
|
||||
},
|
||||
//启用禁用
|
||||
ableOpt() {
|
||||
//请求参数delOpt
|
||||
let that = this;
|
||||
let params = {};
|
||||
params['userId'] = that.list[that.ableIndex].userId;
|
||||
params['status'] = that.list[that.ableIndex].status == 1 ? 0 : 1;
|
||||
//执行接口
|
||||
$.post('/h5/market/sylive/userTeam/status', params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
if (response.code == 200) {
|
||||
that.list[that.ableIndex].status = that.list[that.ableIndex].status == 1 ? 0 : 1;
|
||||
that.isShowAble = false;
|
||||
}
|
||||
}, 'json');
|
||||
},
|
||||
//删除确认框
|
||||
showDel(index) {
|
||||
this.delIndex = index;
|
||||
this.isShowDel = true;
|
||||
},
|
||||
//删除
|
||||
delOpt() {
|
||||
let that = this;
|
||||
//请求参数
|
||||
let params = {};
|
||||
params['userId'] = that.list[that.delIndex].userId;
|
||||
params['status'] = -1;
|
||||
$.post('/h5/market/sylive/userTeam/status', params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
if (response.code == 200) {
|
||||
that.isShowDel = false;
|
||||
that.isRefresh = true;
|
||||
that.loading = false;
|
||||
that.isDataEnd = false;
|
||||
that.isNoData = false;
|
||||
that.list = [];
|
||||
that.getStaffList();
|
||||
}
|
||||
}, 'json');
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?= $this->load->view('h5/market/sylive/hidden_wx_share') ?>
|
||||
</body>
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user