Authored by hf

do modify huodong christmas coupon share content

@@ -19,6 +19,7 @@ class ActivityData @@ -19,6 +19,7 @@ class ActivityData
19 const URI_GET_ACTIVITY_INFO = 'event/api/v1/activity/get'; 19 const URI_GET_ACTIVITY_INFO = 'event/api/v1/activity/get';
20 const URI_GET_NAMED_COUPON = 'event/api/v1/activity/getCoupon'; 20 const URI_GET_NAMED_COUPON = 'event/api/v1/activity/getCoupon';
21 const URI_GET_ALL_COUPON = 'event/api/v1/activity/getCoupon'; 21 const URI_GET_ALL_COUPON = 'event/api/v1/activity/getCoupon';
  22 + const URI_SEND_MESSAGE = 'inbox/service/v1/inbox';
22 23
23 /** 24 /**
24 * 用户获取某个活动指定的单个优惠券 25 * 用户获取某个活动指定的单个优惠券
@@ -50,7 +51,7 @@ class ActivityData @@ -50,7 +51,7 @@ class ActivityData
50 $param = array(); 51 $param = array();
51 $param['uid'] = $uid; 52 $param['uid'] = $uid;
52 $param['activity_id'] = $activityId; 53 $param['activity_id'] = $activityId;
53 - 54 +
54 return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_GET_ALL_COUPON, $param); 55 return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_GET_ALL_COUPON, $param);
55 } 56 }
56 57
@@ -77,7 +78,7 @@ class ActivityData @@ -77,7 +78,7 @@ class ActivityData
77 { 78 {
78 //调用接口发送站内信 79 //调用接口发送站内信
79 return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_SEND_MESSAGE, 'setSingleMessage', array( 80 return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_SEND_MESSAGE, 'setSingleMessage', array(
80 - $uid, $title, $content, $type, $verify_key, $send_uid, $call_back 81 + $uid, $title, $content, $type, $verify_key, $send_uid, $call_back
81 )); 82 ));
82 } 83 }
83 84
@@ -36,9 +36,7 @@ class ChristmasController extends HuodongAction @@ -36,9 +36,7 @@ class ChristmasController extends HuodongAction
36 switch (intval($result['code'])) { 36 switch (intval($result['code'])) {
37 case 200: // 领取成功, 发送站内信消息 37 case 200: // 领取成功, 发送站内信消息
38 $showPopupFlag = '0'; 38 $showPopupFlag = '0';
39 - $title = '【优惠券】您有6张潮集圣诞优惠券';  
40 - $content = '尊敬的客户:恭喜您成功获得6张潮集圣诞优惠券 !您可以在个人中心的交易管理中查看‘我的优惠券’。';  
41 - ActivityData::message($uid, $title, $content); 39 + $this->sendMessage($uid);
42 break; 40 break;
43 case 201: // 已领取过, 提示重复领券 41 case 201: // 已领取过, 提示重复领券
44 $showPopupFlag = '1'; 42 $showPopupFlag = '1';
@@ -53,10 +51,10 @@ class ChristmasController extends HuodongAction @@ -53,10 +51,10 @@ class ChristmasController extends HuodongAction
53 'staticTitle' => '潮集圣诞', 51 'staticTitle' => '潮集圣诞',
54 52
55 'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享 53 'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享
56 - 'shareLink' => 'http://feature.yoho.cn/1211APPTEST3/index.html',  
57 - 'shareTitle' => 'YOHO!BUY有货【潮集圣诞】第一弹疯狂来袭!500元优惠券引爆圣诞!',  
58 - 'shareDesc' => '800+潮牌限时4折起,折上满减,最高直减¥100!',  
59 - 'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/05/02a7ec01785c8579ed10bdb65a16d60a44.png', 54 + 'shareLink' => 'http://feature.yohobuy.com/0/0/675/index.html',
  55 + 'shareTitle' => 'YOHO!BUY有货【潮集圣诞】第一弹来袭!500元优惠券引爆圣诞!',
  56 + 'shareDesc' => '万件潮品限时58折封顶,再享折上满减,还有惊喜圣诞礼物等你来挑哦!',
  57 + 'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/09/029fd41969b67002126ff7a71fe5396b6e.png',
60 58
61 'showPopupFlag' => $showPopupFlag, 59 'showPopupFlag' => $showPopupFlag,
62 'myCouponUrl' => $myCouponUrl, 60 'myCouponUrl' => $myCouponUrl,
@@ -70,7 +68,7 @@ class ChristmasController extends HuodongAction @@ -70,7 +68,7 @@ class ChristmasController extends HuodongAction
70 * 68 *
71 * @return int 69 * @return int
72 */ 70 */
73 - public function getLoggedUid() 71 + private function getLoggedUid()
74 { 72 {
75 // 判断是否是应用访问, 拼接APP需要的URL参数 73 // 判断是否是应用访问, 拼接APP需要的URL参数
76 $this->_isApp = null !== $this->get('app_version'); 74 $this->_isApp = null !== $this->get('app_version');
@@ -83,6 +81,21 @@ class ChristmasController extends HuodongAction @@ -83,6 +81,21 @@ class ChristmasController extends HuodongAction
83 81
84 return $uid; 82 return $uid;
85 } 83 }
  84 +
  85 + /**
  86 + * 发送站内信
  87 + *
  88 + * @param int $uid 用户ID
  89 + */
  90 + private function sendMessage($uid)
  91 + {
  92 + try {
  93 + ActivityData::message($uid, '【优惠券】您有6张潮集圣诞优惠券', '尊敬的客户:恭喜您成功获得6张潮集圣诞优惠券 !您可以在个人中心的交易管理中查看‘我的优惠券’。');
  94 + }
  95 + catch (Exception $e) {
  96 + // do nothing
  97 + }
  98 + }
86 99
87 /** 100 /**
88 * 根据环境来获取活动ID 101 * 根据环境来获取活动ID