(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/step/share/share"],{"2ae5":function(t,e,i){"use strict";(function(t){i("2d0a");n(i("66fd"));var e=n(i("d7b7"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,i("543d")["createPage"])},3369:function(t,e,i){},"5dec":function(t,e,i){"use strict";var n=i("3369"),o=i.n(n);o.a},"697a":function(t,e,i){"use strict";i.r(e);var n=i("8ba0"),o=i.n(n);for(var a in n)"default"!==a&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=o.a},"8ba0":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={data:function(){return{todayStep:0,pic_list:[],poster:"",pic:[],page:0,currentItem:"",left:!1,right:!0}},methods:{screen:function(){var e=this.poster;t.previewImage({urls:[e]})},chooseImg:function(t){var e=this,i=Math.floor(e.pic_list.length/4-1e-4);if(1==t){if(0==e.left)return;e.page--,e.right=!0,0==e.page&&(e.left=!1),e.pic=e.pic_list.slice(4*e.page,4*e.page+4)}else if(2==t){if(0==e.right)return;e.page++,e.left=!0,e.page==i&&(e.right=!1),e.pic=e.pic_list.slice(4*e.page,4*e.page+4)}},tagChoose:function(t){this.currentItem=t,this.getPoster()},saveImage:function(){var e=this;t.showLoading({mask:!0,text:"保存中..."}),t.authorize({scope:"scope.writePhotosAlbum",success:function(i){"authorize:ok"==i.errMsg&&t.getImageInfo({src:e.poster,success:function(e){t.hideLoading(),t.saveImageToPhotosAlbum({filePath:e.path,success:function(e){t.showToast({title:"保存成功！",icon:"success",duration:2e3})},fail:function(e){t.showToast({title:"保存失败！",icon:"none",duration:1e3})}})},fail:function(e){t.hideLoading(),t.showToast({title:"保存失败！",icon:"none",duration:1e3})}})},fail:function(e){t.hideLoading(),t.showModal({title:"提示",content:"保存失败，需要授权保存到相册权限",showCancel:!1,confirmText:"打开授权",success:function(e){e.confirm&&t.openSetting({})}})}})},getPoster:function(){var e=this;t.showLoading({mask:!0,title:"生成中..."}),e.$request({url:e.$api.step.poster,data:{pic_id:e.currentItem,num:e.todayStep}}).then((function(i){t.hideLoading(),0==i.code?e.poster=i.data.pic_url:t.showToast({title:i.msg,icon:"none",duration:1e3})})).catch((function(e){t.hideLoading()}))},getList:function(){var e=this;e.$showLoading({type:"global",text:"步数加载中..."}),e.$request({url:e.$api.step.setting}).then((function(i){e.$hideLoading(),0==i.code?(e.pic_list=i.data.qrcode_pic,e.pic=i.data.qrcode_pic,e.qrcode_title=i.data.qrcode_title,e.currentItem=i.data.qrcode_pic[0].id,i.data.qrcode_pic.length>4?e.pic=i.data.qrcode_pic.slice(0,4):(e.left=!1,e.right=!1),e.getPoster()):t.showToast({title:i.msg,icon:"none",duration:1e3})})).catch((function(t){e.$hideLoading()}))}},onLoad:function(t){this.$commonLoad.onload(t);var e=this;t.step>-1&&(e.todayStep=t.step),e.getList()}};e.default=i}).call(this,i("543d")["default"])},d7b7:function(t,e,i){"use strict";i.r(e);var n=i("f12a"),o=i("697a");for(var a in o)"default"!==a&&function(t){i.d(e,t,(function(){return o[t]}))}(a);i("5dec");var c,s=i("f0c5"),r=Object(s["a"])(o["default"],n["b"],n["c"],!1,null,"f7e76bd8",null,!1,n["a"],c);e["default"]=r.exports},f12a:function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}));var o=function(){var t=this,e=t.$createElement;t._self._c},a=[]}},[["2ae5","common/runtime","common/vendor"]]]);