SinglesDay.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <!DOCTYPE html>
  2. <!--HTML5 doctype-->
  3. <html ng-app="myapp">
  4. <head>
  5. <title>壹管家</title>
  6. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  7. <meta name="viewport"
  8. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
  11. <meta http-equiv="Pragma" content="no-cache">
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  13. <!--引入css文件-->
  14. <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/webapp/common/css/common.css">
  15. <link rel="stylesheet" href=" <?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap-3.3.7.min.css">
  16. <!--引入js文件-->
  17. <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-3.1.1.min.js"></script>
  18. <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/AngularJS v1.4.3.min.js"></script>
  19. <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/bootstrap-3.3.7.min.js"></script>
  20. <!--修改title-->
  21. <script>
  22. $(function () {
  23. document.title = "壹管家";
  24. })
  25. </script>
  26. </head>
  27. <body ng-controller="myctrl">
  28. <div class="">
  29. <form action="" method='post'
  30. class="container form-horizontal ng-valid ng-dirty ng-valid-parse" id='singlesDay'
  31. style="margin-bottom: 15%; ">
  32. <div class="container">
  33. <!--姓名-->
  34. <div class="form-group">
  35. <label>姓名:</label>
  36. <input type="text" name='user_name' class="form-control username" placeholder="请输入您的姓名" ng-model="username">
  37. </div>
  38. <!--选择区域-->
  39. <div class="form-group">
  40. <label>选择区域:</label>
  41. <select name="area" onchange="theforever(this.value)" class="form-control" ng-model="Area"
  42. ng-init="Area=AreaList[0].id"
  43. ng-options="info.name as info.name for info in AreaList" id="">
  44. <option value="">--请选择--</option>
  45. </select>
  46. </div>
  47. <!--房型-->
  48. <div class="form-group">
  49. <label>选择房型:</label>
  50. <select name="homeType" onchange="theforever(this.value)" class="form-control" ng-model="Type"
  51. ng-init="Type=TypeList[0].id"
  52. ng-options="type.name as type.name for type in TypeList" id="">
  53. <option value="">--请选择--</option>
  54. </select>
  55. </div>
  56. <!--房源套数-->
  57. <div class="form-group">
  58. <label>选择房源套数:</label>
  59. <select name="num" onchange="theforever(this.value)" class="form-control" ng-model="Num"
  60. ng-init="Num=NumList[0].id"
  61. ng-options="num.name as num.name for num in NumList" id="">
  62. <option value="">--请选择--</option>
  63. </select>
  64. </div>
  65. <!--手机号码-->
  66. <div class="form-group">
  67. <label>手机号码:</label>
  68. <input type="text" name="mobile" class="form-control"
  69. placeholder="请输入您的手机号码" ng-model="phone"/>
  70. </div>
  71. <!--性别-->
  72. <div class="form-group">
  73. <div style="display: inline-block;max-width: 100%;margin-bottom: 5px;font-weight: 700;">性别:</div>
  74. <div>
  75. <label class="radio-inline">
  76. <input type="radio" name="sex" value="先生" ng-model="sex">先生
  77. </label>
  78. <label class="radio-inline">
  79. <input type="radio" name="sex" value="女士" ng-model="sex">女士
  80. </label>
  81. </div>
  82. </div>
  83. <!--按钮-->
  84. <div class="form-group">
  85. <a id="SinglesDayBtn"
  86. style="background: rgb(42,36,0);color:rgb(178,143,0);border: 0"
  87. class="btn btn-success col-xs-12"
  88. data-container="body"
  89. data-toggle="popover"
  90. data-placement="top"
  91. data-content="{{btnContent}}">
  92. 提交
  93. </a>
  94. </div>
  95. </div>
  96. </form>
  97. </div>
  98. <div class="prevent-scroll">
  99. <div class="box my-action">
  100. <!--首页-->
  101. <div class="width-percent-33">
  102. <div class="title-container-square">
  103. <a class="btn-home-action btn-action-my-order" href="/index.php?r=o2o/web/index#">
  104. <div class="logo logo-my-order" style="margin-bottom: 5px;"></div>
  105. <div class="name">首页</div>
  106. </a>
  107. </div>
  108. </div>
  109. <!--LOGO-->
  110. <div class="width-percent-33">
  111. <div class="title-container-square">
  112. <a class="btn-home-action btn-action-logo" href="/index.php?r=o2o/advisory/im">
  113. <div class="logo logo-my-logo"></div>
  114. </a>
  115. </div>
  116. </div>
  117. <!--我的-->
  118. <div class="width-percent-33">
  119. <div class="title-container-square">
  120. <a class="btn-home-action btn-action-coupon">
  121. <div class="logo logo-coupon" style="margin-bottom: 5px;"></div>
  122. <div class="name">我的</div>
  123. </a>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <!--模态框-->
  129. <div class="model" style="width: 100%;position: fixed;top: 0;background: rgba(0,0,0,0.4)">
  130. <!--错误提示容器-->
  131. <div class="model-box"
  132. style="border-radius: 10px;height:130px;display:none;width: 70%;background: #fff;margin: 0 auto;top:25%;left:15%;position: fixed;">
  133. <div class="model-title"
  134. style="font-family: '微软雅黑', 'Microsoft YaHei', 'STHeiti Light';width: 100%;text-align: center;font-size: 1.1rem;margin-top: 5%;"></div>
  135. <div class="model-content"
  136. 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>
  137. </div>
  138. </div>
  139. </body>
  140. </html>
  141. <script>
  142. var myapp = angular.module('myapp', []);
  143. myapp.controller('myctrl', ['$scope', function ($scope) {
  144. $('.model-content').on('click', function () {
  145. if ($('.model-content').html() == '返回首页') {
  146. window.location.href = '/index.php?r=o2o/web/index';
  147. } else {
  148. $('.model').css('height', '0');
  149. $('.model-box').css('display', 'none');
  150. }
  151. });
  152. /*表单提交进行判断*/
  153. $('#SinglesDayBtn').on('click', function () {
  154. /*姓名是否为空*/
  155. if ($scope.username == undefined) {
  156. model('请重填', '确认您的姓名');
  157. return false;
  158. }
  159. /*验证手机号码*/
  160. if (!(/^1[34578]\d{9}$/.test($scope.phone)) || $scope.phone == 0) {
  161. model('请重填', '手机号码有误');
  162. return false;
  163. }
  164. /*性别*/
  165. if ($scope.sex == undefined) {
  166. model('请重新选择', '确认');
  167. return false;
  168. }
  169. /*model*/
  170. $.ajax({
  171. url: 'index.php?r=o2o/Advisory/SinglesDay',
  172. type: 'POST',
  173. dataType: 'html',
  174. data: $('#singlesDay').serialize(),
  175. success: function (message) {
  176. model(message,'返回首页');
  177. },
  178. error: function (message) {
  179. model('标题', '咨询失败');
  180. }
  181. });
  182. function model(title, content) {
  183. $('.model-box').css('display', 'inline');
  184. $('.model').height(window.screen.height);
  185. $('.model-title').html(title);
  186. $('.model-content').html(content);
  187. }
  188. }
  189. );
  190. $scope.AreaList = [
  191. {'id': 1, 'name': '跨多个区', 'parent': 1, type: '2'},
  192. {'id': 2, 'name': '黄浦区', 'parent': 1, type: '2'},
  193. {'id': 3, 'name': '徐汇区', 'parent': 1, type: '2'},
  194. {'id': 4, 'name': '长宁区', 'parent': 1, type: '2'},
  195. {'id': 5, 'name': '静安区', 'parent': 1, type: '2'},
  196. {'id': 6, 'name': '普陀区', 'parent': 1, type: '2'},
  197. {'id': 7, 'name': '虹口区', 'parent': 1, type: '2'},
  198. {'id': 8, 'name': '杨浦区', 'parent': 1, type: '2'},
  199. {'id': 9, 'name': '闵行区', 'parent': 1, type: '2'},
  200. {'id': 10, 'name': '宝山区', 'parent': 1, type: '2'},
  201. {'id': 11, 'name': '嘉定区', 'parent': 1, type: '2'},
  202. {'id': 12, 'name': '浦东新区', 'parent': 1, type: '2'},
  203. {'id': 13, 'name': '金山区', 'parent': 1, type: '2'},
  204. {'id': 14, 'name': '松江区', 'parent': 1, type: '2'},
  205. {'id': 15, 'name': '青浦区', 'parent': 1, type: '2'},
  206. {'id': 16, 'name': '奉贤区', 'parent': 1, type: '2'}
  207. ];
  208. $scope.TypeList = [
  209. {'id': 1, 'name': '一户室', 'parent': 1, type: '3'},
  210. {'id': 2, 'name': '两户室', 'parent': 1, type: '3'},
  211. {'id': 3, 'name': '三户及以上', 'parent': 1, type: '3'},
  212. {'id': 4, 'name': '单间', 'parent': 1, type: '3'},
  213. {'id': 5, 'name': '多套多房型', 'parent': 1, type: '3'},
  214. ];
  215. $scope.NumList = [
  216. {'id': 1, 'name': '整房三套以下', 'parent': 1, type: '4'},
  217. {'id': 2, 'name': '整房三套以上', 'parent': 1, type: '4'},
  218. {'id': 3, 'name': '多套单间', 'parent': 1, type: '4'}
  219. ]
  220. }])
  221. </script>