├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── apis ├── book.js ├── booklist.js ├── classification.js ├── collection.js ├── library.js ├── order.js ├── request.js ├── review.js └── user.js ├── app.js ├── app.json ├── app.wxss ├── assets ├── 04-26-19-51-00.png ├── 04-26-19-53-08.png ├── 04-26-20-59-19.png ├── component.png └── ui.png ├── component-demos ├── async-button │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── async-switch │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── collapse │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── index │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── load-more │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── no-data │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── panel │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── popup │ ├── 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 │ ├── mask.js │ ├── mask.json │ ├── mask.wxml │ └── mask.wxss ├── send-code │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── spinner │ ├── 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 ├── toast │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── toptip │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── components ├── async-button │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── async-switch │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── collapse │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── load-more │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── no-data │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── panel │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── popup │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── rate │ ├── images │ │ ├── icon_star_full.png │ │ ├── icon_star_half.png │ │ └── icon_star_normal.png │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── search-bar │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── send-code │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── spinner │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── sticky-2 │ ├── 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 ├── toast │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── toptip │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── docs ├── .vuepress │ ├── config.js │ └── public │ │ ├── favicon.ico │ │ └── ui.sketch ├── README.md ├── guide │ ├── README.md │ ├── api.md │ ├── feature.md │ ├── front.md │ └── install.md ├── media │ ├── admin_1.png │ ├── admin_2.png │ ├── android.png │ ├── component.png │ ├── functional_architecture.jpg │ ├── fundebug-1.png │ ├── fundebug-2.png │ ├── library_2.png │ ├── order_status.jpg │ ├── page_status_indicator.png │ ├── postman.png │ ├── sequence_book.jpg │ ├── sequence_borrow_in_library.jpg │ ├── softwares.png │ ├── swagger_ui_1.png │ ├── swagger_ui_2.png │ ├── swagger_ui_3.png │ ├── swagger_ui_4.png │ ├── ui.png │ ├── user_identity.jpg │ ├── weapp_code.png │ ├── weapp_ui_1.png │ ├── weapp_ui_2.png │ ├── weapp_ui_3.png │ ├── wiki_1.png │ ├── wiki_2.png │ ├── wiki_3.png │ └── wiki_4.png └── media_待整理 │ ├── sequence_register.jpg │ ├── sequence_take_book.jpg │ ├── sys_architecture.jpg │ ├── user_case_basic.jpg │ ├── user_case_booklist.jpg │ ├── user_case_collection.jpg │ ├── user_case_notice.jpg │ ├── user_case_order.jpg │ ├── user_case_recommend.jpg │ ├── user_case_review.jpg │ ├── user_case_search.jpg │ ├── user_case_user.jpg │ ├── vue_architecture.jpg │ └── weapp_architecture.jpg ├── images ├── default_avatar.jpg ├── icon_add_to_booklist.png ├── icon_bell.png ├── icon_booklist_fill.png ├── icon_booklist_line.png ├── icon_cart_fill.png ├── icon_cart_line.png ├── icon_certificated.png ├── icon_deposit.png ├── icon_drawer.png ├── icon_empty_booklist.png ├── icon_headlines.png ├── icon_help.png ├── icon_home_fill.png ├── icon_home_line.png ├── icon_in_process.png ├── icon_info.png ├── icon_logout.png ├── icon_me_fill.png ├── icon_me_line.png ├── icon_more.png ├── icon_paper_plane.png ├── icon_review.png ├── icon_review_2.png ├── icon_scan.png ├── icon_setting.png ├── icon_time.png ├── icon_trending_1.png ├── icon_trending_2.png ├── icon_trending_3.png ├── icon_trending_up.png ├── icon_uncertificated.png ├── load_fail.png ├── logo.jpeg ├── miniapp_code.jpg └── no_data.png ├── pages ├── book-detail │ ├── book-detail.js │ ├── book-detail.json │ ├── book-detail.wxml │ ├── book-detail.wxss │ └── children │ │ ├── add.js │ │ ├── add.json │ │ ├── add.wxml │ │ ├── add.wxss │ │ ├── children │ │ ├── library-detail.js │ │ ├── library-detail.json │ │ ├── library-detail.wxml │ │ ├── library-detail.wxss │ │ ├── result.js │ │ ├── result.json │ │ ├── result.wxml │ │ └── result.wxss │ │ ├── library-list.js │ │ ├── library-list.json │ │ ├── library-list.wxml │ │ ├── library-list.wxss │ │ ├── order.js │ │ ├── order.json │ │ ├── order.wxml │ │ ├── order.wxss │ │ ├── review.js │ │ ├── review.json │ │ ├── review.wxml │ │ └── review.wxss ├── booklist │ ├── booklist.js │ ├── booklist.json │ ├── booklist.wxml │ ├── booklist.wxss │ └── children │ │ ├── booklist-detail.js │ │ ├── booklist-detail.json │ │ ├── booklist-detail.wxml │ │ ├── booklist-detail.wxss │ │ ├── children │ │ ├── modify.js │ │ ├── modify.json │ │ ├── modify.wxml │ │ └── modify.wxss │ │ ├── modify.js │ │ ├── modify.json │ │ ├── modify.wxml │ │ └── modify.wxss ├── cart │ ├── cart.js │ ├── cart.json │ ├── cart.wxml │ ├── cart.wxss │ └── children │ │ ├── help.js │ │ ├── help.json │ │ ├── help.wxml │ │ ├── help.wxss │ │ ├── qrcode.js │ │ ├── qrcode.json │ │ ├── qrcode.wxml │ │ └── qrcode.wxss ├── components │ ├── booklist-item │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ └── home-search-bar │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss ├── home │ ├── children │ │ ├── advanced-search.js │ │ ├── advanced-search.json │ │ ├── advanced-search.wxml │ │ ├── advanced-search.wxss │ │ ├── classification.js │ │ ├── classification.json │ │ ├── classification.wxml │ │ └── classification.wxss │ ├── home.js │ ├── home.json │ ├── home.wxml │ └── home.wxss ├── index │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── list │ ├── book.js │ ├── book.json │ ├── book.wxml │ ├── book.wxss │ ├── booklist.js │ ├── booklist.json │ ├── booklist.wxml │ └── booklist.wxss ├── profile │ ├── children │ │ ├── about.js │ │ ├── about.json │ │ ├── about.wxml │ │ ├── about.wxss │ │ ├── children │ │ │ ├── order-detail.js │ │ │ ├── order-detail.json │ │ │ ├── order-detail.wxml │ │ │ ├── order-detail.wxss │ │ │ ├── personal-information-modify.js │ │ │ ├── personal-information-modify.json │ │ │ ├── personal-information-modify.wxml │ │ │ └── personal-information-modify.wxss │ │ ├── order-history.js │ │ ├── order-history.json │ │ ├── order-history.wxml │ │ ├── order-history.wxss │ │ ├── order-ongoing.js │ │ ├── order-ongoing.json │ │ ├── order-ongoing.wxml │ │ ├── order-ongoing.wxss │ │ ├── personal-information.js │ │ ├── personal-information.json │ │ ├── personal-information.wxml │ │ ├── personal-information.wxss │ │ ├── qrcode.js │ │ ├── qrcode.json │ │ ├── qrcode.wxml │ │ ├── qrcode.wxss │ │ ├── review.js │ │ ├── review.json │ │ ├── review.wxml │ │ └── review.wxss │ ├── navigate.js │ ├── navigate.json │ ├── navigate.wxml │ ├── navigate.wxss │ ├── profile.js │ ├── profile.json │ ├── profile.wxml │ └── profile.wxss └── register │ ├── children │ ├── result.js │ ├── result.json │ ├── result.wxml │ └── result.wxss │ ├── register.js │ ├── register.json │ ├── register.wxml │ └── register.wxss ├── project.config.json ├── simplest-mock-server ├── .gitignore ├── Dockerfile ├── README.md ├── README_en.md ├── assets │ └── 04-16-13-22-37.png ├── example │ ├── DELETE │ │ └── api │ │ │ └── v1 │ │ │ ├── booklists │ │ │ └── {id}.json │ │ │ ├── orders │ │ │ └── {id}.json │ │ │ └── reviews │ │ │ └── {id}.json │ ├── GET │ │ └── api │ │ │ └── v1 │ │ │ ├── booklists │ │ │ ├── recommend │ │ │ │ └── {phone}.json │ │ │ ├── search.json │ │ │ ├── users │ │ │ │ └── {id}.json │ │ │ ├── {id}.json │ │ │ └── {id} │ │ │ │ └── books.json │ │ │ ├── books │ │ │ ├── authors │ │ │ │ └── {author}.json │ │ │ ├── classifications │ │ │ │ └── {class}.json │ │ │ ├── isbn │ │ │ │ ├── {isbn}.json │ │ │ │ └── {isbn} │ │ │ │ │ └── collections.json │ │ │ ├── ranking.json │ │ │ ├── recommend │ │ │ │ └── {phone}.json │ │ │ ├── search.json │ │ │ ├── search │ │ │ │ └── advanced.json │ │ │ ├── tags │ │ │ │ └── {tag}.json │ │ │ ├── {id}.json │ │ │ └── {id} │ │ │ │ ├── collections.json │ │ │ │ └── reviews.json │ │ │ ├── classifications │ │ │ └── {id} │ │ │ │ └── sons.json │ │ │ ├── codes │ │ │ └── check.json │ │ │ ├── images.json │ │ │ ├── libraries │ │ │ └── {id}.json │ │ │ ├── orders │ │ │ ├── return.json │ │ │ ├── users │ │ │ │ └── {phone}.json │ │ │ ├── {id}.json │ │ │ └── {id} │ │ │ │ └── take.json │ │ │ ├── reviews │ │ │ └── {id}.json │ │ │ ├── users.json │ │ │ └── users │ │ │ ├── {phone}.json │ │ │ └── {phone} │ │ │ └── reviews.json │ └── POST │ │ └── api │ │ └── v1 │ │ ├── booklists.json │ │ ├── booklists │ │ ├── {id}.json │ │ └── {id} │ │ │ └── favorite.json │ │ ├── books │ │ └── {id} │ │ │ └── reviews.json │ │ ├── codes.json │ │ ├── orders.json │ │ ├── orders │ │ ├── {id}.json │ │ └── {id} │ │ │ ├── cancel.json │ │ │ └── renew.json │ │ └── users │ │ └── {phone}.json ├── gulpfile.js ├── package-lock.json ├── package.json ├── router.js └── server.js ├── styles ├── color.wxss ├── font.wxss ├── helper.wxss ├── icon.wxss ├── ui.wxss └── weui.wxss ├── templates ├── library-list │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── page-status-indicator │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── showcase │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── utils ├── biz-helper.wxs ├── constant.js ├── constant.wxs ├── es6-promise.js ├── event.js ├── fundebug.0.5.0.min.js ├── permission.js ├── promise-polyfill.js ├── promisify.js ├── qrcode.js ├── tip.js ├── utils.js └── validator.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | sitemap.json 3 | .DS_Store -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /apis/book.js: -------------------------------------------------------------------------------- 1 | import { get } from './request.js' 2 | 3 | module.exports = { 4 | getBookById: function (id) { 5 | return get(`/books/${id}`) 6 | }, 7 | getBookByISBN: function (isbn) { 8 | return get(`/books/isbn/${isbn}`) 9 | }, 10 | getRankingBooks: function (start = 0) { 11 | return get(`/books/ranking?start=${start}`) 12 | }, 13 | getRecommendedBooksByUserId: function (uid) { 14 | return get(`/books/recommend/${uid}`) 15 | }, 16 | getBooksByKeyword: function (keyword, start = 0) { 17 | return get('/books/search', { keyword, start }) 18 | }, 19 | getBooksByAuthor: function (author, start = 0) { 20 | return get(`/books/authors/${author}?start=${start}`) 21 | }, 22 | getBooksByTag: function (tag, start = 0) { 23 | return get(`/books/tags/${tag}?start=${start}`) 24 | }, 25 | getBooksByAdvancedSearch: function (params) { 26 | return get('/books/search/advanced', params) 27 | }, 28 | getBooksByClassificationNumber: function (classNum, start = 0) { 29 | return get(`/books/classifications/${classNum}?start=${start}`) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /apis/booklist.js: -------------------------------------------------------------------------------- 1 | import { get, post, del } from './request.js' 2 | 3 | module.exports = { 4 | createBooklist: function (params) { 5 | return post('/booklists', params) 6 | }, 7 | getRecommendedBooklistsByUserId: function (uid) { 8 | return get(`/booklists/recommend/${uid}`) 9 | }, 10 | getBooklistById: function (id, start = 0) { 11 | return get(`/booklists/${id}?start=${start}`) 12 | }, 13 | getBooksByBooklistId: function (id, start = 0) { 14 | return get(`/booklists/${id}/books?start=${start}`) 15 | }, 16 | updateBooklistById: function (id, params) { 17 | return post(`/booklists/${id}`, params) 18 | }, 19 | deleteBooklistById: function (id) { 20 | return del(`/booklists/${id}`) 21 | }, 22 | favoriteBooklistById: function (id) { 23 | return post(`/booklists/${id}/favorite`) 24 | }, 25 | getBooklistsByKeyword: function (keyword, start = 0) { 26 | return get('/booklists/search', { keyword, start }) 27 | }, 28 | getBooklistsByUserId: function (uid, type = 'all') { 29 | return get(`/booklists/users/${uid}?type=${type}`) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /apis/classification.js: -------------------------------------------------------------------------------- 1 | import { get } from './request.js' 2 | 3 | module.exports = { 4 | getSonNumbersByNumber: function (number, start = 0) { 5 | return get(`/classifications/${number}/sons`, { start }) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apis/collection.js: -------------------------------------------------------------------------------- 1 | import { get } from './request.js' 2 | 3 | module.exports = { 4 | getCollectionsByBookId: function (id, params = {}) { 5 | return get(`/books/${id}/collections`, params) 6 | }, 7 | getCollectionsByBookISBN: function (isbn, params = {}) { 8 | return get(`/books/isbn/${isbn}/collections`, params) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /apis/library.js: -------------------------------------------------------------------------------- 1 | import { get, post, del } from './request.js' 2 | 3 | module.exports = { 4 | getLibraryById: function (id) { 5 | return get(`/libraries/${id}`) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apis/order.js: -------------------------------------------------------------------------------- 1 | import { get, post, del } from './request.js' 2 | 3 | module.exports = { 4 | createOrders: function (params) { 5 | return post('/orders', params) 6 | }, 7 | getOrderById: function (id) { 8 | return get(`/orders/${id}`) 9 | }, 10 | getOrdersByUserId: function (uid, type, start = 0) { 11 | return get(`/orders/users/${uid}`, { type, start }) 12 | }, 13 | cancelOrderByOrderId: function (id) { 14 | return post(`/orders/${id}/cancel`) 15 | }, 16 | renewBookByOrderId: function (id) { 17 | return post(`/orders/${id}/renew`) 18 | }, 19 | deleteOrderByOrderId: function (id) { 20 | return del(`/orders/${id}`) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /apis/review.js: -------------------------------------------------------------------------------- 1 | import { get, post, del } from './request.js' 2 | 3 | module.exports = { 4 | addReviewByBookId: function (id, params) { 5 | return post(`/books/${id}/reviews`, params) 6 | }, 7 | getReviewsByBookId: function (id, start = 0) { 8 | return get(`/books/${id}/reviews?start=${start}`) 9 | }, 10 | getReviewsByUserId: function (uid, start = 0) { 11 | return get(`/users/${uid}/reviews?start=${start}`) 12 | }, 13 | deleteReviewById: function (id) { 14 | return del(`/reviews/${id}`) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /apis/user.js: -------------------------------------------------------------------------------- 1 | import { BASE_URL, get, post } from './request' 2 | import Promisify from '../utils/promisify' 3 | 4 | module.exports = { 5 | sendCode: function (phone) { 6 | return post(`/codes?phone=${phone}&type=wechat`) 7 | }, 8 | checkCode: function (phone, code) { 9 | return get('/codes/check', { phone, code, type: 'wechat' }) 10 | }, 11 | uploadIdCardImg: function (filepath) { 12 | return Promisify(wx.uploadFile)({ 13 | url: `${BASE_URL}/upload`, 14 | filePath: filepath, 15 | name: 'picture' 16 | }).then(res => { 17 | if (res.statusCode != 200) { 18 | try { 19 | res.data = JSON.parse(res.data) 20 | } catch (e) { 21 | 22 | } 23 | wx.showModal({ 24 | title: '上传图片失败', 25 | content: (res.data && res.data.message) ? res.data.message : '发生未知错误', 26 | showCancel: false 27 | }) 28 | return Promise.reject(new Error('上传图片失败')) 29 | } else { 30 | return res.data 31 | } 32 | }) 33 | }, 34 | updateUserInfoById: function (id, params) { 35 | return post(`/users/${id}`, params) 36 | }, 37 | getUserInfoById: function (id) { 38 | return get(`/users/${id}`) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | @import 'styles/weui.wxss'; 2 | @import 'styles/font.wxss'; 3 | @import 'styles/color.wxss'; 4 | @import 'styles/icon.wxss'; 5 | @import 'styles/ui.wxss'; 6 | @import 'styles/helper.wxss'; 7 | 8 | /* 组件wxss */ 9 | @import "/templates/page-status-indicator/index.wxss"; 10 | 11 | page { 12 | background-color: #F0EFF5; 13 | padding-bottom: 1rpx; /* 试图解决 load-more 底部 margin 不显示的问题 */ 14 | } 15 | 16 | /** 17 | * 组件展示页相关 18 | */ 19 | .page { 20 | min-height: 100vh; 21 | background-color: #F8F8F8; 22 | } 23 | 24 | .page__hd { 25 | padding: 40px; 26 | } 27 | 28 | .page__bd { 29 | padding-bottom: 40px; 30 | } 31 | 32 | .page__bd--spacing { 33 | padding-left: 15px; 34 | padding-right: 15px; 35 | } 36 | 37 | .page__ft { 38 | padding-bottom: 10px; 39 | text-align: center; 40 | } 41 | 42 | .page__title { 43 | text-align: left; 44 | font-size: 20px; 45 | font-weight: 400; 46 | } 47 | 48 | .page__desc { 49 | margin-top: 5px; 50 | color: #888888; 51 | text-align: left; 52 | font-size: 14px; 53 | } 54 | .page__bd > .page__desc { 55 | margin-left: 15px; 56 | } 57 | .page__bd.page__bd--spacing > .page__desc { 58 | margin-left: 0; 59 | } 60 | 61 | .page__section-title { 62 | margin-top: 1.2em; 63 | margin-left: 15px; 64 | margin-bottom: .6em; 65 | /*color: #353535;*/ 66 | text-align: left; 67 | font-size: 14px; 68 | /*font-weight: bold;*/ 69 | } 70 | 71 | .page__section-title--first { 72 | margin-top: 0; 73 | } 74 | 75 | .page__bd--spacing > .page__section-title { 76 | margin-left: 0; 77 | } 78 | 79 | .page__placeholder { 80 | padding: 50px 0; 81 | text-align: center; 82 | } -------------------------------------------------------------------------------- /assets/04-26-19-51-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/assets/04-26-19-51-00.png -------------------------------------------------------------------------------- /assets/04-26-19-53-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/assets/04-26-19-53-08.png -------------------------------------------------------------------------------- /assets/04-26-20-59-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/assets/04-26-20-59-19.png -------------------------------------------------------------------------------- /assets/component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/assets/component.png -------------------------------------------------------------------------------- /assets/ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/assets/ui.png -------------------------------------------------------------------------------- /component-demos/async-button/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | data: { 4 | loading: true 5 | }, 6 | 7 | onLoading: function () { 8 | this.setData({loading: true}) 9 | }, 10 | 11 | onCancelLoading: function () { 12 | this.setData({loading: false}) 13 | } 14 | }) 15 | -------------------------------------------------------------------------------- /component-demos/async-button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "AsyncButton", 3 | "usingComponents": { 4 | "async-button": "/components/async-button/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/async-button/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AsyncButton 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 | tap 30 | 31 | -------------------------------------------------------------------------------- /component-demos/async-button/index.wxss: -------------------------------------------------------------------------------- 1 | .big-button-area > async-button { 2 | display: block; 3 | margin-bottom: 15px; 4 | } 5 | 6 | .big-button-area > async-button:last-child { 7 | margin-bottom: 0; 8 | } 9 | 10 | .mini-button-area > async-button { 11 | margin-right: 6px; 12 | } -------------------------------------------------------------------------------- /component-demos/async-switch/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | data: { 4 | loading: false, 5 | checked: false 6 | }, 7 | 8 | onToggleSwitch: function () { 9 | this.setData({loading: true}) 10 | setTimeout(() => this.setData({ 11 | loading: false, 12 | checked: !this.data.checked 13 | }), 800) 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /component-demos/async-switch/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "AsyncSwitch", 3 | "usingComponents": { 4 | "async-switch": "/components/async-switch/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/async-switch/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AsyncSwitch 4 | 异步开关 5 | 6 | 7 | 点击切换状态 8 | 9 | 10 | 加载状态 11 | 12 | 13 | 选中状态 14 | 15 | 16 | 禁用状态 17 | 18 | 19 | 20 | 事件 21 | switch 22 | 23 | -------------------------------------------------------------------------------- /component-demos/async-switch/index.wxss: -------------------------------------------------------------------------------- 1 | async-switch { 2 | display: inline-block; 3 | margin-right: 20px; 4 | } -------------------------------------------------------------------------------- /component-demos/collapse/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | data: { 4 | }, 5 | 6 | onShowCollapse: function () { 7 | wx.showModal({ 8 | content: '显示 collapse 内容', 9 | showCancel: false 10 | }) 11 | }, 12 | 13 | onHideCollapse: function () { 14 | wx.showModal({ 15 | content: '隐藏 collapse 内容', 16 | showCancel: false 17 | }) 18 | }, 19 | 20 | onTapAction: function () { 21 | wx.showModal({ 22 | content: '点击了操作按钮', 23 | showCancel: false 24 | }) 25 | } 26 | }) 27 | -------------------------------------------------------------------------------- /component-demos/collapse/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "Collapse", 3 | "usingComponents": { 4 | "collapse": "/components/collapse/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/collapse/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Collapse 4 | 折叠面板 5 | 6 | 7 | 基本用法 8 | 9 | 10 | 这是 collapse 的内容 11 | 12 | 13 | 14 | 带有操作按钮 15 | 16 | 17 | 这是 collapse 的内容 18 | 19 | 20 | 21 | 自定义标题样式 22 | 23 | 24 | 这是 collapse 的内容 25 | 26 | 27 | 注意:自定义样式类的优先级是未知的 28 | 29 | 事件 30 | 31 | 32 | 这是 collapse 的内容 33 | 34 | 35 | show / hide / tapaction 36 | 37 | -------------------------------------------------------------------------------- /component-demos/collapse/index.wxss: -------------------------------------------------------------------------------- 1 | .container { 2 | border: 1px solid #eee; 3 | } 4 | 5 | .custom-header { 6 | color: red !important; 7 | } -------------------------------------------------------------------------------- /component-demos/index/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | data: { 4 | components: [ 5 | { 6 | title: 'AsyncButton 异步圆角线性按钮', 7 | url: '../async-button/index' 8 | }, 9 | { 10 | title: 'AsyncSwitch 异步开关', 11 | url: '../async-switch/index' 12 | }, 13 | { 14 | title: 'Collapse 折叠面板', 15 | url: '../collapse/index' 16 | }, 17 | { 18 | title: 'LoadMore 加载更多', 19 | url: '../load-more/index' 20 | }, 21 | { 22 | title: 'NoData 暂无数据', 23 | url: '../no-data/index' 24 | }, 25 | { 26 | title: 'Panel 带有一个导航标题栏的面板', 27 | url: '../panel/index' 28 | }, 29 | { 30 | title: 'Popup 底部弹出菜单', 31 | url: '../popup/index' 32 | }, 33 | { 34 | title: 'Rate 评分', 35 | url: '../rate/index' 36 | }, 37 | { 38 | title: 'SearchBar 搜索框', 39 | url: '../search-bar/index' 40 | }, 41 | { 42 | title: 'SendCode 发送短信按钮', 43 | url: '../send-code/index' 44 | }, 45 | { 46 | title: 'Spinner 加载样式', 47 | url: '../spinner/index' 48 | }, 49 | { 50 | title: 'Sticky 吸顶元素', 51 | url: '../sticky/index' 52 | }, 53 | { 54 | title: 'TabBar 选项卡', 55 | url: '../tab-bar/index' 56 | }, 57 | { 58 | title: 'Toast 浮动提示', 59 | url: '../toast/index' 60 | }, 61 | { 62 | title: 'TopTip 顶部提示', 63 | url: '../toptip/index' 64 | } 65 | ] 66 | } 67 | }) 68 | -------------------------------------------------------------------------------- /component-demos/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "组件展示" 3 | } -------------------------------------------------------------------------------- /component-demos/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 组件展示 4 | 微信小程序组件封装 5 | 6 | 7 | 8 | 9 | {{item.title}} 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /component-demos/index/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/component-demos/index/index.wxss -------------------------------------------------------------------------------- /component-demos/load-more/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({}) 3 | -------------------------------------------------------------------------------- /component-demos/load-more/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "LoadMore", 3 | "usingComponents": { 4 | "load-more": "/components/load-more/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/load-more/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | LoadMore 4 | 加载更多 5 | 6 | 7 | 基本用法 8 | 9 | 10 | 11 | 自定义文字 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /component-demos/load-more/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/component-demos/load-more/index.wxss -------------------------------------------------------------------------------- /component-demos/no-data/index.js: -------------------------------------------------------------------------------- 1 | Page({}) 2 | -------------------------------------------------------------------------------- /component-demos/no-data/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "NoData", 3 | "usingComponents": { 4 | "no-data": "/components/no-data/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/no-data/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | NoData 4 | 暂无数据 5 | 6 | 7 | 基本用法 8 | 9 | 10 | 自定义文字 11 | 12 | 13 | -------------------------------------------------------------------------------- /component-demos/no-data/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/component-demos/no-data/index.wxss -------------------------------------------------------------------------------- /component-demos/panel/index.js: -------------------------------------------------------------------------------- 1 | // component-demos/panel/index.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | 11 | /** 12 | * 生命周期函数--监听页面加载 13 | */ 14 | onLoad: function (options) { 15 | 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面初次渲染完成 20 | */ 21 | onReady: function () { 22 | 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面显示 27 | */ 28 | onShow: function () { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面隐藏 34 | */ 35 | onHide: function () { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面卸载 41 | */ 42 | onUnload: function () { 43 | 44 | }, 45 | 46 | /** 47 | * 页面相关事件处理函数--监听用户下拉动作 48 | */ 49 | onPullDownRefresh: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 页面上拉触底事件的处理函数 55 | */ 56 | onReachBottom: function () { 57 | 58 | }, 59 | 60 | /** 61 | * 用户点击右上角分享 62 | */ 63 | onShareAppMessage: function () { 64 | 65 | } 66 | }) -------------------------------------------------------------------------------- /component-demos/panel/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "Panel", 3 | "usingComponents": { 4 | "panel": "/components/panel/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/panel/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Panel 4 | 带有一个导航标题栏的面板 5 | 6 | 7 | 8 | 9 | 这是 panel 的内容 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /component-demos/panel/index.wxss: -------------------------------------------------------------------------------- 1 | /* component-demos/panel/index.wxss */ -------------------------------------------------------------------------------- /component-demos/popup/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | data: { 4 | show: [false, false, false, false] 5 | }, 6 | 7 | onShowPopup: function (e) { 8 | this.data.show[e.currentTarget.id] = true 9 | this.setData({show: this.data.show}) 10 | }, 11 | 12 | onHidePopup: function (e) { 13 | this.data.show[e.currentTarget.id] = false 14 | this.setData({show: this.data.show}) 15 | if (e.currentTarget.id == 3) { 16 | wx.showModal({content: '关闭了 popup', showCancel: false}) 17 | } 18 | } 19 | }) 20 | -------------------------------------------------------------------------------- /component-demos/popup/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "Popup", 3 | "usingComponents": { 4 | "popup": "/components/popup/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/popup/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Popup 4 | 底部弹出菜单 5 | 6 | 7 | 基本用法 8 | 9 | 10 | 11 | 这是 popup 的内容 12 | 13 | 14 | 15 | 自定义文字 16 | 17 | 18 | 19 | 这是 popup 的内容 20 | 21 | 22 | 23 | 点击背景无法关闭 24 | 25 | 26 | 27 | 这是 popup 的内容 28 | 29 | 30 | 31 | 事件 32 | 33 | 34 | 35 | 这是 popup 的内容 36 | 37 | 38 | hide 39 | 40 | -------------------------------------------------------------------------------- /component-demos/popup/index.wxss: -------------------------------------------------------------------------------- 1 | .weui-btn { 2 | margin-top: 0; 3 | } -------------------------------------------------------------------------------- /component-demos/rate/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | onChange: function (e) { 4 | console.log(e) 5 | wx.showModal({ 6 | content: `当前评分: ${e.detail.value}`, 7 | showCancel: false 8 | }) 9 | } 10 | }) 11 | -------------------------------------------------------------------------------- /component-demos/rate/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "Rate", 3 | "usingComponents": { 4 | "rate": "/components/rate/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/rate/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Rate 4 | 可打半星的评分组件,默认满分 10 分 5 | 6 | 7 | 基本用法 8 | 9 | 10 | 11 | 12 | 每颗星 2 分,半颗星 1 分 13 | 14 | 自定义大小与间距 15 | 16 | 17 | 18 | 19 | 20 | 大小与间距的单位默认为 px,可选 rpx 21 | 22 | 禁用状态 23 | 24 | 25 | 事件 26 | 27 | change: { value: 当前评分 } 28 | 29 | -------------------------------------------------------------------------------- /component-demos/rate/index.wxss: -------------------------------------------------------------------------------- 1 | .rate-area > rate { 2 | display: block; 3 | margin-bottom: 15px; 4 | } 5 | 6 | .rate-area > rate:last-child { 7 | margin-bottom: 0; 8 | } -------------------------------------------------------------------------------- /component-demos/search-bar/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | data: { 4 | eventInfo: '点击输入框进行操作' 5 | }, 6 | 7 | onEvent: function (e) { 8 | console.log(e) 9 | 10 | switch (e.type) { 11 | case 'focus': 12 | this.setData({eventInfo: '触发 focus 事件'}) 13 | break 14 | case 'input': 15 | this.setData({eventInfo: `触发 input 事件,输入框内容:${e.detail.value}`}) 16 | break 17 | case 'clear': 18 | this.setData({eventInfo: '触发 clear 事件'}) 19 | break 20 | case 'hide': 21 | this.setData({eventInfo: '触发 hide 事件'}) 22 | break 23 | case 'search': 24 | this.setData({eventInfo: `触发 search 事件,输入框内容:${e.detail.value}`}) 25 | break 26 | } 27 | } 28 | }) 29 | -------------------------------------------------------------------------------- /component-demos/search-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "SearchBar", 3 | "usingComponents": { 4 | "search-bar": "/components/search-bar/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/search-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | SearchBar 4 | 搜索框 5 | 6 | 7 | 基本用法 8 | 9 | 10 | 自定义文字 11 | 12 | 13 | 显示遮罩背景 14 | 15 | 16 | 点击遮罩背景可关闭 17 | 18 | 19 | 20 | 点击遮罩背景不可关闭 21 | 22 | 23 | 24 | 25 | 事件 26 | {{eventInfo}} 27 | 28 | focus / input / clear / hide / search 29 | input / search: { value: 输入框内容 } 30 | 输入框内容为空时不触发 search 事件 31 | 32 | -------------------------------------------------------------------------------- /component-demos/search-bar/index.wxss: -------------------------------------------------------------------------------- 1 | .event-info { 2 | margin-top: -10px; 3 | margin-bottom: 5px; 4 | line-height: 1.8em; 5 | text-align: center; 6 | font-size: 14px; 7 | color: #888; 8 | } -------------------------------------------------------------------------------- /component-demos/search-bar/mask.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | tappable: false 4 | }, 5 | 6 | onLoad: function (options) { 7 | if (options.tappable) { 8 | this.setData({tappable: true}) 9 | } 10 | } 11 | }) 12 | -------------------------------------------------------------------------------- /component-demos/search-bar/mask.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "SearchBar", 3 | "usingComponents": { 4 | "search-bar": "/components/search-bar/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/search-bar/mask.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /component-demos/search-bar/mask.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/component-demos/search-bar/mask.wxss -------------------------------------------------------------------------------- /component-demos/send-code/index.js: -------------------------------------------------------------------------------- 1 | 2 | var sendBtns // 保存send-code组件的引用 3 | 4 | Page({ 5 | onReady: function () { 6 | sendBtns = [ 7 | this.selectComponent('#send-btn-1'), 8 | this.selectComponent('#send-btn-2'), 9 | this.selectComponent('#send-btn-3'), 10 | this.selectComponent('#send-btn-4') 11 | ] 12 | }, 13 | 14 | onSend: function (e) { 15 | let btn 16 | 17 | switch (e.target.id) { 18 | case 'send-btn-1': 19 | btn = sendBtns[0] 20 | break 21 | case 'send-btn-2': 22 | btn = sendBtns[1] 23 | break 24 | case 'send-btn-3': 25 | btn = sendBtns[2] 26 | break 27 | case 'send-btn-4': 28 | wx.showModal({content: '点击发送按钮', showCancel: false}) 29 | btn = sendBtns[3] 30 | break 31 | } 32 | 33 | btn.prepare() 34 | setTimeout(() => btn.start(), 1000) 35 | }, 36 | 37 | onEnd: function () { 38 | wx.showModal({content: '倒计时结束', showCancel: false}) 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /component-demos/send-code/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "SendCode", 3 | "usingComponents": { 4 | "send-code": "/components/send-code/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/send-code/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/component-demos/send-code/index.wxss -------------------------------------------------------------------------------- /component-demos/spinner/index.js: -------------------------------------------------------------------------------- 1 | // component-demos/spinner/index.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | 11 | /** 12 | * 生命周期函数--监听页面加载 13 | */ 14 | onLoad: function (options) { 15 | 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面初次渲染完成 20 | */ 21 | onReady: function () { 22 | 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面显示 27 | */ 28 | onShow: function () { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面隐藏 34 | */ 35 | onHide: function () { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面卸载 41 | */ 42 | onUnload: function () { 43 | 44 | }, 45 | 46 | /** 47 | * 页面相关事件处理函数--监听用户下拉动作 48 | */ 49 | onPullDownRefresh: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 页面上拉触底事件的处理函数 55 | */ 56 | onReachBottom: function () { 57 | 58 | }, 59 | 60 | /** 61 | * 用户点击右上角分享 62 | */ 63 | onShareAppMessage: function () { 64 | 65 | } 66 | }) -------------------------------------------------------------------------------- /component-demos/spinner/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "Spinner", 3 | "usingComponents": { 4 | "spinner": "/components/spinner/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/spinner/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Spinner 4 | 加载样式 5 | 6 | 7 | 基本用法 8 | 9 | 10 | 11 | 12 | 自定义颜色 13 | 14 | 15 | 16 | 样式 17 | line-scale / line-scale-pulse-out / ball-pulse-sync 18 | 19 | -------------------------------------------------------------------------------- /component-demos/spinner/index.wxss: -------------------------------------------------------------------------------- 1 | spinner { 2 | display: block; 3 | margin: 10px 0; 4 | } -------------------------------------------------------------------------------- /component-demos/sticky/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | data: { 4 | scrollTop: 0, 5 | eventInfo: {} 6 | }, 7 | 8 | onPageScroll: function (e) { 9 | this.setData({scrollTop: e.scrollTop}) 10 | }, 11 | 12 | onSticky: function (e) { 13 | this.setData({eventInfo: e.detail}) 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /component-demos/sticky/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "Sticky", 3 | "usingComponents": { 4 | "sticky": "/components/sticky/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/sticky/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sticky 4 | 吸顶元素 5 | 6 | 7 | 基本用法 8 | 9 | 滚动页面,我会固定在顶部! 10 | 滚动页面,我会固定在顶部! 11 | 12 | 13 | 自定义与顶部的距离 14 | 15 | 我距离顶部50px! 16 | 我距离顶部50px! 17 | 18 | 19 | 事件 20 | 21 | 22 | top:{{eventInfo.top}} 23 | bottom{{eventInfo.bottom}} 24 | 25 | 26 | top:{{eventInfo.top}} 27 | bottom{{eventInfo.bottom}} 28 | 29 | 30 | stickystart / stickyend:开始固定 / 结束固定 31 | 事件对象为元素的布局信息 { left, top, right, bottom } 32 | 33 | 34 | 35 | 36 | 占位元素 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /component-demos/sticky/index.wxss: -------------------------------------------------------------------------------- 1 | .sticky-header1 { 2 | padding: 10px 20px; 3 | line-height: 30px; 4 | background-color: #fff; 5 | border-color: 1px solid #eee; 6 | } 7 | 8 | .sticky-header2 { 9 | padding: 10px 20px; 10 | line-height: 30px; 11 | background-color: #ddd; 12 | border-color: 1px solid #eee; 13 | } 14 | 15 | .sticky-header3 { 16 | padding: 10px 20px; 17 | background-color: #fff; 18 | border-color: 1px solid #eee; 19 | } -------------------------------------------------------------------------------- /component-demos/tab-bar/index.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | onActiveTab: function (e) { 4 | let tabs = this.selectComponent('#tab-bar') 5 | tabs.setActiveIndex((e.currentTarget.dataset.index - 0 + 1) % 4) 6 | } 7 | }) 8 | -------------------------------------------------------------------------------- /component-demos/tab-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "TabBar", 3 | "usingComponents": { 4 | "tab-bar": "/components/tab-bar/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/tab-bar/index.wxss: -------------------------------------------------------------------------------- 1 | .container { 2 | border: 1px solid #eee; 3 | background-color: #fff; 4 | } -------------------------------------------------------------------------------- /component-demos/toast/index.js: -------------------------------------------------------------------------------- 1 | 2 | var toast 3 | 4 | Page({ 5 | onReady: function () { 6 | toast = this.selectComponent('#toast') 7 | }, 8 | 9 | onShowDefault: function () { 10 | toast.show('我是一个浮动提示') 11 | }, 12 | 13 | onShowPostion: function (e) { 14 | let position = e.currentTarget.dataset.pos 15 | toast.show('我是一个浮动提示', { position }) 16 | }, 17 | 18 | onShowDuration: function () { 19 | toast.show('我在五秒钟后会消失', {duration: 5000}) 20 | } 21 | }) 22 | -------------------------------------------------------------------------------- /component-demos/toast/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "Toast", 3 | "usingComponents": { 4 | "toast": "/components/toast/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/toast/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Toast 6 | 浮动提示,默认显示在底部 3 秒 7 | 8 | 9 | 基本用法 10 | 11 | 12 | 13 | 14 | 提示位置 15 | 16 | 17 | 18 | 19 | 20 | 自定义显示时长 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /component-demos/toast/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/component-demos/toast/index.wxss -------------------------------------------------------------------------------- /component-demos/toptip/index.js: -------------------------------------------------------------------------------- 1 | 2 | var toptip 3 | 4 | Page({ 5 | onReady: function () { 6 | toptip = this.selectComponent('#toptip') 7 | }, 8 | 9 | onShowDefault: function () { 10 | toptip.show('我是一个顶部提示') 11 | }, 12 | 13 | onShowType: function (e) { 14 | let type = e.currentTarget.dataset.type 15 | toptip.show('我是一个顶部提示', { type }) 16 | }, 17 | 18 | onShowDuration: function () { 19 | toptip.show('我在五秒钟后会消失', {duration: 5000}) 20 | } 21 | }) 22 | -------------------------------------------------------------------------------- /component-demos/toptip/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "TopTip", 3 | "usingComponents": { 4 | "toptip": "/components/toptip/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /component-demos/toptip/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TopTip 6 | 顶部提示,默认为 error 类型,显示 3 秒 7 | 8 | 9 | 基本用法 10 | 11 | 12 | 13 | 14 | 提示类型 15 | 16 | 17 | 18 | 19 | 20 | 自定义显示时长 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /component-demos/toptip/index.wxss: -------------------------------------------------------------------------------- 1 | /* component-demos/toptip/index.wxss */ -------------------------------------------------------------------------------- /components/async-button/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 异步圆角线性按钮:加载中、禁用 3 | * @event 4 | */ 5 | Component({ 6 | properties: { 7 | // 按钮文字 8 | text: String, 9 | // 是否正在加载 10 | loading: { 11 | type: Boolean, 12 | value: false 13 | }, 14 | // 按钮类型: primary, default, warn 15 | type: { 16 | type: String, 17 | value: 'primary' 18 | }, 19 | // 按钮大小:default,mini 20 | size: { 21 | type: String, 22 | value: 'default' 23 | }, 24 | // 是否禁用 25 | disabled: { 26 | type: Boolean, 27 | value: false 28 | } 29 | }, 30 | 31 | methods: { 32 | _onTap: function () { 33 | let loading = this.data.loading 34 | let disabled = this.data.disabled 35 | if (loading || disabled) return 36 | else this.triggerEvent('tap') 37 | } 38 | } 39 | }) 40 | -------------------------------------------------------------------------------- /components/async-button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/async-button/index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/async-switch/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 异步开关:同步、异步、禁用 3 | * @event 4 | */ 5 | Component({ 6 | properties: { 7 | // 是否禁用 8 | disabled: { 9 | type: Boolean, 10 | value: false 11 | }, 12 | // 是否选中 13 | checked: { 14 | type: Boolean, 15 | value: false 16 | }, 17 | // 是否正在加载 18 | loading: { 19 | type: Boolean, 20 | value: false 21 | } 22 | }, 23 | 24 | methods: { 25 | _onTap: function () { 26 | { 27 | let loading = this.data.loading 28 | let disabled = this.data.disabled 29 | 30 | if (loading || disabled) return 31 | 32 | this.triggerEvent('switch') 33 | } 34 | } 35 | } 36 | }) 37 | -------------------------------------------------------------------------------- /components/async-switch/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/async-switch/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /components/collapse/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 折叠面板 4 | * TODO --- 动画展开 5 | * slot:折叠区域 6 | * @event 7 | */ 8 | Component({ 9 | options: { 10 | multipleSlots: true 11 | }, 12 | properties: { 13 | // 标题 14 | title: String, 15 | // 标题栏右侧操作按钮的文字 16 | actionText: { 17 | type: String, 18 | value: '' 19 | }, 20 | show: { 21 | type: Boolean, 22 | value: true 23 | } 24 | }, 25 | externalClasses: ['header-class'], // 自定义标题类 26 | methods: { 27 | _toggle: function () { 28 | this.setData({show: !this.data.show}) 29 | if (this.data.show) { 30 | this.triggerEvent('show') 31 | } else { 32 | this.triggerEvent('hide') 33 | } 34 | }, 35 | _onTapAction: function () { 36 | this.triggerEvent('tapaction') 37 | } 38 | } 39 | }) 40 | -------------------------------------------------------------------------------- /components/collapse/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/collapse/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{title}} 5 | 6 | {{actionText}} 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /components/collapse/index.wxss: -------------------------------------------------------------------------------- 1 | 2 | .collapse__header { 3 | position: relative; 4 | padding: 20rpx 30rpx 10rpx 30rpx; 5 | background-color: #f5f5f5; 6 | border-top: 1rpx solid #e5e5e5; 7 | border-bottom: 1rpx solid #e5e5e5; 8 | } 9 | 10 | .collapse__header-action { 11 | position: absolute; 12 | right: 30rpx; 13 | top: 20rpx; 14 | min-width: 15%; 15 | text-align: right; 16 | color: #09BB07; 17 | } 18 | 19 | .collapse__body { 20 | display: none; 21 | } 22 | 23 | .collapse__body--show { 24 | display: block; 25 | } 26 | 27 | 28 | /* 通用样式类 */ 29 | 30 | .font-gray-28 { 31 | color: #888; 32 | font-size: 28rpx 33 | } 34 | 35 | .icon-right, 36 | .icon-down { 37 | display: inline-block; 38 | padding-right: 13rpx; 39 | position: relative; 40 | } 41 | 42 | .icon-right::after, 43 | .icon-down::after { 44 | content: ""; 45 | display: inline-block; 46 | position: relative; 47 | bottom: 2rpx; 48 | height: 6px; 49 | width: 6px; 50 | border-width: 2px 2px 0 0; 51 | border-style: solid; 52 | } 53 | 54 | .icon-right::after { 55 | -webkit-transform: rotate(45deg); 56 | transform: rotate(45deg); 57 | } 58 | 59 | .icon-down::after { 60 | bottom: 4rpx; 61 | -webkit-transform: rotate(135deg); 62 | transform: rotate(135deg); 63 | } 64 | -------------------------------------------------------------------------------- /components/load-more/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 加载更多 4 | */ 5 | Component({ 6 | properties: { 7 | status: { 8 | type: String, 9 | value: 'loading' // nomore, hidding 10 | }, 11 | loadingText: { 12 | type: String, 13 | value: '正在加载' 14 | }, 15 | nomoreText: { 16 | type: String, 17 | value: '没有更多数据了' 18 | } 19 | } 20 | }) 21 | -------------------------------------------------------------------------------- /components/load-more/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/load-more/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{loadingText}} 4 | 5 | 6 | {{nomoreText}} 7 | 8 | -------------------------------------------------------------------------------- /components/no-data/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 暂无数据 4 | */ 5 | Component({ 6 | properties: { 7 | text: { 8 | type: String, 9 | value: '暂无数据' 10 | } 11 | } 12 | }) 13 | -------------------------------------------------------------------------------- /components/no-data/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/no-data/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ text || "暂无数据" }} 4 | -------------------------------------------------------------------------------- /components/no-data/index.wxss: -------------------------------------------------------------------------------- 1 | icon { 2 | color: #ccc; 3 | } 4 | 5 | .no-data { 6 | text-align: center; 7 | margin: 30px 0; 8 | } 9 | 10 | .no-data__text { 11 | text-align: center; 12 | display: block; 13 | color: #aaa; 14 | margin: 6px 0 0 0; 15 | } -------------------------------------------------------------------------------- /components/panel/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 带有一个导航标题栏的面板 4 | * slot: 面板内容 5 | */ 6 | Component({ 7 | properties: { 8 | url: String, 9 | title: String 10 | } 11 | }) 12 | -------------------------------------------------------------------------------- /components/panel/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/panel/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{title}} 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /components/panel/index.wxss: -------------------------------------------------------------------------------- 1 | .panel { 2 | position: relative; 3 | overflow: hidden; 4 | background-color: #FFFFFF; 5 | } 6 | 7 | .panel:before { 8 | content: " "; 9 | position: absolute; 10 | left: 0; 11 | top: 0; 12 | right: 0; 13 | height: 1px; 14 | border-top: 1rpx solid #E5E5E5; 15 | color: #E5E5E5; 16 | } 17 | .panel:after { 18 | content: " "; 19 | position: absolute; 20 | left: 0; 21 | bottom: 0; 22 | right: 0; 23 | height: 1px; 24 | border-bottom: 1rpx solid #E5E5E5; 25 | color: #E5E5E5; 26 | } 27 | .panel-hd { 28 | padding: 14px 15px 10px; 29 | color: #999999; 30 | font-size: 13px; 31 | position: relative; 32 | } 33 | .panel-hd:after { 34 | content: " "; 35 | position: absolute; 36 | left: 0; 37 | bottom: 0; 38 | right: 0; 39 | height: 1px; 40 | border-bottom: 1rpx solid #E5E5E5; 41 | color: #E5E5E5; 42 | left: 15px; 43 | } 44 | .panel-hd--active { 45 | background-color: #ECECEC !important; 46 | } 47 | .panel-hd__arrow { 48 | position: absolute; 49 | right: 15px; 50 | top: 50%; 51 | display: inline-block; 52 | height: 6px; 53 | width: 6px; 54 | border-width: 2px 2px 0 0; 55 | border-color: #c8c8c8; 56 | border-style: solid; 57 | transform: translateY(-50%) matrix(0.71, 0.71, -0.71, 0.71, 0, 0); 58 | } 59 | -------------------------------------------------------------------------------- /components/popup/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 底部弹出菜单 4 | * slot:菜单内容 5 | * @event 6 | */ 7 | Component({ 8 | properties: { 9 | // 点击背景是否自动关闭,默认是 10 | tappableMask: { 11 | type: Boolean, 12 | value: true 13 | }, 14 | // 菜单标题 15 | title: String, 16 | // 关闭按钮文字 17 | hideText: { 18 | type: String, 19 | value: '关闭' 20 | }, 21 | // 由父组件控制菜单显示 22 | show: { 23 | type: Boolean, 24 | value: false 25 | } 26 | }, 27 | 28 | methods: { 29 | _onTapMask: function () { 30 | // 原来这里会直接设置 show 为 false 31 | // 现在只触发事件,由父组件设置 show 属性 32 | if (this.data.tappableMask) { 33 | this.triggerEvent('hide') 34 | } 35 | }, 36 | _onHide: function () { 37 | this.triggerEvent('hide') 38 | } 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /components/popup/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/popup/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{title}} 6 | 7 | {{hideText}} 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /components/popup/index.wxss: -------------------------------------------------------------------------------- 1 | .popup__mask { 2 | z-index: 450; 3 | position: fixed; 4 | top: 0; 5 | left: 0; 6 | right: 0; 7 | bottom: 0; 8 | background: rgba(0, 0, 0, 0.7); 9 | display: none; 10 | } 11 | .popup__container { 12 | z-index: 480; 13 | position: fixed; 14 | left: 0; 15 | bottom: 0; 16 | width: 100%; 17 | max-height: 100vh; 18 | overflow: scroll; 19 | /* width: 100vw; */ 20 | background: white; 21 | transform: translateY(150%); 22 | transition: all 0.4s ease; 23 | } 24 | .popup--show .popup__container { 25 | transform: translateY(0); 26 | } 27 | .popup--show .popup__mask { 28 | display: block; 29 | } 30 | 31 | .popup__hd { 32 | padding: 15px 15px 9px; 33 | line-height: 1em; 34 | border-bottom: 1rpx solid #D9D9D9; 35 | } 36 | 37 | .popup__hd-title { 38 | display: inline-block; 39 | width: 50%; 40 | font-size: 14px; 41 | color: #888; 42 | } 43 | 44 | .popup__hd-close { 45 | display: inline-block; 46 | width: 50%; 47 | font-size: 14px; 48 | color: #09BB07; 49 | } 50 | 51 | .popup__hd-title { 52 | text-align: left; 53 | } 54 | 55 | .popup__hd-close { 56 | text-align: right; 57 | } -------------------------------------------------------------------------------- /components/rate/images/icon_star_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/components/rate/images/icon_star_full.png -------------------------------------------------------------------------------- /components/rate/images/icon_star_half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/components/rate/images/icon_star_half.png -------------------------------------------------------------------------------- /components/rate/images/icon_star_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/components/rate/images/icon_star_normal.png -------------------------------------------------------------------------------- /components/rate/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 可打半星的评分组件,默认满分10分 4 | * @event 5 | */ 6 | Component({ 7 | properties: { 8 | // 当前评分 9 | value: Number, 10 | // 是否禁用 11 | disabled: { 12 | type: Boolean, 13 | value: false 14 | }, 15 | // 五角星个数 16 | number: { 17 | type: Number, 18 | value: 5 19 | }, 20 | // 五角星大小 21 | starSize: { 22 | type: String, 23 | value: 30 24 | }, 25 | // 五角星间距大小 26 | gutterSize: { 27 | type: Number, 28 | value: 0 29 | }, 30 | // 大小单位:px,rpx 31 | unit: { 32 | type: String, 33 | value: 'px' 34 | } 35 | }, 36 | 37 | data: { 38 | // 满星、半星、空星图片url 39 | fullSrc: './images/icon_star_full.png', 40 | halfSrc: './images/icon_star_half.png', 41 | normalSrc: './images/icon_star_normal.png', 42 | 43 | // wx-for 中的辅助数组,为每颗星星设置 value 44 | starArray: [] 45 | }, 46 | 47 | attached: function () { 48 | let t = 0 49 | let ta = [] 50 | for (let i = 0; i < this.properties.number; i++, t += 2) { 51 | ta.push(t) 52 | } 53 | this.setData({starArray: ta}) 54 | }, 55 | 56 | methods: { 57 | // 点击左边选择半颗星 58 | _onTapLeft: function (e) { 59 | if (this.data.disabled) return 60 | let value = e.currentTarget.dataset.value 61 | if (this.data.value === value) { 62 | value-- 63 | } 64 | this.setData({ value: value }) 65 | this.triggerEvent('change', { value: value }) 66 | }, 67 | 68 | // 点击右边选择整颗星 69 | _onTapRight: function (e) { 70 | if (this.data.disabled) return 71 | let value = e.currentTarget.dataset.value 72 | if (this.data.value === value) { 73 | value-- 74 | } 75 | this.setData({ value: value }) 76 | this.triggerEvent('change', { value: value }) 77 | } 78 | } 79 | }) 80 | -------------------------------------------------------------------------------- /components/rate/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/rate/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 13 | 14 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /components/rate/index.wxss: -------------------------------------------------------------------------------- 1 | .star { 2 | } 3 | 4 | .star__image{ 5 | position: relative; 6 | } 7 | .star__image:last-child { 8 | margin-right: 0; 9 | } 10 | 11 | .star__mask{ 12 | position: absolute; 13 | top: 0; 14 | } -------------------------------------------------------------------------------- /components/search-bar/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 搜索框 4 | * @event 5 | */ 6 | Component({ 7 | properties: { 8 | defaultText: { 9 | type: String, 10 | value: '搜索' 11 | }, 12 | focusText: { 13 | type: String, 14 | value: '搜索' 15 | }, 16 | // 是否显示背景遮罩,默认否 17 | showMask: { 18 | type: Boolean, 19 | value: false 20 | }, 21 | // 点击背景是否自动关闭,默认是 22 | tappableMask: { 23 | type: Boolean, 24 | value: true 25 | } 26 | }, 27 | data: { 28 | isFocus: false, 29 | value: '' 30 | }, 31 | methods: { 32 | _onFocus: function () { 33 | this.setData({ isFocus: true }) 34 | this.triggerEvent('focus') 35 | }, 36 | 37 | _onHide: function () { 38 | this.setData({ 39 | value: '', 40 | isFocus: false 41 | }) 42 | this.triggerEvent('hide') 43 | }, 44 | 45 | _onClear: function () { 46 | this.setData({ value: '' }) 47 | this.triggerEvent('clear') 48 | }, 49 | 50 | _onInput: function (e) { 51 | this.setData({ value: e.detail.value }) 52 | this.triggerEvent('input', {value: e.detail.value}) 53 | }, 54 | 55 | _onTapMask: function () { 56 | if (this.data.tappableMask) this._onHide() 57 | }, 58 | 59 | // 在输入框不为空时搜索 60 | _onSearch: function (e) { 61 | if (this.data.value) { 62 | this.triggerEvent('search', { value: this.data.value }) 63 | } 64 | } 65 | } 66 | }) 67 | -------------------------------------------------------------------------------- /components/search-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/search-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /components/search-bar/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | @import '/styles/weui.wxss'; 3 | 4 | .search-bar { 5 | z-index: 6; 6 | } 7 | 8 | .search-bar__mask { 9 | position: fixed; 10 | top: 0; 11 | left: 0; 12 | right: 0; 13 | bottom: 0; 14 | z-index: 5; 15 | background: rgba(0, 0, 0, 0.7); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /components/send-code/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 发送短信的倒计时按钮 4 | * @event 5 | */ 6 | Component({ 7 | properties: { 8 | // 默认文字 9 | defaultText: { 10 | type: String, 11 | value: '获取验证码' 12 | }, 13 | // 点击后的文字 14 | pendingText: { 15 | type: String, 16 | value: '发送中' 17 | }, 18 | // 倒计时文字 19 | countingText: { 20 | type: String, 21 | value: '已发送' 22 | }, 23 | // 倒计时时长 24 | duration: { 25 | type: Number, 26 | value: 60 27 | } 28 | }, 29 | 30 | data: { 31 | str: '', // 当前显示的文字 32 | disabled: false, // 倒计时过程中禁用 33 | timer: null, // 计时器 34 | leftTime: 0 // 倒计时剩余时间 35 | }, 36 | 37 | attached: function () { 38 | let { defaultText, duration } = this.data 39 | this.setData({str: defaultText}) 40 | this.data.leftTime = duration 41 | }, 42 | 43 | methods: { 44 | // 准备倒计时 45 | prepare: function () { 46 | this.setData({ 47 | disabled: true, 48 | str: this.data.pendingText 49 | }) 50 | }, 51 | 52 | // 开始倒计时 53 | start: function () { 54 | this._countDown() 55 | }, 56 | 57 | // 结束倒计时 58 | stop: function () { 59 | clearTimeout(this.data.timer) 60 | this.data.leftTime = this.data.duration 61 | this.setData({ 62 | disabled: false, 63 | str: this.data.defaultText 64 | }) 65 | }, 66 | 67 | /** 68 | * 点击的时候不直接开始倒计时,父组件可以做一些参数判断 69 | */ 70 | _onTap: function () { 71 | this.triggerEvent('tap') 72 | }, 73 | 74 | _countDown: function () { 75 | let countingText = this.data.countingText 76 | if (this.data.leftTime > 0) { 77 | this.data.leftTime-- 78 | this.setData({ 79 | disabled: true, 80 | str: `${countingText}(${this.data.leftTime})` 81 | }) 82 | this.data.timer = setTimeout(() => { 83 | this._countDown() 84 | }, 1000) 85 | } else { 86 | this.stop() 87 | this.triggerEvent('end') 88 | } 89 | } 90 | } 91 | }) 92 | -------------------------------------------------------------------------------- /components/send-code/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/send-code/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{str}} 3 | {{str}} 4 | -------------------------------------------------------------------------------- /components/send-code/index.wxss: -------------------------------------------------------------------------------- 1 | @import "/styles/weui.wxss"; -------------------------------------------------------------------------------- /components/spinner/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 加载组件 4 | * 修改了下面的库的css,目前只整合了三个样式 5 | * https://github.com/ConnorAtherton/loaders.css/blob/master/loaders.css 6 | */ 7 | Component({ 8 | properties: { 9 | /** 10 | * 动画类型 11 | * 可选:line-scale,line-scale-pulse-out,ball-pulse-sync 12 | */ 13 | type: { 14 | type: String, 15 | value: 'line-scale-pulse-out' 16 | }, 17 | /** 18 | * 背景颜色 19 | */ 20 | bgColor: { 21 | type: String, 22 | value: '#999' 23 | } 24 | } 25 | }) 26 | -------------------------------------------------------------------------------- /components/spinner/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/spinner/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /components/sticky-2/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/sticky-2/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /components/sticky-2/index.wxss: -------------------------------------------------------------------------------- 1 | .is-sticky { 2 | z-index: 200; 3 | position: fixed; 4 | top: 0; 5 | left: 0; 6 | width: 100%; 7 | } -------------------------------------------------------------------------------- /components/sticky/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Sticky 吸顶元素,当元素滚动到页面顶部时固定,不再跟随滚动。 4 | * @event 事件对象为被包裹元素的布局信息 5 | * 6 | * 使用示例 7 | * ① wxml: 8 | 9 | 我是固定的! 10 | 我是固定的! 11 | 12 | * ② 为页面添加属性 scrollTop: 0 13 | * ③ 在页面的onPageScroll或scroll-view的bindscroll事件中添加: 14 | onPageScroll: function (e) { 15 | this.setData({scrollTop: e.scrollTop}) 16 | } 17 | */ 18 | Component({ 19 | properties: { 20 | // 页面scrollTop值,该值发生变化时说明页面发生了滚动 21 | scrollTop: { 22 | type: Number, 23 | observer: function (val) { 24 | this._update() 25 | } 26 | }, 27 | // 固定位置与顶部的距离 28 | topSpacing: { 29 | type: Number, 30 | value: 0 31 | } 32 | }, 33 | options: { 34 | multipleSlots: true 35 | }, 36 | data: { 37 | fixed: false 38 | }, 39 | 40 | methods: { 41 | _update: function () { 42 | var query = wx.createSelectorQuery().in(this) 43 | query.select('.sticky').boundingClientRect(res => { 44 | let fixed = res.top - this.properties.topSpacing < 0 45 | if (fixed == this.data.fixed) return 46 | this.setData({fixed: fixed}) 47 | if (fixed) { 48 | this.triggerEvent('stickystart', res) 49 | console.log('trigger stickystart') 50 | } else { 51 | this.triggerEvent('stickyend', res) 52 | console.log('trigger stickyend') 53 | } 54 | }).exec() 55 | } 56 | } 57 | }) 58 | -------------------------------------------------------------------------------- /components/sticky/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/sticky/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /components/sticky/index.wxss: -------------------------------------------------------------------------------- 1 | .sticky { 2 | z-index: 200; 3 | } 4 | 5 | .sticky-faker { 6 | position: fixed; 7 | top: 0; 8 | left: 0; 9 | width: 100%; 10 | z-index: 200; 11 | } -------------------------------------------------------------------------------- /components/tab-bar/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 选项卡 TabBar 4 | * slot:不同tab的内容,“name”为对应tab的值 5 | * @event 6 | */ 7 | Component({ 8 | options: { 9 | multipleSlots: true 10 | }, 11 | properties: { 12 | tabs: { 13 | type: Array, 14 | value: ['tab1', 'tab2', 'tab3'] 15 | }, 16 | // 默认激活的选项 17 | activeIndex: { 18 | type: Number, 19 | value: 0 20 | } 21 | }, 22 | 23 | data: { 24 | sliderOffset: 0, 25 | sliderWidth: 0 // slider的宽度 26 | }, 27 | 28 | attached: function () { 29 | wx.getSystemInfo({ 30 | success: res => { 31 | let sliderWidth = res.windowWidth / this.data.tabs.length 32 | this.setData({ 33 | sliderOffset: sliderWidth * this.data.activeIndex, 34 | sliderWidth: sliderWidth 35 | }) 36 | } 37 | }) 38 | }, 39 | 40 | methods: { 41 | // 设置当前激活页 42 | setActiveIndex: function (index) { 43 | this.setData({ 44 | sliderOffset: this.data.sliderWidth * index, 45 | activeIndex: index 46 | }) 47 | }, 48 | // 切换当前激活页 49 | _onClick: function (e) { 50 | let { offsetLeft, id } = e.currentTarget 51 | this.setData({ 52 | sliderOffset: offsetLeft, // 或者 this.data.sliderWidth * index 53 | activeIndex: id 54 | }) 55 | this.triggerEvent('click', {index: id}) 56 | } 57 | } 58 | }) 59 | -------------------------------------------------------------------------------- /components/tab-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/tab-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{item}} 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /components/tab-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '/styles/weui.wxss' 2 | 3 | .weui-navbar { 4 | position: relative; 5 | } 6 | 7 | .weui-tab__panel { 8 | padding-top: 0; 9 | } -------------------------------------------------------------------------------- /components/toast/index.js: -------------------------------------------------------------------------------- 1 | 2 | var timer 3 | 4 | var DEFAULT_CONFIG = { 5 | duration: 3000, 6 | position: 'bottom' 7 | } 8 | 9 | /** 10 | * Toast 能够自定义位置的浮动提示 11 | * 如果只需要居中显示,最好使用 wx.showToast() 12 | * TODO --- 实现淡入淡出 13 | */ 14 | Component({ 15 | properties: { 16 | // 自定义显示位置:top,center,bottom 17 | position: String 18 | }, 19 | data: { 20 | title: '', 21 | show: false 22 | }, 23 | methods: { 24 | /** 25 | * 显示 Toast,父组件通过 Toast 组件的引用调用 26 | * @param title {String} 27 | * @param option {Object} 28 | * -- duration:持续时长 29 | * -- position:元素位置 30 | */ 31 | show (title = '', options = {}) { 32 | // 如果已经有一个计时器在了,就先清理掉 33 | if (timer) { 34 | clearTimeout(timer) 35 | timer = undefined 36 | } 37 | 38 | // 扩展默认配置项 39 | options = Object.assign({}, DEFAULT_CONFIG, options) 40 | 41 | // 设置定时器,定时关闭topTips 42 | timer = setTimeout(() => { 43 | this.setData({ 44 | show: false 45 | }) 46 | }, options.duration) 47 | 48 | // 展示出topTips 49 | this.setData({ 50 | title: title, 51 | position: options.position, 52 | show: true 53 | }) 54 | } 55 | } 56 | }) 57 | -------------------------------------------------------------------------------- /components/toast/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/toast/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{ title }} 3 | -------------------------------------------------------------------------------- /components/toast/index.wxss: -------------------------------------------------------------------------------- 1 | .toast { 2 | z-index: 500; 3 | display: inline-block; 4 | box-sizing:border-box; 5 | position: fixed; 6 | left: 50%; 7 | width:60%; 8 | transform: translateX(-50%); 9 | padding:10px; 10 | font-size: 14px; 11 | line-height:1.5em; 12 | text-align:center; 13 | color: #fff; 14 | background: rgba(0, 0, 0, 0.7); 15 | border-radius: 4px; 16 | } 17 | 18 | .toast--top { 19 | top: 20px; 20 | } 21 | 22 | .toast--center { 23 | top: 50%; 24 | transform: translateX(-50%) translateY(-50%); 25 | } 26 | 27 | .toast--bottom { 28 | bottom: 20px; 29 | } -------------------------------------------------------------------------------- /components/toptip/index.js: -------------------------------------------------------------------------------- 1 | 2 | var timer 3 | 4 | var DEFAULT_CONFIG = { 5 | duration: 3000, 6 | type: 'error' // warn、success、error 7 | } 8 | 9 | /** 10 | * 顶部提示 11 | */ 12 | Component({ 13 | properties: { 14 | content: String 15 | }, 16 | data: { 17 | type: '', 18 | show: false 19 | }, 20 | 21 | methods: { 22 | /** 23 | * 显示 TopTip,父组件通过 TopTip 组件的引用调用 24 | * @param content {String} 25 | * @param option {Object} 26 | * -- duration:持续时长 27 | * -- type:提示类型 28 | */ 29 | show (content = '', options = {}) { 30 | // 如果已经有一个计时器在了,就先清理掉 31 | if (timer) { 32 | clearTimeout(timer) 33 | timer = undefined 34 | } 35 | 36 | // 扩展默认参数 37 | options = Object.assign({}, DEFAULT_CONFIG, options) 38 | 39 | // 设置定时器,定时关闭 40 | timer = setTimeout(() => { 41 | this.setData({ 42 | show: false 43 | }) 44 | }, options.duration) 45 | 46 | // 展示出topTips 47 | this.setData({ 48 | content: content, 49 | type: options.type, 50 | show: true 51 | }) 52 | } 53 | } 54 | }) 55 | -------------------------------------------------------------------------------- /components/toptip/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/toptip/index.wxml: -------------------------------------------------------------------------------- 1 | {{ content }} -------------------------------------------------------------------------------- /components/toptip/index.wxss: -------------------------------------------------------------------------------- 1 | .toptip { 2 | z-index: 500; 3 | display: block; 4 | position: fixed; 5 | -webkit-transform: translateZ(0) translateY(-100%); 6 | transform: translateZ(0) translateY(-100%); 7 | width: 100%; 8 | /* 至少有一行的高度,保证第一次动画显示正常 */ 9 | min-height: 32px; 10 | top: 0; 11 | line-height: 2.3; 12 | font-size: 14px; 13 | text-align: center; 14 | color: #FFF; 15 | background-color: #E64340; 16 | 17 | /* 动画部分 */ 18 | transition: all 0.4s ease; 19 | } 20 | 21 | .toptip--warn { 22 | background-color: #FFBF00; 23 | } 24 | .toptip--success { 25 | background-color: #09BB07; 26 | } 27 | .toptip--error { 28 | background-color: #E64340; 29 | } 30 | 31 | .toptip--show { 32 | -webkit-transform: translateZ(0) translateY(0); 33 | transform: translateZ(0) translateY(0); 34 | } 35 | -------------------------------------------------------------------------------- /docs/.vuepress/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: '在线借书平台', 3 | description: '一个连接读者与读书馆的图书资源共享平台', 4 | head: [ 5 | ['link', { rel: 'icon', href: `/favicon.ico` }] 6 | ], 7 | base: '/weapp-library/', 8 | themeConfig: { 9 | sidebar: { 10 | '/guide/': [{ 11 | title: '文档', 12 | collapsable: false, 13 | children: [ 14 | '', 15 | 'install', 16 | 'feature', 17 | 'front', 18 | 'api', 19 | ] 20 | }] 21 | }, 22 | repo: 'imageslr/weapp-library', 23 | docsDir: 'docs', 24 | editLinks: true, 25 | editLinkText: '在 Github 上编辑此页', 26 | lastUpdated: '上次更新' 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /docs/.vuepress/public/ui.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/.vuepress/public/ui.sketch -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | actionText: 快速了解 → 4 | actionLink: /guide/ 5 | features: 6 | - title: 图书借阅线上化 7 | details: 查找图书、查看馆藏、预约图书、押金支付等均可在小程序内完成;管理员APP实现借书还书的自动化登记,并提供数据统计、订单搜索与查看等功能。 8 | - title: 图书资源利用率最大化 9 | details: 连接所有图书馆的馆藏信息,用户可在多个图书馆中进行选择,使得每个图书馆的图书资源都能得到充分利用。 10 | - title: 培养用户读书兴趣 11 | details: 为用户提供轻松获取图书信息、管理阅读计划的途径。这不仅需要优化推荐与搜索功能,还需要在其他方面做出更多的探索。 12 | footer: Copyright © 2018-present Imageslr 13 | --- 14 | 15 | ### 开始使用 16 | 打开微信——小程序——搜索“在线借书平台”。 17 | 18 | **测试账号**:随便输入一个合法手机号与6位验证码。 19 | 20 | 也可扫描以下小程序码体验: 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/guide/README.md: -------------------------------------------------------------------------------- 1 | # 快速了解 2 | 3 | ## 开始使用 4 | ### 微信小程序 5 | 打开微信——小程序——搜索“在线借书平台”。 6 | 7 | **测试账号**:随便输入一个合法手机号与6位验证码。 8 | 9 | 也可扫描以下小程序码体验: 10 | 11 | 12 | 13 | 14 | ## 简介 15 | 16 | 我们的目标:提供**一个连接读者与图书馆的图书资源共享平台**。 17 | 18 | 如今人们阅读纸质书的频率越来越低,主要原因是购买纸质书需要成本,而从图书馆借书步骤繁琐:每个图书馆都需要办卡、缴纳押金;图书无法在线预约;不同的图书馆馆藏资源不共享,用户往往需要去多个图书馆才能找到自己想要的图书。我们希望通过为所有图书馆和读者提供服务,实现图书借阅线上化,最大化的提高资源利用率。 19 | 20 | #### 简化借阅流程 21 | 用户可通过小程序在线查找图书及馆藏、预约/借阅图书;当用户在图书馆的时候,也可通过小程序扫描图书的ISBN,将图书加入借书栏;管理员只需要通过安卓管理app扫描用户借书二维码即可自动完成订单的创建或修改,无须手动录入信息。 22 | #### 图书借阅线上化 23 | 图书馆可在系统中注册,通过安卓管理App实现借书/还书的自动化登记,通过桌面应用实现图书馆信息设置/馆藏管理/订单管理等功能。 24 | #### 图书资源利用率最大化 25 | 所有图书馆都能方便在我们的平台注册、发布馆藏。当用户需要借阅某本图书时,可在小程序内直接获取所有图书馆的馆藏信息,无需对每个图书馆分别查找,因此一些图书馆的闲置资源也能得到充分利用。 26 | #### 解决信任问题 27 | 读者需要缴纳押金、上传身份证照片,审核通过后方可借书;图书馆需要提交资质证明文件,审核通过后可获得认证标志,这使读者能够知道哪些图书馆是可靠的,图书馆也能够知道哪些读者是可信任的。再加上完善地平台管理机制(用户可能被拉黑,无法再登录),彻底解决读者与图书馆之间的信任问题。 28 | #### 培养用户读书兴趣 29 | 推荐系统会根据用户阅读习惯为其推荐书籍;书单功能使用户可以管理与分享自己的书单;书评功能使用户能交流自己的读书体会。这些功能都能激发用户的读书欲望,进而培养用户的读书习惯。平台为用户提供轻松获取图书信息、管理阅读计划的途径。这不仅需要优化推荐与搜索功能,还需要在其他方面做出更多的探索。 30 | 31 | 32 | ## 特色 33 | * 研究多种设计规范,精心打磨产品界面与交互,确保良好的用户体验 34 | * 利用 Sketch 绘制[高保真原型图](./front.md#ui) 35 | * 利用 [Swagger](https://app.swaggerhub.com/apis/imageslr/weapp/1.0.1#/) 编写详细的[RESTful API 文档](./api.md) 36 | * 前后端分离开发,[前端](./front.md)尽可能实现[组件化](./front.md#组件化) 37 | * 提供一个轻量级、可复用的[本地 Mock Server 解决方案](https://github.com/imageslr/weapp-library#mock-server) 38 | 39 | 40 | ## 功能 41 | 42 | * **搜索图书** 43 | * **查看馆藏** 44 | * **在线预约/续借图书,线下扫码借书** 45 | * **书单功能**:与网易云音乐的歌单系统十分类似,用户可搜索、收藏、推荐和分享书单。用户不仅可为书单添加描述,还可以与书单内的每一本图书添加个性化描述。 46 | * **书评功能** 47 | * **订单管理** 48 | * **用户管理** 49 | * **数据可视化** 50 | * **图书维基系统**:结合维基百科与豆瓣图书的设计理念而开发,是一个开放、可供多人协同创作、且具有版本控制功能的图书信息管理系统,主要提供平台所使用的图书信息的协作管理功能。任何人均可浏览、创建和更改图书信息。 51 | * 推荐系统(TODO) 52 | 53 | ![小程序](../media/weapp_ui_2.png) 54 | 55 | 更多请见[运行截图](./feature.html#运行截图) 56 | 57 | 58 | -------------------------------------------------------------------------------- /docs/guide/feature.md: -------------------------------------------------------------------------------- 1 | 2 | # 功能 3 | ## 介绍 4 | 本项目[小程序](#微信小程序)有 30 多个页面,实现了以下功能: 5 | 6 | * 搜索图书 7 | * 查看馆藏 8 | * 在线预约/续借图书,线下扫码借书 9 | * 创建/收藏/分享书单 10 | * 书评功能 11 | * 订单管理 12 | * ... 13 | 14 | 其中**书单功能**与网易云音乐的歌单系统十分类似,用户可搜索、收藏、推荐和分享书单。用户不仅可为书单添加描述,还可以与书单内的每一本图书添加个性化描述。 15 | 16 | [图书馆桌面应用](#图书馆桌面应用)、[超级管理员应用](#超级管理员应用)均为 vue 单页应用,具有订单管理、用户管理、数据可视化等功能。 17 | 18 | [图书维基系统](#图书维基系统)也是 vue 单页应用。该系统结合维基百科与豆瓣图书的设计理念而开发,是一个开放、可供多人协同创作、且具有版本控制功能的图书信息管理系统。主要提供平台所使用的图书信息的协作管理功能,任何人均可浏览、创建和更改图书信息。 19 | 20 | ### 功能架构图 21 | ![功能架构](../media/functional_architecture.jpg) 22 | 23 | ### 软件概览 24 | 25 | 各个软件功能请见下图: 26 | 27 | 28 | 29 | ## 运行截图 30 | ### 微信小程序 31 | ![小程序](../media/weapp_ui_1.png) 32 | 33 | ![小程序](../media/weapp_ui_2.png) 34 | 35 | ![小程序](../media/weapp_ui_3.png) 36 | 37 | ### 图书馆安卓App 38 | 安卓 39 | 40 | ### 图书馆桌面应用 41 | #### 数据统计 42 | ![安卓](../media/library_2.png) 43 | 44 | ### 图书维基系统 45 | #### 登录注册 46 | ![wiki](../media/wiki_1.png) 47 | #### 搜索图书 48 | ![wiki](../media/wiki_2.png) 49 | #### 查看不同版本 50 | ![wiki](../media/wiki_3.png) 51 | #### 版本差异对比 52 | ![wiki](../media/wiki_4.png) 53 | 54 | ### 超级管理员应用 55 | #### 平台数据统计 56 | ![admin](../media/admin_1.png) 57 | ![admin](../media/admin_2.png) 58 | 59 | 60 | ## 用户身份 61 | 62 | 图书馆与读者是借阅关系,wiki系统贡献者能和其他用户共同维护图书信息。超级管理员管理所有的用户,同时接收他们意见反馈。 63 | 64 | 65 | 66 | ## 流程图 67 | 68 | 借书流程图: 69 | 70 | ![](../media/sequence_book.jpg) 71 | 72 | ![](../media/sequence_borrow_in_library.jpg) 73 | 74 | 订单状态转移图: 75 | 76 | ![](../media/order_status.jpg) 77 | 78 | -------------------------------------------------------------------------------- /docs/guide/install.md: -------------------------------------------------------------------------------- 1 | # 安装 2 | ## 小程序 3 | 1. 安装最新版微信小程序开发工具 4 | 2. 下载[源代码](https://github.com/imageslr/weapp-library),在微信开发者工具中导入 5 | 3. 按照[README](https://github.com/imageslr/weapp-library) 中的说明,启动本地 mock server 6 | 4. 运行成功 7 | 8 | ## 桌面应用 9 | 10 | 目前暂无。 11 | 12 | ## 后端 13 | 目前暂无。 -------------------------------------------------------------------------------- /docs/media/admin_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/admin_1.png -------------------------------------------------------------------------------- /docs/media/admin_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/admin_2.png -------------------------------------------------------------------------------- /docs/media/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/android.png -------------------------------------------------------------------------------- /docs/media/component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/component.png -------------------------------------------------------------------------------- /docs/media/functional_architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/functional_architecture.jpg -------------------------------------------------------------------------------- /docs/media/fundebug-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/fundebug-1.png -------------------------------------------------------------------------------- /docs/media/fundebug-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/fundebug-2.png -------------------------------------------------------------------------------- /docs/media/library_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/library_2.png -------------------------------------------------------------------------------- /docs/media/order_status.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/order_status.jpg -------------------------------------------------------------------------------- /docs/media/page_status_indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/page_status_indicator.png -------------------------------------------------------------------------------- /docs/media/postman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/postman.png -------------------------------------------------------------------------------- /docs/media/sequence_book.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/sequence_book.jpg -------------------------------------------------------------------------------- /docs/media/sequence_borrow_in_library.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/sequence_borrow_in_library.jpg -------------------------------------------------------------------------------- /docs/media/softwares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/softwares.png -------------------------------------------------------------------------------- /docs/media/swagger_ui_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/swagger_ui_1.png -------------------------------------------------------------------------------- /docs/media/swagger_ui_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/swagger_ui_2.png -------------------------------------------------------------------------------- /docs/media/swagger_ui_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/swagger_ui_3.png -------------------------------------------------------------------------------- /docs/media/swagger_ui_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/swagger_ui_4.png -------------------------------------------------------------------------------- /docs/media/ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/ui.png -------------------------------------------------------------------------------- /docs/media/user_identity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/user_identity.jpg -------------------------------------------------------------------------------- /docs/media/weapp_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/weapp_code.png -------------------------------------------------------------------------------- /docs/media/weapp_ui_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/weapp_ui_1.png -------------------------------------------------------------------------------- /docs/media/weapp_ui_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/weapp_ui_2.png -------------------------------------------------------------------------------- /docs/media/weapp_ui_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/weapp_ui_3.png -------------------------------------------------------------------------------- /docs/media/wiki_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/wiki_1.png -------------------------------------------------------------------------------- /docs/media/wiki_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/wiki_2.png -------------------------------------------------------------------------------- /docs/media/wiki_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/wiki_3.png -------------------------------------------------------------------------------- /docs/media/wiki_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media/wiki_4.png -------------------------------------------------------------------------------- /docs/media_待整理/sequence_register.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/sequence_register.jpg -------------------------------------------------------------------------------- /docs/media_待整理/sequence_take_book.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/sequence_take_book.jpg -------------------------------------------------------------------------------- /docs/media_待整理/sys_architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/sys_architecture.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_basic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_basic.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_booklist.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_booklist.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_collection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_collection.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_notice.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_notice.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_order.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_order.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_recommend.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_recommend.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_review.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_review.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_search.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_search.jpg -------------------------------------------------------------------------------- /docs/media_待整理/user_case_user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/user_case_user.jpg -------------------------------------------------------------------------------- /docs/media_待整理/vue_architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/vue_architecture.jpg -------------------------------------------------------------------------------- /docs/media_待整理/weapp_architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/docs/media_待整理/weapp_architecture.jpg -------------------------------------------------------------------------------- /images/default_avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/default_avatar.jpg -------------------------------------------------------------------------------- /images/icon_add_to_booklist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_add_to_booklist.png -------------------------------------------------------------------------------- /images/icon_bell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_bell.png -------------------------------------------------------------------------------- /images/icon_booklist_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_booklist_fill.png -------------------------------------------------------------------------------- /images/icon_booklist_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_booklist_line.png -------------------------------------------------------------------------------- /images/icon_cart_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_cart_fill.png -------------------------------------------------------------------------------- /images/icon_cart_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_cart_line.png -------------------------------------------------------------------------------- /images/icon_certificated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_certificated.png -------------------------------------------------------------------------------- /images/icon_deposit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_deposit.png -------------------------------------------------------------------------------- /images/icon_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_drawer.png -------------------------------------------------------------------------------- /images/icon_empty_booklist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_empty_booklist.png -------------------------------------------------------------------------------- /images/icon_headlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_headlines.png -------------------------------------------------------------------------------- /images/icon_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_help.png -------------------------------------------------------------------------------- /images/icon_home_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_home_fill.png -------------------------------------------------------------------------------- /images/icon_home_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_home_line.png -------------------------------------------------------------------------------- /images/icon_in_process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_in_process.png -------------------------------------------------------------------------------- /images/icon_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_info.png -------------------------------------------------------------------------------- /images/icon_logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_logout.png -------------------------------------------------------------------------------- /images/icon_me_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_me_fill.png -------------------------------------------------------------------------------- /images/icon_me_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_me_line.png -------------------------------------------------------------------------------- /images/icon_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_more.png -------------------------------------------------------------------------------- /images/icon_paper_plane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_paper_plane.png -------------------------------------------------------------------------------- /images/icon_review.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_review.png -------------------------------------------------------------------------------- /images/icon_review_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_review_2.png -------------------------------------------------------------------------------- /images/icon_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_scan.png -------------------------------------------------------------------------------- /images/icon_setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_setting.png -------------------------------------------------------------------------------- /images/icon_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_time.png -------------------------------------------------------------------------------- /images/icon_trending_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_trending_1.png -------------------------------------------------------------------------------- /images/icon_trending_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_trending_2.png -------------------------------------------------------------------------------- /images/icon_trending_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_trending_3.png -------------------------------------------------------------------------------- /images/icon_trending_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_trending_up.png -------------------------------------------------------------------------------- /images/icon_uncertificated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/icon_uncertificated.png -------------------------------------------------------------------------------- /images/load_fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/load_fail.png -------------------------------------------------------------------------------- /images/logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/logo.jpeg -------------------------------------------------------------------------------- /images/miniapp_code.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/miniapp_code.jpg -------------------------------------------------------------------------------- /images/no_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imageslr/weapp-library/42a1fe8131c7a62041b008fddcacac2cb204ad5b/images/no_data.png -------------------------------------------------------------------------------- /pages/book-detail/book-detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "图书详情", 3 | "usingComponents": 4 | { 5 | "popup": "/components/popup/index", 6 | "load-more": "/components/load-more/index", 7 | "no-data": "/components/no-data/index" 8 | } 9 | } -------------------------------------------------------------------------------- /pages/book-detail/children/add.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "加入书单" 3 | } -------------------------------------------------------------------------------- /pages/book-detail/children/add.wxml: -------------------------------------------------------------------------------- 1 | 书单 2 | 3 | 4 | 5 | 6 | {{booklistTitles[selectedIndex]}} 7 | 8 | 9 | 10 | 11 | 图书描述 12 | 13 | 14 | 15 |