text: (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/API/image/image"],{362:function(e,n,t){"use strict";(function(e){t(5);r(t(3));var n=r(t(363));function r(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t(1)["createPage"])},363:function(e,n,t){"use strict";t.r(n);var r=t(364),i=t(366);for(var o in i)"default"!==o&&function(e){t.d(n,e,(function(){return i[e]}))}(o);t(368);var s,c=t(15),a=Object(c["default"])(i["default"],r["render"],r["staticRenderFns"],!1,null,null,null,!1,r["components"],s);a.options.__file="pages/API/image/image.vue",n["default"]=a.exports},364:function(e,n,t){"use strict";t.r(n);var r=t(365);t.d(n,"render",(function(){return r["render"]})),t.d(n,"staticRenderFns",(function(){return r["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return r["recyclableRender"]})),t.d(n,"components",(function(){return r["components"]}))},365:function(e,n,t){"use strict";var r;t.r(n),t.d(n,"render",(function(){return i})),t.d(n,"staticRenderFns",(function(){return s})),t.d(n,"recyclableRender",(function(){return o})),t.d(n,"components",(function(){return r}));try{r={pageHead:function(){return t.e("components/page-head/page-head").then(t.bind(null,1067))}}}catch(c){if(-1===c.message.indexOf("Cannot find module")||-1===c.message.indexOf(".vue"))throw c;console.error(c.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范，文档：https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范，需手动引入，并在 components 中注册该组件")}var i=function(){var e=this,n=e.$createElement;e._self._c},o=!1,s=[];i._withStripped=!0},366:function(e,n,t){"use strict";t.r(n);var r=t(367),i=t.n(r);for(var o in r)"default"!==o&&function(e){t.d(n,e,(function(){return r[e]}))}(o);n["default"]=i.a},367:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t(17)),i=o(t(331));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,n,t,r,i,o,s){try{var c=e[o](s),a=c.value}catch(u){return void t(u)}c.done?n(a):Promise.resolve(a).then(r,i)}function c(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function c(e){s(o,r,i,c,a,"next",e)}function a(e){s(o,r,i,c,a,"throw",e)}c(void 0)}))}}var a=[["camera"],["album"],["camera","album"]],u=[["compressed"],["original"],["compressed","original"]],l={data:function(){return{title:"choose/previewImage",imageList:[],sourceTypeIndex:2,sourceType:["拍照","相册","拍照或相册"],sizeTypeIndex:2,sizeType:["压缩","原图","压缩或原图"],countIndex:8,count:[1,2,3,4,5,6,7,8,9]}},onUnload:function(){this.imageList=[],this.sourceTypeIndex=2,this.sourceType=["拍照","相册","拍照或相册"],this.sizeTypeIndex=2,this.sizeType=["压缩","原图","压缩或原图"],this.countIndex=8},methods:{sourceTypeChange:function(e){this.sourceTypeIndex=parseInt(e.detail.value)},sizeTypeChange:function(e){this.sizeTypeIndex=parseInt(e.detail.value)},countChange:function(e){this.countIndex=e.detail.value},chooseImage:function(){var n=c(r.default.mark((function n(){var t,i=this;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(9!==this.imageList.length){n.next=7;break}return n.next=3,this.isFullImg();case 3:if(t=n.sent,console.log("是否继续?",t),t){n.next=7;break}return n.abrupt("return");case 7:e.chooseImage({sourceType:a[this.sourceTypeIndex],sizeType:u[this.sizeTypeIndex],count:this.imageList.length+this.count[this.countIndex]>9?9-this.imageList.length:this.count[this.countIndex],success:function(e){i.imageList=i.imageList.concat(e.tempFilePaths)},fail:function(n){console.log("err: ",n),"-1"===n.errMsg.indexOf("cancel")&&e.getSetting({success:function(n){var t=!1;switch(i.sourceTypeIndex){case 0:t=n.authSetting["scope.camera"];break;case 1:t=n.authSetting["scope.album"];break;case 2:t=n.authSetting["scope.album"]&&n.authSetting["scope.camera"];break;default:break}t||e.showModal({title:"授权失败",content:"Hello uni-app需要从您的相机或相册获取图片，请在设置界面打开相关权限",success:function(n){n.confirm&&e.openSetting()}})}})}});case 8:case"end":return n.stop()}}),n,this)})));function t(){return n.apply(this,arguments)}return t}(),isFullImg:function(){var n=this;return new Promise((function(t){e.showModal({content:"已经有9张图片了,是否清空现有图片？",success:function(e){e.confirm?(n.imageList=[],t(!0)):t(!1)},fail:function(){t(!1)}})}))},previewImage:function(n){var t=n.target.dataset.src;e.previewImage({current:t,urls:this.imageList})},checkPermission:function(n){var t=this;return c(r.default.mark((function o(){var s,c;return r.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(s=n?n-1:t.sourceTypeIndex,!i.default.isIOS){r.next=7;break}return r.next=4,i.default.requestIOS(a[s][0]);case 4:r.t0=r.sent,r.next=10;break;case 7:return r.next=9,i.default.requestAndroid(0===s?"android.permission.CAMERA":"android.permission.READ_EXTERNAL_STORAGE");case 9:r.t0=r.sent;case 10:return c=r.t0,null===c||1===c?c=1:e.showModal({content:"没有开启权限",confirmText:"设置",success:function(e){e.confirm&&i.default.gotoAppSetting()}}),r.abrupt("return",c);case 13:case"end":return r.stop()}}),o)})))()}}};n.default=l}).call(this,t(1)["default"])},368:function(e,n,t){"use strict";t.r(n);var r=t(369),i=t.n(r);for(var o in r)"default"!==o&&function(e){t.d(n,e,(function(){return r[e]}))}(o);n["default"]=i.a},369:function(e,n,t){}},[[362,"common/runtime","common/vendor"]]]);
  //# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/API/image/image.js.map