|
@@ -12,8 +12,8 @@ require_once (BASE_ROOT_PATH . '/helper/bonus_helper.php');
|
|
|
require_once (BASE_ROOT_PATH . '/helper/predeposit_helper.php');
|
|
|
require_once (BASE_ROOT_PATH . '/helper/session_helper.php');
|
|
|
require_once (BASE_ROOT_PATH . '/helper/sms_helper.php');
|
|
|
-require_once (BASE_MOBILE_PATH . "/control/login.php");
|
|
|
-
|
|
|
+require_once (BASE_ROOT_PATH . '/helper/model_helper.php');
|
|
|
+require_once (BASE_ROOT_PATH . '/helper/bonus_share.php');
|
|
|
|
|
|
class bonusexControl extends mobileControl
|
|
|
{
|
|
@@ -21,9 +21,10 @@ class bonusexControl extends mobileControl
|
|
|
parent::__construct();
|
|
|
}
|
|
|
|
|
|
- private function fileter_typeinfos($type_infos,&$type_info,&$binded_info)
|
|
|
+ private function fileter_typeinfos($type_infos,&$type_info,&$binded_info,&$avatars)
|
|
|
{
|
|
|
$type_info = bonus_helper::filter_type($type_infos['type_info']);
|
|
|
+ $avatars = $type_infos['avatars'];
|
|
|
|
|
|
$binded_info = array();
|
|
|
$binded_infos = $type_infos['binded_info'];
|
|
@@ -57,7 +58,7 @@ class bonusexControl extends mobileControl
|
|
|
if(empty($type_infos)) {
|
|
|
return self::outerr(errcode::ErrBonus,"无此红包.");
|
|
|
}
|
|
|
- $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
|
|
|
+ $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
|
$type = \bonus\type::create_by_paramer($type_infos['type_info']);
|
|
|
|
|
|
$isMineType = $this->isMineType($type);
|
|
@@ -78,7 +79,7 @@ class bonusexControl extends mobileControl
|
|
|
$mine_bonus = bonus_helper::get_mine_by_bonussn($new_sn);
|
|
|
}
|
|
|
}
|
|
|
- $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info);
|
|
|
+ $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars);
|
|
|
if($bonus->isBinded() || $isMineType) {
|
|
|
return self::outsuccess($data,"bonus/content");
|
|
|
}
|
|
@@ -107,7 +108,10 @@ class bonusexControl extends mobileControl
|
|
|
else
|
|
|
{
|
|
|
if($type->isEnd() || $type->binded_over()) {
|
|
|
- return self::outsuccess(array('type_info' => $type_info,'binded_info' => $binded_info),'bonus/detail');
|
|
|
+ return self::outsuccess(array('type_info' => $type_info,
|
|
|
+ 'binded_info' => $binded_info,
|
|
|
+ 'avatars' => $avatars),
|
|
|
+ 'bonus/detail');
|
|
|
}
|
|
|
else {
|
|
|
return self::outsuccess(array('type_info' => $type_info),"bonus/open");
|
|
@@ -126,7 +130,7 @@ class bonusexControl extends mobileControl
|
|
|
if(empty($type_infos)) {
|
|
|
return self::outerr(errcode::ErrBonus,"无此红包.");
|
|
|
}
|
|
|
- $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
|
|
|
+ $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
|
|
|
|
$type = \bonus\type::create_by_paramer($type_infos['type_info']);
|
|
|
if($type->isStart() == false) {
|
|
@@ -138,7 +142,11 @@ class bonusexControl extends mobileControl
|
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
|
}
|
|
|
|
|
|
- return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),'bonus/detail');
|
|
|
+ return self::outsuccess(array('type_info' => $type_info,
|
|
|
+ 'mine_bonus' => $mine_bonus,
|
|
|
+ 'binded_info' => $binded_info,
|
|
|
+ 'avatars' => $avatars),
|
|
|
+ 'bonus/detail');
|
|
|
}
|
|
|
|
|
|
public function grabOp()
|
|
@@ -152,7 +160,7 @@ class bonusexControl extends mobileControl
|
|
|
if(empty($type_infos)) {
|
|
|
return self::outerr(errcode::ErrBonus,"无此红包.");
|
|
|
}
|
|
|
- $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
|
|
|
+ $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
|
|
|
|
$type = \bonus\type::create_by_paramer($type_infos['type_info']);
|
|
|
if($type->isStart() == false) {
|
|
@@ -166,7 +174,7 @@ class bonusexControl extends mobileControl
|
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
|
|
|
|
if($bonus_obj->isBinded()) {
|
|
|
- return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
|
|
|
+ return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/content");
|
|
|
}
|
|
|
elseif($type->isEnd()) {
|
|
|
return self::outsuccess(array('type_info' => $type_info),"bonus/end");
|
|
@@ -178,12 +186,12 @@ class bonusexControl extends mobileControl
|
|
|
$ret = bonus_helper::bind_bonus($bonus_obj->bonus_sn(),$_SESSION['MPHPSESSID'],session_helper::cur_mobile(),$new_sn);
|
|
|
if($ret == true) {
|
|
|
$mine_bonus = bonus_helper::get_mine_by_bonussn($new_sn);
|
|
|
- return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
|
|
|
+ return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/content");
|
|
|
} else {
|
|
|
- return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/bind");
|
|
|
+ return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/bind");
|
|
|
}
|
|
|
} else {
|
|
|
- return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/bind");
|
|
|
+ return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/bind");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -211,11 +219,11 @@ class bonusexControl extends mobileControl
|
|
|
if(empty($type_infos)) {
|
|
|
return self::outerr(errcode::ErrBonus,"无此红包.");
|
|
|
}
|
|
|
- $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
|
|
|
- $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info);
|
|
|
+ $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
|
+ $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars);
|
|
|
return self::outsuccess($data,"bonus/content");
|
|
|
} else {
|
|
|
- $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info);
|
|
|
+ $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars);
|
|
|
return self::outsuccess($data,"bonus/bind");
|
|
|
}
|
|
|
}
|
|
@@ -238,9 +246,9 @@ class bonusexControl extends mobileControl
|
|
|
if($bonus_obj->isBinded()) {
|
|
|
$type_sn = $bonus_obj->type_sn();
|
|
|
$type_infos = bonus_helper::get_typeinfo($type_sn);
|
|
|
- $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
|
|
|
+ $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
|
- return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
|
|
|
+ return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/content");
|
|
|
}
|
|
|
|
|
|
$type_sn = $bonus_obj->type_sn();
|
|
@@ -284,9 +292,9 @@ class bonusexControl extends mobileControl
|
|
|
$mine_bonus = bonus_helper::get_mine_by_bonussn($new_bonus_sn);
|
|
|
$bonus_obj = \bonus\user_bonus::create_by_param($mine_bonus);
|
|
|
$type_infos = bonus_helper::get_typeinfo($bonus_obj->type_sn());
|
|
|
- $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
|
|
|
+ $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
|
|
|
|
- return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info));
|
|
|
+ return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars));
|
|
|
} else {
|
|
|
return self::outerr($ret['code'],$ret['msg']);
|
|
|
}
|
|
@@ -338,9 +346,9 @@ class bonusexControl extends mobileControl
|
|
|
{
|
|
|
$bonus = bonus_helper::get_mine_by_bonussn($bonus_obj->bonus_sn());
|
|
|
$type_infos = bonus_helper::get_typeinfo($bonus_obj->type_sn());
|
|
|
- $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
|
|
|
+ $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
|
|
|
|
- return self::outsuccess(array('type_info' => $type_info,'mine_bonus' => $bonus,'binded_info' => $binded_info),"bonus/content");
|
|
|
+ return self::outsuccess(array('type_info' => $type_info,'mine_bonus' => $bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/content");
|
|
|
} else {
|
|
|
return self::outsuccess(errcode::ErrBonus,"只有拼收起红包才可以摇哦~");
|
|
|
}
|
|
@@ -428,6 +436,23 @@ function bonus_output_grabinfo($output)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function bonus_output_sender_header($output)
|
|
|
+{
|
|
|
+ $avatar = RESOURCE_SITE_URL . '/mobile/defimg/female.png';
|
|
|
+ $type_info = $output['type_info'];
|
|
|
+ $avatars = $output['avatars'];
|
|
|
+
|
|
|
+ if(!empty($type_info))
|
|
|
+ {
|
|
|
+ $type = \bonus\type::create_by_paramer($type_info);
|
|
|
+ $user_id = $type->sender_id();
|
|
|
+ if(array_key_exists($user_id,$avatars)) {
|
|
|
+ $avatar = $avatars[$user_id];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $avatar;
|
|
|
+}
|
|
|
+
|
|
|
function bonus_output_sender($output)
|
|
|
{
|
|
|
$type_info = $output['type_info'];
|
|
@@ -470,6 +495,7 @@ function bonus_output_graburl($output)
|
|
|
|
|
|
function bonus_output_type($output)
|
|
|
{
|
|
|
+ echo '<div class="name">';
|
|
|
echo '<p class="p p_name" style="color:#454545">';
|
|
|
$type_info = $output['type_info'];
|
|
|
$type = \bonus\type::create_by_paramer($type_info);
|
|
@@ -478,12 +504,18 @@ function bonus_output_type($output)
|
|
|
echo '<s class="icon_pin"></s>';
|
|
|
}
|
|
|
echo '</p>';
|
|
|
-
|
|
|
echo '<p class="prompt">' . $type_info['type_bless'] . '</p>';
|
|
|
+ echo '</div>';
|
|
|
}
|
|
|
|
|
|
function bonus_output_mine($output)
|
|
|
{
|
|
|
+ if($_SESSION['is_app']) {
|
|
|
+ $show_down = false;
|
|
|
+ } else {
|
|
|
+ $show_down = true;
|
|
|
+ }
|
|
|
+
|
|
|
$mine_bonus = $output['mine_bonus'];
|
|
|
if(!empty($mine_bonus)) {
|
|
|
$bonus = \bonus\user_bonus::create_by_param($mine_bonus);
|
|
@@ -492,15 +524,14 @@ function bonus_output_mine($output)
|
|
|
echo('</div>');
|
|
|
echo('<input type="hidden" id="mine_bonus" value=' ."{$bonus->bonus_sn()}>");
|
|
|
|
|
|
- if($bonus->isBinded()) {
|
|
|
- echo('<div class="link" id="links">');
|
|
|
- echo('<p style="margin: 20px 0"><a href="javascript:void(0)">请下载熊猫美妆APP,享用红包</a></p>');
|
|
|
- echo('</div>');
|
|
|
- }
|
|
|
+ $show_down = $bonus->isBinded() && $show_down;
|
|
|
+ } else {
|
|
|
+ $show_down = false;
|
|
|
}
|
|
|
- else {
|
|
|
- echo('<div class="link">');
|
|
|
- echo('<p style="margin: 20px 0><a href="javascript:void(0)">请下载熊猫美妆APP</a></p>');
|
|
|
+
|
|
|
+ if($show_down) {
|
|
|
+ echo('<div class="link" id="link">');
|
|
|
+ echo('<p><a href="javascript:void(0)"><span class="down_icon"></span>点击下载APP</a></p>');
|
|
|
echo('</div>');
|
|
|
}
|
|
|
}
|
|
@@ -565,6 +596,7 @@ function bonus_out_bindedtime($period)
|
|
|
function bonus_output_bindedinfo($output)
|
|
|
{
|
|
|
$type_info = $output['type_info'];
|
|
|
+ $avatars = $output['avatars'];
|
|
|
$type = \bonus\type::create_by_paramer($type_info);
|
|
|
|
|
|
echo('<div class="prompt text_left">');
|
|
@@ -583,24 +615,36 @@ function bonus_output_bindedinfo($output)
|
|
|
$bined_info = $output['binded_info'];
|
|
|
if(empty($bined_info)) return;
|
|
|
|
|
|
+ echo '<div class="list">';
|
|
|
+
|
|
|
+ $avatar = RESOURCE_SITE_URL . '/mobile/defimg/female.png';
|
|
|
foreach($bined_info as $val)
|
|
|
{
|
|
|
$bonus = \bonus\user_bonus::create_by_param($val);
|
|
|
+ $user_id = $bonus->user_id();
|
|
|
+ if(array_key_exists($user_id,$avatars)) {
|
|
|
+ $avatar = $avatars[$user_id];
|
|
|
+ }
|
|
|
+
|
|
|
echo('<div class="li">');
|
|
|
+ echo('<div class="li_head_image">');
|
|
|
+ echo('<img src="' . $avatar .'" />');
|
|
|
+ echo('</div>');
|
|
|
+
|
|
|
echo('<div class="li_left">');
|
|
|
echo('<p class="p">' . $bonus->user_name() .'</p>');
|
|
|
if(empty($bonus->user_comment()))
|
|
|
{
|
|
|
- if($bonus->user_mobile() == $_SESSION['member_mobile']) {
|
|
|
- echo ('<p class="prompt" id="my_prompt">');
|
|
|
- echo ('<a href="javascript:void(0)" id="message" style="color: #1927D1">留言</a>');
|
|
|
- echo ('</p>');
|
|
|
+ if($bonus->user_id() == $_SESSION['member_id']) {
|
|
|
+ echo('<p class="prompt" id="my_prompt"><a href="javascript:void(0)" id="message" style="color: #1927D1;display:inline-block;padding-top: 0.1rem;">留言</a></p>');
|
|
|
echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
|
|
|
} else {
|
|
|
echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
|
|
|
echo('<p class="prompt"></p>');
|
|
|
}
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
echo('<p class="prompt">' . $bonus->user_comment() . '</p>');
|
|
|
echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
|
|
|
}
|
|
@@ -608,12 +652,14 @@ function bonus_output_bindedinfo($output)
|
|
|
echo('</div>');
|
|
|
echo('<div class="li_right">');
|
|
|
echo('<p class="p">' . $bonus->bonus_value() . '元</p>');
|
|
|
+ echo('<p><span class="hilt">' . $bonus->bonus_rate() . '%</span></p>');
|
|
|
if($type->binded_over() && $type->isMaxAmount($bonus->bonus_value()) && $type->isRandomAmount()) {
|
|
|
echo('<p class="king_box"><s class="king"></s>手气最佳</p>');
|
|
|
}
|
|
|
echo('</div>');
|
|
|
echo('</div>');
|
|
|
}
|
|
|
+ echo('</div>');
|
|
|
}
|
|
|
|
|
|
function android_downpath()
|
|
@@ -622,14 +668,29 @@ function android_downpath()
|
|
|
return $url;
|
|
|
}
|
|
|
|
|
|
-function share_title()
|
|
|
+function share_title($output)
|
|
|
{
|
|
|
- return "丽人丽妆公司特权红包,内购正品行货美妆.";
|
|
|
+ $type_info = $output['type_info'];
|
|
|
+ $type = \bonus\type::create_by_paramer($type_info);
|
|
|
+ return $type->bless();
|
|
|
}
|
|
|
|
|
|
-function share_image()
|
|
|
+function share_subtitle($output)
|
|
|
{
|
|
|
- return BASE_SITE_URL + "/panda.png";
|
|
|
+ $type_info = $output['type_info'];
|
|
|
+ $type = \bonus\type::create_by_paramer($type_info);
|
|
|
+ $share_id = $type->share_id();
|
|
|
+ $share = bonus_share::instance()->get($share_id);
|
|
|
+ return $share['sub_title'];
|
|
|
+}
|
|
|
+
|
|
|
+function share_image($output)
|
|
|
+{
|
|
|
+ $type_info = $output['type_info'];
|
|
|
+ $type = \bonus\type::create_by_paramer($type_info);
|
|
|
+ $share_id = $type->share_id();
|
|
|
+ $share = bonus_share::instance()->get($share_id);
|
|
|
+ return $share['img_url'];
|
|
|
}
|
|
|
|
|
|
|