UNPKG

wapp-cli

Version:
1 lines 23.2 kB
(global.webpackJsonp=global.webpackJsonp||[]).push([[3],[,function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=t(3),r=t(0);o.showLoading=function(e){void 0===e&&(e={}),wx.showLoading(Object.assign({title:"加载中",mask:"true"},e))},o.hideLoading=function(e){void 0===e&&(e={}),wx.hideLoading()},o.showToast=function(e){void 0===e&&(e={}),wx.showToast(Object.assign({title:"成功",mask:"true",icon:"none",duration:n.default.THEME.toastDuration},e))},o.showModal=function(e){return void 0===e&&(e={}),wx.Promise.showModal(Object.assign({},{title:"提示",content:"",cancelColor:n.default.THEME.disabledColor,confirmColor:n.default.THEME.mainColor},e))},o.setTitle=function(e){wx.setNavigationBarTitle({title:e})};var i=function(e){var t=e.url,n=e.type,r=e.data;switch(n){case"navigateTo":wx.navigateTo(o.getUrlQuery(t,r));break;case"redirectTo":wx.redirectTo(o.getUrlQuery(t,r));break;case"switchTab":wx.switchTab(o.getUrlQuery(t,r));break;case"reLaunch":wx.reLaunch(o.getUrlQuery(t,r))}};o.navigateTo=function(e,t){var n=e.url;i({url:n,data:t,type:"navigateTo"})},o.redirectTo=function(e,t){var n=e.url;i({url:n,data:t,type:"redirectTo"})},o.switchTab=function(e,t){var n=e.url;i({url:n,data:t,type:"switchTab"})},o.reLaunch=function(e,t){var n=e.url;i({url:n,data:t,type:"reLaunch"})},o.getUrlQuery=function(e,t){return void 0===t&&(t={}),{url:[e,r.queryStringfy(t)].filter(function(e){return e}).join("?")}},o.default={showLoading:o.showLoading,hideLoading:o.hideLoading,showToast:o.showToast,showModal:o.showModal,navigateTo:o.navigateTo,redirectTo:o.redirectTo,switchTab:o.switchTab,reLaunch:o.reLaunch,getUrlQuery:o.getUrlQuery,setTitle:o.setTitle},o.promisify=function(){wx.Promise={};["login","showModal","getUserInfo","navigateTo","checkSession","getStorageInfo","removeStorage","clearStorage","getNetworkType","getSystemInfo","canvasToTempFilePath","saveImageToPhotosAlbum","getImageInfo","setClipboardData","makePhoneCall","uploadFile","chooseImage"].forEach(function(r){wx.Promise[r]=function(e){return void 0===e&&(e={}),new Promise(function(t,n){e.success=function(e){console.log("wx."+r+" success",e),t(e)},e.fail=function(e){console.error("wx."+r+" fail",e),n(e)},wx[r](e)})}}),wx.Promise.getStorage=function(e){return new Promise(function(t,n){wx.getStorage({key:e,success:function(e){t(e.data)},fail:function(e){n(e)}})})},wx.Promise.setStorage=function(e,r){return new Promise(function(t,n){wx.setStorage({key:e,data:r,success:function(e){t(r)},fail:function(e){n(e)}})})},wx.Promise.removeStorage=function(e){return new Promise(function(t,n){wx.removeStorage({key:e,success:function(e){t(e)},fail:function(e){n(e)}})})},wx.Promise.request=function(r){return r.toast&&wx.showToast({title:r.toast.title||"加载中",icon:"loading"}),new Promise(function(t,n){wx.request({url:r.url,method:r.method||"GET",data:r.data,header:r.header,success:function(e){t(e)},fail:function(e){console.error("wx.request fail [network]",r,e),n(e)}})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.file={upload:{prefix:"https://kolrank.cdn.pinquest.cn/",url:"https://app.pinquest.cn/",key:"file"}},t.default={Account:{Login:{url:"account/public/miniappLogin",type:"post",isAuth:!1,isLock:!0},GetUserInfo:{url:"account/user/{pin_uid}/miniappGetUserInfo",type:"post"},CustomerLogin:{url:"spread/user/{pin_uid}/customers/login",type:"get"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),o=n(12);t.default={APP:r.default,THEME:o.default}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(i,u,a,s){return new(a||(a=Promise))(function(e,t){function n(e){try{o(s.next(e))}catch(e){t(e)}}function r(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(n,r)}o((s=s.apply(i,u||[])).next())})},o=this&&this.__generator||function(n,r){var o,i,u,e,a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,u&&(t=[2&t[0],u.value]),t[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(u=0<(u=a.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=r.call(n,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),u=n(1);App(Object.assign({requestLock:{status:!1,request:null,count:0},onLaunch:function(){return r(this,void 0,void 0,function(){return o(this,function(e){return u.promisify.call(this),i.createStore.call(this),[2]})})}},i.default,u.default))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={},c={},l={};t.createStore=function(){var e,t,n,r=a(6),o=a(9),i=a(17),u=a(20);r&&function(e){this.state=Object.assign({},e)}.call(this,r.default),i&&(e=i.default,Object.assign(c,e)),o&&(t=o.default,Object.assign(s,t)),u&&(n=u.default,Object.assign(l,n))},t.default={commit:function(t,e){var n=Object.keys(c).find(function(e){return c[e].hasOwnProperty(t)});if(n){var r=getApp()||this;r.state[n]=c[n][t].call(null,r.state[n],e)}else console.log("could not commit "+t+". "+t+" callback is undefined.")},dispatch:function(t,e){var n=Object.keys(s).find(function(e){return s[e].hasOwnProperty(t)});if(n){var r=getApp()||this;return s[n][t].call(this,r.state[n],e)}console.log("could not dispatch "+t+". "+t+" callback is undefined.")},getter:function(t,e){var n=Object.keys(l).find(function(e){return l[e].hasOwnProperty(t)});if(n){var r=getApp()||this;return l[n][t].call(this,r.state[n],e)}console.log("could not dispatch "+t+". "+t+" callback is undefined.")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),o=n(8);t.default={config:o.config,account:r.account}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.account={token:{},corpInfo:{},customerInfo:{},sellerInfo:{},spreadInfo:{}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config={networkStatus:{isConnected:!0,networkType:"4g"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),o=n(16);t.default={config:o.default,account:r.default}},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(i,u,a,s){return new(a||(a=Promise))(function(e,t){function n(e){try{o(s.next(e))}catch(e){t(e)}}function r(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(n,r)}o((s=s.apply(i,u||[])).next())})},s=this&&this.__generator||function(n,r){var o,i,u,e,a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,u&&(t=[2&t[0],u.value]),t[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(u=0<(u=a.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=r.call(n,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=new(n(13).AccountService);t.default={login:function(e){return o(this,void 0,void 0,function(){var a,t=this;return s(this,function(e){switch(e.label){case 0:return 1!==(a=getApp()||this).requestLock.count?[3,2]:[4,a.requestLock.request];case 1:return[2,e.sent()];case 2:a.requestLock.status=!0,a.requestLock.count++,a.requestLock.request=new Promise(function(i,u){return o(t,void 0,void 0,function(){var t,n,r,o;return s(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,4,5]),[4,wx.Promise.login()];case 1:return t=e.sent(),n=wx.getExtConfigSync(),n.pin_appid,n.corp_id,[4,l.Login({code:t.code})];case 2:return r=e.sent().data,a.commit("setToken",r),i(r),[3,5];case 3:return o=e.sent(),c.showToast({title:"登陆失败,请稍后再试!"}),u(o),[3,5];case 4:return a.requestLock.status=!1,a.requestLock.request=null,a.requestLock.count=0,[7];case 5:return[2]}})})}),e.label=3;case 3:return e.trys.push([3,5,,6]),[4,a.requestLock.request];case 4:return[2,e.sent()];case 5:return e.sent(),[3,6];case 6:return[2]}})})},reportFormId:function(n,r){return void 0===r&&(r=""),o(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return console.info("fromId",r),r&&"the formId is a mock one"===r?[2]:(t=getApp()||this,n.profile.account?[3,2]:[4,t.dispatch("login")]);case 1:e.sent(),e.label=2;case 2:return[2]}})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={wxAppId:"wx app id"};var o=Object.assign({},r,Object({ENV:"production",BASE_API:"http://localhost:8081"}));console.warn("App Config",o);var i="production"===o.ENV;t.default={version:"1.0.0",isProd:i,config:o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={disabledColor:"#394256",mainColor:"#2384E8",toastDuration:2e3}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return e.call(this,"Account")||this}return o(t,e),t}(n(14).default);t.AccountService=i},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},s=this&&this.__awaiter||function(i,u,a,s){return new(a||(a=Promise))(function(e,t){function n(e){try{o(s.next(e))}catch(e){t(e)}}function r(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(n,r)}o((s=s.apply(i,u||[])).next())})},c=this&&this.__generator||function(n,r){var o,i,u,e,a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,u&&(t=[2&t[0],u.value]),t[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(u=0<(u=a.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=r.call(n,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(t,"__esModule",{value:!0});var l=n(2),f=n(0),u=n(15),a=function(a){function e(e){var t=a.call(this)||this,u=t;if(!l.default.hasOwnProperty(e))return console.error("moduleName is not found please add it in file config/api",e),t;for(var n=l.default[e],r=function(e){var i=n[e];u[e]=function(n,r,o){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o={}),s(t,void 0,void 0,function(){var t;return c(this,function(e){return t=f.deepClone(i),[2,u[i.type](n,f.strFormat(i.url,r),t,Object.assign({},o,t.headers))]})})}},o=0,i=Object.keys(n);o<i.length;o++){r(i[o])}return t}return o(e,a),e}(function(){function e(e){this.uri="",this.Host=u.HttpService.getUrl,e&&(this.uri=e),this.http=new u.HttpService}return e.prototype.post=function(e,t,n,r){void 0===t&&(t=""),void 0===r&&(r={});var o={url:this._getURI(t),method:"post",data:e,header:r};return this.http.jsonRequest(o,n)},e.prototype.get=function(e,t,n,r){void 0===t&&(t=""),void 0===r&&(r={});var o={url:this._getURI(t),method:"get",data:e,header:r};return this.http.jsonRequest(o,n)},e.prototype.put=function(e,t,n,r){void 0===t&&(t=""),void 0===r&&(r={});var o={url:this._getURI(t),method:"put",data:e,header:r};return this.http.jsonRequest(o,n)},e.prototype.delete=function(e,t,n,r){void 0===t&&(t=""),void 0===r&&(r={});var o={url:this._getURI(t),method:"delete",data:e,header:r};return this.http.jsonRequest(o,n)},e.prototype.getUrl=function(e,t,n){return void 0===t&&(t=""),this._getURI(t)+"?data="+encodeURIComponent(JSON.stringify(e))},e.prototype._getURI=function(e){return e&&e.match(/^http/)?e:this.uri+(e?"/"+e:"")},e}());t.default=a;var p=function(){function e(e){this.uri="",e&&(this.uri=e),this.http=new u.HttpService}return e.prototype.upload=function(e,t){return void 0===t&&(t=""),this.http.fileUpload(i({url:this._getURI(t)},e))},e.prototype._getURI=function(e){return this.uri+(e?"/"+e:"")},e}();t.UploadFileService=p},function(e,t,n){"use strict";var l=this&&this.__awaiter||function(i,u,a,s){return new(a||(a=Promise))(function(e,t){function n(e){try{o(s.next(e))}catch(e){t(e)}}function r(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(n,r)}o((s=s.apply(i,u||[])).next())})},f=this&&this.__generator||function(n,r){var o,i,u,e,a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,u&&(t=[2&t[0],u.value]),t[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(u=0<(u=a.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=r.call(n,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),i=n(2),p=n(0),a=n(1),d=1;function u(){var e=0;return getApp().request_id?(getApp().request_id++,e=getApp().request_id):(e=function(e){for(var t="",n=0;n<e;n++){var r=parseInt((10*Math.random()).toString(),10);0!==n||0!==r?t+=r:n--}return parseInt(t,10)}(8),getApp().request_id=e),e.toString()}t.generateRequestID=u;var r=function(){function c(){}return c.getUrl=function(e){var t=o.default.APP.config.BASE_API;return e.match(/^http/)?e:0===e.indexOf("/")?t+e:t+"/"+e},c._parseRequestOptions=function(a,s){return l(this,void 0,void 0,function(){var t,n,r,o,i,u;return f(this,function(e){switch(e.label){case 0:return t=wx.getExtConfigSync(),n=t.pin_appid,r=t.corp_id,s?[4,getApp().dispatch("getToken")]:[3,2];case 1:o=e.sent(),i=o.pin_uid,u=o.token,a.header||(a.header={}),a.url=p.strFormat(a.url,{pin_uid:i}),Object.assign(a.header,{"X-Pin-Authorization":u,"X-Pin-CorpID":r}),e.label=2;case 2:return a.url=p.strFormat(a.url,{pin_appid:n}),[2,a]}})})},c._parseResponse=function(e){return wx.hideLoading(),[e.data,e.header]},c.prototype.jsonRequest=function(e,t){return this.preRequest(e,t)},c.prototype.fileUpload=function(e){return new Promise(function(n,r){e.url.indexOf("https://")<0&&(e.url=i.file.upload.url+e.url),e.formData||(e.formData={app_id:o.default.APP.config.APP_ID,request_id:u()}),e.name=i.file.upload.key,wx.Promise.uploadFile().then(function(e){if(200===e.statusCode){var t=JSON.parse(e.data);console.warn("upload success--\x3e",t),n.apply(void 0,[t,e.header])}r(e.errMsg)}).catch(function(e){r(e)})})},c.prototype.preRequest=function(i,u){return l(this,void 0,void 0,function(){var t,n,r,o;return f(this,function(e){switch(e.label){case 0:if(t=u.hasLoading,n=void 0!==t&&t,r=u.isLock,o=void 0!==r&&r,!getApp().state.config.networkStatus.isConnected)return a.showToast({title:"网络不见啦!",icon:"none",duration:2e3}),[2];if(n&&a.showLoading({title:"加载中"}),!getApp().requestLock.status||o)return[3,4];console.warn("Ohh, we are waiting for some request finishing first."),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,getApp().requestLock.request];case 2:return e.sent(),console.warn("Wow, getApp().requestLock.request success."),[3,4];case 3:return e.sent(),console.warn("Oops, getApp().requestLock.request failed."),[2];case 4:return[2,this.request(i,u)]}})})},c.prototype.request=function(a,s){return l(this,void 0,void 0,function(){var t,u,n=this;return f(this,function(e){switch(e.label){case 0:return t=s.isAuth,[4,c._parseRequestOptions(a,u=void 0===t||t)];case 1:return a=e.sent(),console.warn("request start, config: ",s,a),[2,new Promise(function(o,i){a.url=c.getUrl(a.url),wx.Promise.request(a).then(function(r){return l(n,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return t=r.statusCode,r.data,200<=t&&t<=300?[2,o.apply(void 0,c._parseResponse(r))]:[3,1];case 1:if(401!==t||!d)return[3,8];d=0,e.label=2;case 2:return e.trys.push([2,6,,7]),[4,getApp().dispatch("login")];case 3:return e.sent(),[4,c._parseRequestOptions(a,u)];case 4:return a=e.sent(),d=1,n=o,[4,this.request(a,s)];case 5:return[2,n.apply(void 0,[e.sent()])];case 6:return e.sent(),[2,i.apply(void 0,c._parseResponse(r))];case 7:return[3,9];case 8:return[2,i.apply(void 0,c._parseResponse(r))];case 9:return[2]}})})}).catch(function(e){i.apply(void 0,c._parseResponse(e))})})]}})})},c}();t.HttpService=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(i,u,a,s){return new(a||(a=Promise))(function(e,t){function n(e){try{o(s.next(e))}catch(e){t(e)}}function r(e){try{o(s.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(n,r)}o((s=s.apply(i,u||[])).next())})},i=this&&this.__generator||function(n,r){var o,i,u,e,a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,u&&(t=[2&t[0],u.value]),t[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(u=0<(u=a.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=r.call(n,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.default={detectNetwork:function(e){return r(this,void 0,void 0,function(){var t,n,r,o;return i(this,function(e){switch(e.label){case 0:return t=getApp()||this,r=(n=t).commit,o=["networkStatus"],[4,wx.Promise.getNetworkType()];case 1:return r.apply(n,o.concat([e.sent()])),wx.onNetworkStatusChange(function(e){t.commit("networkStatus",e)}),[2]}})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),o=n(19);t.default={config:o.default,account:r.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={login:function(e,t){return void 0===t&&(t={}),console.log(e,t),Object.keys(t).length&&(e.baseInfo=Object.assign({},t)),e},setToken:function(e,t){return void 0===t&&(t={}),e.token=t||{},wx.setStorageSync("TOKEN",e.token),wx.setStorageSync("TOKEN_TIME",(new Date).valueOf()+604800),e},setCorpInfo:function(e,t){return void 0===t&&(t={}),e.corpInfo=t||{},Object.keys(t)&&wx.setStorageSync("corpInfo",e.corpInfo),e},setSellerInfo:function(e,t){return void 0===t&&(t={}),e.sellerInfo=t||{},Object.keys(t)&&wx.setStorageSync("sellerInfo",e.sellerInfo),e},setCustomerInfo:function(e,t){return void 0===t&&(t={}),e.customerInfo=t||{},e},setSpreadInfo:function(e,t){return void 0===t&&(t={}),e.spreadInfo=t||{},e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={setAppConfig:function(e,t){return Object.assign(e,t),e},networkStatus:function(e,t){console.warn("[network.networkType]: ",t.networkType);var n=t.networkType,r=t.isConnected;return void 0===r&&(r="none"!==n),e.networkStatus={isConnected:r,networkType:n},e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21),o=n(22);t.default={config:o.default,account:r.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={getToken:function(e){return e.token},getSellerInfo:function(e){return Object.keys(e.sellerInfo).length?e.sellerInfo:null},getCustomerInfo:function(e){return Object.keys(e.customerInfo).length?e.customerInfo:null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.default={sourcePrefixHost:function(e,t){return void 0===t&&(t=""),(e["resource-prefix"]||r.default.prefixSource)+t}}}],[[4,0,1]]]),require("runtime"),require("commons");