├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── app.js ├── app.json ├── app.less ├── app.wxss ├── components ├── image-cropper │ ├── image-cropper.js │ ├── image-cropper.json │ ├── image-cropper.wxml │ └── image-cropper.wxss ├── share-menu │ ├── index.js │ ├── index.json │ ├── index.less │ ├── index.wxml │ └── index.wxss ├── share-to-friend │ ├── index.js │ ├── index.json │ ├── index.less │ ├── index.wxml │ └── index.wxss ├── w-block-item │ ├── w-block-item.js │ ├── w-block-item.json │ ├── w-block-item.wxml │ └── w-block-item.wxss ├── w-list-item │ ├── w-list-item.js │ ├── w-list-item.json │ ├── w-list-item.wxml │ └── w-list-item.wxss ├── w-mask │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── w-modals-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── w-moments-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── w-runs-item │ ├── index.js │ ├── index.json │ ├── index.less │ ├── index.wxml │ └── index.wxss ├── config.js ├── dist ├── action-sheet │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── alert │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── avatar │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── badge │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── base │ └── index.js ├── button │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── card │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── cell-group │ ├── index.js │ ├── index.json │ └── index.wxml ├── cell │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── checkbox-group │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── checkbox │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── col │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── collapse-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── collapse │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── count-down │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── divider │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── drawer │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── grid-icon │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── grid-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── grid-label │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── grid │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── icon │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── index-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── index │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── input-number │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── input │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── load-more │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── message │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── modal │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── notice-bar │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── page │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── panel │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── progress │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── radio-group │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── radio │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── rate │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── row │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── slide │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── spin │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── step │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── steps │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── sticky-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── sticky │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── swipeout │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── switch │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── tab-bar-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── tab-bar │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── tab │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── tabs │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── tag │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── toast │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── docs └── index.html ├── imgs ├── default │ ├── boy.jpg │ ├── girl.jpg │ └── sharebg.png ├── empty.png ├── ercode.jpg ├── hot.png ├── pyq.png ├── run.png ├── run │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── photo.png │ └── ranking.png ├── share.png ├── slidemenu.png ├── tabbar │ ├── moments-w.png │ ├── moments.png │ ├── pub-w.png │ ├── pub.png │ ├── run-w.png │ ├── run.png │ ├── user-w.png │ └── user.png ├── test │ └── modal.png ├── userbg.jpg └── wx.png ├── package-lock.json ├── package.json ├── pages ├── moments │ ├── messages │ │ ├── messages.js │ │ ├── messages.json │ │ ├── messages.less │ │ ├── messages.wxml │ │ └── messages.wxss │ ├── moments.js │ ├── moments.json │ ├── moments.less │ ├── moments.wxml │ ├── moments.wxss │ └── newMoment │ │ ├── newMoment.js │ │ ├── newMoment.json │ │ ├── newMoment.wxml │ │ └── newMoment.wxss ├── pub │ ├── blockDetail │ │ ├── blockDetail.js │ │ ├── blockDetail.json │ │ ├── blockDetail.wxml │ │ └── blockDetail.wxss │ ├── blockMore │ │ ├── blockmore.js │ │ ├── blockmore.json │ │ ├── blockmore.wxml │ │ └── blockmore.wxss │ ├── listDetail │ │ ├── listDetail.js │ │ ├── listDetail.json │ │ ├── listDetail.wxml │ │ └── listDetail.wxss │ ├── listMore │ │ ├── listmore.js │ │ ├── listmore.json │ │ ├── listmore.wxml │ │ └── listmore.wxss │ ├── pub.js │ ├── pub.json │ ├── pub.wxml │ └── pub.wxss ├── run │ ├── run.js │ ├── run.json │ ├── run.wxml │ ├── run.wxss │ └── sharePage │ │ ├── sharePage.js │ │ ├── sharePage.json │ │ ├── sharePage.less │ │ ├── sharePage.wxml │ │ └── sharePage.wxss └── user │ ├── edit │ ├── edit.js │ ├── edit.json │ ├── edit.wxml │ └── edit.wxss │ ├── modals │ ├── modals.js │ ├── modals.json │ ├── modals.less │ ├── modals.wxml │ └── modals.wxss │ ├── myMoments │ ├── myMoments.js │ ├── myMoments.json │ ├── myMoments.less │ ├── myMoments.wxml │ └── myMoments.wxss │ ├── myRuns │ ├── myRuns.js │ ├── myRuns.json │ ├── myRuns.less │ ├── myRuns.wxml │ └── myRuns.wxss │ ├── privacy │ ├── privacy.js │ ├── privacy.json │ ├── privacy.less │ ├── privacy.wxml │ └── privacy.wxss │ ├── setting │ ├── setting.js │ ├── setting.json │ ├── setting.less │ ├── setting.wxml │ └── setting.wxss │ ├── user.js │ ├── user.json │ ├── user.wxml │ ├── user.wxss │ └── userPage │ ├── userPage.js │ ├── userPage.json │ ├── userPage.less │ ├── userPage.wxml │ └── userPage.wxss ├── project.config.json ├── sitemap.json ├── theme ├── theme.less └── theme.wxss ├── utils ├── share.js ├── shareOld.js ├── time2cn.js └── util.js └── voice └── countDown.mp3 /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows 2 | [Dd]esktop.ini 3 | Thumbs.db 4 | $RECYCLE.BIN/ 5 | 6 | # macOS 7 | .DS_Store 8 | .fseventsd 9 | .Spotlight-V100 10 | .TemporaryItems 11 | .Trashes 12 | 13 | # Node.js 14 | node_modules/ 15 | 16 | # Mini program 17 | miniprogram_npm/ 18 | project.config.json 19 | project.private.config.json 20 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "less.compile": { 3 | "out": true, //输出编译 4 | "compress": false, //压缩 5 | "sourceMap": false, //生成source map 6 | "outExt": ".wxss", //输出后缀 7 | "relativeUrls": true //使用相对路径 8 | } 9 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Patrick-Jun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /app.less: -------------------------------------------------------------------------------- 1 | @import 'theme/theme.less'; 2 | 3 | page{ 4 | // button 5 | --button-info-background-color: @theme; 6 | --button-info-border-color: @theme; 7 | --button-primary-background-color: @primary; 8 | --button-primary-border-color: @primary; 9 | --button-danger-background-color: @danger; 10 | --button-danger-border-color: @danger; 11 | --button-warning-background-color: @warning; 12 | --button-warning-border-color: @warning; 13 | 14 | // 提示框 15 | --notify-primary-background-color: @primary; 16 | --notify-success-background-color: @theme-light; 17 | --notify-danger-background-color: @danger; 18 | --notify-warning-background-color: @warning; 19 | 20 | // radio 21 | // --radio-border-color: @gray-5; 22 | --radio-transition-duration: 0.2s; 23 | --radio-label-margin: 10px; 24 | --radio-checked-icon-color: @theme; 25 | 26 | // Switch 27 | // --switch-node-background-color: @white; 28 | // --switch-background-color: @white; 29 | --switch-on-background-color: @theme; 30 | // --switch-border: 1px solid rgba(0, 0, 0, 0.1); 31 | 32 | // Tag 33 | // --tag-text-color: white; 34 | // --tag-border-radius: 0.2em; 35 | --tag-dander-color: @danger; 36 | --tag-primary-color: @primary; 37 | --tag-success-color: @theme; 38 | --tag-warning-color: @warning; 39 | // --tag-plain-background-color: white; 40 | } 41 | .container { 42 | height: 100%; 43 | display: flex; 44 | flex-direction: column; 45 | align-items: center; 46 | justify-content: space-between; 47 | padding: 200rpx 0; 48 | box-sizing: border-box; 49 | } 50 | .text-over{ 51 | overflow: hidden; 52 | text-overflow: ellipsis; 53 | white-space: nowrap; 54 | } 55 | .loading{ 56 | margin-top: 50%; 57 | width: 100%; 58 | } 59 | -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /* 主题 /theme/theme.less */ 2 | page { 3 | --button-info-background-color: #63b7af; 4 | --button-info-border-color: #63b7af; 5 | --button-primary-background-color: #6886c5; 6 | --button-primary-border-color: #6886c5; 7 | --button-danger-background-color: #ffacb7; 8 | --button-danger-border-color: #ffacb7; 9 | --button-warning-background-color: #ffe0ac; 10 | --button-warning-border-color: #ffe0ac; 11 | --notify-primary-background-color: #6886c5; 12 | --notify-success-background-color: #abf0e9; 13 | --notify-danger-background-color: #ffacb7; 14 | --notify-warning-background-color: #ffe0ac; 15 | --radio-transition-duration: 0.2s; 16 | --radio-label-margin: 10px; 17 | --radio-checked-icon-color: #63b7af; 18 | --switch-on-background-color: #63b7af; 19 | --tag-dander-color: #ffacb7; 20 | --tag-primary-color: #6886c5; 21 | --tag-success-color: #63b7af; 22 | --tag-warning-color: #ffe0ac; 23 | } 24 | .container { 25 | height: 100%; 26 | display: flex; 27 | flex-direction: column; 28 | align-items: center; 29 | justify-content: space-between; 30 | padding: 200rpx 0; 31 | box-sizing: border-box; 32 | } 33 | .text-over { 34 | overflow: hidden; 35 | text-overflow: ellipsis; 36 | white-space: nowrap; 37 | } 38 | .loading { 39 | margin-top: 50%; 40 | width: 100%; 41 | } 42 | -------------------------------------------------------------------------------- /components/image-cropper/image-cropper.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/image-cropper/image-cropper.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /components/share-menu/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-popup": "@vant/weapp/popup/index", 5 | "van-cell": "@vant/weapp/cell/index", 6 | "van-cell-group": "@vant/weapp/cell-group/index" 7 | } 8 | } -------------------------------------------------------------------------------- /components/share-menu/index.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/components/share-menu/index.less -------------------------------------------------------------------------------- /components/share-menu/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | {{img}} 14 | 15 | 19 | 20 | 21 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /components/share-menu/index.wxss: -------------------------------------------------------------------------------- 1 | /* components/share-menu/index.wxss */ -------------------------------------------------------------------------------- /components/share-to-friend/index.js: -------------------------------------------------------------------------------- 1 | // components/share-to-friend/index.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | show: { 8 | type: Boolean, 9 | value: false 10 | } 11 | }, 12 | 13 | /** 14 | * 组件的初始数据 15 | */ 16 | data: { 17 | 18 | }, 19 | 20 | /** 21 | * 组件的方法列表 22 | */ 23 | methods: { 24 | 25 | } 26 | }) 27 | -------------------------------------------------------------------------------- /components/share-to-friend/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "w-mask": "/components/w-mask/index" 5 | } 6 | } -------------------------------------------------------------------------------- /components/share-to-friend/index.less: -------------------------------------------------------------------------------- 1 | .guide-item{ 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | .img{ 6 | margin-left: 300rpx; 7 | width: 300rpx; 8 | height: 300rpx; 9 | } 10 | .text{ 11 | width: 100%; 12 | font-size: 36rpx; 13 | letter-spacing: 2px; 14 | text-align: center; 15 | } 16 | } -------------------------------------------------------------------------------- /components/share-to-friend/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 点击这里添加小程序,或分享给朋友 5 | 6 | -------------------------------------------------------------------------------- /components/share-to-friend/index.wxss: -------------------------------------------------------------------------------- 1 | .guide-item { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | .guide-item .img { 7 | margin-left: 300rpx; 8 | width: 300rpx; 9 | height: 300rpx; 10 | } 11 | .guide-item .text { 12 | width: 100%; 13 | font-size: 36rpx; 14 | letter-spacing: 2px; 15 | text-align: center; 16 | } 17 | -------------------------------------------------------------------------------- /components/w-block-item/w-block-item.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | properties: { 3 | imgUrl: { 4 | type: String, 5 | value: "" 6 | }, 7 | textContent: { 8 | type: String, 9 | value: "" 10 | }, 11 | imgLink:{ 12 | type:String, 13 | value:"" 14 | } 15 | }, 16 | data: { 17 | // 这里是一些组件内部数据 18 | }, 19 | methods: { 20 | // 这里是一个自定义方法 21 | 22 | } 23 | }) -------------------------------------------------------------------------------- /components/w-block-item/w-block-item.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/w-block-item/w-block-item.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{textContent}} 9 | 10 | 11 | -------------------------------------------------------------------------------- /components/w-block-item/w-block-item.wxss: -------------------------------------------------------------------------------- 1 | .list { 2 | height: 450rpx; 3 | width: 330rpx; 4 | margin: 12rpx 0; 5 | background: rgb(240, 240, 240); 6 | } 7 | .list-img { 8 | width: 330rpx; 9 | height: 340rpx; 10 | margin: auto; 11 | } 12 | .list-img image{ 13 | width: 100%; 14 | height: 100%; 15 | } 16 | .list-text { 17 | /* width: 450rpx; */ 18 | padding:0 20rpx; 19 | color: #444; 20 | } 21 | .list-text text { 22 | display: block; 23 | text-align: center; 24 | vertical-align: middle; 25 | width: 300rpx; 26 | height: 100rpx; 27 | line-height: 100rpx; 28 | overflow: hidden; 29 | text-overflow: ellipsis; 30 | white-space: nowrap; 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /components/w-list-item/w-list-item.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | properties: { 3 | imgUrl: { 4 | type: String, 5 | value: "" 6 | }, 7 | textContent: { 8 | type: String, 9 | value: "" 10 | }, 11 | imgLink: { 12 | type: String, 13 | value: "" 14 | } 15 | }, 16 | data: { 17 | // 这里是一些组件内部数据 18 | }, 19 | methods: { 20 | // 这里是一个自定义方法 21 | 22 | } 23 | }) -------------------------------------------------------------------------------- /components/w-list-item/w-list-item.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/w-list-item/w-list-item.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{textContent}} 10 | 11 | 12 | -------------------------------------------------------------------------------- /components/w-list-item/w-list-item.wxss: -------------------------------------------------------------------------------- 1 | .list { 2 | height: 200rpx; 3 | display: flex; 4 | justify-content: space-between; 5 | align-items: center; 6 | border: 1rpx rgb(240, 240, 240) solid; 7 | margin: 12rpx 0; 8 | /* background: rgb(240, 240, 240); */ 9 | 10 | } 11 | .list-img { 12 | width: 200rpx; 13 | height: 100rpx; 14 | padding: 20rpx; 15 | } 16 | .list-img image{ 17 | width: 100%; 18 | height: 100%; 19 | } 20 | .list-text { 21 | width: 450rpx; 22 | padding: 0 50rpx; 23 | color: #444; 24 | 25 | } 26 | .list-text text { 27 | overflow: hidden; 28 | text-overflow: ellipsis; 29 | display:-webkit-box; /*将对象作为弹性伸缩盒子模型显示;*/ 30 | -webkit-line-clamp:2; /*设置文本显示两行*/ 31 | -webkit-box-orient:vertical; /*从上到下排列子元素;*/ 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /components/w-mask/index.js: -------------------------------------------------------------------------------- 1 | // components/jun-mask.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | show: { 8 | type: Boolean, 9 | value: false 10 | }, 11 | }, 12 | 13 | /** 14 | * 组件的初始数据 15 | */ 16 | data: { 17 | 18 | }, 19 | 20 | /** 21 | * 组件的方法列表 22 | */ 23 | methods: { 24 | onClose() { 25 | this.setData({ show: false }) 26 | this.triggerEvent('onClose', {}, { bubbles: true }) 27 | } 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /components/w-mask/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/w-mask/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /components/w-mask/index.wxss: -------------------------------------------------------------------------------- 1 | /* components/jun-mask.wxss */ 2 | /* 遮罩层 */ 3 | .jun-mask{ 4 | position: fixed; 5 | left: 0;right: 0;top: 0;bottom: 0; 6 | color: white; 7 | background-color: rgba(0, 0, 0, 0.66); 8 | z-index: 9999; 9 | } -------------------------------------------------------------------------------- /components/w-modals-item/index.js: -------------------------------------------------------------------------------- 1 | // components/w-modals-item/index.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | medal: { 8 | type: Object, //数据类型 9 | value: null //默认值 10 | } 11 | }, 12 | 13 | /** 14 | * 组件的初始数据 15 | */ 16 | data: { 17 | isShowDetail: false, 18 | data: {} //用于展示 19 | }, 20 | 21 | /** 22 | * 生命周期 23 | */ 24 | attached: function() { 25 | let that = this; 26 | //整理传入数据 27 | that.setData({ 28 | data: that.properties.medal 29 | }) 30 | }, 31 | 32 | /** 33 | * 组件的方法列表 34 | */ 35 | methods: { 36 | showDetail: function(){ 37 | this.setData({ isShowDetail:true }) 38 | }, 39 | onClose: function(){ 40 | this.setData({ isShowDetail:false }) 41 | } 42 | } 43 | }) 44 | -------------------------------------------------------------------------------- /components/w-modals-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-tag": "@vant/weapp/tag/index", 5 | "van-popup": "@vant/weapp/popup/index" 6 | } 7 | } -------------------------------------------------------------------------------- /components/w-modals-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ data.length }} 5 | 6 | 7 | 12 | {{ data[0].name }} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | {{ data[0].name }} 26 | {{ data[0].type == 1 ? '累计获得:'+data.length+'枚' : '(不可重复获得)'}} 27 | {{ data[0].desc }} 28 | {{ data[data.length-1].created_at }} 29 | 30 | -------------------------------------------------------------------------------- /components/w-modals-item/index.wxss: -------------------------------------------------------------------------------- 1 | /* 累计获得次数 */ 2 | .count{ 3 | position: absolute; 4 | top: 30rpx; 5 | right: 20rpx; 6 | z-index: 10; 7 | } 8 | 9 | /* 图片 */ 10 | .img{ 11 | position: relative; 12 | text-align: center; 13 | width: 100%; 14 | } 15 | /* 勋章名称 */ 16 | .name{ 17 | width: 100%; 18 | font-size: 24rpx; 19 | color: #747272; 20 | /* white-space: nowrap !important; 21 | overflow: hidden !important; 22 | text-overflow: ellipsis !important; */ 23 | } 24 | 25 | /* 详细显示 */ 26 | .detail{ 27 | width: 560rpx; 28 | height: 720rpx; 29 | } 30 | .d-img{ 31 | width: 100%; 32 | text-align: center; 33 | margin-top: 70rpx; 34 | } 35 | .d-name{ 36 | width: 100%; 37 | margin-top: 10rpx; 38 | text-align: center; 39 | font-size: 38rpx; 40 | color: blueviolet; 41 | font-weight: 700; 42 | } 43 | .d-count{ 44 | width: 100%; 45 | text-align: center; 46 | font-size: 24rpx; 47 | color: #919191; 48 | } 49 | .d-desc{ 50 | margin: 30rpx auto; 51 | width: 80%; 52 | border: rgb(233, 231, 229) 1px solid; 53 | padding: 12rpx 30rpx; 54 | border-radius: 5px; 55 | min-height: 200rpx; 56 | font-size: 30rpx; 57 | color: #504e4e; 58 | } 59 | .d-time{ 60 | width: 100%; 61 | position: absolute; 62 | bottom: 50rpx; 63 | text-align: center; 64 | font-size: 22rpx; 65 | color: #afabab; 66 | } -------------------------------------------------------------------------------- /components/w-moments-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "@vant/weapp/icon/index", 5 | "van-transition": "@vant/weapp/transition/index", 6 | "van-popup": "@vant/weapp/popup/index", 7 | "van-tag": "@vant/weapp/tag/index" 8 | } 9 | } -------------------------------------------------------------------------------- /components/w-runs-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-popup": "@vant/weapp/popup/index" 5 | } 6 | } -------------------------------------------------------------------------------- /components/w-runs-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | {{ runobj.day + ' ' + runobj.distance + ' km' }} 12 | {{ runobj.day + ' ' }}未完成 13 | 14 | {{ ' ' + runobj.timeRun }} 15 | {{ ' ' + runobj.speed }} 16 | 17 | 18 | 19 | {{ runobj.time }} 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 最高配速:{{ runobj.speed_top || '--' }} 34 | 最低配速:{{ runobj.speed_low || '--' }} 35 | 开始时间:{{ runobj.time_start }} 36 | 结束时间:{{ runobj.time_end || '--' }} 37 | 38 | 39 | 删除记录 40 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /components/w-runs-item/index.wxss: -------------------------------------------------------------------------------- 1 | .run-item-box { 2 | width: 100%; 3 | margin-top: 25rpx; 4 | } 5 | .run-item-box .con { 6 | width: 92%; 7 | height: 120rpx; 8 | margin: 0 auto; 9 | border-radius: 60rpx; 10 | background-color: #f1f1f1; 11 | box-shadow: 5px 5px 5px rgba(104, 103, 103, 0.6); 12 | display: flex; 13 | flex-direction: row; 14 | align-items: center; 15 | } 16 | .run-item-box .con .icon { 17 | width: 106rpx; 18 | height: 90rpx; 19 | margin-left: 24rpx; 20 | background-color: orange; 21 | border-radius: 50%; 22 | } 23 | .run-item-box .con .data { 24 | width: 100%; 25 | display: flex; 26 | flex-direction: row; 27 | align-items: center; 28 | } 29 | .run-item-box .con .data .some { 30 | margin-left: 24rpx; 31 | height: 100rpx; 32 | } 33 | .run-item-box .con .data .some .totle { 34 | height: 65rpx; 35 | line-height: 65rpx; 36 | font-size: 32rpx; 37 | color: black; 38 | } 39 | .run-item-box .con .data .some .totle text { 40 | color: red; 41 | } 42 | .run-item-box .con .data .some .speed { 43 | height: 35rpx; 44 | line-height: 35rpx; 45 | font-size: 26rpx; 46 | color: gray; 47 | } 48 | .run-item-box .con .data .time { 49 | position: absolute; 50 | right: 90rpx; 51 | font-size: 32rpx; 52 | color: gray; 53 | } 54 | .run-item-box .con-hover { 55 | box-shadow: 3px 3px 3px rgba(104, 103, 103, 0.6); 56 | } 57 | .ml { 58 | margin-left: 20rpx; 59 | } 60 | /* 详细显示 */ 61 | .detail { 62 | width: 560rpx; 63 | height: 720rpx; 64 | position: relative; 65 | } 66 | .detail .d-img { 67 | position: relative; 68 | width: 100%; 69 | text-align: center; 70 | margin-top: 70rpx; 71 | } 72 | .detail .d-img #runImg { 73 | margin-left: 30rpx; 74 | } 75 | .detail .d-data { 76 | display: flex; 77 | flex-direction: column; 78 | margin: 10rpx 50rpx; 79 | } 80 | .detail .d-data .d-item { 81 | margin-top: 5rpx; 82 | font-size: 28rpx; 83 | } 84 | .detail .d-data .d-item text { 85 | font-size: 24rpx; 86 | color: gray; 87 | } 88 | .detail .d-btns { 89 | width: 100%; 90 | position: absolute; 91 | bottom: 30rpx; 92 | display: flex; 93 | flex-direction: row; 94 | justify-content: center; 95 | } 96 | .detail .d-btns .d-btn { 97 | margin-left: 30rpx; 98 | margin-right: 30rpx; 99 | } 100 | #runImg { 101 | position: fixed; 102 | left: -9999px; 103 | background-color: transparent; 104 | width: 500px; 105 | height: 400px; 106 | } 107 | -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 配置文件 3 | */ 4 | 5 | 6 | /** 7 | * 一下两个配置,根据自身情况选择其中一个 8 | * 配置1-适合体验预览项目:无需自己搭建后端服务,后端是项目作者启动的,不确定什么时候会停服,且数据都存储在项目作者服务器 9 | * 配置2-适合自用、二次开发:需要自己搭建后端项目 https://github.com/Chef5/PopRun-b 10 | */ 11 | 12 | 13 | // 配置1-适合体验预览项目 14 | export const hostUrl = 'https://dev.run.nunet.cn'; 15 | export const appInfo = { 16 | appid: '', // 自己小程序的appid 17 | secret: '', // 自己小程序的secret 18 | }; 19 | 20 | // 配置2-适合自用、二次开发 21 | // export const hostUrl = 'http://127.0.0.1:8000'; -------------------------------------------------------------------------------- /dist/action-sheet/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class', 'i-class-mask', 'i-class-header'], 3 | 4 | options: { 5 | multipleSlots: true 6 | }, 7 | 8 | properties: { 9 | visible: { 10 | type: Boolean, 11 | value: false 12 | }, 13 | maskClosable: { 14 | type: Boolean, 15 | value: true 16 | }, 17 | showCancel: { 18 | type: Boolean, 19 | value: false 20 | }, 21 | cancelText: { 22 | type: String, 23 | value: '取消' 24 | }, 25 | actions: { 26 | type: Array, 27 | value: [] 28 | } 29 | }, 30 | 31 | methods: { 32 | handleClickMask () { 33 | if (!this.data.maskClosable) return; 34 | this.handleClickCancel(); 35 | }, 36 | 37 | handleClickItem ({ currentTarget = {} }) { 38 | const dataset = currentTarget.dataset || {}; 39 | const { index } = dataset; 40 | this.triggerEvent('click', { index }); 41 | }, 42 | 43 | handleClickCancel () { 44 | this.triggerEvent('cancel'); 45 | } 46 | } 47 | }); 48 | -------------------------------------------------------------------------------- /dist/action-sheet/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-button": "../button/index", 6 | "i-icon": "../icon/index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /dist/action-sheet/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | {{ item.name }} 17 | 18 | 19 | 20 | 21 | {{ cancelText }} 22 | 23 | 24 | -------------------------------------------------------------------------------- /dist/action-sheet/index.wxss: -------------------------------------------------------------------------------- 1 | .i-as{position:fixed;width:100%;box-sizing:border-box;left:0;right:0;bottom:0;background:#f7f7f7;transform:translate3d(0,100%,0);transform-origin:center;transition:all .2s ease-in-out;z-index:900;visibility:hidden}.i-as-show{transform:translate3d(0,0,0);visibility:visible}.i-as-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);z-index:900;transition:all .2s ease-in-out;opacity:0;visibility:hidden}.i-as-mask-show{opacity:1;visibility:visible}.i-as-action-item{position:relative}.i-as-action-item::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-as-header{background:#fff;text-align:center;position:relative;font-size:12px;color:#80848f}.i-as-header::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-as-cancel{margin-top:6px}.i-as-btn-loading{display:inline-block;vertical-align:middle;margin-right:10px;width:12px;height:12px;background:0 0;border-radius:50%;border:2px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-as-btn-text{display:inline-block;vertical-align:middle}.i-as-btn-icon{font-size:14px!important;margin-right:4px}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} -------------------------------------------------------------------------------- /dist/alert/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | options: { 4 | multipleSlots: true 5 | }, 6 | properties: { 7 | //info, success, warning, error 8 | type: { 9 | type: String, 10 | value: 'info' 11 | }, 12 | closable: { 13 | type: Boolean, 14 | value: false 15 | }, 16 | showIcon: { 17 | type: Boolean, 18 | default: false 19 | }, 20 | desc: { 21 | type: Boolean, 22 | default: false 23 | }, 24 | }, 25 | data: { 26 | closed: false 27 | }, 28 | methods: { 29 | handleTap() { 30 | this.setData({ 31 | closed: !this.data.closed, 32 | }); 33 | this.triggerEvent('close'); 34 | }, 35 | 36 | } 37 | }); 38 | -------------------------------------------------------------------------------- /dist/alert/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-icon": "../icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/alert/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dist/alert/index.wxss: -------------------------------------------------------------------------------- 1 | .i-alert{position:relative;margin:10px;padding:8px 48px 8px 16px;font-size:14px;border-radius:2px;color:#fff;background:#f7f7f7;color:#495060}.i-alert.i-alert-with-icon{padding:8px 48px 8px 38px}.i-alert-info{color:#fff;background:#2db7f5}.i-alert-success{color:#fff;background:#19be6b}.i-alert-warning{color:#fff;background:#f90}.i-alert-error{color:#fff;background:#ed3f14}.i-alert-icon{position:absolute;top:9px;left:16px;font-size:14px}.i-alert-desc{font-size:12px}.i-alert-with-desc{padding:16px;position:relative}.i-alert-with-desc.i-alert-with-icon{padding:16px 16px 16px 69px}.i-alert-with-desc .i-alert-icon{top:50%;left:24px;margin-top:-21px;font-size:28px}.i-alert-close{font-size:12px;position:absolute;right:16px;top:8px;overflow:hidden;cursor:pointer} -------------------------------------------------------------------------------- /dist/avatar/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | properties: { 5 | // circle || square 6 | shape: { 7 | type: String, 8 | value: 'circle' 9 | }, 10 | // small || large || default 11 | size: { 12 | type: String, 13 | value: 'default' 14 | }, 15 | src: { 16 | type: String, 17 | value: '' 18 | } 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /dist/avatar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/avatar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /dist/avatar/index.wxss: -------------------------------------------------------------------------------- 1 | .i-avatar{display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:32px;height:32px;line-height:32px;border-radius:16px;font-size:18px}.i-avatar .ivu-avatar-string{line-height:32px}.i-avatar-large{width:40px;height:40px;line-height:40px;border-radius:20px;font-size:24px}.i-avatar-large .ivu-avatar-string{line-height:40px}.i-avatar-small{width:24px;height:24px;line-height:24px;border-radius:12px;font-size:14px}.i-avatar-small .ivu-avatar-string{line-height:24px}.i-avatar-image{background:0 0}.i-avatar-square{border-radius:4px}.i-avatar>image{width:100%;height:100%} -------------------------------------------------------------------------------- /dist/badge/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class', 'i-class-alone'], 3 | 4 | properties: { 5 | count: { 6 | type: Number, 7 | value: 0, 8 | observer: 'finalCount' 9 | }, 10 | overflowCount: { 11 | type: Number, 12 | value: 99 13 | }, 14 | dot: { 15 | type: Boolean, 16 | value: false 17 | }, 18 | }, 19 | data: { 20 | finalCount: 0 21 | }, 22 | methods: { 23 | finalCount() { 24 | this.setData({ 25 | finalCount: parseInt(this.data.count) >= parseInt(this.data.overflowCount) ? `${this.data.overflowCount}+` : this.data.count 26 | }); 27 | }, 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /dist/badge/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/badge/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ finalCount }} 5 | 6 | -------------------------------------------------------------------------------- /dist/badge/index.wxss: -------------------------------------------------------------------------------- 1 | .i-badge{position:relative;display:inline-block;line-height:1;vertical-align:middle}.i-badge-count{position:absolute;transform:translateX(50%);top:-6px;right:0;height:18px;border-radius:9px;min-width:18px;background:#ed3f14;border:1px solid transparent;color:#fff;line-height:18px;text-align:center;padding:0 5px;font-size:12px;white-space:nowrap;transform-origin:-10% center;z-index:10;box-shadow:0 0 0 1px #fff;box-sizing:border-box;text-rendering:optimizeLegibility}.i-badge-count-alone{top:auto;display:block;position:relative;transform:translateX(0)}.i-badge-dot{position:absolute;transform:translateX(-50%);transform-origin:0 center;top:-4px;right:-8px;height:8px;width:8px;border-radius:100%;background:#ed3f14;z-index:10;box-shadow:0 0 0 1px #fff} -------------------------------------------------------------------------------- /dist/base/index.js: -------------------------------------------------------------------------------- 1 | function getCtx (selector) { 2 | const pages = getCurrentPages(); 3 | const ctx = pages[pages.length - 1]; 4 | 5 | const componentCtx = ctx.selectComponent(selector); 6 | 7 | if (!componentCtx) { 8 | console.error('无法找到对应的组件,请按文档说明使用组件'); 9 | return null; 10 | } 11 | return componentCtx; 12 | } 13 | 14 | function Toast(options) { 15 | const { selector = '#toast' } = options; 16 | const ctx = getCtx(selector); 17 | 18 | ctx.handleShow(options); 19 | } 20 | 21 | Toast.hide = function (selector = '#toast') { 22 | const ctx = getCtx(selector); 23 | 24 | ctx.handleHide(); 25 | }; 26 | 27 | function Message(options) { 28 | const { selector = '#message' } = options; 29 | const ctx = getCtx(selector); 30 | 31 | ctx.handleShow(options); 32 | } 33 | 34 | module.exports = { 35 | $Toast: Toast, 36 | $Message: Message 37 | }; -------------------------------------------------------------------------------- /dist/button/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | properties: { 5 | // default, primary, ghost, info, success, warning, error 6 | type: { 7 | type: String, 8 | value: '', 9 | }, 10 | inline: { 11 | type: Boolean, 12 | value: false 13 | }, 14 | // default, large, small 15 | size: { 16 | type: String, 17 | value: '', 18 | }, 19 | // circle, square 20 | shape: { 21 | type: String, 22 | value: 'square' 23 | }, 24 | disabled: { 25 | type: Boolean, 26 | value: false, 27 | }, 28 | loading: { 29 | type: Boolean, 30 | value: false, 31 | }, 32 | long: { 33 | type: Boolean, 34 | value: false 35 | }, 36 | openType: String, 37 | appParameter: String, 38 | hoverStopPropagation: Boolean, 39 | hoverStartTime: { 40 | type: Number, 41 | value: 20 42 | }, 43 | hoverStayTime: { 44 | type: Number, 45 | value: 70 46 | }, 47 | lang: { 48 | type: String, 49 | value: 'en' 50 | }, 51 | sessionFrom: { 52 | type: String, 53 | value: '' 54 | }, 55 | sendMessageTitle: String, 56 | sendMessagePath: String, 57 | sendMessageImg: String, 58 | showMessageCard: Boolean 59 | }, 60 | 61 | methods: { 62 | handleTap () { 63 | if (this.data.disabled) return false; 64 | 65 | this.triggerEvent('click'); 66 | }, 67 | bindgetuserinfo({ detail = {} } = {}) { 68 | this.triggerEvent('getuserinfo', detail); 69 | }, 70 | bindcontact({ detail = {} } = {}) { 71 | this.triggerEvent('contact', detail); 72 | }, 73 | bindgetphonenumber({ detail = {} } = {}) { 74 | this.triggerEvent('getphonenumber', detail); 75 | }, 76 | binderror({ detail = {} } = {}) { 77 | this.triggerEvent('error', detail); 78 | } 79 | } 80 | }); 81 | -------------------------------------------------------------------------------- /dist/button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/button/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/button/index.wxss: -------------------------------------------------------------------------------- 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-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)}} -------------------------------------------------------------------------------- /dist/card/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | options: { 5 | multipleSlots: true 6 | }, 7 | 8 | properties: { 9 | full: { 10 | type: Boolean, 11 | value: false 12 | }, 13 | thumb: { 14 | type: String, 15 | value: '' 16 | }, 17 | title: { 18 | type: String, 19 | value: '' 20 | }, 21 | extra: { 22 | type: String, 23 | value: '' 24 | } 25 | } 26 | }); 27 | -------------------------------------------------------------------------------- /dist/card/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/card/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | {{ extra }} 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /dist/card/index.wxss: -------------------------------------------------------------------------------- 1 | .i-card{margin:0 16px;font-size:14px;overflow:hidden;position:relative;background:#fff;border:1rpx solid #dddee1;border-radius:5px}.i-card-full{margin:0;border-left:none;border-right:none;border-radius:0}.i-card-header{display:flex;padding:6px 16px;align-items:center}.i-card-header-content{flex:1;text-align:left}.i-card-header-thumb{display:inline-block;width:64px;height:64px;position:relative;margin-left:auto;margin-right:auto;overflow:hidden;background-size:cover;vertical-align:middle}.i-card-header-title{display:inline-block;vertical-align:middle;font-size:14px;color:#1c2438}.i-card-header-extra{flex:1;text-align:right;font-size:14px;color:#80848f}.i-card-body{position:relative;padding:6px 16px;color:#495060;font-size:14px}.i-card-body::before{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-card-footer{position:relative;padding:6px 16px;color:#80848f;font-size:12px} -------------------------------------------------------------------------------- /dist/cell-group/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../cell/index': { 6 | type: 'child', 7 | linked () { 8 | this._updateIsLastCell(); 9 | }, 10 | linkChanged () { 11 | this._updateIsLastCell(); 12 | }, 13 | unlinked () { 14 | this._updateIsLastCell(); 15 | } 16 | } 17 | }, 18 | 19 | methods: { 20 | _updateIsLastCell() { 21 | let cells = this.getRelationNodes('../cell/index'); 22 | const len = cells.length; 23 | 24 | if (len > 0) { 25 | let lastIndex = len - 1; 26 | 27 | cells.forEach((cell, index) => { 28 | cell.updateIsLastCell(index === lastIndex); 29 | }); 30 | } 31 | } 32 | } 33 | }); 34 | -------------------------------------------------------------------------------- /dist/cell-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/cell-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /dist/cell/index.js: -------------------------------------------------------------------------------- 1 | const warn = (msg, getValue) => { 2 | console.warn(msg); 3 | console.log('接受到的值为:', getValue); 4 | }; 5 | 6 | Component({ 7 | externalClasses: ['i-class'], 8 | 9 | options: { 10 | multipleSlots: true 11 | }, 12 | 13 | relations: { 14 | '../cell-group/index': { 15 | type: 'parent' 16 | } 17 | }, 18 | 19 | properties: { 20 | // 左侧标题 21 | title: { 22 | type: String 23 | }, 24 | // 标题下方的描述信息 25 | label: { 26 | type: String 27 | }, 28 | // 右侧内容 29 | value: { 30 | type: String 31 | }, 32 | // 只有点击 footer 区域才触发 tab 事件 33 | onlyTapFooter: { 34 | type: Boolean 35 | }, 36 | // 是否展示右侧箭头并开启尝试以 url 跳转 37 | isLink: { 38 | type: null, 39 | value: '' 40 | }, 41 | // 链接类型,可选值为 navigateTo,redirectTo,switchTab,reLaunch 42 | linkType: { 43 | type: String, 44 | value: 'navigateTo' 45 | }, 46 | url: { 47 | type: String, 48 | value: '' 49 | } 50 | }, 51 | 52 | data: { 53 | isLastCell: true 54 | }, 55 | 56 | methods: { 57 | navigateTo () { 58 | const { url } = this.data; 59 | const type = typeof this.data.isLink; 60 | 61 | this.triggerEvent('click', {}); 62 | 63 | if (!this.data.isLink || !url || url === 'true' || url === 'false') return; 64 | 65 | if (type !== 'boolean' && type !== 'string') { 66 | warn('isLink 属性值必须是一个字符串或布尔值', this.data.isLink); 67 | return; 68 | } 69 | 70 | if (['navigateTo', 'redirectTo', 'switchTab', 'reLaunch'].indexOf(this.data.linkType) === -1) { 71 | warn('linkType 属性可选值为 navigateTo,redirectTo,switchTab,reLaunch', this.data.linkType); 72 | return; 73 | } 74 | wx[this.data.linkType].call(wx, {url}); 75 | }, 76 | handleTap () { 77 | if (!this.data.onlyTapFooter) { 78 | this.navigateTo(); 79 | } 80 | }, 81 | 82 | updateIsLastCell (isLastCell) { 83 | this.setData({ isLastCell }); 84 | } 85 | } 86 | }); 87 | -------------------------------------------------------------------------------- /dist/cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/cell/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ title }} 7 | {{ label }} 8 | 9 | 10 | 11 | {{ value }} 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dist/cell/index.wxss: -------------------------------------------------------------------------------- 1 | .i-cell{position:relative;padding:12px 15px;display:flex;background:#fff;align-items:center;line-height:1.4;font-size:14px;overflow:hidden}.i-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px;left:15px;right:0}.i-cell-last::after{display:none}.i-cell-icon{margin-right:5px}.i-cell-icon:empty{display:none}.i-cell-bd{flex:1}.i-cell-text{line-height:24px;font-size:14px}.i-cell-desc{line-height:1.2;font-size:12px;color:#80848f}.i-cell-ft{position:relative;text-align:right;color:#495060}.i-cell-access .i-cell-ft{padding-right:13px}.i-cell-access .i-cell-ft::after{content:" ";display:inline-block;width:6px;height:6px;position:absolute;top:50%;right:2px;border-width:2px 2px 0 0;border-color:#dddee1;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)} -------------------------------------------------------------------------------- /dist/checkbox-group/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | relations: { 4 | '../checkbox/index': { 5 | type: 'child', 6 | linked() { 7 | this.changeCurrent(); 8 | }, 9 | linkChanged() { 10 | this.changeCurrent(); 11 | }, 12 | unlinked() { 13 | this.changeCurrent(); 14 | } 15 | } 16 | }, 17 | properties: { 18 | current: { 19 | type: Array, 20 | value: [], 21 | observer: 'changeCurrent' 22 | }, 23 | }, 24 | methods: { 25 | changeCurrent(val = this.data.current) { 26 | let items = this.getRelationNodes('../checkbox/index'); 27 | const len = items.length; 28 | if (len > 0) { 29 | items.forEach(item => { 30 | item.changeCurrent(val.indexOf(item.data.value) !== -1); 31 | }); 32 | } 33 | }, 34 | emitEvent(current) { 35 | this.triggerEvent('change', current); 36 | } 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /dist/checkbox-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-cell-group": "../cell-group/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/checkbox-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /dist/checkbox-group/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/dist/checkbox-group/index.wxss -------------------------------------------------------------------------------- /dist/checkbox/index.js: -------------------------------------------------------------------------------- 1 | const prefixCls = 'i-checkbox'; 2 | 3 | Component({ 4 | externalClasses: ['i-class'], 5 | relations: { 6 | '../checkbox-group/index': { 7 | type: 'parent' 8 | } 9 | }, 10 | properties: { 11 | value: { 12 | type: String, 13 | value: '' 14 | }, 15 | checked: { 16 | type: Boolean, 17 | value: false 18 | }, 19 | disabled: { 20 | type: Boolean, 21 | value: false 22 | }, 23 | color: { 24 | type: String, 25 | value: '#2d8cf0' 26 | }, 27 | position: { 28 | type: String, 29 | value: 'left', //left right 30 | observer: 'setPosition' 31 | } 32 | }, 33 | data: { 34 | checked: true, 35 | positionCls: `${prefixCls}-checkbox-left`, 36 | }, 37 | attached() { 38 | this.setPosition(); 39 | }, 40 | methods: { 41 | changeCurrent(current) { 42 | this.setData({ checked: current }); 43 | }, 44 | checkboxChange() { 45 | if (this.data.disabled) return; 46 | const item = { current: !this.data.checked, value: this.data.value }; 47 | const parent = this.getRelationNodes('../checkbox-group/index')[0]; 48 | parent ? parent.emitEvent(item) : this.triggerEvent('change', item); 49 | }, 50 | setPosition() { 51 | this.setData({ 52 | positionCls: this.data.position.indexOf('left') !== -1 ? `${prefixCls}-checkbox-left` : `${prefixCls}-checkbox-right`, 53 | }); 54 | } 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /dist/checkbox/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-cell": "../cell/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/checkbox/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dist/checkbox/index.wxss: -------------------------------------------------------------------------------- 1 | .i-checkbox-cell::after{display:block}.i-checkbox-checkbox-left{float:left}.i-checkbox-checkbox-right{float:right}.i-checkbox-radio{vertical-align:middle}.i-checkbox-title{display:inline-block;vertical-align:middle} -------------------------------------------------------------------------------- /dist/col/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../row/index': { 6 | type: 'parent' 7 | } 8 | }, 9 | 10 | properties: { 11 | span: { 12 | value: 0, 13 | type: Number 14 | }, 15 | offset: { 16 | value: 0, 17 | type: Number 18 | } 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /dist/col/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /dist/col/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/col/index.wxss: -------------------------------------------------------------------------------- 1 | .i-col{float:left;box-sizing:border-box;width:0}.i-col-span-1{display:block;width:4.16666667%}.i-col-offset-1{margin-left:4.16666667%}.i-col-span-2{display:block;width:8.33333333%}.i-col-offset-2{margin-left:8.33333333%}.i-col-span-3{display:block;width:12.5%}.i-col-offset-3{margin-left:12.5%}.i-col-span-4{display:block;width:16.66666667%}.i-col-offset-4{margin-left:16.66666667%}.i-col-span-5{display:block;width:20.83333333%}.i-col-offset-5{margin-left:20.83333333%}.i-col-span-6{display:block;width:25%}.i-col-offset-6{margin-left:25%}.i-col-span-7{display:block;width:29.16666667%}.i-col-offset-7{margin-left:29.16666667%}.i-col-span-8{display:block;width:33.33333333%}.i-col-offset-8{margin-left:33.33333333%}.i-col-span-9{display:block;width:37.5%}.i-col-offset-9{margin-left:37.5%}.i-col-span-10{display:block;width:41.66666667%}.i-col-offset-10{margin-left:41.66666667%}.i-col-span-11{display:block;width:45.83333333%}.i-col-offset-11{margin-left:45.83333333%}.i-col-span-12{display:block;width:50%}.i-col-offset-12{margin-left:50%}.i-col-span-13{display:block;width:54.16666667%}.i-col-offset-13{margin-left:54.16666667%}.i-col-span-14{display:block;width:58.33333333%}.i-col-offset-14{margin-left:58.33333333%}.i-col-span-15{display:block;width:62.5%}.i-col-offset-15{margin-left:62.5%}.i-col-span-16{display:block;width:66.66666667%}.i-col-offset-16{margin-left:66.66666667%}.i-col-span-17{display:block;width:70.83333333%}.i-col-offset-17{margin-left:70.83333333%}.i-col-span-18{display:block;width:75%}.i-col-offset-18{margin-left:75%}.i-col-span-19{display:block;width:79.16666667%}.i-col-offset-19{margin-left:79.16666667%}.i-col-span-20{display:block;width:83.33333333%}.i-col-offset-20{margin-left:83.33333333%}.i-col-span-21{display:block;width:87.5%}.i-col-offset-21{margin-left:87.5%}.i-col-span-22{display:block;width:91.66666667%}.i-col-offset-22{margin-left:91.66666667%}.i-col-span-23{display:block;width:95.83333333%}.i-col-offset-23{margin-left:95.83333333%}.i-col-span-24{display:block;width:100%}.i-col-offset-24{margin-left:100%} -------------------------------------------------------------------------------- /dist/collapse-item/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class-content', 'i-class-title', 'i-class'], 3 | 4 | relations: { 5 | '../collapse/index': { 6 | type: 'parent', 7 | linked: function (target) { 8 | const options = { 9 | accordion: target.data.accordion 10 | } 11 | if (target.data.name === this.data.name) { 12 | options.showContent = 'i-collapse-item-show-content'; 13 | } 14 | this.setData(options); 15 | } 16 | } 17 | }, 18 | 19 | properties: { 20 | title: String, 21 | name: String 22 | }, 23 | 24 | data: { 25 | showContent: '', 26 | accordion: false 27 | }, 28 | 29 | options: { 30 | multipleSlots: true 31 | }, 32 | 33 | methods: { 34 | trigger(e) { 35 | const data = this.data; 36 | if (data.accordion) { 37 | this.triggerEvent('collapse', {name: data.name}, {composed: true, bubbles: true}); 38 | } else { 39 | this.setData({ 40 | showContent: data.showContent ? '' : 'i-collapse-item-show-content' 41 | }); 42 | } 43 | }, 44 | } 45 | }); 46 | 47 | -------------------------------------------------------------------------------- /dist/collapse-item/index.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "component": true, 4 | "usingComponents": { 5 | "i-icon": "../icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/collapse-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{title}} 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dist/collapse-item/index.wxss: -------------------------------------------------------------------------------- 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)} -------------------------------------------------------------------------------- /dist/collapse/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../collapse-item/index': { 6 | type: 'child' 7 | } 8 | }, 9 | properties: { 10 | name: String, 11 | accordion: Boolean 12 | }, 13 | methods: { 14 | clickfn(e) { 15 | const params = e.detail; 16 | const allList = this.getRelationNodes('../collapse-item/index'); 17 | allList.forEach((item) => { 18 | if (params.name === item.data.name) { 19 | item.setData({ 20 | showContent: 'i-collapse-item-show-content' 21 | }); 22 | } else { 23 | item.setData({ 24 | showContent: '' 25 | }); 26 | } 27 | }); 28 | }, 29 | } 30 | }); 31 | 32 | -------------------------------------------------------------------------------- /dist/collapse/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/collapse/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dist/collapse/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/dist/collapse/index.wxss -------------------------------------------------------------------------------- /dist/count-down/index.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "component": true 4 | } 5 | -------------------------------------------------------------------------------- /dist/count-down/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{time}} 3 | 4 | 5 | -------------------------------------------------------------------------------- /dist/count-down/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/dist/count-down/index.wxss -------------------------------------------------------------------------------- /dist/divider/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties: { 4 | content: { 5 | type: String, 6 | value: '' 7 | }, 8 | height : { 9 | type: Number, 10 | value: 48 11 | }, 12 | color : { 13 | type : String, 14 | value : '#80848f' 15 | }, 16 | lineColor : { 17 | type : String, 18 | value : '#e9eaec' 19 | }, 20 | size : { 21 | type: String, 22 | value: 12 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /dist/divider/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/divider/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{content}} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | module.exports = { 12 | getStyle : function(color,size,height){ 13 | var color = 'color:' + color +';'; 14 | var size = 'font-size:' + size + 'px;'; 15 | var height = 'height:' + height+'px;' 16 | return color + size + height; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /dist/divider/index.wxss: -------------------------------------------------------------------------------- 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} -------------------------------------------------------------------------------- /dist/drawer/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties: { 4 | visible: { 5 | type: Boolean, 6 | value: false 7 | }, 8 | 9 | mask: { 10 | type: Boolean, 11 | value: true 12 | }, 13 | 14 | maskClosable: { 15 | type: Boolean, 16 | value: true 17 | }, 18 | 19 | mode: { 20 | type: String, 21 | value: 'left' // left right 22 | } 23 | }, 24 | data: {}, 25 | methods: { 26 | handleMaskClick() { 27 | if (!this.data.maskClosable) { 28 | return; 29 | } 30 | this.triggerEvent('close', {}); 31 | } 32 | } 33 | }); 34 | -------------------------------------------------------------------------------- /dist/drawer/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/drawer/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dist/drawer/index.wxss: -------------------------------------------------------------------------------- 1 | .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)} -------------------------------------------------------------------------------- /dist/grid-icon/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../grid-item/index': { 6 | type: 'parent' 7 | } 8 | }, 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /dist/grid-icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/grid-icon/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/grid-icon/index.wxss: -------------------------------------------------------------------------------- 1 | .i-grid-icon{display:block;width:28px;height:28px;margin:0 auto}.i-grid-icon image{width:100%;height:100%} -------------------------------------------------------------------------------- /dist/grid-item/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../grid/index': { 6 | type: 'parent' 7 | }, 8 | '../grid-icon/index': { 9 | type: 'child' 10 | } 11 | }, 12 | 13 | data: { 14 | width: '33.33%' 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /dist/grid-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/grid-item/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/grid-item/index.wxss: -------------------------------------------------------------------------------- 1 | .i-grid-item{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid #e9eaec;border-bottom:1rpx solid #e9eaec} -------------------------------------------------------------------------------- /dist/grid-label/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../grid-item/index': { 6 | type: 'parent' 7 | } 8 | }, 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /dist/grid-label/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/grid-label/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/grid-label/index.wxss: -------------------------------------------------------------------------------- 1 | .i-grid-label{margin-top:5px;display:block;text-align:center;color:#1c2438;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden} -------------------------------------------------------------------------------- /dist/grid/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../grid-item/index': { 6 | type: 'child', 7 | linked () { 8 | this.setGridItemWidth(); 9 | }, 10 | linkChanged () { 11 | this.setGridItemWidth(); 12 | }, 13 | unlinked () { 14 | this.setGridItemWidth(); 15 | } 16 | } 17 | }, 18 | 19 | methods: { 20 | setGridItemWidth () { 21 | const nodes = this.getRelationNodes('../grid-item/index'); 22 | 23 | // const len = nodes.length; 24 | // if (len < 3) { 25 | // nodes.forEach(item => { 26 | // item.setData({ 27 | // 'width': '33.33%' 28 | // }); 29 | // }); 30 | // } else { 31 | // const width = 100 / nodes.length; 32 | // nodes.forEach(item => { 33 | // item.setData({ 34 | // 'width': width + '%' 35 | // }); 36 | // }); 37 | // } 38 | const width = 100 / nodes.length; 39 | nodes.forEach(item => { 40 | item.setData({ 41 | 'width': width + '%' 42 | }); 43 | }); 44 | } 45 | }, 46 | 47 | ready () { 48 | this.setGridItemWidth(); 49 | } 50 | }); 51 | -------------------------------------------------------------------------------- /dist/grid/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/grid/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/grid/index.wxss: -------------------------------------------------------------------------------- 1 | .i-grid{border-top:1rpx solid #e9eaec;border-left:1rpx solid #e9eaec;overflow:hidden} -------------------------------------------------------------------------------- /dist/icon/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | properties: { 5 | type: { 6 | type: String, 7 | value: '' 8 | }, 9 | custom: { 10 | type: String, 11 | value: '' 12 | }, 13 | size: { 14 | type: Number, 15 | value: 14 16 | }, 17 | color: { 18 | type: String, 19 | value: '' 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /dist/icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/icon/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/index-item/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties : { 4 | name : { 5 | type : String, 6 | value : '' 7 | } 8 | }, 9 | relations : { 10 | '../index/index' : { 11 | type : 'parent' 12 | } 13 | }, 14 | data : { 15 | top : 0, 16 | height : 0, 17 | currentName : '' 18 | }, 19 | methods: { 20 | updateDataChange() { 21 | const className = '.i-index-item'; 22 | const query = wx.createSelectorQuery().in(this); 23 | query.select( className ).boundingClientRect((res)=>{ 24 | this.setData({ 25 | top : res.top, 26 | height : res.height, 27 | currentName : this.data.name 28 | }) 29 | }).exec() 30 | } 31 | } 32 | }) -------------------------------------------------------------------------------- /dist/index-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/index-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{name}} 3 | 4 | 5 | 6 | 7 | 8 | module.exports = { 9 | 10 | } 11 | 12 | -------------------------------------------------------------------------------- /dist/index-item/index.wxss: -------------------------------------------------------------------------------- 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} -------------------------------------------------------------------------------- /dist/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 17 | {{item}} 18 | 19 | 20 | {{currentName}} 21 | 22 | 23 | 24 | module.exports = { 25 | setScrollStyle : function(height){ 26 | var units = ['%','px','rem','rpx','em','rem']; 27 | var hasUnits = false; 28 | for( var i = 0; i < units.length;i++ ){ 29 | var u = units[i]; 30 | if( height.indexOf( u ) > -1 ){ 31 | hasUnits = true; 32 | break; 33 | } 34 | } 35 | return 'height:'+ ( hasUnits ? height : height+'px' ); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /dist/index/index.wxss: -------------------------------------------------------------------------------- 1 | .i-index{width:100%;height:100%}.i-index-line{position:absolute;left:0;width:100%;height:1rpx;background-color:#f7f7f7;top:50%}.i-index-content{background:#fff;position:relative;z-index:1;display:inline-block;padding:0 10px}.i-index-fixed{position:fixed;right:0;top:50%;z-index:10;padding-left:10px;transform:translateY(-50%)}.i-index-fixed-item{display:block;height:18px;line-height:18px;padding:0 5px;text-align:center;color:#2d8cf0;font-size:12px;border-radius:50%}.i-index-fixed-item-current{background:#2d8cf0;color:#fff}.i-index-tooltip{position:fixed;left:50%;top:50%;transform:translate3d(-50%,-50%,0);background:rgba(0,0,0,.7);color:#fff;font-size:24px;border-radius:50%;width:80px;height:80px;line-height:80px;text-align:center} -------------------------------------------------------------------------------- /dist/input-number/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/input-number/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | - 3 | 4 | + 5 | 6 | -------------------------------------------------------------------------------- /dist/input-number/index.wxss: -------------------------------------------------------------------------------- 1 | .i-input-number{color:#495060}.i-input-number view{display:inline-block;line-height:20px;padding:5px 0;text-align:center;min-width:40px;box-sizing:border-box;vertical-align:middle;font-size:12px;border:1rpx solid #dddee1}.i-input-number-minus{border-right:none;border-radius:2px 0 0 2px}.i-input-number-plus{border-left:none;border-radius:0 2px 2px 0}.i-input-number-text{border:1rpx solid #dddee1;display:inline-block;text-align:center;vertical-align:middle;height:30px;width:40px;min-height:auto;font-size:12px;line-height:30px}.i-input-number-disabled{border-color:#dddee1;color:#bbbec4;background:#f7f7f7} -------------------------------------------------------------------------------- /dist/input/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | behaviors: ['wx://form-field'], 3 | 4 | externalClasses: ['i-class'], 5 | 6 | properties: { 7 | title: { 8 | type: String 9 | }, 10 | // text || textarea || password || number 11 | type: { 12 | type: String, 13 | value: 'text' 14 | }, 15 | disabled: { 16 | type: Boolean, 17 | value: false 18 | }, 19 | placeholder: { 20 | type: String, 21 | value: '' 22 | }, 23 | autofocus: { 24 | type: Boolean, 25 | value: false 26 | }, 27 | mode: { 28 | type: String, 29 | value: 'normal' 30 | }, 31 | right: { 32 | type: Boolean, 33 | value: false 34 | }, 35 | error: { 36 | type: Boolean, 37 | value: false 38 | }, 39 | maxlength: { 40 | type: Number 41 | } 42 | }, 43 | 44 | methods: { 45 | handleInputChange(event) { 46 | const { detail = {} } = event; 47 | const { value = '' } = detail; 48 | this.setData({ value }); 49 | 50 | this.triggerEvent('change', event); 51 | }, 52 | 53 | handleInputFocus(event) { 54 | this.triggerEvent('focus', event); 55 | }, 56 | 57 | handleInputBlur(event) { 58 | this.triggerEvent('blur', event); 59 | } 60 | } 61 | }); 62 | -------------------------------------------------------------------------------- /dist/input/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/input/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{ title }} 3 | 17 | 31 | 32 | -------------------------------------------------------------------------------- /dist/input/index.wxss: -------------------------------------------------------------------------------- 1 | .i-cell{position:relative;padding:12px 15px;display:flex;background:#fff;align-items:center;line-height:1.4;font-size:14px;overflow:hidden}.i-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px;left:15px;right:0}.i-cell-last::after{display:none}.i-cell-icon{margin-right:5px}.i-cell-icon:empty{display:none}.i-cell-bd{flex:1}.i-cell-text{line-height:24px;font-size:14px}.i-cell-desc{line-height:1.2;font-size:12px;color:#80848f}.i-cell-ft{position:relative;text-align:right;color:#495060}.i-cell-access .i-cell-ft{padding-right:13px}.i-cell-access .i-cell-ft::after{content:" ";display:inline-block;width:6px;height:6px;position:absolute;top:50%;right:2px;border-width:2px 2px 0 0;border-color:#dddee1;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.i-input{padding:7px 15px;color:#495060}.i-input-wrapped{margin:10px 15px;background-color:#fff}.i-input-wrapped::after{left:0;border-width:1px;border-radius:4px}.i-input-error{color:#ed3f14}.i-input-title{color:#495060;min-width:65px;padding-right:10px}.i-input-input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.i-input-placeholder{font-size:14px}.i-input-input-right{text-align:right}.i-input.i-input-wrapped::after{display:block}.i-input-wrapped.i-input-error::after{border-color:#ed3f14} -------------------------------------------------------------------------------- /dist/load-more/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | properties: { 5 | loading: { 6 | type: Boolean, 7 | value: true 8 | }, 9 | tip: { 10 | type: String, 11 | value: '' 12 | } 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /dist/load-more/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/load-more/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ tip }} 5 | 正在加载 6 | 7 | 8 | -------------------------------------------------------------------------------- /dist/load-more/index.wxss: -------------------------------------------------------------------------------- 1 | .i-load-more{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.i-load-more-loading{display:inline-block;margin-right:12px;vertical-align:middle;width:14px;height:14px;background:0 0;border-radius:50%;border:2px solid #e9eaec;border-color:#e9eaec #e9eaec #e9eaec #2d8cf0;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-load-more-tip{display:inline-block;vertical-align:middle;color:#495060}.i-load-more-line{border-top:1px solid #dddee1;display:flex;border-top:0}.i-load-more-line::before{position:relative;top:-1px;-webkit-box-flex:1;-webkit-flex:1;flex:1;content:'';border-top:1px solid #dddee1}.i-load-more-line::after{position:relative;top:-1px;-webkit-box-flex:1;-webkit-flex:1;flex:1;content:'';border-top:1px solid #dddee1}.i-load-more-line .i-load-more-tip{position:relative;top:-.9em;padding:0 .55em}.i-load-more-empty{width:4px;height:4px;border-radius:50%;background-color:#e5e5e5;display:inline-block;position:relative;vertical-align:0;top:-.16em}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} -------------------------------------------------------------------------------- /dist/message/index.js: -------------------------------------------------------------------------------- 1 | const default_data = { 2 | visible: false, 3 | content: '', 4 | duration: 2, 5 | type: 'default', // default || success || warning || error 6 | }; 7 | 8 | let timmer = null; 9 | 10 | Component({ 11 | externalClasses: ['i-class'], 12 | 13 | data: { 14 | ...default_data 15 | }, 16 | 17 | methods: { 18 | handleShow (options) { 19 | const { type = 'default', duration = 2 } = options; 20 | 21 | this.setData({ 22 | ...options, 23 | type, 24 | duration, 25 | visible: true 26 | }); 27 | 28 | const d = this.data.duration * 1000; 29 | 30 | if (timmer) clearTimeout(timmer); 31 | if (d !== 0) { 32 | timmer = setTimeout(() => { 33 | this.handleHide(); 34 | timmer = null; 35 | }, d); 36 | } 37 | }, 38 | 39 | handleHide () { 40 | this.setData({ 41 | ...default_data 42 | }); 43 | } 44 | } 45 | }); -------------------------------------------------------------------------------- /dist/message/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/message/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{ content }} 3 | -------------------------------------------------------------------------------- /dist/message/index.wxss: -------------------------------------------------------------------------------- 1 | .i-message{display:block;width:100%;min-height:32px;line-height:2.3;position:fixed;top:0;left:0;right:0;background:#2d8cf0;color:#fff;text-align:center;font-size:14px;z-index:1010;opacity:0;-webkit-transform:translateZ(0) translateY(-100%);transition:all .4s ease-in-out}.i-message-show{-webkit-transform:translateZ(0) translateY(0);opacity:1}.i-message-default{background:#2d8cf0}.i-message-success{background:#19be6b}.i-message-warning{background:#f90}.i-message-error{background:#ed3f14} -------------------------------------------------------------------------------- /dist/modal/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class', 'i-class-mask'], 3 | 4 | properties: { 5 | visible: { 6 | type: Boolean, 7 | value: false 8 | }, 9 | title: { 10 | type: String, 11 | value: '' 12 | }, 13 | showOk: { 14 | type: Boolean, 15 | value: true 16 | }, 17 | showCancel: { 18 | type: Boolean, 19 | value: true 20 | }, 21 | okText: { 22 | type: String, 23 | value: '确定' 24 | }, 25 | cancelText: { 26 | type: String, 27 | value: '取消' 28 | }, 29 | // 按钮组,有此值时,不显示 ok 和 cancel 按钮 30 | actions: { 31 | type: Array, 32 | value: [] 33 | }, 34 | // horizontal || vertical 35 | actionMode: { 36 | type: String, 37 | value: 'horizontal' 38 | } 39 | }, 40 | 41 | methods: { 42 | handleClickItem ({ currentTarget = {} }) { 43 | const dataset = currentTarget.dataset || {}; 44 | const { index } = dataset; 45 | this.triggerEvent('click', { index }); 46 | }, 47 | handleClickOk () { 48 | this.triggerEvent('ok'); 49 | }, 50 | handleClickCancel () { 51 | this.triggerEvent('cancel'); 52 | } 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /dist/modal/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "i-grid": "../grid/index", 5 | "i-grid-item": "../grid-item/index", 6 | "i-button": "../button/index", 7 | "i-icon": "../icon/index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dist/modal/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {{ cancelText }} 25 | 26 | 27 | {{ okText }} 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /dist/modal/index.wxss: -------------------------------------------------------------------------------- 1 | .i-modal{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;height:100%;z-index:1000;display:flex;outline:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;transform:translateZ(1px);opacity:0;visibility:hidden}.i-modal-show{visibility:visible;opacity:1}.i-modal-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);z-index:1000;transition:all .2s ease-in-out;opacity:0;visibility:hidden}.i-modal-mask-show{opacity:1;visibility:visible}.i-modal-main{width:270px;position:relative}.i-modal-content{border-radius:7px;padding-top:15px;position:relative;background-color:#fff;border:0;background-clip:padding-box;text-align:center;height:100%;overflow:hidden}.i-modal-body{max-height:100px;margin-bottom:15px;font-size:14px;color:#80848f;height:100%;line-height:1.5;overflow:auto}.i-modal-title{padding:6px 15px 15px;margin:0;font-size:18px;line-height:1;color:#1c2438;text-align:center}.i-modal-actions{margin:0 1px}.i-modal-action-vertical{position:relative}.i-modal-action-vertical:after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-modal-grid{border-radius:0 0 7px 7px;border-left:none}.i-modal-grid-item,.i-modal-grid-item-last{padding:0;border-bottom:none}.i-modal-grid-item-last{border-right:none}.i-modal-btn-ok{color:#2d8cf0!important}.i-modal-btn-loading{display:inline-block;vertical-align:middle;margin-right:10px;width:12px;height:12px;background:0 0;border-radius:50%;border:2px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-modal-btn-text{display:inline-block;vertical-align:middle}.i-modal-btn-icon{font-size:14px!important;margin-right:4px}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} -------------------------------------------------------------------------------- /dist/notice-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-icon": "../icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/notice-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /dist/notice-bar/index.wxss: -------------------------------------------------------------------------------- 1 | .i-noticebar{display:flex;height:72rpx;line-height:72rpx;font-size:14px;color:#f76a24;background-color:#fefcec;overflow:hidden}.i-noticebar-icon{display:flex;margin-left:30rpx;align-items:center}.i-noticebar-icon+view{margin-left:10rpx}.i-noticebar-operation{display:flex;margin-right:16rpx;align-items:center}.i-noticebar-content-wrap{position:relative;flex:1;margin:0 30rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.i-noticebar-content-wrap .i-noticebar-content{position:absolute;transition-duration:20s} -------------------------------------------------------------------------------- /dist/page/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | options: { 5 | multipleSlots: true 6 | }, 7 | 8 | properties: { 9 | // button || number || pointer 10 | mode: { 11 | type: String, 12 | value: 'button' 13 | }, 14 | current: { 15 | type: Number, 16 | value: 1 17 | }, 18 | total: { 19 | type: Number, 20 | value: 0 21 | }, 22 | // 是否隐藏数值 23 | simple: { 24 | type: Boolean, 25 | value: false 26 | } 27 | }, 28 | 29 | methods: { 30 | handleChange (type) { 31 | this.triggerEvent('change', { 32 | type: type 33 | }); 34 | }, 35 | handlePrev () { 36 | this.handleChange('prev'); 37 | }, 38 | handleNext () { 39 | this.handleChange('next'); 40 | } 41 | } 42 | }); 43 | -------------------------------------------------------------------------------- /dist/page/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-button": "../button/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/page/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ current }}/{{total}} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dist/page/index.wxss: -------------------------------------------------------------------------------- 1 | .i-page{display:block;width:100%;height:44px;overflow:hidden;box-sizing:border-box;position:relative}.i-page-prev{position:absolute;left:10px;top:0}.i-page-next{position:absolute;right:10px;top:0}.i-page-number{width:100%;height:44px;line-height:44px;margin:0 auto;text-align:center}.i-page-number-current{display:inline;color:#2d8cf0}.i-page-pointer{width:100%;height:44px;line-height:44px;margin:0 auto;text-align:center}.i-page-pointer-dot{display:inline-block;width:8px;height:8px;margin:0 2px;border-radius:50%;background:#bbbec4}.i-page-pointer-dot.current{background:#80848f}.i-page-button{display:inline-block;margin:0} -------------------------------------------------------------------------------- /dist/panel/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | properties: { 5 | title: { 6 | type: String, 7 | value: '' 8 | }, 9 | // 标题顶部距离 10 | hideTop: { 11 | type: Boolean, 12 | value: false 13 | }, 14 | hideBorder: { 15 | type: Boolean, 16 | value: false 17 | } 18 | } 19 | }); 20 | -------------------------------------------------------------------------------- /dist/panel/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/panel/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{ title }} 3 | 4 | 5 | -------------------------------------------------------------------------------- /dist/panel/index.wxss: -------------------------------------------------------------------------------- 1 | .i-panel{position:relative;overflow:hidden}.i-panel-title{font-size:14px;line-height:1;color:#1c2438;padding:20px 16px 10px}.i-panel-title-hide-top{padding-top:0}.i-panel-content{position:relative;background:#fff;overflow:hidden}.i-panel-content::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px;border-bottom-width:1px}.i-panel-without-border::after{border:0 none} -------------------------------------------------------------------------------- /dist/progress/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | properties: { 5 | percent: { 6 | type: Number, 7 | value: 0 8 | }, 9 | // normal || active || wrong || success 10 | status: { 11 | type: String, 12 | value: 'normal' 13 | }, 14 | strokeWidth: { 15 | type: Number, 16 | value: 10 17 | }, 18 | hideInfo: { 19 | type: Boolean, 20 | value: false 21 | } 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /dist/progress/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/progress/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ percent }}% 9 | 10 | -------------------------------------------------------------------------------- /dist/progress/index.wxss: -------------------------------------------------------------------------------- 1 | .i-progress{display:inline-block;width:100%;font-size:12px;position:relative}.i-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0;box-sizing:border-box}.i-progress-show-info .i-progress-outer{padding-right:55px;margin-right:-55px}.i-progress-inner{display:inline-block;width:100%;background-color:#f3f3f3;border-radius:100px;vertical-align:middle}.i-progress-bg{border-radius:100px;background-color:#2db7f5;transition:all .2s linear;position:relative}.i-progress-text{display:inline-block;margin-left:5px;text-align:left;font-size:1em;vertical-align:middle}.i-progress-active .i-progress-bg:before{content:'';opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;background:#fff;border-radius:10px;animation:i-progress-active 2s ease-in-out infinite}.i-progress-wrong .i-progress-bg{background-color:#ed3f14}.i-progress-wrong .i-progress-text{color:#ed3f14}.i-progress-success .i-progress-bg{background-color:#19be6b}.i-progress-success .i-progress-text{color:#19be6b}@keyframes i-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}} -------------------------------------------------------------------------------- /dist/radio-group/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | relations: { 4 | '../radio/index': { 5 | type: 'child', 6 | linked() { 7 | this.changeCurrent(); 8 | }, 9 | linkChanged() { 10 | this.changeCurrent(); 11 | }, 12 | unlinked() { 13 | this.changeCurrent(); 14 | } 15 | } 16 | }, 17 | properties: { 18 | current: { 19 | type: String, 20 | value: '', 21 | observer: 'changeCurrent' 22 | }, 23 | }, 24 | methods: { 25 | changeCurrent(val = this.data.current) { 26 | let items = this.getRelationNodes('../radio/index'); 27 | const len = items.length; 28 | if (len > 0) { 29 | items.forEach(item => { 30 | item.changeCurrent(val === item.data.value); 31 | }); 32 | } 33 | }, 34 | emitEvent(current) { 35 | this.triggerEvent('change', current); 36 | } 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /dist/radio-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-cell-group": "../cell-group/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/radio-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /dist/radio-group/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/dist/radio-group/index.wxss -------------------------------------------------------------------------------- /dist/radio/index.js: -------------------------------------------------------------------------------- 1 | const prefixCls = 'i-radio'; 2 | 3 | Component({ 4 | externalClasses: ['i-class'], 5 | relations: { 6 | '../radio-group/index': { 7 | type: 'parent' 8 | } 9 | }, 10 | properties: { 11 | value: { 12 | type: String, 13 | value: '' 14 | }, 15 | checked: { 16 | type: Boolean, 17 | value: false 18 | }, 19 | disabled: { 20 | type: Boolean, 21 | value: false 22 | }, 23 | color: { 24 | type: String, 25 | value: '#2d8cf0' 26 | }, 27 | position: { 28 | type: String, 29 | value: 'left', //left right 30 | observer: 'setPosition' 31 | } 32 | }, 33 | data: { 34 | checked: true, 35 | positionCls: `${prefixCls}-radio-left`, 36 | }, 37 | attached() { 38 | this.setPosition(); 39 | }, 40 | methods: { 41 | changeCurrent(current) { 42 | this.setData({ checked: current }); 43 | }, 44 | radioChange() { 45 | if (this.data.disabled) return; 46 | const item = { current: !this.data.checked, value: this.data.value }; 47 | const parent = this.getRelationNodes('../radio-group/index')[0]; 48 | parent ? parent.emitEvent(item) : this.triggerEvent('change', item); 49 | }, 50 | setPosition() { 51 | this.setData({ 52 | positionCls: this.data.position.indexOf('left') !== -1 ? `${prefixCls}-radio-left` : `${prefixCls}-radio-right`, 53 | }); 54 | } 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /dist/radio/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-cell": "../cell/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/radio/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dist/radio/index.wxss: -------------------------------------------------------------------------------- 1 | .i-radio-cell::after{display:block}.i-radio-radio-left{float:left}.i-radio-radio-right{float:right}.i-radio-radio{vertical-align:middle}.i-radio-title{display:inline-block;vertical-align:middle} -------------------------------------------------------------------------------- /dist/rate/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties : { 4 | count : { 5 | type : Number, 6 | value : 5 7 | }, 8 | value : { 9 | type : Number, 10 | value : 0 11 | }, 12 | disabled : { 13 | type : Boolean, 14 | value : false 15 | }, 16 | size : { 17 | type : Number, 18 | value : 20 19 | }, 20 | name : { 21 | type : String, 22 | value : '' 23 | } 24 | }, 25 | data : { 26 | touchesStart : { 27 | pageX : 0 28 | } 29 | }, 30 | methods : { 31 | handleClick(e){ 32 | const data = this.data; 33 | if( data.disabled ){ 34 | return; 35 | } 36 | const index = e.currentTarget.dataset.index; 37 | this.triggerEvent('change',{ 38 | index : index + 1 39 | }) 40 | }, 41 | handleTouchMove(e){ 42 | const data = this.data; 43 | if( data.disabled ){ 44 | return; 45 | } 46 | if( !e.changedTouches[0] ){ 47 | return; 48 | } 49 | const movePageX = e.changedTouches[0].pageX; 50 | const space = movePageX - data.touchesStart.pageX; 51 | 52 | if( space <= 0 ){ 53 | return; 54 | } 55 | let setIndex = Math.ceil( space/data.size ); 56 | setIndex = setIndex > data.count ? data.count : setIndex ; 57 | this.triggerEvent('change',{ 58 | index : setIndex 59 | }) 60 | } 61 | }, 62 | ready(){ 63 | const className = '.i-rate'; 64 | var query = wx.createSelectorQuery().in(this) 65 | query.select( className ).boundingClientRect((res)=>{ 66 | this.data.touchesStart.pageX = res.left || 0; 67 | }).exec() 68 | } 69 | }); 70 | -------------------------------------------------------------------------------- /dist/rate/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents":{ 4 | "i-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /dist/rate/index.wxml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 10 | 11 | 12 | 13 | 14 | 15 | var prefixCls = 'i-rate'; 16 | module.exports = { 17 | getCurrent : function( value,index ){ 18 | if( index < value ){ 19 | return prefixCls + '-current' 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /dist/rate/index.wxss: -------------------------------------------------------------------------------- 1 | .i-rate{margin:0;padding:0;font-size:20px;display:inline-block;vertical-align:middle;font-weight:400;font-style:normal}.i-rate-hide-input{display:none}.i-rate-star{display:inline-block;color:#e9e9e9}.i-rate-current{color:#f5a623}.i-rate-text{display:inline-block;vertical-align:middle;margin-left:6px;font-size:14px} -------------------------------------------------------------------------------- /dist/row/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../col/index': { 6 | type: 'child' 7 | } 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /dist/row/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/row/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/row/index.wxss: -------------------------------------------------------------------------------- 1 | .i-row:after{content:"";display:table;clear:both} -------------------------------------------------------------------------------- /dist/slide/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | options: { 4 | // 在组件定义时的选项中启用多slot支持 5 | multipleSlots: true 6 | }, 7 | methods : { 8 | handleTap2(){ 9 | console.log(event,1111111) 10 | }, 11 | handleTap3(){ 12 | 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /dist/slide/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-button": "../button/index", 6 | "i-icon": "../icon/index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /dist/slide/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 1111 3 | 4 | -------------------------------------------------------------------------------- /dist/slide/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/dist/slide/index.wxss -------------------------------------------------------------------------------- /dist/spin/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | properties: { 5 | // small || default || large 6 | size: { 7 | type: String, 8 | value: 'default' 9 | }, 10 | fix: { 11 | type: Boolean, 12 | value: false 13 | }, 14 | fullscreen: { 15 | type: Boolean, 16 | value: false 17 | }, 18 | custom: { 19 | type: Boolean, 20 | value: false 21 | } 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /dist/spin/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/spin/index.wxml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 |
7 | -------------------------------------------------------------------------------- /dist/spin/index.wxss: -------------------------------------------------------------------------------- 1 | .i-spin{color:#2d8cf0;vertical-align:middle;text-align:center}.i-spin-dot{position:relative;display:block;border-radius:50%;background-color:#2d8cf0;width:20px;height:20px;animation:ani-spin-bounce 1s 0s ease-in-out infinite}.i-spin-large .i-spin-dot{width:32px;height:32px}.i-spin-small .i-spin-dot{width:12px;height:12px}.i-spin-fix{position:absolute;top:0;left:0;z-index:8;width:100%;height:100%;background-color:rgba(255,255,255,.9)}.i-spin-fullscreen{z-index:2010}.i-spin-fullscreen-wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.i-spin-fix .i-spin-main{position:absolute;top:50%;left:50%;-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.i-spin-fix .i-spin-dot{display:inline-block}.i-spin-show-text .i-spin-dot,.i-spin-text{display:none}.i-spin-show-text .i-spin-text{display:block;font-size:14px}@keyframes ani-spin-bounce{0%{transform:scale(0)}100%{transform:scale(1);opacity:0}} -------------------------------------------------------------------------------- /dist/step/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties : { 4 | status : { 5 | type : String, 6 | //wait、process、finish、error 7 | value : '' 8 | }, 9 | title : { 10 | type : String, 11 | value : '' 12 | }, 13 | content : { 14 | type : String, 15 | value : '' 16 | }, 17 | icon : { 18 | type : String, 19 | value : '' 20 | } 21 | }, 22 | options: { 23 | // 在组件定义时的选项中启用多slot支持 24 | multipleSlots: true 25 | }, 26 | relations : { 27 | '../steps/index' : { 28 | type : 'parent' 29 | } 30 | }, 31 | data : { 32 | //step length 33 | len : 1, 34 | //current in step index 35 | index : 0, 36 | //parent component select current index 37 | current : 0, 38 | //css direction 39 | direction : 'horizontal' 40 | }, 41 | methods : { 42 | updateDataChange( options ){ 43 | this.setData({ 44 | len : options.len, 45 | index : options.index, 46 | current : options.current, 47 | direction : options.direction 48 | }) 49 | } 50 | } 51 | 52 | }) -------------------------------------------------------------------------------- /dist/step/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-icon": "../icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/step/index.wxss: -------------------------------------------------------------------------------- 1 | .i-step-ico{width:24px;height:100%;border-radius:100%;background:#fff;position:relative;z-index:2;margin:0 auto;border:#dddee1 solid 1px}.i-step-ico-in{vertical-align:baseline}.i-step-line{position:absolute;left:50%;top:12px;width:100%;height:1px;background:#dddee1}.i-step-horizontal .i-step-ico::after{position:absolute;top:11px;left:23px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-horizontal .i-step-item-main{text-align:center}.i-step-horizontal .i-step-ico::before{position:absolute;top:11px;left:-11px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-ico{box-sizing:border-box;font-size:12px}.i-step-process .i-step-ico{border:#2d8cf0 solid 1px;color:#fff;background:#2d8cf0}.i-step-wait .i-step-ico{border:#e9eaec solid 1px;color:#e9eaec}.i-step-wait .i-step-line{background:#2d8cf0}.i-step-finish .i-step-ico{border:#2d8cf0 solid 1px;color:#2d8cf0}.i-step-finish .i-step-line{background:#2d8cf0}.i-step-error .i-step-ico{border:#ed3f14 solid 1px;color:#ed3f14}.i-step-error .i-step-line{background:#ed3f14}.i-step-item{font-size:12px;position:relative;display:inline-block;box-sizing:border-box;padding-left:10px;vertical-align:top}.i-step-item-ico{width:100%;height:24px;line-height:24px;text-align:center}.i-step-item-main{margin-top:10px;clear:both}.i-step-item-title{font-size:14px;font-weight:700;color:#1c2438}.i-step-item-content{font-size:12px;font-weight:700;margin-top:2px;color:#80848f}.i-step-vertical{padding-bottom:30px}.i-step-vertical .i-step-item-ico{width:24px;float:left}.i-step-vertical .i-step-item-main{margin-left:40px;margin-top:0;clear:inherit}.i-step-vertical .i-step-line{position:absolute;height:100%;top:0;left:10px;margin:0 0 0 12px;width:1px} -------------------------------------------------------------------------------- /dist/steps/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties : { 4 | current : { 5 | type : Number, 6 | value : -1, 7 | observer : '_updateDataChange' 8 | }, 9 | status : { 10 | type : String, 11 | //wait、process、finish、error 12 | value : '' 13 | }, 14 | direction : { 15 | type : String, 16 | //value has horizontal or vertical 17 | value : 'horizontal' 18 | } 19 | }, 20 | relations : { 21 | '../step/index' : { 22 | type : 'child', 23 | linked(){ 24 | this._updateDataChange(); 25 | }, 26 | linkChanged () { 27 | this._updateDataChange(); 28 | }, 29 | unlinked () { 30 | this._updateDataChange(); 31 | } 32 | } 33 | }, 34 | methods: { 35 | _updateDataChange() { 36 | let steps = this.getRelationNodes('../step/index'); 37 | const len = steps.length; 38 | if (len > 0) { 39 | steps.forEach((step, index) => { 40 | step.updateDataChange({ 41 | len : len, 42 | index : index, 43 | current : this.data.current, 44 | direction : this.data.direction 45 | }); 46 | }); 47 | } 48 | } 49 | } 50 | }) -------------------------------------------------------------------------------- /dist/steps/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/steps/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /dist/steps/index.wxss: -------------------------------------------------------------------------------- 1 | .i-steps{width:100%} -------------------------------------------------------------------------------- /dist/sticky-item/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | options: { 4 | multipleSlots: true 5 | }, 6 | relations : { 7 | '../sticky/index' : { 8 | type : 'parent' 9 | } 10 | }, 11 | data : { 12 | top : 0, 13 | height : 0, 14 | isFixed : false, 15 | index : -1, 16 | }, 17 | methods: { 18 | updateScrollTopChange(scrollTop){ 19 | const data = this.data; 20 | const top = data.top; 21 | const height = data.height; 22 | this.setData({ 23 | isFixed : ( scrollTop >= top && scrollTop < top + height ) ? true : false 24 | }) 25 | }, 26 | updateDataChange(index) { 27 | const className = '.i-sticky-item'; 28 | const query = wx.createSelectorQuery().in(this); 29 | query.select( className ).boundingClientRect((res)=>{ 30 | if( res ){ 31 | this.setData({ 32 | top : res.top, 33 | height : res.height, 34 | index : index 35 | }) 36 | } 37 | }).exec() 38 | } 39 | } 40 | }) -------------------------------------------------------------------------------- /dist/sticky-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/sticky-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /dist/sticky-item/index.wxss: -------------------------------------------------------------------------------- 1 | .i-sticky-item-header{background:#eee;font-size:14px;width:100%;height:32px;line-height:32px}.i-sticky-item-content{font-size:14px}.i-sticky-title{width:100%;padding:0 15px;box-sizing:border-box;background:#eee}.i-sticky-fixed .i-sticky-title{position:fixed;top:0} -------------------------------------------------------------------------------- /dist/sticky/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties : { 4 | scrollTop : { 5 | type : Number, 6 | observer(val){ 7 | this._updateScrollTopChange(); 8 | } 9 | } 10 | }, 11 | relations : { 12 | '../sticky-item/index' : { 13 | type : 'child', 14 | linked(){ 15 | this._updateDataChange(); 16 | }, 17 | linkChanged () { 18 | this._updateDataChange(); 19 | }, 20 | unlinked () { 21 | this._updateDataChange(); 22 | } 23 | } 24 | }, 25 | data : { 26 | timer : null, 27 | itemLength : 0, 28 | }, 29 | methods : { 30 | _updateScrollTopChange(){ 31 | const stickies = this.getRelationNodes('../sticky-item/index'); 32 | if( stickies.length > 0 ){ 33 | stickies.forEach((item) => { 34 | if( item ){ 35 | item.updateScrollTopChange( this.data.scrollTop ); 36 | } 37 | }) 38 | } 39 | }, 40 | _updateDataChange( ){ 41 | const stickies = this.getRelationNodes('../sticky-item/index'); 42 | if( stickies.length > 0 ){ 43 | if( this.data.timer ){ 44 | clearTimeout( this.data.timer ) 45 | this.setData({ 46 | timer : null 47 | }) 48 | } 49 | this.data.timer = setTimeout(()=>{ 50 | stickies.forEach((item,index) => { 51 | if( item ){ 52 | item.updateDataChange(index); 53 | } 54 | }) 55 | },0) 56 | this.setData({ 57 | timer : this.data.timer 58 | }) 59 | } 60 | } 61 | } 62 | 63 | }) -------------------------------------------------------------------------------- /dist/sticky/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/sticky/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /dist/sticky/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/dist/sticky/index.wxss -------------------------------------------------------------------------------- /dist/swipeout/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "i-cell": "../cell/index", 5 | "i-icon": "../icon/index" 6 | } 7 | } -------------------------------------------------------------------------------- /dist/swipeout/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 15 | 20 | 21 | {{item.name}} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | module.exports = { 31 | setStyle : function( item ){ 32 | var defaults = '#f7f7f7'; 33 | return 'background:' + ( item.background ? item.background : defaults ) +';' + 'color:'+ item.color; 34 | }, 35 | setPosition : function( position ){ 36 | return 'transform:translate(' + position.pageX + 'px,0);'; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /dist/swipeout/index.wxss: -------------------------------------------------------------------------------- 1 | .i-swipeout-wrap{border-bottom:#dddee1 solid 1px;background:#fff;position:relative;overflow:hidden}.i-swipeout-item{width:100%;padding:15px 20px;box-sizing:border-box;transition:transform .2s ease;font-size:14px}.i-swipeout-content{white-space:nowrap;overflow:hidden}.i-swipeout-button-right-group{position:absolute;right:-100%;top:0;height:100%;z-index:1;width:100%}.i-swipeout-button-right-item{height:100%;float:left;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;justify-content:center} -------------------------------------------------------------------------------- /dist/switch/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties : { 4 | value : { 5 | type : Boolean, 6 | value : false 7 | }, 8 | //large small default 9 | size : { 10 | type : String, 11 | value : 'default' 12 | }, 13 | // is or not disable 14 | disabled : { 15 | type : Boolean, 16 | value : false 17 | }, 18 | // hidden inut name 19 | name : { 20 | type : String, 21 | value : '' 22 | } 23 | }, 24 | options: { 25 | // 在组件定义时的选项中启用多slot支持 26 | multipleSlots: true 27 | }, 28 | methods : { 29 | toggle(){ 30 | if( this.data.disabled ) return; 31 | const data = this.data; 32 | const value = data.value ? false : true; 33 | this.triggerEvent('change',{ 34 | value : value 35 | }) 36 | } 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /dist/switch/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/switch/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | var sizes = ['large', 'default']; 12 | var prefixCls = 'i-switch'; 13 | module.exports = { 14 | setSize : function( size ){ 15 | var index = sizes.indexOf( size ); 16 | return prefixCls + ( index > -1 ? ( '-'+size ) : 'default' ) 17 | }, 18 | setCurrent : function( value,disabled ){ 19 | var className = value && !disabled ? prefixCls + '-checked' : ''; 20 | if( disabled ){ 21 | className += ' ' + prefixCls + '-disabled'; 22 | } 23 | return className; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dist/switch/index.wxss: -------------------------------------------------------------------------------- 1 | .i-switch{display:inline-block;width:48px;height:24px;line-height:24px;border-radius:24px;vertical-align:middle;border:1px solid #ccc;background-color:#ccc;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:all .2s ease-in-out}.i-switch-hide-input{display:none;opacity:0}.i-switch-inner{color:#fff;font-size:12px;position:absolute;left:25px;vertical-align:middle}.i-switch-inner .i-icon{width:12px;height:12px;text-align:center;vertical-align:middle}.i-switch:after{content:'';width:22px;height:22px;border-radius:22px;background-color:#fff;position:absolute;left:1px;top:1px;cursor:pointer;transition:left .2s ease-in-out,width .2s ease-in-out}.i-switch-checked:after{left:8px}.i-switch-large{width:60px}.i-switch-large.i-switch-checked:after{left:37px}.i-switch-checked:after{left:25px}.i-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0}.i-switch-checked .i-switch-inner{left:8px}.i-switch-checked:after{left:25px}.i-switch-disabled{background:#f3f3f3;border-color:#f3f3f3}.i-switch-disabled:after{background:#ccc;cursor:not-allowed}.i-switch-disabled .i-switch-inner{color:#ccc} -------------------------------------------------------------------------------- /dist/tab-bar-item/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../tab-bar/index': { 6 | type: 'parent' 7 | } 8 | }, 9 | 10 | properties: { 11 | icon: { 12 | type: String, 13 | value: '' 14 | }, 15 | currentIcon: { 16 | type: String, 17 | value: '' 18 | }, 19 | img: { 20 | type: String, 21 | value: '' 22 | }, 23 | currentImg: { 24 | type: String, 25 | value: '' 26 | }, 27 | key: { 28 | type: String, 29 | value: '' 30 | }, 31 | title: { 32 | type: String, 33 | value: '' 34 | }, 35 | dot: { 36 | type: Boolean, 37 | value: false 38 | }, 39 | count: { 40 | type: Number, 41 | value: 0 42 | } 43 | }, 44 | 45 | data: { 46 | current: false, 47 | currentColor: '' 48 | }, 49 | 50 | methods: { 51 | changeCurrent (current) { 52 | this.setData({ current }); 53 | }, 54 | changeCurrentColor (currentColor) { 55 | this.setData({ currentColor }); 56 | }, 57 | handleClickItem () { 58 | const parent = this.getRelationNodes('../tab-bar/index')[0]; 59 | parent.emitEvent(this.data.key); 60 | } 61 | } 62 | }); 63 | -------------------------------------------------------------------------------- /dist/tab-bar-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-badge": "../badge/index", 6 | "i-icon": "../icon/index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /dist/tab-bar-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ title }} 7 | {{ title }} 8 | 9 | 10 | -------------------------------------------------------------------------------- /dist/tab-bar-item/index.wxss: -------------------------------------------------------------------------------- 1 | .i-tab-bar-item{flex:1;display:flex;width:100%;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;text-align:center}.i-tab-bar-item-icon{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;color:#80848f}.i-tab-bar-item-icon-current{color:#2d8cf0}.i-tab-bar-item-img{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;width:22px;height:22px}.i-tab-bar-item-title{font-size:10px;margin:3px 0 0;line-height:1;text-align:center;box-sizing:border-box;color:#80848f}.i-tab-bar-item-title-current{color:#2d8cf0}.i-tab-bar-item-img{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;color:#80848f} -------------------------------------------------------------------------------- /dist/tab-bar/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../tab-bar-item/index': { 6 | type: 'child', 7 | linked () { 8 | this.changeCurrent(); 9 | }, 10 | linkChanged () { 11 | this.changeCurrent(); 12 | }, 13 | unlinked () { 14 | this.changeCurrent(); 15 | } 16 | } 17 | }, 18 | 19 | properties: { 20 | current: { 21 | type: String, 22 | value: '', 23 | observer: 'changeCurrent' 24 | }, 25 | color: { 26 | type: String, 27 | value: '' 28 | }, 29 | fixed: { 30 | type: Boolean, 31 | value: false 32 | } 33 | }, 34 | 35 | data: { 36 | list: [] 37 | }, 38 | 39 | methods: { 40 | changeCurrent (val = this.data.current) { 41 | let items = this.getRelationNodes('../tab-bar-item/index'); 42 | const len = items.length; 43 | 44 | if (len > 0) { 45 | const list = []; 46 | items.forEach(item => { 47 | item.changeCurrent(item.data.key === val); 48 | item.changeCurrentColor(this.data.color); 49 | list.push({ 50 | key: item.data.key 51 | }); 52 | }); 53 | this.setData({ 54 | list: list 55 | }); 56 | } 57 | }, 58 | emitEvent (key) { 59 | this.triggerEvent('change', { key }); 60 | }, 61 | handleClickItem (e) { 62 | const key = e.currentTarget.dataset.key; 63 | this.emitEvent(key); 64 | } 65 | } 66 | }); 67 | -------------------------------------------------------------------------------- /dist/tab-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/tab-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dist/tab-bar/index.wxss: -------------------------------------------------------------------------------- 1 | .i-tab-bar{display:flex;width:100%;height:50px;box-sizing:border-box;position:relative;justify-content:space-around;align-items:center;-webkit-box-align:center;background:#fff}.i-tab-bar::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-tab-bar-fixed{position:fixed;bottom:0;z-index:2}.i-tab-bar-list{position:absolute;top:0;bottom:0;left:0;right:0}.i-tab-bar-layer{display:block;float:left;height:100%} -------------------------------------------------------------------------------- /dist/tab/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../tabs/index': { 6 | type: 'parent' 7 | } 8 | }, 9 | 10 | properties: { 11 | key: { 12 | type: String, 13 | value: '' 14 | }, 15 | title: { 16 | type: String, 17 | value: '' 18 | }, 19 | dot: { 20 | type: Boolean, 21 | value: false 22 | }, 23 | count: { 24 | type: Number, 25 | value: 0 26 | } 27 | }, 28 | 29 | data: { 30 | current: false, 31 | currentColor: '', 32 | scroll: false 33 | }, 34 | 35 | methods: { 36 | changeCurrent (current) { 37 | this.setData({ current }); 38 | }, 39 | changeCurrentColor (currentColor) { 40 | this.setData({ currentColor }); 41 | }, 42 | changeScroll (scroll) { 43 | this.setData({ scroll }); 44 | }, 45 | handleClickItem () { 46 | const parent = this.getRelationNodes('../tabs/index')[0]; 47 | parent.emitEvent(this.data.key); 48 | } 49 | } 50 | }); 51 | -------------------------------------------------------------------------------- /dist/tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-badge": "../badge/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ title }} 5 | {{ title }} 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dist/tab/index.wxss: -------------------------------------------------------------------------------- 1 | .i-tabs-tab{flex:1;display:flex;width:100%;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;text-align:center;position:relative}.i-tabs-tab-bar{display:block;width:100%;height:2px;background:0 0;position:absolute;bottom:0;left:0;background:#2d8cf0}.i-tabs-tab-title{font-size:14px;text-align:center;box-sizing:border-box;color:#80848f}.i-tabs-tab-title-current{color:#2d8cf0}.i-tabs-tab-scroll{display:inline-block;width:60px} -------------------------------------------------------------------------------- /dist/tabs/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | 4 | relations: { 5 | '../tab/index': { 6 | type: 'child', 7 | linked () { 8 | this.changeCurrent(); 9 | }, 10 | linkChanged () { 11 | this.changeCurrent(); 12 | }, 13 | unlinked () { 14 | this.changeCurrent(); 15 | } 16 | } 17 | }, 18 | 19 | properties: { 20 | current: { 21 | type: String, 22 | value: '', 23 | observer: 'changeCurrent' 24 | }, 25 | color: { 26 | type: String, 27 | value: '' 28 | }, 29 | scroll: { 30 | type: Boolean, 31 | value: false 32 | }, 33 | fixed: { 34 | type: Boolean, 35 | value: false 36 | } 37 | }, 38 | 39 | methods: { 40 | changeCurrent (val = this.data.current) { 41 | let items = this.getRelationNodes('../tab/index'); 42 | const len = items.length; 43 | 44 | if (len > 0) { 45 | items.forEach(item => { 46 | item.changeScroll(this.data.scroll); 47 | item.changeCurrent(item.data.key === val); 48 | item.changeCurrentColor(this.data.color); 49 | }); 50 | } 51 | }, 52 | emitEvent (key) { 53 | this.triggerEvent('change', { key }); 54 | } 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /dist/tabs/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /dist/tabs/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dist/tabs/index.wxss: -------------------------------------------------------------------------------- 1 | .i-tabs{display:flex;width:100%;height:42px;line-height:42px;box-sizing:border-box;position:relative;justify-content:space-around;align-items:center;-webkit-box-align:center;background:#fff}.i-tabs::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-tabs-scroll{display:block;overflow-x:auto;white-space:nowrap}.i-tabs-fixed{position:fixed;top:0;z-index:2} -------------------------------------------------------------------------------- /dist/tag/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['i-class'], 3 | properties : { 4 | //slot name 5 | name : { 6 | type : String, 7 | value : '' 8 | }, 9 | //can click or not click 10 | checkable : { 11 | type : Boolean, 12 | value : false 13 | }, 14 | //is current choose 15 | checked : { 16 | type : Boolean, 17 | value : true 18 | }, 19 | //background and color setting 20 | color : { 21 | type : String, 22 | value : 'default' 23 | }, 24 | //control fill or not 25 | type : { 26 | type : String, 27 | value : 'dot' 28 | } 29 | }, 30 | methods : { 31 | tapTag(){ 32 | const data = this.data; 33 | if( data.checkable ){ 34 | const checked = data.checked ? false : true; 35 | this.triggerEvent('change',{ 36 | name : data.name || '', 37 | checked : checked 38 | }); 39 | } 40 | } 41 | } 42 | }) -------------------------------------------------------------------------------- /dist/tag/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component" : true 3 | } -------------------------------------------------------------------------------- /dist/tag/index.wxml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | module.exports = { 8 | getClass : function(color,type,checked,checkable) { 9 | var initColorList = ['blue', 'green', 'red', 'yellow', 'default']; 10 | var theme = ''; 11 | var className = 'i-tag-'; 12 | if( initColorList.indexOf( color ) > -1 ){ 13 | theme = className + color; 14 | } 15 | if( type === 'border' ){ 16 | theme = className+color+'-border'; 17 | } 18 | if( checkable && checked ){ 19 | theme = className+color+'-checked'; 20 | }else if( checkable && !checked ){ 21 | theme = ( type === 'border' ? className + color +'-border' : className+'none' ); 22 | } 23 | 24 | return theme; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /dist/tag/index.wxss: -------------------------------------------------------------------------------- 1 | .i-tag{display:inline-block;height:18px;line-height:18px;padding:0 4px;border-radius:2px;background:#fff;font-size:11px;vertical-align:middle;border:1rpx solid #dddee1}.i-tag-none{border-color:#fff}.i-tag-default{border-color:#dddee1;background:#e9eaec}.i-tag-red{background:#ed3f14;color:#fff}.i-tag-red-border{color:#ed3f14;background:#fff;border-color:#ed3f14}.i-tag-red-checked{background:#ed3f14;color:#fff;border-color:#ed3f14}.i-tag-green{background:#19be6b;color:#fff;border-color:#19be6b}.i-tag-green-border{color:#19be6b;background:#fff;border-color:#19be6b}.i-tag-green-checked{background:#19be6b;color:#fff;border-color:#19be6b}.i-tag-blue{background:#2d8cf0;color:#fff;border-color:#2d8cf0}.i-tag-blue-border{color:#2d8cf0;background:#fff;border-color:#2d8cf0}.i-tag-blue-checked{background:#2d8cf0;color:#fff;border-color:#2d8cf0}.i-tag-yellow{background:#f90;color:#fff;border-color:#f90}.i-tag-yellow-border{color:#f90;background:#fff;border-color:#f90}.i-tag-yellow-checked{background:#f90;color:#fff;border-color:#f90}.i-tag-default-checked{background:#e9eaec;color:#495060;border-color:#e9eaec} -------------------------------------------------------------------------------- /dist/toast/index.js: -------------------------------------------------------------------------------- 1 | const default_data = { 2 | visible: false, 3 | content: '', 4 | icon: '', 5 | image: '', 6 | duration: 2, 7 | mask: true, 8 | type: 'default', // default || success || warning || error || loading 9 | }; 10 | 11 | let timmer = null; 12 | 13 | Component({ 14 | externalClasses: ['i-class'], 15 | 16 | data: { 17 | ...default_data 18 | }, 19 | 20 | methods: { 21 | handleShow (options) { 22 | const { type = 'default', duration = 2 } = options; 23 | 24 | this.setData({ 25 | ...options, 26 | type, 27 | duration, 28 | visible: true 29 | }); 30 | 31 | const d = this.data.duration * 1000; 32 | 33 | if (timmer) clearTimeout(timmer); 34 | if (d !== 0) { 35 | timmer = setTimeout(() => { 36 | this.handleHide(); 37 | timmer = null; 38 | }, d); 39 | } 40 | }, 41 | 42 | handleHide () { 43 | this.setData({ 44 | ...default_data 45 | }); 46 | } 47 | } 48 | }); 49 | -------------------------------------------------------------------------------- /dist/toast/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": 4 | { 5 | "i-icon": "../icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dist/toast/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {{ content }} 16 | -------------------------------------------------------------------------------- /dist/toast/index.wxss: -------------------------------------------------------------------------------- 1 | .i-toast{position:fixed;top:35%;left:50%;transform:translate3d(-50%,-50%,0);background:rgba(0,0,0,.7);color:#fff;font-size:14px;line-height:1.5em;margin:0 auto;box-sizing:border-box;padding:10px 18px;text-align:center;border-radius:4px;z-index:1010}.i-toast-mask{position:fixed;top:0;bottom:0;left:0;right:0;z-index:1010}.i-toast-icon{font-size:38px!important;margin-bottom:6px}.i-toast-image{max-width:100px;max-height:100px}.i-toast-loading{display:inline-block;vertical-align:middle;width:28px;height:28px;background:0 0;border-radius:50%;border:2px solid #fff;border-color:#fff #fff #fff #2d8cf0;animation:btn-spin .8s linear;animation-iteration-count:infinite}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} -------------------------------------------------------------------------------- /imgs/default/boy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/default/boy.jpg -------------------------------------------------------------------------------- /imgs/default/girl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/default/girl.jpg -------------------------------------------------------------------------------- /imgs/default/sharebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/default/sharebg.png -------------------------------------------------------------------------------- /imgs/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/empty.png -------------------------------------------------------------------------------- /imgs/ercode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/ercode.jpg -------------------------------------------------------------------------------- /imgs/hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/hot.png -------------------------------------------------------------------------------- /imgs/pyq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/pyq.png -------------------------------------------------------------------------------- /imgs/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/run.png -------------------------------------------------------------------------------- /imgs/run/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/run/1.png -------------------------------------------------------------------------------- /imgs/run/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/run/2.png -------------------------------------------------------------------------------- /imgs/run/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/run/3.png -------------------------------------------------------------------------------- /imgs/run/photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/run/photo.png -------------------------------------------------------------------------------- /imgs/run/ranking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/run/ranking.png -------------------------------------------------------------------------------- /imgs/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/share.png -------------------------------------------------------------------------------- /imgs/slidemenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/slidemenu.png -------------------------------------------------------------------------------- /imgs/tabbar/moments-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/tabbar/moments-w.png -------------------------------------------------------------------------------- /imgs/tabbar/moments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/tabbar/moments.png -------------------------------------------------------------------------------- /imgs/tabbar/pub-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/tabbar/pub-w.png -------------------------------------------------------------------------------- /imgs/tabbar/pub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/tabbar/pub.png -------------------------------------------------------------------------------- /imgs/tabbar/run-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/tabbar/run-w.png -------------------------------------------------------------------------------- /imgs/tabbar/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/tabbar/run.png -------------------------------------------------------------------------------- /imgs/tabbar/user-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/tabbar/user-w.png -------------------------------------------------------------------------------- /imgs/tabbar/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/tabbar/user.png -------------------------------------------------------------------------------- /imgs/test/modal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/test/modal.png -------------------------------------------------------------------------------- /imgs/userbg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/userbg.jpg -------------------------------------------------------------------------------- /imgs/wx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/imgs/wx.png -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "poprun", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@vant/weapp": { 8 | "version": "1.2.2", 9 | "resolved": "https://registry.npm.taobao.org/@vant/weapp/download/@vant/weapp-1.2.2.tgz?cache=0&sync_timestamp=1587435123675&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Fweapp%2Fdownload%2F%40vant%2Fweapp-1.2.2.tgz", 10 | "integrity": "sha1-ISz17rOBKnSG8sy7juOK876MRbk=" 11 | }, 12 | "vant-weapp": { 13 | "version": "0.5.28", 14 | "resolved": "https://registry.npm.taobao.org/vant-weapp/download/vant-weapp-0.5.28.tgz", 15 | "integrity": "sha1-Qm7biuxShKGnvqsbXpy3PlFExBs=" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "poprun", 3 | "version": "1.0.0", 4 | "description": "```\r npm install\r ```\r > 可能会报路径错误:根据报错创建指定目录", 5 | "main": "app.js", 6 | "dependencies": { 7 | "@vant/weapp": "^1.2.2", 8 | "vant-weapp": "^0.5.28" 9 | }, 10 | "devDependencies": {}, 11 | "scripts": { 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "keywords": [], 15 | "author": "Patrick-Jun", 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/Patrick-Jun/PopRun.git" 20 | }, 21 | "bugs": { 22 | "url": "https://github.com/Patrick-Jun/PopRun/issues" 23 | }, 24 | "homepage": "https://github.com/Patrick-Jun/PopRun#readme" 25 | } 26 | -------------------------------------------------------------------------------- /pages/moments/messages/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-icon": "@vant/weapp/icon/index", 4 | "van-swipe-cell": "@vant/weapp/swipe-cell/index", 5 | "van-cell": "@vant/weapp/cell/index", 6 | "van-cell-group": "@vant/weapp/cell-group/index", 7 | "van-tag": "@vant/weapp/tag/index" 8 | }, 9 | "navigationBarTitleText": "消息通知" 10 | } -------------------------------------------------------------------------------- /pages/moments/messages/messages.less: -------------------------------------------------------------------------------- 1 | .con{ 2 | display: flex; 3 | flex-direction: column; 4 | .item{ 5 | // margin: 2px 0px; 6 | border-bottom: 1px solid rgb(236, 236, 236); 7 | .msg{ 8 | padding: 0rpx 28rpx; 9 | font-size: 28rpx; 10 | color: gray; 11 | padding: 4px 12px; 12 | .created-time{ 13 | font-size: 22rpx; 14 | color: rgb(197, 195, 195); 15 | text-align: right; 16 | } 17 | } 18 | .green,.red{ 19 | display: box; 20 | box-orient: horizontal; 21 | box-pack: center; 22 | box-align: center; 23 | display: -webkit-box; 24 | -webkit-box-orient: horizontal; 25 | -webkit-box-pack: center; 26 | -webkit-box-align: center; 27 | 28 | color: white; 29 | text-align: center; 30 | width: 45px; 31 | height: 100%; 32 | } 33 | .green{ 34 | background-color: #07c160; 35 | } 36 | .red{ 37 | background-color: red; 38 | } 39 | } 40 | } 41 | 42 | .empty{ 43 | width: 100%; 44 | height: 100%; 45 | text-align: center; 46 | font-size: 48rpx; 47 | color: rgb(224, 218, 218); 48 | image{ 49 | margin-top: 20%; 50 | width: 400rpx; 51 | height: 500rpx; 52 | opacity: .3; 53 | } 54 | } 55 | 56 | .btns{ 57 | position: fixed; 58 | bottom: 20px; 59 | width: 100%; 60 | display: flex; 61 | flex-direction: row; 62 | text-align: center; 63 | .btn{ 64 | flex: 1; 65 | } 66 | } -------------------------------------------------------------------------------- /pages/moments/messages/messages.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 已读 6 | 7 | 8 | 9 | 10 | 系统通知 11 | 未读 12 | 已读 13 | 14 | 15 | 16 | 17 | 删除 18 | 19 | 20 | 21 | 22 | 已读 23 | 24 | 未读 25 | 已读 26 | {{ message.msg }} 27 | {{ message.created_at }} 28 | 29 | 删除 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 空空如也~ 38 | 39 | 40 | 41 | 42 | 全部已读 43 | 44 | 45 | 全部删除 46 | 47 | -------------------------------------------------------------------------------- /pages/moments/messages/messages.wxss: -------------------------------------------------------------------------------- 1 | .con { 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | .con .item { 6 | border-bottom: 1px solid #ececec; 7 | } 8 | .con .item .msg { 9 | padding: 0rpx 28rpx; 10 | font-size: 28rpx; 11 | color: gray; 12 | padding: 4px 12px; 13 | } 14 | .con .item .msg .created-time { 15 | font-size: 22rpx; 16 | color: #c5c3c3; 17 | text-align: right; 18 | } 19 | .con .item .green, 20 | .con .item .red { 21 | display: box; 22 | box-orient: horizontal; 23 | box-pack: center; 24 | box-align: center; 25 | display: -webkit-box; 26 | -webkit-box-orient: horizontal; 27 | -webkit-box-pack: center; 28 | -webkit-box-align: center; 29 | color: white; 30 | text-align: center; 31 | width: 45px; 32 | height: 100%; 33 | } 34 | .con .item .green { 35 | background-color: #07c160; 36 | } 37 | .con .item .red { 38 | background-color: red; 39 | } 40 | .empty { 41 | width: 100%; 42 | height: 100%; 43 | text-align: center; 44 | font-size: 48rpx; 45 | color: #e0dada; 46 | } 47 | .empty image { 48 | margin-top: 20%; 49 | width: 400rpx; 50 | height: 500rpx; 51 | opacity: 0.3; 52 | } 53 | .btns { 54 | position: fixed; 55 | bottom: 20px; 56 | width: 100%; 57 | display: flex; 58 | flex-direction: row; 59 | text-align: center; 60 | } 61 | .btns .btn { 62 | flex: 1; 63 | } 64 | -------------------------------------------------------------------------------- /pages/moments/moments.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "w-moments-item": "/components/w-moments-item/index", 4 | "van-icon": "@vant/weapp/icon/index", 5 | "van-popup": "@vant/weapp/popup/index", 6 | "van-swipe-cell": "@vant/weapp/swipe-cell/index", 7 | "van-cell": "@vant/weapp/cell/index", 8 | "van-cell-group": "@vant/weapp/cell-group/index", 9 | "van-tag": "@vant/weapp/tag/index" 10 | }, 11 | "enablePullDownRefresh": true 12 | } -------------------------------------------------------------------------------- /pages/moments/moments.less: -------------------------------------------------------------------------------- 1 | // 侧边框 2 | .slidemenu{ 3 | z-index: 11; 4 | position: fixed; 5 | right: 0; 6 | top: 0; 7 | // background-color: gray; 8 | width: 14px; 9 | height: 100%; 10 | display: flex; 11 | align-items: center; 12 | .img{ 13 | width: 14px; 14 | height: 120px; 15 | } 16 | } 17 | 18 | 19 | 20 | //侧滑菜单弹窗 21 | .menu{ 22 | width: 70px; 23 | padding: 20rpx 10rpx; 24 | border-radius: 30px 0 0 30px; 25 | background-color: white; 26 | z-index: 100; 27 | .main-item{ 28 | text-align: center; 29 | margin: 15px 0px; 30 | .add-background{ 31 | background-color: white; 32 | } 33 | .title{ 34 | width: 60px; 35 | font-size: 20rpx; 36 | } 37 | } 38 | } 39 | 40 | //消息盒子 41 | .messages{ 42 | width: 68%; 43 | height: 100%; 44 | background-color: white; 45 | z-index: 100; 46 | .messages-box{ 47 | width: 100%; 48 | margin: 15px 0px 10px; 49 | .title{ 50 | width: 100%; 51 | text-align: center; 52 | padding-bottom: 10rpx; 53 | border-bottom: 1px solid gray; 54 | } 55 | .con{ 56 | display: flex; 57 | flex-direction: column; 58 | .item{ 59 | // margin: 2px 0px; 60 | border-bottom: 1px solid gray; 61 | .msg{ 62 | padding: 0rpx 28rpx; 63 | font-size: 28rpx; 64 | color: gray; 65 | padding: 3px 12px; 66 | } 67 | .green,.red{ 68 | display: box; 69 | box-orient: horizontal; 70 | box-pack: center; 71 | box-align: center; 72 | display: -webkit-box; 73 | -webkit-box-orient: horizontal; 74 | -webkit-box-pack: center; 75 | -webkit-box-align: center; 76 | 77 | color: white; 78 | text-align: center; 79 | width: 45px; 80 | height: 100%; 81 | } 82 | .green{ 83 | background-color: green; 84 | } 85 | .red{ 86 | background-color: red; 87 | } 88 | } 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /pages/moments/moments.wxss: -------------------------------------------------------------------------------- 1 | .slidemenu { 2 | z-index: 11; 3 | position: fixed; 4 | right: 0; 5 | top: 0; 6 | width: 14px; 7 | height: 100%; 8 | display: flex; 9 | align-items: center; 10 | } 11 | .slidemenu .img { 12 | width: 14px; 13 | height: 120px; 14 | } 15 | .menu { 16 | width: 70px; 17 | padding: 20rpx 10rpx; 18 | border-radius: 30px 0 0 30px; 19 | background-color: white; 20 | z-index: 100; 21 | } 22 | .menu .main-item { 23 | text-align: center; 24 | margin: 15px 0px; 25 | } 26 | .menu .main-item .add-background { 27 | background-color: white; 28 | } 29 | .menu .main-item .title { 30 | width: 60px; 31 | font-size: 20rpx; 32 | } 33 | .messages { 34 | width: 68%; 35 | height: 100%; 36 | background-color: white; 37 | z-index: 100; 38 | } 39 | .messages .messages-box { 40 | width: 100%; 41 | margin: 15px 0px 10px; 42 | } 43 | .messages .messages-box .title { 44 | width: 100%; 45 | text-align: center; 46 | padding-bottom: 10rpx; 47 | border-bottom: 1px solid gray; 48 | } 49 | .messages .messages-box .con { 50 | display: flex; 51 | flex-direction: column; 52 | } 53 | .messages .messages-box .con .item { 54 | border-bottom: 1px solid gray; 55 | } 56 | .messages .messages-box .con .item .msg { 57 | padding: 0rpx 28rpx; 58 | font-size: 28rpx; 59 | color: gray; 60 | padding: 3px 12px; 61 | } 62 | .messages .messages-box .con .item .green, 63 | .messages .messages-box .con .item .red { 64 | display: box; 65 | box-orient: horizontal; 66 | box-pack: center; 67 | box-align: center; 68 | display: -webkit-box; 69 | -webkit-box-orient: horizontal; 70 | -webkit-box-pack: center; 71 | -webkit-box-align: center; 72 | color: white; 73 | text-align: center; 74 | width: 45px; 75 | height: 100%; 76 | } 77 | .messages .messages-box .con .item .green { 78 | background-color: green; 79 | } 80 | .messages .messages-box .con .item .red { 81 | background-color: red; 82 | } 83 | -------------------------------------------------------------------------------- /pages/moments/newMoment/newMoment.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-uploader": "@vant/weapp/uploader/index", 4 | "van-cell": "@vant/weapp/cell/index", 5 | "van-cell-group": "@vant/weapp/cell-group/index" 6 | } 7 | } -------------------------------------------------------------------------------- /pages/moments/newMoment/newMoment.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 16 | 17 | 18 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 发布 39 | 40 | 41 | -------------------------------------------------------------------------------- /pages/moments/newMoment/newMoment.wxss: -------------------------------------------------------------------------------- 1 | /* pages/moments/newMoment/newMoment.wxss */ 2 | .body{ 3 | padding: 10rpx; 4 | } 5 | .textarea{ 6 | /* border:1px solid #d8d7d7; */ 7 | width:100%; 8 | min-height: 300rpx; 9 | } 10 | .imgs{ 11 | margin-top: 22rpx; 12 | } 13 | .other{ 14 | margin-top: 8rpx; 15 | } 16 | .publish{ 17 | margin-top: 66rpx; 18 | width: 100%; 19 | height: 200rpx; 20 | text-align: center; 21 | } -------------------------------------------------------------------------------- /pages/pub/blockDetail/blockDetail.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | blockDetail:{} 9 | }, 10 | 11 | /** 12 | * 生命周期函数--监听页面加载 13 | */ 14 | onLoad: function (options) { 15 | let that=this; 16 | wx.request({ 17 | url: app.config.getHostUrl() + '/api/pub/getCourseDetail', 18 | data: options, 19 | success: (res) => { 20 | if (res.data.isSuccess) { 21 | res.data.data.text = res.data.data.text.split("
"); 22 | that.setData({ 23 | blockDetail: res.data.data 24 | }) 25 | // console.log(res.data.data) 26 | // console.log(this.data.blockDetail) 27 | } 28 | } 29 | }) 30 | // console.log(options) 31 | }, 32 | 33 | /** 34 | * 生命周期函数--监听页面初次渲染完成 35 | */ 36 | onReady: function () { 37 | 38 | }, 39 | 40 | /** 41 | * 生命周期函数--监听页面显示 42 | */ 43 | onShow: function () { 44 | 45 | }, 46 | 47 | /** 48 | * 生命周期函数--监听页面隐藏 49 | */ 50 | onHide: function () { 51 | 52 | }, 53 | 54 | /** 55 | * 生命周期函数--监听页面卸载 56 | */ 57 | onUnload: function () { 58 | 59 | }, 60 | 61 | /** 62 | * 页面相关事件处理函数--监听用户下拉动作 63 | */ 64 | onPullDownRefresh: function () { 65 | 66 | }, 67 | 68 | /** 69 | * 页面上拉触底事件的处理函数 70 | */ 71 | onReachBottom: function () { 72 | 73 | }, 74 | 75 | /** 76 | * 用户点击右上角分享 77 | */ 78 | onShareAppMessage: function () { 79 | 80 | } 81 | }) -------------------------------------------------------------------------------- /pages/pub/blockDetail/blockDetail.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /pages/pub/blockDetail/blockDetail.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{blockDetail.title}} 4 | 5 | 6 | 7 | 8 | {{blockDetail.desc}} 9 | 10 | 11 | {{item}} 12 | 13 | 14 | -------------------------------------------------------------------------------- /pages/pub/blockDetail/blockDetail.wxss: -------------------------------------------------------------------------------- 1 | .top { 2 | padding:0 16px; 3 | } 4 | .title { 5 | font-weight: bold; 6 | text-align: center; 7 | font-size: 40rpx; 8 | padding: 30rpx 0; 9 | } 10 | 11 | .desc-title { 12 | color: #666; 13 | font-size: 30rpx; 14 | font-weight: bold; 15 | text-indent: 2em; 16 | } 17 | .desc-con{ 18 | padding: 20rpx 0; 19 | text-indent: 2em; 20 | font-size: 30rpx; 21 | } -------------------------------------------------------------------------------- /pages/pub/blockMore/blockmore.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "w-block-item": "/components/w-block-item/w-block-item", 4 | "van-divider": "@vant/weapp/divider/index", 5 | "van-toast": "@vant/weapp/toast/index" 6 | } 7 | } -------------------------------------------------------------------------------- /pages/pub/blockMore/blockmore.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 教程分享 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pages/pub/blockMore/blockmore.wxss: -------------------------------------------------------------------------------- 1 | .pub { 2 | padding: 0 16px; 3 | } 4 | .block { 5 | display: flex; 6 | justify-content: space-between; 7 | align-items: center; 8 | flex-wrap: wrap; 9 | } -------------------------------------------------------------------------------- /pages/pub/listDetail/listDetail.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-cell": "@vant/weapp/cell/index", 4 | "van-cell-group": "@vant/weapp/cell-group/index", 5 | "van-image": "@vant/weapp/image/index", 6 | "van-button": "@vant/weapp/button/index" 7 | } 8 | } -------------------------------------------------------------------------------- /pages/pub/listDetail/listDetail.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{listDetail.title}} 6 | 7 | 8 | 10 | 11 | {{listDetail.desc}} 12 | 13 | 17 | 18 | {{item}} 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{listDetail.medal.name}} 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | {{signText}} 39 | 40 | 41 | -------------------------------------------------------------------------------- /pages/pub/listDetail/listDetail.wxss: -------------------------------------------------------------------------------- 1 | .top { 2 | padding:0 32rpx; 3 | } 4 | .image { 5 | display: block; 6 | width: 686rpx; 7 | padding-bottom: 30rpx; 8 | } 9 | .title { 10 | font-weight: bold; 11 | text-align: center; 12 | font-size: 40rpx; 13 | padding: 30rpx 0; 14 | } 15 | 16 | .desc-title { 17 | color: #666; 18 | font-size: 30rpx; 19 | font-weight: bold; 20 | text-indent: 2em; 21 | padding: 20rpx 0; 22 | } 23 | .desc-con{ 24 | padding: 20rpx 0; 25 | text-indent: 2em; 26 | font-size: 30rpx; 27 | } 28 | 29 | .medal-img { 30 | text-align: center; 31 | } 32 | .medal-name { 33 | color: blueviolet; 34 | text-align: center; 35 | font-weight: bold; 36 | margin-top: 10rpx; 37 | font-size: 38rpx; 38 | } 39 | .bottom { 40 | padding-bottom: 16px; 41 | } 42 | .apply { 43 | text-align: center; 44 | } -------------------------------------------------------------------------------- /pages/pub/listMore/listmore.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "w-list-item": "/components/w-list-item/w-list-item", 4 | "van-divider": "@vant/weapp/divider/index", 5 | "van-toast": "@vant/weapp/toast/index" 6 | } 7 | } -------------------------------------------------------------------------------- /pages/pub/listMore/listmore.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 活动广场 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pages/pub/listMore/listmore.wxss: -------------------------------------------------------------------------------- 1 | .pub { 2 | padding: 0 16px; 3 | } 4 | -------------------------------------------------------------------------------- /pages/pub/pub.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | swiperArr: [], 9 | list: [], 10 | block: [] 11 | }, 12 | 13 | /** 14 | * 生命周期函数--监听页面加载 15 | */ 16 | onLoad: function(options) { 17 | this.getSwiper(); 18 | this.getList(); 19 | this.getBlock(); 20 | }, 21 | 22 | // 获取轮播列表 23 | getSwiper() { 24 | let that = this; 25 | wx.request({ 26 | url: app.config.getHostUrl() + '/api/pub/getSwipper', 27 | success: (res) => { 28 | if (res.data.isSuccess) { 29 | res.data.data.forEach(e => { 30 | e.imgLink = "listDetail/listDetail?acid=" + e.acid 31 | }) 32 | that.setData({ 33 | swiperArr: res.data.data 34 | }) 35 | } 36 | }, 37 | }); 38 | }, 39 | // 获取活动 40 | getList() { 41 | let that = this; 42 | wx.request({ 43 | url: app.config.getHostUrl() + '/api/pub/getList', 44 | header: { 45 | "Content-Type": "application/json" 46 | }, 47 | data: { 48 | "pageindex": 0, 49 | "pagesize": 5 50 | }, 51 | method: "POST", 52 | success: (res) => { 53 | if (res.data.isSuccess) { 54 | res.data.data.activitys.forEach(e => { 55 | e.imgLink = "listDetail/listDetail?acid=" + e.acid 56 | }) 57 | that.setData({ 58 | list: res.data.data.activitys 59 | }) 60 | } 61 | }, 62 | }); 63 | }, 64 | // 获取课程 65 | getBlock() { 66 | let that=this; 67 | wx.request({ 68 | url: app.config.getHostUrl() + '/api/pub/getCourses', 69 | success: (res) => { 70 | if (res.data.isSuccess) { 71 | res.data.data.forEach(e => { 72 | e.imgLink = "blockDetail/blockDetail?rcid=" + e.rcid 73 | }) 74 | that.setData({ 75 | block: res.data.data 76 | }) 77 | } 78 | } 79 | }) 80 | }, 81 | 82 | /** 83 | * 页面相关事件处理函数--监听用户下拉动作 84 | */ 85 | onPullDownRefresh: function() { 86 | this.getSwiper(); 87 | this.getList(); 88 | this.getBlock(); 89 | app.stopRefresh(); 90 | } 91 | 92 | }) -------------------------------------------------------------------------------- /pages/pub/pub.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "w-list-item":"/components/w-list-item/w-list-item", 4 | "w-block-item":"/components/w-block-item/w-block-item", 5 | "van-divider": "@vant/weapp/divider/index", 6 | "van-grid": "@vant/weapp/grid/index", 7 | "van-grid-item": "@vant/weapp/grid-item/index", 8 | "van-cell": "@vant/weapp/cell/index" 9 | }, 10 | "enablePullDownRefresh": true 11 | } -------------------------------------------------------------------------------- /pages/pub/pub.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ item.title }} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 活动广场 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 教程分享 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /pages/pub/pub.wxss: -------------------------------------------------------------------------------- 1 | .pub { 2 | padding: 0 16px; 3 | } 4 | image { 5 | margin: auto; 6 | /* width: auto; */ 7 | /* height: auto; */ 8 | width: 100%; 9 | height: 100%; 10 | } 11 | swiper{ 12 | width: 100%; 13 | height: 380rpx; 14 | } 15 | swiper-item{ 16 | position: relative; 17 | } 18 | .swiper-title{ 19 | position: absolute; 20 | width: 100%; 21 | bottom: 0; 22 | left: 0; 23 | height: 60rpx; 24 | line-height: 60rpx; 25 | color: white; 26 | background: linear-gradient(to top, rgba(0, 0, 0, .8) , rgba(0, 0, 0, .4) ); 27 | text-align: center; 28 | overflow: hidden; 29 | white-space: nowrap; 30 | text-overflow: ellipsis; 31 | } 32 | 33 | .block { 34 | display: flex; 35 | justify-content: space-between; 36 | align-items: center; 37 | flex-wrap: wrap; 38 | } -------------------------------------------------------------------------------- /pages/run/run.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "i-button": "../../dist/button/index", 4 | "i-drawer": "../../dist/drawer/index", 5 | "i-card": "../../dist/card/index", 6 | "i-tabs": "../../dist/tabs/index", 7 | "i-tab": "../../dist/tab/index", 8 | "i-cell-group": "../../dist/cell-group/index", 9 | "i-cell": "../../dist/cell/index", 10 | "i-icon": "../../dist/icon/index", 11 | "van-dialog": "@vant/weapp/dialog/index", 12 | "van-toast": "@vant/weapp/toast/index", 13 | "van-tab": "@vant/weapp/tab/index", 14 | "van-tabs": "@vant/weapp/tabs/index", 15 | "share-menu": "/components/share-menu/index", 16 | "share-to-friend": "/components/share-to-friend/index" 17 | } 18 | } -------------------------------------------------------------------------------- /pages/run/sharePage/sharePage.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-field": "@vant/weapp/field/index", 4 | "van-button": "@vant/weapp/button/index" 5 | } 6 | } -------------------------------------------------------------------------------- /pages/run/sharePage/sharePage.less: -------------------------------------------------------------------------------- 1 | .main{ 2 | width: 100%; 3 | .btn{ 4 | margin-top: 40rpx; 5 | text-align: center; 6 | } 7 | } -------------------------------------------------------------------------------- /pages/run/sharePage/sharePage.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 加载中... 5 | 6 | 7 | 8 | 9 | 18 | 19 | 20 | 确认分享 21 | 22 | 23 | -------------------------------------------------------------------------------- /pages/run/sharePage/sharePage.wxss: -------------------------------------------------------------------------------- 1 | .main { 2 | width: 100%; 3 | } 4 | .main .btn { 5 | margin-top: 40rpx; 6 | text-align: center; 7 | } 8 | -------------------------------------------------------------------------------- /pages/user/edit/edit.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "image-cropper": "/components/image-cropper/image-cropper", 4 | "van-field": "@vant/weapp/field/index", 5 | "van-cell": "@vant/weapp/cell/index", 6 | "van-cell-group": "@vant/weapp/cell-group/index", 7 | "van-radio": "@vant/weapp/radio/index", 8 | "van-radio-group": "@vant/weapp/radio-group/index", 9 | "van-picker": "@vant/weapp/picker/index", 10 | "van-popup": "@vant/weapp/popup/index" 11 | } 12 | } -------------------------------------------------------------------------------- /pages/user/edit/edit.wxss: -------------------------------------------------------------------------------- 1 | .lc{ 2 | text-align: center; 3 | } 4 | .mt50{ 5 | margin-top: 50rpx; 6 | } 7 | .van-cell-title{ 8 | flex: none !important; 9 | -webkit-flex: none !important; 10 | max-width: 90px; 11 | min-width: 90px; 12 | } 13 | .picker-active{ 14 | font-size: 36rpx; 15 | } -------------------------------------------------------------------------------- /pages/user/modals/modals.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | isShowloading: true 10 | }, 11 | 12 | /** 13 | * 生命周期函数--监听页面加载 14 | */ 15 | onLoad: function (options) { 16 | let that = this; 17 | that.requestData(options.rid).then((res)=>{ 18 | that.setData({ 19 | medals: that.parseMedals(res), 20 | isShowloading: false 21 | }) 22 | }) 23 | if(options.ta){ //他人查看时 24 | wx.setNavigationBarTitle({ 25 | title: options.ta+'的勋章墙', 26 | }) 27 | } 28 | }, 29 | 30 | /** 31 | * 生命周期函数--监听页面初次渲染完成 32 | */ 33 | onReady: function () { 34 | 35 | }, 36 | 37 | /** 38 | * 用户点击右上角分享 39 | */ 40 | onShareAppMessage: function () { 41 | 42 | }, 43 | 44 | //获取个人勋章数据 45 | requestData(rid) { 46 | return new Promise((resolve, reject)=>{ 47 | wx.request({ 48 | url: app.config.getHostUrl()+'/api/user/getMedal', 49 | data: { rid }, 50 | method: 'POST', 51 | success: (result)=>{ 52 | if(result.data.isSuccess){ 53 | resolve(result.data.data); 54 | }else{ 55 | reject(result.data.msg); 56 | } 57 | }, 58 | fail: ()=>{}, 59 | complete: ()=>{} 60 | }); 61 | }) 62 | }, 63 | 64 | // 处理勋章数据 65 | parseMedals(medals) { 66 | if(medals == []) return medals; 67 | let nmedals = []; 68 | for (let i = 0; i < medals.length; i++) { 69 | // if (medals[i] == undefined) continue; 70 | let outer = medals[i]; 71 | let item = [outer]; //内循收集 72 | // for (let n = i + 1; n < medals.length; n++) { 73 | // if (outer.type == 0) break; 74 | // if (medals[n] == undefined) continue; 75 | // let inner = medals[n]; 76 | // if (outer.meid == inner.meid) { 77 | // item.push(inner); 78 | // delete medals[n]; //用splice不行,因为n的最大值在循环开始就确定了 79 | // } 80 | // } 81 | nmedals.push(item); 82 | } 83 | return nmedals; 84 | }, 85 | }) -------------------------------------------------------------------------------- /pages/user/modals/modals.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-grid": "@vant/weapp/grid/index", 4 | "van-grid-item": "@vant/weapp/grid-item/index", 5 | "w-modals-item": "/components/w-modals-item/index" 6 | }, 7 | "navigationBarTitleText": "我的勋章墙" 8 | } -------------------------------------------------------------------------------- /pages/user/modals/modals.less: -------------------------------------------------------------------------------- 1 | .empty{ 2 | width: 100%; 3 | height: 100%; 4 | text-align: center; 5 | font-size: 48rpx; 6 | color: rgb(224, 218, 218); 7 | image{ 8 | margin-top: 20%; 9 | width: 400rpx; 10 | height: 500rpx; 11 | opacity: .3; 12 | } 13 | } -------------------------------------------------------------------------------- /pages/user/modals/modals.wxml: -------------------------------------------------------------------------------- 1 | 2 | 加载中... 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 空空如也~ 15 | -------------------------------------------------------------------------------- /pages/user/modals/modals.wxss: -------------------------------------------------------------------------------- 1 | .empty { 2 | width: 100%; 3 | height: 100%; 4 | text-align: center; 5 | font-size: 48rpx; 6 | color: #e0dada; 7 | } 8 | .empty image { 9 | margin-top: 20%; 10 | width: 400rpx; 11 | height: 500rpx; 12 | opacity: 0.3; 13 | } 14 | -------------------------------------------------------------------------------- /pages/user/myMoments/myMoments.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "w-moments-item": "/components/w-moments-item/index" 4 | }, 5 | "navigationBarTitleText": "我的动态", 6 | "enablePullDownRefresh": true 7 | } -------------------------------------------------------------------------------- /pages/user/myMoments/myMoments.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/pages/user/myMoments/myMoments.less -------------------------------------------------------------------------------- /pages/user/myMoments/myMoments.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 加载中... 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pages/user/myMoments/myMoments.wxss: -------------------------------------------------------------------------------- 1 | /* pages/user/myMoments/myMoments.wxss */ -------------------------------------------------------------------------------- /pages/user/myRuns/myRuns.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-divider": "@vant/weapp/divider/index", 4 | "w-run-item": "/components/w-runs-item/index" 5 | }, 6 | "navigationBarTitleText": "我的运动", 7 | "enablePullDownRefresh": true 8 | } -------------------------------------------------------------------------------- /pages/user/myRuns/myRuns.less: -------------------------------------------------------------------------------- 1 | @import '../../../theme/theme.less'; 2 | .main{ 3 | background-color: rgb(255, 255, 255); 4 | width: 100%; 5 | .head{ 6 | width: 100%; 7 | height: 380rpx; 8 | position: relative; 9 | .img{ 10 | width: 120rpx; 11 | height: 120rpx; 12 | position: absolute; 13 | top: 20rpx; 14 | left: 20rpx; 15 | border: 14rpx solid white; 16 | border-radius: 50%; 17 | z-index: 10; 18 | } 19 | .card{ 20 | width: 82%; 21 | height: 300rpx; 22 | position: absolute; 23 | top: 80rpx; 24 | left: 70rpx; 25 | background-color: @theme; 26 | border-radius: 40rpx; 27 | box-shadow: 5px 5px 5px rgba(104, 103, 103, 0.6); 28 | .totle{ 29 | height: 150rpx; 30 | line-height: 150rpx; 31 | padding-left: 100rpx; 32 | font-size: 36rpx; 33 | color: white; 34 | text{ 35 | font-size: 60rpx; 36 | color: rgb(44, 44, 44); 37 | } 38 | } 39 | .detail{ 40 | margin-top: 20rpx; 41 | display: flex; 42 | flex-direction: row; 43 | text-align: center; 44 | .item{ 45 | flex: 1; 46 | display: flex; 47 | flex-direction: column; 48 | .value{ 49 | font-size: 32rpx; 50 | color: rgb(63, 63, 63); 51 | } 52 | .name{ 53 | color: white; 54 | font-size: 20rpx; 55 | margin-top: 7rpx; 56 | } 57 | } 58 | } 59 | } 60 | .card-hover{ 61 | // width: calc(82% + 2px); 62 | // height: calc(300rpx + 2px); 63 | box-shadow: 3px 3px 3px rgba(104, 103, 103, 0.6); 64 | } 65 | } 66 | .body{ 67 | padding-top: 50rpx; 68 | padding-bottom: 50rpx; 69 | } 70 | } -------------------------------------------------------------------------------- /pages/user/myRuns/myRuns.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 加载中... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 累计里程:{{runData.sumD || 0}}km 13 | 14 | 15 | 16 | {{runData.times || 0}} 17 | 累计次数 18 | 19 | 20 | {{runData.sumT || 0}} 21 | 累计时长(分) 22 | 23 | 24 | {{runData.maxD || 0}} 25 | 最大里程(km) 26 | 27 | 28 | {{runData.maxT || 0}} 29 | 最大时长(分) 30 | 31 | 32 | {{runData.avgS || 0}} 33 | 平均配速 34 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /pages/user/myRuns/myRuns.wxss: -------------------------------------------------------------------------------- 1 | /* 主题 /theme/theme.less */ 2 | .main { 3 | background-color: #ffffff; 4 | width: 100%; 5 | } 6 | .main .head { 7 | width: 100%; 8 | height: 380rpx; 9 | position: relative; 10 | } 11 | .main .head .img { 12 | width: 120rpx; 13 | height: 120rpx; 14 | position: absolute; 15 | top: 20rpx; 16 | left: 20rpx; 17 | border: 14rpx solid white; 18 | border-radius: 50%; 19 | z-index: 10; 20 | } 21 | .main .head .card { 22 | width: 82%; 23 | height: 300rpx; 24 | position: absolute; 25 | top: 80rpx; 26 | left: 70rpx; 27 | background-color: #63b7af; 28 | border-radius: 40rpx; 29 | box-shadow: 5px 5px 5px rgba(104, 103, 103, 0.6); 30 | } 31 | .main .head .card .totle { 32 | height: 150rpx; 33 | line-height: 150rpx; 34 | padding-left: 100rpx; 35 | font-size: 36rpx; 36 | color: white; 37 | } 38 | .main .head .card .totle text { 39 | font-size: 60rpx; 40 | color: #2c2c2c; 41 | } 42 | .main .head .card .detail { 43 | margin-top: 20rpx; 44 | display: flex; 45 | flex-direction: row; 46 | text-align: center; 47 | } 48 | .main .head .card .detail .item { 49 | flex: 1; 50 | display: flex; 51 | flex-direction: column; 52 | } 53 | .main .head .card .detail .item .value { 54 | font-size: 32rpx; 55 | color: #3f3f3f; 56 | } 57 | .main .head .card .detail .item .name { 58 | color: white; 59 | font-size: 20rpx; 60 | margin-top: 7rpx; 61 | } 62 | .main .head .card-hover { 63 | box-shadow: 3px 3px 3px rgba(104, 103, 103, 0.6); 64 | } 65 | .main .body { 66 | padding-top: 50rpx; 67 | padding-bottom: 50rpx; 68 | } 69 | -------------------------------------------------------------------------------- /pages/user/privacy/privacy.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-cell": "@vant/weapp/cell/index", 4 | "van-cell-group": "@vant/weapp/cell-group/index", 5 | "van-radio": "@vant/weapp/radio/index", 6 | "van-radio-group": "@vant/weapp/radio-group/index", 7 | "van-switch": "@vant/weapp/switch/index" 8 | }, 9 | "navigationBarTitleText": "隐私设置" 10 | } -------------------------------------------------------------------------------- /pages/user/privacy/privacy.less: -------------------------------------------------------------------------------- 1 | .title{ 2 | font-size: 36rpx; 3 | } 4 | -------------------------------------------------------------------------------- /pages/user/privacy/privacy.wxml: -------------------------------------------------------------------------------- 1 | 加载中... 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pages/user/privacy/privacy.wxss: -------------------------------------------------------------------------------- 1 | .title { 2 | font-size: 36rpx; 3 | } 4 | -------------------------------------------------------------------------------- /pages/user/setting/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-cell": "@vant/weapp/cell/index", 4 | "van-cell-group": "@vant/weapp/cell-group/index", 5 | "van-radio": "@vant/weapp/radio/index", 6 | "van-radio-group": "@vant/weapp/radio-group/index", 7 | "van-switch": "@vant/weapp/switch/index" 8 | }, 9 | "navigationBarTitleText": "通用设置" 10 | } -------------------------------------------------------------------------------- /pages/user/setting/setting.less: -------------------------------------------------------------------------------- 1 | .title{ 2 | font-size: 32rpx; 3 | } 4 | 5 | .van-cell-title{ 6 | font-size: 32rpx; 7 | flex: none !important; 8 | -webkit-flex: none !important; 9 | max-width: 90px; 10 | min-width: 90px; 11 | } -------------------------------------------------------------------------------- /pages/user/setting/setting.wxml: -------------------------------------------------------------------------------- 1 | 加载中... 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 红点 28 | 29 | 30 | 数字 31 | 32 | 33 | 免打扰 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /pages/user/setting/setting.wxss: -------------------------------------------------------------------------------- 1 | .title { 2 | font-size: 32rpx; 3 | } 4 | .van-cell-title { 5 | font-size: 32rpx; 6 | flex: none !important; 7 | -webkit-flex: none !important; 8 | max-width: 90px; 9 | min-width: 90px; 10 | } 11 | -------------------------------------------------------------------------------- /pages/user/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-divider": "@vant/weapp/divider/index", 4 | "van-tag": "@vant/weapp/tag/index", 5 | "van-cell": "@vant/weapp/cell/index", 6 | "van-cell-group": "@vant/weapp/cell-group/index", 7 | "van-grid": "@vant/weapp/grid/index", 8 | "van-grid-item": "@vant/weapp/grid-item/index", 9 | "w-modals-item": "/components/w-modals-item/index", 10 | "van-popup": "@vant/weapp/popup/index" 11 | }, 12 | "enablePullDownRefresh": true 13 | } -------------------------------------------------------------------------------- /pages/user/userPage/userPage.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-tag": "@vant/weapp/tag/index", 4 | "w-modals-item": "/components/w-modals-item/index", 5 | "van-cell": "@vant/weapp/cell/index", 6 | "van-cell-group": "@vant/weapp/cell-group/index", 7 | "van-grid": "@vant/weapp/grid/index", 8 | "van-grid-item": "@vant/weapp/grid-item/index", 9 | "w-moments-item": "/components/w-moments-item/index" 10 | } 11 | } -------------------------------------------------------------------------------- /pages/user/userPage/userPage.wxss: -------------------------------------------------------------------------------- 1 | /* 整个页面 */ 2 | /* 主题 /theme/theme.less */ 3 | .main { 4 | background: url('http://img.cdn.1zdz.cn/app/poprun/poprun-bg.webp') center no-repeat; 5 | background-size: cover; 6 | padding: 60rpx 0rpx 10rpx 0rpx; 7 | font-size: 26rpx; 8 | color: white; 9 | /* 签名 */ 10 | } 11 | .main .head-img { 12 | padding: 0rpx 6rpx; 13 | } 14 | .main .head-name-col { 15 | height: 100px; 16 | padding-top: 10px; 17 | } 18 | .main .head-name { 19 | display: flex; 20 | flex-direction: row; 21 | } 22 | .main .head-name .name { 23 | max-width: 320rpx; 24 | color: #6886c5; 25 | font-size: 32rpx; 26 | font-weight: 700; 27 | padding-right: 12rpx; 28 | white-space: nowrap; 29 | overflow: hidden; 30 | text-overflow: ellipsis; 31 | } 32 | .main .head-name .head-name-n text { 33 | display: inline-block; 34 | margin-left: 10rpx; 35 | height: 34rpx; 36 | line-height: 34rpx; 37 | font-size: 30rpx; 38 | border-radius: 4px; 39 | color: white; 40 | } 41 | .main .head-teamjob { 42 | display: flex; 43 | flex-direction: row; 44 | margin-top: 12rpx; 45 | } 46 | .main .head-teamjob .job { 47 | margin-left: 14rpx; 48 | } 49 | .main .head-run { 50 | display: flex; 51 | flex-direction: row; 52 | margin-top: 12rpx; 53 | } 54 | .main .head-run text { 55 | color: white; 56 | } 57 | .main .head-run .time { 58 | margin-left: 14rpx; 59 | } 60 | .main .head-info { 61 | font-size: 30rpx; 62 | margin-top: 10rpx; 63 | text-align: center; 64 | letter-spacing: 1px; 65 | color: white; 66 | } 67 | .main .run-data { 68 | margin-top: 16rpx; 69 | padding: 15rpx 0rpx; 70 | display: flex; 71 | flex-direction: row; 72 | text-align: center; 73 | } 74 | .main .run-data .item { 75 | flex: 1; 76 | display: flex; 77 | flex-direction: column; 78 | color: white; 79 | } 80 | .main .run-data .item .name { 81 | font-size: 20rpx; 82 | margin-top: 7rpx; 83 | } 84 | .head-modal { 85 | background-color: white; 86 | z-index: 10; 87 | } 88 | .head-modal .modal-title { 89 | display: inline-block; 90 | } 91 | .empty { 92 | width: 100%; 93 | height: 100%; 94 | text-align: center; 95 | font-size: 48rpx; 96 | color: #e0dada; 97 | } 98 | .empty image { 99 | margin-top: 10rpx; 100 | width: 300rpx; 101 | height: 375rpx; 102 | opacity: 0.3; 103 | } 104 | -------------------------------------------------------------------------------- /sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /theme/theme.less: -------------------------------------------------------------------------------- 1 | /* 主题 /theme/theme.less */ 2 | @theme: #63b7af; 3 | @theme-light: #abf0e9; 4 | 5 | @bg: #d4f3ef; 6 | 7 | @warning: #ffe0ac; 8 | @danger: #ffacb7; 9 | @primary: #6886c5; 10 | @enhance: #ee8572; -------------------------------------------------------------------------------- /theme/theme.wxss: -------------------------------------------------------------------------------- 1 | /* 主题 /theme/theme.less */ 2 | -------------------------------------------------------------------------------- /utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':') 9 | } 10 | 11 | const formatNumber = n => { 12 | n = n.toString() 13 | return n[1] ? n : '0' + n 14 | } 15 | // 速度单位换算m/s=>min s/km 16 | const formatSpeed = speed=>{ 17 | //s/km 18 | // speed=parseFloat(speed) 19 | if (speed <= 0 || !speed) { 20 | return "--′--″" 21 | } else { 22 | speed = 1000 / speed; 23 | let s = formatNumber(parseInt(speed % 60)); 24 | let m = formatNumber(parseInt(speed / 60) % 60); 25 | return m + "′" + s + "″"; 26 | } 27 | } 28 | 29 | // 计算时间 x分钟 => 00:00 30 | const formatPeriod2time = n => { 31 | return formatNumber(Math.floor(n/60))+':'+formatNumber(n%60); 32 | } 33 | 34 | // 字符串转date 35 | const string2date = str => { 36 | return new Date(str); 37 | } 38 | 39 | 40 | module.exports = { 41 | formatTime: formatTime, 42 | formatNumber: formatNumber, 43 | formatSpeed: formatSpeed, 44 | formatPeriod2time, 45 | string2date 46 | } 47 | -------------------------------------------------------------------------------- /voice/countDown.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chef5/PopRun/b510745f05ee554d86dc67ef0e255f5c18d6bde9/voice/countDown.mp3 --------------------------------------------------------------------------------