Ver Fonte

定点支付

洪海涛 há 8 anos atrás
pai
commit
14aaba84de

+ 8 - 1
www/protected/modules/common/controllers/ActivityController.php

@@ -38,7 +38,14 @@ class ActivityController extends O2oBaseController
     $this->redirect('http://common.yiguanjia.me/index.php?r=o2o/web/index');
     //$this->renderpartial('//protected/modules/o2o/Web');
   }
-
+  //名宿保洁
+  public function actionSinglesDay(){
+    $this->render('SinglesDay');
+  }
+//企业服务
+  public function actionEnterprise(){
+    $this->render('Enterprise');
+  }
   //扫码获取代金券
   public function actionGetCoupon()
   {

+ 202 - 0
www/protected/modules/common/views/activity/enterprise.php

@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!--HTML5 doctype-->
+<html ng-app="myapp">
+<head>
+  <title>壹管家</title>
+  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+  <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
+  <meta name="apple-mobile-web-app-capable" content="yes">
+  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
+  <meta http-equiv="Pragma" content="no-cache">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <!--引入css文件-->
+  <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/webapp/o2o/dist/css/main.css?v=2016032401">
+  <link rel="stylesheet" href=" <?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap-3.3.7.min.css">
+  <!--引入js文件-->
+  <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-3.1.1.min.js"></script>
+  <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/AngularJS v1.4.3.min.js"></script>
+  <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/bootstrap-3.3.7.min.js"></script>
+
+</head>
+<body ng-controller="myctrl">
+<div class="">
+  <!--  <img style="width: 100%"-->
+  <!--       src="http://odulvej8l.bkt.clouddn.com/%E6%B0%91%E5%AE%BF%E4%BF%9D%E6%B4%81%E8%AF%A6%E6%83%85%E9%A1%B5.jpg"-->
+  <!--       alt="">-->
+  <h1></h1>
+  <form action="index.php?r=common/Activity/ScanCoupon" method='post'
+        class="container  form-horizontal  ng-valid ng-dirty ng-valid-parse" style="margin-bottom: 15%; ">
+    <div class="container">
+      <!--姓名-->
+      <div class="form-group">
+        <label>姓名:</label>
+        <input type="text" name='name' class="form-control username" placeholder="请输入您的姓名" ng-model="username">
+      </div>
+      <!--选择区域-->
+      <div class="form-group">
+        <label>选择区域:</label>
+        <select name="area" class="form-control" ng-model="Area" ng-init="Area=AreaList[0].id"
+                ng-options="info.id as info.name for info in AreaList" id="">
+          <option value="">--请选择--</option>
+        </select>
+      </div>
+      <!--房型-->
+      <div class="form-group">
+        <label>选择房型:</label>
+        <select name="type" class="form-control" ng-model="Type" ng-init="Type=TypeList[0].id"
+                ng-options="type.id as type.name for type in TypeList" id="">
+          <option value="">--请选择--</option>
+        </select>
+      </div>
+      <!--房源套数-->
+      <div class="form-group">
+        <label>选择房源套数:</label>
+        <select name="num" class="form-control" ng-model="Num" ng-init="Num=NumList[0].id"
+                ng-options="num.id as num.name for num in NumList" id="">
+          <option value="">--请选择--</option>
+        </select>
+      </div>
+      <!--手机号码-->
+      <div class="form-group">
+        <label>手机号码:</label>
+        <input type="text" name="phone" class="form-control"
+               placeholder="请输入您的手机号码" ng-model="phone"/>
+      </div>
+      <h2 style="text-align: center">你好</h2>
+      <!--性别-->
+      <div class="form-group">
+        <div style="display: inline-block;max-width: 100%;margin-bottom: 5px;font-weight: 700;">性别:</div>
+        <div>
+          <label class="radio-inline">
+            <input type="radio" name="sex" value="男" ng-model="sex">男
+          </label>
+          <label class="radio-inline">
+            <input type="radio" name="sex" value="女" ng-model="sex">女
+          </label>
+        </div>
+      </div>
+      <!--按钮-->
+      <div class="form-group">
+        <button
+          style="background: rgb(42,36,0);color:rgb(178,143,0);border: 0"
+          class="btn btn-success col-xs-12"
+          data-container="body"
+          data-toggle="popover"
+          data-placement="top"
+          data-content="{{btnContent}}">
+          提交
+        </button>
+      </div>
+    </div>
+  </form>
+</div>
+<div class="prevent-scroll">
+  <div class="box my-action">
+    <!--首页-->
+    <div class="width-percent-33">
+      <div class="title-container-square">
+        <a class="btn-home-action btn-action-my-order" href="/index.php?r=o2o/web/index#">
+          <div class="logo logo-my-order"></div>
+          <div class="name">首页</div>
+        </a>
+      </div>
+    </div>
+    <!--LOGO-->
+    <div class="width-percent-33">
+      <div class="title-container-square">
+        <a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
+          <div class="logo logo-my-logo"></div>
+        </a>
+      </div>
+    </div>
+    <!--我的-->
+    <div class="width-percent-33">
+      <div class="title-container-square">
+        <a class="btn-home-action btn-action-coupon">
+          <div class="logo logo-coupon"></div>
+          <div class="name">我的</div>
+        </a>
+      </div>
+    </div>
+  </div>
+</div>
+<!--模态框-->
+<div class="model" style="width: 100%;position: fixed;top: 0;background: rgba(0,0,0,0.4)">
+  <!--错误提示容器-->
+  <div class="model-box"
+       style="border-radius: 10px;height:130px;display:none;width: 70%;background: #fff;margin: 0 auto;top:25%;left:15%;position: fixed;">
+    <div class="model-title"
+         style="font-family: '微软雅黑', 'Microsoft YaHei', 'STHeiti Light';width: 100%;text-align: center;font-size: 2.2rem;margin-top: 5%;"></div>
+    <div class="model-content"
+         style="font-family: '微软雅黑', 'Microsoft YaHei', 'STHeiti Light';margin: 0 auto;width: 80%;background: rgb(42,36,0);color:rgb(178,143,0);font-size: 1.3rem;margin-top: 30px;text-align: center;padding: 5px 0 5px 0"></div>
+  </div>
+</div>
+</body>
+</html>
+<script>
+  var myapp = angular.module('myapp', []);
+  myapp.controller('myctrl', ['$scope', function ($scope) {
+    $('.model-content').on('click', function () {
+      $('.model').css('height', '0');
+      $('.model-box').css('display', 'none');
+    });
+    /*表单提交进行判断*/
+    $('button').on('click', function () {
+        /*姓名是否为空*/
+        if ($scope.username == undefined) {
+          model('请重填', '确认您的姓名');
+          return false;
+        }
+        /*验证手机号码*/
+        if (!(/^1[34578]\d{9}$/.test($scope.phone)) || $scope.phone == 0) {
+          model('请重填', '手机号码有误');
+          return false;
+        }
+        /*性别*/
+        if ($scope.sex == undefined) {
+          model('请重新选择', '确认');
+          return false;
+        }
+        /*model*/
+        function model(title, content) {
+          $('.model-box').css('display', 'inline');
+          $('.model').height(window.screen.height);
+          $('.model-title').html(title);
+          $('.model-content').html(content);
+        }
+      }
+    );
+
+    $scope.AreaList = [
+      {'id': 1, 'name': '跨多个区', 'parent': 1, type: '2'},
+      {'id': 2, 'name': '黄浦区', 'parent': 1, type: '2'},
+      {'id': 3, 'name': '徐汇区', 'parent': 1, type: '2'},
+      {'id': 4, 'name': '长宁区', 'parent': 1, type: '2'},
+      {'id': 5, 'name': '静安区', 'parent': 1, type: '2'},
+      {'id': 6, 'name': '普陀区', 'parent': 1, type: '2'},
+      {'id': 7, 'name': '虹口区', 'parent': 1, type: '2'},
+      {'id': 8, 'name': '杨浦区', 'parent': 1, type: '2'},
+      {'id': 9, 'name': '闵行区', 'parent': 1, type: '2'},
+      {'id': 10, 'name': '宝山区', 'parent': 1, type: '2'},
+      {'id': 11, 'name': '嘉定区', 'parent': 1, type: '2'},
+      {'id': 12, 'name': '浦东新区', 'parent': 1, type: '2'},
+      {'id': 13, 'name': '金山区', 'parent': 1, type: '2'},
+      {'id': 14, 'name': '松江区', 'parent': 1, type: '2'},
+      {'id': 15, 'name': '青浦区', 'parent': 1, type: '2'},
+      {'id': 16, 'name': '奉贤区', 'parent': 1, type: '2'}
+    ];
+    $scope.TypeList=[
+      {'id': 1, 'name': '一户室', 'parent': 1, type: '3'},
+      {'id': 2, 'name': '两户室', 'parent': 1, type: '3'},
+      {'id': 3, 'name': '三户及以上', 'parent': 1, type: '3'},
+      {'id': 4, 'name': '单间', 'parent': 1, type: '3'},
+      {'id': 5, 'name': '多套多房型', 'parent': 1, type: '3'},
+    ];
+    $scope.NumList=[
+      {'id': 1, 'name': '整房三套以下', 'parent': 1, type: '4'},
+      {'id': 2, 'name': '整房三套以上', 'parent': 1, type: '4'},
+      {'id': 3, 'name': '多套单间', 'parent': 1, type: '4'}
+    ]
+  }])
+</script>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
www/webapp/o2o/dist/js/main.js


+ 1 - 1
www/webapp/o2o/dist/js/page/homeenterprise.js

@@ -1 +1 @@
-define(["$","template","IScroll","user","product","native","config","address"],function(e,t,n,r,i,s,o,u){function a(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"企业服务",body:"",init:function(t,n){var i=this,s=e(document);i.on("swipeRight",function(e){a.call(this,e)}),e.newTouch(".back-button",function(e){a.call(this,e)},i),i.on("tapBackButton",function(e){a.call(this,e)}),e.newTouch(".o2o-btn-homestay",function(e){e.preventDefault(),window.location.href="/index.php?r=common/activity/ScanCoupon"},i),e.newTouch(".btn-action-my-order",function(){event.preventDefault(),s.trigger("spa:navigate",{hash:"",pushData:{needReset:!0}})},i),e.newTouch(".btn-action-coupon",function(e){e.preventDefault(),r.checkLogin(function(){s.trigger("spa:navigate",{hash:"mine",pushData:{needReset:!0}})})},i),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(r,i){var s=this,u=e(document);if(r.pushData&&r.pushData.needReset){var a=t("homeenterprise/index",{showNavBar:!o.isWX});e(".spa-page-body",s).html(a),setTimeout(function(){r.scroll=new n("#homeenterpriseScroll")},500)}i.resolve()},beforeclose:function(e,t){t.resolve()}}});
+define(["$","template","IScroll","user","product","native","config","address"],function(e,t,n,r,i,s,o,u){function a(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"企业服务",body:"",init:function(t,n){var i=this,s=e(document);i.on("swipeRight",function(e){a.call(this,e)}),e.newTouch(".back-button",function(e){a.call(this,e)},i),i.on("tapBackButton",function(e){a.call(this,e)}),e.newTouch(".o2o-btn-homestay",function(e){e.preventDefault(),window.location.href="/index.php?r=common/activity/Enterprise"},i),e.newTouch(".btn-action-my-order",function(){event.preventDefault(),s.trigger("spa:navigate",{hash:"",pushData:{needReset:!0}})},i),e.newTouch(".btn-action-coupon",function(e){e.preventDefault(),r.checkLogin(function(){s.trigger("spa:navigate",{hash:"mine",pushData:{needReset:!0}})})},i),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(r,i){var s=this,u=e(document);if(r.pushData&&r.pushData.needReset){var a=t("homeenterprise/index",{showNavBar:!o.isWX});e(".spa-page-body",s).html(a),setTimeout(function(){r.scroll=new n("#homeenterpriseScroll")},500)}i.resolve()},beforeclose:function(e,t){t.resolve()}}});

+ 1 - 1
www/webapp/o2o/dist/js/page/homestay.js

@@ -1 +1 @@
-define(["$","template","IScroll","user","product","native","config","address"],function(e,t,n,r,i,s,o,u){function a(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"家庭保洁",body:"",init:function(t,n){var s=this,o=e(document);s.on("swipeRight",function(e){a.call(this,e)}),e.newTouch(".back-button",function(e){a.call(this,e)},s),s.on("tapBackButton",function(e){a.call(this,e)}),e.newTouch(".o2o-btn-homestay",function(e){e.preventDefault(),window.location.href="/index.php?r=common/activity/ScanCoupon"},s),e.newTouch(".btn-product",function(t){t.preventDefault();var n=parseInt(e(this).attr("data-product-type"));o.trigger("spa:navigate",{hash:"placeOrder",pushData:{product:i.allList[n-1],needReset:!0}})},s),e.newTouch(".btn-action-my-order",function(){event.preventDefault(),o.trigger("spa:navigate",{hash:"",pushData:{needReset:!0}})},s),e.newTouch(".btn-action-coupon",function(e){e.preventDefault(),r.checkLogin(function(){o.trigger("spa:navigate",{hash:"mine",pushData:{needReset:!0}})})},s),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(r,i){var s=this,u=e(document);if(r.pushData&&r.pushData.needReset){var a=t("homestay/index",{showNavBar:!o.isWX});e(".spa-page-body",s).html(a),setTimeout(function(){r.scroll=new n("#homestayScroll")},500)}i.resolve()},beforeclose:function(e,t){t.resolve()}}});
+define(["$","template","IScroll","user","product","native","config","address"],function(e,t,n,r,i,s,o,u){function a(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"家庭保洁",body:"",init:function(t,n){var s=this,o=e(document);s.on("swipeRight",function(e){a.call(this,e)}),e.newTouch(".back-button",function(e){a.call(this,e)},s),s.on("tapBackButton",function(e){a.call(this,e)}),e.newTouch(".o2o-btn-homestay",function(e){e.preventDefault(),window.location.href="/index.php?r=common/activity/SinglesDay"},s),e.newTouch(".btn-product",function(t){t.preventDefault();var n=parseInt(e(this).attr("data-product-type"));o.trigger("spa:navigate",{hash:"placeOrder",pushData:{product:i.allList[n-1],needReset:!0}})},s),e.newTouch(".btn-action-my-order",function(){event.preventDefault(),o.trigger("spa:navigate",{hash:"",pushData:{needReset:!0}})},s),e.newTouch(".btn-action-coupon",function(e){e.preventDefault(),r.checkLogin(function(){o.trigger("spa:navigate",{hash:"mine",pushData:{needReset:!0}})})},s),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(r,i){var s=this,u=e(document);if(r.pushData&&r.pushData.needReset){var a=t("homestay/index",{showNavBar:!o.isWX});e(".spa-page-body",s).html(a),setTimeout(function(){r.scroll=new n("#homestayScroll")},500)}i.resolve()},beforeclose:function(e,t){t.resolve()}}});

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
www/webapp/o2o/dist/js/page/placeOrder.js


+ 1 - 1
www/webapp/o2o/js/page/homeenterprise.js

@@ -46,7 +46,7 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
             });
             $.newTouch('.o2o-btn-homestay',function (event) {
                 event.preventDefault();
-                window.location.href='/index.php?r=common/activity/ScanCoupon';
+                window.location.href='/index.php?r=common/activity/Enterprise';
                 // console.log('测试')
             },$view);
             /*首页*/

+ 1 - 1
www/webapp/o2o/js/page/homestay.js

@@ -46,7 +46,7 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
 			});
 			$.newTouch('.o2o-btn-homestay',function (event) {
 				event.preventDefault();
-				window.location.href='/index.php?r=common/activity/ScanCoupon';
+				window.location.href='/index.php?r=common/activity/SinglesDay';
 				// console.log('测试')
 			},$view);
 			

+ 66 - 12
www/webapp/o2o/js/page/placeOrder.js

@@ -29,7 +29,6 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
 					callback();
 				}
 			}, 50);
-
 			pageData.scrollCheckAutoCancel = setTimeout(function () {
 				clearInterval(pageData.scrollCheck);
 
@@ -58,7 +57,6 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
 		var placeOrderScroll;
 		setTimeout(function () {
 			pageData.scroll = new IScroll('#placeOrderScroll');
-
 		}, 50);
 	}
 
@@ -251,13 +249,13 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
 				var pushData = pageData.pushData;
 				back.call(this, pushData['backHash']);
 			});
-/*setTimeOut*/
+			/*setTimeOut*/
 			setInterval(function () {
 				if (product.name == "活动产品") {
 					$('.show-time-picker').css('display', 'none');
-					$('.o2o-singles-day').css('display','inline');
+					$('.o2o-singles-day').css('display', 'inline');
 				}
-			},50);
+			}, 50);
 			/* 点击查看详情。跳转到product页面 */
 			$.newTouch('.product-pic-o2o', function (event) {
 				$doc.trigger('spa:navigate', {
@@ -268,15 +266,9 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
 					}
 				});
 			}, $view);
-
 			/*特效*/
 			setInterval(function run() {
 				$('.product-img').fadeToggle();
-				/*if (product.name == "活动产品") {
-					$('.o2o-height').css('padding-bottom','25%')
-					$('.show-time-picker').css('display', 'none');
-					$('.o2o-singles-day').css('display','inline');
-				}*/
 			}, 500);
 
 			/* 点击选择extra。 */
@@ -681,7 +673,7 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
 			}, $view);
 
 			/* 点击选择优惠券 */
-			$.newTouch('.show-coupon-picker', function (event) {
+		/*	$.newTouch('.show-coupon-picker', function (event) {
 				if ($(this).hasClass('disabled')) return;
 				event.preventDefault();
 
@@ -703,6 +695,67 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
 					return;
 				}
 
+				// 跳转到picker页面,展示优惠券
+				$doc.trigger('spa:navigate', {
+					hash: 'picker',
+					pushData: {
+						title: '选择优惠券',
+						backHash: 'placeOrder',
+						products: JSON.stringify([{
+							product_id: order.productID,
+							count: order.productCount
+						}]),
+						time: order.bookingDate + ' ' + order.bookingTime + ':00',
+						type: order.productType,
+						extraJson: extraJson
+					},
+					callback: {
+						// 在picker页面挑选之后,回到这个页面时执行的回调。pickValue:选中的优惠券的ID;
+						onSelect: function (pickValue) {
+							if (pickValue == '') {
+								$('.coupon-selected-name', $view).text('不使用');
+								order.couponValue = 0;
+							} else {
+								for (var i in user.orderCoupons) {
+									var couponInfo = user.orderCoupons[i];
+									if (couponInfo.id == pickValue) {
+										$('.coupon-selected-name', $view).text(couponInfo['coupon']['name']);
+										order.couponValue = couponInfo['coupon']['value'];
+										break;
+									}
+								}
+							}
+							// 填写order
+							order.couponID = pickValue;
+							// 计算总费用
+							payCharge($('.order-cost', $view));
+						}
+					}
+				});
+			}, $view);*/
+			/* 点击选择优惠券 */
+			$.newTouch('.show-coupon-picker', function (event) {
+				if ($(this).hasClass('disabled')) return;
+				event.preventDefault();
+
+				var extraJson = '';
+				if (product.extra && !order.appendID) {
+					$doc.trigger('spa:openpanel', ['simpleAlert', {
+						message: '请选择服务'
+					}]);
+					return;
+				} else {
+					extraJson = JSON.stringify([{type: order.appendID, price: order.price}]);
+				}
+
+				// 必须先选择时间
+				if (!order.bookingDate) {
+					$doc.trigger('spa:openpanel', ['simpleAlert', {
+						message: '请选择服务时间'
+					}]);
+					return;
+				}
+
 				// 跳转到picker页面,展示优惠券
 				$doc.trigger('spa:navigate', {
 					hash: 'picker',
@@ -742,6 +795,7 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
 				});
 			}, $view);
 
+
 			/* 是否选中同意用户协议,关系到下订单按钮是否激活 */
 			$.newTouch('.agreement-touch-area', function (event) {
 				var agreementObj = $('.agreement-checkbox', $view);

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff