瀏覽代碼

Merge branch 'test' of https://git.oschina.net/yiguanjia/php into test

Charlie 8 年之前
父節點
當前提交
1f9fffff8b

+ 19 - 22
www/protected/modules/common/controllers/ActivityController.php

@@ -10,7 +10,7 @@ class ActivityController extends O2oBaseController  {
     //扫码获取代金券
 
     public function actionIndex(){
-
+        $this->render('index');exit;
     }
 
     public function actionGetCoupon() {
@@ -21,6 +21,7 @@ class ActivityController extends O2oBaseController  {
         $home_page = Yii::app()->getRequest()->getParam("home_page",'');
         $userId = '';
         $appToken = '';
+        var_dump($code);
         if($code && $state){
             $accessInfo = CommonWeixin::getAccessInfo($code);
             $userId = '';
@@ -72,32 +73,31 @@ class ActivityController extends O2oBaseController  {
                         }
                     }
                     //用户注册后,发放代金券
+                    $userId = $user->_id;
 
-                    $coupon_id =new MongoId($coupon_id);
-                    $start_time = time();                 //发放优惠券可用开始时间
-                    $end_time = $start_time + 86400*30;   //发放优惠券过期时间
-                    if (CommonFn::isMongoId($coupon_id)) {
-                        if (CommonFn::isMongoId($user->_id)) {
-                            Service::factory('CouponService')->giveCoupon($user->_id, $coupon_id, $start_time, $end_time);//发放代金券
-                        }
-                    }
                 }else{
                     echo $accessInfo['errcode'];
                     die();
                 }
+
+
             }
         }
 
+        $coupon_id =new MongoId($coupon_id);
+        $start_time = time();                 //发放优惠券可用开始时间
+        $end_time = $start_time + 86400*30;   //发放优惠券过期时间
+        if (CommonFn::isMongoId($coupon_id) && !$coupon_id) {
+            if (CommonFn::isMongoId($userId) && !$userId) {
+                Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
+                $this->render('index');exit;
+            }
+        }
         if($home_page){
-            $this->renderpartial('//o2o/web/index', array(
-                'version' => '2015111601',
-                'debug' => 'false',
-                'signPackage' => $signPackage,
-                'userId' => $userId,
-                'appToken' => $appToken,
-            ));
+            var_dump($user->_id);exit;
+            $this->renderpartial('index');
         }else{
-
+            var_dump($coupon_id);
             $this->renderpartial('getCoupon', array(
                 'version' => '2015111601',
                 'debug' => 'false',
@@ -121,17 +121,14 @@ class ActivityController extends O2oBaseController  {
         $redirectURI = 'http://' . $_SERVER['HTTP_HOST'] . Yii::app()->request->baseUrl . '/index.php?r=/common/activity/getCoupon&coupon_id='.$coupon_id;
 
         if($home_page){
-            $appURI = Yii::app()->request->baseUrl . '/common/activity/getCoupon'.'&home_page='.$home_page;
+            $appURI = Yii::app()->request->baseUrl . '/index.php?r=common/activity/getCoupon'.'&home_page='.$home_page.'&coupon_id='.$coupon_id;
             $redirectURI = $redirectURI.'/'.$home_page;
         }else{
-
-
-            $appURI = Yii::app()->request->baseUrl . '/common/activity/getCoupon&coupon_id='.$coupon_id;
+            $appURI = Yii::app()->request->baseUrl . '/index.php?r=common/activity/getCoupon&coupon_id='.$coupon_id;
         }
         $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';
-
         $this->renderpartial('wxIndex', array(
             'codeURI' => $codeURI,
             'appURI' => $appURI

+ 5 - 13
www/protected/modules/common/views/activity/getCoupon.php

@@ -38,10 +38,7 @@
 <script type="text/javascript" id="wxMain" data-sign="<?php echo @htmlentities(json_encode($signPackage)); ?>"></script>
 <script type="text/javascript">
     (function(){
-
         var ua = navigator.userAgent.toLowerCase();
-        var url = '<?php echo Yii::app()->request->baseUrl?>';
-
         <?php
         if(isset($from_channel)){
             echo "var from_channel = '$from_channel';";
@@ -50,7 +47,6 @@
             }
         }
         ?>
-
         if (ua.match(/MicroMessenger/i) == 'micromessenger') {
             <?php
             if(!empty($userId) && !empty($appToken)){
@@ -62,25 +58,21 @@
             ?>
             var userID = localStorage.getItem('wxUserID');
             var appToken = localStorage.getItem('appToken');
+
             if (!userID || !appToken) {
                 localStorage.clear();
                 location.href = '<?php echo Yii::app()->request->baseUrl . 'index.php?r=/common/activity/wxIndex&coupon_id='.$coupon_id; ?>';
+            } else {
+                localStorage.clear();
+                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>
 

+ 2 - 0
www/protected/modules/common/views/activity/index.php

@@ -13,8 +13,10 @@
 </head>
 
 <body>
+<div align="center">
     <h1>扫码关注壹管家获取更多资讯</h1>
     <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/qryiguanjia.jpg" class="index_logo" />
+</div>
 </body>
 
 </html>

文件差異過大導致無法顯示
+ 0 - 0
www/webapp/o2o/dist/js/build/template.js


文件差異過大導致無法顯示
+ 0 - 0
www/webapp/o2o/dist/js/main.js


文件差異過大導致無法顯示
+ 0 - 0
www/webapp/o2o/dist/js/model/product.js


文件差異過大導致無法顯示
+ 0 - 0
www/webapp/o2o/dist/js/page/placeOrder.js


文件差異過大導致無法顯示
+ 0 - 4
www/webapp/o2o/js/build/template.js


+ 40 - 0
www/webapp/o2o/js/model/product.js

@@ -252,6 +252,46 @@ define(['base', '$', 'api'], function (base, $, api) {
                         url: "http://7oxep6.com2.z0.glb.clouddn.com/7aa5766b0c71b1474355274988.jpg",
                         width: 537,
                         height: 537
+                    },
+                    {
+                        url: "http://oduj3utzz.bkt.clouddn.com/3e74cb763276a1475979060634.jpg",
+                        width: 720,
+                        height: 1165
+                    },
+                    {
+                        url: "http://oduj3utzz.bkt.clouddn.com/0f29fa9bf28161475979068565.jpg",
+                        width: 720,
+                        height: 844
+                    },
+                    {
+                        url: "http://oduj3utzz.bkt.clouddn.com/205de28a664c21475979065361.png",
+                        width: 720,
+                        height: 1129
+                    },
+                    {
+                        url: "http://oduj3utzz.bkt.clouddn.com/f17ecbfe231231475979073441.jpg",
+                        width: 720,
+                        height: 1204
+                    },
+                    {
+                        url: "http://oduj3utzz.bkt.clouddn.com/30daa83d817761475979080897.jpg",
+                        width: 720,
+                        height: 1246
+                    },
+                    {
+                        url: "http://oduj3utzz.bkt.clouddn.com/3ee87b41d9d241475979077357.png",
+                        width: 720,
+                        height: 1257
+                    },
+                    {
+                        url: "http://oduj3utzz.bkt.clouddn.com/06e7de122aab21475979086760.png",
+                        width: 720,
+                        height: 647
+                    },
+                    {
+                        url: "http://oduj3utzz.bkt.clouddn.com/2973a12ec9a0f1475979093617.jpg",
+                        width: 720,
+                        height: 786
                     }
                 ]
             }

+ 3 - 3
www/webapp/o2o/js/page/placeOrder.js

@@ -489,7 +489,7 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
                 if (order.productCount <= 1) return;
                 if (order.price == 0) {
                     $doc.trigger('spa:openpanel', ['simpleAlert', {
-                        message: '请选择extra'
+                        message: '请选择服务'
                     }]);
                     return;
                 }
@@ -628,7 +628,7 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
                 var extraJson = '';
                 if (product.extra && !order.appendID) {
                     $doc.trigger('spa:openpanel', ['simpleAlert', {
-                        message: '请选择extra'
+                        message: '请选择服务'
                     }]);
                     return;
                 }else {
@@ -710,7 +710,7 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
 
                 if (product.extra && !order.appendID) {
                     $doc.trigger('spa:openpanel', ['simpleAlert', {
-                        message: '请选择extra'
+                        message: '请选择服务'
                     }]);
                     return;
                 }

+ 8 - 8
www/webapp/o2o/tpl/mine/index.html

@@ -41,18 +41,18 @@
                             代金券
                         </a>
                     </li>
-                    <li class="table-view-cell">
-                        <a class="navigate-right btn-helper">
-                            <img src="http://oduj3utzz.bkt.clouddn.com/qe54qw5e4qw1e23qwwe132q.png" width="20px" height="20px" style="position: relative; top: 4px;"/>
-                            帮助中心
-                        </a>
-                    </li>
-                    <li class="table-view-cell">
+                    <!--<li class="table-view-cell">-->
+                        <!--<a class="navigate-right btn-helper">-->
+                            <!--<img src="http://oduj3utzz.bkt.clouddn.com/qe54qw5e4qw1e23qwwe132q.png" width="20px" height="20px" style="position: relative; top: 4px;"/>-->
+                            <!--帮助中心-->
+                        <!--</a>-->
+                    <!--</li>-->
+                    <!--<li class="table-view-cell">
                         <a class="navigate-right btn-about">
                             <img src="http://oduj3utzz.bkt.clouddn.com/7uo8i7o98ui78o97u89iouio789.png" width="20px" height="20px" style="position: relative; top: 4px;"/>
                             关于壹管家
                         </a>
-                    </li>
+                    </li>-->
                 </ul>
                 <div style="width: 100%; padding-top: 80px;text-align: center; color: #b6bbc2; font-size:16px;">专属管家 服务无忧</div>
             </div>

+ 6 - 5
www/webapp/o2o/tpl/placeOrder/index.html

@@ -94,11 +94,7 @@
                   <span class="table-view-cell-right-label booking-time" style="display: block; position: static; text-align: right">选择服务时间</span>
                 </a>
               </li>
-              <li class="table-view-cell memo">
-                <form class="input-group" id="order-form">
-                  <input type="text" class="order-memo" id="order-memo" placeholder="(备注)可填写附加要求">
-                </form>
-              </li>
+
             </ul>
             <!-- 附加服务
             <div class="extra-service-title">附加服务</div>
@@ -172,6 +168,11 @@
                   <span class="table-view-cell-right-label coupon-selected-name" style="display: block; position: static; text-align: right">选择优惠券</span>
                 </a>
               </li>
+                <li class="table-view-cell memo">
+                    <form class="input-group" id="order-form">
+                        <input type="text" class="order-memo" id="order-memo" placeholder="(备注)可填写附加要求">
+                    </form>
+                </li>
             </ul>
             <!-- 订单详情
             <ul class="table-view order-list">

部分文件因文件數量過多而無法顯示