作者 李洪娟

健康资料选择日期,邀请好友跳转

  1 +/*!
  2 + * Rolldate 1.3.0
  3 + * Copyright 2018 雾空
  4 + * https://github.com/weijhfly/rolldate
  5 + * Licensed under MIT
  6 + * Released on: aug 4, 2018
  7 + */
  8 +ul {
  9 + margin: 0;
  10 + padding: 0;
  11 +}
  12 +li {
  13 + list-style-type: none;
  14 +}
  15 +.rolldate-container {
  16 + font-size: 14px;
  17 + text-align: center;
  18 +}
  19 +.rolldate-container header {
  20 + background: #D8B25F;
  21 + line-height: 45px;
  22 + font-size: 18px;
  23 + color: #fff;
  24 + font-weight: bold;
  25 +}
  26 +.rolldate-container .rolldate-mask {
  27 + position: fixed;
  28 + width: 100%;
  29 + height: 100%;
  30 + top: 0;
  31 + left: 0;
  32 + background: #000;
  33 + opacity: 0.5;
  34 + z-index: 100;
  35 +}
  36 +.rolldate-container .rolldate-wrapper {
  37 + position: fixed;
  38 + width: 80%;
  39 + top: 50%;
  40 + left: 10%;
  41 + margin-top: -118px;
  42 + z-index: 101;
  43 + border-radius: 3px;
  44 + overflow: hidden;
  45 + background: #fff;
  46 +}
  47 +.rolldate-container .rolldate-content {
  48 + padding: 10px;
  49 +}
  50 +.rolldate-container .rolldate-frame {
  51 + position: relative;
  52 + height: 120px;
  53 + overflow: hidden;
  54 + background: #f5f5f5;
  55 + border: 1px solid #e0e0e0;
  56 + border-radius: 5px;
  57 +}
  58 +.rolldate-container .rolldate-frame > div {
  59 + position: relative;
  60 + left: 0;
  61 + top: 0;
  62 + height: 120px;
  63 + float: left;
  64 + width: 33.3333333%;
  65 + z-index: 2;
  66 +}
  67 +.rolldate-container .rolldate-frame li {
  68 + line-height: 40px;
  69 +}
  70 +.rolldate-container .rolldate-frame:after {
  71 + content: '';
  72 + height: 40px;
  73 + background: #ddd;
  74 + position: absolute;
  75 + top: 40px;
  76 + left: 0;
  77 + width: 100%;
  78 + z-index: 1;
  79 +}
  80 +.rolldate-container footer {
  81 + overflow: hidden;
  82 + padding: 10px 20px;
  83 +}
  84 +.rolldate-container .rolldate-btn {
  85 + float: left;
  86 + background: #dcdddd;
  87 + color: #666;
  88 + font-size: 15px;
  89 + line-height: 30px;
  90 + padding: 0;
  91 + border: none;
  92 + width: 120px;
  93 + border-radius: 5px;
  94 + outline: none;
  95 +}
  96 +.rolldate-container .rolldate-confirm {
  97 + float: right;
  98 + background: #D8B25F;
  99 + color: #fff;
  100 +}
  101 +.rolldate-container.rolldate-two .rolldate-frame > div {
  102 + width: 50%;
  103 +}
  104 +.rolldate-container.rolldate-five .rolldate-frame > div {
  105 + width: 20%;
  106 +}
  107 +.rolldate-container.rolldate-six .rolldate-wrapper {
  108 + width: 90%;
  109 + left: 5%;
  110 +}
  111 +.rolldate-container.rolldate-six .rolldate-frame > div {
  112 + width: 16.6666666%;
  113 +}
  114 +.rolldate-container.rolldate-one .rolldate-wrapper {
  115 + width: 60%;
  116 + left: 20%;
  117 +}
  118 +.rolldate-container.rolldate-one .rolldate-frame > div {
  119 + width: 100%;
  120 +}
  121 +.rolldate-container.rolldate-one .rolldate-btn {
  122 + width: 80px;
  123 +}
  124 +@media screen and (max-width: 320px) {
  125 + .rolldate-container {
  126 + font-size: 13px;
  127 + }
  128 + .rolldate-container footer {
  129 + padding: 10px;
  130 + }
  131 + .rolldate-container .rolldate-btn {
  132 + width: 100px;
  133 + }
  134 +}
  1 +var app = new Vue({
  2 + el: '#app',
  3 + data: {
  4 + bro_year: '',
  5 + bro_month: '',
  6 + bro_day: '',
  7 + broth_info: '请选择日期',
  8 + default_bro: '日期',
  9 + date_type: '',
  10 + type_name: '',
  11 + type_home: '',
  12 + type_id: '',
  13 + choose_type_name: '名称',
  14 + choose_homes: '机构名称',
  15 + popupVisible: false,
  16 + img_report: '',
  17 + img_sao_yi_sao: '',
  18 + Illness_list: [],
  19 + org_list: [],
  20 + content: '',
  21 + rid: '',
  22 + code: ''
  23 + },
  24 + created: function () {
  25 + apiready = function () {
  26 + // app.broth_info=$("#date2").val();
  27 + console.log(app.broth_info)
  28 + app.broth_info=localStorage.getItem("birth")
  29 + app.rid = api.pageParam.rid;
  30 + app.date_type = api.pageParam.date_type;
  31 + app.type_name = api.pageParam.type_name;
  32 + app.type_home = api.pageParam.type_home;
  33 + app.type_id = api.pageParam.type_id;
  34 + app.getOrg();
  35 + switch (app.type_id) {
  36 + case 1:
  37 + app.getIllness();
  38 + break;
  39 + case 2:
  40 + app.getPExam();
  41 + break;
  42 + case 3:
  43 + app.getCheckReport();
  44 + break;
  45 + default:
  46 + return false;
  47 + }
  48 +
  49 + }
  50 + },
  51 + methods: {
  52 + // 选择日期
  53 + // broSelect: function () {
  54 + // // api.openPicker({
  55 + // // type: 'date',
  56 + // // title: '选择日期'
  57 + // // }, function (ret, err) {
  58 + // // if (ret) {
  59 + // // app.bro_year = ret.year;
  60 + // // app.bro_month = ret.month;
  61 + // // app.bro_day = ret.day;
  62 + // // app.broth_info = app.bro_year + '-' + add0(app.bro_month) + '-' + add0(app.bro_day);
  63 + // // if (checkDate(app.broth_info, 2)) {
  64 + // // return app.broth_info
  65 + // // } else {
  66 + // // toastMsg('日期不能比今天晚');
  67 + // // return app.broth_info = app.default_bro
  68 + // // }
  69 + // // } else {
  70 + // // console.log(JSON.stringify(err));
  71 + // // }
  72 + // // });
  73 + // // },
  74 + // 上传照片
  75 + choose_pic: function (type) {
  76 + app.popupVisible = false;
  77 + api.getPicture({
  78 + sourceType: type,
  79 + encodingType: 'jpg',
  80 + mediaValue: 'pic',
  81 + destinationType: 'url',
  82 + allowEdit: true,
  83 + quality: 50,
  84 + targetWidth: 300,
  85 + targetHeight: 400,
  86 + saveToPhotoAlbum: true
  87 + }, function (ret, err) {
  88 + // alert(JSON.stringify(ret));
  89 + if (ret && ret.data && ret.data !== "") {
  90 + api.ajax({
  91 + url: baseurl + 'user/index/addReportPic',
  92 + method: 'post',
  93 + data: {
  94 + values: {
  95 + r_type: app.type_id
  96 + },
  97 + files: {
  98 + file: ret.data
  99 + }
  100 + },
  101 + headers: {
  102 + "XX-Device-Type": getDevice(),
  103 + 'XX-Token': getToken()
  104 + }
  105 + }, function (res, erro) {
  106 + if (res.code == 1) {
  107 + app.img_report = res.data.url;
  108 + // alert(JSON.stringify(app.img_report));
  109 + } else {
  110 + toastMsg(res.msg);
  111 + }
  112 + });
  113 + }
  114 + });
  115 + },
  116 + // 获取疾病类型
  117 + getIllness: function () {
  118 + var heder = {
  119 + "XX-Device-Type": getDevice(),
  120 + 'XX-Token': getToken()
  121 + };
  122 + getRequest('post', 'user/index/getIllness', null, heder).then(function (res) {
  123 + console.log(res)
  124 + if (res.data.code == 1) {
  125 + for (var i in res.data.data) {
  126 + app.Illness_list.push({
  127 + value: res.data.data[i].id,
  128 + label: res.data.data[i].name
  129 + })
  130 + }
  131 + loadEnd()
  132 + }
  133 + })
  134 + },
  135 + // 获取体检名称
  136 + getPExam: function () {
  137 + var heder = {
  138 + "XX-Device-Type": getDevice(),
  139 + 'XX-Token': getToken()
  140 + };
  141 + getRequest('post', 'user/index/getPExam', null, heder).then(function (res) {
  142 + if (res.data.code == 1) {
  143 + for (var i in res.data.data) {
  144 + app.Illness_list.push({
  145 + value: res.data.data[i].id,
  146 + label: res.data.data[i].name
  147 + })
  148 + }
  149 + loadEnd()
  150 + }
  151 + })
  152 + },
  153 + // 获取
  154 + getCheckReport: function () {
  155 + var header = {
  156 + "XX-Device-Type": getDevice(),
  157 + 'XX-Token': getToken()
  158 + };
  159 + getRequest('post', 'user/index/getCheckReport', null, header).then(function (res) {
  160 + if (res.data.code == 1) {
  161 + for (var i in res.data.data) {
  162 + app.Illness_list.push({
  163 + value: res.data.data[i].id,
  164 + label: res.data.data[i].name
  165 + })
  166 + }
  167 + loadEnd()
  168 + }
  169 + })
  170 + },
  171 + // 获取机构名称
  172 + getOrg: function () {
  173 + var heder = {
  174 + "XX-Device-Type": getDevice(),
  175 + 'XX-Token': getToken()
  176 + };
  177 + getRequest('post', 'user/index/getOrg', null, heder).then(function (res) {
  178 +
  179 + if (res.data.code == 1) {
  180 +
  181 +
  182 + for (var i=0 ;i< res.data.data.length;i++) {
  183 + app.org_list.push({
  184 + value: res.data.data[i].id,
  185 + label: res.data.data[i].name
  186 + })
  187 + }
  188 +
  189 + loadEnd()
  190 + }
  191 + })
  192 + },
  193 + // 选择类别
  194 + choose_item: function () {
  195 + weui.picker(app.Illness_list, {
  196 + onChange: function (result) {
  197 + },
  198 + onConfirm: function (result) {
  199 + app.choose_type_name = result[0].label
  200 + }
  201 + })
  202 + },
  203 + // 选择机构名称
  204 + choose_home: function () {
  205 + weui.picker(app.org_list, {
  206 + onChange: function (result) {
  207 + },
  208 + onConfirm: function (result) {
  209 + app.choose_homes = result[0].label
  210 + }
  211 + })
  212 + },
  213 + // 打开二维码
  214 + openQrc: function () {
  215 + var FNScanner = api.require('FNScanner');
  216 + FNScanner.open({
  217 + autorotation: true
  218 + }, function (ret, err) {
  219 + if (ret) {
  220 + FNScanner.openScanner({
  221 + autorotation: true
  222 + }, function (ret, err) {
  223 + if (ret) {
  224 + // alert(JSON.stringify(ret))
  225 + app.code = ret.content;
  226 + // alert(JSON.stringify(app.img_report));
  227 + // toastMsg('扫码成功')
  228 + } else {
  229 + // alert(JSON.stringify(ret))
  230 + }
  231 + });
  232 + } else {
  233 + }
  234 + });
  235 + },
  236 + // 保存报告
  237 + save_info: function () {
  238 + app.broth_info=$("#date2").val();
  239 + localStorage.setItem("birth",app.broth_info);
  240 + console.log(localStorage)
  241 + console.log( app.broth_info)
  242 + var header = {
  243 + "XX-Device-Type": getDevice(),
  244 + 'XX-Token': getToken()
  245 + };
  246 + var post = {
  247 + rid: app.rid,
  248 + checktime: Date.parse(app.broth_info),
  249 + name: app.choose_type_name,
  250 + org: app.choose_homes,
  251 + descript: app.content,
  252 + pic: app.img_report,
  253 + r_type: app.type_id,
  254 + code: app.code
  255 + };
  256 + if (app.broth_info == '') {
  257 + toastMsg('请选择日期')
  258 + } else if (app.choose_type_name == '名称') {
  259 + toastMsg('请选择类别')
  260 + } else if (app.choose_homes == '机构名称') {
  261 + toastMsg('请选择机构名称')
  262 + } else if (app.content == '') {
  263 + toastMsg('请输入描述')
  264 + } else if (app.img_report == '' && app.code == '') {
  265 + toastMsg('请上传报告照片')
  266 + }
  267 + else {
  268 + getRequest('post', 'user/index/addReport', post, header).then(function (res) {
  269 + // alert(JSON.stringify(res))
  270 + if (res.data.code == 1) {
  271 + toastMsg('添加成功');
  272 + api.sendEvent({
  273 + name:'add_success'
  274 + });
  275 + setTimeout(function() {
  276 + api.closeWin()
  277 + }, 1000)
  278 + } else {
  279 + toastMsg(res.msg)
  280 + }
  281 + })
  282 + }
  283 + }
  284 + }
  285 +})
1 -// var baseurl = 'http://kindapp.w.bronet.cn/api/';//测试地址  
2 -var baseurl='http://wx.cijievip.com/api/' //正式地址 1 + var baseurl = 'http://kindapp.w.bronet.cn/api/';//测试地址
  2 +//var baseurl='http://wx.cijievip.com/api/' //正式地址
3 var imgurl = 'http://wx.cijievip.com/'; 3 var imgurl = 'http://wx.cijievip.com/';
4 var debug=true; 4 var debug=true;
5 // var baseurl = 'http://192.168.1.3/api/';//本地测试 5 // var baseurl = 'http://192.168.1.3/api/';//本地测试
  1 +/*!
  2 + * Rolldate 1.3.0
  3 + * Copyright 2018 雾空
  4 + * https://github.com/weijhfly/rolldate
  5 + * Licensed under MIT
  6 + * Released on: aug 4, 2018
  7 + */
  8 +!function(t,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.rolldate=o():t.rolldate=o()}(window,function(){return function(t){var o={};function i(s){if(o[s])return o[s].exports;var e=o[s]={i:s,l:!1,exports:{}};return t[s].call(e.exports,e,e.exports,i),e.l=!0,e.exports}return i.m=t,i.c=o,i.d=function(t,o,s){i.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,o){if(1&o&&(t=i(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var e in t)i.d(s,e,function(o){return t[o]}.bind(null,e));return s},i.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(o,"a",o),o},i.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},i.p="",i(i.s=0)}([function(t,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.version=o.Date=void 0;var s=function(){function t(t,o){for(var i=0;i<o.length;i++){var s=o[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(o,i,s){return i&&t(o.prototype,i),s&&t(o,s),o}}();i(3);var e=function(t){return t&&t.__esModule?t:{default:t}}(i(1));var r=i(2),n=e.default.iScroll;o.Date=function(){function t(o){if(function(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this,t),o&&o.el){var i=this,s=i.$(o.el)[0];s&&(i.extend(o),s.addEventListener("click",function(){if("INPUT"==s.nodeName&&s.blur(),i.config.tapBefore&&!1===i.config.tapBefore.call(i,s))return!1;i.createUi()}))}}return s(t,[{key:"baseData",value:function(){return{date:new window.Date,emptyli:"<li>&nbsp;</li>",dateFormat:["YYYY-MM","YYYY-MM-DD","YYYY-MM-DD hh:mm","YYYY-MM-DD hh:mm:ss","YYYY","MM","DD","hh:mm","hh:mm:ss"],domClass:["rolldate-year","rolldate-month","rolldate-day","rolldate-hour","rolldate-min","rolldate-sec"],opts:{el:"",format:"YYYY-MM-DD",beginYear:2e3,endYear:2100,theme:"",scrollTime:200,tapBefore:null,moveEnd:null,confirmBefore:null,confirmEnd:null}}}},{key:"extend",value:function(t){var o=this.baseData().opts;for(var i in o)o[i]=0===t[i]?0:t[i]||o[i];this.config=o}},{key:"createUi",value:function(){for(var t=this,o=t.baseData(),i=o.dateFormat.indexOf(t.config.format),s=5==(i=i>1?i+1:i)?[o.domClass[0]]:6==i?[o.domClass[1]]:7==i?[o.domClass[2]]:8==i?o.domClass.slice(3,5):9==i?o.domClass.slice(3):o.domClass.slice(0,i+2),e=s.length,r="",l=t.$(t.config.el)[0],a=l.date?l.date:o.date,h=0;h<e;h++){if(r+='<div id="'+s[h]+'"><ul>'+o.emptyli,0==h&&i<6)for(var c=t.config.beginYear;c<=t.config.endYear;c++)r+="<li"+(c==a.getFullYear()?' class="active"':"")+">"+c+"年</li>";else if((1==h||6==i)&&i<7)for(var p=1;p<=12;p++)r+="<li"+(p==a.getMonth()+1?' class="active"':"")+">"+(p<10?"0"+p:p)+"月</li>";else if((2==h||7==i)&&i<=7)for(var d=t.bissextile(a.getFullYear(),a.getMonth()+1),m=1;m<=d;m++)r+="<li"+(m==a.getDate()?' class="active"':"")+">"+(m<10?"0"+m:m)+"日</li>";else if(3==h||i>7&&0==h)for(var u=0;u<=23;u++)r+="<li"+(u==a.getHours()?' class="active"':"")+">"+(u<10?"0"+u:u)+"时</li>";else if(4==h||i>7&&1==h)for(var f=0;f<=59;f++)r+="<li"+(f==a.getMinutes()?' class="active"':"")+">"+(f<10?"0"+f:f)+"分</li>";else if(5==h||i>7&&2==h)for(var b=0;b<=59;b++)r+="<li"+(b==a.getSeconds()?' class="active"':"")+">"+(b<10?"0"+b:b)+"秒</li>";r+=o.emptyli+"</ul></div>"}var S='<div class="rolldate-mask"></div>\n <div class="rolldate-wrapper">\n <header>选择日期</header>\n <section class="rolldate-content">\n <div class="rolldate-frame">'+r+'</div>\n </section>\n <footer>\n <button class="rolldate-btn rolldate-cancel">取消</button>\n <button class="rolldate-btn rolldate-confirm">确定</button>\n </footer>\n </div>',g=document.createElement("div"),v=0==i||8==i?"rolldate-two":3==i?"rolldate-five":4==i?"rolldate-six":i>=5&&i<=7?"rolldate-one":"",x=!1;g.className="rolldate-container "+v,g.innerHTML=S,document.body.appendChild(g),t.setTheme(),t.iscroll=[];for(var y=0;y<e;y++){t.iscroll[y]=new n(s[y],{snap:"li",vScrollbar:!1,hScroll:!1,checkDOMChanges:2==y,onScrollEnd:function(){if(x&&(t.config.moveEnd&&t.config.moveEnd.call(t,t.$(t.config.el)[0],this),-1!=o.domClass.slice(0,2).indexOf(this.wrapper.id)&&t.iscroll[2])){var i=t.getIscrollDay(t.iscroll[2]),s=t.bissextile(t.getIscrollDay(t.iscroll[0]),t.getIscrollDay(t.iscroll[1])),e="";if(s+2!=t.$("#"+o.domClass[2]+" li").length){for(var r=1;r<=s;r++)e+="<li>"+(r<10?"0"+r:r)+"日</li>";e=o.emptyli+e+o.emptyli,t.$("#"+o.domClass[2]+" ul")[0].innerHTML=e,i>s&&t.iscroll[2].scrollToElement(t.$("#"+o.domClass[2]+" li")[s-1])}}}});var Y=t.$("#"+s[y]+" .active")[0].previousSibling;t.iscroll[y].scrollToElement(Y,t.config.scrollTime)}t.event(),setTimeout(function(){x=!0},1e3)}},{key:"$",value:function(t){return document.querySelectorAll(t)}},{key:"event",value:function(){var t=this,o=t.$(".rolldate-mask")[0],i=t.$(".rolldate-cancel")[0],s=t.$(".rolldate-confirm")[0];o.addEventListener("click",function(){t.destroy(!0)}),i.addEventListener("click",function(){t.destroy(!0)}),s.addEventListener("click",function(){var o=t.$(t.config.el)[0],i=t.baseData(),s=t.config.format,e=new window.Date,r=i.dateFormat.indexOf(s);if(t.iscroll.forEach(function(o,i){var n=t.getIscrollDay(o),l=void 0;r<=4?l=0==i?"YYYY":1==i?"MM":2==i?"DD":3==i?"hh":4==i?"mm":"ss":5==r?l="MM":6==r?l="DD":7==r?l=0==i?"hh":1==i?"mm":"":8==r&&(l=0==i?"hh":1==i?"mm":"ss"),s=s.replace(l,n),"YYYY"==l?e.setFullYear(n):"MM"==l?e.setMonth(n-1):"DD"==l?e.setDate(n):"hh"==l?e.setHours(n):"mm"==l?e.setMinutes(n):"ss"==l&&e.setSeconds(n)}),o.date=e,t.config.confirmBefore){var n=t.config.confirmBefore.call(t,o,s);if(!1===n)return t.config.confirmEnd&&t.config.confirmEnd.call(t,o,s),!1;n&&(s=n)}"INPUT"==o.nodeName?o.value=s:o.innerText=s,t.config.confirmEnd&&t.config.confirmEnd.call(t,o,s),t.destroy()})}},{key:"bissextile",value:function(t,o){var i=void 0;return 1==o||3==o||5==o||7==o||8==o||10==o||12==o?i=31:4==o||6==o||11==o||9==o?i=30:2==o&&(i=t%4!=0||t%100==0&&t%400!=0?28:29),i}},{key:"destroy",value:function(t){if(this.iscroll.forEach(function(t,o){t.destroy()}),document.body.removeChild(this.$(".rolldate-container")[0]),t&&this.config.confirmEnd){var o=this.$(this.config.el)[0];this.config.confirmEnd.call(this,o)}}},{key:"getIscrollDay",value:function(t){return this.$("#"+t.wrapper.id+" li")[Math.abs(t.y)/40+1].innerText.replace(/\D/g,"")}},{key:"setTheme",value:function(){var t=this.config.theme,o={blue:"#16a1d3",red:"#d91600",green:"#009688",black:"#393D49"},i=this.$(".rolldate-container header")[0],s=this.$(".rolldate-container .rolldate-confirm")[0];t&&(i.style.background=s.style.background=o[t]?o[t]:t)}}]),t}(),o.version=r.version},function(t,o,i){!function(){var t=Math,i=function(t){return t>>0},s=/webkit/i.test(navigator.appVersion)?"webkit":/firefox/i.test(navigator.userAgent)?"Moz":"opera"in window?"O":"",e=/android/gi.test(navigator.appVersion),r=/iphone|ipad/gi.test(navigator.appVersion),n=/playbook/gi.test(navigator.appVersion),l=/hp-tablet/gi.test(navigator.appVersion),a="WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix,h="ontouchstart"in window&&!l,c=s+"Transform"in document.documentElement.style,p=r||n,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,1)},m=window.cancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout,u="onorientationchange"in window?"orientationchange":"resize",f=h?"touchstart":"mousedown",b=h?"touchmove":"mousemove",S=h?"touchend":"mouseup",g=h?"touchcancel":"mouseup",v="Moz"==s?"DOMMouseScroll":"mousewheel",x="translate"+(a?"3d(":"("),y=a?",0)":")",Y=function(t,o){var i,n=this,l=document;for(i in n.wrapper="object"==typeof t?t:l.getElementById(t),n.wrapper.style.overflow="hidden",n.scroller=n.wrapper.children[0],n.options={hScroll:!0,vScroll:!0,x:0,y:0,bounce:!0,bounceLock:!1,momentum:!0,lockDirection:!0,useTransform:!0,useTransition:!1,topOffset:0,checkDOMChanges:!1,hScrollbar:!0,vScrollbar:!0,fixedScrollbar:e,hideScrollbar:r,fadeScrollbar:r&&a,scrollbarClass:"",zoom:!1,zoomMin:1,zoomMax:4,doubleTapZoom:2,wheelAction:"scroll",snap:!1,snapThreshold:1,onRefresh:null,onBeforeScrollStart:function(t){t.preventDefault()},onScrollStart:null,onBeforeScrollMove:null,onScrollMove:null,onBeforeScrollEnd:null,onScrollEnd:null,onTouchEnd:null,onDestroy:null,onZoomStart:null,onZoom:null,onZoomEnd:null},o)n.options[i]=o[i];n.x=n.options.x,n.y=n.options.y,n.options.useTransform=!!c&&n.options.useTransform,n.options.hScrollbar=n.options.hScroll&&n.options.hScrollbar,n.options.vScrollbar=n.options.vScroll&&n.options.vScrollbar,n.options.zoom=n.options.useTransform&&n.options.zoom,n.options.useTransition=p&&n.options.useTransition,n.options.zoom&&e&&(x="translate(",y=")"),n.scroller.style[s+"TransitionProperty"]=n.options.useTransform?"-"+s.toLowerCase()+"-transform":"top left",n.scroller.style[s+"TransitionDuration"]="0",n.scroller.style[s+"TransformOrigin"]="0 0",n.options.useTransition&&(n.scroller.style[s+"TransitionTimingFunction"]="cubic-bezier(0.33,0.66,0.66,1)"),n.options.useTransform?n.scroller.style[s+"Transform"]=x+n.x+"px,"+n.y+"px"+y:n.scroller.style.cssText+=";position:absolute;top:"+n.y+"px;left:"+n.x+"px",n.options.useTransition&&(n.options.fixedScrollbar=!0),n.refresh(),n._bind(u,window),n._bind(f),h||(n._bind("mouseout",n.wrapper),"none"!=n.options.wheelAction&&n._bind(v)),n.options.checkDOMChanges&&(n.checkDOMTime=setInterval(function(){n._checkDOMChanges()},500))};Y.prototype={enabled:!0,x:0,y:0,steps:[],scale:1,currPageX:0,currPageY:0,pagesX:[],pagesY:[],aniTime:null,wheelZoomCount:0,handleEvent:function(t){switch(t.type){case f:if(!h&&0!==t.button)return;this._start(t);break;case b:this._move(t);break;case S:case g:this._end(t);break;case u:this._resize();break;case v:this._wheel(t);break;case"mouseout":this._mouseout(t);break;case"webkitTransitionEnd":this._transitionEnd(t)}},_checkDOMChanges:function(){this.moved||this.zoomed||this.animating||this.scrollerW==this.scroller.offsetWidth*this.scale&&this.scrollerH==this.scroller.offsetHeight*this.scale||this.refresh()},_scrollbar:function(o){var e,r=document;this[o+"Scrollbar"]?(this[o+"ScrollbarWrapper"]||(e=r.createElement("div"),this.options.scrollbarClass?e.className=this.options.scrollbarClass+o.toUpperCase():e.style.cssText="position:absolute;z-index:100;"+("h"==o?"height:7px;bottom:1px;left:2px;right:"+(this.vScrollbar?"7":"2")+"px":"width:7px;bottom:"+(this.hScrollbar?"7":"2")+"px;top:2px;right:1px"),e.style.cssText+=";pointer-events:none;-"+s+"-transition-property:opacity;-"+s+"-transition-duration:"+(this.options.fadeScrollbar?"350ms":"0")+";overflow:hidden;opacity:"+(this.options.hideScrollbar?"0":"1"),this.wrapper.appendChild(e),this[o+"ScrollbarWrapper"]=e,e=r.createElement("div"),this.options.scrollbarClass||(e.style.cssText="position:absolute;z-index:100;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);-"+s+"-background-clip:padding-box;-"+s+"-box-sizing:border-box;"+("h"==o?"height:100%":"width:100%")+";-"+s+"-border-radius:3px;border-radius:3px"),e.style.cssText+=";pointer-events:none;-"+s+"-transition-property:-"+s+"-transform;-"+s+"-transition-timing-function:cubic-bezier(0.33,0.66,0.66,1);-"+s+"-transition-duration:0;-"+s+"-transform:"+x+"0,0"+y,this.options.useTransition&&(e.style.cssText+=";-"+s+"-transition-timing-function:cubic-bezier(0.33,0.66,0.66,1)"),this[o+"ScrollbarWrapper"].appendChild(e),this[o+"ScrollbarIndicator"]=e),"h"==o?(this.hScrollbarSize=this.hScrollbarWrapper.clientWidth,this.hScrollbarIndicatorSize=t.max(i(this.hScrollbarSize*this.hScrollbarSize/this.scrollerW),8),this.hScrollbarIndicator.style.width=this.hScrollbarIndicatorSize+"px",this.hScrollbarMaxScroll=this.hScrollbarSize-this.hScrollbarIndicatorSize,this.hScrollbarProp=this.hScrollbarMaxScroll/this.maxScrollX):(this.vScrollbarSize=this.vScrollbarWrapper.clientHeight,this.vScrollbarIndicatorSize=t.max(i(this.vScrollbarSize*this.vScrollbarSize/this.scrollerH),8),this.vScrollbarIndicator.style.height=this.vScrollbarIndicatorSize+"px",this.vScrollbarMaxScroll=this.vScrollbarSize-this.vScrollbarIndicatorSize,this.vScrollbarProp=this.vScrollbarMaxScroll/this.maxScrollY),this._scrollbarPos(o,!0)):this[o+"ScrollbarWrapper"]&&(c&&(this[o+"ScrollbarIndicator"].style[s+"Transform"]=""),this[o+"ScrollbarWrapper"].parentNode.removeChild(this[o+"ScrollbarWrapper"]),this[o+"ScrollbarWrapper"]=null,this[o+"ScrollbarIndicator"]=null)},_resize:function(){var t=this;setTimeout(function(){t.refresh()},e?200:0)},_pos:function(t,o){t=this.hScroll?t:0,o=this.vScroll?o:0,this.options.useTransform?this.scroller.style[s+"Transform"]=x+t+"px,"+o+"px"+y+" scale("+this.scale+")":(t=i(t),o=i(o),this.scroller.style.left=t+"px",this.scroller.style.top=o+"px"),this.x=t,this.y=o,this._scrollbarPos("h"),this._scrollbarPos("v")},_scrollbarPos:function(t,o){var e,r="h"==t?this.x:this.y;this[t+"Scrollbar"]&&((r=this[t+"ScrollbarProp"]*r)<0?(this.options.fixedScrollbar||((e=this[t+"ScrollbarIndicatorSize"]+i(3*r))<8&&(e=8),this[t+"ScrollbarIndicator"].style["h"==t?"width":"height"]=e+"px"),r=0):r>this[t+"ScrollbarMaxScroll"]&&(this.options.fixedScrollbar?r=this[t+"ScrollbarMaxScroll"]:((e=this[t+"ScrollbarIndicatorSize"]-i(3*(r-this[t+"ScrollbarMaxScroll"])))<8&&(e=8),this[t+"ScrollbarIndicator"].style["h"==t?"width":"height"]=e+"px",r=this[t+"ScrollbarMaxScroll"]+(this[t+"ScrollbarIndicatorSize"]-e))),this[t+"ScrollbarWrapper"].style[s+"TransitionDelay"]="0",this[t+"ScrollbarWrapper"].style.opacity=o&&this.options.hideScrollbar?"0":"1",this[t+"ScrollbarIndicator"].style[s+"Transform"]=x+("h"==t?r+"px,0":"0,"+r+"px")+y)},_start:function(o){var i,e,r,n,l,a=h?o.touches[0]:o;this.enabled&&(this.options.onBeforeScrollStart&&this.options.onBeforeScrollStart.call(this,o),(this.options.useTransition||this.options.zoom)&&this._transitionTime(0),this.moved=!1,this.animating=!1,this.zoomed=!1,this.distX=0,this.distY=0,this.absDistX=0,this.absDistY=0,this.dirX=0,this.dirY=0,this.options.zoom&&h&&o.touches.length>1&&(n=t.abs(o.touches[0].pageX-o.touches[1].pageX),l=t.abs(o.touches[0].pageY-o.touches[1].pageY),this.touchesDistStart=t.sqrt(n*n+l*l),this.originX=t.abs(o.touches[0].pageX+o.touches[1].pageX-2*this.wrapperOffsetLeft)/2-this.x,this.originY=t.abs(o.touches[0].pageY+o.touches[1].pageY-2*this.wrapperOffsetTop)/2-this.y,this.options.onZoomStart&&this.options.onZoomStart.call(this,o)),this.options.momentum&&(this.options.useTransform?(e=1*(i=getComputedStyle(this.scroller,null)[s+"Transform"].replace(/[^0-9-.,]/g,"").split(","))[4],r=1*i[5]):(e=1*getComputedStyle(this.scroller,null).left.replace(/[^0-9-]/g,""),r=1*getComputedStyle(this.scroller,null).top.replace(/[^0-9-]/g,"")),e==this.x&&r==this.y||(this.options.useTransition?this._unbind("webkitTransitionEnd"):m(this.aniTime),this.steps=[],this._pos(e,r))),this.absStartX=this.x,this.absStartY=this.y,this.startX=this.x,this.startY=this.y,this.pointX=a.pageX,this.pointY=a.pageY,this.startTime=o.timeStamp||Date.now(),this.options.onScrollStart&&this.options.onScrollStart.call(this,o),this._bind(b),this._bind(S),this._bind(g))},_move:function(o){var i,e,r,n=h?o.touches[0]:o,l=n.pageX-this.pointX,a=n.pageY-this.pointY,c=this.x+l,p=this.y+a,d=o.timeStamp||Date.now();return this.options.onBeforeScrollMove&&this.options.onBeforeScrollMove.call(this,o),this.options.zoom&&h&&o.touches.length>1?(i=t.abs(o.touches[0].pageX-o.touches[1].pageX),e=t.abs(o.touches[0].pageY-o.touches[1].pageY),this.touchesDist=t.sqrt(i*i+e*e),this.zoomed=!0,(r=1/this.touchesDistStart*this.touchesDist*this.scale)<this.options.zoomMin?r=.5*this.options.zoomMin*Math.pow(2,r/this.options.zoomMin):r>this.options.zoomMax&&(r=2*this.options.zoomMax*Math.pow(.5,this.options.zoomMax/r)),this.lastScale=r/this.scale,c=this.originX-this.originX*this.lastScale+this.x,p=this.originY-this.originY*this.lastScale+this.y,this.scroller.style[s+"Transform"]=x+c+"px,"+p+"px"+y+" scale("+r+")",void(this.options.onZoom&&this.options.onZoom.call(this,o))):(this.pointX=n.pageX,this.pointY=n.pageY,(c>0||c<this.maxScrollX)&&(c=this.options.bounce?this.x+l/2:c>=0||this.maxScrollX>=0?0:this.maxScrollX),(p>this.minScrollY||p<this.maxScrollY)&&(p=this.options.bounce?this.y+a/2:p>=this.minScrollY||this.maxScrollY>=0?this.minScrollY:this.maxScrollY),this.absDistX<6&&this.absDistY<6?(this.distX+=l,this.distY+=a,this.absDistX=t.abs(this.distX),void(this.absDistY=t.abs(this.distY))):(this.options.lockDirection&&(this.absDistX>this.absDistY+5?(p=this.y,a=0):this.absDistY>this.absDistX+5&&(c=this.x,l=0)),this.moved=!0,this._pos(c,p),this.dirX=l>0?-1:l<0?1:0,this.dirY=a>0?-1:a<0?1:0,d-this.startTime>300&&(this.startTime=d,this.startX=this.x,this.startY=this.y),void(this.options.onScrollMove&&this.options.onScrollMove.call(this,o))))},_end:function(o){if(!h||0==o.touches.length){var e,r,n,l,a,c,p,d=this,m=h?o.changedTouches[0]:o,u={dist:0,time:0},f={dist:0,time:0},v=(o.timeStamp||Date.now())-d.startTime,Y=d.x,w=d.y;if(d._unbind(b),d._unbind(S),d._unbind(g),d.options.onBeforeScrollEnd&&d.options.onBeforeScrollEnd.call(d,o),d.zoomed)return p=d.scale*d.lastScale,p=Math.max(d.options.zoomMin,p),p=Math.min(d.options.zoomMax,p),d.lastScale=p/d.scale,d.scale=p,d.x=d.originX-d.originX*d.lastScale+d.x,d.y=d.originY-d.originY*d.lastScale+d.y,d.scroller.style[s+"TransitionDuration"]="200ms",d.scroller.style[s+"Transform"]=x+d.x+"px,"+d.y+"px"+y+" scale("+d.scale+")",d.zoomed=!1,d.refresh(),void(d.options.onZoomEnd&&d.options.onZoomEnd.call(d,o));if(!d.moved)return h&&(d.doubleTapTimer&&d.options.zoom?(clearTimeout(d.doubleTapTimer),d.doubleTapTimer=null,d.options.onZoomStart&&d.options.onZoomStart.call(d,o),d.zoom(d.pointX,d.pointY,1==d.scale?d.options.doubleTapZoom:1),d.options.onZoomEnd&&setTimeout(function(){d.options.onZoomEnd.call(d,o)},200)):d.doubleTapTimer=setTimeout(function(){for(d.doubleTapTimer=null,e=m.target;1!=e.nodeType;)e=e.parentNode;"SELECT"!=e.tagName&&"INPUT"!=e.tagName&&"TEXTAREA"!=e.tagName&&((r=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,o.view,1,m.screenX,m.screenY,m.clientX,m.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,0,null),r._fake=!0,e.dispatchEvent(r))},d.options.zoom?250:0)),d._resetPos(200),void(d.options.onTouchEnd&&d.options.onTouchEnd.call(d,o));if(v<300&&d.options.momentum&&(u=Y?d._momentum(Y-d.startX,v,-d.x,d.scrollerW-d.wrapperW+d.x,d.options.bounce?d.wrapperW:0):u,f=w?d._momentum(w-d.startY,v,-d.y,d.maxScrollY<0?d.scrollerH-d.wrapperH+d.y-d.minScrollY:0,d.options.bounce?d.wrapperH:0):f,Y=d.x+u.dist,w=d.y+f.dist,(d.x>0&&Y>0||d.x<d.maxScrollX&&Y<d.maxScrollX)&&(u={dist:0,time:0}),(d.y>d.minScrollY&&w>d.minScrollY||d.y<d.maxScrollY&&w<d.maxScrollY)&&(f={dist:0,time:0})),u.dist||f.dist)return a=t.max(t.max(u.time,f.time),10),d.options.snap&&(n=Y-d.absStartX,l=w-d.absStartY,t.abs(n)<d.options.snapThreshold&&t.abs(l)<d.options.snapThreshold?d.scrollTo(d.absStartX,d.absStartY,200):(Y=(c=d._snap(Y,w)).x,w=c.y,a=t.max(c.time,a))),d.scrollTo(i(Y),i(w),a),void(d.options.onTouchEnd&&d.options.onTouchEnd.call(d,o));if(d.options.snap)return n=Y-d.absStartX,l=w-d.absStartY,t.abs(n)<d.options.snapThreshold&&t.abs(l)<d.options.snapThreshold?d.scrollTo(d.absStartX,d.absStartY,200):(c=d._snap(d.x,d.y)).x==d.x&&c.y==d.y||d.scrollTo(c.x,c.y,c.time),void(d.options.onTouchEnd&&d.options.onTouchEnd.call(d,o));d._resetPos(200),d.options.onTouchEnd&&d.options.onTouchEnd.call(d,o)}},_resetPos:function(t){var o=this.x>=0?0:this.x<this.maxScrollX?this.maxScrollX:this.x,i=this.y>=this.minScrollY||this.maxScrollY>0?this.minScrollY:this.y<this.maxScrollY?this.maxScrollY:this.y;if(o==this.x&&i==this.y)return this.moved&&(this.moved=!1,this.options.onScrollEnd&&this.options.onScrollEnd.call(this)),this.hScrollbar&&this.options.hideScrollbar&&("webkit"==s&&(this.hScrollbarWrapper.style[s+"TransitionDelay"]="300ms"),this.hScrollbarWrapper.style.opacity="0"),void(this.vScrollbar&&this.options.hideScrollbar&&("webkit"==s&&(this.vScrollbarWrapper.style[s+"TransitionDelay"]="300ms"),this.vScrollbarWrapper.style.opacity="0"));this.scrollTo(o,i,t||0)},_wheel:function(t){var o,i,s,e,r,n=this;if("wheelDeltaX"in t?(o=t.wheelDeltaX/12,i=t.wheelDeltaY/12):o=i="detail"in t?3*-t.detail:-t.wheelDelta,"zoom"==n.options.wheelAction)return(r=n.scale*Math.pow(2,1/3*(i?i/Math.abs(i):0)))<n.options.zoomMin&&(r=n.options.zoomMin),r>n.options.zoomMax&&(r=n.options.zoomMax),void(r!=n.scale&&(!n.wheelZoomCount&&n.options.onZoomStart&&n.options.onZoomStart.call(n,t),n.wheelZoomCount++,n.zoom(t.pageX,t.pageY,r,400),setTimeout(function(){n.wheelZoomCount--,!n.wheelZoomCount&&n.options.onZoomEnd&&n.options.onZoomEnd.call(n,t)},400)));s=n.x+o,e=n.y+i,s>0?s=0:s<n.maxScrollX&&(s=n.maxScrollX),e>n.minScrollY?e=n.minScrollY:e<n.maxScrollY&&(e=n.maxScrollY),n.scrollTo(s,e,0)},_mouseout:function(t){var o=t.relatedTarget;if(o){for(;o=o.parentNode;)if(o==this.wrapper)return;this._end(t)}else this._end(t)},_transitionEnd:function(t){t.target==this.scroller&&(this._unbind("webkitTransitionEnd"),this._startAni())},_startAni:function(){var o,i,s,e=this,r=e.x,n=e.y,l=Date.now();if(!e.animating)if(e.steps.length){if((o=e.steps.shift()).x==r&&o.y==n&&(o.time=0),e.animating=!0,e.moved=!0,e.options.useTransition)return e._transitionTime(o.time),e._pos(o.x,o.y),e.animating=!1,void(o.time?e._bind("webkitTransitionEnd"):e._resetPos(0));(s=function(){var a,h,c=Date.now();if(c>=l+o.time)return e._pos(o.x,o.y),e.animating=!1,e.options.onAnimationEnd&&e.options.onAnimationEnd.call(e),void e._startAni();c=(c-l)/o.time-1,i=t.sqrt(1-c*c),a=(o.x-r)*i+r,h=(o.y-n)*i+n,e._pos(a,h),e.animating&&(e.aniTime=d(s))})()}else e._resetPos(400)},_transitionTime:function(t){t+="ms",this.scroller.style[s+"TransitionDuration"]=t,this.hScrollbar&&(this.hScrollbarIndicator.style[s+"TransitionDuration"]=t),this.vScrollbar&&(this.vScrollbarIndicator.style[s+"TransitionDuration"]=t)},_momentum:function(o,s,e,r,n){var l=t.abs(o)/s,a=l*l/.0012;return o>0&&a>e?(l=l*(e+=n/(6/(a/l*6e-4)))/a,a=e):o<0&&a>r&&(l=l*(r+=n/(6/(a/l*6e-4)))/a,a=r),{dist:a*=o<0?-1:1,time:i(l/6e-4)}},_offset:function(t){for(var o=-t.offsetLeft,i=-t.offsetTop;t=t.offsetParent;)o-=t.offsetLeft,i-=t.offsetTop;return t!=this.wrapper&&(o*=this.scale,i*=this.scale),{left:o,top:i}},_snap:function(o,s){var e,r,n,l,a;for(n=this.pagesX.length-1,e=0,r=this.pagesX.length;e<r;e++)if(o>=this.pagesX[e]){n=e;break}for(n==this.currPageX&&n>0&&this.dirX<0&&n--,o=this.pagesX[n],l=(l=t.abs(o-this.pagesX[this.currPageX]))?t.abs(this.x-o)/l*500:0,this.currPageX=n,n=this.pagesY.length-1,e=0;e<n;e++)if(s>=this.pagesY[e]){n=e;break}return n==this.currPageY&&n>0&&this.dirY<0&&n--,s=this.pagesY[n],a=(a=t.abs(s-this.pagesY[this.currPageY]))?t.abs(this.y-s)/a*500:0,this.currPageY=n,{x:o,y:s,time:i(t.max(l,a))||200}},_bind:function(t,o,i){(o||this.scroller).addEventListener(t,this,!!i)},_unbind:function(t,o,i){(o||this.scroller).removeEventListener(t,this,!!i)},destroy:function(){this.scroller.style[s+"Transform"]="",this.hScrollbar=!1,this.vScrollbar=!1,this._scrollbar("h"),this._scrollbar("v"),this._unbind(u,window),this._unbind(f),this._unbind(b),this._unbind(S),this._unbind(g),this.options.hasTouch||(this._unbind("mouseout",this.wrapper),this._unbind(v)),this.options.useTransition&&this._unbind("webkitTransitionEnd"),this.options.checkDOMChanges&&clearInterval(this.checkDOMTime),this.options.onDestroy&&this.options.onDestroy.call(this)},refresh:function(){var t,o,e,r,n=0,l=0;if(this.scale<this.options.zoomMin&&(this.scale=this.options.zoomMin),this.wrapperW=this.wrapper.clientWidth||1,this.wrapperH=this.wrapper.clientHeight||1,this.minScrollY=-this.options.topOffset||0,this.scrollerW=i(this.scroller.offsetWidth*this.scale),this.scrollerH=i((this.scroller.offsetHeight+this.minScrollY)*this.scale),this.maxScrollX=this.wrapperW-this.scrollerW,this.maxScrollY=this.wrapperH-this.scrollerH+this.minScrollY,this.dirX=0,this.dirY=0,this.options.onRefresh&&this.options.onRefresh.call(this),this.hScroll=this.options.hScroll&&this.maxScrollX<0,this.vScroll=this.options.vScroll&&(!this.options.bounceLock&&!this.hScroll||this.scrollerH>this.wrapperH),this.hScrollbar=this.hScroll&&this.options.hScrollbar,this.vScrollbar=this.vScroll&&this.options.vScrollbar&&this.scrollerH>this.wrapperH,t=this._offset(this.wrapper),this.wrapperOffsetLeft=-t.left,this.wrapperOffsetTop=-t.top,"string"==typeof this.options.snap)for(this.pagesX=[],this.pagesY=[],o=0,e=(r=this.scroller.querySelectorAll(this.options.snap)).length;o<e;o++)(n=this._offset(r[o])).left+=this.wrapperOffsetLeft,n.top+=this.wrapperOffsetTop,this.pagesX[o]=n.left<this.maxScrollX?this.maxScrollX:n.left*this.scale,this.pagesY[o]=n.top<this.maxScrollY?this.maxScrollY:n.top*this.scale;else if(this.options.snap){for(this.pagesX=[];n>=this.maxScrollX;)this.pagesX[l]=n,n-=this.wrapperW,l++;for(this.maxScrollX%this.wrapperW&&(this.pagesX[this.pagesX.length]=this.maxScrollX-this.pagesX[this.pagesX.length-1]+this.pagesX[this.pagesX.length-1]),n=0,l=0,this.pagesY=[];n>=this.maxScrollY;)this.pagesY[l]=n,n-=this.wrapperH,l++;this.maxScrollY%this.wrapperH&&(this.pagesY[this.pagesY.length]=this.maxScrollY-this.pagesY[this.pagesY.length-1]+this.pagesY[this.pagesY.length-1])}this._scrollbar("h"),this._scrollbar("v"),this.zoomed||(this.scroller.style[s+"TransitionDuration"]="0",this._resetPos(200))},scrollTo:function(t,o,i,s){var e,r,n=t;for(this.stop(),n.length||(n=[{x:t,y:o,time:i,relative:s}]),e=0,r=n.length;e<r;e++)n[e].relative&&(n[e].x=this.x-n[e].x,n[e].y=this.y-n[e].y),this.steps.push({x:n[e].x,y:n[e].y,time:n[e].time||0});this._startAni()},scrollToElement:function(o,i){var s;(o=o.nodeType?o:this.scroller.querySelector(o))&&((s=this._offset(o)).left+=this.wrapperOffsetLeft,s.top+=this.wrapperOffsetTop,s.left=s.left>0?0:s.left<this.maxScrollX?this.maxScrollX:s.left,s.top=s.top>this.minScrollY?this.minScrollY:s.top<this.maxScrollY?this.maxScrollY:s.top,i=void 0===i?t.max(2*t.abs(s.left),2*t.abs(s.top)):i,this.scrollTo(s.left,s.top,i))},scrollToPage:function(t,o,i){var s,e;i=void 0===i?400:i,this.options.onScrollStart&&this.options.onScrollStart.call(this),this.options.snap?(t="next"==t?this.currPageX+1:"prev"==t?this.currPageX-1:t,o="next"==o?this.currPageY+1:"prev"==o?this.currPageY-1:o,t=t<0?0:t>this.pagesX.length-1?this.pagesX.length-1:t,o=o<0?0:o>this.pagesY.length-1?this.pagesY.length-1:o,this.currPageX=t,this.currPageY=o,s=this.pagesX[t],e=this.pagesY[o]):(s=-this.wrapperW*t,e=-this.wrapperH*o,s<this.maxScrollX&&(s=this.maxScrollX),e<this.maxScrollY&&(e=this.maxScrollY)),this.scrollTo(s,e,i)},disable:function(){this.stop(),this._resetPos(0),this.enabled=!1,this._unbind(b),this._unbind(S),this._unbind(g)},enable:function(){this.enabled=!0},stop:function(){this.options.useTransition?this._unbind("webkitTransitionEnd"):m(this.aniTime),this.steps=[],this.moved=!1,this.animating=!1},zoom:function(t,o,i,e){var r=i/this.scale;this.options.useTransform&&(this.zoomed=!0,e=void 0===e?200:e,t=t-this.wrapperOffsetLeft-this.x,o=o-this.wrapperOffsetTop-this.y,this.x=t-t*r+this.x,this.y=o-o*r+this.y,this.scale=i,this.refresh(),this.x=this.x>0?0:this.x<this.maxScrollX?this.maxScrollX:this.x,this.y=this.y>this.minScrollY?this.minScrollY:this.y<this.maxScrollY?this.maxScrollY:this.y,this.scroller.style[s+"TransitionDuration"]=e+"ms",this.scroller.style[s+"Transform"]=x+this.x+"px,"+this.y+"px"+y+" scale("+i+")",this.zoomed=!1)},isReady:function(){return!this.moved&&!this.zoomed&&!this.animating}},o.iScroll=Y}()},function(t){t.exports={name:"rolldate",version:"1.3.0",description:"",main:"dist/rolldate.js",scripts:{build:"cross-env NODE_ENV=production webpack --config config/rolldate.config.js --mode production",dev:"cross-env NODE_ENV=development webpack-dev-server --config config/rolldate.config.js --mode development"},keywords:["date","iscroll-date"],repository:{type:"git",url:"https://github.com/weijhfly/rolldate"},author:"雾空",license:"MIT",dependencies:{},devDependencies:{autoprefixer:"^9.0.1","babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","clean-webpack-plugin":"^0.1.19","cross-env":"^5.2.0","css-loader":"^1.0.0","extract-text-webpack-plugin":"^4.0.0-beta.0","html-webpack-plugin":"^3.2.0",less:"^3.8.0","less-loader":"^4.1.0","postcss-loader":"^2.1.6","style-loader":"^0.21.0",webpack:"^4.16.2","webpack-cli":"^3.1.0","webpack-dev-server":"^3.1.5"}}},function(t,o){}])});
@@ -83,6 +83,7 @@ @@ -83,6 +83,7 @@
83 getCode: function () { 83 getCode: function () {
84 if (!mobileReg.test(app.phone)) { 84 if (!mobileReg.test(app.phone)) {
85 toastMsg('手机号不正确') 85 toastMsg('手机号不正确')
  86 +
86 } 87 }
87 else { 88 else {
88 const TIME_COUNT = 60; 89 const TIME_COUNT = 60;
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 <link rel="stylesheet" href="../../assets/css/api.css"/> 12 <link rel="stylesheet" href="../../assets/css/api.css"/>
13 <link rel="stylesheet" href="../../assets/css/my_f.css"/> 13 <link rel="stylesheet" href="../../assets/css/my_f.css"/>
14 <link rel="stylesheet" href="../../assets/icon/iconfont.css"> 14 <link rel="stylesheet" href="../../assets/icon/iconfont.css">
  15 + <link rel="stylesheet" href="../../assets/css/rolldate.css">
15 <title></title> 16 <title></title>
16 <style> 17 <style>
17 .report_item { 18 .report_item {
@@ -97,10 +98,13 @@ @@ -97,10 +98,13 @@
97 <body> 98 <body>
98 <!--<div id="loadStart"></div>--> 99 <!--<div id="loadStart"></div>-->
99 <div id="app" v-cloak> 100 <div id="app" v-cloak>
100 - <div class="report_item" @click="broSelect"> 101 + <div class="report_item" >
101 <span>{{date_type}}</span> 102 <span>{{date_type}}</span>
102 - <div class="report_item_right"><span>{{broth_info?broth_info:default_bro}}</span><span  
103 - class="iconfont icon-xiangyou"></span></div> 103 + <div class="report_item_right">
  104 + <!--<span>{{broth_info?broth_info:default_bro}}</span>-->
  105 + <input readonly type="text" id="date2" placeholder="" :value="broth_info" v-model="broth_info" style="text-align: right;color:#a09f9f">
  106 + <span class="iconfont icon-xiangyou"></span>
  107 + </div>
104 </div> 108 </div>
105 <div class="report_item" @click="choose_item"> 109 <div class="report_item" @click="choose_item">
106 <span>{{type_name}}</span> 110 <span>{{type_name}}</span>
@@ -150,285 +154,22 @@ @@ -150,285 +154,22 @@
150 <script> 154 <script>
151 new FastClick(document.body); 155 new FastClick(document.body);
152 </script> 156 </script>
  157 +<script type="text/javascript" src="../../assets/js/jquery-1.10.1.min.js"></script>
  158 +<script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js"></script>
  159 +<script src="../../assets/js/rolldate.js"></script>
  160 +
153 <script type="text/javascript" src="../../assets/js/vue.min.js"></script> 161 <script type="text/javascript" src="../../assets/js/vue.min.js"></script>
154 <script type="text/javascript" src="../../assets/js/index.js"></script> 162 <script type="text/javascript" src="../../assets/js/index.js"></script>
155 <script type="text/javascript" src="../../assets/js/weui.min.js"></script> 163 <script type="text/javascript" src="../../assets/js/weui.min.js"></script>
156 <script type="text/javascript" src="../../assets/js/public.js"></script> 164 <script type="text/javascript" src="../../assets/js/public.js"></script>
157 <script type="text/javascript" src="../../assets/js/axios.min.js"></script> 165 <script type="text/javascript" src="../../assets/js/axios.min.js"></script>
158 <script type="text/javascript" src="../../assets/icon/iconfont.js"></script> 166 <script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
  167 +<script type="text/javascript" src="../../assets/js/ache.js"></script>
159 <script> 168 <script>
160 - var app = new Vue({  
161 - el: '#app',  
162 - data: {  
163 - bro_year: '',  
164 - bro_month: '',  
165 - bro_day: '',  
166 - broth_info: '',  
167 - default_bro: '日期',  
168 - date_type: '',  
169 - type_name: '',  
170 - type_home: '',  
171 - type_id: '',  
172 - choose_type_name: '名称',  
173 - choose_homes: '机构名称',  
174 - popupVisible: false,  
175 - img_report: '',  
176 - img_sao_yi_sao: '',  
177 - Illness_list: [],  
178 - org_list: [],  
179 - content: '',  
180 - rid: '',  
181 - code: ''  
182 - },  
183 - created: function () {  
184 - apiready = function () {  
185 - app.rid = api.pageParam.rid;  
186 - app.date_type = api.pageParam.date_type;  
187 - app.type_name = api.pageParam.type_name;  
188 - app.type_home = api.pageParam.type_home;  
189 - app.type_id = api.pageParam.type_id;  
190 - app.getOrg();  
191 - switch (app.type_id) {  
192 - case 1:  
193 - app.getIllness();  
194 - break;  
195 - case 2:  
196 - app.getPExam();  
197 - break;  
198 - case 3:  
199 - app.getCheckReport();  
200 - break;  
201 - default:  
202 - return false;  
203 - }  
204 -  
205 - }  
206 - },  
207 - methods: {  
208 - // 选择日期  
209 - broSelect: function () {  
210 - api.openPicker({  
211 - type: 'date',  
212 - title: '选择日期'  
213 - }, function (ret, err) {  
214 - if (ret) {  
215 - app.bro_year = ret.year;  
216 - app.bro_month = ret.month;  
217 - app.bro_day = ret.day;  
218 - app.broth_info = app.bro_year + '-' + add0(app.bro_month) + '-' + add0(app.bro_day);  
219 - if (checkDate(app.broth_info, 2)) {  
220 - return app.broth_info  
221 - } else {  
222 - toastMsg('日期不能比今天晚');  
223 - return app.broth_info = app.default_bro  
224 - }  
225 - } else {  
226 - console.log(JSON.stringify(err));  
227 - }  
228 - });  
229 - },  
230 - // 上传照片  
231 - choose_pic: function (type) {  
232 - app.popupVisible = false;  
233 - api.getPicture({  
234 - sourceType: type,  
235 - encodingType: 'jpg',  
236 - mediaValue: 'pic',  
237 - destinationType: 'url',  
238 - allowEdit: true,  
239 - quality: 50,  
240 - targetWidth: 300,  
241 - targetHeight: 400,  
242 - saveToPhotoAlbum: true  
243 - }, function (ret, err) {  
244 - // alert(JSON.stringify(ret));  
245 - if (ret && ret.data && ret.data !== "") {  
246 - api.ajax({  
247 - url: baseurl + 'user/index/addReportPic',  
248 - method: 'post',  
249 - data: {  
250 - values: {  
251 - r_type: app.type_id  
252 - },  
253 - files: {  
254 - file: ret.data  
255 - }  
256 - },  
257 - headers: {  
258 - "XX-Device-Type": getDevice(),  
259 - 'XX-Token': getToken()  
260 - }  
261 - }, function (res, erro) {  
262 - if (res.code == 1) {  
263 - app.img_report = res.data.url;  
264 - // alert(JSON.stringify(app.img_report));  
265 - } else {  
266 - toastMsg(res.msg);  
267 - }  
268 - });  
269 - }  
270 - });  
271 - },  
272 - // 获取疾病类型  
273 - getIllness: function () {  
274 - var heder = {  
275 - "XX-Device-Type": getDevice(),  
276 - 'XX-Token': getToken()  
277 - };  
278 - getRequest('post', 'user/index/getIllness', null, heder).then(function (res) {  
279 -  
280 - if (res.data.code == 1) {  
281 - for (var i in res.data.data) {  
282 - app.Illness_list.push({  
283 - value: res.data.data[i].id,  
284 - label: res.data.data[i].name  
285 - })  
286 - }  
287 - loadEnd()  
288 - }  
289 - })  
290 - },  
291 - // 获取体检名称  
292 - getPExam: function () {  
293 - var heder = {  
294 - "XX-Device-Type": getDevice(),  
295 - 'XX-Token': getToken()  
296 - };  
297 - getRequest('post', 'user/index/getPExam', null, heder).then(function (res) {  
298 - if (res.data.code == 1) {  
299 - for (var i in res.data.data) {  
300 - app.Illness_list.push({  
301 - value: res.data.data[i].id,  
302 - label: res.data.data[i].name  
303 - })  
304 - }  
305 - loadEnd()  
306 - }  
307 - })  
308 - },  
309 - // 获取  
310 - getCheckReport: function () {  
311 - var header = {  
312 - "XX-Device-Type": getDevice(),  
313 - 'XX-Token': getToken()  
314 - };  
315 - getRequest('post', 'user/index/getCheckReport', null, header).then(function (res) {  
316 - if (res.data.code == 1) {  
317 - for (var i in res.data.data) {  
318 - app.Illness_list.push({  
319 - value: res.data.data[i].id,  
320 - label: res.data.data[i].name  
321 - })  
322 - }  
323 - loadEnd()  
324 - }  
325 - })  
326 - },  
327 - // 获取机构名称  
328 - getOrg: function () {  
329 - var heder = {  
330 - "XX-Device-Type": getDevice(),  
331 - 'XX-Token': getToken()  
332 - };  
333 - getRequest('post', 'user/index/getOrg', null, heder).then(function (res) {  
334 - if (res.data.code == 1) {  
335 - for (var i in res.data.data) {  
336 - app.org_list.push({  
337 - value: res.data.data[i].id,  
338 - label: res.data.data[i].name  
339 - })  
340 - }  
341 - loadEnd()  
342 - }  
343 - })  
344 - },  
345 - // 选择类别  
346 - choose_item: function () {  
347 - weui.picker(app.Illness_list, {  
348 - onChange: function (result) {  
349 - },  
350 - onConfirm: function (result) {  
351 - app.choose_type_name = result[0].label  
352 - }  
353 - })  
354 - },  
355 - // 选择机构名称  
356 - choose_home: function () {  
357 - weui.picker(app.org_list, {  
358 - onChange: function (result) {  
359 - },  
360 - onConfirm: function (result) {  
361 - app.choose_homes = result[0].label  
362 - }  
363 - })  
364 - },  
365 - // 打开二维码  
366 - openQrc: function () {  
367 - var FNScanner = api.require('FNScanner');  
368 - FNScanner.open({  
369 - autorotation: true  
370 - }, function (ret, err) {  
371 - if (ret) {  
372 - FNScanner.openScanner({  
373 - autorotation: true  
374 - }, function (ret, err) {  
375 - if (ret) {  
376 - // alert(JSON.stringify(ret))  
377 - app.code = ret.content;  
378 - // alert(JSON.stringify(app.img_report));  
379 - // toastMsg('扫码成功')  
380 - } else {  
381 - // alert(JSON.stringify(ret))  
382 - }  
383 - });  
384 - } else {  
385 - }  
386 - });  
387 - },  
388 - // 保存报告  
389 - save_info: function () {  
390 - var header = {  
391 - "XX-Device-Type": getDevice(),  
392 - 'XX-Token': getToken()  
393 - };  
394 - var post = {  
395 - rid: app.rid,  
396 - checktime: Date.parse(app.broth_info),  
397 - name: app.choose_type_name,  
398 - org: app.choose_homes,  
399 - descript: app.content,  
400 - pic: app.img_report,  
401 - r_type: app.type_id,  
402 - code: app.code  
403 - };  
404 - if (app.broth_info == '') {  
405 - toastMsg('请选择日期')  
406 - } else if (app.choose_type_name == '名称') {  
407 - toastMsg('请选择类别')  
408 - } else if (app.choose_homes == '机构名称') {  
409 - toastMsg('请选择机构名称')  
410 - } else if (app.content == '') {  
411 - toastMsg('请输入描述')  
412 - } else if (app.img_report == '' && app.code == '') {  
413 - toastMsg('请上传报告照片')  
414 - }  
415 - else {  
416 - getRequest('post', 'user/index/addReport', post, header).then(function (res) {  
417 - // alert(JSON.stringify(res))  
418 - if (res.data.code == 1) {  
419 - toastMsg('添加成功');  
420 - api.sendEvent({  
421 - name:'add_success'  
422 - });  
423 - setTimeout(function() {  
424 - api.closeWin()  
425 - }, 1000)  
426 - } else {  
427 - toastMsg(res.msg)  
428 - }  
429 - })  
430 - }  
431 - }  
432 - } 169 + new rolldate.Date({
  170 + el:'#date2',
  171 + format:'YYYY-MM-DD',
  172 + beginYear:2000,
  173 + endYear:2100
433 }) 174 })
434 </script> 175 </script>
@@ -287,6 +287,8 @@ @@ -287,6 +287,8 @@
287 if(! myreg.test(app.tel)){ 287 if(! myreg.test(app.tel)){
288 //alert("请输入正确的手机号") 288 //alert("请输入正确的手机号")
289 mui.toast("请输入正确的手机号"); 289 mui.toast("请输入正确的手机号");
  290 + //openView('download', 'download', '下载页', 'download', false, false, false);
  291 +
290 unstock(); 292 unstock();
291 }else{ 293 }else{
292 294
@@ -351,6 +353,8 @@ @@ -351,6 +353,8 @@
351 // alert("领取成功") 353 // alert("领取成功")
352 mui.toast("领取成功"); 354 mui.toast("领取成功");
353 unstock(); 355 unstock();
  356 + window.location.href='download.html'
  357 +
354 } 358 }
355 }) 359 })
356 } 360 }