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 @@
62fb0f19-7bae-4122-a498-9c4f2c64e6b7

View File

@@ -0,0 +1 @@
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/styleToCssString"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(e,t){var r=[],n=!0,a=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(n=(l=o.next()).done)&&(r.push(l.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw i}}return r}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-avatar"},shape:{type:String,value:"circle"},size:{type:String,value:"default"},src:{type:String,value:""},bodyStyle:{type:[String,Object],value:"",observer:function(e){this.setData({extStyle:(0,_styleToCssString.default)(e)})}},scale:{type:Boolean,value:!1}},data:{extStyle:"",childrenStyle:""},computed:{classes:["prefixCls, shape, size, src",function(e,t,r,n){var a;return{wrap:(0,_classNames2.default)(e,(_defineProperty(a={},"".concat(e,"--").concat(t),t),_defineProperty(a,"".concat(e,"--").concat(r),r),_defineProperty(a,"".concat(e,"--thumb"),n),a)),string:"".concat(e,"__string")}}]},methods:{setScale:function(){var l=this,e=this.data.prefixCls,t=wx.createSelectorQuery().in(this);t.select(".".concat(e)).boundingClientRect(),t.select(".".concat(e,"__string")).boundingClientRect(),t.exec(function(e){if(!e.filter(function(e){return!e}).length){var t=_slicedToArray(e,2),r=t[0],n=t[1],a=r.width-8<n.width?(r.width-8)/n.width:1,i=1!=a?"position: absolute; display: inline-block; transform: scale(".concat(a,"); left: calc(50% - ").concat(Math.round(n.width/2),"px)"):"";l.setData({childrenStyle:i})}})}},ready:function(){!this.data.src&&this.data.scale&&this.setScale()}});

View File

@@ -0,0 +1,3 @@
{
"component": true
}

View File

@@ -0,0 +1,6 @@
<view class="wux-class {{ classes.wrap }}" style="{{ extStyle }}">
<image src="{{ src }}" wx:if="{{ src }}" />
<text class="{{ classes.string }}" style="{{ childrenStyle }}" wx:else>
<slot></slot>
</text>
</view>

View File

@@ -0,0 +1 @@
.wux-avatar{box-sizing:border-box;display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:64rpx;height:64rpx;line-height:64rpx;border-radius:32rpx;font-size:36rpx}.wux-avatar .wux-avatar__string{line-height:64rpx}.wux-avatar--small{width:48rpx;height:48rpx;line-height:48rpx;border-radius:24rpx;font-size:28rpx}.wux-avatar--small .wux-avatar__string{line-height:48rpx}.wux-avatar--large{width:80rpx;height:80rpx;line-height:80rpx;border-radius:40rpx;font-size:48rpx}.wux-avatar--large .wux-avatar__string{line-height:80rpx}.wux-avatar--square{border-radius:8rpx}.wux-avatar--thumb{background:0 0}.wux-avatar>image{width:100%;height:100%}