dever 7 年之前
父節點
當前提交
e5213904e7

+ 3 - 0
tm/lib/Controller/Admin/Activity/SetPage.class.php

@@ -72,6 +72,7 @@ class SetPage extends Controller {
 		$events_Data = $this->objLottery->getOneLotteryEventsAndPrize ( $events_id );
 		
 		// 载入修改页面需要用到的配置
+		$eventsShareButton = LotteryEvents::getShareButton (); // // [活动] 是否显示分享按钮
 		$eventsDeliveryType = LotteryEvents::getDeliveryType (); // // [活动] 发货状态
 		$eventsAuthorize = LotteryEvents::getAuthorize (); // [活动] 授权
 		$eventsDisplayStatus = LotteryEvents::getDisplay (); // [活动] 是否显示
@@ -83,6 +84,7 @@ class SetPage extends Controller {
 		$prizeExpress = LotteryPrize::getExpress (); // [奖项] 是否需要快递
 		$prizeType = LotteryPrize::getType (); // [奖项] 类型
 		
+		$this->setOutput ( 'eventsShareButton', $eventsShareButton );
 		$this->setOutput ( 'eventsDeliveryType', $eventsDeliveryType );
 		$this->setOutput ( 'eventsAuthorize', $eventsAuthorize );
 		$this->setOutput ( 'eventsDisplayStatus', $eventsDisplayStatus );
@@ -159,6 +161,7 @@ class SetPage extends Controller {
 		$info = array();
 		$info['events_tips'] =  Request::p('events_tips', null);
 		$info['events_hd_tips'] = Request::p('events_hd_tips', null); //互动提示语
+		$info['share_button'] = Request::p('share_button', null); //是否显示分享按钮
 		$info['events_rules'] =  Request::p('events_rules', null);
 		$info['operationt_tips'] =  Request::p('operationt_tips', null);
 		$info['display'] =  LotteryEvents::EVENT_DISPLAY_SHOW;

+ 3 - 2
tm/lib/Controller/EventsTurntable.class.php

@@ -37,7 +37,7 @@ class EventsTurntable extends EventsController {
 		
 		# 检查是否移动端
 		$title = $turntableData['events']['weixinShare']['title'] ? $turntableData['events']['weixinShare']['title'] : $turntableData['events']['events_name'];
-		$this->checkIsFromMobile($title);
+		//$this->checkIsFromMobile($title);
 		
 		# 获取试用信息
 		$objLotteryEventsTypeTry = new LotteryEventsTypeTry($uid, $events_id);
@@ -73,7 +73,7 @@ class EventsTurntable extends EventsController {
 		$authorize = $turntableData['events']['authorize'];
 		if ($authorize && $loginUrl) {
 				if($ckLogin==true){
-					self::redirect($loginUrl);
+					//self::redirect($loginUrl);
 				}
 		}
 		
@@ -122,6 +122,7 @@ class EventsTurntable extends EventsController {
 		$jsonTurntableData = json_encode($jsonTurntableData);
 		$this->tpl = 'events_turntable';
 		$this->setOutput('title', $turntableData['events']['weixinShare']['title'] ? $turntableData['events']['weixinShare']['title'] : $turntableData['events']['events_name']);
+		//print_r($otherEventsData);die;
 		$this->setOutput('jsonTurntableData', $jsonTurntableData);
 		$this->setOutput('turntableData', $turntableData);
 		$this->setOutput('otherEventsData', $otherEventsData);

+ 30 - 0
tm/lib/Dao/LotteryEvents.class.php

@@ -22,6 +22,7 @@ class LotteryEvents extends DBAgileDev {
 		'events_name',
 		'begin_time',
 		'end_time',
+		'share_button',
 		'platform_ids',	
 		'operator_uid',
 		'list_display',
@@ -527,6 +528,35 @@ class LotteryEvents extends DBAgileDev {
 		return self::$deliveryType;
 	}
 	
+	/**
+	 * SHARE_BUTTON_FALSE  [不显示分享按钮] 
+	 * @var int
+	 */
+	const SHARE_BUTTON_FALSE  = 1;
+	/**
+	 * SHARE_BUTTON_TRUE  [显示分享按钮]
+	 * @var int
+	 */
+	const  SHARE_BUTTON_TRUE = 2;
 	
 	
+	public static $shareButton= array(
+			self::SHARE_BUTTON_FALSE => array(
+					'desc'	=> '不显示',
+					'kw'	=> 'SHARE_BUTTON_FALSE',
+			),
+			self::SHARE_BUTTON_TRUE => array(
+					'desc'	=> '显示',
+					'kw'	=> 'SHARE_BUTTON_TRUE',
+			),
+	);
+	
+	/**
+	 * 获取 是否显示分享按钮
+	 * @return array
+	 */
+	public static function getShareButton() {
+		return self::$shareButton;
+	}
+	
 }

+ 8 - 0
tm/template_dir/admin/activity/setPage_event.html

@@ -49,6 +49,14 @@
 				<label class="control-label rowlabel">互动提示语:</label>
 				<input name="events_hd_tips" class="form-control" type="text" style="width:300px;" value="<{$eventData.events_hd_tips}>"/>
 			</div>
+			<div class="form-group">
+				<label class="control-label rowlabel">是否显示分享按钮:</label>
+				<{foreach from=$eventsShareButton item=info key=key}>
+				<label class="radio-inline">
+					<input name="share_button" type="radio" value="<{$key}>" <{if $eventData.share_button == $key}>checked<{/if}>> <{$info.desc}>
+				</label>
+				<{/foreach}>
+			</div>
 			<div class="form-group">
 				<label class="control-label rowlabel">活动规则提示语:</label>
 				<input name="operationt_tips" class="form-control" type="text" style="width:300px;" value="<{$eventData.operationt_tips}>"/>

+ 49 - 5
tm/template_dir/bottom.html

@@ -43,6 +43,37 @@
 <{/if}>
 <{if !$notShowWeixinShare && !$weixinShare.notAllow}>
 <script type="text/javascript">
+
+function share_button(e, title, url, img, content) {
+    console.log(title);
+    var u = navigator.userAgent.toLowerCase();
+    var isApple = /iphone|ipad|ipod|ios/i.test(u);
+    var isAndroid = /android/i.test(u);
+    if (isApple) {
+        e.show();
+        e.click(function()
+        {
+            share_ios(title, url, img, content);
+        })
+    } else if(isAndroid && window.AndroidBridge) {
+        e.show();
+        e.click(function()
+        {
+            share_android(title, url, img, content);
+        })
+    } else {
+        e.hide();
+    }
+}
+
+function share_ios(title, url, img, content) {
+    window.location = 'myscheme://share_title/' + title + '/share_url/' + url + '/share_img/' + img + '/share_content/' + content;
+}
+
+function share_android(title, url, img, content) {
+    window.AndroidBridge.openShare(title, url, img, content);
+}
+
 var URL = window.location.href, site;
 site = 1;
 
@@ -73,25 +104,38 @@ new brickjs.MShare({
         }
     }
 });
+if ($('.share_button').length) {
+    share_button($('.share_button'), '<{$weixinShare.title}>', '<{$web_cfg.url}>', '<{$weixinShare.imgUrl}>', '<{$weixinShare.content}>');
+}
 <{else}>
+
+var url = '<{if $weixinShare.jump_url}><{$weixinShare.jump_url}><{else}><{$web_cfg.url}><{/if}>';
+var title = '<{if $weixinShare.title}><{$weixinShare.title}><{else}><{$platform.weixinShare_title}><{/if}>';
+var img = '<{if $weixinShare.imgUrl}><{$weixinShare.imgUrl}><{else}><{$platform.weixinShare_img_url}><{/if}>';
+var content = '<{if $weixinShare.content}><{$weixinShare.content}><{else}><{$platform.weixinShare_content}><{/if}>';
+
+if ($('.share_button').length) {
+    share_button($('.share_button'), title, url, img, content);
+}
+
 new brickjs.MShare({
 	website : 'sg',
     site: site,
     catalog: "",
-    sUrl: "<{if $weixinShare.jump_url}><{$weixinShare.jump_url}><{else}><{$web_cfg.url}><{/if}>", //分享地址
-    title: "<{if $weixinShare.title}><{$weixinShare.title}><{else}><{$platform.weixinShare_title}><{/if}>",
-    imgUrl: "<{if $weixinShare.imgUrl}><{$weixinShare.imgUrl}><{else}><{$platform.weixinShare_img_url}><{/if}>",
+    sUrl: url, //分享地址
+    title: title,
+    imgUrl: img,
     imgWidth: "640",
     imgHeight: "640",
     source_id : 1,
     source_table : 'onepage',
-    desc: "<{if $weixinShare.content}><{$weixinShare.content}><{else}><{$platform.weixinShare_content}><{/if}>",
+    desc: content,
     appKey: {
         tsina: "2412621184"
     },
     ralateUid: '1658402750',
     wxGuide: {
-        imgUrl: '<{if $weixinShare.imgUrl}><{$weixinShare.imgUrl}><{else}><{$platform.weixinShare_img_url}><{/if}>',
+        imgUrl: img,
         width: 100,
         height: 100,
         style: {

+ 4 - 0
tm/template_dir/events_code.html

@@ -22,6 +22,10 @@
             <div class="center"><a href="<{$listUrl}>" class="submit_btn_style">参与更多特权活动</a></div>
         </div>
         <{/if}>
+
+        <{if $codeInfo.share_button == 2}>
+        	<{include file="share_button.html"}>
+	    <{/if}>
         
         <{if $codeInfo.operationt_tips}>
         <div class="h3_title"><span><{$codeInfo.operationt_tips}></span></div>

+ 4 - 0
tm/template_dir/events_invitation.html

@@ -26,6 +26,10 @@
             <div class="center"><a href="<{$listUrl}>" class="submit_btn_style">参与更多特权活动</a></div>
         </div>
         <{/if}>
+
+        <{if $info.share_button == 2}>
+        <{include file="share_button.html"}>
+        <{/if}>
         
         <{if $info.operationt_tips}>
         <div class="h3_title"><{$info.operationt_tips}></div>

+ 4 - 0
tm/template_dir/events_scratch.html

@@ -63,6 +63,10 @@
         <{/foreach}>
         <div class="clear"></div>
     </div>
+
+    <{if $scratchData.events.share_button == 2}>
+    <{include file="share_button.html"}>
+    <{/if}>
     
     <{if $scratchData.events.operationt_tips}>
     <div class="ac_title_com_line"><span><{$scratchData.events.operationt_tips}></span></div>

+ 4 - 0
tm/template_dir/events_survey.html

@@ -27,6 +27,10 @@
             </dl>
             <{/foreach}>
         </div>
+
+        <{if $surveyInfo.share_button == 2}>
+        <{include file="share_button.html"}>
+        <{/if}>
         
         <{if $surveyInfo.operationt_tips}>
         <div class="h3_title"><{$surveyInfo.operationt_tips}></div>

+ 4 - 0
tm/template_dir/events_try.html

@@ -24,6 +24,10 @@
             <div class="center"><a href="<{$listUrl}>" class="submit_btn_style">参与更多特权活动</a></div>
         </div>
         <{/if}>
+
+        <{if $tryInfo.share_button == 2}>
+	    <{include file="share_button.html"}>
+	    <{/if}>
         
         <!--公用活动规则样式-->
         <{if $tryInfo.operationt_tips}>

+ 4 - 0
tm/template_dir/events_turntable.html

@@ -65,6 +65,10 @@
             <{/if}>
             <{/foreach}>
         </div>
+
+        <{if $turntableData.events.share_button == 2}>
+        <{include file="share_button.html"}>
+        <{/if}>
         
         <{if $turntableData.events.operationt_tips}>
         <div class="h3_title"><{$turntableData.events.operationt_tips}></div>

+ 4 - 0
tm/template_dir/events_vote.html

@@ -84,6 +84,10 @@
             </div>
         </div>
         <{/if}>
+
+        <{if $voteInfo.share_button == 2}>
+        <{include file="share_button.html"}>
+        <{/if}>
         
         <{if $voteInfo.operationt_tips}>
         <div class="h3_title"><span><{$voteInfo.operationt_tips}></span></div>

+ 3 - 0
tm/template_dir/share_button.html

@@ -0,0 +1,3 @@
+<div class="v_end_com_box" style="display:none;">
+    <div class="center share_button">分享给好友</div>
+</div>