├── .eslintrc.js ├── .gitignore ├── LICENSE ├── README.md ├── app.js ├── app.json ├── app.wxss ├── components ├── category-tab │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── daily-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── daily-tab │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── follow-tab │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── news-tab │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── recommend-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── recommend-tab │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── topic-tab │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── images ├── home_ic_img_avatar.png ├── home_ic_mine_normal.png ├── home_ic_mine_selected.png ├── home_ic_normal.png └── home_ic_selected.png ├── miniprogram_npm ├── lin-ui │ ├── action-sheet │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── album │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxs │ │ └── index.wxss │ ├── arc-popup │ │ ├── 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 │ ├── behaviors │ │ ├── computeOffset.js │ │ ├── countdown.js │ │ ├── hover.js │ │ ├── rules.js │ │ ├── scrollCenter.js │ │ ├── transition.js │ │ ├── validator.js │ │ ├── watchShow.js │ │ └── zIndex.js │ ├── button │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── calendar │ │ ├── calendar.wxml │ │ ├── components │ │ │ ├── day │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ ├── index.wxs │ │ │ │ └── index.wxss │ │ │ ├── header │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ └── mounth │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ ├── index.wxs │ │ │ │ └── index.wxss │ │ ├── config.js │ │ ├── dete.js │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxs │ │ ├── index.wxss │ │ ├── util.js │ │ └── utils.wxs │ ├── capsule-bar │ │ ├── icons │ │ │ ├── capsule-left-black.png │ │ │ ├── capsule-left-white.png │ │ │ ├── capsule-right-black.png │ │ │ └── capsule-right-white.png │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── card │ │ ├── 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 │ ├── circle │ │ ├── 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 │ ├── combined-tabs │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── common │ │ └── async-validator │ │ │ ├── index.js │ │ │ ├── messages.js │ │ │ ├── rule │ │ │ ├── enum.js │ │ │ ├── index.js │ │ │ ├── pattern.js │ │ │ ├── range.js │ │ │ ├── required.js │ │ │ ├── type.js │ │ │ └── whitespace.js │ │ │ ├── util.js │ │ │ └── validator │ │ │ ├── array.js │ │ │ ├── boolean.js │ │ │ ├── date.js │ │ │ ├── enum.js │ │ │ ├── float.js │ │ │ ├── index.js │ │ │ ├── integer.js │ │ │ ├── method.js │ │ │ ├── number.js │ │ │ ├── object.js │ │ │ ├── pattern.js │ │ │ ├── regexp.js │ │ │ ├── required.js │ │ │ ├── string.js │ │ │ └── type.js │ ├── core │ │ ├── behaviors │ │ │ └── doNothingBehavior.js │ │ └── utils │ │ │ ├── data-util.js │ │ │ ├── event-bus.js │ │ │ ├── event-util.js │ │ │ ├── node-util.js │ │ │ └── pixel-util.js │ ├── countdown │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── counter │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── custom-tab-bar │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── dialog │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── error-tip │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── filter │ │ ├── array.wxs │ │ ├── classnames.wxs │ │ ├── is.wxs │ │ ├── object.wxs │ │ ├── string.wxs │ │ └── zero-padding.wxs │ ├── form-item │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── form │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── grid-item │ │ ├── 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 │ ├── image-clipper-tools │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── image-clipper │ │ ├── calculate.js │ │ ├── images │ │ │ ├── close.png │ │ │ ├── photo.png │ │ │ ├── rotate-along.png │ │ │ ├── rotate-inverse.png │ │ │ └── sure.png │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── image-picker │ │ ├── image │ │ │ └── add.png │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── index-anchor │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── index-list │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── input │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── list │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── loading │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── loadmore │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── mask │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── message │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── notice-bar │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── popup │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── price │ │ ├── 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 │ ├── search-bar │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── segment-item │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── segment │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── skeleton │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── slide-view │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── spin │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── status-show │ │ ├── image │ │ │ ├── address.png │ │ │ ├── cart.png │ │ │ ├── data.png │ │ │ ├── error.png │ │ │ ├── network.png │ │ │ ├── order.png │ │ │ ├── product.png │ │ │ └── success.png │ │ ├── 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 │ ├── tab-bar │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── tabpanel │ │ ├── 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 │ ├── textarea │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── toast │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── transition │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── utils │ │ ├── device-util.js │ │ └── util.js │ └── water-flow │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss └── moment │ ├── index.js │ └── index.js.map ├── package-lock.json ├── package.json ├── pages ├── category-detail │ ├── category-detail.js │ ├── category-detail.json │ ├── category-detail.wxml │ └── category-detail.wxss ├── home │ ├── home.js │ ├── home.json │ ├── home.wxml │ └── home.wxss ├── mine │ ├── mime.js │ ├── mime.json │ ├── mime.wxml │ └── mime.wxss ├── news-detail │ ├── news-detail.js │ ├── news-detail.json │ ├── news-detail.wxml │ └── news-detail.wxss ├── topic-detail │ ├── topic-detail.js │ ├── topic-detail.json │ ├── topic-detail.wxml │ └── topic-detail.wxss └── video-detail │ ├── video-detail.js │ ├── video-detail.json │ ├── video-detail.wxml │ └── video-detail.wxss ├── project.config.json ├── sitemap.json └── utils └── util.js /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Eslint config file 3 | * Documentation: https://eslint.org/docs/user-guide/configuring/ 4 | * Install the Eslint extension before using this feature. 5 | */ 6 | module.exports = { 7 | env: { 8 | es6: true, 9 | browser: true, 10 | node: true, 11 | }, 12 | ecmaFeatures: { 13 | modules: true, 14 | }, 15 | parserOptions: { 16 | ecmaVersion: 2018, 17 | sourceType: 'module', 18 | }, 19 | globals: { 20 | wx: true, 21 | App: true, 22 | Page: true, 23 | getCurrentPages: true, 24 | getApp: true, 25 | Component: true, 26 | requirePlugin: true, 27 | requireMiniProgram: true, 28 | }, 29 | // extends: 'eslint:recommended', 30 | rules: {}, 31 | } 32 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 fmtjava 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.js: -------------------------------------------------------------------------------- 1 | // app.js 2 | App({ 3 | onLaunch() { 4 | // 展示本地存储能力 5 | const logs = wx.getStorageSync('logs') || [] 6 | logs.unshift(Date.now()) 7 | wx.setStorageSync('logs', logs) 8 | 9 | // 登录 10 | wx.login({ 11 | success: res => { 12 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 13 | } 14 | }) 15 | }, 16 | globalData: { 17 | userInfo: null 18 | }, 19 | gBaseUrl:"http://baobab.kaiyanapp.com/api/" 20 | }) 21 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/home/home", 4 | "pages/mine/mime", 5 | "pages/category-detail/category-detail", 6 | "pages/video-detail/video-detail", 7 | "pages/news-detail/news-detail", 8 | "pages/topic-detail/topic-detail" 9 | ], 10 | "usingComponents": { 11 | "l-icon": "/miniprogram_npm/lin-ui/icon/index", 12 | "l-loadmore": "/miniprogram_npm/lin-ui/loadmore/index" 13 | }, 14 | "window": { 15 | "backgroundTextStyle": "light", 16 | "navigationBarBackgroundColor": "#fff", 17 | "navigationBarTitleText": "Weixin", 18 | "navigationBarTextStyle": "black" 19 | }, 20 | "tabBar": { 21 | "borderStyle": "white", 22 | "selectedColor": "#000000", 23 | "position": "bottom", 24 | "color": "#9a9a9a", 25 | "list": [ 26 | { 27 | "text": "首页", 28 | "pagePath": "pages/home/home", 29 | "iconPath": "/images/home_ic_normal.png", 30 | "selectedIconPath": "/images/home_ic_selected.png" 31 | }, 32 | { 33 | "text": "我的", 34 | "pagePath": "pages/mine/mime", 35 | "iconPath": "/images/home_ic_mine_normal.png", 36 | "selectedIconPath": "/images/home_ic_mine_selected.png" 37 | } 38 | ] 39 | }, 40 | "style": "v2", 41 | "sitemapLocation": "sitemap.json" 42 | } -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /components/category-tab/index.js: -------------------------------------------------------------------------------- 1 | 2 | const app = getApp() 3 | 4 | Component({ 5 | /** 6 | * 组件的属性列表 7 | */ 8 | properties: { 9 | 10 | }, 11 | 12 | /** 13 | * 组件的初始数据 14 | */ 15 | data: { 16 | categoryList:[] 17 | }, 18 | 19 | /** 20 | * 组件的方法列表 21 | */ 22 | methods: { 23 | onRefresh(){ 24 | wx.request({ 25 | url: app.gBaseUrl + 'v4/categories', 26 | success:(res)=>{ 27 | this.setData({ 28 | categoryList:res.data 29 | }) 30 | wx.stopPullDownRefresh() 31 | }, 32 | fail:(res)=>{ 33 | wx.showToast({ 34 | icon:'error', 35 | title: res.errMsg, 36 | }) 37 | } 38 | }) 39 | }, 40 | go2CategoryDetail(event){ 41 | const category = this.data.categoryList[event.detail.index] 42 | wx.navigateTo({ 43 | url: '/pages/category-detail/category-detail?id=' + category.id + "&headerImage=" + category.headerImage + "&name=" + category.name + "&description=" + category.description, 44 | }) 45 | } 46 | }, 47 | attached: function() { 48 | this.onRefresh() 49 | }, 50 | }) 51 | -------------------------------------------------------------------------------- /components/category-tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "l-grid":"/miniprogram_npm/lin-ui/grid/index", 5 | "l-grid-item":"/miniprogram_npm/lin-ui/grid-item/index" 6 | } 7 | } -------------------------------------------------------------------------------- /components/category-tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #{{item.name}} 5 | 6 | -------------------------------------------------------------------------------- /components/category-tab/index.wxss: -------------------------------------------------------------------------------- 1 | 2 | .category-container{ 3 | margin-top: 100rpx; 4 | margin-left: 10rpx; 5 | margin-right: 10rpx; 6 | } 7 | 8 | .l-grid-item{ 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | flex-direction: column; 13 | padding: 8rpx 8rpx; 14 | box-sizing: border-box 15 | } 16 | .category-img{ 17 | width: 100%; 18 | height: 400rpx; 19 | border-radius: 8rpx; 20 | } 21 | 22 | .category-text{ 23 | position: absolute; 24 | color: #ffffff; 25 | font-size: 44rpx; 26 | font-weight: bold; 27 | } -------------------------------------------------------------------------------- /components/daily-item/index.js: -------------------------------------------------------------------------------- 1 | // components/daily/daily.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | item:Object 8 | }, 9 | 10 | /** 11 | * 组件的初始数据 12 | */ 13 | data: { 14 | 15 | }, 16 | 17 | /** 18 | * 组件的方法列表 19 | */ 20 | methods: { 21 | go2VideoDetail(event){ 22 | const itemJsonStr = encodeURIComponent(JSON.stringify(this.properties.item)) 23 | wx.navigateTo({ 24 | url: '/pages/video-detail/video-detail?item=' + itemJsonStr, 25 | }) 26 | } 27 | } 28 | }) 29 | -------------------------------------------------------------------------------- /components/daily-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | 5 | } 6 | } -------------------------------------------------------------------------------- /components/daily-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{item.data.category}} 8 | 9 | 10 | 11 | {{item.videoTimeText}} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {{item.data.title}} 21 | {{item.data.author === null ? item.data.author.name : item.data.tags[0].name}} 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /components/daily-tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "daily-item":"/components/daily-item/index" 5 | } 6 | } -------------------------------------------------------------------------------- /components/daily-tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | {{item.data.text}} 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /components/daily-tab/index.wxss: -------------------------------------------------------------------------------- 1 | .container{ 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | 6 | .banner-swiper{ 7 | margin-top: 100rpx; 8 | width: 100%; 9 | height: 400rpx; 10 | padding-left: 30rpx; 11 | padding-right: 30rpx; 12 | box-sizing: border-box; 13 | } 14 | 15 | .banner-swiper-item{ 16 | width: 100%; 17 | border-radius: 8rpx; 18 | } 19 | 20 | .banner-image{ 21 | width: 100%; 22 | border-radius: 8rpx; 23 | } 24 | 25 | .title-container{ 26 | display: flex; 27 | align-items: center; 28 | justify-content: center; 29 | margin-top: 20rpx; 30 | } 31 | 32 | .title{ 33 | font-size: 36rpx; 34 | color: #000000DD; 35 | font-weight: bold; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /components/follow-tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/follow-tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{item.data.header.title}} 8 | {{item.data.header.description}} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | {{followItem.data.category}} 18 | 19 | {{followItem.data.title}} 20 | {{followItem.releaseTimeStr}} 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /components/news-tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/news-tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{item.data.text}} 4 | 5 | 6 | 7 | {{titleItem}} 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /components/news-tab/index.wxss: -------------------------------------------------------------------------------- 1 | /* components/news-tab/index.wxss */ 2 | .container{ 3 | display: flex; 4 | flex-direction: column; 5 | margin-top: 100rpx; 6 | } 7 | .title{ 8 | margin-top: 10rpx; 9 | margin-left: 20rpx; 10 | color: #000000DD; 11 | font-size: 44rpx; 12 | font-weight: bold; 13 | } 14 | 15 | .card{ 16 | display: flex; 17 | flex-direction: column; 18 | background-color: #EDEDED; 19 | margin: 20rpx; 20 | padding-bottom: 20rpx; 21 | border-radius: 8rpx; 22 | } 23 | 24 | .image{ 25 | width: 100%; 26 | height: 280rpx; 27 | border-top-left-radius: 8rpx; 28 | border-top-right-radius: 8rpx; 29 | margin-bottom: 10rpx; 30 | } 31 | 32 | .content{ 33 | margin-left: 20rpx; 34 | margin-right: 20rpx; 35 | margin-top: 10rpx; 36 | font-size: 24rpx; 37 | color: #333333; 38 | } -------------------------------------------------------------------------------- /components/recommend-item/index.js: -------------------------------------------------------------------------------- 1 | // components/recommend-item/index.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | data:Object 8 | }, 9 | 10 | /** 11 | * 组件的初始数据 12 | */ 13 | data: { 14 | 15 | }, 16 | 17 | /** 18 | * 组件的方法列表 19 | */ 20 | methods: { 21 | go2Recommend(event){ 22 | const contentData = this.data.data.data.content 23 | const recommendData = contentData.data; 24 | if(contentData.type === 'video'){ 25 | console.log('video') 26 | wx.previewMedia({ 27 | sources: [{url:recommendData.playUrl, 28 | type:'video', 29 | poster:recommendData.cover.feed}], 30 | }) 31 | }else{ 32 | if(recommendData.urls === null ||recommendData.urls.legnth === 0){ 33 | wx.previewImage({ 34 | urls: [recommendData.url], 35 | }) 36 | }else{ 37 | wx.previewImage({ 38 | urls: recommendData.urls, 39 | }) 40 | } 41 | } 42 | } 43 | } 44 | }) 45 | -------------------------------------------------------------------------------- /components/recommend-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "l-card":"/miniprogram_npm/lin-ui/card/index" 5 | } 6 | } -------------------------------------------------------------------------------- /components/recommend-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{data.data.content.data.description}} 5 | 6 | 7 | 8 | {{data.data.content.data.owner.nickname}} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/recommend-item/index.wxss: -------------------------------------------------------------------------------- 1 | .container{ 2 | width: 100%; 3 | position: relative; 4 | } 5 | .card-container { 6 | width: 100%; 7 | padding: 0rpx; 8 | margin-bottom: 20rpx; 9 | } 10 | 11 | .head-img { 12 | border-top-left-radius: 8rpx; 13 | border-top-right-radius: 8rpx; 14 | } 15 | 16 | .icon{ 17 | position: absolute; 18 | top: 10rpx; 19 | right: 10rpx; 20 | } 21 | 22 | .description { 23 | color: #000000DD; 24 | font-size: 28rpx; 25 | overflow: hidden; 26 | text-overflow: ellipsis; 27 | display: -webkit-box; 28 | -webkit-line-clamp: 2; 29 | -webkit-box-orient: vertical; 30 | margin: 20rpx; 31 | } 32 | 33 | .bottom-container { 34 | display: flex; 35 | flex-direction: row; 36 | justify-content: space-between; 37 | margin: 20rpx; 38 | } 39 | 40 | .owner { 41 | display: flex; 42 | flex-direction: row; 43 | align-items: center; 44 | } 45 | 46 | .avatar { 47 | width: 48rpx; 48 | height: 48rpx; 49 | border-radius: 50%; 50 | } 51 | 52 | .nickname { 53 | margin-left: 10rpx; 54 | width: 160rpx; 55 | font-size: 24rpx; 56 | } 57 | 58 | .like-text { 59 | margin-left: 6rpx; 60 | font-size: 24rpx; 61 | } -------------------------------------------------------------------------------- /components/recommend-tab/index.js: -------------------------------------------------------------------------------- 1 | const app = getApp() 2 | 3 | Component({ 4 | /** 5 | * 组件的属性列表 6 | */ 7 | properties: { 8 | 9 | }, 10 | 11 | /** 12 | * 组件的初始数据 13 | */ 14 | data: { 15 | nextPageUrl:"" 16 | }, 17 | 18 | /** 19 | * 组件的方法列表 20 | */ 21 | methods: { 22 | onRefresh(){ 23 | wx.request({ 24 | url: app.gBaseUrl + 'v7/community/tab/rec', 25 | success:(res)=>{ 26 | const nextPageUrl = res.data.nextPageUrl 27 | let itemList = res.data.itemList 28 | itemList = itemList.filter((value)=> value.type !== 'horizontalScrollCard') 29 | 30 | this.data.nextPageUrl = nextPageUrl 31 | 32 | wx.lin.renderWaterFlow(itemList, true) 33 | wx.stopPullDownRefresh() 34 | }, 35 | fail:(res)=>{ 36 | wx.showToast({ 37 | icon:'error', 38 | title: res.errMsg, 39 | }) 40 | } 41 | }) 42 | }, 43 | onLoadMore(){ 44 | if(this.data.nextPageUrl === null){ 45 | return 46 | } 47 | wx.request({ 48 | url: this.data.nextPageUrl, 49 | success:(res)=>{ 50 | const nextPageUrl = res.data.nextPageUrl 51 | let itemList = res.data.itemList 52 | 53 | this.data.nextPageUrl = nextPageUrl 54 | 55 | wx.lin.renderWaterFlow(itemList, false) 56 | }, 57 | fail:(res)=>{ 58 | wx.showToast({ 59 | icon:'error', 60 | title: res.errMsg, 61 | }) 62 | } 63 | }) 64 | }, 65 | }, 66 | attached: function() { 67 | this.onRefresh() 68 | }, 69 | }) 70 | -------------------------------------------------------------------------------- /components/recommend-tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "recommend-item":"/components/recommend-item/index", 5 | "l-water-flow":"/miniprogram_npm/lin-ui/water-flow/index" 6 | } 7 | } -------------------------------------------------------------------------------- /components/recommend-tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /components/recommend-tab/index.wxss: -------------------------------------------------------------------------------- 1 | .container{ 2 | margin-left: 20rpx; 3 | margin-right: 20rpx; 4 | margin-top: 100rpx; 5 | } -------------------------------------------------------------------------------- /components/topic-tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/topic-tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /components/topic-tab/index.wxss: -------------------------------------------------------------------------------- 1 | /* components/topic-tab/index.wxss */ 2 | .container{ 3 | display: flex; 4 | flex-direction: column; 5 | margin-top: 100rpx; 6 | margin-left: 20rpx; 7 | margin-right: 20rpx; 8 | } 9 | .image{ 10 | width: 100%; 11 | height: 400rpx; 12 | border-radius: 8rpx; 13 | margin-top: 10rpx; 14 | } 15 | 16 | .line{ 17 | height: 1px; 18 | background-color: #0000001F; 19 | margin-top: 20rpx; 20 | margin-bottom: 10rpx; 21 | } -------------------------------------------------------------------------------- /images/home_ic_img_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fmtjava/wx_eyepetizer/d5b643349e8abcf05a6d89309e51bb02fbd9906c/images/home_ic_img_avatar.png -------------------------------------------------------------------------------- /images/home_ic_mine_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fmtjava/wx_eyepetizer/d5b643349e8abcf05a6d89309e51bb02fbd9906c/images/home_ic_mine_normal.png -------------------------------------------------------------------------------- /images/home_ic_mine_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fmtjava/wx_eyepetizer/d5b643349e8abcf05a6d89309e51bb02fbd9906c/images/home_ic_mine_selected.png -------------------------------------------------------------------------------- /images/home_ic_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fmtjava/wx_eyepetizer/d5b643349e8abcf05a6d89309e51bb02fbd9906c/images/home_ic_normal.png -------------------------------------------------------------------------------- /images/home_ic_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fmtjava/wx_eyepetizer/d5b643349e8abcf05a6d89309e51bb02fbd9906c/images/home_ic_selected.png -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/action-sheet/index.js: -------------------------------------------------------------------------------- 1 | import zIndex from"../behaviors/zIndex";import hover from"../behaviors/hover";Component({behaviors:[zIndex,hover],externalClasses:["l-class-title","l-class-item","l-class-cancel","l-title-class","l-item-class","l-cancel-class"],properties:{locked:Boolean,showCancel:Boolean,show:Boolean,itemList:Array,cancelText:{type:String,value:"取消"},title:String,zIndex:{type:Number,value:777},openApi:{type:Boolean,value:!0}},data:{success:"",fail:"",isIphoneX:!1},attached(){this.data.openApi&&this.initActionSheet(),this.initUIAdapter()},pageLifetimes:{show(){this.data.openApi&&this.initActionSheet()}},methods:{initUIAdapter(){wx.getSystemInfo({success:e=>{this.setData({isIphoneX:"iPhone X"===e.model})}})},initActionSheet(){wx.lin=wx.lin||{},wx.lin.showActionSheet=(e={})=>{const{itemList:t=[],success:s=null,fail:i=null,title:a="",locked:l=!1,cancelText:n="取消",showCancel:c=!1}=e;return this.setData({itemList:t.slice(0,10),success:s,fail:i,title:a,locked:l,cancelText:n,showCancel:c,show:!0}),this}},handleClickItem(e){const{success:t}=this.data;t&&t({...e.currentTarget.dataset}),this.triggerEvent("linitemtap",{...e.currentTarget.dataset},{bubbles:!0,composed:!0}),this._hideActionSheet()},_showActionSheet(){this.setData({show:!0})},_hideActionSheet(){this.setData({show:!1})},handleClickCancel(){const{fail:e}=this.data;e&&e({errMsg:"showactionsheet:fail cancel"}),this.triggerEvent("lincancel",{errMsg:"showactionsheet:fail cancel"},{bubbles:!0,composed:!0}),this._hideActionSheet()},handleClickPopUp(){this.data.locked||this.handleClickCancel()}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/action-sheet/index.json: -------------------------------------------------------------------------------- 1 | {"component":true,"usingComponents":{"l-icon":"../icon/index","l-popup":"../popup/index","l-button":"../button/index"} } -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/action-sheet/index.wxss: -------------------------------------------------------------------------------- 1 | .l-action-sheet{background:#f7f7f7}.l-item-button{height:88rpx;line-height:88rpx;text-align:center;background:#fff;border-bottom:2rpx solid #f3f3f3;font-size:28rpx;color:#45526b;display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden}.l-cancel{margin-top:12rpx}.l-cancel-x .l-item-button{padding-bottom:44rpx}.l-image-button>.l-button-text{margin-left:20rpx}.list-hover{opacity:.8} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/album/index.json: -------------------------------------------------------------------------------- 1 | {"component":true,"usingComponents":{}} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/album/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | +{{urls.length-maxNumber}} 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/album/index.wxss: -------------------------------------------------------------------------------- 1 | .container{display:grid}.vertical{height:360rpx}.parent{display:inline-grid;grid-template-columns:repeat(auto-fill)}.child{box-sizing:border-box;background-color:#fff;flex:0 0 44%;height:100px;border:1px solid red;margin-top:4%;margin-left:2%;margin-right:2%}.dimback{background:#000}.dim{opacity:.6}.imageContainer{position:relative}.imageContainer:last-child>.text{color:#fff;font-weight:700;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:larger} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/arc-popup/index.json: -------------------------------------------------------------------------------- 1 | {"component":true,"usingComponents":{"l-popup":"../popup/index"}} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/arc-popup/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/arc-popup/index.wxss: -------------------------------------------------------------------------------- 1 | .container-arc-popup{width:100%}.arc-popup{overflow:hidden;width:100%;background:#fff}.content-arc-popup{padding:30rpx;box-sizing:border-box}.header-popup{width:100%;z-index:999}.header-popup.fixed{position:sticky;top:0;background-color:#fff} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/avatar/index.js: -------------------------------------------------------------------------------- 1 | Component({externalClasses:["l-class","l-class-text","l-text-class"],properties:{icon:String,iconColor:{type:String,value:"#3963BC"},iconSize:{type:String,value:"28"},text:String,src:String,openData:{type:Array,observer:"_initOpenData"},shape:{type:String,value:"circle"},mode:{type:String,value:"scaleToFill"},size:{type:Number,value:120},placement:{type:String,value:"right"}},data:{_isHaveUserNickName:!1,_isHaveUserAvatarUrl:!1,_iconSize:"",_iconColor:"#ffffff"},methods:{_initOpenData:function(e){this._isHaveUserAvatarUrl(e),this._isHaveUserNickName(e)},_isHaveUserAvatarUrl:function(e){this.setData({_isHaveUserAvatarUrl:-1!==e.indexOf("userAvatarUrl")})},_isHaveUserNickName:function(e){this.setData({_isHaveUserNickName:-1!==e.indexOf("userNickName")})},tapAvatar:function(e){this.triggerEvent("lintap",e,{bubbles:!0,composed:!0})}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/avatar/index.json: -------------------------------------------------------------------------------- 1 | {"component":true,"usingComponents":{"l-icon":"../icon/index"} } -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/avatar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{text}} 11 | 12 | 13 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/avatar/index.wxss: -------------------------------------------------------------------------------- 1 | .l-avatar{display:inline-flex;justify-content:center;align-items:center}.l-avatar-image{flex:1;display:inline-flex;justify-content:center;align-items:center;background:#ccc;overflow:hidden}.l-avatar-text{display:inline-block;height:max-content;width:max-content;font-size:28rpx;color:#45526b;line-height:40px}.open-data{width:100%;height:100%}.l-avatar-text .l-avatar-text-text,.l-avatar-text .open-data{font-size:inherit;color:inherit;line-height:inherit}.l-square{border-radius:8rpx}.l-circle{border-radius:50%}.l-placement-left,.l-placement-right{align-items:center;justify-content:center}.l-placement-left{margin-right:24rpx;flex-direction:row-reverse}.l-placement-left .l-avatar-text{margin-right:24rpx}.l-placement-right{flex-direction:row}.l-placement-right .l-avatar-text{margin-left:24rpx}.l-placement-top{flex-direction:column-reverse}.l-placement-top .l-avatar-text{margin-bottom:12rpx}.l-placement-bottom{flex-direction:column}.l-placement-bottom .l-avatar-text{margin-top:12rpx} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/badge/index.js: -------------------------------------------------------------------------------- 1 | import validator from"../behaviors/validator";Component({externalClasses:["l-class","l-class-self","l-self-class"],behaviors:[validator],properties:{dot:{type:Boolean,value:!1},shape:{type:String,value:"horn",options:["horn","circle"]},value:{type:String,value:"0"},mode:{type:String,value:"number",options:["number","text"]},maxCount:{type:Number,value:99},numberType:{type:String,value:"overflow",options:["overflow","limit","ellipsis"]},show:{type:Boolean,value:!0}},data:{finalCount:0},observers:{value:function(){this.finalCount()}},methods:{finalCount(){isNaN(Number(this.data.value))||"text"===this.data.mode?this.setData({finalCount:this.data.value}):this.switchType()},switchType(){switch(this.data.numberType){case"overflow":this.setData({finalCount:Number(this.data.value)>Number(this.data.maxCount)?this.data.maxCount+"+":this.data.value});break;case"ellipsis":this.setData({finalCount:Number(this.data.value)>Number(this.data.maxCount)?"...":this.data.value});break;case"limit":this.setData({finalCount:Number(this.data.value)>999?Number(this.data.value)>=9999?Math.floor(this.data.value/1e4*100)/100+"w":Math.floor(this.data.value/1e3*100)/100+"k":this.data.value});break;default:this.setData({finalCount:Number(this.data.value)})}},handleTap(){this.triggerEvent("lintap",{},{bubbles:!0,composed:!0})}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/badge/index.json: -------------------------------------------------------------------------------- 1 | {"component":true,"usingComponents":{}} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/badge/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{finalCount}} 6 | 7 | 8 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/badge/index.wxss: -------------------------------------------------------------------------------- 1 | .l-badge{position:relative;display:inline-block;line-height:1;vertical-align:middle}.l-badge-content{max-width:650rpx;left:70%;background-color:#ff474b;color:#fff;position:absolute;font-size:20rpx;display:inline-block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-align:center;box-sizing:border-box;z-index:10;letter-spacing:.5rpx}.l-badge-content-horn{height:28rpx;min-width:54rpx;padding:0 8rpx;border-radius:14rpx 14rpx 14rpx 0rpx;line-height:28rpx;top:-10rpx}.l-badge-content-circle{height:32rpx;min-width:32rpx;padding:0 10rpx;border-radius:16rpx;line-height:32rpx;top:-10rpx}.l-badge-dot{height:16rpx;width:16rpx;transform:translateX(50%);border-radius:50%;background-color:#ff474b;position:absolute;top:-4rpx;right:0rpx} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/behaviors/computeOffset.js: -------------------------------------------------------------------------------- 1 | export default Behavior({behaviors:[],properties:{},data:{distance:0},attached(){this.offsetMargin()},methods:{offsetMargin(){const{windowHeight:t,screenHeight:e}=wx.getSystemInfoSync();this.setData({distance:e-t})}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/behaviors/hover.js: -------------------------------------------------------------------------------- 1 | export default Behavior({behaviors:[],properties:{isHover:{type:Boolean,value:!0}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/behaviors/rules.js: -------------------------------------------------------------------------------- 1 | import Schema from"../common/async-validator/index";import validator from"../behaviors/validator";export default Behavior({behaviors:[validator],properties:{rules:{optionalTypes:[Object,Array],value:[]},tipType:{type:String,value:"toast",options:["toast","message","text"]}},data:{schema:"",tipFun:{message:"showMessage",toast:"showToast"},tipContent:{message:"content",toast:"title"},errorText:"",errors:[]},methods:{initRules(){const{rules:t}=this.data;t&&("[object Object]"===Object.prototype.toString.call(t)&&(this.data.rules=[t]),this.data.rules.forEach(t=>{t.trigger?"string"!=typeof t.trigger||(t.trigger=[t.trigger]):t.trigger=[]}))},getNeedValidateRule(t){const e=this.data.name,{rules:a}=this.data;if(!a)return;const r=t?a.filter(e=>e.trigger.indexOf(t)>-1):a,s=new Schema({[e]:r});return this.setData({schema:s}),r},validatorData(t,e){const{tipType:a,tipFun:r,tipContent:s}=this.data;this.getNeedValidateRule(e)&&(Object.getOwnPropertyNames(t).forEach(e=>{""===t[e]&&(t[e]=void 0)}),this.data.schema.validate(t,t=>{if(this.setData({errors:t||[]}),this.triggerEvent("linvalidate",{errors:t,isError:!!t}),t&&a){const e=r[a],i=s[a];return"text"===a?(this.setData({errorText:t[0].message}),t):wx.lin&&wx.lin[e]?(wx.lin[e]&&wx.lin[e]({[i]:t[0].message,duration:1500,mask:!1}),t):(wx.showToast({icon:"none",title:`请在页面内引入${a}组件`}),t)}!t&&a&&this.setData({errorText:""})}))}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/behaviors/scrollCenter.js: -------------------------------------------------------------------------------- 1 | export default Behavior({methods:{getRect(e,t=!1){return new Promise((r,o)=>{const s=wx.createSelectorQuery().in(this);(t?s.selectAll(e):s.select(e)).boundingClientRect(e=>{if(!e)return o("找不到元素");r(e)}).exec()})},queryScrollNode(e,t,r="width"){if(t<0)return;const o=e[t];this.getRect(".l-tabsscroll").then(s=>{if(!s)return console.error("找不到元素");const c=s[r];let n=e.slice(0,t).reduce((e,t)=>e+t[r],0);n+=(o[r]-c)/2,"width"===r?this.setData({transformX:n,transformY:0}):this.setData({transformX:0,transformY:n})}).catch(e=>{console.error(e)})},queryMultipleNodes(){const{placement:e,currentIndex:t}=this.data;this.getRect(".l-tabs-item",!0).then(r=>{-1!==["top","bottom"].indexOf(e)?this.queryScrollNode(r,t):this.queryScrollNode(r,t,"height")}).catch(e=>{console.error(e)})}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/behaviors/validator.js: -------------------------------------------------------------------------------- 1 | export default Behavior({definitionFilter(e){const{properties:o}=e;Object.keys(o).forEach(e=>{const{options:t}=o[e];t&&(o[e].observer=function(o){!t.includes(o)&&o&&console.error(`${e}: ${o} must be in the [${t}]`)})})}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/behaviors/watchShow.js: -------------------------------------------------------------------------------- 1 | export default Behavior({observers:{show:function(t){t&&this.changeStatus(),t||this.setData({status:t})}},methods:{changeStatus(){this.setData({status:!0}),this.data.timer&&clearTimeout(this.data.timer),this.data.timer=setTimeout(()=>{this.setData({status:!1}),this.data.success&&this.data.success(),this.data.timer=null},this.properties.duration)}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/behaviors/zIndex.js: -------------------------------------------------------------------------------- 1 | export default Behavior({behaviors:[],properties:{zIndex:{type:Number,value:777}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/button/index.js: -------------------------------------------------------------------------------- 1 | import validator from"../behaviors/validator";Component({externalClasses:["l-class","l-label-class","l-hover-class","l-img-class","l-icon-class"],behaviors:[validator],properties:{name:{type:String,value:"lin"},type:{type:String,value:"default",options:["warning","success","error","default"]},plain:Boolean,size:{type:String,value:"medium",options:["medium","large","mini","long"]},shape:{type:String,value:"circle",options:["square","circle","semicircle"]},disabled:{type:Boolean,value:!1},special:{type:Boolean,value:!1},loading:{type:Boolean,value:!1},width:Number,height:Number,icon:String,image:String,bgColor:String,iconColor:String,iconSize:String,openType:String,appParameter:String,lang:String,hoverStopPropagation:Boolean,hoverStartTime:{type:Number,value:20},hoverStayTime:{type:Number,value:70},sessionFrom:{type:String,value:""},sendMessageTitle:String,sendMessagePath:String,sendMessageImg:String,showMessageCard:Boolean,formType:String,disabledHover:{type:Boolean,value:!1}},methods:{handleTap(){if(this.data.disabled||this.data.loading)return!1;this.triggerEvent("lintap",{},{bubbles:!0,composed:!0})},openTypeEvent(e){this.triggerEvent(e.type,e.detail,{})}}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/button/index.json: -------------------------------------------------------------------------------- 1 | {"component":true,"usingComponents":{"l-icon":"../icon/index"}} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/calendar.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/day/index.js: -------------------------------------------------------------------------------- 1 | Component({data:{},properties:{text:null,topInfo:null,bottomInfo:null,type:null,color:{type:String,value:""}},methods:{}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/day/index.json: -------------------------------------------------------------------------------- 1 | {"component":true} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/day/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ topInfo }} 4 | {{ text }} 5 | {{ bottomInfo }} 6 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/day/index.wxs: -------------------------------------------------------------------------------- 1 | function getDayStyle(type, color) { 2 | var style = []; 3 | 4 | if (color) { 5 | if ( 6 | type === 'start' || 7 | type === 'end' || 8 | type === 'selected' 9 | ) { 10 | style.push(['background', color]); 11 | } else if (type === 'middle') { 12 | style.push(['color', color]); 13 | // style.push(['background', color]); 14 | // style.push(['opacity', '0.1']); 15 | } 16 | } 17 | 18 | return style 19 | .map(function(item) { 20 | return item.join(':'); 21 | }) 22 | .join(';'); 23 | } 24 | 25 | module.exports = { 26 | getDayStyle: getDayStyle, 27 | }; -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/day/index.wxss: -------------------------------------------------------------------------------- 1 | .calendar-day-container{display:flex;flex-direction:column;height:100%;align-items:center;position:relative;color:#666}.calendar-day-container.selected{background-color:#3963bc;color:#fff;border-radius:8rpx}.calendar-day-container.start{background-color:#3963bc;color:#fff;border-radius:8rpx}.calendar-day-container.end{background-color:#3963bc;color:#fff;border-radius:8rpx}.calendar-day-container.disabled{color:#c8c9cc;cursor:default;background:#fff}.calendar-day-container.middle{color:#3963bc}.calendar-day-container.middle::after{position:absolute;top:0;right:0;bottom:0;left:0;background-color:currentColor;opacity:.1;content:''}.calendar-day-container .top{height:24rpx;line-height:24rpx;font-size:16rpx}.calendar-day-container .text{flex:1;font-size:32rpx}.calendar-day-container .bottom{height:24rpx;line-height:24rpx;font-size:16rpx} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/header/index.js: -------------------------------------------------------------------------------- 1 | Component({data:{weekdays:["日","一","二","三","四","五","六"]},properties:{title:{type:String,value:"日期选择"},subTitle:String,showTitle:Boolean,showSubtitle:Boolean},methods:{}}); -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/header/index.json: -------------------------------------------------------------------------------- 1 | {"component":true} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/header/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | 8 | 9 | 10 | {{ subTitle }} 11 | 12 | 13 | 14 | 15 | {{ item }} 16 | 17 | 18 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/header/index.wxss: -------------------------------------------------------------------------------- 1 | .calendar-header-container .calendar-header-container_title{text-align:center;padding:20rpx 0;font-size:36rpx;line-height:44rpx}.calendar-header-container .calendar-header-container_subtitle{text-align:center;font-size:36rpx;line-height:44rpx;margin-bottom:30rpx}.calendar-header-container .calendar-header__weekdays{display:flex;justify-content:center;align-items:center;margin:0 20rpx;padding:10rpx 0;border-bottom:1rpx solid #f3f3f3}.calendar-header-container .calendar-header__weekdays .calendar-header__weekday{width:14.285%;text-align:center} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/mounth/index.json: -------------------------------------------------------------------------------- 1 | {"component":true,"usingComponents":{"day":"../day/index"}} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/mounth/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ computed.formatMonthTitle(date) }} 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/mounth/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 3 | function formatMonthTitle(date) { 4 | date = getDate(date); 5 | return date.getFullYear() + '年' + (date.getMonth() + 1) + '月'; 6 | } 7 | 8 | 9 | 10 | module.exports = { 11 | formatMonthTitle: formatMonthTitle 12 | }; 13 | -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/components/mounth/index.wxss: -------------------------------------------------------------------------------- 1 | .calendar-mounth-container{color:#333;display:flex;flex-direction:column}.calendar-mounth-container .title{text-align:center;font-weight:800}.calendar-mounth-container .calendar-day-container{display:flex;flex-wrap:wrap}.calendar-mounth-container .calendar-day-container .calendar-day-wrap{width:14.285%} -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/config.js: -------------------------------------------------------------------------------- 1 | export const TYPE_SINGLE="single";export const TYPE_RANGE="range";export const TYPE_MULTIPLE="multiple"; -------------------------------------------------------------------------------- /miniprogram_npm/lin-ui/calendar/dete.js: -------------------------------------------------------------------------------- 1 | const formatFlags={format:function(t,e){let a;const r={"y+":(e=new Date(e)).getFullYear().toString(),"M+":(e.getMonth()+1).toString(),"d+":e.getDate().toString()};for(let e in r)a=new RegExp("("+e+")").exec(t),a&&(t=t.replace(a[1],1===a[1].length?r[e]:this.padZero(r[e],a[1].length)));return t},padZero(t,e){let a=t;for(let r=0;r 2 | 3 | 4 |