UNPKG

@xysfe/actui

Version:

A fantastic mobile ui lib implement by Vue

1 lines 5.16 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@xysfe/actui/es/assets/utils/helpers.js")):"function"==typeof define&&define.amd?define(["@xysfe/actui/es/assets/utils/helpers.js"],e):"object"==typeof exports?exports.GoldProtocol=e(require("@xysfe/actui/es/assets/utils/helpers.js")):t.GoldProtocol=e(t["@xysfe/actui/es/assets/utils/helpers.js"])}("undefined"!=typeof self?self:this,function(t){return function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="../es",e(e.s=1726)}({1726:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(957);n.a.install=function(t){t.component(n.a.name,n.a)},e.default=n.a},39:function(e,o){e.exports=t},7:function(t,e,o){"use strict";function n(t,e,o,n,r,c,s,a){t=t||{};var i=typeof t.default;"object"!==i&&"function"!==i||(t=t.default);var l="function"==typeof t?t.options:t;e&&(l.render=e,l.staticRenderFns=o,l._compiled=!0),n&&(l.functional=!0),c&&(l._scopeId=c);var d;if(s?(d=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=d):r&&(d=a?function(){r.call(this,this.$root.$options.shadowRoot)}:r),d)if(l.functional){l._injectStyles=d;var u=l.render;l.render=function(t,e){return d.call(e),u(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,d):[d]}return{exports:t,options:l}}e.a=n},877:function(t,e,o){"use strict";var n=o(39);o.n(n);e.a={name:"ActGoldProtocol",data:function(){return{protocolChecked:this.checkState}},props:{text:{type:String,default:"本人已阅读并同意"},tips:{type:String,default:""},protocols:{type:Array,default:function(){return[]}},checkState:{type:Boolean,default:!0},showCheckBox:{type:Boolean,default:!0},textColor:{type:String,default:"#666"},textFontSize:{type:[Number,String],default:13},openInWindow:{type:Boolean,default:!1},brandColor:{type:String,default:"#8c7fee"},zIndex:{type:[String,Number],default:999},disableChecked:{type:Boolean,default:!1}},computed:{fontSize:function(){return Object(n.formatFontSize)(this.textFontSize)}},methods:{getCheckBoxState:function(){return!!this.protocolChecked},onClick:function(t){var e=this,o=!1;if((o=t.openInWindow?t.openInWindow:!1!==t.openInWindow&&this.openInWindow)&&t.data){if(Object(n.isArray)(t.data)&&1===t.data.length&&t.data[0].src)return this.openUrl(t.data[0].src);if(!Object(n.isArray)(t.data)&&t.data.src)return this.openUrl(t.data.src)}this.docPop&&this.docPop.remove(),this.docPop=this.$createDocPop({zIndex:this.zIndex,title:t.title,docData:this.docData(t),brandColor:this.brandColor,openInWindow:o},function(t){return[t("template",{slot:"content"},[e.$slots.content])]}).show()},docData:function(t){return Object(n.isArray)(t.data)?t.data:[t.data]},protocolToggle:function(){this.disableChecked||(this.protocolChecked=!this.protocolChecked,this.$emit("toggle",this.protocolChecked))},openUrl:function(t){n.ua.isMobile||n.ua.isWx?location.href=t:window.open(t,"_blank")}},watch:{checkState:function(t){this.protocolChecked=t}}}},957:function(t,e,o){"use strict";function n(t){a||o(958)}var r=o(877),c=o(959),s=o(7),a=!1,i=n,l=Object(s.a)(r.a,c.a,c.b,!1,i,"data-v-1da413b4",null);l.options.__file="src\\components\\GoldProtocol\\src\\index.vue",e.a=l.exports},958:function(t,e){},959:function(t,e,o){"use strict";o.d(e,"a",function(){return n}),o.d(e,"b",function(){return r});var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"act-gold-protocol"},[t.showCheckBox?o("div",{staticClass:"act-gold-protocol-check",on:{click:function(e){return e.stopPropagation(),t.protocolToggle.apply(null,arguments)}}},[o("i",{staticClass:"act-gold-protocol-icon",class:{checked:t.protocolChecked},style:{"background-color":t.protocolChecked?t.brandColor:""}})]):t._e(),t._v(" "),o("div",{staticClass:"act-gold-protocol-text",style:{color:t.textColor,"font-size":t.fontSize}},[o("span",{domProps:{innerHTML:t._s(t.text)}}),t._v(" "),t._l(t.protocols,function(e,n){return[n==t.protocols.length-1&&0!=n?o("span",{key:n+"span"},[t._v("和")]):0!=n?o("span",{key:n+"span"},[t._v("、")]):t._e(),t._v(" "),e.track?o("a",{key:n+"a",staticClass:"act-gold-protocol-item",style:{color:t.brandColor},attrs:{"data-track":e.track},on:{click:function(o){return t.onClick(e)}}},[t._v("《"+t._s(e.title)+"》")]):o("a",{key:n+"a",staticClass:"act-gold-protocol-item",style:{color:t.brandColor},attrs:{"data-track":e.track||""},on:{click:function(o){return t.onClick(e)}}},[t._v("《"+t._s(e.title)+"》")])]}),t._v(" "),o("span",{domProps:{innerHTML:t._s(t.tips)}})],2)])},r=[];n._withStripped=!0}})});