pages-product-addGoods-secound.10eb6814.js 5.7 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-product-addGoods-secound"],{c25d:function(e,n,t){"use strict";t("6a54");var o=t("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.ActionSheet=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#000000";return new Promise((function(t,o){uni.showActionSheet({itemList:e,itemColor:n,success:function(e){t(e.tapIndex)},fail:function(e){o(e.errMsg)}})}))},n.Authorize=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scope.userInfo";return new Promise((function(n,t){uni.authorize({scope:e,success:function(e){n(e)},fail:function(e){t(e)}})}))},n.GetUserInfo=function(){return new Promise((function(e,n){uni.getUserInfo({success:function(n){e(n)},fail:function(e){n(e)}})}))},n.Loading=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"正在加载...",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};uni.showLoading((0,r.default)({title:e,mask:!0},n))},n.Modal=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"提示",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"这是一个模态弹窗!";return new Promise((function(t,o){uni.showModal({title:e,content:n,success:function(e){e.confirm&&t(),e.cancel&&o()}})}))},n.ScrollTo=function(e){uni.pageScrollTo({scrollTop:e,duration:300})},n.Toast=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:800,i=(0,r.default)({title:e,duration:o,position:"center",mask:!0,icon:n||"none"},t);uni.showToast(i)},n.chooseImage=function(e){return new Promise((function(n,t){uni.chooseImage({count:e,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){n(e)},fail:function(e){t(e)}})}))},n.clearStorage=function(){try{uni.clearStorageSync()}catch(e){throw new Error("处理失败")}},n.convertObj=a,n.formatDate=u,n.getQuarterStartDate=function(){var e=new Date(f,function(){var e=0;s<3&&(e=0);2<s&&s<6&&(e=3);5<s&&s<9&&(e=6);s>8&&(e=9);return e}(),1);return u(e,"yyyy-MM-dd")},n.getStorage=function(e){var n=uni.getStorageSync(e);try{"number"!=typeof JSON.parse(n)&&(n=JSON.parse(n))}catch(t){}return n},n.hideLoading=function(){try{uni.hideLoading()}catch(e){throw new Error("处理失败")}},n.navigateBack=function(e){uni.navigateBack({delta:e})},n.navigateTo=function(e,n,t){var o=n,i="navigateTo";switch(o=t?o+"?"+a(t):o,e){case 1:i="navigateTo";break;case 2:i="redirectTo";break;case 3:i="reLaunch";break;case 4:i="switchTab";break;default:i="navigateTo";break}uni[i]({url:o,animationType:"slide-in-right",animationDuration:200})},n.pathToBase64=function(e){return new Promise((function(n,t){if("object"===("undefined"===typeof window?"undefined":(0,i.default)(window))&&"document"in window){if("function"===typeof FileReader){var o=new XMLHttpRequest;return o.open("GET",e,!0),o.responseType="blob",o.onload=function(){if(200===this.status){var e=new FileReader;e.onload=function(e){n(e.target.result)},e.onerror=t,e.readAsDataURL(this.response)}},o.onerror=t,void o.send()}var r=document.createElement("canvas"),a=r.getContext("2d"),u=new Image;return u.onload=function(){r.width=u.width,r.height=u.height,a.drawImage(u,0,0),n(r.toDataURL()),r.height=r.width=0},u.onerror=t,void(u.src=e)}"object"!==("undefined"===typeof plus?"undefined":(0,i.default)(plus))?"object"===("undefined"===typeof wx?"undefined":(0,i.default)(wx))&&wx.canIUse("getFileSystemManager")?wx.getFileSystemManager().readFile({filePath:e,encoding:"base64",success:function(e){n("data:image/png;base64,"+e.data)},fail:function(e){t(e)}}):t(new Error("not support")):plus.io.resolveLocalFileSystemURL(getLocalFilePath(e),(function(e){e.file((function(e){var o=new plus.io.FileReader;o.onload=function(e){n(e.target.result)},o.onerror=function(e){t(e)},o.readAsDataURL(e)}),(function(e){t(e)}))}),(function(e){t(e)}))}))},n.removeStorage=function(e){e&&uni.removeStorageSync(e)},n.serialize=function(e){if(null!=e&&""!=e)try{return JSON.parse(JSON.stringify(e))}catch(n){return e instanceof Array?[]:{}}return e},n.setStorage=function(e,n){if("string"==typeof n)return uni.setStorageSync(e,n),n;uni.setStorageSync(e,JSON.stringify(n))},n.showMonthFirstDay=function(){var e=(new Date).setDate(1);return u(new Date(e).getTime(),"yyyy-MM-dd")},n.showWeekFirstDay=function(){var e=new Date,n=e.getDay()||7;return e.setDate(e.getDate()-n+1),u(e,"yyyy-MM-dd")},n.throttle=function(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return function(){for(var o=this,i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];n||(n=setTimeout((function(){e.apply(o,r),n=null}),t))}},n.unique=function(e){e=e||[];for(var n={},t=0;t<e.length;t++){var o=JSON.stringify(e[t]);"undefined"==typeof o&&(n[o]=1)}for(var t in e.length=0,n)e[e.length]=t;return e};var i=o(t("fcf3")),r=o(t("9b1b"));function a(e){var n,t=[];return Object.keys(e).forEach((function(n){t.push("".concat(n,"=").concat(e[n]))})),n=t.join("&"),n}function u(e,n){return e?(n=n||"yyyy-MM-dd hh:mm:ss",new Date(e).format(n)):""}t("d4b5"),t("7a76"),t("c9b5"),t("bf0f"),t("2797"),t("dc8a"),t("aa9c"),t("c223"),t("5c47"),t("0506"),t("a1c1"),t("23f4"),t("7d2f"),t("9c4e"),t("ab80"),Date.prototype.format=function(e){var n={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var t in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,String(this.getFullYear()).substr(4-RegExp.$1.length))),n)new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[t]:("00"+n[t]).substr(String(n[t]).length)));return e};var c=new Date,s=c.getMonth(),f=c.getYear();f+=f<2e3?1900:0}}]);