@xysfe/actui
Version:
A fantastic mobile ui lib implement by Vue
1 lines • 8.12 kB
JavaScript
!function(s,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@xysfe/actui/es/assets/utils/create/index.js"),require("@xysfe/actui/es/assets/utils/helpers.js"),require("@xysfe/actui/es/assets/mixins/visible.js"),require("@xysfe/actui/es/assets/mixins/noscroll.js"),require("@xysfe/actui/es/assets/common/popup.js"),require("@xysfe/actui/es/assets/svgicon.js"),require("@xysfe/actui/es/Loading/index.js"),require("@xysfe/actui/es/assets/mixins/fontsize.js"),require("@xysfe/actui/es/assets/utils/app.js"),require("@xysfe/actui/es/assets/mixins/poster-layer.js"),require("@xysfe/actui/es/toBase64/index.js")):"function"==typeof define&&define.amd?define(["@xysfe/actui/es/assets/utils/create/index.js","@xysfe/actui/es/assets/utils/helpers.js","@xysfe/actui/es/assets/mixins/visible.js","@xysfe/actui/es/assets/mixins/noscroll.js","@xysfe/actui/es/assets/common/popup.js","@xysfe/actui/es/assets/svgicon.js","@xysfe/actui/es/Loading/index.js","@xysfe/actui/es/assets/mixins/fontsize.js","@xysfe/actui/es/assets/utils/app.js","@xysfe/actui/es/assets/mixins/poster-layer.js","@xysfe/actui/es/toBase64/index.js"],e):"object"==typeof exports?exports.PosterLayer=e(require("@xysfe/actui/es/assets/utils/create/index.js"),require("@xysfe/actui/es/assets/utils/helpers.js"),require("@xysfe/actui/es/assets/mixins/visible.js"),require("@xysfe/actui/es/assets/mixins/noscroll.js"),require("@xysfe/actui/es/assets/common/popup.js"),require("@xysfe/actui/es/assets/svgicon.js"),require("@xysfe/actui/es/Loading/index.js"),require("@xysfe/actui/es/assets/mixins/fontsize.js"),require("@xysfe/actui/es/assets/utils/app.js"),require("@xysfe/actui/es/assets/mixins/poster-layer.js"),require("@xysfe/actui/es/toBase64/index.js")):s.PosterLayer=e(s["@xysfe/actui/es/assets/utils/create/index.js"],s["@xysfe/actui/es/assets/utils/helpers.js"],s["@xysfe/actui/es/assets/mixins/visible.js"],s["@xysfe/actui/es/assets/mixins/noscroll.js"],s["@xysfe/actui/es/assets/common/popup.js"],s["@xysfe/actui/es/assets/svgicon.js"],s["@xysfe/actui/es/Loading/index.js"],s["@xysfe/actui/es/assets/mixins/fontsize.js"],s["@xysfe/actui/es/assets/utils/app.js"],s["@xysfe/actui/es/assets/mixins/poster-layer.js"],s["@xysfe/actui/es/toBase64/index.js"])}("undefined"!=typeof self?self:this,function(s,e,t,i,n,o,a,r,c,u,l){return function(s){function e(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return s[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var t={};return e.m=s,e.c=t,e.d=function(s,t,i){e.o(s,t)||Object.defineProperty(s,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(s){var t=s&&s.__esModule?function(){return s.default}:function(){return s};return e.d(t,"a",t),t},e.o=function(s,e){return Object.prototype.hasOwnProperty.call(s,e)},e.p="../es",e(e.s=1702)}({110:function(s,e){s.exports=i},1134:function(s,e,t){"use strict";var i=t(118),n=t.n(i),o=t(40),a=t.n(o),r=t(110),c=t.n(r),u=t(554),l=t.n(u),f=t(1705),p=t.n(f),d=t(1706),x=t.n(d),y=t(261),h=t.n(y),m=t(143),_=t.n(m),v=t(39),g=(t.n(v),t(926));t.n(g);e.a={name:"ActPosterLayer",mixins:[a.a,c.a,p.a,l.a],data:function(){return{shareIcon:"arrow-share",showLoading:!1,longPressId:"",isApp:!!v.ua.isApp}},computed:{shareIconId:function(){return"icon-"+this.shareIcon},_showDesc:function(){return this.showDesc?!(!v.ua.isWx&&!v.ua.isApp):this.showDesc}},watch:{isVisible:function(s){var e=this;s&&(this._showArrow&&this.$nextTick(function(){e.changeIconColor(e._title.color?e._title.color:e.themeColor)}),this.showLoading=!0,x()(this._options).then(function(s){e.showLoading=!1,e.imgData=s.data,e.$emit("done",e.imgData)}).catch(function(s){console.log(s)}))}},methods:{changeIconColor:function(s){document.getElementById("icon-arrow-share").querySelector("path").setAttribute("fill",s)},oneBtnClick:function(s){this._btn[0].handle(this,s)},twoBtnClick:function(s,e){this._btn[s].handle(this,e)},appLongPressStart:function(){var s=this;s.longPressId=setTimeout(function(){s.handleLongPress()},1e3)},appLongPressEnd:function(){clearTimeout(this.longPressId)},handleLongPress:function(){var s=this;Object(g.appSaveImage)(this.imgData,function(){s.$emit("longpress")})},clickMask:function(s){this.hide()}},components:{ActPopup:n.a,svgIcon:_.a,ActLoading:h.a}}},118:function(s,e){s.exports=n},143:function(s,e){s.exports=o},1702:function(s,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t(26),n=t.n(i),o=t(1703);o.a.install=function(s){s.component(o.a.name,o.a),s.prototype.$createPosterLayer=n()(o.a,s)},e.default=o.a},1703:function(s,e,t){"use strict";function i(s){r||t(1704)}var n=t(1134),o=t(1707),a=t(7),r=!1,c=i,u=Object(a.a)(n.a,o.a,o.b,!1,c,"data-v-4c6a07bc",null);u.options.__file="src\\components\\PosterLayer\\src\\index.vue",e.a=u.exports},1704:function(s,e){},1705:function(s,e){s.exports=u},1706:function(s,e){s.exports=l},1707:function(s,e,t){"use strict";t.d(e,"a",function(){return i}),t.d(e,"b",function(){return n});var i=function(){var s=this,e=s.$createElement,t=s._self._c||e;return t("act-popup",{directives:[{name:"show",rawName:"v-show",value:s.isVisible,expression:"isVisible"}],attrs:{zIndex:s.zIndex,opacity:s.opacity},nativeOn:{click:function(e){return s.clickMask.apply(null,arguments)}},scopedSlots:s._u([{key:"mask",fn:function(){return[t("div",{staticClass:"act-posterlayer",style:{"font-size":s._fontSize}},[t("div",{staticClass:"poster-header"},[t("div",{staticClass:"title",style:{color:s._title.color}},[s._v("\n "+s._s(s._title.txt)+"\n ")]),s._v(" "),s.showDesc?t("div",{staticClass:"desc",style:{color:s._desc.color}},[s._v("\n "+s._s(s._desc.txt)+"\n ")]):s._e(),s._v(" "),s._showArrow?t("div",{staticClass:"arrow",style:{bottom:s.showDesc?"0.5em":"-1.4em"}},[t("svg-icon",{attrs:{iconClass:s.shareIcon}})],1):s._e()]),s._v(" "),t("div",{staticClass:"poster-img act-row act-middle"},[s.showLoading?t("act-loading",{directives:[{name:"show",rawName:"v-show",value:s.showLoading,expression:"showLoading"}],attrs:{type:s._loading.type,size:s._loading.size,color:s._loading.color}}):s.imgData&&s.isApp?t("img",{staticClass:"poster",attrs:{src:s.imgData},on:{touchstart:function(e){return e.preventDefault(),s.appLongPressStart.apply(null,arguments)},touchend:s.appLongPressEnd}}):s.imgData?t("img",{staticClass:"poster",attrs:{src:s.imgData},on:{touchend:function(s){s.preventDefault()}}}):s._e()],1),s._v(" "),t("div",{staticClass:"poster-btn"},[1===s._btn.length?t("div",{staticClass:"one-btn",style:{color:s._btn[0].color,border:"1px solid "+s._btn[0].color,"background-color":s._btn[0].bgcolor},on:{click:function(e){return e.stopPropagation(),s.oneBtnClick.apply(null,arguments)}}},[t("span",[s._v(s._s(s._btn[0].txt))])]):2===s._btn.length?t("div",{staticClass:"two-btn"},s._l(s._btn,function(e,i){return t("div",{key:i,style:{"background-color":e.bgcolor},on:{click:function(e){for(var t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return e.stopPropagation(),s.twoBtnClick.apply(void 0,[i].concat(n))}}},[t("span",{style:{color:e.color}},[s._v(s._s(e.txt))])])}),0):s._e()])])]},proxy:!0}])})},n=[];i._withStripped=!0},26:function(e,t){e.exports=s},261:function(s,e){s.exports=a},39:function(s,t){s.exports=e},40:function(s,e){s.exports=t},554:function(s,e){s.exports=r},7:function(s,e,t){"use strict";function i(s,e,t,i,n,o,a,r){s=s||{};var c=typeof s.default;"object"!==c&&"function"!==c||(s=s.default);var u="function"==typeof s?s.options:s;e&&(u.render=e,u.staticRenderFns=t,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId=o);var l;if(a?(l=function(s){s=s||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,s||"undefined"==typeof __VUE_SSR_CONTEXT__||(s=__VUE_SSR_CONTEXT__),n&&n.call(this,s),s&&s._registeredComponents&&s._registeredComponents.add(a)},u._ssrRegister=l):n&&(l=r?function(){n.call(this,this.$root.$options.shadowRoot)}:n),l)if(u.functional){u._injectStyles=l;var f=u.render;u.render=function(s,e){return l.call(e),f(s,e)}}else{var p=u.beforeCreate;u.beforeCreate=p?[].concat(p,l):[l]}return{exports:s,options:u}}e.a=i},926:function(s,e){s.exports=c}})});