enterprise.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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/bootstrap-3.3.7.min.js"></script>
  19. <!--修改title-->
  20. <script>
  21. $(function () {
  22. document.title = "壹管家";
  23. })
  24. </script>
  25. </head>
  26. <body ng-controller="myctrl">
  27. <div class="container" style="margin-top: 2rem">
  28. <form action="" method='post'
  29. class="container form-horizontal ng-valid ng-dirty ng-valid-parse" id='enterprise'
  30. style="margin-bottom: 15%; ">
  31. <!--姓名-->
  32. <div class="form-group">
  33. <label>姓名:</label>
  34. <input type="text" name='user_name' class="form-control username" placeholder="请输入您的姓名" ng-model="username">
  35. </div>
  36. <!--选择区域-->
  37. <div class="form-group">
  38. <label>选择区域:</label>
  39. <select name="area" class="form-control" ng-model="Area" ng-init="Area=AreaList[0].id"
  40. ng-options="info.name as info.name for info in AreaList" id="">
  41. <option value="">--请选择--</option>
  42. </select>
  43. </div>
  44. <!--房型-->
  45. <div class="form-group">
  46. <label>选择服务:</label>
  47. <select name="tech_content" class="form-control" ng-model="AechContent" ng-init="AechContent=AechContentList[0].id"
  48. ng-options="type.name as type.name for type in AechContentList" id="">
  49. <option value="">--请选择--</option>
  50. </select>
  51. </div>
  52. <!--手机号码-->
  53. <div class="form-group">
  54. <label>手机号码:</label>
  55. <input type="text" name="mobile" class="form-control"
  56. placeholder="请输入您的手机号码" ng-model="phone"/>
  57. </div>
  58. <!--性别-->
  59. <div class="form-group">
  60. <div style="display: inline-block;max-width: 100%;margin-bottom: 5px;font-weight: 700;">性别:</div>
  61. <div>
  62. <label class="radio-inline">
  63. <input type="radio" name="sex" value="先生" ng-model="sex">先生
  64. </label>
  65. <label class="radio-inline">
  66. <input type="radio" name="sex" value="女士" ng-model="sex">女士
  67. </label>
  68. </div>
  69. </div>
  70. <!--按钮-->
  71. <div class="form-group">
  72. <a id="enterpriseBtn"
  73. style="background: rgb(42,36,0);color:rgb(178,143,0);border: 0"
  74. class="btn btn-success col-xs-12"
  75. data-container="body"
  76. data-toggle="popover"
  77. data-placement="top"
  78. data-content="{{btnContent}}">
  79. 提交
  80. </a>
  81. </div>
  82. </div>
  83. </form>
  84. </div>
  85. <div class="prevent-scroll">
  86. <div class="box my-action">
  87. <!--首页-->
  88. <div class="width-percent-33">
  89. <div class="title-container-square">
  90. <a class="btn-home-action btn-action-my-order" href="/index.php?r=o2o/web/index">
  91. <div class="logo logo-my-order" style="margin-bottom: 0.5rem;"></div>
  92. <div class="name">首页</div>
  93. </a>
  94. </div>
  95. </div>
  96. <!--LOGO-->
  97. <div class="width-percent-33">
  98. <div class="title-container-square">
  99. <a class="btn-home-action btn-action-logo" href="/index.php?r=o2o/advisory/im">
  100. <div class="logo logo-my-logo"></div>
  101. </a>
  102. </div>
  103. </div>
  104. <!--我的-->
  105. <div class="width-percent-33">
  106. <div class="title-container-square">
  107. <a class="btn-home-action btn-action-coupon" href="/index.php?r=o2o/web/index">
  108. <div class="logo logo-coupon"style="margin-bottom: 0.5rem;"></div>
  109. <div class="name">我的</div>
  110. </a>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <!--模态框-->
  116. <div class="model" style="width: 100%;position: fixed;top: 0;background: rgba(0,0,0,0.4)">
  117. <!--错误提示容器-->
  118. <div class="model-box"
  119. style="border-radius: 10px;height:130px;display:none;width: 70%;background: #fff;margin: 0 auto;top:25%;left:15%;position: fixed;">
  120. <div class="model-title"
  121. style="font-family: '微软雅黑', 'Microsoft YaHei', 'STHeiti Light';width: 100%;text-align: center;font-size: 1.1rem;margin-top: 5%;"></div>
  122. <div class="model-content"
  123. 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>
  124. </div>
  125. </div>
  126. </body>
  127. </html>
  128. <script src="//cdn.bootcss.com/angular.js/1.4.3/angular.min.js"></script>
  129. <script>
  130. var myapp = angular.module('myapp', []);
  131. myapp.controller('myctrl', ['$scope', function ($scope) {
  132. $('.model-content').on('click', function () {
  133. if ($('.model-content').html() == '返回首页') {
  134. window.location.href = '/index.php?r=o2o/web/index';
  135. } else {
  136. $('.model').css('height', '0');
  137. $('.model-box').css('display', 'none');
  138. }
  139. });
  140. /*表单提交进行判断*/
  141. $('#enterpriseBtn').on('click', function () {
  142. /*姓名是否为空*/
  143. if ($scope.username == undefined) {
  144. model('请重填', '确认您的姓名');
  145. return false;
  146. }
  147. /*验证手机号码*/
  148. if (!(/^1[34578]\d{9}$/.test($scope.phone)) || $scope.phone == 0) {
  149. model('请重填', '手机号码有误');
  150. return false;
  151. }
  152. /*性别*/
  153. if ($scope.sex == undefined) {
  154. model('请重新选择', '确认');
  155. return false;
  156. }
  157. /*model*/
  158. $.ajax({
  159. url: 'index.php?r=o2o/Advisory/enterprise',
  160. type: 'POST',
  161. dataType: 'html',
  162. data: $('#enterprise').serialize(),
  163. success: function (message) {
  164. model(message,'返回首页');
  165. },
  166. error: function (message) {
  167. model('标题', '咨询失败');
  168. }
  169. });
  170. function model(title, content) {
  171. $('.model-box').css('display', 'inline');
  172. $('.model').height(window.screen.height);
  173. $('.model-title').html(title);
  174. $('.model-content').html(content);
  175. }
  176. }
  177. );
  178. $scope.AreaList = [
  179. {'id': 1, 'name': '跨多个区', 'parent': 1, type: '2'},
  180. {'id': 2, 'name': '黄浦区', 'parent': 1, type: '2'},
  181. {'id': 3, 'name': '徐汇区', 'parent': 1, type: '2'},
  182. {'id': 4, 'name': '长宁区', 'parent': 1, type: '2'},
  183. {'id': 5, 'name': '静安区', 'parent': 1, type: '2'},
  184. {'id': 6, 'name': '普陀区', 'parent': 1, type: '2'},
  185. {'id': 7, 'name': '虹口区', 'parent': 1, type: '2'},
  186. {'id': 8, 'name': '杨浦区', 'parent': 1, type: '2'},
  187. {'id': 9, 'name': '闵行区', 'parent': 1, type: '2'},
  188. {'id': 10, 'name': '宝山区', 'parent': 1, type: '2'},
  189. {'id': 11, 'name': '嘉定区', 'parent': 1, type: '2'},
  190. {'id': 12, 'name': '浦东新区', 'parent': 1, type: '2'},
  191. {'id': 13, 'name': '金山区', 'parent': 1, type: '2'},
  192. {'id': 14, 'name': '松江区', 'parent': 1, type: '2'},
  193. {'id': 15, 'name': '青浦区', 'parent': 1, type: '2'},
  194. {'id': 16, 'name': '奉贤区', 'parent': 1, type: '2'}
  195. ];
  196. $scope.AechContentList=[
  197. {'id': 1, 'name': '写字楼日常保洁', 'parent': 1, type: '3'},
  198. {'id': 2, 'name': '展会日常保洁', 'parent': 1, type: '3'},
  199. {'id': 3, 'name': '开荒保洁', 'parent': 1, type: '3'},
  200. {'id': 4, 'name': '地毯清洁', 'parent': 1, type: '3'},
  201. {'id': 5, 'name': '地板打蜡', 'parent': 1, type: '3'},
  202. {'id': 6, 'name': '沙发清洗', 'parent': 1, type: '3'},
  203. {'id': 7, 'name': '电器清洗', 'parent': 1, type: '3'},
  204. {'id': 8, 'name': '玻璃清洗', 'parent': 1, type: '3'},
  205. {'id': 9, 'name': '整体消毒', 'parent': 1, type: '3'},
  206. {'id': 10, 'name': '电器消毒', 'parent': 1, type: '3'},
  207. {'id': 11, 'name': '除尘除螨', 'parent': 1, type: '3'}
  208. ];
  209. }])
  210. </script>