add-sylive-hidden_wx_share
This commit is contained in:
@@ -73,7 +73,11 @@ class Act extends Wx {
|
||||
$info['org_id'] = $this->session['org_id'];
|
||||
$info['subscribemsg'] = $subscribemsg;
|
||||
$info['code'] = '';
|
||||
$info['shareurl'] = '/h5/market/sylive/act/share?skey='.$info['skey'];
|
||||
if($this->group_id<4){
|
||||
$info['shareurl'] = '/h5/market/sylive/act/share?skey='.$info['skey'];
|
||||
}else{
|
||||
$info['shareurl'] = '';
|
||||
}
|
||||
$info['statisticsurl'] = '/h5/market/sylive/stic?skey='.$info['skey'];
|
||||
$info['channelImg'] = build_qiniu_image_url($row['channelImg']);
|
||||
// $info['live_url'] = 'https://live.liche.cn/watch/'.$row['channelId'];
|
||||
|
||||
@@ -35,6 +35,9 @@ class Biz extends Admin {
|
||||
$row = $this->market_sylive_organization_model->get(['organizationId'=>$biz_id]);
|
||||
$this->data['headimg'] = $this->liche_img;
|
||||
$this->data['biz_name'] = $row['organizationName'];
|
||||
//微信分享
|
||||
$wx_info = $this->share_info();
|
||||
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||
$this->show_view('h5/market/sylive/biz/index');
|
||||
}
|
||||
|
||||
@@ -46,6 +49,9 @@ class Biz extends Admin {
|
||||
$area_id = $this->input->get('area_id');
|
||||
$this->data['area_id'] = $area_id;
|
||||
$this->data['group_id'] = $this->group_id;
|
||||
//微信分享
|
||||
$wx_info = $this->share_info();
|
||||
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||
$this->show_view('h5/market/sylive/biz/lists');
|
||||
}
|
||||
//大区列表
|
||||
@@ -53,6 +59,9 @@ class Biz extends Admin {
|
||||
if($this->group_id!=0){
|
||||
throw new Hd_exception('权限不足',400);
|
||||
}
|
||||
//微信分享
|
||||
$wx_info = $this->share_info();
|
||||
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||
$this->show_view('h5/market/sylive/biz/brands');
|
||||
}
|
||||
//顾问
|
||||
@@ -60,6 +69,9 @@ class Biz extends Admin {
|
||||
if($this->group_id!=3){
|
||||
throw new Hd_exception('权限不足',400);
|
||||
}
|
||||
//微信分享
|
||||
$wx_info = $this->share_info();
|
||||
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||
$this->show_view('h5/market/sylive/biz/detail');
|
||||
}
|
||||
public function nav(){
|
||||
|
||||
@@ -95,21 +95,24 @@ abstract class Common extends CI_Controller{
|
||||
}
|
||||
}
|
||||
//微信分享信息
|
||||
public function share_info($act_row){
|
||||
public function share_info($act_row=[]){
|
||||
$a_id = $act_row['activityId'];
|
||||
$share_skey = "a_id=" . $a_id . "&cf_uid=" . $this->uid . "&cf_share=" . $this->myencryption->random_string(6);
|
||||
//微信分享
|
||||
$share_url = http_host_com('home') . "/h5/market/sylive/act?skey=" . $this->myencryption->base64url_encode($share_skey);
|
||||
$this->load->library('Jssdk');
|
||||
$jssdk = new Jssdk('liche');
|
||||
$shareTitle = $act_row['shareTitle'] ? json_decode($act_row['shareTitle'],true) : [];
|
||||
$sign_package = $jssdk->getSignPackage();
|
||||
$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
|
||||
);
|
||||
$share = [];
|
||||
if($act_row){
|
||||
//微信分享
|
||||
$share_url = http_host_com('home') . "/h5/market/sylive/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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,14 +288,21 @@ class Stic extends Admin{
|
||||
];
|
||||
$skey = $this->input->get('skey');
|
||||
$page = $this->input->get('page');
|
||||
$type = $this->input->get('type');
|
||||
!$page && $page=1;
|
||||
$param = $this->myencryption->base64url_decode($skey);
|
||||
$a_id = intval($param['a_id']);//活动id
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
|
||||
$where = [
|
||||
'a_id'=>$a_id,
|
||||
// 'kpi'=>'watch',
|
||||
'cf_uid'=>$this->uid
|
||||
];
|
||||
if($type==1){ //预热
|
||||
$where['c_time<='] = strtotime($row['timeStart']);
|
||||
}else{ //开始
|
||||
$where['c_time>='] = strtotime($row['timeStart']);
|
||||
}
|
||||
$total = $this->mdSytActivityKpiData->count($where);
|
||||
$lists = [];
|
||||
if($total){
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/md5.min.js"></script>
|
||||
<script type="text/javascript" src="//player.polyv.net/livesdk/polyv-live.min.js"></script>
|
||||
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
<body class="bg-fff">
|
||||
<div id="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb150" :style="'background-image:url('+info.bg+')'">
|
||||
|
||||
@@ -216,4 +216,5 @@
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -131,5 +131,5 @@
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -224,5 +224,5 @@
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<?=$this->load->view('h5/market/sylive/share_script')?>
|
||||
</body>
|
||||
@@ -14,4 +14,5 @@
|
||||
<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,27 @@
|
||||
<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.closeWindow();
|
||||
wx.hideMenuItems({
|
||||
menuList: [
|
||||
'menuItem:share:appMessage', 'menuItem:share:timeline','menuItem:share:qq'
|
||||
'menuItem:share:weiboApp','menuItem:share:facebook','menuItem:share:QZone',
|
||||
'menuItem:editTag','menuItem:delete','menuItem:copyUrl',
|
||||
'menuItem:originPage','menuItem:readMode','menuItem:openWithQQBrowser','menuItem:openWithSafari',
|
||||
'menuItem:share:email','menuItem:share:brand'
|
||||
] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有 menu 项见附录3
|
||||
});
|
||||
});
|
||||
wx.error(function (res) {
|
||||
console.log('res', res);
|
||||
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
||||
});
|
||||
</script>
|
||||
@@ -210,7 +210,7 @@
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive/stic/event',{'skey':'<?=$skey?>','page':that.page},function (res){
|
||||
$.get('/h5/market/sylive/stic/event',{'skey':'<?=$skey?>','page':that.page,'type':that.tabid},function (res){
|
||||
that.loading = false;
|
||||
that.page = that.page + 1;
|
||||
that.dynamic.title = '实时<span class="color-00a2ff">动态</span>';
|
||||
|
||||
Reference in New Issue
Block a user