├── miniprogram_npm └── vant-weapp │ ├── common │ ├── style │ │ ├── var.wxss │ │ ├── mixins │ │ │ ├── clearfix.wxss │ │ │ ├── ellipsis.wxss │ │ │ └── hairline.wxss │ │ ├── clearfix.wxss │ │ ├── ellipsis.wxss │ │ └── hairline.wxss │ ├── color.js │ ├── color.d.ts │ ├── component.d.ts │ ├── utils.d.ts │ ├── utils.js │ ├── index.wxss │ └── component.js │ ├── area │ ├── index.d.ts │ ├── index.wxss │ ├── index.json │ └── index.wxml │ ├── badge │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── index.js │ ├── card │ ├── index.d.ts │ ├── index.json │ ├── index.js │ ├── index.wxss │ └── index.wxml │ ├── cell │ ├── index.d.ts │ ├── index.json │ ├── index.js │ ├── index.wxml │ └── index.wxss │ ├── col │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ ├── index.js │ └── index.wxss │ ├── field │ ├── index.d.ts │ ├── index.json │ └── index.wxss │ ├── icon │ ├── index.d.ts │ ├── index.json │ ├── index.js │ └── index.wxml │ ├── info │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ ├── index.js │ └── index.wxss │ ├── panel │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.js │ └── index.wxml │ ├── popup │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ └── index.js │ ├── radio │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── index.js │ ├── rate │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ └── index.wxml │ ├── row │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js │ ├── steps │ ├── index.d.ts │ ├── index.json │ ├── index.js │ └── index.wxml │ ├── tab │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js │ ├── tabs │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ └── index.wxml │ ├── tag │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── index.js │ ├── toast │ ├── index.d.ts │ ├── index.json │ ├── index.js │ ├── index.wxss │ ├── toast.d.ts │ ├── index.wxml │ └── toast.js │ ├── button │ ├── index.d.ts │ ├── index.json │ ├── index.js │ ├── index.wxml │ └── index.wxss │ ├── cell-group │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js │ ├── checkbox │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── collapse │ ├── index.d.ts │ ├── index.wxss │ ├── index.json │ ├── index.wxml │ └── index.js │ ├── dialog │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── dialog.d.ts │ ├── dialog.js │ └── index.wxml │ ├── loading │ ├── index.d.ts │ ├── index.json │ ├── index.js │ └── index.wxml │ ├── nav-bar │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.js │ └── index.wxml │ ├── notice-bar │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ └── index.wxml │ ├── notify │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── notify.d.ts │ ├── index.wxml │ ├── notify.js │ └── index.js │ ├── overlay │ ├── index.d.ts │ ├── index.wxss │ ├── index.json │ ├── index.wxml │ └── index.js │ ├── picker │ ├── index.d.ts │ ├── index.json │ ├── shared.js │ ├── shared.d.ts │ ├── index.wxss │ └── index.wxml │ ├── progress │ ├── index.d.ts │ ├── index.json │ ├── index.wxs │ ├── index.wxss │ ├── index.js │ └── index.wxml │ ├── radio-group │ ├── index.wxml │ ├── index.d.ts │ ├── index.wxss │ ├── index.json │ └── index.js │ ├── search │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.js │ └── index.wxml │ ├── slider │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ └── index.wxml │ ├── stepper │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── submit-bar │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js │ ├── swipe-cell │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ └── index.wxml │ ├── switch │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── index.js │ ├── tabbar │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js │ ├── transition │ ├── index.d.ts │ ├── index.json │ ├── index.wxml │ ├── index.js │ └── index.wxss │ ├── action-sheet │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.js │ └── index.wxml │ ├── badge-group │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js │ ├── checkbox-group │ ├── index.d.ts │ ├── index.wxml │ ├── index.wxss │ ├── index.json │ └── index.js │ ├── collapse-item │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ └── index.wxml │ ├── datetime-picker │ ├── index.d.ts │ ├── index.wxss │ ├── index.json │ └── index.wxml │ ├── goods-action │ ├── index.d.ts │ ├── index.json │ ├── index.js │ ├── index.wxss │ └── index.wxml │ ├── picker-column │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ └── index.wxml │ ├── switch-cell │ ├── index.d.ts │ ├── index.wxss │ ├── index.json │ ├── index.wxml │ └── index.js │ ├── tabbar-item │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js │ ├── tree-select │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ └── index.wxml │ ├── goods-action-button │ ├── index.d.ts │ ├── index.wxss │ ├── index.json │ ├── index.js │ └── index.wxml │ ├── goods-action-icon │ ├── index.d.ts │ ├── index.json │ ├── index.wxss │ ├── index.js │ └── index.wxml │ ├── mixins │ ├── basic.d.ts │ ├── link.d.ts │ ├── touch.d.ts │ ├── button.d.ts │ ├── open-type.d.ts │ ├── observer │ │ ├── behavior.d.ts │ │ ├── props.d.ts │ │ ├── index.d.ts │ │ ├── props.js │ │ ├── index.js │ │ └── behavior.js │ ├── transition.d.ts │ ├── safe-area.d.ts │ ├── link.js │ ├── button.js │ ├── basic.js │ ├── open-type.js │ ├── touch.js │ └── safe-area.js │ └── wxs │ ├── array.wxs │ ├── object.wxs │ ├── utils.wxs │ ├── bem.wxs │ └── memoize.wxs ├── pages ├── webview │ ├── webview.wxss │ ├── webview.json │ ├── webview.wxml │ └── webview.js ├── about │ ├── about.json │ ├── about.wxss │ ├── about.js │ └── about.wxml ├── repo-detail │ ├── repo-detail.json │ ├── repo-detail.wxml │ └── repo-detail.wxss ├── login │ ├── login.json │ └── login.wxss ├── me │ ├── me.json │ ├── me.wxss │ └── me.wxml ├── search │ ├── search.wxss │ ├── search.json │ ├── search.wxml │ └── search.js ├── index │ ├── repo-self │ │ └── repo-self.json │ ├── index.json │ ├── index.wxss │ ├── repo-all │ │ └── repo-all.json │ ├── index.wxml │ └── index.js └── repositories │ ├── repositories.json │ └── repositories.wxss ├── components ├── gh-custom │ ├── index.wxss │ ├── index.json │ ├── index.wxml │ └── index.js └── nodata │ ├── nodata.json │ ├── nodata.wxml │ ├── nodata.wxss │ └── nodata.js ├── custom-tab-bar ├── index.json ├── index.js ├── index.wxml └── index.wxss ├── assets ├── img │ ├── avatar.png │ ├── github.jpg │ ├── share.jpg │ ├── weapp.jpg │ ├── no-data.png │ └── tabbar │ │ ├── gh-me.png │ │ ├── gh-chanku.png │ │ ├── gh-me-active.png │ │ └── gh-chanku-active.png └── css │ └── main.wxss ├── app.wxss ├── sitemap.json ├── app.js ├── utils ├── config.js ├── util.wxs └── http.js ├── cloud_fun └── gh_cloud_fn │ ├── package.json │ └── index.js ├── package.json ├── README.md ├── .gitignore ├── app.json └── project.config.json /miniprogram_npm/vant-weapp/common/style/var.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/area/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/card/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/col/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/field/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/icon/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/info/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/panel/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/popup/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/rate/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/row/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/steps/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tab/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabs/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tag/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/toast/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /pages/webview/webview.wxss: -------------------------------------------------------------------------------- 1 | /* pages/webview/webview.wxss */ -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/button/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell-group/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/style/mixins/clearfix.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/style/mixins/ellipsis.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/style/mixins/hairline.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/dialog/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/loading/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/nav-bar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notice-bar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notify/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/overlay/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/progress/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/search/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/slider/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/stepper/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/submit-bar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/swipe-cell/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/transition/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /pages/webview/webview.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /components/gh-custom/index.wxss: -------------------------------------------------------------------------------- 1 | /* components/gh-custom/index.wxss */ -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/action-sheet/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge-group/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox-group/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse-item/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/datetime-picker/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker-column/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio-group/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch-cell/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar-item/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tree-select/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/area/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-button/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-icon/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tag/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/col/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/info/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/loading/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/row/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/stepper/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/basic.d.ts: -------------------------------------------------------------------------------- 1 | export declare const basic: void; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/link.d.ts: -------------------------------------------------------------------------------- 1 | export declare const link: void; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/touch.d.ts: -------------------------------------------------------------------------------- 1 | export declare const touch: void; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker-column/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/progress/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/slider/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/transition/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /custom-tab-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/datetime-picker/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/button.d.ts: -------------------------------------------------------------------------------- 1 | export declare const button: void; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/swipe-cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /components/gh-custom/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /components/nodata/nodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/open-type.d.ts: -------------------------------------------------------------------------------- 1 | export declare const openType: void; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/observer/behavior.d.ts: -------------------------------------------------------------------------------- 1 | export declare const behavior: void; 2 | -------------------------------------------------------------------------------- /pages/about/about.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {}, 3 | "navigationBarTitleText": "帮助与介绍" 4 | } -------------------------------------------------------------------------------- /assets/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/avatar.png -------------------------------------------------------------------------------- /assets/img/github.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/github.jpg -------------------------------------------------------------------------------- /assets/img/share.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/share.jpg -------------------------------------------------------------------------------- /assets/img/weapp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/weapp.jpg -------------------------------------------------------------------------------- /assets/img/no-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/no-data.png -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-badge-group{width:85px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/style/clearfix.wxss: -------------------------------------------------------------------------------- 1 | .van-clearfix:after{content:"";display:table;clear:both} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/observer/props.d.ts: -------------------------------------------------------------------------------- 1 | export declare function observeProps(props: any): void; 2 | -------------------------------------------------------------------------------- /assets/img/tabbar/gh-me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/tabbar/gh-me.png -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-button/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';:host{-webkit-flex:1;flex:1} -------------------------------------------------------------------------------- /assets/img/tabbar/gh-chanku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/tabbar/gh-chanku.png -------------------------------------------------------------------------------- /components/gh-custom/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | components/gh-custom/index.wxml 3 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/transition.d.ts: -------------------------------------------------------------------------------- 1 | export declare const transition: (showDefaultValue: boolean) => void; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/row/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-row:after{content:"";display:table;clear:both} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/observer/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare function observe(vantOptions: any, options: any): void; 2 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/row/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /pages/webview/webview.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/img/tabbar/gh-me-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/tabbar/gh-me-active.png -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /* 引入iconfont字体文件 */ 2 | @import "./assets/font/font.wxss"; 3 | /* 引入基础样式文件 */ 4 | @import "./assets/css/main.wxss"; 5 | 6 | -------------------------------------------------------------------------------- /assets/img/tabbar/gh-chanku-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjiaobin/github-search/HEAD/assets/img/tabbar/gh-chanku-active.png -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/overlay/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-overlay{position:fixed;top:0;right:0;bottom:0;left:0} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/card/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-tag": "../tag/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/color.js: -------------------------------------------------------------------------------- 1 | export const RED = '#f44'; 2 | export const BLUE = '#1989fa'; 3 | export const GREEN = '#07c160'; 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-info": "../info/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-info": "../info/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/nav-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notice-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/panel/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/rate/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/steps/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabs/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-info": "../info/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/area/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-picker": "../picker/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/popup/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-overlay": "../overlay/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-cell-group__title{font-size:14px;padding:15px 15px 5px;color:#999;line-height:16px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/datetime-picker/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-picker": "../picker/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notify/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-transition": "../transition/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/overlay/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-transition": "../transition/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/color.d.ts: -------------------------------------------------------------------------------- 1 | export declare const RED = "#f44"; 2 | export declare const BLUE = "#1989fa"; 3 | export declare const GREEN = "#07c160"; 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-button": "../button/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/wxs/array.wxs: -------------------------------------------------------------------------------- 1 | function isArray(array) { 2 | return array && array.constructor === 'Array'; 3 | } 4 | 5 | module.exports.isArray = isArray; 6 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/info/index.wxml: -------------------------------------------------------------------------------- 1 | {{ info }} 6 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/panel/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-panel{background:#fff}.van-panel__header-value{color:#f44}.van-panel__footer{padding:10px 15px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/progress/index.wxs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | text: function(pivotText, percentage) { 3 | return pivotText || percentage + '%'; 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/field/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index", 5 | "van-icon": "../icon/index" 6 | } 7 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch-cell/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-switch-cell{padding-top:9px;padding-bottom:9px}.van-switch-cell__switch{vertical-align:middle} -------------------------------------------------------------------------------- /components/nodata/nodata.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{text}} 4 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/search/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-field": "../field/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/dialog/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-popup": "../popup/index", 5 | "van-button": "../button/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/submit-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-button": "../button/index", 5 | "van-icon": "../icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch-cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index", 5 | "van-switch": "../switch/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-info": "../info/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tree-select/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-cell": "../cell/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-button": "../button/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/info/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | info: null, 5 | customStyle: String 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "picker-column": "../picker-column/index", 5 | "loading": "../loading/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tab/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tab__pane{box-sizing:border-box;overflow-y:auto}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { safeArea } from '../mixins/safe-area'; 3 | VantComponent({ 4 | mixins: [safeArea()] 5 | }); 6 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/safe-area.d.ts: -------------------------------------------------------------------------------- 1 | export declare const safeArea: ({ safeAreaInsetBottom, safeAreaInsetTop }?: { 2 | safeAreaInsetBottom?: boolean; 3 | safeAreaInsetTop?: boolean; 4 | }) => void; 5 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-goods-action{position:fixed;right:0;bottom:0;left:0;display:-webkit-flex;display:flex;background-color:#fff}.van-goods-action--safe{padding-bottom:34px} -------------------------------------------------------------------------------- /pages/repo-detail/repo-detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-steps": "../../miniprogram_npm/vant-weapp/steps/index", 4 | "no-data": "../../components/nodata/nodata" 5 | }, 6 | "navigationBarTitleText": "提交记录" 7 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/action-sheet/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-popup": "../popup/index", 6 | "van-loading": "../loading/index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tabbar{display:-webkit-flex;display:flex;width:100%;height:50px;background-color:#fff}.van-tabbar--fixed{position:fixed;bottom:0;left:0}.van-tabbar--safe{padding-bottom:34px} -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function () { 4 | // wx.cloud.init({ 5 | // env: 'gh-weapp-test-c46p5', 6 | // traceUser: true 7 | // }) 8 | }, 9 | globalData: { 10 | userInfo: null, 11 | auth: 1 12 | } 13 | }) -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notify/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-notify{position:fixed;top:0;width:100%;padding:6px 15px;font-size:14px;line-height:20px;text-align:center;word-break:break-all;box-sizing:border-box}.van-notify__safe-top{height:44px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/col/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pages/login/login.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-field": "../../miniprogram_npm/vant-weapp/field/index", 4 | "van-button": "../../miniprogram_npm/vant-weapp/button/index", 5 | "van-dialog": "../../miniprogram_npm/vant-weapp/dialog/index" 6 | } 7 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell-group/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | {{ title }} 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | title: String, 5 | border: { 6 | type: Boolean, 7 | value: true 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tag/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/toast/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-loading": "../loading/index", 6 | "van-overlay": "../overlay/index", 7 | "van-transition": "../transition/index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/component.d.ts: -------------------------------------------------------------------------------- 1 | declare function VantComponent(vantOptions?: VantComponentOptions>): void; 2 | export { VantComponent }; 3 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker-column/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-picker-column{overflow:hidden;font-size:16px;color:#999;text-align:center}.van-picker-column__item{padding:0 5px}.van-picker-column__item--selected{font-weight:500;color:#333}.van-picker-column__item--disabled{opacity:.3} -------------------------------------------------------------------------------- /utils/config.js: -------------------------------------------------------------------------------- 1 | const github_token = "GITHUB_TOKEN" 2 | const github_account = "GITHUB_ACCOUNT" 3 | const github_pwd = "GITHUB_PWD" 4 | const github_user_info = "GITHUB_USER_INFO" 5 | 6 | module.exports = { 7 | github_token, 8 | github_account, 9 | github_pwd, 10 | github_user_info 11 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/utils.d.ts: -------------------------------------------------------------------------------- 1 | declare function isDef(value: any): boolean; 2 | declare function isObj(x: any): boolean; 3 | declare function isNumber(value: any): boolean; 4 | declare function range(num: number, min: number, max: number): number; 5 | export { isObj, isDef, isNumber, range }; 6 | -------------------------------------------------------------------------------- /pages/me/me.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-cell": "../../miniprogram_npm/vant-weapp/cell/index", 4 | "van-cell-group": "../../miniprogram_npm/vant-weapp/cell-group/index", 5 | "van-button": "../../miniprogram_npm/vant-weapp/button/index" 6 | }, 7 | "navigationBarTitleText": "我" 8 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/rate/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-rate{-webkit-user-select:none;user-select:none}.van-rate__item{position:relative;display:inline-block;padding:0 2px}.van-rate__icon{display:block;height:1em}.van-rate__icon--half{position:absolute;top:0;left:2px;width:.5em;overflow:hidden} -------------------------------------------------------------------------------- /pages/search/search.wxss: -------------------------------------------------------------------------------- 1 | /* pages/search/search.wxss */ 2 | .github-search_list { 3 | padding: 20rpx; 4 | } 5 | .search_item { 6 | margin-bottom: 20rpx; 7 | border-bottom: 1px solid #eaecef; 8 | } 9 | .no-data__type { 10 | text-align: center; 11 | } 12 | .van-tag__text { 13 | margin-bottom: 30rpx; 14 | } -------------------------------------------------------------------------------- /components/gh-custom/index.js: -------------------------------------------------------------------------------- 1 | // components/gh-custom/index.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | 8 | }, 9 | 10 | /** 11 | * 组件的初始数据 12 | */ 13 | data: { 14 | 15 | }, 16 | 17 | /** 18 | * 组件的方法列表 19 | */ 20 | methods: { 21 | 22 | } 23 | }) 24 | -------------------------------------------------------------------------------- /custom-tab-bar/index.js: -------------------------------------------------------------------------------- 1 | // custom-tab-bar/custom-tab-bar.js.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | 8 | }, 9 | 10 | /** 11 | * 组件的初始数据 12 | */ 13 | data: { 14 | 15 | }, 16 | 17 | /** 18 | * 组件的方法列表 19 | */ 20 | methods: { 21 | 22 | } 23 | }) 24 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/panel/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | classes: ['header-class', 'footer-class'], 4 | props: { 5 | desc: String, 6 | title: String, 7 | status: String, 8 | useFooterSlot: Boolean 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/overlay/index.wxml: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /components/nodata/nodata.wxss: -------------------------------------------------------------------------------- 1 | /* components/nodata/nodata.wxss */ 2 | .no-data { 3 | display: flex; 4 | justify-content: center; 5 | align-items: center; 6 | flex-direction: column; 7 | } 8 | .no-data__img { 9 | width: 200rpx; 10 | height: 200rpx; 11 | } 12 | .no-data__text { 13 | font-size: 30rpx; 14 | color: #ccc; 15 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/style/ellipsis.wxss: -------------------------------------------------------------------------------- 1 | .van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/wxs/object.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var REGEXP = getRegExp('{|}|"', 'g'); 3 | 4 | function keys(obj) { 5 | return JSON.stringify(obj) 6 | .replace(REGEXP, '') 7 | .split(',') 8 | .map(function(item) { 9 | return item.split(':')[0]; 10 | }); 11 | } 12 | 13 | module.exports.keys = keys; 14 | -------------------------------------------------------------------------------- /cloud_fun/gh_cloud_fn/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gh_cloud_fn", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "latest" 13 | } 14 | } -------------------------------------------------------------------------------- /pages/index/repo-self/repo-self.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-search": "../../../miniprogram_npm/vant-weapp/search/index", 5 | "no-data": "../../../components/nodata/nodata", 6 | "van-loading": "../../../miniprogram_npm/vant-weapp/loading/index", 7 | "van-icon": "../../../miniprogram_npm/vant-weapp/icon/index" 8 | } 9 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /cloud_fun/gh_cloud_fn/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk') 3 | 4 | cloud.init() 5 | 6 | // 云函数入口函数 7 | exports.main = async (event, context) => { 8 | const wxContext = cloud.getWXContext() 9 | 10 | return { 11 | event, 12 | openid: wxContext.OPENID, 13 | appid: wxContext.APPID, 14 | unionid: wxContext.UNIONID, 15 | } 16 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/transition/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/wxs/utils.wxs: -------------------------------------------------------------------------------- 1 | var bem = require('./bem.wxs').bem; 2 | var memoize = require('./memoize.wxs').memoize; 3 | 4 | function isSrc(url) { 5 | return url.indexOf('http') === 0 || url.indexOf('data:image') === 0 || url.indexOf('//') === 0; 6 | } 7 | 8 | module.exports = { 9 | bem: memoize(bem), 10 | isSrc: isSrc, 11 | memoize: memoize 12 | }; 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "github-search", 3 | "version": "1.0.0", 4 | "description": "简易小程序", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "陈焦滨&kevin", 10 | "license": "ISC", 11 | "dependencies": { 12 | "flyio": "^0.6.14", 13 | "vant-weapp": "^0.5.15" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pages/search/search.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-row": "../../miniprogram_npm/vant-weapp/row/index", 4 | "van-col": "../../miniprogram_npm/vant-weapp/col/index", 5 | "no-data": "../../components/nodata/nodata", 6 | "van-loading": "../../miniprogram_npm/vant-weapp/loading/index", 7 | "van-tag": "../../miniprogram_npm/vant-weapp/tag/index" 8 | } 9 | } -------------------------------------------------------------------------------- /components/nodata/nodata.js: -------------------------------------------------------------------------------- 1 | // components/nodata/nodata.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | text: { 8 | type: String, 9 | value: '暂无数据' 10 | } 11 | }, 12 | 13 | /** 14 | * 组件的初始数据 15 | */ 16 | data: { 17 | 18 | }, 19 | 20 | /** 21 | * 组件的方法列表 22 | */ 23 | methods: { 24 | 25 | } 26 | }) 27 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notify/notify.d.ts: -------------------------------------------------------------------------------- 1 | interface NotifyOptions { 2 | text: string; 3 | color?: string; 4 | backgroundColor?: string; 5 | duration?: number; 6 | selector?: string; 7 | context?: any; 8 | safeAreaInsetTop?: boolean; 9 | zIndex?: number; 10 | } 11 | export default function Notify(options: NotifyOptions | string): void; 12 | export {}; 13 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/swipe-cell/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-swipe-cell{position:relative;overflow:hidden}.van-swipe-cell__left,.van-swipe-cell__right{position:absolute;top:0;height:100%}.van-swipe-cell__left{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.van-swipe-cell__right{right:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-icon/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-goods-action-icon{width:50px!important;border:none!important}.van-goods-action-icon__content{display:-webkit-flex;display:flex;height:100%;font-size:10px;line-height:1;color:#7d7e80;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center}.van-goods-action-icon__icon{margin-bottom:4px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notify/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 8 | {{ text }} 9 | 10 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/transition/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { transition } from '../mixins/transition'; 3 | VantComponent({ 4 | classes: [ 5 | 'enter-class', 6 | 'enter-active-class', 7 | 'enter-to-class', 8 | 'leave-class', 9 | 'leave-active-class', 10 | 'leave-to-class' 11 | ], 12 | mixins: [transition(true)] 13 | }); 14 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/loading/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | size: { 5 | type: String, 6 | value: '30px' 7 | }, 8 | type: { 9 | type: String, 10 | value: 'circular' 11 | }, 12 | color: { 13 | type: String, 14 | value: '#c9c9c9' 15 | } 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/loading/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-search": "../../miniprogram_npm/vant-weapp/search/index", 4 | "van-button": "../../miniprogram_npm/vant-weapp/button/index", 5 | "van-picker": "../../miniprogram_npm/vant-weapp/picker/index", 6 | "van-icon": "../../miniprogram_npm/vant-weapp/icon/index", 7 | "repo-all": "./repo-all/repo-all", 8 | "repo-self": "./repo-self/repo-self" 9 | }, 10 | "navigationBarTitleText": "GitHub-仓库" 11 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/utils.js: -------------------------------------------------------------------------------- 1 | function isDef(value) { 2 | return value !== undefined && value !== null; 3 | } 4 | function isObj(x) { 5 | const type = typeof x; 6 | return x !== null && (type === 'object' || type === 'function'); 7 | } 8 | function isNumber(value) { 9 | return /^\d+$/.test(value); 10 | } 11 | function range(num, min, max) { 12 | return Math.min(Math.max(num, min), max); 13 | } 14 | export { isObj, isDef, isNumber, range }; 15 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/link.js: -------------------------------------------------------------------------------- 1 | export const link = Behavior({ 2 | properties: { 3 | url: String, 4 | linkType: { 5 | type: String, 6 | value: 'navigateTo' 7 | } 8 | }, 9 | methods: { 10 | jumpLink(urlKey = 'url') { 11 | const url = this.data[urlKey]; 12 | if (url) { 13 | wx[this.data.linkType]({ url }); 14 | } 15 | } 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/info/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-info{position:absolute;top:-8px;right:0;min-width:16px;padding:0 3px;font-family:PingFang SC,Helvetica Neue,Arial,sans-serif;font-size:12px;font-weight:500;line-height:14px;color:#fff;text-align:center;white-space:nowrap;background-color:#f44;border:1px solid #fff;border-radius:16px;-webkit-transform:translateX(50%);transform:translateX(50%);box-sizing:border-box;-webkit-transform-origin:100%;transform-origin:100%} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tag/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tag{color:#fff;font-size:10px;padding:.2em .5em;line-height:normal;border-radius:.2em;display:inline-block}.van-tag:after{border-color:currentColor;border-radius:.4em}.van-tag--mark{padding-right:.6em;border-radius:0 .8em .8em 0}.van-tag--mark:after{border-radius:0 1.6em 1.6em 0}.van-tag--round{border-radius:.8em}.van-tag--round:after{border-radius:1.6em}.van-tag--medium{font-size:12px}.van-tag--large{font-size:14px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/steps/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { GREEN } from '../common/color'; 3 | VantComponent({ 4 | props: { 5 | icon: String, 6 | steps: Array, 7 | active: Number, 8 | direction: { 9 | type: String, 10 | value: 'horizontal' 11 | }, 12 | activeColor: { 13 | type: String, 14 | value: GREEN 15 | } 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /pages/repo-detail/repo-detail.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 15 | {{ title }} 16 | 17 | 18 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/icon/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | info: null, 5 | name: String, 6 | size: String, 7 | color: String, 8 | customStyle: String, 9 | classPrefix: { 10 | type: String, 11 | value: 'van-icon' 12 | } 13 | }, 14 | methods: { 15 | onClick() { 16 | this.$emit('click'); 17 | } 18 | } 19 | }); 20 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/progress/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-progress{position:relative;height:4px;background:#e5e5e5;border-radius:4px}.van-progress__portion{position:absolute;left:0;height:100%;border-radius:inherit}.van-progress__pivot{position:absolute;top:50%;right:0;min-width:2em;padding:0 5px;font-size:10px;line-height:1.6;text-align:center;word-break:keep-all;background-color:#e5e5e5;border-radius:1em;-webkit-transform:translateY(-50%);transform:translateY(-50%);box-sizing:border-box} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker/shared.js: -------------------------------------------------------------------------------- 1 | export const pickerProps = { 2 | title: String, 3 | loading: Boolean, 4 | showToolbar: Boolean, 5 | cancelButtonText: { 6 | type: String, 7 | value: '取消' 8 | }, 9 | confirmButtonText: { 10 | type: String, 11 | value: '确认' 12 | }, 13 | visibleItemCount: { 14 | type: Number, 15 | value: 5 16 | }, 17 | itemHeight: { 18 | type: Number, 19 | value: 44 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | .container { 3 | background: #fff; 4 | height: 100vh; 5 | overflow: hidden; 6 | } 7 | .gh-head { 8 | display: flex; 9 | flex-direction: column; 10 | height: 100%; 11 | } 12 | .gh-tab { 13 | padding: 0 40rpx; 14 | flex: 0 0 70rpx; 15 | } 16 | .ad-container { 17 | flex: 0 0 50rpx; 18 | /* justify-self: center; 19 | width: 100%; */ 20 | } 21 | .gh-tab-item { 22 | display: inline-block; 23 | font-size: 32rpx; 24 | padding-bottom: 10rpx; 25 | margin-right: 30rpx; 26 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/button.js: -------------------------------------------------------------------------------- 1 | export const button = Behavior({ 2 | externalClasses: ['hover-class'], 3 | properties: { 4 | id: String, 5 | lang: { 6 | type: String, 7 | value: 'en' 8 | }, 9 | businessId: Number, 10 | sessionFrom: String, 11 | sendMessageTitle: String, 12 | sendMessagePath: String, 13 | sendMessageImg: String, 14 | showMessageCard: Boolean, 15 | appParameter: String, 16 | ariaLabel: String 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /pages/index/repo-all/repo-all.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-search": "../../../miniprogram_npm/vant-weapp/search/index", 5 | "van-button": "../../../miniprogram_npm/vant-weapp/button/index", 6 | "van-row": "../../../miniprogram_npm/vant-weapp/row/index", 7 | "van-col": "../../../miniprogram_npm/vant-weapp/col/index", 8 | "van-icon": "../../../miniprogram_npm/vant-weapp/icon/index", 9 | "no-data": "../../../components/nodata/nodata", 10 | "van-loading": "../../../miniprogram_npm/vant-weapp/loading/index" 11 | } 12 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/datetime-picker/index.wxml: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch-cell/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 19 | 20 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/slider/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;background-color:#e5e5e5}.van-slider__bar{position:relative;border-radius:inherit;background-color:#1989fa}.van-slider__button{width:20px;height:20px;border-radius:50%;background-color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.5)}.van-slider__button-wrapper{position:absolute;top:50%;right:0;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0)}.van-slider__button-wrapper:after{content:"";position:absolute;width:200%;height:200%;top:-50%;left:-50%}.van-slider--disabled{opacity:.3} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/area/index.wxml: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/overlay/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | show: Boolean, 5 | mask: Boolean, 6 | customStyle: String, 7 | duration: { 8 | type: [Number, Object], 9 | value: 300 10 | }, 11 | zIndex: { 12 | type: Number, 13 | value: 1 14 | } 15 | }, 16 | methods: { 17 | onClick() { 18 | this.$emit('click'); 19 | }, 20 | // for prevent touchmove 21 | noop() { } 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker/shared.d.ts: -------------------------------------------------------------------------------- 1 | export declare const pickerProps: { 2 | title: StringConstructor; 3 | loading: BooleanConstructor; 4 | showToolbar: BooleanConstructor; 5 | cancelButtonText: { 6 | type: StringConstructor; 7 | value: string; 8 | }; 9 | confirmButtonText: { 10 | type: StringConstructor; 11 | value: string; 12 | }; 13 | visibleItemCount: { 14 | type: NumberConstructor; 15 | value: number; 16 | }; 17 | itemHeight: { 18 | type: NumberConstructor; 19 | value: number; 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /utils/util.wxs: -------------------------------------------------------------------------------- 1 | // 时间转换 2 | var formatTime = function (date) { 3 | var date = getDate(date) || getDate() 4 | var year = date.getFullYear() 5 | var month = date.getMonth() + 1 6 | var day = date.getDate() 7 | var hour = date.getHours() 8 | var minute = date.getMinutes() 9 | var second = date.getSeconds() 10 | 11 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 12 | } 13 | 14 | var formatNumber = function (n) { 15 | n = n.toString() 16 | return n[1] ? n : '0' + n 17 | } 18 | 19 | module.exports = { 20 | formatTime: formatTime 21 | } -------------------------------------------------------------------------------- /custom-tab-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 仓库 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-badge{display:block;padding:20px 12px 20px 9px;overflow:hidden;font-size:14px;line-height:1.4;color:#7d7e80;word-break:break-all;background-color:#f8f8f8;border-left:3px solid transparent;box-sizing:border-box;-webkit-user-select:none;user-select:none}.van-badge--hover{background-color:#f2f3f5}.van-badge:after{border-bottom-width:1px}.van-badge--active{font-weight:700;color:#333;border-color:#f44}.van-badge--active:after{border-right-width:1px}.van-badge--active,.van-badge--active.van-badge--hover{background-color:#fff}.van-badge__text{position:relative} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/panel/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/progress/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { BLUE } from '../common/color'; 3 | VantComponent({ 4 | props: { 5 | inactive: Boolean, 6 | percentage: Number, 7 | pivotText: String, 8 | pivotColor: String, 9 | showPivot: { 10 | type: Boolean, 11 | value: true 12 | }, 13 | color: { 14 | type: String, 15 | value: BLUE 16 | }, 17 | textColor: { 18 | type: String, 19 | value: '#fff' 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/icon/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 13 | 18 | 19 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/progress/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 13 | {{ getters.text(pivotText, percentage) }} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 简述 2 | 3 | github-search利用GitHub开放API开发的一个便携式查看开源仓库和个人仓库的的小程序 4 | 5 | # github-search小应用 6 | * 微信小程序原生实现 7 | * UI用的是有赞的vant-weapp(https://youzan.github.io/vant-weapp/#/intro) 8 | * 数据接口用的是GitHub的开放的API(https://developer.github.com/v3/) 9 | * 接口请求封装的库用的是Flyio(https://wendux.github.io/dist/#/doc/flyio/redirect) 10 | * 图标库icon用的是阿里云的icon图标(https://www.iconfont.cn/manage/index?spm=a313x.7781069.1998910419.db775f1f3&manage_type=myprojects&projectId=1276755&keyword=) 11 | 12 | # 微信扫一扫使用 13 | ![](https://raw.githubusercontent.com/chenjiaobin/github-search/master/assets/img/weapp.jpg) 14 | 15 | 16 | ~如果觉得还OK,点个赞👍再走呗😀 17 | 18 | 19 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar-item/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-tabbar-item{color:#7d7e80;height:100%;display:-webkit-flex;display:flex;line-height:1;font-size:12px;-webkit-align-items:center;align-items:center;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center}.van-tabbar-item__icon{font-size:18px;margin-bottom:5px;position:relative}.van-tabbar-item__icon--dot:after{top:0;right:-8px;width:8px;height:8px;content:" ";position:absolute;border-radius:100%;background-color:#f44}.van-tabbar-item__icon image{width:30px;height:18px;display:block}.van-tabbar-item--active{color:#1989fa} -------------------------------------------------------------------------------- /pages/repositories/repositories.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-row": "../../miniprogram_npm/vant-weapp/row/index", 4 | "van-col": "../../miniprogram_npm/vant-weapp/col/index", 5 | "no-data": "../../components/nodata/nodata", 6 | "van-loading": "../../miniprogram_npm/vant-weapp/loading/index", 7 | "van-tag": "../../miniprogram_npm/vant-weapp/tag/index", 8 | "van-icon": "../../miniprogram_npm/vant-weapp/icon/index", 9 | "van-picker": "../../miniprogram_npm/vant-weapp/picker/index", 10 | "van-popup": "../../miniprogram_npm/vant-weapp/popup/index", 11 | "van-button": "../../miniprogram_npm/vant-weapp/button/index" 12 | } 13 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/col/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'row', 5 | type: 'ancestor' 6 | }, 7 | props: { 8 | span: Number, 9 | offset: Number 10 | }, 11 | data: { 12 | style: '' 13 | }, 14 | methods: { 15 | setGutter(gutter) { 16 | const padding = `${gutter / 2}px`; 17 | const style = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : ''; 18 | if (style !== this.data.style) { 19 | this.set({ style }); 20 | } 21 | } 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-icon/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { link } from '../mixins/link'; 3 | import { button } from '../mixins/button'; 4 | import { openType } from '../mixins/open-type'; 5 | VantComponent({ 6 | classes: ['icon-class', 'text-class'], 7 | mixins: [link, button, openType], 8 | props: { 9 | text: String, 10 | info: String, 11 | icon: String, 12 | disabled: Boolean, 13 | loading: Boolean 14 | }, 15 | methods: { 16 | onClick(event) { 17 | this.$emit('click', event.detail); 18 | this.jumpLink(); 19 | } 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ---> Node 2 | # Logs 3 | logs 4 | *.log 5 | npm-debug.log* 6 | 7 | # Runtime data 8 | pids 9 | *.pid 10 | *.seed 11 | 12 | # Directory for instrumented libs generated by jscoverage/JSCover 13 | lib-cov 14 | 15 | # Coverage directory used by tools like istanbul 16 | coverage 17 | 18 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 19 | .grunt 20 | 21 | # node-waf configuration 22 | .lock-wscript 23 | 24 | # Compiled binary addons (http://nodejs.org/api/addons.html) 25 | build/Release 26 | 27 | # Dependency directory 28 | # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git 29 | node_modules 30 | 31 | .idea 32 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-button/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { link } from '../mixins/link'; 3 | import { button } from '../mixins/button'; 4 | import { openType } from '../mixins/open-type'; 5 | VantComponent({ 6 | mixins: [link, button, openType], 7 | props: { 8 | text: String, 9 | loading: Boolean, 10 | disabled: Boolean, 11 | type: { 12 | type: String, 13 | value: 'danger' 14 | } 15 | }, 16 | methods: { 17 | onClick(event) { 18 | this.$emit('click', event.detail); 19 | this.jumpLink(); 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/search/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-search{padding:10px 16px;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search,.van-search__content{display:-webkit-flex;display:flex}.van-search__content{padding-left:10px;background-color:#f7f8fa;border-radius:2px;-webkit-flex:1;flex:1}.van-search__content--round{border-radius:17px}.van-search__label{padding:0 5px;font-size:14px;line-height:34px;color:#333}.van-search__field{-webkit-flex:1;flex:1}.van-search__field__left-icon{color:#999}.van-search--withaction{padding-right:0}.van-search__action{padding:0 10px;font-size:14px;line-height:34px;color:#333}.van-search__action--hover{background-color:#f2f3f5} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-switch{display:inline-block;position:relative;width:2em;border:1px solid rgba(0,0,0,.1);border-radius:1em;box-sizing:initial;transition:background-color .3s}.van-switch,.van-switch__node{height:1em;background-color:#fff}.van-switch__node{top:0;left:0;position:absolute;border-radius:100%;width:1em;z-index:1;transition:.3s;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05)}.van-switch__loading{top:25%;left:25%;position:absolute!important}.van-switch--on{background-color:#1989fa}.van-switch--on .van-switch__node{-webkit-transform:translateX(1em);transform:translateX(1em)}.van-switch--disabled{opacity:.4} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/swipe-cell/index.wxml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse-item/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:.3s}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c9c9c9!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__wrapper--transition{transition:height .3s ease-in-out}.van-collapse-item__content{padding:15px;font-size:13px;line-height:1.5;color:#999;background-color:#fff} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/observer/props.js: -------------------------------------------------------------------------------- 1 | export function observeProps(props) { 2 | if (!props) { 3 | return; 4 | } 5 | Object.keys(props).forEach(key => { 6 | let prop = props[key]; 7 | if (prop === null || !('type' in prop)) { 8 | prop = { type: prop }; 9 | } 10 | let { observer } = prop; 11 | prop.observer = function () { 12 | if (observer) { 13 | if (typeof observer === 'string') { 14 | observer = this[observer]; 15 | } 16 | observer.apply(this, arguments); 17 | } 18 | this.set(); 19 | }; 20 | props[key] = prop; 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/nav-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-nav-bar{position:relative;height:44px;line-height:44px;text-align:center;background-color:#fff;-webkit-user-select:none;user-select:none}.van-nav-bar__text{display:inline-block;padding:0 15px;margin:0 -15px;color:#1989fa;vertical-align:middle}.van-nav-bar__text--hover{background-color:#f2f3f5}.van-nav-bar__arrow{color:#1989fa;vertical-align:middle}.van-nav-bar__arrow+.van-nav-bar__text{padding-left:25px;margin-left:-20px}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar__title{max-width:60%;margin:0 auto;font-size:16px;font-weight:500}.van-nav-bar__left,.van-nav-bar__right{position:absolute;bottom:0;font-size:14px}.van-nav-bar__left{left:15px}.van-nav-bar__right{right:15px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/toast/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | show: Boolean, 5 | mask: Boolean, 6 | message: String, 7 | forbidClick: Boolean, 8 | zIndex: { 9 | type: Number, 10 | value: 1000 11 | }, 12 | type: { 13 | type: String, 14 | value: 'text' 15 | }, 16 | loadingType: { 17 | type: String, 18 | value: 'circular' 19 | }, 20 | position: { 21 | type: String, 22 | value: 'middle' 23 | } 24 | }, 25 | methods: { 26 | // for prevent touchmove 27 | noop() { } 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /pages/about/about.wxss: -------------------------------------------------------------------------------- 1 | /* pages/about/about.wxss */ 2 | .gh-tip { 3 | padding: 40rpx 20rpx; 4 | } 5 | .gh-tip__title { 6 | text-align: center; 7 | font-size: 34rpx; 8 | } 9 | .tip-icon { 10 | font-size: 20px; 11 | margin-right: 10rpx; 12 | color: #4cd964; 13 | } 14 | .gh-tip__intro { 15 | padding: 30rpx 15rpx 0 15rpx; 16 | font-size: 30rpx; 17 | } 18 | .gh-tip__logo { 19 | font-size: 36rpx; 20 | color: green; 21 | font-style: italic; 22 | margin-right: 8rpx; 23 | } 24 | .gh-tip__content { 25 | font-size: 26rpx; 26 | color: rgb(116, 116, 116); 27 | padding-top: 30rpx; 28 | } 29 | .gh-tip__item { 30 | display: flex; 31 | margin-top: 15rpx; 32 | line-height: 40rpx; 33 | } 34 | .tip_index { 35 | flex: 50rpx 0 0; 36 | } 37 | .tip_text { 38 | flex: 1; 39 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/basic.js: -------------------------------------------------------------------------------- 1 | export const basic = Behavior({ 2 | methods: { 3 | $emit() { 4 | this.triggerEvent.apply(this, arguments); 5 | }, 6 | getRect(selector, all) { 7 | return new Promise(resolve => { 8 | wx.createSelectorQuery() 9 | .in(this)[all ? 'selectAll' : 'select'](selector) 10 | .boundingClientRect(rect => { 11 | if (all && Array.isArray(rect) && rect.length) { 12 | resolve(rect); 13 | } 14 | if (!all && rect) { 15 | resolve(rect); 16 | } 17 | }) 18 | .exec(); 19 | }); 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/open-type.js: -------------------------------------------------------------------------------- 1 | export const openType = Behavior({ 2 | properties: { 3 | openType: String 4 | }, 5 | methods: { 6 | bindGetUserInfo(event) { 7 | this.$emit('getuserinfo', event.detail); 8 | }, 9 | bindContact(event) { 10 | this.$emit('contact', event.detail); 11 | }, 12 | bindGetPhoneNumber(event) { 13 | this.$emit('getphonenumber', event.detail); 14 | }, 15 | bindError(event) { 16 | this.$emit('error', event.detail); 17 | }, 18 | bindLaunchApp(event) { 19 | this.$emit('launchapp', event.detail); 20 | }, 21 | bindOpenSetting(event) { 22 | this.$emit('opensetting', event.detail); 23 | }, 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/nav-bar/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { safeArea } from '../mixins/safe-area'; 3 | VantComponent({ 4 | mixins: [safeArea({ safeAreaInsetTop: true })], 5 | classes: ['title-class'], 6 | props: { 7 | title: String, 8 | fixed: Boolean, 9 | leftText: String, 10 | rightText: String, 11 | leftArrow: Boolean, 12 | border: { 13 | type: Boolean, 14 | value: true 15 | }, 16 | zIndex: { 17 | type: Number, 18 | value: 120 19 | } 20 | }, 21 | methods: { 22 | onClickLeft() { 23 | this.$emit('click-left'); 24 | }, 25 | onClickRight() { 26 | this.$emit('click-right'); 27 | } 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notify/notify.js: -------------------------------------------------------------------------------- 1 | import { isObj } from '../common/utils'; 2 | const defaultOptions = { 3 | selector: '#van-notify', 4 | duration: 3000 5 | }; 6 | function parseOptions(text) { 7 | return isObj(text) ? text : { text }; 8 | } 9 | function getContext() { 10 | const pages = getCurrentPages(); 11 | return pages[pages.length - 1]; 12 | } 13 | export default function Notify(options) { 14 | options = Object.assign({}, defaultOptions, parseOptions(options)); 15 | const context = options.context || getContext(); 16 | const notify = context.selectComponent(options.selector); 17 | delete options.selector; 18 | if (notify) { 19 | notify.set(options); 20 | notify.show(); 21 | } 22 | else { 23 | console.warn('未找到 van-notify 节点,请确认 selector 及 context 是否正确'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/popup/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /pages/login/login.wxss: -------------------------------------------------------------------------------- 1 | /* pages/login/login.wxss */ 2 | .gh-login { 3 | height: 100vh; 4 | } 5 | .gh-login__logo { 6 | padding-top: 100rpx; 7 | text-align: center; 8 | } 9 | .logo { 10 | width: 200rpx; 11 | height: 200rpx; 12 | } 13 | .gh-login__form { 14 | width: 80%; 15 | margin: 40rpx auto; 16 | text-align: center; 17 | } 18 | .gh-tab-item { 19 | display: inline-block; 20 | font-size: 32rpx; 21 | width: 50%; 22 | text-align: center; 23 | } 24 | .gh-swiper-login { 25 | height: 400rpx; 26 | padding: 30rpx 0; 27 | } 28 | .van-icon-self { 29 | color: #1989fa; 30 | } 31 | .field-index--van-field { 32 | border: 2rpx solid #ccc; 33 | } 34 | .ven-button-self { 35 | background-color: #4cd964!important; 36 | } 37 | .field__item { 38 | margin-bottom: 60rpx; 39 | } 40 | .dialog-index--van-dialog__cancel { 41 | color: #4cd964!important; 42 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/slider/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 12 | 19 | 23 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-radio{display:-webkit-flex;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-radio__icon-wrap,.van-radio__label{line-height:20px}.van-radio__icon-wrap{-webkit-flex:none;flex:none}.van-radio__icon{display:block;width:20px;height:20px;font-size:14px;color:transparent;text-align:center;border:1px solid #e5e5e5;box-sizing:border-box;transition:.2s}.van-radio__icon--round{border-radius:100%}.van-radio__icon--checked{color:#fff;background-color:#1989fa;border-color:#1989fa}.van-radio__icon--disabled{background-color:#eee;border-color:#c9c9c9}.van-radio__icon--disabled.van-radio__icon--checked{color:#c9c9c9}.van-radio__label{margin-left:10px;color:#333;word-break:break-all}.van-radio__label--left{float:left;margin:0 10px 0 0}.van-radio__label--disabled{color:#c9c9c9}.van-radio__label:empty{margin:0} -------------------------------------------------------------------------------- /pages/search/search.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 当前用户的Followers: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {{item.login}} 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | type: 'ancestor', 5 | name: 'badge-group', 6 | linked(target) { 7 | this.parent = target; 8 | } 9 | }, 10 | props: { 11 | info: null, 12 | title: String 13 | }, 14 | methods: { 15 | onClick() { 16 | const { parent } = this; 17 | if (!parent) { 18 | return; 19 | } 20 | const index = parent.badges.indexOf(this); 21 | parent.setActive(index).then(() => { 22 | this.$emit('click', index); 23 | parent.$emit('change', index); 24 | }); 25 | }, 26 | setActive(active) { 27 | return this.set({ active }); 28 | } 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-button/index.wxml: -------------------------------------------------------------------------------- 1 | 26 | {{ text }} 27 | 28 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notice-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-notice-bar{display:-webkit-flex;display:flex;height:40px;padding:0 15px;font-size:14px;line-height:24px;-webkit-align-items:center;align-items:center}.van-notice-bar--withicon{position:relative;padding-right:40px}.van-notice-bar--wrapable{height:auto;padding:8px 15px}.van-notice-bar--wrapable .van-notice-bar__wrap{height:auto}.van-notice-bar--wrapable .van-notice-bar__content{position:relative;white-space:normal}.van-notice-bar__left-icon{display:-webkit-flex;display:flex;margin-right:4px;vertical-align:middle;-webkit-align-items:center;align-items:center}.van-notice-bar__right-icon{position:absolute;top:10px;right:15px;font-size:16px}.van-notice-bar__wrap{position:relative;height:24px;overflow:hidden;-webkit-flex:1;flex:1}.van-notice-bar__content{position:absolute;white-space:nowrap}.van-notice-bar__content.van-ellipsis{max-width:100%} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/action-sheet/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-action-sheet{max-height:90%!important;color:#333}.van-action-sheet__cancel,.van-action-sheet__item{height:50px;font-size:16px;line-height:50px;text-align:center;background-color:#fff}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5}.van-action-sheet__cancel{height:60px}.van-action-sheet__cancel:before{display:block;height:10px;background-color:#f8f8f8;content:" "}.van-action-sheet__item--disabled{color:#c9c9c9}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff}.van-action-sheet__subname{margin-left:5px;font-size:12px;color:#7d7e80}.van-action-sheet__header{font-size:16px;font-weight:500;line-height:44px;text-align:center}.van-action-sheet__close{position:absolute!important;top:0;right:0;padding:0 15px;font-size:18px!important;line-height:inherit!important;color:#999} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/style/hairline.wxss: -------------------------------------------------------------------------------- 1 | .van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{content:" ";position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:-50%;left:-50%;right:-50%;bottom:-50%;-webkit-transform:scale(.5);transform:scale(.5);border:0 solid #eee}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:block;width:20px;height:20px;font-size:14px;color:transparent;text-align:center;border:1px solid #e5e5e5;box-sizing:border-box;transition:.2s}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;background-color:#1989fa;border-color:#1989fa}.van-checkbox__icon--disabled{background-color:#eee;border-color:#c9c9c9}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c9c9c9}.van-checkbox__label{margin-left:10px;color:#333;word-break:break-all}.van-checkbox__label--left{float:left;margin:0 10px 0 0}.van-checkbox__label--disabled{color:#c9c9c9}.van-checkbox__label:empty{margin:0} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tab/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'tabs', 5 | type: 'ancestor' 6 | }, 7 | props: { 8 | dot: Boolean, 9 | info: null, 10 | title: String, 11 | disabled: Boolean, 12 | titleStyle: String 13 | }, 14 | data: { 15 | width: null, 16 | inited: false, 17 | active: false, 18 | animated: false 19 | }, 20 | watch: { 21 | title: 'update', 22 | disabled: 'update', 23 | dot: 'update', 24 | info: 'update', 25 | titleStyle: 'update' 26 | }, 27 | methods: { 28 | update() { 29 | const parent = this.getRelationNodes('../tabs/index')[0]; 30 | if (parent) { 31 | parent.updateTabs(); 32 | } 33 | } 34 | } 35 | }); 36 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tree-select/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tree-select{position:relative;font-size:14px;-webkit-user-select:none;user-select:none}.van-tree-select__nav{position:absolute;top:0;bottom:0;left:0;width:35%;min-width:120px;background-color:#fafafa}.van-tree-select__nitem{position:relative;padding:0 9px 0 15px;line-height:44px}.van-tree-select__nitem--active:after{position:absolute;top:0;bottom:0;left:0;width:3.6px;background-color:#f44;content:""}.van-tree-select__nitem--active{font-weight:700;background-color:#fff}.van-tree-select__nitem--disabled{color:#999}.van-tree-select__content{width:65%;padding-left:15px;margin-left:35%;background-color:#fff;box-sizing:border-box}.van-tree-select__item{position:relative;font-weight:700;line-height:44px}.van-tree-select__item--active{color:#f44}.van-tree-select__item--disabled{color:#999}.van-tree-select__selected{position:absolute;top:0;right:15px;bottom:0;height:24px;margin:auto 0;line-height:24px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/toast/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;color:#fff;font-size:14px;line-height:20px;border-radius:4px;word-break:break-all;-webkit-align-items:center;align-items:center;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center;box-sizing:initial;background-color:rgba(51,51,51,.88);white-space:pre-wrap}.van-toast__container{position:fixed;top:50%;left:50%;max-width:70%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-toast--text{padding:8px 12px;min-width:96px}.van-toast--icon{width:90px;padding:15px;min-height:90px}.van-toast--icon .van-toast__icon{font-size:48px}.van-toast--icon .van-toast__text{padding-top:5px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/toast/toast.d.ts: -------------------------------------------------------------------------------- 1 | declare type ToastMessage = string | number; 2 | interface ToastOptions { 3 | show?: boolean; 4 | type?: string; 5 | mask?: boolean; 6 | zIndex?: number; 7 | context?: any; 8 | position?: string; 9 | duration?: number; 10 | selector?: string; 11 | forbidClick?: boolean; 12 | loadingType?: string; 13 | message?: ToastMessage; 14 | onClose?: () => void; 15 | } 16 | declare function Toast(toastOptions: ToastOptions | ToastMessage): Weapp.Component; 17 | declare namespace Toast { 18 | var loading: (options: string | number | ToastOptions) => Weapp.Component; 19 | var success: (options: string | number | ToastOptions) => Weapp.Component; 20 | var fail: (options: string | number | ToastOptions) => Weapp.Component; 21 | var clear: () => void; 22 | var setDefaultOptions: (options: ToastOptions) => void; 23 | var resetDefaultOptions: () => void; 24 | } 25 | export default Toast; 26 | -------------------------------------------------------------------------------- /pages/repo-detail/repo-detail.wxss: -------------------------------------------------------------------------------- 1 | /* pages/repo-detail/repo-detail.wxss */ 2 | .gh-step-color .van-step { 3 | color: #000; 4 | } 5 | .gh-step-color .van-step__circle { 6 | background-color: #4cd964; 7 | } 8 | .gh-step-color .van-step__title view:nth-child(2) { 9 | color: #707070; 10 | } 11 | .gh-refresh { 12 | position: fixed; 13 | bottom: 250rpx; 14 | right: 50rpx; 15 | background: rgb(241, 241, 241); 16 | color: #000; 17 | border: 1px solid rgb(241, 241, 241); 18 | border-radius: 50%; 19 | width: 70rpx; 20 | height: 70rpx; 21 | text-align: center; 22 | line-height: 70rpx; 23 | } 24 | 25 | .start { 26 | animation: fade-in .5s forwards 27 | } 28 | @keyframes fade-in { 29 | 0% { 30 | opacity: 0; 31 | } 32 | 33 | 100% { 34 | opacity: 1; 35 | } 36 | } 37 | 38 | .end { 39 | animation: fade-out .5s forwards 40 | } 41 | @keyframes fade-out{ 42 | 0% { 43 | opacity: 1; 44 | } 45 | 46 | 100% { 47 | opacity: 0; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/wxs/bem.wxs: -------------------------------------------------------------------------------- 1 | var array = require('./array.wxs'); 2 | var object = require('./object.wxs'); 3 | var PREFIX = 'van-'; 4 | 5 | function join(name, mods) { 6 | name = PREFIX + name; 7 | mods = mods.map(function(mod) { 8 | return name + '--' + mod; 9 | }); 10 | mods.unshift(name); 11 | return mods.join(' '); 12 | } 13 | 14 | function traversing(mods, conf) { 15 | if (!conf) { 16 | return; 17 | } 18 | 19 | if (typeof conf === 'string' || typeof conf === 'number') { 20 | mods.push(conf); 21 | } else if (array.isArray(conf)) { 22 | conf.forEach(function(item) { 23 | traversing(mods, item); 24 | }); 25 | } else if (typeof conf === 'object') { 26 | object.keys(conf).forEach(function(key) { 27 | conf[key] && mods.push(key); 28 | }); 29 | } 30 | } 31 | 32 | function bem(name, conf) { 33 | var mods = []; 34 | traversing(mods, conf); 35 | return join(name, mods); 36 | } 37 | 38 | module.exports.bem = bem; 39 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/submit-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-submit-bar{position:fixed;bottom:0;left:0;z-index:100;width:100%;-webkit-user-select:none;user-select:none}.van-submit-bar__tip{padding:10px;font-size:12px;line-height:1.5;color:#f56723;background-color:#fff7cc}.van-submit-bar__tip:empty{display:none}.van-submit-bar__tip-icon{width:12px;height:12px;margin-right:4px;vertical-align:middle}.van-submit-bar__tip-text{display:inline;vertical-align:middle}.van-submit-bar__bar{display:-webkit-flex;display:flex;height:50px;font-size:14px;background-color:#fff;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-end;justify-content:flex-end}.van-submit-bar__bar--safe{padding-bottom:34px}.van-submit-bar__text{padding-right:12px;font-weight:500;color:#333;-webkit-flex:1;flex:1;text-align:right}.van-submit-bar__price{font-size:18px;color:#f44}.van-submit-bar__currency{font-size:14px}.van-submit-bar__suffix-label{margin-left:5px}.van-submit-bar__button{width:110px} -------------------------------------------------------------------------------- /assets/css/main.wxss: -------------------------------------------------------------------------------- 1 | /* 文字颜色 */ 2 | .gh-green { 3 | color: #4cd964; 4 | } 5 | .gh-white { 6 | color: #ffffff; 7 | } 8 | .gh-gray { 9 | color: gray; 10 | } 11 | .gh-bold { 12 | font-weight: bold; 13 | } 14 | .gh-boder-bottom { 15 | border-bottom: 4rpx solid #4cd964; 16 | } 17 | .gh-text-small { 18 | font-size: 26rpx; 19 | } 20 | .gh-text-mid { 21 | font-size: 30rpx; 22 | } 23 | .gh-text-large { 24 | font-size: 34rpx; 25 | } 26 | .gh-page-contanin { 27 | padding: 20rpx; 28 | } 29 | .gh-swiper-box { 30 | /* height: calc(100vh - 70rpx); */ 31 | flex: 1; 32 | } 33 | .gh-swiper-box-list { 34 | /* height: calc(100vh - 140rpx) */ 35 | flex: 1; 36 | overflow-y: auto; 37 | } 38 | 39 | /* 背景色 */ 40 | .gh-bg-green { 41 | color: #4cd964; 42 | } 43 | .gh-bg-white { 44 | background: #ffffff; 45 | } 46 | .clearfix::after { 47 | content: ''; 48 | height: 0; 49 | clear: both; 50 | display: block; 51 | visibility: hidden; 52 | } 53 | .clearfix { 54 | zoom: 1; 55 | } 56 | 57 | 58 | -------------------------------------------------------------------------------- /custom-tab-bar/index.wxss: -------------------------------------------------------------------------------- 1 | /* 引入iconfont字体文件 */ 2 | @import "../assets/font/font.wxss"; 3 | /* 引入基础样式文件 */ 4 | @import "../assets/css/main.wxss"; 5 | 6 | .gh-bar { 7 | display: flex; 8 | justify-content: space-around; 9 | align-items: center; 10 | font-size: 26rpx; 11 | border-top: 2rpx solid #eaecef; 12 | padding: 10rpx 0; 13 | height: 84rpx; 14 | } 15 | .gh-bar__item { 16 | flex: 1; 17 | text-align: center; 18 | } 19 | .gh-bar__avatar-out { 20 | position: relative; 21 | } 22 | .gh-bar__avatar-inner { 23 | position: absolute; 24 | top: -100rpx; 25 | left: 50%; 26 | margin-left: -48rpx; 27 | font-size: 100rpx; 28 | width: 96rpx; 29 | height: 104rpx; 30 | background: #ffffff; 31 | border-radius: 50%; 32 | animation:circleRoate 5s ; 33 | animation-timing-function:linear; 34 | animation-iteration-count: infinite; 35 | } 36 | @keyframes circleRoate{ 37 | from{ 38 | transform: rotate(0deg) infinite; 39 | } 40 | to{ 41 | transform: rotate(360deg); 42 | } 43 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/stepper/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 21 | 27 | 28 | -------------------------------------------------------------------------------- /pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | {{item}} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tag/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { RED, BLUE, GREEN } from '../common/color'; 3 | const DEFAULT_COLOR = '#999'; 4 | const COLOR_MAP = { 5 | danger: RED, 6 | primary: BLUE, 7 | success: GREEN 8 | }; 9 | VantComponent({ 10 | props: { 11 | size: String, 12 | type: String, 13 | mark: Boolean, 14 | color: String, 15 | plain: Boolean, 16 | round: Boolean, 17 | textColor: String 18 | }, 19 | computed: { 20 | style() { 21 | const color = this.data.color || COLOR_MAP[this.data.type] || DEFAULT_COLOR; 22 | const key = this.data.plain ? 'color' : 'background-color'; 23 | const style = { [key]: color }; 24 | if (this.data.textColor) { 25 | style.color = this.data.textColor; 26 | } 27 | return Object.keys(style).map(key => `${key}: ${style[key]}`).join(';'); 28 | } 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/card/index.js: -------------------------------------------------------------------------------- 1 | import { link } from '../mixins/link'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | classes: [ 5 | 'num-class', 6 | 'desc-class', 7 | 'thumb-class', 8 | 'title-class', 9 | 'price-class', 10 | 'origin-price-class', 11 | ], 12 | mixins: [link], 13 | props: { 14 | tag: String, 15 | num: String, 16 | desc: String, 17 | thumb: String, 18 | title: String, 19 | price: String, 20 | centered: Boolean, 21 | lazyLoad: Boolean, 22 | thumbLink: String, 23 | originPrice: String, 24 | thumbMode: { 25 | type: String, 26 | value: 'aspectFit' 27 | }, 28 | currency: { 29 | type: String, 30 | value: '¥' 31 | } 32 | }, 33 | methods: { 34 | onClickThumb() { 35 | this.jumpLink('thumbLink'); 36 | } 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/dialog/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-dialog{width:85%;overflow:hidden;font-size:16px;background-color:#fff;border-radius:4px}.van-dialog__header{padding-top:25px;font-weight:500;text-align:center}.van-dialog__header--isolated{padding:25px 0}.van-dialog__message{max-height:60vh;padding:25px;overflow-y:auto;font-size:14px;line-height:1.5;text-align:center;-webkit-overflow-scrolling:touch}.van-dialog__message--has-title{padding-top:12px;color:#7d7e80}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__footer{display:-webkit-flex;display:flex}.van-dialog__button{-webkit-flex:1;flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog__confirm{color:#1989fa!important}.van-dialog-bounce-enter{opacity:0;-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7)}.van-dialog-bounce-leave-active{opacity:0;-webkit-transform:translate3d(-50%,-50%,0) scale(.9);transform:translate3d(-50%,-50%,0) scale(.9)} -------------------------------------------------------------------------------- /pages/webview/webview.js: -------------------------------------------------------------------------------- 1 | // pages/webview/webview.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | outSrc: null 9 | }, 10 | 11 | /** 12 | * 生命周期函数--监听页面加载 13 | */ 14 | onLoad: function (options) { 15 | this.setData({ 16 | outSrc: options.outsrc 17 | }) 18 | }, 19 | 20 | /** 21 | * 生命周期函数--监听页面初次渲染完成 22 | */ 23 | onReady: function () { 24 | 25 | }, 26 | 27 | /** 28 | * 生命周期函数--监听页面显示 29 | */ 30 | onShow: function () { 31 | 32 | }, 33 | 34 | /** 35 | * 生命周期函数--监听页面隐藏 36 | */ 37 | onHide: function () { 38 | 39 | }, 40 | 41 | /** 42 | * 生命周期函数--监听页面卸载 43 | */ 44 | onUnload: function () { 45 | 46 | }, 47 | 48 | /** 49 | * 页面相关事件处理函数--监听用户下拉动作 50 | */ 51 | onPullDownRefresh: function () { 52 | 53 | }, 54 | 55 | /** 56 | * 页面上拉触底事件的处理函数 57 | */ 58 | onReachBottom: function () { 59 | 60 | }, 61 | 62 | /** 63 | * 用户点击右上角分享 64 | */ 65 | onShareAppMessage: function () { 66 | 67 | } 68 | }) -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell/index.js: -------------------------------------------------------------------------------- 1 | import { link } from '../mixins/link'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | classes: [ 5 | 'title-class', 6 | 'label-class', 7 | 'value-class', 8 | 'right-icon-class', 9 | 'hover-class' 10 | ], 11 | mixins: [link], 12 | props: { 13 | title: null, 14 | value: null, 15 | icon: String, 16 | size: String, 17 | label: String, 18 | center: Boolean, 19 | isLink: Boolean, 20 | required: Boolean, 21 | clickable: Boolean, 22 | titleWidth: String, 23 | customStyle: String, 24 | arrowDirection: String, 25 | useLabelSlot: Boolean, 26 | border: { 27 | type: Boolean, 28 | value: true 29 | } 30 | }, 31 | methods: { 32 | onClick(event) { 33 | this.$emit('click', event.detail); 34 | this.jumpLink(); 35 | } 36 | } 37 | }); 38 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/observer/index.js: -------------------------------------------------------------------------------- 1 | import { behavior } from './behavior'; 2 | import { observeProps } from './props'; 3 | export function observe(vantOptions, options) { 4 | const { watch, computed } = vantOptions; 5 | options.behaviors.push(behavior); 6 | if (watch) { 7 | const props = options.properties || {}; 8 | Object.keys(watch).forEach(key => { 9 | if (key in props) { 10 | let prop = props[key]; 11 | if (prop === null || !('type' in prop)) { 12 | prop = { type: prop }; 13 | } 14 | prop.observer = watch[key]; 15 | props[key] = prop; 16 | } 17 | }); 18 | options.properties = props; 19 | } 20 | if (computed) { 21 | options.methods = options.methods || {}; 22 | options.methods.$options = () => vantOptions; 23 | if (options.properties) { 24 | observeProps(options.properties); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/touch.js: -------------------------------------------------------------------------------- 1 | export const touch = Behavior({ 2 | methods: { 3 | touchStart(event) { 4 | const touch = event.touches[0]; 5 | this.direction = ''; 6 | this.deltaX = 0; 7 | this.deltaY = 0; 8 | this.offsetX = 0; 9 | this.offsetY = 0; 10 | this.startX = touch.clientX; 11 | this.startY = touch.clientY; 12 | }, 13 | touchMove(event) { 14 | const touch = event.touches[0]; 15 | this.deltaX = touch.clientX - this.startX; 16 | this.deltaY = touch.clientY - this.startY; 17 | this.offsetX = Math.abs(this.deltaX); 18 | this.offsetY = Math.abs(this.deltaY); 19 | this.direction = 20 | this.offsetX > this.offsetY 21 | ? 'horizontal' 22 | : this.offsetX < this.offsetY 23 | ? 'vertical' 24 | : ''; 25 | } 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch-cell/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | props: { 5 | value: null, 6 | title: String, 7 | border: Boolean, 8 | checked: Boolean, 9 | loading: Boolean, 10 | disabled: Boolean, 11 | activeColor: String, 12 | inactiveColor: String, 13 | size: { 14 | type: String, 15 | value: '24px' 16 | }, 17 | activeValue: { 18 | type: null, 19 | value: true 20 | }, 21 | inactiveValue: { 22 | type: null, 23 | value: false 24 | } 25 | }, 26 | watch: { 27 | checked(value) { 28 | this.set({ value }); 29 | } 30 | }, 31 | created() { 32 | this.set({ value: this.data.checked }); 33 | }, 34 | methods: { 35 | onChange(event) { 36 | this.$emit('change', event.detail); 37 | } 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/toast/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 16 | 17 | {{ message }} 18 | 19 | 20 | 21 | 27 | 28 | {{ message }} 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/button/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { button } from '../mixins/button'; 3 | import { openType } from '../mixins/open-type'; 4 | VantComponent({ 5 | mixins: [button, openType], 6 | classes: ['hover-class', 'loading-class'], 7 | props: { 8 | plain: Boolean, 9 | block: Boolean, 10 | round: Boolean, 11 | square: Boolean, 12 | loading: Boolean, 13 | hairline: Boolean, 14 | disabled: Boolean, 15 | loadingText: String, 16 | type: { 17 | type: String, 18 | value: 'default' 19 | }, 20 | size: { 21 | type: String, 22 | value: 'normal' 23 | }, 24 | loadingSize: { 25 | type: String, 26 | value: '20px' 27 | } 28 | }, 29 | methods: { 30 | onClick() { 31 | if (!this.data.disabled && !this.data.loading) { 32 | this.$emit('click'); 33 | } 34 | } 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/rate/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 13 | 21 | 22 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/row/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'col', 5 | type: 'descendant', 6 | linked(target) { 7 | if (this.data.gutter) { 8 | target.setGutter(this.data.gutter); 9 | } 10 | } 11 | }, 12 | props: { 13 | gutter: Number 14 | }, 15 | watch: { 16 | gutter: 'setGutter' 17 | }, 18 | mounted() { 19 | if (this.data.gutter) { 20 | this.setGutter(); 21 | } 22 | }, 23 | methods: { 24 | setGutter() { 25 | const { gutter } = this.data; 26 | const margin = `-${Number(gutter) / 2}px`; 27 | const style = gutter 28 | ? `margin-right: ${margin}; margin-left: ${margin};` 29 | : ''; 30 | this.set({ style }); 31 | this.getRelationNodes('../col/index').forEach(col => { 32 | col.setGutter(this.data.gutter); 33 | }); 34 | } 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/card/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-card{position:relative;padding:5px 15px;font-size:12px;color:#333;background-color:#fafafa;box-sizing:border-box}.van-card__header{display:-webkit-flex;display:flex}.van-card__header--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{position:relative;width:90px;height:90px;margin-right:10px;-webkit-flex:none;flex:none}.van-card__thumb:empty{display:none}.van-card__img{width:100%;height:100%}.van-card__content{position:relative;min-width:0;-webkit-flex:1;flex:1}.van-card__desc,.van-card__title{word-break:break-all}.van-card__title{font-weight:700;line-height:16px}.van-card__desc{color:#7d7e80}.van-card__bottom,.van-card__desc{line-height:20px}.van-card__price{display:inline-block;font-weight:700;color:#f44}.van-card__origin-price{display:inline-block;margin-left:5px;font-size:10px;color:#7d7e80;text-decoration:line-through}.van-card__num{float:right}.van-card__tag{position:absolute;top:2px;left:0}.van-card__footer{width:100%;text-align:right;-webkit-flex:none;flex:none} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notice-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 15 | 16 | 17 | 18 | {{ text }} 19 | 20 | 21 | 22 | 28 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-picker{position:relative;overflow:hidden;-webkit-text-size-adjust:100%;background-color:#fff;-webkit-user-select:none;user-select:none}.van-picker__toolbar{display:-webkit-flex;display:flex;height:44px;line-height:44px;-webkit-justify-content:space-between;justify-content:space-between}.van-picker__cancel,.van-picker__confirm{padding:0 15px;font-size:14px;color:#1989fa}.van-picker__cancel--hover,.van-picker__confirm--hover{background-color:#f2f3f5}.van-picker__title{max-width:50%;font-size:16px;font-weight:500;text-align:center}.van-picker__columns{position:relative;display:-webkit-flex;display:flex}.van-picker__column{-webkit-flex:1 1;flex:1 1;width:0}.van-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:4;display:-webkit-flex;display:flex;background-color:hsla(0,0%,100%,.9);-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-picker__frame,.van-picker__loading .van-loading{position:absolute;top:50%;left:0;z-index:1;width:100%;pointer-events:none;-webkit-transform:translateY(-50%);transform:translateY(-50%)} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker-column/index.wxml: -------------------------------------------------------------------------------- 1 | 9 | 10 | {{ getOptionText(option, valueKey) }} 19 | 20 | 21 | 22 | 23 | function isObj(x) { 24 | var type = typeof x; 25 | return x !== null && (type === 'object' || type === 'function'); 26 | } 27 | 28 | module.exports = function (option, valueKey) { 29 | return isObj(option) && option[valueKey] ? option[valueKey] : option; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/goods-action-icon/index.wxml: -------------------------------------------------------------------------------- 1 | 25 | 26 | 33 | {{ text }} 34 | 35 | 36 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/action-sheet/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { safeArea } from '../mixins/safe-area'; 3 | VantComponent({ 4 | mixins: [safeArea()], 5 | props: { 6 | show: Boolean, 7 | title: String, 8 | cancelText: String, 9 | zIndex: { 10 | type: Number, 11 | value: 100 12 | }, 13 | actions: { 14 | type: Array, 15 | value: [] 16 | }, 17 | overlay: { 18 | type: Boolean, 19 | value: true 20 | }, 21 | closeOnClickOverlay: { 22 | type: Boolean, 23 | value: true 24 | } 25 | }, 26 | methods: { 27 | onSelect(event) { 28 | const { index } = event.currentTarget.dataset; 29 | const item = this.data.actions[index]; 30 | if (item && !item.disabled && !item.loading) { 31 | this.$emit('select', item); 32 | } 33 | }, 34 | onCancel() { 35 | this.$emit('cancel'); 36 | }, 37 | onClose() { 38 | this.$emit('close'); 39 | } 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | relation: { 5 | name: 'radio', 6 | type: 'descendant', 7 | linked(target) { 8 | this.children = this.children || []; 9 | this.children.push(target); 10 | this.updateChild(target); 11 | }, 12 | unlinked(target) { 13 | this.children = this.children.filter((child) => child !== target); 14 | } 15 | }, 16 | props: { 17 | value: { 18 | type: null, 19 | observer: 'updateChildren' 20 | }, 21 | disabled: { 22 | type: Boolean, 23 | observer: 'updateChildren' 24 | } 25 | }, 26 | methods: { 27 | updateChildren() { 28 | (this.children || []).forEach((child) => this.updateChild(child)); 29 | }, 30 | updateChild(child) { 31 | const { value, disabled } = this.data; 32 | child.set({ 33 | value, 34 | disabled: disabled || child.data.disabled 35 | }); 36 | } 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /pages/repositories/repositories.wxss: -------------------------------------------------------------------------------- 1 | /* pages/repositories/repositories.wxss */ 2 | view { 3 | word-break: break-all 4 | } 5 | .github-search_list { 6 | padding: 20rpx; 7 | } 8 | .search_item { 9 | margin-bottom: 20rpx; 10 | padding-bottom: 16rpx; 11 | border-bottom: 1px solid #eaecef; 12 | } 13 | .no-data__type { 14 | text-align: center; 15 | } 16 | .van-tag__text { 17 | margin-bottom: 30rpx; 18 | } 19 | .search_item__fullname { 20 | color: #0366d6; 21 | } 22 | .search_item__language { 23 | font-size: 32rpx; 24 | padding: 10rpx 0; 25 | } 26 | .search_item__description { 27 | font-size: 28rpx; 28 | } 29 | .search_item__description .van-col{ 30 | display: -webkit-box; 31 | -webkit-box-orient: vertical; 32 | -webkit-line-clamp: 3; 33 | overflow: hidden; 34 | } 35 | .search_item__starAndFork { 36 | text-align: right; 37 | } 38 | .star, .fork { 39 | display: inline-block; 40 | font-size: 28rpx; 41 | } 42 | .star { 43 | margin-right: 20rpx; 44 | } 45 | .star__title { 46 | color: orange; 47 | font-weight: bold; 48 | } 49 | .fork__title { 50 | color: cornflowerblue; 51 | font-weight: bold; 52 | } 53 | .github__sort { 54 | margin-bottom: 16rpx; 55 | font-size: 34rpx; 56 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/index.wxss: -------------------------------------------------------------------------------- 1 | .van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{content:"";display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{content:" ";position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:-50%;left:-50%;right:-50%;bottom:-50%;-webkit-transform:scale(.5);transform:scale(.5);border:0 solid #eee}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/wxs/memoize.wxs: -------------------------------------------------------------------------------- 1 | /** 2 | * Simple memoize 3 | * wxs doesn't support fn.apply, so this memoize only support up to 2 args 4 | */ 5 | 6 | function isPrimitive(value) { 7 | var type = typeof value; 8 | return ( 9 | type === 'boolean' || 10 | type === 'number' || 11 | type === 'string' || 12 | type === 'undefined' || 13 | value === null 14 | ); 15 | } 16 | 17 | // mock simple fn.call in wxs 18 | function call(fn, args) { 19 | if (args.length === 2) { 20 | return fn(args[0], args[1]); 21 | } 22 | 23 | if (args.length === 1) { 24 | return fn(args[0]); 25 | } 26 | 27 | return fn(); 28 | } 29 | 30 | function serializer(args) { 31 | if (args.length === 1 && isPrimitive(args[0])) { 32 | return args[0]; 33 | } 34 | var obj = {}; 35 | for (var i = 0; i < args.length; i++) { 36 | obj['key' + i] = args[i]; 37 | } 38 | return JSON.stringify(obj); 39 | } 40 | 41 | function memoize(fn) { 42 | var cache = {}; 43 | 44 | return function() { 45 | var key = serializer(arguments); 46 | if (cache[key] === undefined) { 47 | cache[key] = call(fn, arguments); 48 | } 49 | 50 | return cache[key]; 51 | }; 52 | } 53 | 54 | module.exports.memoize = memoize; 55 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index", 4 | "pages/login/login", 5 | "pages/me/me", 6 | "pages/about/about", 7 | "pages/search/search", 8 | "pages/webview/webview", 9 | "pages/repositories/repositories", 10 | "pages/repo-detail/repo-detail" 11 | ], 12 | "window": { 13 | "backgroundTextStyle": "light", 14 | "navigationBarBackgroundColor": "#fff", 15 | "navigationBarTitleText": "GitHub小应用", 16 | "navigationBarTextStyle": "black" 17 | }, 18 | "tabBar": { 19 | "color": "#bfbfbf", 20 | "selectedColor": "#4cd964", 21 | "backgroundColor": "#ffffff", 22 | "list": [ 23 | { 24 | "pagePath": "pages/index/index", 25 | "iconPath": "assets/img/tabbar/gh-chanku.png", 26 | "selectedIconPath": "assets/img/tabbar/gh-chanku-active.png", 27 | "text": "仓库" 28 | }, 29 | { 30 | "pagePath": "pages/me/me", 31 | "iconPath": "assets/img/tabbar/gh-me.png", 32 | "selectedIconPath": "assets/img/tabbar/gh-me-active.png", 33 | "text": "我" 34 | } 35 | ] 36 | }, 37 | "navigateToMiniProgramAppIdList": [ 38 | "wx8abaf00ee8c3202e", 39 | "wxdc8cbe6d135617ce" 40 | ], 41 | "sitemapLocation": "sitemap.json" 42 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/checkbox-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | relation: { 5 | name: 'checkbox', 6 | type: 'descendant', 7 | linked(target) { 8 | this.children = this.children || []; 9 | this.children.push(target); 10 | this.updateChild(target); 11 | }, 12 | unlinked(target) { 13 | this.children = this.children.filter((child) => child !== target); 14 | } 15 | }, 16 | props: { 17 | max: Number, 18 | value: { 19 | type: Array, 20 | observer: 'updateChildren' 21 | }, 22 | disabled: { 23 | type: Boolean, 24 | observer: 'updateChildren' 25 | } 26 | }, 27 | methods: { 28 | updateChildren() { 29 | (this.children || []).forEach((child) => this.updateChild(child)); 30 | }, 31 | updateChild(child) { 32 | const { value, disabled } = this.data; 33 | child.set({ 34 | value: value.indexOf(child.data.name) !== -1, 35 | disabled: disabled || child.data.disabled 36 | }); 37 | } 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/notify/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { RED } from '../common/color'; 3 | import { safeArea } from '../mixins/safe-area'; 4 | VantComponent({ 5 | mixins: [safeArea()], 6 | props: { 7 | text: String, 8 | color: { 9 | type: String, 10 | value: '#fff' 11 | }, 12 | backgroundColor: { 13 | type: String, 14 | value: RED 15 | }, 16 | duration: { 17 | type: Number, 18 | value: 3000 19 | }, 20 | zIndex: { 21 | type: Number, 22 | value: 110 23 | } 24 | }, 25 | methods: { 26 | show() { 27 | const { duration } = this.data; 28 | clearTimeout(this.timer); 29 | this.set({ 30 | show: true 31 | }); 32 | if (duration > 0 && duration !== Infinity) { 33 | this.timer = setTimeout(() => { 34 | this.hide(); 35 | }, duration); 36 | } 37 | }, 38 | hide() { 39 | clearTimeout(this.timer); 40 | this.set({ 41 | show: false 42 | }); 43 | } 44 | } 45 | }); 46 | -------------------------------------------------------------------------------- /pages/index/index.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | import * as githubApi from '../../api/github.js' 3 | const Fly = require("../../miniprogram_npm/flyio/index.js") 4 | const http = new Fly() 5 | // http.config.headers = { 6 | // "Authorization": 'token token-key' 7 | // } 8 | 9 | //获取应用实例 10 | const app = getApp() 11 | 12 | Page({ 13 | data: { 14 | // swiper当前活动页 15 | tabCur: 0, 16 | tabItems: ['所有', '个人'], 17 | show: false 18 | }, 19 | 20 | onLoad: function () { 21 | wx.getSystemInfo({ 22 | success: function(res) { 23 | console.log(res) 24 | app.globalData.screenHeight = res.windowHeight 25 | }, 26 | }) 27 | }, 28 | 29 | /** 30 | * 用户点击右上角分享 31 | */ 32 | onShareAppMessage: function () { 33 | return { 34 | title: '欢迎使用GitHub小应用', 35 | imageUrl: '../../assets/img/share.jpg', 36 | path: '/pages/index/index' 37 | } 38 | }, 39 | 40 | // tab切换 41 | tabSelect (event) { 42 | console.log(event) 43 | let { id } = event.currentTarget.dataset 44 | this.setData({ 45 | tabCur: id 46 | }) 47 | }, 48 | 49 | // swiper切换 50 | changeTab (event) { 51 | console.log(event) 52 | let { current } = event.detail 53 | this.setData({ 54 | tabCur: current 55 | }) 56 | } 57 | }) 58 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 23 | 27 | 28 | 32 | 33 | 38 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/switch/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | classes: ['node-class'], 5 | props: { 6 | checked: null, 7 | loading: Boolean, 8 | disabled: Boolean, 9 | activeColor: String, 10 | inactiveColor: String, 11 | size: { 12 | type: String, 13 | value: '30px' 14 | }, 15 | activeValue: { 16 | type: null, 17 | value: true 18 | }, 19 | inactiveValue: { 20 | type: null, 21 | value: false 22 | } 23 | }, 24 | watch: { 25 | checked(value) { 26 | this.set({ value }); 27 | } 28 | }, 29 | created() { 30 | this.set({ value: this.data.checked }); 31 | }, 32 | methods: { 33 | onClick() { 34 | const { activeValue, inactiveValue } = this.data; 35 | if (!this.data.disabled && !this.data.loading) { 36 | const checked = this.data.checked === activeValue; 37 | const value = checked ? inactiveValue : activeValue; 38 | this.$emit('input', value); 39 | this.$emit('change', value); 40 | } 41 | } 42 | } 43 | }); 44 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/radio/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | relation: { 5 | name: 'radio-group', 6 | type: 'ancestor', 7 | linked(target) { 8 | this.parent = target; 9 | }, 10 | unlinked() { 11 | this.parent = null; 12 | } 13 | }, 14 | classes: ['icon-class', 'label-class'], 15 | props: { 16 | value: null, 17 | disabled: Boolean, 18 | useIconSlot: Boolean, 19 | checkedColor: String, 20 | labelPosition: String, 21 | labelDisabled: Boolean, 22 | shape: { 23 | type: String, 24 | value: 'round' 25 | } 26 | }, 27 | methods: { 28 | emitChange(value) { 29 | const instance = this.parent || this; 30 | instance.$emit('input', value); 31 | instance.$emit('change', value); 32 | }, 33 | onChange(event) { 34 | console.log(event); 35 | this.emitChange(this.data.name); 36 | }, 37 | onClickLabel() { 38 | const { disabled, labelDisabled, name } = this.data; 39 | if (!disabled && !labelDisabled) { 40 | this.emitChange(name); 41 | } 42 | } 43 | } 44 | }); 45 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/steps/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | {{ item.text }} 12 | {{ item.desc }} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | function get(index, active) { 25 | if (index < active) { 26 | return 'finish'; 27 | } else if (index === active) { 28 | return 'process'; 29 | } 30 | 31 | return ''; 32 | } 33 | 34 | module.exports = get; 35 | 36 | -------------------------------------------------------------------------------- /pages/me/me.wxss: -------------------------------------------------------------------------------- 1 | /* pages/me/me.wxss */ 2 | page { 3 | background: #F3F3F3; 4 | } 5 | /* .gh-me { 6 | background: #fff; 7 | } */ 8 | .label-self { 9 | font-size: 36rpx; 10 | } 11 | .customer-icon { 12 | margin-right: 10rpx; 13 | color: #4cd964; 14 | } 15 | .gh-me__info { 16 | display: flex; 17 | border-bottom: 2rpx solid #eaecef; 18 | padding: 10rpx; 19 | background: #fff; 20 | } 21 | .gh-me__avatar { 22 | flex: 150rpx 0 0; 23 | margin-right: 15rpx; 24 | } 25 | .avatar { 26 | width: 140rpx; 27 | height: 140rpx; 28 | border: 2rpx solid #fff; 29 | border-radius: 10rpx; 30 | } 31 | .gh-me__text { 32 | flex: 1; 33 | } 34 | .gh-me__text .name { 35 | margin-bottom: 15rpx; 36 | } 37 | .gh-me__text .num { 38 | font-size: 32rpx; 39 | color: gray; 40 | } 41 | .gh-me__login { 42 | line-height: 140rpx; 43 | } 44 | .gh-contact { 45 | height: 24px!important; 46 | line-height: 24px!important; 47 | text-align: left!important; 48 | padding: 0; 49 | background: transparent; 50 | font-size: 16px; 51 | } 52 | .gh-contact::after { 53 | border: none!important; 54 | } 55 | .button-hover { 56 | color: #000; 57 | } 58 | .gh-me__tab { 59 | background: #fff; 60 | } 61 | .gh-me__other { 62 | background: #fff; 63 | margin-top: 40rpx; 64 | } 65 | .ad-container { 66 | position: fixed; 67 | right: 20rpx; 68 | bottom: 120rpx; 69 | } -------------------------------------------------------------------------------- /pages/about/about.js: -------------------------------------------------------------------------------- 1 | // pages/about/about.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 | return { 65 | title: '欢迎使用GitHub小应用', 66 | imageUrl: '../../assets/img/share.jpg', 67 | path: '/pages/index/index' 68 | } 69 | }, 70 | 71 | copy (e) { 72 | let { text } = e.currentTarget.dataset 73 | wx.setClipboardData({ 74 | data: text, 75 | success () { 76 | wx.showToast({ 77 | title: '复制成功', 78 | icon: 'none' 79 | }) 80 | } 81 | }) 82 | } 83 | }) -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/safe-area.js: -------------------------------------------------------------------------------- 1 | let cache = null; 2 | function getSafeArea() { 3 | return new Promise((resolve, reject) => { 4 | if (cache != null) { 5 | resolve(cache); 6 | } 7 | else { 8 | wx.getSystemInfo({ 9 | success: ({ model, screenHeight, statusBarHeight }) => { 10 | const iphoneX = /iphone x/i.test(model); 11 | const iphoneNew = /iPhone11/i.test(model) && screenHeight === 812; 12 | cache = { 13 | isIPhoneX: iphoneX || iphoneNew, 14 | statusBarHeight 15 | }; 16 | resolve(cache); 17 | }, 18 | fail: reject 19 | }); 20 | } 21 | }); 22 | } 23 | export const safeArea = ({ safeAreaInsetBottom = true, safeAreaInsetTop = false } = {}) => Behavior({ 24 | properties: { 25 | safeAreaInsetTop: { 26 | type: Boolean, 27 | value: safeAreaInsetTop 28 | }, 29 | safeAreaInsetBottom: { 30 | type: Boolean, 31 | value: safeAreaInsetBottom 32 | } 33 | }, 34 | created() { 35 | getSafeArea().then(({ isIPhoneX, statusBarHeight }) => { 36 | this.set({ isIPhoneX, statusBarHeight }); 37 | }); 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/nav-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 15 | {{ leftText }} 21 | 22 | 23 | 24 | 25 | {{ title }} 26 | 27 | 28 | 29 | {{ rightText }} 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/field/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{position:relative;display:block;width:100%;height:24px;min-height:24px;padding:0;margin:0;line-height:inherit;color:#333;text-align:left;background-color:initial;border:0;box-sizing:border-box;resize:none}.van-field__input--disabled{color:#999;background-color:initial;opacity:1}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;left:0;color:#999;pointer-events:none}.van-field__placeholder--error{color:#f44}.van-field__icon-root{display:-webkit-flex;display:flex;min-height:24px;-webkit-align-items:center;align-items:center}.van-field__clear-root,.van-field__icon-container{padding:0 10px;margin-right:-10px;line-height:inherit;vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:10px}.van-field__button:empty{display:none}.van-field__error-message{font-size:12px;color:#f44;text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/badge-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'badge', 5 | type: 'descendant', 6 | linked(target) { 7 | this.badges.push(target); 8 | this.setActive(this.data.active); 9 | }, 10 | unlinked(target) { 11 | this.badges = this.badges.filter(item => item !== target); 12 | this.setActive(this.data.active); 13 | } 14 | }, 15 | props: { 16 | active: { 17 | type: Number, 18 | value: 0, 19 | observer: 'setActive' 20 | } 21 | }, 22 | beforeCreate() { 23 | this.badges = []; 24 | this.currentActive = -1; 25 | }, 26 | methods: { 27 | setActive(active) { 28 | const { badges, currentActive } = this; 29 | if (!badges.length) { 30 | return Promise.resolve(); 31 | } 32 | this.currentActive = active; 33 | const stack = []; 34 | if (currentActive !== active && badges[currentActive]) { 35 | stack.push(badges[currentActive].setActive(false)); 36 | } 37 | if (badges[active]) { 38 | stack.push(badges[active].setActive(true)); 39 | } 40 | return Promise.all(stack); 41 | } 42 | } 43 | }); 44 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/submit-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | {{ tip }} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | {{ label || '合计:' }} 23 | 24 | {{ currency }} 25 | {{ priceStr }} 26 | 27 | {{ suffixLabel }} 28 | 29 | 39 | {{ loading ? '' : buttonText }} 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/button/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 40 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/dialog/dialog.d.ts: -------------------------------------------------------------------------------- 1 | declare type DialogAction = 'confirm' | 'cancel'; 2 | declare type DialogOptions = { 3 | lang?: string; 4 | show?: boolean; 5 | title?: string; 6 | zIndex?: number; 7 | context?: any; 8 | message?: string; 9 | overlay?: boolean; 10 | selector?: string; 11 | ariaLabel?: string; 12 | className?: string; 13 | transition?: string; 14 | asyncClose?: boolean; 15 | businessId?: number; 16 | sessionFrom?: string; 17 | appParameter?: string; 18 | messageAlign?: string; 19 | sendMessageImg?: string; 20 | showMessageCard?: boolean; 21 | sendMessagePath?: string; 22 | sendMessageTitle?: string; 23 | confirmButtonText?: string; 24 | cancelButtonText?: string; 25 | showConfirmButton?: boolean; 26 | showCancelButton?: boolean; 27 | closeOnClickOverlay?: boolean; 28 | confirmButtonOpenType?: string; 29 | }; 30 | interface Dialog { 31 | (options: DialogOptions): Promise; 32 | alert?: (options: DialogOptions) => Promise; 33 | confirm?: (options: DialogOptions) => Promise; 34 | close?: () => void; 35 | stopLoading?: () => void; 36 | install?: () => void; 37 | setDefaultOptions?: (options: DialogOptions) => void; 38 | resetDefaultOptions?: () => void; 39 | defaultOptions?: DialogOptions; 40 | currentOptions?: DialogOptions; 41 | } 42 | declare const Dialog: Dialog; 43 | export default Dialog; 44 | -------------------------------------------------------------------------------- /utils/http.js: -------------------------------------------------------------------------------- 1 | const Fly = require("../miniprogram_npm/flyio/index.js") 2 | import { base64_encode } from './util.js' 3 | import config from './config.js' 4 | 5 | // 实例化 Fly 6 | const http = new Fly() 7 | 8 | // http 请求配置 9 | http.config.baseURL = 'https://api.github.com' 10 | 11 | http.interceptors.request.use(request => { 12 | const app = getApp() 13 | let auth = '' 14 | if (app.globalData.auth == 1) { 15 | let token = wx.getStorageSync(config.github_token) 16 | auth = token ? `token ${token}` : '' 17 | } else if (app.globalData.auth == 2) { 18 | let account = wx.getStorageSync(config.github_account) 19 | let password = wx.getStorageSync(config.github_pwd) 20 | if (account && password) { 21 | auth = 'Basic ' + base64_encode(account + ':' + password) 22 | } else { 23 | auth = '' 24 | } 25 | } 26 | request.headers = { 27 | "Authorization": auth 28 | } 29 | 30 | // 设置token,因为github有些接口是需要权限验证,token需要用户自己在github上生成(第一种认证),token-key在github上生成就行了 31 | // request.headers = { 32 | // "Authorization": 'token token-key' 33 | // } 34 | 35 | // 这种是base Auth认证,需要用户输入账号和密码(第二种认证) 36 | // request.headers = { 37 | // "Authorization": 'Basic ' + base64_encode('账号名字:密码') 38 | // } 39 | return request 40 | }) 41 | 42 | // 请求回调响应 43 | http.interceptors.response.use((res) => { 44 | let data = res 45 | if (data.status !== 200) { 46 | return Promise.reject(data.errMsg) 47 | } 48 | return data 49 | }) 50 | 51 | export default http 52 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tree-select/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | {{ item.text }} 16 | 17 | 18 | 23 | 30 | {{ item.text }} 31 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/search/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | classes: ['field-class', 'input-class', 'cancel-class'], 5 | props: { 6 | focus: Boolean, 7 | error: Boolean, 8 | disabled: Boolean, 9 | readonly: Boolean, 10 | inputAlign: String, 11 | showAction: Boolean, 12 | useActionSlot: Boolean, 13 | placeholder: String, 14 | placeholderStyle: String, 15 | background: { 16 | type: String, 17 | value: '#ffffff' 18 | }, 19 | maxlength: { 20 | type: Number, 21 | value: -1 22 | }, 23 | shape: { 24 | type: String, 25 | value: 'square' 26 | }, 27 | label: String 28 | }, 29 | methods: { 30 | onChange(event) { 31 | this.set({ value: event.detail }); 32 | this.$emit('change', event.detail); 33 | }, 34 | onCancel() { 35 | this.set({ value: '' }); 36 | this.$emit('cancel'); 37 | this.$emit('change', ''); 38 | }, 39 | onSearch() { 40 | this.$emit('search', this.data.value); 41 | }, 42 | onFocus() { 43 | this.$emit('focus'); 44 | }, 45 | onBlur() { 46 | this.$emit('blur'); 47 | }, 48 | onClear() { 49 | this.$emit('clear'); 50 | }, 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/mixins/observer/behavior.js: -------------------------------------------------------------------------------- 1 | function setAsync(context, data) { 2 | return new Promise(resolve => { 3 | context.setData(data, resolve); 4 | }); 5 | } 6 | ; 7 | export const behavior = Behavior({ 8 | created() { 9 | if (!this.$options) { 10 | return; 11 | } 12 | const cache = {}; 13 | const { computed } = this.$options(); 14 | const keys = Object.keys(computed); 15 | this.calcComputed = () => { 16 | const needUpdate = {}; 17 | keys.forEach(key => { 18 | const value = computed[key].call(this); 19 | if (cache[key] !== value) { 20 | cache[key] = needUpdate[key] = value; 21 | } 22 | }); 23 | return needUpdate; 24 | }; 25 | }, 26 | attached() { 27 | this.set(); 28 | }, 29 | methods: { 30 | // set data and set computed data 31 | set(data, callback) { 32 | const stack = []; 33 | if (data) { 34 | stack.push(setAsync(this, data)); 35 | } 36 | if (this.calcComputed) { 37 | stack.push(setAsync(this, this.calcComputed())); 38 | } 39 | return Promise.all(stack).then(res => { 40 | if (callback && typeof callback === 'function') { 41 | callback.call(this); 42 | } 43 | return res; 44 | }); 45 | } 46 | } 47 | }); 48 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/collapse/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'collapse-item', 5 | type: 'descendant', 6 | linked(child) { 7 | this.children.push(child); 8 | }, 9 | unlinked(child) { 10 | this.children = this.children.filter((item) => item !== child); 11 | } 12 | }, 13 | props: { 14 | value: { 15 | type: null, 16 | observer: 'updateExpanded' 17 | }, 18 | accordion: { 19 | type: Boolean, 20 | observer: 'updateExpanded' 21 | }, 22 | border: { 23 | type: Boolean, 24 | value: true 25 | } 26 | }, 27 | beforeCreate() { 28 | this.children = []; 29 | }, 30 | methods: { 31 | updateExpanded() { 32 | this.children.forEach((child) => { 33 | child.updateExpanded(); 34 | }); 35 | }, 36 | switch(name, expanded) { 37 | const { accordion, value } = this.data; 38 | if (!accordion) { 39 | name = expanded 40 | ? (value || []).concat(name) 41 | : (value || []).filter((activeName) => activeName !== name); 42 | } 43 | else { 44 | name = expanded ? name : ''; 45 | } 46 | this.$emit('change', name); 47 | this.$emit('input', name); 48 | } 49 | } 50 | }); 51 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 16 | 17 | 18 | 22 | {{ title }} 23 | 24 | 25 | 26 | 27 | {{ label }} 28 | 29 | 30 | 31 | 32 | {{ value }} 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/cell/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;width:100%;padding:10px 15px;font-size:14px;line-height:24px;color:#333;background-color:#fff;box-sizing:border-box}.van-cell:after{content:" ";position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{margin-top:3px;font-size:12px;line-height:18px;color:#999}.van-cell__value{overflow:hidden;color:#999;text-align:right;vertical-align:middle}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;height:24px;font-size:16px;-webkit-align-items:center;align-items:center}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#999}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;left:7px;font-size:14px;color:#f44;content:"*"}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px}.van-cell--large .van-cell__label{font-size:14px} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/submit-bar/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { safeArea } from '../mixins/safe-area'; 3 | VantComponent({ 4 | mixins: [safeArea()], 5 | classes: [ 6 | 'bar-class', 7 | 'price-class', 8 | 'button-class' 9 | ], 10 | props: { 11 | tip: { 12 | type: null, 13 | observer: 'updateTip' 14 | }, 15 | tipIcon: String, 16 | type: Number, 17 | price: { 18 | type: null, 19 | observer: 'updatePrice' 20 | }, 21 | label: String, 22 | loading: Boolean, 23 | disabled: Boolean, 24 | buttonText: String, 25 | currency: { 26 | type: String, 27 | value: '¥' 28 | }, 29 | buttonType: { 30 | type: String, 31 | value: 'danger' 32 | }, 33 | decimalLength: { 34 | type: Number, 35 | value: 2, 36 | observer: 'updatePrice' 37 | }, 38 | suffixLabel: String 39 | }, 40 | methods: { 41 | updatePrice() { 42 | const { price, decimalLength } = this.data; 43 | this.set({ 44 | hasPrice: typeof price === 'number', 45 | priceStr: (price / 100).toFixed(decimalLength) 46 | }); 47 | }, 48 | updateTip() { 49 | this.set({ hasTip: typeof this.data.tip === 'string' }); 50 | }, 51 | onSubmit(event) { 52 | this.$emit('submit', event.detail); 53 | } 54 | } 55 | }); 56 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar-item/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | info: null, 5 | icon: String, 6 | dot: Boolean, 7 | name: { 8 | type: [String, Number] 9 | } 10 | }, 11 | relation: { 12 | name: 'tabbar', 13 | type: 'ancestor' 14 | }, 15 | data: { 16 | active: false 17 | }, 18 | methods: { 19 | onClick() { 20 | if (this.parent) { 21 | this.parent.onChange(this); 22 | } 23 | this.$emit('click'); 24 | }, 25 | updateFromParent() { 26 | const { parent } = this; 27 | if (!parent) { 28 | return; 29 | } 30 | const index = parent.children.indexOf(this); 31 | const parentData = parent.data; 32 | const { data } = this; 33 | const active = (data.name || index) === parentData.active; 34 | const patch = {}; 35 | if (active !== data.active) { 36 | patch.active = active; 37 | } 38 | if (parentData.activeColor !== data.activeColor) { 39 | patch.activeColor = parentData.activeColor; 40 | } 41 | if (parentData.inactiveColor !== data.inactiveColor) { 42 | patch.inactiveColor = parentData.inactiveColor; 43 | } 44 | return Object.keys(patch).length > 0 45 | ? this.set(patch) 46 | : Promise.resolve(); 47 | } 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/search/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | {{ label }} 9 | 10 | 11 | 35 | 36 | 37 | 43 | 44 | 取消 45 | 46 | 47 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/stepper/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-stepper{font-size:0}.van-stepper__minus,.van-stepper__plus{position:relative;display:inline-block;width:28px;height:28px;padding:5px;margin:1px;vertical-align:middle;background-color:#f2f3f5;border:0;box-sizing:border-box}.van-stepper__minus:before,.van-stepper__plus:before{width:9px;height:1px}.van-stepper__minus:after,.van-stepper__plus:after{width:1px;height:9px}.van-stepper__minus:after,.van-stepper__minus:before,.van-stepper__plus:after,.van-stepper__plus:before{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;background-color:#333;content:""}.van-stepper__minus--hover,.van-stepper__plus--hover{background-color:#e8e8e8}.van-stepper__minus--disabled,.van-stepper__plus--disabled{background-color:#f7f8fa}.van-stepper__minus--disabled:after,.van-stepper__minus--disabled:before,.van-stepper__plus--disabled:after,.van-stepper__plus--disabled:before{background-color:#c9c9c9}.van-stepper__minus--disabled.van-stepper__minus--hover,.van-stepper__minus--disabled.van-stepper__plus--hover,.van-stepper__plus--disabled.van-stepper__minus--hover,.van-stepper__plus--disabled.van-stepper__plus--hover{background-color:#f7f8fa}.van-stepper__minus{border-radius:4px 0 0 4px}.van-stepper__minus:after{display:none}.van-stepper__plus{border-radius:0 4px 4px 0}.van-stepper__input{display:inline-block;width:30px;height:26px;padding:1px;margin:1px;font-size:14px;color:#333;text-align:center;vertical-align:middle;background-color:#f2f3f5;border:0;border-width:1px 0;border-radius:0;box-sizing:initial;-webkit-appearance:none}.van-stepper__input--disabled{color:#c9c9c9;background-color:#f2f3f5} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/card/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 20 | {{ tag }} 21 | 22 | 23 | 24 | 25 | {{ title }} 26 | 27 | 28 | {{ desc }} 29 | 30 | 31 | 32 | 33 | 34 | {{ currency }} {{ price }} 35 | {{ currency }} {{ originPrice }} 36 | x {{ num }} 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/common/component.js: -------------------------------------------------------------------------------- 1 | import { basic } from '../mixins/basic'; 2 | import { observe } from '../mixins/observer/index'; 3 | function mapKeys(source, target, map) { 4 | Object.keys(map).forEach(key => { 5 | if (source[key]) { 6 | target[map[key]] = source[key]; 7 | } 8 | }); 9 | } 10 | function VantComponent(vantOptions = {}) { 11 | const options = {}; 12 | mapKeys(vantOptions, options, { 13 | data: 'data', 14 | props: 'properties', 15 | mixins: 'behaviors', 16 | methods: 'methods', 17 | beforeCreate: 'created', 18 | created: 'attached', 19 | mounted: 'ready', 20 | relations: 'relations', 21 | destroyed: 'detached', 22 | classes: 'externalClasses' 23 | }); 24 | const { relation } = vantOptions; 25 | if (relation) { 26 | options.relations = Object.assign(options.relations || {}, { 27 | [`../${relation.name}/index`]: relation 28 | }); 29 | } 30 | // add default externalClasses 31 | options.externalClasses = options.externalClasses || []; 32 | options.externalClasses.push('custom-class'); 33 | // add default behaviors 34 | options.behaviors = options.behaviors || []; 35 | options.behaviors.push(basic); 36 | // map field to form-field behavior 37 | if (vantOptions.field) { 38 | options.behaviors.push('wx://form-field'); 39 | } 40 | // add default options 41 | options.options = { 42 | multipleSlots: true, 43 | addGlobalClass: true 44 | }; 45 | observe(vantOptions, options); 46 | Component(options); 47 | } 48 | export { VantComponent }; 49 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/action-sheet/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | {{ title }} 15 | 20 | 21 | 22 | 23 | 38 | 39 | 40 | 47 | {{ cancelText }} 48 | 49 | 50 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/popup/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { transition } from '../mixins/transition'; 3 | import { safeArea } from '../mixins/safe-area'; 4 | VantComponent({ 5 | classes: [ 6 | 'enter-class', 7 | 'enter-active-class', 8 | 'enter-to-class', 9 | 'leave-class', 10 | 'leave-active-class', 11 | 'leave-to-class' 12 | ], 13 | mixins: [transition(false), safeArea()], 14 | props: { 15 | transition: { 16 | type: String, 17 | observer: 'observeClass' 18 | }, 19 | customStyle: String, 20 | overlayStyle: String, 21 | zIndex: { 22 | type: Number, 23 | value: 100 24 | }, 25 | overlay: { 26 | type: Boolean, 27 | value: true 28 | }, 29 | closeOnClickOverlay: { 30 | type: Boolean, 31 | value: true 32 | }, 33 | position: { 34 | type: String, 35 | value: 'center', 36 | observer: 'observeClass' 37 | } 38 | }, 39 | created() { 40 | this.observeClass(); 41 | }, 42 | methods: { 43 | onClickOverlay() { 44 | this.$emit('click-overlay'); 45 | if (this.data.closeOnClickOverlay) { 46 | this.$emit('close'); 47 | } 48 | }, 49 | observeClass() { 50 | const { transition, position } = this.data; 51 | this.updateClasses(transition || position); 52 | if (transition === 'none') { 53 | this.set({ duration: 0 }); 54 | } 55 | } 56 | } 57 | }); 58 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabs/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{position:absolute;top:0;right:0;left:0;display:-webkit-flex;display:flex;background-color:#fff}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{line-height:30px;color:#f44;border-right:1px solid #f44}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{position:absolute;bottom:0;left:0;z-index:1;height:3px;background-color:#f44;border-radius:3px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tabs__content{overflow:hidden}.van-tab,.van-tabs__track{position:relative}.van-tab{min-width:0;padding:0 5px;font-size:14px;line-height:44px;color:#7d7e80;text-align:center;cursor:pointer;box-sizing:border-box;-webkit-flex:1;flex:1}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9}.van-tab__title--dot:after{display:inline-block;width:8px;height:8px;vertical-align:middle;background-color:#f44;border-radius:100%;content:""}.van-tab__title__info{position:relative!important;top:-1px!important;display:inline-block;-webkit-transform:translateX(0)!important;transform:translateX(0)!important} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/col/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/transition/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-transition{transition-timing-function:ease}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-fade-down-enter-active,.van-fade-down-leave-active,.van-fade-left-enter-active,.van-fade-left-leave-active,.van-fade-right-enter-active,.van-fade-right-leave-active,.van-fade-up-enter-active,.van-fade-up-leave-active{transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.van-fade-up-enter,.van-fade-up-leave-to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.van-fade-down-enter,.van-fade-down-leave-to{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.van-fade-left-enter,.van-fade-left-leave-to{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.van-fade-right-enter,.van-fade-right-leave-to{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.van-slide-down-enter-active,.van-slide-down-leave-active,.van-slide-left-enter-active,.van-slide-left-leave-active,.van-slide-right-enter-active,.van-slide-right-leave-active,.van-slide-up-enter-active,.van-slide-up-leave-active{transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform}.van-slide-up-enter,.van-slide-up-leave-to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.van-slide-down-enter,.van-slide-down-leave-to{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.van-slide-left-enter,.van-slide-left-leave-to{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.van-slide-right-enter,.van-slide-right-leave-to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)} -------------------------------------------------------------------------------- /pages/about/about.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 旨在帮助程序员在日常中更好的管理和查询GitHub相关信息。 6 | 7 | 8 | 9 | 1、 10 | 登录凭证:GitHub API某些功能为了安全性,需要授权才能操作。授权可通过a.Token认证,b.账号密码认证,c.在GitHub上创建Auth apps,该应用选用a或b两种认证方式 11 | 12 | 13 | 2、 14 | tabBar(仓库-所有):通过关键字、语言、排列类型(stars/forks)、排列方式(升序/降序)进行GitHub仓库搜索 15 | 16 | 17 | 3、 18 | tabBar(仓库-个人):通过输入用户名(只要是GitHub存在即可)查询个人信息,包括用户名、名字、Bio、Following、Follower以及查询的用户名下的(公有)列表。(Tip:私有仓库得授权才能查询,暂不支持,后续跟进~~) 19 | 20 | 21 | 4、 22 | 帮助与反馈:如有建议请前往反馈,吐槽也可以。 23 | 24 | 25 | 5、 26 | star和follow:在首页的仓库列表可以点击star和follow仓库(Tip:需要GitHub凭证认证,所以请先登陆实现认证才可使用) 27 | 28 | 29 | 6、 30 | 如果出现数据刷不出来,请清除缓存重新登录 31 | 32 | 33 | 7、 34 | 项目GitHub地址:https://github.com/chenjiaobin/github-search 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/dialog/dialog.js: -------------------------------------------------------------------------------- 1 | let queue = []; 2 | function getContext() { 3 | const pages = getCurrentPages(); 4 | return pages[pages.length - 1]; 5 | } 6 | const Dialog = options => { 7 | options = Object.assign({}, Dialog.currentOptions, options); 8 | return new Promise((resolve, reject) => { 9 | const context = options.context || getContext(); 10 | const dialog = context.selectComponent(options.selector); 11 | delete options.selector; 12 | if (dialog) { 13 | dialog.set(Object.assign({ onCancel: reject, onConfirm: resolve }, options)); 14 | queue.push(dialog); 15 | } 16 | else { 17 | console.warn('未找到 van-dialog 节点,请确认 selector 及 context 是否正确'); 18 | } 19 | }); 20 | }; 21 | Dialog.defaultOptions = { 22 | show: true, 23 | title: '', 24 | message: '', 25 | zIndex: 100, 26 | overlay: true, 27 | className: '', 28 | asyncClose: false, 29 | messageAlign: '', 30 | transition: 'scale', 31 | selector: '#van-dialog', 32 | confirmButtonText: '确认', 33 | cancelButtonText: '取消', 34 | showConfirmButton: true, 35 | showCancelButton: false, 36 | closeOnClickOverlay: false, 37 | confirmButtonOpenType: '' 38 | }; 39 | Dialog.alert = Dialog; 40 | Dialog.confirm = options => Dialog(Object.assign({ showCancelButton: true }, options)); 41 | Dialog.close = () => { 42 | queue.forEach(dialog => { 43 | dialog.close(); 44 | }); 45 | queue = []; 46 | }; 47 | Dialog.stopLoading = () => { 48 | queue.forEach(dialog => { 49 | dialog.stopLoading(); 50 | }); 51 | }; 52 | Dialog.setDefaultOptions = options => { 53 | Object.assign(Dialog.currentOptions, options); 54 | }; 55 | Dialog.resetDefaultOptions = () => { 56 | Dialog.currentOptions = Object.assign({}, Dialog.defaultOptions); 57 | }; 58 | Dialog.resetDefaultOptions(); 59 | export default Dialog; 60 | -------------------------------------------------------------------------------- /pages/me/me.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{user.name}} 10 | 博客:{{user.blog}} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /pages/search/search.js: -------------------------------------------------------------------------------- 1 | import * as githubApi from '../../api/github.js' 2 | 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | list: [], 10 | search: { 11 | searchKey: null, 12 | page: 1 13 | }, 14 | loadingText: '暂无数据', 15 | loading: true 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面加载 20 | */ 21 | onLoad: function (options) { 22 | this.setData({ 23 | search: Object.assign(this.data.search, { searchKey: options.key }) 24 | }) 25 | this.loadList(options.key) 26 | }, 27 | 28 | /** 29 | * 生命周期函数--监听页面初次渲染完成 30 | */ 31 | onReady: function () { 32 | 33 | }, 34 | 35 | /** 36 | * 生命周期函数--监听页面卸载 37 | */ 38 | onUnload: function () { 39 | 40 | }, 41 | 42 | /** 43 | * 页面相关事件处理函数--监听用户下拉动作 44 | */ 45 | onPullDownRefresh: function () { 46 | this.loadList(this.data.search.searchKey, 1) 47 | }, 48 | 49 | /** 50 | * 页面上拉触底事件的处理函数 51 | */ 52 | onReachBottom: function () { 53 | this.setData({ 54 | search: Object.assign(this.data.search, { page: ++this.data.search.page }) 55 | }) 56 | this.loadList(this.data.search.searchKey, this.data.search.page) 57 | }, 58 | 59 | // 获取列表数据 60 | loadList (username, page = 1) { 61 | githubApi.getFollower({ username: username, params: { page: page } }).then(res => { 62 | if (page === 1) { 63 | this.setData({ 64 | list: [].concat(res.data) 65 | }) 66 | } else { 67 | this.setData({ 68 | list: this.data.list.concat(res.data) 69 | }) 70 | } 71 | this.setData({ 72 | loading: false 73 | }) 74 | }).catch(err => { 75 | this.setData({ 76 | loading: false 77 | }) 78 | console.log(err) 79 | }) 80 | }, 81 | 82 | toGithub (event) { 83 | // let url = event.currentTarget.dataset.githuburl 84 | // wx.navigateTo({ 85 | // url: `/pages/webview/webview?outsrc=${url}`, 86 | // }) 87 | } 88 | }) -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/picker/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 13 | {{ cancelButtonText }} 14 | 15 | {{ title }} 16 | 23 | {{ confirmButtonText }} 24 | 25 | 26 | 27 | 28 | 29 | 34 | 48 | 52 | 53 | 54 | 55 | 56 | function isSimple(columns) { 57 | return columns.length && !columns[0].values; 58 | } 59 | module.exports = isSimple; 60 | 61 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabbar/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { safeArea } from '../mixins/safe-area'; 3 | VantComponent({ 4 | mixins: [safeArea()], 5 | relation: { 6 | name: 'tabbar-item', 7 | type: 'descendant', 8 | linked(target) { 9 | this.children.push(target); 10 | target.parent = this; 11 | target.updateFromParent(); 12 | }, 13 | unlinked(target) { 14 | this.children = this.children.filter((item) => item !== target); 15 | this.updateChildren(); 16 | } 17 | }, 18 | props: { 19 | active: { 20 | type: [Number, String], 21 | observer: 'updateChildren' 22 | }, 23 | activeColor: { 24 | type: String, 25 | observer: 'updateChildren' 26 | }, 27 | inactiveColor: { 28 | type: String, 29 | observer: 'updateChildren' 30 | }, 31 | fixed: { 32 | type: Boolean, 33 | value: true 34 | }, 35 | border: { 36 | type: Boolean, 37 | value: true 38 | }, 39 | zIndex: { 40 | type: Number, 41 | value: 1 42 | } 43 | }, 44 | beforeCreate() { 45 | this.children = []; 46 | }, 47 | methods: { 48 | updateChildren() { 49 | const { children } = this; 50 | if (!Array.isArray(children) || !children.length) { 51 | return Promise.resolve(); 52 | } 53 | return Promise.all(children.map((child) => child.updateFromParent())); 54 | }, 55 | onChange(child) { 56 | const index = this.children.indexOf(child); 57 | const active = child.data.name || index; 58 | if (active !== this.data.active) { 59 | this.$emit('change', active); 60 | } 61 | } 62 | } 63 | }); 64 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/button/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-button{position:relative;display:inline-block;height:44px;padding:0;font-size:16px;line-height:42px;text-align:center;vertical-align:middle;box-sizing:border-box;border-radius:2px;-webkit-appearance:none;-webkit-text-size-adjust:100%}.van-button:before{position:absolute;top:50%;left:50%;width:100%;height:100%;background-color:#000;border:inherit;border-color:#000;border-radius:inherit;content:" ";opacity:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{color:#333;background-color:#fff;border:1px solid #eee}.van-button--primary{color:#fff;background-color:#07c160;border:1px solid #07c160}.van-button--info{color:#fff;background-color:#1989fa;border:1px solid #1989fa}.van-button--danger{color:#fff;background-color:#f44;border:1px solid #f44}.van-button--warning{color:#fff;background-color:#ff976a;border:1px solid #ff976a}.van-button--plain{background-color:#fff}.van-button--plain.van-button--primary{color:#07c160}.van-button--plain.van-button--info{color:#1989fa}.van-button--plain.van-button--danger{color:#f44}.van-button--plain.van-button--warning{color:#ff976a}.van-button--large{width:100%;height:50px;line-height:48px}.van-button--normal{padding:0 15px;font-size:14px}.van-button--small{height:30px;min-width:60px;padding:0 8px;font-size:12px;line-height:28px}.van-button--mini{display:inline-block;width:50px;height:22px;font-size:10px;line-height:20px}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:block;width:100%}.van-button--round{border-radius:10em}.van-button--square{border-radius:0}.van-button--disabled{opacity:.5}.van-button__loading-text{margin-left:5px;display:inline-block;vertical-align:middle}.van-button--hairline{border-width:0;padding-top:1px}.van-button--hairline:after{border-width:1px;border-color:inherit;border-radius:4px}.van-button--hairline.van-button--round:after{border-radius:10em}.van-button--hairline.van-button--square:after{border-radius:0} -------------------------------------------------------------------------------- /project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": false, 8 | "es6": true, 9 | "enhance": true, 10 | "postcss": true, 11 | "preloadBackgroundData": false, 12 | "minified": true, 13 | "newFeature": true, 14 | "coverView": true, 15 | "nodeModules": true, 16 | "autoAudits": false, 17 | "showShadowRootInWxmlPanel": true, 18 | "scopeDataCheck": false, 19 | "uglifyFileName": false, 20 | "checkInvalidKey": true, 21 | "checkSiteMap": true, 22 | "uploadWithSourceMap": true, 23 | "compileHotReLoad": false, 24 | "lazyloadPlaceholderEnable": false, 25 | "useMultiFrameRuntime": true, 26 | "useApiHook": true, 27 | "useApiHostProcess": true, 28 | "babelSetting": { 29 | "ignore": [], 30 | "disablePlugins": [], 31 | "outputPath": "" 32 | }, 33 | "useIsolateContext": false, 34 | "userConfirmedBundleSwitch": false, 35 | "packNpmManually": false, 36 | "packNpmRelationList": [], 37 | "minifyWXSS": true, 38 | "disableUseStrict": false, 39 | "minifyWXML": true, 40 | "showES6CompileOption": false, 41 | "useCompilerPlugins": false, 42 | "ignoreUploadUnusedFiles": true 43 | }, 44 | "compileType": "miniprogram", 45 | "libVersion": "2.7.2", 46 | "appid": "wxd7216888020d0020", 47 | "projectname": "github-search", 48 | "debugOptions": { 49 | "hidedInDevtools": [] 50 | }, 51 | "isGameTourist": false, 52 | "simulatorType": "wechat", 53 | "simulatorPluginLibVersion": {}, 54 | "cloudfunctionRoot": "cloud_fun/", 55 | "condition": { 56 | "search": { 57 | "list": [] 58 | }, 59 | "conversation": { 60 | "list": [] 61 | }, 62 | "plugin": { 63 | "list": [] 64 | }, 65 | "game": { 66 | "currentL": -1, 67 | "list": [] 68 | }, 69 | "miniprogram": { 70 | "list": [ 71 | { 72 | "id": -1, 73 | "name": "扫描小程序场景值", 74 | "pathName": "pages/index/index", 75 | "scene": 1047 76 | } 77 | ] 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/dialog/index.wxml: -------------------------------------------------------------------------------- 1 | 10 | 14 | {{ title }} 15 | 16 | 17 | 18 | 22 | {{ message }} 23 | 24 | 25 | 26 | 34 | {{ cancelButtonText }} 35 | 36 | 61 | {{ confirmButtonText }} 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/toast/toast.js: -------------------------------------------------------------------------------- 1 | import { isObj } from '../common/utils'; 2 | const defaultOptions = { 3 | type: 'text', 4 | mask: false, 5 | message: '', 6 | show: true, 7 | zIndex: 1000, 8 | duration: 3000, 9 | position: 'middle', 10 | forbidClick: false, 11 | loadingType: 'circular', 12 | selector: '#van-toast' 13 | }; 14 | let queue = []; 15 | let currentOptions = Object.assign({}, defaultOptions); 16 | function parseOptions(message) { 17 | return isObj(message) ? message : { message }; 18 | } 19 | function getContext() { 20 | const pages = getCurrentPages(); 21 | return pages[pages.length - 1]; 22 | } 23 | function Toast(toastOptions) { 24 | const options = Object.assign({}, currentOptions, parseOptions(toastOptions)); 25 | const context = options.context || getContext(); 26 | const toast = context.selectComponent(options.selector); 27 | if (!toast) { 28 | console.warn('未找到 van-toast 节点,请确认 selector 及 context 是否正确'); 29 | return; 30 | } 31 | delete options.context; 32 | delete options.selector; 33 | toast.clear = () => { 34 | toast.set({ show: false }); 35 | if (options.onClose) { 36 | options.onClose(); 37 | } 38 | }; 39 | queue.push(toast); 40 | toast.set(options); 41 | clearTimeout(toast.timer); 42 | if (options.duration > 0) { 43 | toast.timer = setTimeout(() => { 44 | toast.clear(); 45 | queue = queue.filter(item => item !== toast); 46 | }, options.duration); 47 | } 48 | return toast; 49 | } 50 | const createMethod = type => (options) => Toast(Object.assign({ type }, parseOptions(options))); 51 | Toast.loading = createMethod('loading'); 52 | Toast.success = createMethod('success'); 53 | Toast.fail = createMethod('fail'); 54 | Toast.clear = () => { 55 | queue.forEach(toast => { 56 | toast.clear(); 57 | }); 58 | queue = []; 59 | }; 60 | Toast.setDefaultOptions = (options) => { 61 | Object.assign(currentOptions, options); 62 | }; 63 | Toast.resetDefaultOptions = () => { 64 | currentOptions = Object.assign({}, defaultOptions); 65 | }; 66 | export default Toast; 67 | -------------------------------------------------------------------------------- /miniprogram_npm/vant-weapp/tabs/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 24 | 25 | {{ item.title }} 26 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 45 | 46 | 47 | 48 | 49 | 50 | --------------------------------------------------------------------------------