Browse Source

优化

master
xpz2018 6 years ago
parent
commit
eb17e4ddb8
7 changed files with 9 additions and 2880 deletions
  1. 47
      components/icon/index.js
  2. 3
      components/icon/index.json
  3. 1
      components/icon/index.wxml
  4. 2820
      components/icon/index.wxss
  5. 1
      components/input-number/index.json
  6. 16
      components/input-number/index.wxml
  7. 1
      pages/mall/order-info/index.json

47
components/icon/index.js

@ -1,47 +0,0 @@
Component({
externalClasses: ['wux-class'],
properties: {
type: {
type: String,
value: '',
},
size: {
type: [String, Number],
value: 32,
observer: 'updated',
},
color: {
type: String,
value: '',
},
hidden: {
type: Boolean,
value: false,
},
},
data: {
fontSize: '',
},
methods: {
updated(size = this.data.size) {
let fontSize = size
if (typeof size === 'number') {
fontSize = `${size}px`
} else if (typeof size === 'string') {
if (!isNaN(Number(size))) {
fontSize = `${size}px`
}
}
if (this.data.fontSize !== fontSize) {
this.setData({
fontSize,
})
}
},
},
attached() {
this.updated()
},
})

3
components/icon/index.json

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

1
components/icon/index.wxml

@ -1 +0,0 @@
<view class="wux-class ion {{ type ? 'ion-' + type : '' }}" style="font-size: {{ fontSize }}; {{ color ? 'color: ' + color : '' }}" hidden="{{ hidden }}"></view>

2820
components/icon/index.wxss
File diff suppressed because it is too large
View File

1
components/input-number/index.json

@ -1,6 +1,5 @@
{
"component": true,
"usingComponents": {
"wux-icon": "../icon/index"
}
}

16
components/input-number/index.wxml

@ -1,9 +1,11 @@
<view class="wux-class {{ classes.wrap }}">
<view bindlongpress="onLongpress" bindtap="onTap" bindtouchend="onTouchEnd" touchcancel="onTouchCancel" data-type="sub" class="wux-sub-class {{ classes.sub }}">
<wux-icon wux-class="{{ classes.icon }}" type="ios-remove"></wux-icon>
</view>
<input bindinput="onInput" bindfocus="onFocus" bindblur="onBlur" value="{{ inputValue }}" disabled="{{ disabled }}" type="number" class="wux-input-class {{ classes.input }}" />
<view bindlongpress="onLongpress" bindtap="onTap" bindtouchend="onTouchEnd" touchcancel="onTouchCancel" data-type="add" class="wux-add-class {{ classes.add }}">
<wux-icon wux-class="{{ classes.icon }}" type="ios-add"></wux-icon>
</view>
<view bindlongpress="onLongpress" bindtap="onTap" bindtouchend="onTouchEnd" touchcancel="onTouchCancel" data-type="sub" class="wux-sub-class {{ classes.sub }}">
<!-- <wux-icon wux-class="{{ classes.icon }}" type="ios-remove"></wux-icon> -->
<text class="cuIcon-move" style="font-size:40rpx"></text>
</view>
<input bindinput="onInput" bindfocus="onFocus" bindblur="onBlur" value="{{ inputValue }}" disabled="{{ disabled }}" type="number" class="wux-input-class {{ classes.input }}" />
<view bindlongpress="onLongpress" bindtap="onTap" bindtouchend="onTouchEnd" touchcancel="onTouchCancel" data-type="add" class="wux-add-class {{ classes.add }}">
<!-- <wux-icon wux-class="{{ classes.icon }}" type="ios-add"></wux-icon> -->
<text class="cuIcon-add" style="font-size:40rpx"></text>
</view>
</view>

1
pages/mall/order-info/index.json

@ -1,7 +1,6 @@
{
"usingComponents": {
"wux-button": "/components/button/index",
"wux-icon": "/components/icon/index",
"wux-input-number": "/components/input-number/index"
}
}
Loading…
Cancel
Save