-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
938 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.i-btn{text-align:center;vertical-align:middle;touch-action:manipulation;cursor:pointer;background-image:none;white-space:nowrap;user-select:none;font-size:14px;border-radius:2px;border:0!important;position:relative;text-decoration:none;height:44px;line-height:44px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);color:#fff!important;background:#f7f7f7!important;color:#495060!important;margin:10px}.i-btn-long{border-radius:0;margin:0;box-shadow:none}.i-btn-large{height:48px;line-height:48px}.i-btn-small{height:40px;line-height:40px}.i-btn-primary{color:#fff!important;background:#2d8cf0!important}.i-btn-ghost{color:#fff!important;background:#fff!important;color:#495060!important}.i-btn-success{color:#fff!important;background:#19be6b!important}.i-btn-warning{color:#fff!important;background:#f90!important}.i-btn-error{color:#fff!important;background:#ed3f14!important}.i-btn-info{color:#fff!important;background:#2db7f5!important}.i-btn-circle{border-radius:44px}.i-btn-large.i-btn-circle{border-radius:48px}.i-btn-small.i-btn-circle{border-radius:40px}.i-btn-loading{opacity:.6}.i-btn-loading-inner{display:inline-block;margin-right:12px;vertical-align:middle;width:14px;height:14px;background:0 0;border-radius:50%;border:2px solid #fff;border-color:#fff #fff #fff transparent;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-btn-disabled{color:#bbbec4!important;background:#f7f7f7!important}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} | ||
.i-btn{text-align:center;vertical-align:middle;touch-action:manipulation;cursor:pointer;background-image:none;white-space:nowrap;user-select:none;font-size:14px;border-radius:2px;border:0!important;position:relative;text-decoration:none;height:44px;line-height:44px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);color:#fff!important;background:#f7f7f7!important;color:#495060!important;margin:10px}.i-btn-hover{opacity:.9}.i-btn-long{border-radius:0;margin:0;box-shadow:none}.i-btn-large{height:48px;line-height:48px}.i-btn-small{height:40px;line-height:40px}.i-btn-primary{color:#fff!important;background:#2d8cf0!important}.i-btn-ghost{color:#fff!important;background:#fff!important;color:#495060!important}.i-btn-success{color:#fff!important;background:#19be6b!important}.i-btn-warning{color:#fff!important;background:#f90!important}.i-btn-error{color:#fff!important;background:#ed3f14!important}.i-btn-info{color:#fff!important;background:#2db7f5!important}.i-btn-circle{border-radius:44px}.i-btn-large.i-btn-circle{border-radius:48px}.i-btn-small.i-btn-circle{border-radius:40px}.i-btn-loading{opacity:.6}.i-btn-loading-inner{display:inline-block;margin-right:12px;vertical-align:middle;width:14px;height:14px;background:0 0;border-radius:50%;border:2px solid #fff;border-color:#fff #fff #fff transparent;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-btn-disabled{color:#bbbec4!important;background:#f7f7f7!important}.i-btn-inline{display:inline-block}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Component({ | ||
externalClasses: ['i-class-content', 'i-class-title', 'i-class'], | ||
|
||
relations: { | ||
'../collapse/index': { | ||
type: 'parent', | ||
linked: function (target) { | ||
const options = { | ||
accordion: target.data.accordion | ||
} | ||
if (target.data.name === this.data.name) { | ||
options.showContent = 'i-collapse-item-show-content'; | ||
} | ||
this.setData(options); | ||
} | ||
} | ||
}, | ||
|
||
properties: { | ||
title: String, | ||
name: String | ||
}, | ||
|
||
data: { | ||
showContent: '', | ||
accordion: false | ||
}, | ||
|
||
options: { | ||
multipleSlots: true | ||
}, | ||
|
||
methods: { | ||
trigger(e) { | ||
const data = this.data; | ||
if (data.accordion) { | ||
this.triggerEvent('collapse', {name: data.name}, {composed: true, bubbles: true}); | ||
} else { | ||
this.setData({ | ||
showContent: data.showContent ? '' : 'i-collapse-item-show-content' | ||
}); | ||
} | ||
}, | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"i-icon": "../icon/index" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<view id="{{name}}" class="i-class i-collapse-item "> | ||
<view class="i-collapse-item-title-wrap" bindtap="trigger"> | ||
<i-icon size="16" type="enter" i-class="{{ showContent ? 'i-collapse-item-arrow-show' : 'i-collapse-item-arrow' }}"/> | ||
<text class="i-collapse-item-title i-class-title">{{title}}</text> | ||
</view> | ||
<view class="i-collapse-item-content {{showContent}} i-class-content"> | ||
<slot name="content"></slot> | ||
</view> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.i-collapse-item{padding:2px 8px;border-top:1px solid #dddee1}.i-collapse-item-title{vertical-align:middle}.i-collapse-item-title-wrap{padding:2px 0 0}.i-collapse-item-content{padding:6px;display:none}.i-collapse-item-show-content{display:block}.i-collapse-item-arrow{transition:transform .2s ease-in-out}.i-collapse-item-arrow-show{transition:transform .2s ease-in-out;transform:rotate(90deg)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Component({ | ||
externalClasses: ['i-class'], | ||
|
||
relations: { | ||
'../collapse-item/index': { | ||
type: 'child' | ||
} | ||
}, | ||
properties: { | ||
name: String, | ||
accordion: Boolean | ||
}, | ||
methods: { | ||
clickfn(e) { | ||
const params = e.detail; | ||
const allList = this.getRelationNodes('../collapse-item/index'); | ||
allList.forEach((item) => { | ||
if (params.name === item.data.name) { | ||
item.setData({ | ||
showContent: 'i-collapse-item-show-content' | ||
}); | ||
} else { | ||
item.setData({ | ||
showContent: '' | ||
}); | ||
} | ||
}); | ||
}, | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"component": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<view class="i-class i-collapse" bindcollapse="clickfn"> | ||
<slot></slot> | ||
</view> | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
Component({ | ||
properties: { | ||
target: Number, | ||
showDay: Boolean, | ||
callback: String, | ||
format: Array, | ||
clearTimer: Boolean | ||
}, | ||
externalClasses: ['countdown-class'], | ||
data: { | ||
time: '', | ||
resultFormat: [], | ||
changeFormat: false | ||
}, | ||
ready() { | ||
this.getFormat(); | ||
|
||
}, | ||
methods: { | ||
getFormat() { | ||
const data = this.data; | ||
const len = data.format.length; | ||
|
||
if (!data.showDay) data.resultFormat.push(''); | ||
|
||
if (len >= 3) { | ||
for (let i = 0; i < len; i++) { | ||
if (data.resultFormat.length >= 4) break; | ||
if (data.format[i]) { | ||
data.resultFormat.push(data.format[i].toString()); | ||
} | ||
} | ||
|
||
if (data.resultFormat.length >= 4) data.changeFormat = true; | ||
} | ||
|
||
this.getLastTime(); | ||
}, | ||
init() { | ||
const self = this; | ||
setTimeout(function () { | ||
self.getLastTime.call(self); | ||
}, 1000); | ||
}, | ||
getLastTime() { | ||
const data = this.data; | ||
const gapTime = Math.ceil((data.target - new Date().getTime()) / 1000); | ||
let result = ''; | ||
let time = '00:00:00'; | ||
let day = '00'; | ||
const format = data.resultFormat; | ||
|
||
if (gapTime > 0) { | ||
day = this.formatNum(parseInt(gapTime / 86400)); | ||
let lastTime = gapTime % 86400; | ||
const hour = this.formatNum(parseInt(lastTime / 3600)); | ||
lastTime = lastTime % 3600; | ||
const minute = this.formatNum(parseInt(lastTime / 60)); | ||
const second = this.formatNum(lastTime % 60); | ||
|
||
if (data.changeFormat) time = `${hour}${format[1]}${minute}${format[2]}${second}${format[3]}`; | ||
else time = `${hour}:${minute}:${second}`; | ||
|
||
if (!data.clearTimer) this.init.call(this); | ||
} else { | ||
this.endfn(); | ||
} | ||
|
||
if (data.showDay) { | ||
if (data.changeFormat) { | ||
result = `${day}${format[0]} ${time}`; | ||
} else { | ||
result = `${day}d ${time}`; | ||
} | ||
} else { | ||
result = time; | ||
} | ||
this.setData({ | ||
time: result | ||
}); | ||
|
||
}, | ||
formatNum(num) { | ||
return num > 9 ? num : `0${num}`; | ||
}, | ||
endfn() { | ||
this.triggerEvent('callback', {}); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
{ | ||
"component": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<text class="countdown-class"> | ||
{{time}} | ||
</text> | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Component({ | ||
externalClasses: ['i-class'], | ||
properties: { | ||
content: { | ||
type: String, | ||
value: '' | ||
}, | ||
height : { | ||
type: Number, | ||
value: 48 | ||
}, | ||
color : { | ||
type : String, | ||
value : '#80848f' | ||
}, | ||
lineColor : { | ||
type : String, | ||
value : '#e9eaec' | ||
}, | ||
size : { | ||
type: String, | ||
value: 12 | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"component": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<view class="i-divider i-class" style="{{parse.getStyle(color,size,height)}}"> | ||
<view class="i-divider-content" wx:if="{{content !== ''}}"> | ||
{{content}} | ||
</view> | ||
<view class="i-divider-content" wx:else> | ||
<slot></slot> | ||
</view> | ||
<view class="i-divider-line" style="background:{{lineColor}}"></view> | ||
</view> | ||
<wxs module="parse"> | ||
module.exports = { | ||
getStyle : function(color,size,height){ | ||
var color = 'color:' + color +';'; | ||
var size = 'font-size:' + size + 'px;'; | ||
var height = 'height:' + height+'px;' | ||
return color + size + height; | ||
} | ||
} | ||
</wxs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.i-divider{width:100%;text-align:center;font-size:12px;position:relative;display:flex;align-items:center;justify-content:center}.i-divider-line{position:absolute;left:0;width:100%;height:1rpx;background-color:#f7f7f7;top:50%}.i-divider-content{background:#fff;position:relative;z-index:1;display:inline-block;padding:0 10px} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.i-drawer{visibility:hidden}.i-drawer-show{visibility:visible}.i-drawer-show .i-drawer-mask{display:block}.i-drawer-show .i-drawer-container{opacity:1}.i-drawer-show.i-drawer-left .i-drawer-container,.i-drawer-show.i-drawer-right .i-drawer-container{transform:translate3d(0,-50%,0)}.i-drawer-mask{display:none;position:fixed;top:0;left:0;right:0;bottom:0;z-index:6;background:rgba(0,0,0,.6)}.i-drawer-container{position:fixed;left:50%;top:50%;transform:translate3d(-50%,-50%,0);transform-origin:center;transition:all .4s ease;z-index:7;opacity:0}.i-drawer-left .i-drawer-container{left:0;top:50%;transform:translate3d(-100%,-50%,0)}.i-drawer-right .i-drawer-container{right:0;top:50%;left:auto;transform:translate3d(100%,-50%,0)} | ||
.i-drawer{visibility:hidden}.i-drawer-show{visibility:visible}.i-drawer-show .i-drawer-mask{display:block;opacity:1}.i-drawer-show .i-drawer-container{opacity:1}.i-drawer-show.i-drawer-left .i-drawer-container,.i-drawer-show.i-drawer-right .i-drawer-container{transform:translate3d(0,-50%,0)}.i-drawer-mask{opacity:0;position:fixed;top:0;left:0;right:0;bottom:0;z-index:6;background:rgba(0,0,0,.6);transition:all .3s ease-in-out}.i-drawer-container{position:fixed;left:50%;top:50%;transform:translate3d(-50%,-50%,0);transform-origin:center;transition:all .3s ease-in-out;z-index:7;opacity:0}.i-drawer-left .i-drawer-container{left:0;top:50%;transform:translate3d(-100%,-50%,0)}.i-drawer-right .i-drawer-container{right:0;top:50%;left:auto;transform:translate3d(100%,-50%,0)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<view class="i-class i-grid-label"><slot></slot></view> | ||
<view class="i-class i-grid-label"><slot></slot></view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<view class="i-class i-icon i-icon-{{ type }}" style="font-size: {{ size }}px; {{ color ? 'color:' + color : '' }}"></view> | ||
<view class="i-class i-icon {{ type === '' ? '' : 'i-icon-' + type }} {{ custom }}" style="font-size: {{ size }}px; {{ color ? 'color:' + color : '' }}"></view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Component({ | ||
externalClasses: ['i-class'], | ||
properties : { | ||
name : { | ||
type : String, | ||
value : '' | ||
} | ||
}, | ||
relations : { | ||
'../index/index' : { | ||
type : 'parent' | ||
} | ||
}, | ||
data : { | ||
top : 0, | ||
height : 0, | ||
currentName : '' | ||
}, | ||
methods: { | ||
updateDataChange() { | ||
const className = '.i-index-item'; | ||
const query = wx.createSelectorQuery().in(this); | ||
query.select( className ).boundingClientRect((res)=>{ | ||
this.setData({ | ||
top : res.top, | ||
height : res.height, | ||
currentName : this.data.name | ||
}) | ||
}).exec() | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"component": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<view class="i-index-item i-class"> | ||
<view class="i-index-item-header">{{name}}</view> | ||
<view class="i-index-item-content"> | ||
<slot></slot> | ||
</view> | ||
</view> | ||
<wxs module="parse"> | ||
module.exports = { | ||
|
||
} | ||
</wxs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.i-index-item-header{height:30px;line-height:30px;background:#eee;font-size:14px;padding-left:10px;width:100%;box-sizing:border-box}.i-index-item-content{font-size:14px} |
Oops, something went wrong.