Browse Source

activityController

DengTao 8 năm trước cách đây
mục cha
commit
ab563d8a0c

+ 2 - 2
www/protected/modules/common/controllers/ActivityController.php

@@ -99,7 +99,7 @@ class ActivityController extends O2oBaseController  {
             ));
         }else{
 
-            $this->renderpartial('wxIndex', array(
+            $this->renderpartial('getCoupon', array(
                 'version' => '2015111601',
                 'debug' => 'false',
                 'signPackage' => $signPackage,
@@ -130,7 +130,7 @@ class ActivityController extends O2oBaseController  {
         $scope = 'snsapi_userinfo';
         $state = 'yiguanjia';
         $codeURI = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' . $wxConfig['appId'] . '&redirect_uri=' . urlencode($redirectURI) . '&response_type=code&scope=' . $scope . '&state=' . $state . '#wechat_redirect';
-       
+        print_r($codeURI);
         $this->renderpartial('wxIndex', array(
             'codeURI' => $codeURI,
             'appURI' => $appURI

+ 2 - 11
www/protected/modules/common/views/activity/getCoupon.php

@@ -48,7 +48,7 @@
         }
         ?>
 
-       // if (ua.match(/MicroMessenger/i) == 'micromessenger') {
+        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
             <?php
             if(!empty($userId) && !empty($appToken)){
                 echo '
@@ -64,20 +64,11 @@
                 location.href = '<?php echo Yii::app()->request->baseUrl . 'index.php?r=/common/activity/wxIndex&coupon_id='.$coupon_id; ?>';
             }
             document.write('<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"><\/script>');
-        //}
+        }
         if (location.hash == '#rd') {
             location.hash = '';
         }
-        var debug = true;
-        
 
-        var main = '<?php echo Yii::app()->request->baseUrl;?>/webapp/o2o/dist/js/main.js?v=20160960804';
-        if (debug) {
-            main = '<?php echo Yii::app()->request->baseUrl;?>/webapp/o2o/js/main.js?v=' + (new Date()).getTime();
-            //document.getElementById('debugMain').src = '<?php echo Yii::app()->request->baseUrl; ?>/webapp/common/js/debuggap.js';
-        }
-        document.getElementById('graceMain').setAttribute('data-main', main);
-        document.getElementById('graceMain').src = '<?php echo Yii::app()->request->baseUrl; ?>/webapp/common/js/require.js';
     })();
 </script>