فهرست منبع

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

north 8 سال پیش
والد
کامیت
cd3d69438b

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/moonclub/dist/js/build/template.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/moonclub/dist/js/main.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/moonclub/dist/js/page/employe.js


+ 1 - 1
www/webapp/moonclub/dist/js/page/modeifyStatus.js

@@ -1 +1 @@
-define(["$","template","native","config","user","api"],function(e,t,n,r,i,s){function o(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}function f(t,n){e(".model-box").css("display","inline"),e(".model").css("bottom","0"),e(".model-title").html(t),e(".model-content").html(n);return}var u={},a=[];return{title:"雇员",body:"",init:function(t,n){var r=this,i=e(document);r.on("swipeRight",function(e){o.call(this,e)}),e.newTouch(".back-button",function(e){o.call(this,e)},r),r.on("tapBackButton",function(e){o.call(this,e)}),e.newTouch("#submit",function(t){t.preventDefault();var n=e(".user-auth").val();s.getModifyStatus({auth:u.auth,_id:a.id,status:n},function(e){e.success&&console.log(e.data)})},r),n.resolve()},beforeopen:function(n,r){var i=this,s=e(document);u=n.pushData.authArr,a=n.pushData.listArr,console.log(a),s.trigger("spa:openloader");if(s){s.trigger("spa:closeloader");var o=t("employe/modeifyStatus",{authArr:u,listArr:a});e(".spa-page-body",i).html(o)}r.resolve()},afteropen:function(e,t){t.resolve()},beforeclose:function(e,t){t.resolve()}}});
+define(["$","template","native","config","user","api"],function(e,t,n,r,i,s){function o(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}function l(t,n){e(".model-box").css("display","inline"),e(".model").css("bottom","0"),e(".model-title").html(t),e(".model-content").html(n);return}var u={},a=[],f={0:"未预约",1:"已预约",2:"已结束"};return{title:"雇员",body:"",init:function(t,n){var r=this,i=e(document);r.on("swipeRight",function(e){o.call(this,e)}),e.newTouch(".back-button",function(e){o.call(this,e)},r),r.on("tapBackButton",function(e){o.call(this,e)}),e.newTouch("#submit",function(t){t.preventDefault();var n=parseInt(e(".user-auth").val());n===5?l("当前订单已经结束,不可修改状态","确定"):s.getModifyStatus({auth:u.auth,_id:a.id,status:n},function(e){e.success&&l("订单状态修改成功,请及时处理!","确定")})},r),e.newTouch(".model-content",function(t){var n=e(".model-title")[0].innerHTML;e(".model").css("bottom",""),e(".model-box").css("display","none"),i.trigger("spa:navigate",{hash:"service-info",pushData:{needReload:!0}})},r),n.resolve()},beforeopen:function(n,r){var i=this,s=e(document);u=n.pushData.authArr,a=n.pushData.listArr,console.log(a);var o={index:"",title:""};parseInt(a.status)===2?(o.index=5,o.title="暂无可选状态"):(o.index=parseInt(a.status)+1,o.title=f[parseInt(a.status)+1]),console.log(o),s.trigger("spa:openloader");if(s){s.trigger("spa:closeloader");var l=t("employe/modeifyStatus",{authArr:u,listArr:a,status:o});e(".spa-page-body",i).html(l)}r.resolve()},afteropen:function(e,t){t.resolve()},beforeclose:function(e,t){t.resolve()}}});

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/moonclub/js/build/template.js


+ 74 - 50
www/webapp/moonclub/js/page/employe.js

@@ -1,4 +1,4 @@
-define(['$', 'template',  'native', 'config', 'user',  'api'], function ($, template, native, config, user, api) {
+define(['$', 'template', 'native', 'config', 'user', 'api'], function ($, template, native, config, user, api) {
 
   /*
   user_id;//user_id
@@ -17,6 +17,7 @@ define(['$', 'template',  'native', 'config', 'user',  'api'], function ($, temp
   auth;//角色 中医/营养师/保洁师/月嫂/催乳师/配送师
   desc;//备注
   */
+
   // 返回事件
   function back(event) {
     event.preventDefault();
@@ -61,13 +62,13 @@ define(['$', 'template',  'native', 'config', 'user',  'api'], function ($, temp
         event.preventDefault();
         // 用户id
         var user_id = user.id;
-        if(user_id === ''){
+        if (user_id === '') {
           model('您的信息识别码有误,请重新扫描二维码,进入本页面!', '确定');
           return;
         }
         // 用户姓名
         var name = $(".user-name").val();
-        if(name === ''){
+        if (name === '') {
           model('请重新输入您的姓名!', '确定');
           return;
         }
@@ -81,69 +82,69 @@ define(['$', 'template',  'native', 'config', 'user',  'api'], function ($, temp
         }
         // 出生日期
         var num = $(".user-num").val();
-        if(num === ''){
+        if (num === '') {
           model('请选择出生日期!', '确定');
           return;
         }
         // 身份证
         var card_id = $(".card-id").val();
-        if ($.checkID(card_id) !== true){
+        if ($.checkID(card_id) !== true) {
           model($.checkID(card_id), '确定');
           return;
         }
         // 地址
         var userAddress = $(".user-address").val();
         console.log('地址:' + userAddress);
-        if (userAddress === ''){
+        if (userAddress === '') {
           model('请输入地址!', '确定');
           return;
         }
         // 手机号码
         var mobile = $(".user-mobile").val();
-        if(!(/^1[34578]\d{9}$/.test(mobile)) || mobile == 0 || mobile === ''){
+        if (!(/^1[34578]\d{9}$/.test(mobile)) || mobile == 0 || mobile === '') {
           model('请输入正确的手机号!', '确定');
           return;
         }
         // 所属机构
         var mechanism = $(".user-mechanism").val();
-        if(mechanism === ''){
-          model('所属机构不为空!','确定')
+        if (mechanism === '') {
+          model('所属机构不为空!', '确定')
           return;
         }
         // 学历
         var education = $(".user-education").val();
-        if(education === ''){
-          model('学历不为空!','确定')
+        if (education === '') {
+          model('学历不为空!', '确定')
           return;
         }
         // 证书
         var certificate = $(".user-certificate").val();
-        if(certificate === ''){
-          model('证书不为空!','确定')
+        if (certificate === '') {
+          model('证书不为空!', '确定')
           return;
         }
         // 工种
         var type_of_work = $(".type-of-work").val();
-        if(type_of_work === ''){
-          model('工种不为空!','确定')
+        if (type_of_work === '') {
+          model('工种不为空!', '确定')
           return;
         }
         // 技能
         var skill = $(".user-skill").val();
-        if(skill === ''){
-          model('技能不为空!','确定')
+        if (skill === '') {
+          model('技能不为空!', '确定')
           return;
         }
         // 工作年限
         var work_year = $('.user-work-year').val();
-        if(work_year === ''){
-          model('工作年限不为空!','确定')
+        if (work_year === '') {
+          model('工作年限不为空!', '确定')
           return;
         }
         // 角色
         var auth = $('.user-auth').val();
-        if(auth === 0){
-          model('请选择角色!','确定')
+        if (auth === 0) {
+          model('请选择角色!', '确定')
           return;
         }
         // 备注
@@ -164,20 +165,26 @@ define(['$', 'template',  'native', 'config', 'user',  'api'], function ($, temp
           work_year: work_year,
           auth: auth,
           desc: desc
-        },function (res) {
+        }, function (res) {
           console.log(res)
-          if(res.success){
-            model('提交成功!','确定')
+          if (res.success) {
+            model('提交成功!', '确定')
           } else {
-            model('提交失败!','确定')
+            model(res.message, '确定')
           }
         })
-      },$view)
+      }, $view)
 
       // 模态框
       $.newTouch('.model-content', function (event) {
-        if ($('.model-title')[0].innerHTML === '成功了棒棒哒∪0∪') {
-          location.href="http://common.yiguanjia.me/index.php?r=moonclub/web/index";
+        var title = $('.model-title')[0].innerHTML;
+        if (title === '提交成功!') {
+          $doc.trigger('spa:navigate', {
+            hash: 'service-info',
+            pushData: {
+              needReload: true
+            }
+          });
         }
         $('.model').css('bottom', '');
         $('.model-box').css('display', 'none');
@@ -188,28 +195,45 @@ define(['$', 'template',  'native', 'config', 'user',  'api'], function ($, temp
     beforeopen: function (pageData, dtd) {
       var $view = this;
       var $doc = $(document);
-      api.GetAuthinfo({},function (res) {
-        if (res.success) {
-          $doc.trigger('spa:openloader');
-          if ($doc) {
-            $doc.trigger('spa:closeloader');
-            var tpl = template('employe/index',{
-              authInfo: res.data
-            });
-            $('.spa-page-body', $view).html(tpl);
-            setTimeout(function () {
-              var calendar = new LCalendar();
-              calendar.init({
-                'trigger': '#demo1', //标签id
-                'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
-                'minDate': '1900-1-1', //最小日期
-                'maxDate': (new Date().getFullYear() + 10) + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate() //最大日期
-              });
-              // pageData.scroll = new IScroll('#employeScroll');
-            }, 700);
-          }
-        }
-      });
+      // 判断雇员是否注册过
+      api.getQueryPersonalInfo({
+        user_id: user.id
+      }, function (res) {
+        // 已注册前往订单列表
+        if (res.message === '已经注册过') {
+          $doc.trigger('spa:navigate', {
+            hash: 'service-info',
+            pushData: {
+              needReload: true
+            }
+          });
+        } else {
+          // 获取角色信息表
+          api.GetAuthinfo({}, function (res) {
+            if (res.success) {
+              $doc.trigger('spa:openloader');
+              if ($doc) {
+                $doc.trigger('spa:closeloader');
+                var tpl = template('employe/index', {
+                  authInfo: res.data
+                });
+                // 渲染页面
+                $('.spa-page-body', $view).html(tpl);
+                setTimeout(function () {
+                  var calendar = new LCalendar();
+                  calendar.init({
+                    'trigger': '#demo1', //标签id
+                    'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
+                    'minDate': '1900-1-1', //最小日期
+                    'maxDate': (new Date().getFullYear() + 10) + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate() //最大日期
+                  });
+                  // pageData.scroll = new IScroll('#employeScroll');
+                }, 700);
+              }
+            }
+          });
+        }
+      })
       dtd.resolve();
     },
     afteropen: function (pageData, dtd) {

+ 46 - 13
www/webapp/moonclub/js/page/modeifyStatus.js

@@ -12,6 +12,11 @@ define(['$', 'template', 'native', 'config', 'user', 'api'], function ($, templa
 
   var authArr = {}
   var listArr = []
+  var statusArr = {
+    0: '未预约',
+    1: '已预约',
+    2: '已结束'
+  }
 
   // 调用模态框
   function model(title, content) {
@@ -44,18 +49,34 @@ define(['$', 'template', 'native', 'config', 'user', 'api'], function ($, templa
 
       $.newTouch('#submit', function (event) {
         event.preventDefault();
-        var auth = $('.user-auth').val();
-        api.getModifyStatus({
-          auth: authArr.auth,
-          _id: listArr.id,
-          status: auth
-        }, function (res) {
-          if (res.success) {
-            console.log(res.data)
-          }
-        })
+        var auth = parseInt($('.user-auth').val());
+        if (auth === 5) {
+          model('当前订单已经结束,不可修改状态', '确定')
+        } else {
+          api.getModifyStatus({
+            auth: authArr.auth,
+            _id: listArr.id,
+            status: auth
+          }, function (res) {
+            if (res.success) {
+              model('订单状态修改成功,请及时处理!','确定')
+            }
+          })
+        }
       }, $view)
 
+      // 模态框
+      $.newTouch('.model-content', function (event) {
+        var title = $('.model-title')[0].innerHTML;
+        $('.model').css('bottom', '');
+        $('.model-box').css('display', 'none');
+        $doc.trigger('spa:navigate', {
+          hash: 'service-info',
+          pushData: {
+            needReload: true
+          }
+        });
+      }, $view)
       dtd.resolve();
     },
     beforeopen: function (pageData, dtd) {
@@ -63,14 +84,26 @@ define(['$', 'template', 'native', 'config', 'user', 'api'], function ($, templa
       var $doc = $(document);
       authArr = pageData.pushData.authArr
       listArr = pageData.pushData.listArr
-
-      console.log(listArr)
+      console.log(listArr);
+      var status = {
+        index: '',
+        title: ''
+      }
+      if (parseInt(listArr.status) === 2) {
+        status.index = 5
+        status.title = '暂无可选状态'
+      } else {
+        status.index = parseInt(listArr.status) + 1
+        status.title = statusArr[parseInt(listArr.status) + 1]
+      }
+      console.log(status)
       $doc.trigger('spa:openloader');
       if ($doc) {
         $doc.trigger('spa:closeloader');
         var tpl = template('employe/modeifyStatus', {
           authArr: authArr,
-          listArr: listArr
+          listArr: listArr,
+          status: status
         });
         $('.spa-page-body', $view).html(tpl);
       }

+ 1 - 11
www/webapp/moonclub/tpl/employe/index.html

@@ -100,14 +100,4 @@
   </div>
 </div>
 
-<!--模态框-->
-<div class="model" style="width: 100%;position: fixed;top: 0;left:0;background: rgba(0,0,0,0.4)">
-  <!--错误提示容器-->
-  <div class="model-box"
-       style="border-radius: 10px;min-height: 80px;display:none;width: 70%;background: #fff;margin: 0 auto;top:30%;left:15%;position: fixed;">
-    <div class="model-title"
-         style="font-family: '微软雅黑', 'Microsoft YaHei', 'STHeiti Light';width: 100%;text-align: center;font-size: 1.1rem;margin-top: 5%;"></div>
-    <div class="model-content"
-         style="font-family: '微软雅黑', 'Microsoft YaHei', 'STHeiti Light';margin: 0 auto;width: 80%;background: #2f004e;color:rgb(255, 255, 255);margin-bottom: 15px;font-size: 1.3rem;margin-top: 15px;text-align: center;padding: 5px 0 5px 0"></div>
-  </div>
-</div>
+

+ 13 - 4
www/webapp/moonclub/tpl/employe/modeifyStatus.html

@@ -14,11 +14,9 @@
         <div>备注:{{listArr.remarks}}</div>
       </div>
       <div class="form-group">
-        <label>状态选择:</label>
+        <label>可选状态:</label>
         <select class="form-control user-auth">
-          <option value="0">-- 未预约 --</option>
-          <option value="1">-- 已预约 --</option>
-          <option value="2">-- 已结束 --</option>
+          <option value="{{status.index}}">-- {{status.title}} --</option>
         </select>
       </div>
       <!--按钮-->
@@ -30,4 +28,15 @@
       </div>
     </div>
   </div>
+</div>
+<!--模态框-->
+<div class="model" style="width: 100%;position: fixed;top: 0;left:0;background: rgba(0,0,0,0.4)">
+  <!--错误提示容器-->
+  <div class="model-box"
+       style="border-radius: 10px;min-height: 80px;display:none;width: 70%;background: #fff;margin: 0 auto;top:30%;left:15%;position: fixed;">
+    <div class="model-title"
+         style="font-family: '微软雅黑', 'Microsoft YaHei', 'STHeiti Light';width: 100%;text-align: center;font-size: 1.1rem;margin-top: 5%;"></div>
+    <div class="model-content"
+         style="font-family: '微软雅黑', 'Microsoft YaHei', 'STHeiti Light';margin: 0 auto;width: 80%;background: #2f004e;color:rgb(255, 255, 255);margin-bottom: 15px;font-size: 1.3rem;margin-top: 15px;text-align: center;padding: 5px 0 5px 0"></div>
+  </div>
 </div>

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است