first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1 @@
dbdde32c-eabc-4655-bbbe-5fd7ca1e3930

View File

@@ -0,0 +1 @@
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var defaults={prefixCls:"wux-notification",classNames:"wux-animate--slideInDown",image:"",title:"",text:"",duration:3e3,data:"",onClick:function(){},onClose:function(){}},_notification=null;(0,_baseComponent.default)({useFunc:!0,data:defaults,computed:{classes:["prefixCls",function(t){return{wrap:(0,_classNames.default)(t),content:"".concat(t,"__content"),hd:"".concat(t,"__hd"),image:"".concat(t,"__image"),bd:"".concat(t,"__bd"),title:"".concat(t,"__title"),text:"".concat(t,"__text"),ft:"".concat(t,"__ft")}}]},methods:{hide:function(){this.$$setData({in:!1}),"function"==typeof this.fns.onClose&&this.fns.onClose(this.data.data)},show:function(t){function e(){_notification&&_notification.hide.call(n)}var n=this,i=0<arguments.length&&void 0!==t?t:{},o=new Promise(function(t){var e=n.$$mergeOptionsAndBindMethods(Object.assign({},defaults,i));n.$$setData(_objectSpread({in:!0},e)),_notification&&(clearTimeout(_notification.timeout),_notification=null),(_notification={hide:n.hide}).timeout=setTimeout(function(){return n.hide(),t(!0)},e.duration)});return e.then=function(t,e){return o.then(t,e)},e.promise=o,e},onClick:function(){"function"==typeof this.fns.onClick&&this.fns.onClick(this.data.data)}}});

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"wux-animation-group": "../animation-group/index"
}
}

View File

@@ -0,0 +1,12 @@
<wux-animation-group wux-class="{{ classes.wrap }}" in="{{ in }}" classNames="{{ classNames }}" bind:click="onClick">
<view class="{{ classes.content }}">
<view class="{{ classes.hd }}" wx:if="{{ image }}">
<image class="{{ classes.image }}" src="{{ image }}" />
</view>
<view class="{{ classes.bd }}" wx:if="{{ title || text }}">
<view wx:if="{{ title }}" class="{{ classes.title }}">{{ title }}</view>
<view wx:if="{{ text }}" class="{{ classes.text }}">{{ text }}</view>
</view>
<view class="{{ classes.ft }}"></view>
</view>
</wux-animation-group>

View File

@@ -0,0 +1 @@
.wux-notification{position:absolute;top:-2rem;right:0;left:0;z-index:9999;width:100%;min-height:4rem;padding-top:2rem;font-size:.8rem;color:#fff;background-color:rgba(0,0,0,.85)}.wux-notification__content{display:-ms-flexbox;display:flex;padding:.3rem .6rem 1rem .6rem;-ms-flex-align:start;align-items:flex-start}.wux-notification__hd{width:1rem;height:1rem}.wux-notification__image{width:100%;height:100%}.wux-notification__bd{width:100%;margin:0 .4rem}.wux-notification__title{font-weight:700}.wux-notification__text{line-height:1}.wux-notification__ft{position:absolute;bottom:.2rem;left:50%;width:2rem;height:.3rem;background:#fff;border-radius:.15rem;opacity:.5;transform:translate3d(-50%,0,0)}