From d59a124e8e055b8c4836770a3f2ecc68f6e12fa2 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Sun, 21 Mar 2021 01:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B5=E9=9D=A2;=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E4=BB=A3=E7=A0=81;=E5=AE=8C=E5=96=84=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.js | 36 ++++- app.js | 53 +------ app.json | 6 +- dist/action-sheet/index.js | 47 ++++++ dist/action-sheet/index.json | 8 + dist/action-sheet/index.wxml | 23 +++ dist/action-sheet/index.wxss | 1 + dist/alert/index.js | 37 +++++ dist/alert/index.json | 7 + dist/alert/index.wxml | 15 ++ dist/alert/index.wxss | 1 + dist/avatar/index.js | 20 +++ dist/avatar/index.json | 3 + dist/avatar/index.wxml | 4 + dist/avatar/index.wxss | 1 + dist/badge/index.js | 29 ++++ dist/badge/index.json | 3 + dist/badge/index.wxml | 5 + dist/badge/index.wxss | 1 + dist/base/index.js | 37 +++++ dist/button/index.js | 80 ++++++++++ dist/button/index.json | 3 + dist/button/index.wxml | 20 +++ dist/button/index.wxss | 1 + dist/card/index.js | 26 ++++ dist/card/index.json | 3 + dist/card/index.wxml | 11 ++ dist/card/index.wxss | 1 + dist/cell-group/index.js | 33 ++++ dist/cell-group/index.json | 3 + dist/cell-group/index.wxml | 3 + dist/cell/index.js | 86 +++++++++++ dist/cell/index.json | 3 + dist/cell/index.wxml | 16 ++ dist/cell/index.wxss | 1 + dist/checkbox-group/index.js | 38 +++++ dist/checkbox-group/index.json | 7 + dist/checkbox-group/index.wxml | 3 + dist/checkbox-group/index.wxss | 0 dist/checkbox/index.js | 56 +++++++ dist/checkbox/index.json | 7 + dist/checkbox/index.wxml | 8 + dist/checkbox/index.wxss | 1 + dist/col/index.js | 20 +++ dist/col/index.json | 3 + dist/col/index.wxml | 1 + dist/col/index.wxss | 1 + dist/collapse-item/index.js | 46 ++++++ dist/collapse-item/index.json | 7 + dist/collapse-item/index.wxml | 9 ++ dist/collapse-item/index.wxss | 1 + dist/collapse/index.js | 31 ++++ dist/collapse/index.json | 3 + dist/collapse/index.wxml | 4 + dist/collapse/index.wxss | 0 dist/count-down/index.js | 90 +++++++++++ dist/count-down/index.json | 4 + dist/count-down/index.wxml | 4 + dist/count-down/index.wxss | 0 dist/divider/index.js | 25 ++++ dist/divider/index.json | 3 + dist/divider/index.wxml | 19 +++ dist/divider/index.wxss | 1 + dist/drawer/index.js | 33 ++++ dist/drawer/index.json | 3 + dist/drawer/index.wxml | 6 + dist/drawer/index.wxss | 1 + dist/grid-icon/index.js | 10 ++ dist/grid-icon/index.json | 3 + dist/grid-icon/index.wxml | 1 + dist/grid-icon/index.wxss | 1 + dist/grid-item/index.js | 16 ++ dist/grid-item/index.json | 3 + dist/grid-item/index.wxml | 1 + dist/grid-item/index.wxss | 1 + dist/grid-label/index.js | 10 ++ dist/grid-label/index.json | 3 + dist/grid-label/index.wxml | 1 + dist/grid-label/index.wxss | 1 + dist/grid/index.js | 50 +++++++ dist/grid/index.json | 3 + dist/grid/index.wxml | 1 + dist/grid/index.wxss | 1 + dist/icon/index.js | 22 +++ dist/icon/index.json | 3 + dist/icon/index.wxml | 1 + dist/icon/index.wxss | 1 + dist/index-item/index.js | 32 ++++ dist/index-item/index.json | 3 + dist/index-item/index.wxml | 11 ++ dist/index-item/index.wxss | 1 + dist/index/index.js | 158 ++++++++++++++++++++ dist/index/index.json | 3 + dist/index/index.wxml | 38 +++++ dist/index/index.wxss | 1 + dist/input-number/index.js | 101 +++++++++++++ dist/input-number/index.json | 3 + dist/input-number/index.wxml | 5 + dist/input-number/index.wxss | 1 + dist/input/index.js | 61 ++++++++ dist/input/index.json | 3 + dist/input/index.wxml | 31 ++++ dist/input/index.wxss | 1 + dist/load-more/index.js | 14 ++ dist/load-more/index.json | 3 + dist/load-more/index.wxml | 8 + dist/load-more/index.wxss | 1 + dist/message/index.js | 45 ++++++ dist/message/index.json | 3 + dist/message/index.wxml | 3 + dist/message/index.wxss | 1 + dist/modal/index.js | 54 +++++++ dist/modal/index.json | 9 ++ dist/modal/index.wxml | 40 +++++ dist/modal/index.wxss | 1 + dist/notice-bar/index.js | 112 ++++++++++++++ dist/notice-bar/index.json | 7 + dist/notice-bar/index.wxml | 9 ++ dist/notice-bar/index.wxss | 1 + dist/page/index.js | 42 ++++++ dist/page/index.json | 7 + dist/page/index.wxml | 14 ++ dist/page/index.wxss | 1 + dist/panel/index.js | 19 +++ dist/panel/index.json | 3 + dist/panel/index.wxml | 4 + dist/panel/index.wxss | 1 + dist/progress/index.js | 23 +++ dist/progress/index.json | 3 + dist/progress/index.wxml | 10 ++ dist/progress/index.wxss | 1 + dist/radio-group/index.js | 38 +++++ dist/radio-group/index.json | 7 + dist/radio-group/index.wxml | 3 + dist/radio-group/index.wxss | 0 dist/radio/index.js | 56 +++++++ dist/radio/index.json | 7 + dist/radio/index.wxml | 8 + dist/radio/index.wxss | 1 + dist/rate/index.js | 69 +++++++++ dist/rate/index.json | 6 + dist/rate/index.wxml | 23 +++ dist/rate/index.wxss | 1 + dist/row/index.js | 9 ++ dist/row/index.json | 3 + dist/row/index.wxml | 1 + dist/row/index.wxss | 1 + dist/slide/index.js | 15 ++ dist/slide/index.json | 8 + dist/slide/index.wxml | 4 + dist/slide/index.wxss | 0 dist/spin/index.js | 23 +++ dist/spin/index.json | 3 + dist/spin/index.wxml | 6 + dist/spin/index.wxss | 1 + dist/step/index.js | 52 +++++++ dist/step/index.json | 7 + dist/step/index.wxml | 70 +++++++++ dist/step/index.wxss | 1 + dist/steps/index.js | 50 +++++++ dist/steps/index.json | 3 + dist/steps/index.wxml | 3 + dist/steps/index.wxss | 1 + dist/sticky-item/index.js | 40 +++++ dist/sticky-item/index.json | 3 + dist/sticky-item/index.wxml | 10 ++ dist/sticky-item/index.wxss | 1 + dist/sticky/index.js | 63 ++++++++ dist/sticky/index.json | 3 + dist/sticky/index.wxml | 3 + dist/sticky/index.wxss | 0 dist/swipeout/index.js | 161 ++++++++++++++++++++ dist/swipeout/index.json | 7 + dist/swipeout/index.wxml | 39 +++++ dist/swipeout/index.wxss | 1 + dist/switch/index.js | 38 +++++ dist/switch/index.json | 3 + dist/switch/index.wxml | 26 ++++ dist/switch/index.wxss | 1 + dist/tab-bar-item/index.js | 62 ++++++++ dist/tab-bar-item/index.json | 8 + dist/tab-bar-item/index.wxml | 10 ++ dist/tab-bar-item/index.wxss | 1 + dist/tab-bar/index.js | 66 ++++++++ dist/tab-bar/index.json | 3 + dist/tab-bar/index.wxml | 6 + dist/tab-bar/index.wxss | 1 + dist/tab/index.js | 50 +++++++ dist/tab/index.json | 7 + dist/tab/index.wxml | 9 ++ dist/tab/index.wxss | 1 + dist/tabs/index.js | 56 +++++++ dist/tabs/index.json | 3 + dist/tabs/index.wxml | 2 + dist/tabs/index.wxss | 1 + dist/tag/index.js | 42 ++++++ dist/tag/index.json | 3 + dist/tag/index.wxml | 27 ++++ dist/tag/index.wxss | 1 + dist/toast/index.js | 48 ++++++ dist/toast/index.json | 7 + dist/toast/index.wxml | 16 ++ dist/toast/index.wxss | 1 + pages/bind-document/bind-document.js | 5 + pages/bind-document/bind-document.json | 4 +- pages/bind-document/bind-document.wxml | 47 +++++- pages/get-user-info/get-user-info.js | 108 ++++++++++++++ pages/get-user-info/get-user-info.json | 8 + pages/get-user-info/get-user-info.wxml | 11 ++ pages/get-user-info/get-user-info.wxss | 1 + pages/index/index.js | 199 ++++++++++++++++++++----- pages/index/index.json | 4 +- pages/index/index.wxml | 2 + utils/request.js | 19 ++- 214 files changed, 3705 insertions(+), 100 deletions(-) create mode 100644 dist/action-sheet/index.js create mode 100644 dist/action-sheet/index.json create mode 100644 dist/action-sheet/index.wxml create mode 100644 dist/action-sheet/index.wxss create mode 100644 dist/alert/index.js create mode 100644 dist/alert/index.json create mode 100644 dist/alert/index.wxml create mode 100644 dist/alert/index.wxss create mode 100644 dist/avatar/index.js create mode 100644 dist/avatar/index.json create mode 100644 dist/avatar/index.wxml create mode 100644 dist/avatar/index.wxss create mode 100644 dist/badge/index.js create mode 100644 dist/badge/index.json create mode 100644 dist/badge/index.wxml create mode 100644 dist/badge/index.wxss create mode 100644 dist/base/index.js create mode 100644 dist/button/index.js create mode 100644 dist/button/index.json create mode 100644 dist/button/index.wxml create mode 100644 dist/button/index.wxss create mode 100644 dist/card/index.js create mode 100644 dist/card/index.json create mode 100644 dist/card/index.wxml create mode 100644 dist/card/index.wxss create mode 100644 dist/cell-group/index.js create mode 100644 dist/cell-group/index.json create mode 100644 dist/cell-group/index.wxml create mode 100644 dist/cell/index.js create mode 100644 dist/cell/index.json create mode 100644 dist/cell/index.wxml create mode 100644 dist/cell/index.wxss create mode 100644 dist/checkbox-group/index.js create mode 100644 dist/checkbox-group/index.json create mode 100644 dist/checkbox-group/index.wxml create mode 100644 dist/checkbox-group/index.wxss create mode 100644 dist/checkbox/index.js create mode 100644 dist/checkbox/index.json create mode 100644 dist/checkbox/index.wxml create mode 100644 dist/checkbox/index.wxss create mode 100644 dist/col/index.js create mode 100644 dist/col/index.json create mode 100644 dist/col/index.wxml create mode 100644 dist/col/index.wxss create mode 100644 dist/collapse-item/index.js create mode 100644 dist/collapse-item/index.json create mode 100644 dist/collapse-item/index.wxml create mode 100644 dist/collapse-item/index.wxss create mode 100644 dist/collapse/index.js create mode 100644 dist/collapse/index.json create mode 100644 dist/collapse/index.wxml create mode 100644 dist/collapse/index.wxss create mode 100644 dist/count-down/index.js create mode 100644 dist/count-down/index.json create mode 100644 dist/count-down/index.wxml create mode 100644 dist/count-down/index.wxss create mode 100644 dist/divider/index.js create mode 100644 dist/divider/index.json create mode 100644 dist/divider/index.wxml create mode 100644 dist/divider/index.wxss create mode 100644 dist/drawer/index.js create mode 100644 dist/drawer/index.json create mode 100644 dist/drawer/index.wxml create mode 100644 dist/drawer/index.wxss create mode 100644 dist/grid-icon/index.js create mode 100644 dist/grid-icon/index.json create mode 100644 dist/grid-icon/index.wxml create mode 100644 dist/grid-icon/index.wxss create mode 100644 dist/grid-item/index.js create mode 100644 dist/grid-item/index.json create mode 100644 dist/grid-item/index.wxml create mode 100644 dist/grid-item/index.wxss create mode 100644 dist/grid-label/index.js create mode 100644 dist/grid-label/index.json create mode 100644 dist/grid-label/index.wxml create mode 100644 dist/grid-label/index.wxss create mode 100644 dist/grid/index.js create mode 100644 dist/grid/index.json create mode 100644 dist/grid/index.wxml create mode 100644 dist/grid/index.wxss create mode 100644 dist/icon/index.js create mode 100644 dist/icon/index.json create mode 100644 dist/icon/index.wxml create mode 100644 dist/icon/index.wxss create mode 100644 dist/index-item/index.js create mode 100644 dist/index-item/index.json create mode 100644 dist/index-item/index.wxml create mode 100644 dist/index-item/index.wxss create mode 100644 dist/index/index.js create mode 100644 dist/index/index.json create mode 100644 dist/index/index.wxml create mode 100644 dist/index/index.wxss create mode 100644 dist/input-number/index.js create mode 100644 dist/input-number/index.json create mode 100644 dist/input-number/index.wxml create mode 100644 dist/input-number/index.wxss create mode 100644 dist/input/index.js create mode 100644 dist/input/index.json create mode 100644 dist/input/index.wxml create mode 100644 dist/input/index.wxss create mode 100644 dist/load-more/index.js create mode 100644 dist/load-more/index.json create mode 100644 dist/load-more/index.wxml create mode 100644 dist/load-more/index.wxss create mode 100644 dist/message/index.js create mode 100644 dist/message/index.json create mode 100644 dist/message/index.wxml create mode 100644 dist/message/index.wxss create mode 100644 dist/modal/index.js create mode 100644 dist/modal/index.json create mode 100644 dist/modal/index.wxml create mode 100644 dist/modal/index.wxss create mode 100644 dist/notice-bar/index.js create mode 100644 dist/notice-bar/index.json create mode 100644 dist/notice-bar/index.wxml create mode 100644 dist/notice-bar/index.wxss create mode 100644 dist/page/index.js create mode 100644 dist/page/index.json create mode 100644 dist/page/index.wxml create mode 100644 dist/page/index.wxss create mode 100644 dist/panel/index.js create mode 100644 dist/panel/index.json create mode 100644 dist/panel/index.wxml create mode 100644 dist/panel/index.wxss create mode 100644 dist/progress/index.js create mode 100644 dist/progress/index.json create mode 100644 dist/progress/index.wxml create mode 100644 dist/progress/index.wxss create mode 100644 dist/radio-group/index.js create mode 100644 dist/radio-group/index.json create mode 100644 dist/radio-group/index.wxml create mode 100644 dist/radio-group/index.wxss create mode 100644 dist/radio/index.js create mode 100644 dist/radio/index.json create mode 100644 dist/radio/index.wxml create mode 100644 dist/radio/index.wxss create mode 100644 dist/rate/index.js create mode 100644 dist/rate/index.json create mode 100644 dist/rate/index.wxml create mode 100644 dist/rate/index.wxss create mode 100644 dist/row/index.js create mode 100644 dist/row/index.json create mode 100644 dist/row/index.wxml create mode 100644 dist/row/index.wxss create mode 100644 dist/slide/index.js create mode 100644 dist/slide/index.json create mode 100644 dist/slide/index.wxml create mode 100644 dist/slide/index.wxss create mode 100644 dist/spin/index.js create mode 100644 dist/spin/index.json create mode 100644 dist/spin/index.wxml create mode 100644 dist/spin/index.wxss create mode 100644 dist/step/index.js create mode 100644 dist/step/index.json create mode 100644 dist/step/index.wxml create mode 100644 dist/step/index.wxss create mode 100644 dist/steps/index.js create mode 100644 dist/steps/index.json create mode 100644 dist/steps/index.wxml create mode 100644 dist/steps/index.wxss create mode 100644 dist/sticky-item/index.js create mode 100644 dist/sticky-item/index.json create mode 100644 dist/sticky-item/index.wxml create mode 100644 dist/sticky-item/index.wxss create mode 100644 dist/sticky/index.js create mode 100644 dist/sticky/index.json create mode 100644 dist/sticky/index.wxml create mode 100644 dist/sticky/index.wxss create mode 100644 dist/swipeout/index.js create mode 100644 dist/swipeout/index.json create mode 100644 dist/swipeout/index.wxml create mode 100644 dist/swipeout/index.wxss create mode 100644 dist/switch/index.js create mode 100644 dist/switch/index.json create mode 100644 dist/switch/index.wxml create mode 100644 dist/switch/index.wxss create mode 100644 dist/tab-bar-item/index.js create mode 100644 dist/tab-bar-item/index.json create mode 100644 dist/tab-bar-item/index.wxml create mode 100644 dist/tab-bar-item/index.wxss create mode 100644 dist/tab-bar/index.js create mode 100644 dist/tab-bar/index.json create mode 100644 dist/tab-bar/index.wxml create mode 100644 dist/tab-bar/index.wxss create mode 100644 dist/tab/index.js create mode 100644 dist/tab/index.json create mode 100644 dist/tab/index.wxml create mode 100644 dist/tab/index.wxss create mode 100644 dist/tabs/index.js create mode 100644 dist/tabs/index.json create mode 100644 dist/tabs/index.wxml create mode 100644 dist/tabs/index.wxss create mode 100644 dist/tag/index.js create mode 100644 dist/tag/index.json create mode 100644 dist/tag/index.wxml create mode 100644 dist/tag/index.wxss create mode 100644 dist/toast/index.js create mode 100644 dist/toast/index.json create mode 100644 dist/toast/index.wxml create mode 100644 dist/toast/index.wxss create mode 100644 pages/get-user-info/get-user-info.js create mode 100644 pages/get-user-info/get-user-info.json create mode 100644 pages/get-user-info/get-user-info.wxml create mode 100644 pages/get-user-info/get-user-info.wxss diff --git a/api/user.js b/api/user.js index e8d223c..9218549 100644 --- a/api/user.js +++ b/api/user.js @@ -1 +1,35 @@ -import request from '../utils/request.js' \ No newline at end of file +import request from '../utils/request.js' + +export const login = (appID, code)=>{ + return request({ + url: '/wx/user/' + appID + '/login', + method: 'get', + data: { + code + } + }) +} + +export const checkProfile = () => { + return request({ + url: "/user/profile/uploaded", + method: "get", + data: {} + }) +} + +export const setProfile = (userInfo) => { + return request({ + url: "/user/profile/", + method: "post", + data: userInfo + }) +} + +export const getProfile = () => { + return request({ + url: "/user/profile/", + method: "get", + data: {} + }) +} \ No newline at end of file diff --git a/app.js b/app.js index 5630495..91778c6 100644 --- a/app.js +++ b/app.js @@ -8,64 +8,13 @@ App({ const logs = wx.getStorageSync('logs') || [] logs.unshift(Date.now()) wx.setStorageSync('logs', logs) - - - wx.login({ - success: res => { - // 发送 res.code 到后台换取 openId, sessionKey, unionId - request({ - url: '/wx/user/' + this.globalData.appID + '/login', - method: 'get', - data: { - code: res.code - } - }).then(res => { - console.log(res) - - this.globalData.login = true - // 设置登录时间 - this.globalData.loginTime = Date.now() - - // 设置登录信息 - const userBaseInfo = {} - userBaseInfo.openid = res.openid - userBaseInfo.postmark = res.postmark - userBaseInfo.token = res.token - - this.globalData.userBaseInfo = userBaseInfo - - }).then(res => { - // 获取用户信息 - wx.getSetting({ - success: res => { - if (res.authSetting['scope.userInfo']) { - // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 - wx.getUserInfo({ - success: res => { - // 可以将 res 发送给后台解码出 unionId - this.globalData.userInfo = res.userInfo - - // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 - // 所以此处加入 callback 以防止这种情况 - if (this.userInfoReadyCallback) { - this.userInfoReadyCallback(res) - } - } - }) - } - } - }) - }).catch(err => { - console.log(err) - }) - } - }) }, globalData: { userInfo: null, userBaseInfo: null, loginTime: null, login: false, + loginCallback: null, appID: 'wxb915ee2a665fcb6c', baseURL: 'http://localhost:8088' } diff --git a/app.json b/app.json index dd7a73c..105080d 100644 --- a/app.json +++ b/app.json @@ -2,7 +2,8 @@ "pages": [ "pages/index/index", "pages/logs/logs", - "pages/bind-document/bind-document" + "pages/bind-document/bind-document", + "pages/get-user-info/get-user-info" ], "window": { "backgroundTextStyle": "light", @@ -10,6 +11,9 @@ "navigationBarTitleText": "全员育人小程序", "navigationBarTextStyle": "black" }, + "useExtendedLib": { + "weui": true + }, "style": "v2", "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/dist/action-sheet/index.js b/dist/action-sheet/index.js new file mode 100644 index 0000000..2db31aa --- /dev/null +++ b/dist/action-sheet/index.js @@ -0,0 +1,47 @@ +Component({ + externalClasses: ['i-class', 'i-class-mask', 'i-class-header'], + + options: { + multipleSlots: true + }, + + properties: { + visible: { + type: Boolean, + value: false + }, + maskClosable: { + type: Boolean, + value: true + }, + showCancel: { + type: Boolean, + value: false + }, + cancelText: { + type: String, + value: '取消' + }, + actions: { + type: Array, + value: [] + } + }, + + methods: { + handleClickMask () { + if (!this.data.maskClosable) return; + this.handleClickCancel(); + }, + + handleClickItem ({ currentTarget = {} }) { + const dataset = currentTarget.dataset || {}; + const { index } = dataset; + this.triggerEvent('click', { index }); + }, + + handleClickCancel () { + this.triggerEvent('cancel'); + } + } +}); diff --git a/dist/action-sheet/index.json b/dist/action-sheet/index.json new file mode 100644 index 0000000..6b1e67d --- /dev/null +++ b/dist/action-sheet/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": + { + "i-button": "../button/index", + "i-icon": "../icon/index" + } +} diff --git a/dist/action-sheet/index.wxml b/dist/action-sheet/index.wxml new file mode 100644 index 0000000..332f393 --- /dev/null +++ b/dist/action-sheet/index.wxml @@ -0,0 +1,23 @@ + + + + + + + + + {{ item.name }} + + + + + {{ cancelText }} + + diff --git a/dist/action-sheet/index.wxss b/dist/action-sheet/index.wxss new file mode 100644 index 0000000..05c6f04 --- /dev/null +++ b/dist/action-sheet/index.wxss @@ -0,0 +1 @@ +.i-as{position:fixed;width:100%;box-sizing:border-box;left:0;right:0;bottom:0;background:#f7f7f7;transform:translate3d(0,100%,0);transform-origin:center;transition:all .2s ease-in-out;z-index:900;visibility:hidden}.i-as-show{transform:translate3d(0,0,0);visibility:visible}.i-as-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);z-index:900;transition:all .2s ease-in-out;opacity:0;visibility:hidden}.i-as-mask-show{opacity:1;visibility:visible}.i-as-action-item{position:relative}.i-as-action-item::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-as-header{background:#fff;text-align:center;position:relative;font-size:12px;color:#80848f}.i-as-header::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-as-cancel{margin-top:6px}.i-as-btn-loading{display:inline-block;vertical-align:middle;margin-right:10px;width:12px;height:12px;background:0 0;border-radius:50%;border:2px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-as-btn-text{display:inline-block;vertical-align:middle}.i-as-btn-icon{font-size:14px!important;margin-right:4px}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/dist/alert/index.js b/dist/alert/index.js new file mode 100644 index 0000000..461b67d --- /dev/null +++ b/dist/alert/index.js @@ -0,0 +1,37 @@ +Component({ + externalClasses: ['i-class'], + options: { + multipleSlots: true + }, + properties: { + //info, success, warning, error + type: { + type: String, + value: 'info' + }, + closable: { + type: Boolean, + value: false + }, + showIcon: { + type: Boolean, + default: false + }, + desc: { + type: Boolean, + default: false + }, + }, + data: { + closed: false + }, + methods: { + handleTap() { + this.setData({ + closed: !this.data.closed, + }); + this.triggerEvent('close'); + }, + + } +}); diff --git a/dist/alert/index.json b/dist/alert/index.json new file mode 100644 index 0000000..db3afc0 --- /dev/null +++ b/dist/alert/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-icon": "../icon/index" + } +} diff --git a/dist/alert/index.wxml b/dist/alert/index.wxml new file mode 100644 index 0000000..eebabde --- /dev/null +++ b/dist/alert/index.wxml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/dist/alert/index.wxss b/dist/alert/index.wxss new file mode 100644 index 0000000..0e61fce --- /dev/null +++ b/dist/alert/index.wxss @@ -0,0 +1 @@ +.i-alert{position:relative;margin:10px;padding:8px 48px 8px 16px;font-size:14px;border-radius:2px;color:#fff;background:#f7f7f7;color:#495060}.i-alert.i-alert-with-icon{padding:8px 48px 8px 38px}.i-alert-info{color:#fff;background:#2db7f5}.i-alert-success{color:#fff;background:#19be6b}.i-alert-warning{color:#fff;background:#f90}.i-alert-error{color:#fff;background:#ed3f14}.i-alert-icon{position:absolute;top:9px;left:16px;font-size:14px}.i-alert-desc{font-size:12px}.i-alert-with-desc{padding:16px;position:relative}.i-alert-with-desc.i-alert-with-icon{padding:16px 16px 16px 69px}.i-alert-with-desc .i-alert-icon{top:50%;left:24px;margin-top:-21px;font-size:28px}.i-alert-close{font-size:12px;position:absolute;right:16px;top:8px;overflow:hidden;cursor:pointer} \ No newline at end of file diff --git a/dist/avatar/index.js b/dist/avatar/index.js new file mode 100644 index 0000000..fae9476 --- /dev/null +++ b/dist/avatar/index.js @@ -0,0 +1,20 @@ +Component({ + externalClasses: ['i-class'], + + properties: { + // circle || square + shape: { + type: String, + value: 'circle' + }, + // small || large || default + size: { + type: String, + value: 'default' + }, + src: { + type: String, + value: '' + } + } +}); diff --git a/dist/avatar/index.json b/dist/avatar/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/avatar/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/avatar/index.wxml b/dist/avatar/index.wxml new file mode 100644 index 0000000..11730c6 --- /dev/null +++ b/dist/avatar/index.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/dist/avatar/index.wxss b/dist/avatar/index.wxss new file mode 100644 index 0000000..8f6e636 --- /dev/null +++ b/dist/avatar/index.wxss @@ -0,0 +1 @@ +.i-avatar{display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:32px;height:32px;line-height:32px;border-radius:16px;font-size:18px}.i-avatar .ivu-avatar-string{line-height:32px}.i-avatar-large{width:40px;height:40px;line-height:40px;border-radius:20px;font-size:24px}.i-avatar-large .ivu-avatar-string{line-height:40px}.i-avatar-small{width:24px;height:24px;line-height:24px;border-radius:12px;font-size:14px}.i-avatar-small .ivu-avatar-string{line-height:24px}.i-avatar-image{background:0 0}.i-avatar-square{border-radius:4px}.i-avatar>image{width:100%;height:100%} \ No newline at end of file diff --git a/dist/badge/index.js b/dist/badge/index.js new file mode 100644 index 0000000..2b9fb30 --- /dev/null +++ b/dist/badge/index.js @@ -0,0 +1,29 @@ +Component({ + externalClasses: ['i-class', 'i-class-alone'], + + properties: { + count: { + type: Number, + value: 0, + observer: 'finalCount' + }, + overflowCount: { + type: Number, + value: 99 + }, + dot: { + type: Boolean, + value: false + }, + }, + data: { + finalCount: 0 + }, + methods: { + finalCount() { + this.setData({ + finalCount: parseInt(this.data.count) >= parseInt(this.data.overflowCount) ? `${this.data.overflowCount}+` : this.data.count + }); + }, + } +}); diff --git a/dist/badge/index.json b/dist/badge/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/badge/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/badge/index.wxml b/dist/badge/index.wxml new file mode 100644 index 0000000..372fd7f --- /dev/null +++ b/dist/badge/index.wxml @@ -0,0 +1,5 @@ + + + + {{ finalCount }} + diff --git a/dist/badge/index.wxss b/dist/badge/index.wxss new file mode 100644 index 0000000..281658f --- /dev/null +++ b/dist/badge/index.wxss @@ -0,0 +1 @@ +.i-badge{position:relative;display:inline-block;line-height:1;vertical-align:middle}.i-badge-count{position:absolute;transform:translateX(50%);top:-6px;right:0;height:18px;border-radius:9px;min-width:18px;background:#ed3f14;border:1px solid transparent;color:#fff;line-height:18px;text-align:center;padding:0 5px;font-size:12px;white-space:nowrap;transform-origin:-10% center;z-index:10;box-shadow:0 0 0 1px #fff;box-sizing:border-box;text-rendering:optimizeLegibility}.i-badge-count-alone{top:auto;display:block;position:relative;transform:translateX(0)}.i-badge-dot{position:absolute;transform:translateX(-50%);transform-origin:0 center;top:-4px;right:-8px;height:8px;width:8px;border-radius:100%;background:#ed3f14;z-index:10;box-shadow:0 0 0 1px #fff} \ No newline at end of file diff --git a/dist/base/index.js b/dist/base/index.js new file mode 100644 index 0000000..6cb977f --- /dev/null +++ b/dist/base/index.js @@ -0,0 +1,37 @@ +function getCtx (selector) { + const pages = getCurrentPages(); + const ctx = pages[pages.length - 1]; + + const componentCtx = ctx.selectComponent(selector); + + if (!componentCtx) { + console.error('无法找到对应的组件,请按文档说明使用组件'); + return null; + } + return componentCtx; +} + +function Toast(options) { + const { selector = '#toast' } = options; + const ctx = getCtx(selector); + + ctx.handleShow(options); +} + +Toast.hide = function (selector = '#toast') { + const ctx = getCtx(selector); + + ctx.handleHide(); +}; + +function Message(options) { + const { selector = '#message' } = options; + const ctx = getCtx(selector); + + ctx.handleShow(options); +} + +module.exports = { + $Toast: Toast, + $Message: Message +}; \ No newline at end of file diff --git a/dist/button/index.js b/dist/button/index.js new file mode 100644 index 0000000..f0e9b3e --- /dev/null +++ b/dist/button/index.js @@ -0,0 +1,80 @@ +Component({ + externalClasses: ['i-class'], + + properties: { + // default, primary, ghost, info, success, warning, error + type: { + type: String, + value: '', + }, + inline: { + type: Boolean, + value: false + }, + // default, large, small + size: { + type: String, + value: '', + }, + // circle, square + shape: { + type: String, + value: 'square' + }, + disabled: { + type: Boolean, + value: false, + }, + loading: { + type: Boolean, + value: false, + }, + long: { + type: Boolean, + value: false + }, + openType: String, + appParameter: String, + hoverStopPropagation: Boolean, + hoverStartTime: { + type: Number, + value: 20 + }, + hoverStayTime: { + type: Number, + value: 70 + }, + lang: { + type: String, + value: 'en' + }, + sessionFrom: { + type: String, + value: '' + }, + sendMessageTitle: String, + sendMessagePath: String, + sendMessageImg: String, + showMessageCard: Boolean + }, + + methods: { + handleTap () { + if (this.data.disabled) return false; + + this.triggerEvent('click'); + }, + bindgetuserinfo({ detail = {} } = {}) { + this.triggerEvent('getuserinfo', detail); + }, + bindcontact({ detail = {} } = {}) { + this.triggerEvent('contact', detail); + }, + bindgetphonenumber({ detail = {} } = {}) { + this.triggerEvent('getphonenumber', detail); + }, + binderror({ detail = {} } = {}) { + this.triggerEvent('error', detail); + } + } +}); diff --git a/dist/button/index.json b/dist/button/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/button/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/button/index.wxml b/dist/button/index.wxml new file mode 100644 index 0000000..e154eee --- /dev/null +++ b/dist/button/index.wxml @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/dist/button/index.wxss b/dist/button/index.wxss new file mode 100644 index 0000000..550bc81 --- /dev/null +++ b/dist/button/index.wxss @@ -0,0 +1 @@ +.i-btn{text-align:center;vertical-align:middle;touch-action:manipulation;cursor:pointer;background-image:none;white-space:nowrap;user-select:none;font-size:14px;border-radius:2px;border:0!important;position:relative;text-decoration:none;height:44px;line-height:44px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);color:#fff!important;background:#f7f7f7!important;color:#495060!important;margin:10px}.i-btn-hover{opacity:.9}.i-btn-long{border-radius:0;margin:0;box-shadow:none}.i-btn-large{height:48px;line-height:48px}.i-btn-small{height:40px;line-height:40px}.i-btn-primary{color:#fff!important;background:#2d8cf0!important}.i-btn-ghost{color:#fff!important;background:#fff!important;color:#495060!important}.i-btn-success{color:#fff!important;background:#19be6b!important}.i-btn-warning{color:#fff!important;background:#f90!important}.i-btn-error{color:#fff!important;background:#ed3f14!important}.i-btn-info{color:#fff!important;background:#2db7f5!important}.i-btn-circle{border-radius:44px}.i-btn-large.i-btn-circle{border-radius:48px}.i-btn-small.i-btn-circle{border-radius:40px}.i-btn-loading{opacity:.6}.i-btn-loading-inner{display:inline-block;margin-right:12px;vertical-align:middle;width:14px;height:14px;background:0 0;border-radius:50%;border:2px solid #fff;border-color:#fff #fff #fff transparent;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-btn-disabled{color:#bbbec4!important;background:#f7f7f7!important}.i-btn-inline{display:inline-block}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/dist/card/index.js b/dist/card/index.js new file mode 100644 index 0000000..20ad106 --- /dev/null +++ b/dist/card/index.js @@ -0,0 +1,26 @@ +Component({ + externalClasses: ['i-class'], + + options: { + multipleSlots: true + }, + + properties: { + full: { + type: Boolean, + value: false + }, + thumb: { + type: String, + value: '' + }, + title: { + type: String, + value: '' + }, + extra: { + type: String, + value: '' + } + } +}); diff --git a/dist/card/index.json b/dist/card/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/card/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/card/index.wxml b/dist/card/index.wxml new file mode 100644 index 0000000..4792293 --- /dev/null +++ b/dist/card/index.wxml @@ -0,0 +1,11 @@ + + + + + {{ title }} + + {{ extra }} + + + + diff --git a/dist/card/index.wxss b/dist/card/index.wxss new file mode 100644 index 0000000..fd8fad4 --- /dev/null +++ b/dist/card/index.wxss @@ -0,0 +1 @@ +.i-card{margin:0 16px;font-size:14px;overflow:hidden;position:relative;background:#fff;border:1rpx solid #dddee1;border-radius:5px}.i-card-full{margin:0;border-left:none;border-right:none;border-radius:0}.i-card-header{display:flex;padding:6px 16px;align-items:center}.i-card-header-content{flex:1;text-align:left}.i-card-header-thumb{display:inline-block;width:64px;height:64px;position:relative;margin-left:auto;margin-right:auto;overflow:hidden;background-size:cover;vertical-align:middle}.i-card-header-title{display:inline-block;vertical-align:middle;font-size:14px;color:#1c2438}.i-card-header-extra{flex:1;text-align:right;font-size:14px;color:#80848f}.i-card-body{position:relative;padding:6px 16px;color:#495060;font-size:14px}.i-card-body::before{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-card-footer{position:relative;padding:6px 16px;color:#80848f;font-size:12px} \ No newline at end of file diff --git a/dist/cell-group/index.js b/dist/cell-group/index.js new file mode 100644 index 0000000..ad36baa --- /dev/null +++ b/dist/cell-group/index.js @@ -0,0 +1,33 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../cell/index': { + type: 'child', + linked () { + this._updateIsLastCell(); + }, + linkChanged () { + this._updateIsLastCell(); + }, + unlinked () { + this._updateIsLastCell(); + } + } + }, + + methods: { + _updateIsLastCell() { + let cells = this.getRelationNodes('../cell/index'); + const len = cells.length; + + if (len > 0) { + let lastIndex = len - 1; + + cells.forEach((cell, index) => { + cell.updateIsLastCell(index === lastIndex); + }); + } + } + } +}); diff --git a/dist/cell-group/index.json b/dist/cell-group/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/cell-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/cell-group/index.wxml b/dist/cell-group/index.wxml new file mode 100644 index 0000000..1897919 --- /dev/null +++ b/dist/cell-group/index.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/dist/cell/index.js b/dist/cell/index.js new file mode 100644 index 0000000..50e635c --- /dev/null +++ b/dist/cell/index.js @@ -0,0 +1,86 @@ +const warn = (msg, getValue) => { + console.warn(msg); + console.log('接受到的值为:', getValue); +}; + +Component({ + externalClasses: ['i-class'], + + options: { + multipleSlots: true + }, + + relations: { + '../cell-group/index': { + type: 'parent' + } + }, + + properties: { + // 左侧标题 + title: { + type: String + }, + // 标题下方的描述信息 + label: { + type: String + }, + // 右侧内容 + value: { + type: String + }, + // 只有点击 footer 区域才触发 tab 事件 + onlyTapFooter: { + type: Boolean + }, + // 是否展示右侧箭头并开启尝试以 url 跳转 + isLink: { + type: null, + value: '' + }, + // 链接类型,可选值为 navigateTo,redirectTo,switchTab,reLaunch + linkType: { + type: String, + value: 'navigateTo' + }, + url: { + type: String, + value: '' + } + }, + + data: { + isLastCell: true + }, + + methods: { + navigateTo () { + const { url } = this.data; + const type = typeof this.data.isLink; + + this.triggerEvent('click', {}); + + if (!this.data.isLink || !url || url === 'true' || url === 'false') return; + + if (type !== 'boolean' && type !== 'string') { + warn('isLink 属性值必须是一个字符串或布尔值', this.data.isLink); + return; + } + + if (['navigateTo', 'redirectTo', 'switchTab', 'reLaunch'].indexOf(this.data.linkType) === -1) { + warn('linkType 属性可选值为 navigateTo,redirectTo,switchTab,reLaunch', this.data.linkType); + return; + } + wx[this.data.linkType].call(wx, {url}); + }, + handleTap () { + if (!this.data.onlyTapFooter) { + this.navigateTo(); + } + }, + + updateIsLastCell (isLastCell) { + this.setData({ isLastCell }); + } + } +}); diff --git a/dist/cell/index.json b/dist/cell/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/cell/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/cell/index.wxml b/dist/cell/index.wxml new file mode 100644 index 0000000..c3683e3 --- /dev/null +++ b/dist/cell/index.wxml @@ -0,0 +1,16 @@ + + + + + + {{ title }} + {{ label }} + + + + {{ value }} + + + + + \ No newline at end of file diff --git a/dist/cell/index.wxss b/dist/cell/index.wxss new file mode 100644 index 0000000..e45ad75 --- /dev/null +++ b/dist/cell/index.wxss @@ -0,0 +1 @@ +.i-cell{position:relative;padding:12px 15px;display:flex;background:#fff;align-items:center;line-height:1.4;font-size:14px;overflow:hidden}.i-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px;left:15px;right:0}.i-cell-last::after{display:none}.i-cell-icon{margin-right:5px}.i-cell-icon:empty{display:none}.i-cell-bd{flex:1}.i-cell-text{line-height:24px;font-size:14px}.i-cell-desc{line-height:1.2;font-size:12px;color:#80848f}.i-cell-ft{position:relative;text-align:right;color:#495060}.i-cell-access .i-cell-ft{padding-right:13px}.i-cell-access .i-cell-ft::after{content:" ";display:inline-block;width:6px;height:6px;position:absolute;top:50%;right:2px;border-width:2px 2px 0 0;border-color:#dddee1;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)} \ No newline at end of file diff --git a/dist/checkbox-group/index.js b/dist/checkbox-group/index.js new file mode 100644 index 0000000..6465450 --- /dev/null +++ b/dist/checkbox-group/index.js @@ -0,0 +1,38 @@ +Component({ + externalClasses: ['i-class'], + relations: { + '../checkbox/index': { + type: 'child', + linked() { + this.changeCurrent(); + }, + linkChanged() { + this.changeCurrent(); + }, + unlinked() { + this.changeCurrent(); + } + } + }, + properties: { + current: { + type: Array, + value: [], + observer: 'changeCurrent' + }, + }, + methods: { + changeCurrent(val = this.data.current) { + let items = this.getRelationNodes('../checkbox/index'); + const len = items.length; + if (len > 0) { + items.forEach(item => { + item.changeCurrent(val.indexOf(item.data.value) !== -1); + }); + } + }, + emitEvent(current) { + this.triggerEvent('change', current); + } + } +}); diff --git a/dist/checkbox-group/index.json b/dist/checkbox-group/index.json new file mode 100644 index 0000000..edf138d --- /dev/null +++ b/dist/checkbox-group/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-cell-group": "../cell-group/index" + } +} diff --git a/dist/checkbox-group/index.wxml b/dist/checkbox-group/index.wxml new file mode 100644 index 0000000..6940180 --- /dev/null +++ b/dist/checkbox-group/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/dist/checkbox-group/index.wxss b/dist/checkbox-group/index.wxss new file mode 100644 index 0000000..e69de29 diff --git a/dist/checkbox/index.js b/dist/checkbox/index.js new file mode 100644 index 0000000..b383952 --- /dev/null +++ b/dist/checkbox/index.js @@ -0,0 +1,56 @@ +const prefixCls = 'i-checkbox'; + +Component({ + externalClasses: ['i-class'], + relations: { + '../checkbox-group/index': { + type: 'parent' + } + }, + properties: { + value: { + type: String, + value: '' + }, + checked: { + type: Boolean, + value: false + }, + disabled: { + type: Boolean, + value: false + }, + color: { + type: String, + value: '#2d8cf0' + }, + position: { + type: String, + value: 'left', //left right + observer: 'setPosition' + } + }, + data: { + checked: true, + positionCls: `${prefixCls}-checkbox-left`, + }, + attached() { + this.setPosition(); + }, + methods: { + changeCurrent(current) { + this.setData({ checked: current }); + }, + checkboxChange() { + if (this.data.disabled) return; + const item = { current: !this.data.checked, value: this.data.value }; + const parent = this.getRelationNodes('../checkbox-group/index')[0]; + parent ? parent.emitEvent(item) : this.triggerEvent('change', item); + }, + setPosition() { + this.setData({ + positionCls: this.data.position.indexOf('left') !== -1 ? `${prefixCls}-checkbox-left` : `${prefixCls}-checkbox-right`, + }); + } + } +}); diff --git a/dist/checkbox/index.json b/dist/checkbox/index.json new file mode 100644 index 0000000..e2ab49a --- /dev/null +++ b/dist/checkbox/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-cell": "../cell/index" + } +} diff --git a/dist/checkbox/index.wxml b/dist/checkbox/index.wxml new file mode 100644 index 0000000..214493f --- /dev/null +++ b/dist/checkbox/index.wxml @@ -0,0 +1,8 @@ + + + + + diff --git a/dist/checkbox/index.wxss b/dist/checkbox/index.wxss new file mode 100644 index 0000000..a07699f --- /dev/null +++ b/dist/checkbox/index.wxss @@ -0,0 +1 @@ +.i-checkbox-cell::after{display:block}.i-checkbox-checkbox-left{float:left}.i-checkbox-checkbox-right{float:right}.i-checkbox-radio{vertical-align:middle}.i-checkbox-title{display:inline-block;vertical-align:middle} \ No newline at end of file diff --git a/dist/col/index.js b/dist/col/index.js new file mode 100644 index 0000000..9b2d65d --- /dev/null +++ b/dist/col/index.js @@ -0,0 +1,20 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../row/index': { + type: 'parent' + } + }, + + properties: { + span: { + value: 0, + type: Number + }, + offset: { + value: 0, + type: Number + } + } +}); diff --git a/dist/col/index.json b/dist/col/index.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/dist/col/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/dist/col/index.wxml b/dist/col/index.wxml new file mode 100644 index 0000000..838a22b --- /dev/null +++ b/dist/col/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/col/index.wxss b/dist/col/index.wxss new file mode 100644 index 0000000..bdce125 --- /dev/null +++ b/dist/col/index.wxss @@ -0,0 +1 @@ +.i-col{float:left;box-sizing:border-box;width:0}.i-col-span-1{display:block;width:4.16666667%}.i-col-offset-1{margin-left:4.16666667%}.i-col-span-2{display:block;width:8.33333333%}.i-col-offset-2{margin-left:8.33333333%}.i-col-span-3{display:block;width:12.5%}.i-col-offset-3{margin-left:12.5%}.i-col-span-4{display:block;width:16.66666667%}.i-col-offset-4{margin-left:16.66666667%}.i-col-span-5{display:block;width:20.83333333%}.i-col-offset-5{margin-left:20.83333333%}.i-col-span-6{display:block;width:25%}.i-col-offset-6{margin-left:25%}.i-col-span-7{display:block;width:29.16666667%}.i-col-offset-7{margin-left:29.16666667%}.i-col-span-8{display:block;width:33.33333333%}.i-col-offset-8{margin-left:33.33333333%}.i-col-span-9{display:block;width:37.5%}.i-col-offset-9{margin-left:37.5%}.i-col-span-10{display:block;width:41.66666667%}.i-col-offset-10{margin-left:41.66666667%}.i-col-span-11{display:block;width:45.83333333%}.i-col-offset-11{margin-left:45.83333333%}.i-col-span-12{display:block;width:50%}.i-col-offset-12{margin-left:50%}.i-col-span-13{display:block;width:54.16666667%}.i-col-offset-13{margin-left:54.16666667%}.i-col-span-14{display:block;width:58.33333333%}.i-col-offset-14{margin-left:58.33333333%}.i-col-span-15{display:block;width:62.5%}.i-col-offset-15{margin-left:62.5%}.i-col-span-16{display:block;width:66.66666667%}.i-col-offset-16{margin-left:66.66666667%}.i-col-span-17{display:block;width:70.83333333%}.i-col-offset-17{margin-left:70.83333333%}.i-col-span-18{display:block;width:75%}.i-col-offset-18{margin-left:75%}.i-col-span-19{display:block;width:79.16666667%}.i-col-offset-19{margin-left:79.16666667%}.i-col-span-20{display:block;width:83.33333333%}.i-col-offset-20{margin-left:83.33333333%}.i-col-span-21{display:block;width:87.5%}.i-col-offset-21{margin-left:87.5%}.i-col-span-22{display:block;width:91.66666667%}.i-col-offset-22{margin-left:91.66666667%}.i-col-span-23{display:block;width:95.83333333%}.i-col-offset-23{margin-left:95.83333333%}.i-col-span-24{display:block;width:100%}.i-col-offset-24{margin-left:100%} \ No newline at end of file diff --git a/dist/collapse-item/index.js b/dist/collapse-item/index.js new file mode 100644 index 0000000..bc415c1 --- /dev/null +++ b/dist/collapse-item/index.js @@ -0,0 +1,46 @@ +Component({ + externalClasses: ['i-class-content', 'i-class-title', 'i-class'], + + relations: { + '../collapse/index': { + type: 'parent', + linked: function (target) { + const options = { + accordion: target.data.accordion + } + if (target.data.name === this.data.name) { + options.showContent = 'i-collapse-item-show-content'; + } + this.setData(options); + } + } + }, + + properties: { + title: String, + name: String + }, + + data: { + showContent: '', + accordion: false + }, + + options: { + multipleSlots: true + }, + + methods: { + trigger(e) { + const data = this.data; + if (data.accordion) { + this.triggerEvent('collapse', {name: data.name}, {composed: true, bubbles: true}); + } else { + this.setData({ + showContent: data.showContent ? '' : 'i-collapse-item-show-content' + }); + } + }, + } +}); + diff --git a/dist/collapse-item/index.json b/dist/collapse-item/index.json new file mode 100644 index 0000000..54575da --- /dev/null +++ b/dist/collapse-item/index.json @@ -0,0 +1,7 @@ + +{ + "component": true, + "usingComponents": { + "i-icon": "../icon/index" + } +} diff --git a/dist/collapse-item/index.wxml b/dist/collapse-item/index.wxml new file mode 100644 index 0000000..ba22b0a --- /dev/null +++ b/dist/collapse-item/index.wxml @@ -0,0 +1,9 @@ + + + + {{title}} + + + + + \ No newline at end of file diff --git a/dist/collapse-item/index.wxss b/dist/collapse-item/index.wxss new file mode 100644 index 0000000..d44c032 --- /dev/null +++ b/dist/collapse-item/index.wxss @@ -0,0 +1 @@ +.i-collapse-item{padding:2px 8px;border-top:1px solid #dddee1}.i-collapse-item-title{vertical-align:middle}.i-collapse-item-title-wrap{padding:2px 0 0}.i-collapse-item-content{padding:6px;display:none}.i-collapse-item-show-content{display:block}.i-collapse-item-arrow{transition:transform .2s ease-in-out}.i-collapse-item-arrow-show{transition:transform .2s ease-in-out;transform:rotate(90deg)} \ No newline at end of file diff --git a/dist/collapse/index.js b/dist/collapse/index.js new file mode 100644 index 0000000..acc1455 --- /dev/null +++ b/dist/collapse/index.js @@ -0,0 +1,31 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../collapse-item/index': { + type: 'child' + } + }, + properties: { + name: String, + accordion: Boolean + }, + methods: { + clickfn(e) { + const params = e.detail; + const allList = this.getRelationNodes('../collapse-item/index'); + allList.forEach((item) => { + if (params.name === item.data.name) { + item.setData({ + showContent: 'i-collapse-item-show-content' + }); + } else { + item.setData({ + showContent: '' + }); + } + }); + }, + } +}); + diff --git a/dist/collapse/index.json b/dist/collapse/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/collapse/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/collapse/index.wxml b/dist/collapse/index.wxml new file mode 100644 index 0000000..0f379f7 --- /dev/null +++ b/dist/collapse/index.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/dist/collapse/index.wxss b/dist/collapse/index.wxss new file mode 100644 index 0000000..e69de29 diff --git a/dist/count-down/index.js b/dist/count-down/index.js new file mode 100644 index 0000000..f1da533 --- /dev/null +++ b/dist/count-down/index.js @@ -0,0 +1,90 @@ +Component({ + properties: { + target: Number, + showDay: Boolean, + callback: String, + format: Array, + clearTimer: Boolean + }, + externalClasses: ['countdown-class'], + data: { + time: '', + resultFormat: [], + changeFormat: false + }, + ready() { + this.getFormat(); + + }, + methods: { + getFormat() { + const data = this.data; + const len = data.format.length; + + if (!data.showDay) data.resultFormat.push(''); + + if (len >= 3) { + for (let i = 0; i < len; i++) { + if (data.resultFormat.length >= 4) break; + if (data.format[i]) { + data.resultFormat.push(data.format[i].toString()); + } + } + + if (data.resultFormat.length >= 4) data.changeFormat = true; + } + + this.getLastTime(); + }, + init() { + const self = this; + setTimeout(function () { + self.getLastTime.call(self); + }, 1000); + }, + getLastTime() { + const data = this.data; + const gapTime = Math.ceil((data.target - new Date().getTime()) / 1000); + let result = ''; + let time = '00:00:00'; + let day = '00'; + const format = data.resultFormat; + + if (gapTime > 0) { + day = this.formatNum(parseInt(gapTime / 86400)); + let lastTime = gapTime % 86400; + const hour = this.formatNum(parseInt(lastTime / 3600)); + lastTime = lastTime % 3600; + const minute = this.formatNum(parseInt(lastTime / 60)); + const second = this.formatNum(lastTime % 60); + + if (data.changeFormat) time = `${hour}${format[1]}${minute}${format[2]}${second}${format[3]}`; + else time = `${hour}:${minute}:${second}`; + + if (!data.clearTimer) this.init.call(this); + } else { + this.endfn(); + } + + if (data.showDay) { + if (data.changeFormat) { + result = `${day}${format[0]} ${time}`; + } else { + result = `${day}d ${time}`; + } + } else { + result = time; + } + this.setData({ + time: result + }); + + }, + formatNum(num) { + return num > 9 ? num : `0${num}`; + }, + endfn() { + this.triggerEvent('callback', {}); + } + } +}); diff --git a/dist/count-down/index.json b/dist/count-down/index.json new file mode 100644 index 0000000..74f1315 --- /dev/null +++ b/dist/count-down/index.json @@ -0,0 +1,4 @@ + +{ + "component": true +} diff --git a/dist/count-down/index.wxml b/dist/count-down/index.wxml new file mode 100644 index 0000000..e4bec57 --- /dev/null +++ b/dist/count-down/index.wxml @@ -0,0 +1,4 @@ + + {{time}} + + diff --git a/dist/count-down/index.wxss b/dist/count-down/index.wxss new file mode 100644 index 0000000..e69de29 diff --git a/dist/divider/index.js b/dist/divider/index.js new file mode 100644 index 0000000..6b0e448 --- /dev/null +++ b/dist/divider/index.js @@ -0,0 +1,25 @@ +Component({ + externalClasses: ['i-class'], + properties: { + content: { + type: String, + value: '' + }, + height : { + type: Number, + value: 48 + }, + color : { + type : String, + value : '#80848f' + }, + lineColor : { + type : String, + value : '#e9eaec' + }, + size : { + type: String, + value: 12 + } + } +}); diff --git a/dist/divider/index.json b/dist/divider/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/divider/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/divider/index.wxml b/dist/divider/index.wxml new file mode 100644 index 0000000..b7111d3 --- /dev/null +++ b/dist/divider/index.wxml @@ -0,0 +1,19 @@ + + + {{content}} + + + + + + + + module.exports = { + getStyle : function(color,size,height){ + var color = 'color:' + color +';'; + var size = 'font-size:' + size + 'px;'; + var height = 'height:' + height+'px;' + return color + size + height; + } + } + diff --git a/dist/divider/index.wxss b/dist/divider/index.wxss new file mode 100644 index 0000000..98827ab --- /dev/null +++ b/dist/divider/index.wxss @@ -0,0 +1 @@ +.i-divider{width:100%;text-align:center;font-size:12px;position:relative;display:flex;align-items:center;justify-content:center}.i-divider-line{position:absolute;left:0;width:100%;height:1rpx;background-color:#f7f7f7;top:50%}.i-divider-content{background:#fff;position:relative;z-index:1;display:inline-block;padding:0 10px} \ No newline at end of file diff --git a/dist/drawer/index.js b/dist/drawer/index.js new file mode 100644 index 0000000..adb248a --- /dev/null +++ b/dist/drawer/index.js @@ -0,0 +1,33 @@ +Component({ + externalClasses: ['i-class'], + properties: { + visible: { + type: Boolean, + value: false + }, + + mask: { + type: Boolean, + value: true + }, + + maskClosable: { + type: Boolean, + value: true + }, + + mode: { + type: String, + value: 'left' // left right + } + }, + data: {}, + methods: { + handleMaskClick() { + if (!this.data.maskClosable) { + return; + } + this.triggerEvent('close', {}); + } + } +}); diff --git a/dist/drawer/index.json b/dist/drawer/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/drawer/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/drawer/index.wxml b/dist/drawer/index.wxml new file mode 100644 index 0000000..67380d9 --- /dev/null +++ b/dist/drawer/index.wxml @@ -0,0 +1,6 @@ + + + + + + diff --git a/dist/drawer/index.wxss b/dist/drawer/index.wxss new file mode 100644 index 0000000..2824713 --- /dev/null +++ b/dist/drawer/index.wxss @@ -0,0 +1 @@ +.i-drawer{visibility:hidden}.i-drawer-show{visibility:visible}.i-drawer-show .i-drawer-mask{display:block;opacity:1}.i-drawer-show .i-drawer-container{opacity:1}.i-drawer-show.i-drawer-left .i-drawer-container,.i-drawer-show.i-drawer-right .i-drawer-container{transform:translate3d(0,-50%,0)}.i-drawer-mask{opacity:0;position:fixed;top:0;left:0;right:0;bottom:0;z-index:6;background:rgba(0,0,0,.6);transition:all .3s ease-in-out}.i-drawer-container{position:fixed;left:50%;top:50%;transform:translate3d(-50%,-50%,0);transform-origin:center;transition:all .3s ease-in-out;z-index:7;opacity:0}.i-drawer-left .i-drawer-container{left:0;top:50%;transform:translate3d(-100%,-50%,0)}.i-drawer-right .i-drawer-container{right:0;top:50%;left:auto;transform:translate3d(100%,-50%,0)} \ No newline at end of file diff --git a/dist/grid-icon/index.js b/dist/grid-icon/index.js new file mode 100644 index 0000000..5315185 --- /dev/null +++ b/dist/grid-icon/index.js @@ -0,0 +1,10 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../grid-item/index': { + type: 'parent' + } + }, + +}); diff --git a/dist/grid-icon/index.json b/dist/grid-icon/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/grid-icon/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/grid-icon/index.wxml b/dist/grid-icon/index.wxml new file mode 100644 index 0000000..b9f9025 --- /dev/null +++ b/dist/grid-icon/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/grid-icon/index.wxss b/dist/grid-icon/index.wxss new file mode 100644 index 0000000..88c58a7 --- /dev/null +++ b/dist/grid-icon/index.wxss @@ -0,0 +1 @@ +.i-grid-icon{display:block;width:28px;height:28px;margin:0 auto}.i-grid-icon image{width:100%;height:100%} \ No newline at end of file diff --git a/dist/grid-item/index.js b/dist/grid-item/index.js new file mode 100644 index 0000000..e492542 --- /dev/null +++ b/dist/grid-item/index.js @@ -0,0 +1,16 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../grid/index': { + type: 'parent' + }, + '../grid-icon/index': { + type: 'child' + } + }, + + data: { + width: '33.33%' + } +}); diff --git a/dist/grid-item/index.json b/dist/grid-item/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/grid-item/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/grid-item/index.wxml b/dist/grid-item/index.wxml new file mode 100644 index 0000000..8e133cd --- /dev/null +++ b/dist/grid-item/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/grid-item/index.wxss b/dist/grid-item/index.wxss new file mode 100644 index 0000000..ed0f395 --- /dev/null +++ b/dist/grid-item/index.wxss @@ -0,0 +1 @@ +.i-grid-item{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid #e9eaec;border-bottom:1rpx solid #e9eaec} \ No newline at end of file diff --git a/dist/grid-label/index.js b/dist/grid-label/index.js new file mode 100644 index 0000000..5315185 --- /dev/null +++ b/dist/grid-label/index.js @@ -0,0 +1,10 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../grid-item/index': { + type: 'parent' + } + }, + +}); diff --git a/dist/grid-label/index.json b/dist/grid-label/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/grid-label/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/grid-label/index.wxml b/dist/grid-label/index.wxml new file mode 100644 index 0000000..7ab5a8a --- /dev/null +++ b/dist/grid-label/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/grid-label/index.wxss b/dist/grid-label/index.wxss new file mode 100644 index 0000000..d45a990 --- /dev/null +++ b/dist/grid-label/index.wxss @@ -0,0 +1 @@ +.i-grid-label{margin-top:5px;display:block;text-align:center;color:#1c2438;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden} \ No newline at end of file diff --git a/dist/grid/index.js b/dist/grid/index.js new file mode 100644 index 0000000..f9c9c40 --- /dev/null +++ b/dist/grid/index.js @@ -0,0 +1,50 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../grid-item/index': { + type: 'child', + linked () { + this.setGridItemWidth(); + }, + linkChanged () { + this.setGridItemWidth(); + }, + unlinked () { + this.setGridItemWidth(); + } + } + }, + + methods: { + setGridItemWidth () { + const nodes = this.getRelationNodes('../grid-item/index'); + + // const len = nodes.length; + // if (len < 3) { + // nodes.forEach(item => { + // item.setData({ + // 'width': '33.33%' + // }); + // }); + // } else { + // const width = 100 / nodes.length; + // nodes.forEach(item => { + // item.setData({ + // 'width': width + '%' + // }); + // }); + // } + const width = 100 / nodes.length; + nodes.forEach(item => { + item.setData({ + 'width': width + '%' + }); + }); + } + }, + + ready () { + this.setGridItemWidth(); + } +}); diff --git a/dist/grid/index.json b/dist/grid/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/grid/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/grid/index.wxml b/dist/grid/index.wxml new file mode 100644 index 0000000..4c9143c --- /dev/null +++ b/dist/grid/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/grid/index.wxss b/dist/grid/index.wxss new file mode 100644 index 0000000..842fc98 --- /dev/null +++ b/dist/grid/index.wxss @@ -0,0 +1 @@ +.i-grid{border-top:1rpx solid #e9eaec;border-left:1rpx solid #e9eaec;overflow:hidden} \ No newline at end of file diff --git a/dist/icon/index.js b/dist/icon/index.js new file mode 100644 index 0000000..eb43ab9 --- /dev/null +++ b/dist/icon/index.js @@ -0,0 +1,22 @@ +Component({ + externalClasses: ['i-class'], + + properties: { + type: { + type: String, + value: '' + }, + custom: { + type: String, + value: '' + }, + size: { + type: Number, + value: 14 + }, + color: { + type: String, + value: '' + } + } +}); diff --git a/dist/icon/index.json b/dist/icon/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/icon/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/icon/index.wxml b/dist/icon/index.wxml new file mode 100644 index 0000000..d689bc5 --- /dev/null +++ b/dist/icon/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icon/index.wxss b/dist/icon/index.wxss new file mode 100644 index 0000000..b18dcbb --- /dev/null +++ b/dist/icon/index.wxss @@ -0,0 +1 @@ +@font-face{font-family:iconfont;src:url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAADscAAsAAAAAdLQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAAQwAAAFZW7klYY21hcAAAAYAAAAORAAAI/nDS68xnbHlmAAAFFAAAL68AAF2IQcM2EGhlYWQAADTEAAAALwAAADYRc1XVaGhlYQAANPQAAA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3xPIpZzI9UB4yZhlTzD/SU4GNqdTMXO8trIwx1yi2YFY3lG+nubDCwuBFk6KehQYo0uBV+WZn4MfahFK4S28bI6XCp7HYmz/vDSxtgM2Z8MbGa/zpaKCC8PbNEB5crLb0j3hMmKbTNpEx8KkjGROOtWxYKv/PqgQ5aud3Rt6VATQYeCinARd8ZfYGXLyXo07Ue/sLJVFnfG0UUlMy5YU8peSPeEoJKKRbUta7mZyqIQw65xT0JpSqamDaemVf1UT4JGkG3cGX9sh/oajTxOG0X40CceW8lWqRmkDh8qljc2Z8yr8Y6OFStsH5apYjYa30SRx3awLtSh6vIY2I6qA83qfLpfpOOeJNqu9QkNHUx0SfpYQgenunXvRL/NEzvqxp4Z6Q03tDzSW21Ytef+dF+JjM2JVEHXMvGuj2YdElz7DZOBxYZXfa46tDCK1FqQXYune0JosX1YnPVb2jqX4ZrnTCbOemc2RNW89jU/7kmkGVG0TPzgXqWmzawH5VLK3Icb61L6y/FukOOXJurS0DZRWxdS5IeFfUBqyvuyj+1rU0nbt9vR6F8KbDL8') format('woff')}.i-icon{display:inline-block;font-family:iconfont;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:auto;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:middle}.i-icon-accessory:before{content:"\e6dd"}.i-icon-activity:before{content:"\e6de"}.i-icon-activity_fill:before{content:"\e6df"}.i-icon-add:before{content:"\e6e0"}.i-icon-addressbook_fill:before{content:"\e6e2"}.i-icon-addressbook:before{content:"\e6e3"}.i-icon-barrage_fill:before{content:"\e6e4"}.i-icon-barrage:before{content:"\e6e5"}.i-icon-browse_fill:before{content:"\e6e6"}.i-icon-browse:before{content:"\e6e7"}.i-icon-brush:before{content:"\e6e8"}.i-icon-brush_fill:before{content:"\e6e9"}.i-icon-businesscard_fill:before{content:"\e6ea"}.i-icon-businesscard:before{content:"\e6eb"}.i-icon-camera_fill:before{content:"\e6ec"}.i-icon-camera:before{content:"\e6ed"}.i-icon-clock_fill:before{content:"\e6ee"}.i-icon-clock:before{content:"\e6ef"}.i-icon-close:before{content:"\e6f0"}.i-icon-collection_fill:before{content:"\e6f1"}.i-icon-collection:before{content:"\e6f2"}.i-icon-computer_fill:before{content:"\e6f3"}.i-icon-computer:before{content:"\e6f4"}.i-icon-coordinates_fill:before{content:"\e6f5"}.i-icon-coordinates:before{content:"\e6f6"}.i-icon-coupons_fill:before{content:"\e6f7"}.i-icon-coupons:before{content:"\e6f8"}.i-icon-createtask_fill:before{content:"\e6f9"}.i-icon-createtask:before{content:"\e6fa"}.i-icon-customerservice_fill:before{content:"\e6fb"}.i-icon-customerservice:before{content:"\e6fc"}.i-icon-delete_fill:before{content:"\e6fd"}.i-icon-delete:before{content:"\e6fe"}.i-icon-document:before{content:"\e6ff"}.i-icon-document_fill:before{content:"\e700"}.i-icon-dynamic_fill:before{content:"\e701"}.i-icon-dynamic:before{content:"\e702"}.i-icon-editor:before{content:"\e703"}.i-icon-eit:before{content:"\e704"}.i-icon-emoji_fill:before{content:"\e705"}.i-icon-emoji:before{content:"\e706"}.i-icon-enter:before{content:"\e707"}.i-icon-enterinto:before{content:"\e708"}.i-icon-enterinto_fill:before{content:"\e709"}.i-icon-feedback_fill:before{content:"\e70a"}.i-icon-feedback:before{content:"\e70b"}.i-icon-flag_fill:before{content:"\e70c"}.i-icon-flag:before{content:"\e70d"}.i-icon-flashlight:before{content:"\e70e"}.i-icon-flashlight_fill:before{content:"\e70f"}.i-icon-fullscreen:before{content:"\e710"}.i-icon-group:before{content:"\e711"}.i-icon-group_fill:before{content:"\e712"}.i-icon-homepage_fill:before{content:"\e713"}.i-icon-homepage:before{content:"\e714"}.i-icon-integral_fill:before{content:"\e715"}.i-icon-integral:before{content:"\e716"}.i-icon-interactive_fill:before{content:"\e717"}.i-icon-interactive:before{content:"\e718"}.i-icon-keyboard:before{content:"\e719"}.i-icon-label:before{content:"\e71a"}.i-icon-label_fill:before{content:"\e71b"}.i-icon-like_fill:before{content:"\e71c"}.i-icon-like:before{content:"\e71d"}.i-icon-live_fill:before{content:"\e71e"}.i-icon-live:before{content:"\e71f"}.i-icon-lock_fill:before{content:"\e720"}.i-icon-lock:before{content:"\e721"}.i-icon-mail:before{content:"\e722"}.i-icon-mail_fill:before{content:"\e723"}.i-icon-message:before{content:"\e724"}.i-icon-message_fill:before{content:"\e725"}.i-icon-mine:before{content:"\e726"}.i-icon-mine_fill:before{content:"\e727"}.i-icon-mobilephone_fill:before{content:"\e728"}.i-icon-mobilephone:before{content:"\e729"}.i-icon-more:before{content:"\e72a"}.i-icon-narrow:before{content:"\e72b"}.i-icon-offline_fill:before{content:"\e72c"}.i-icon-offline:before{content:"\e72d"}.i-icon-other:before{content:"\e72e"}.i-icon-picture_fill:before{content:"\e72f"}.i-icon-picture:before{content:"\e730"}.i-icon-play:before{content:"\e731"}.i-icon-play_fill:before{content:"\e732"}.i-icon-playon_fill:before{content:"\e733"}.i-icon-playon:before{content:"\e734"}.i-icon-praise_fill:before{content:"\e735"}.i-icon-praise:before{content:"\e736"}.i-icon-prompt_fill:before{content:"\e737"}.i-icon-prompt:before{content:"\e738"}.i-icon-redpacket_fill:before{content:"\e739"}.i-icon-redpacket:before{content:"\e73a"}.i-icon-refresh:before{content:"\e73b"}.i-icon-remind_fill:before{content:"\e73c"}.i-icon-remind:before{content:"\e73d"}.i-icon-return:before{content:"\e73e"}.i-icon-right:before{content:"\e73f"}.i-icon-scan:before{content:"\e740"}.i-icon-send:before{content:"\e741"}.i-icon-service_fill:before{content:"\e742"}.i-icon-service:before{content:"\e743"}.i-icon-setup_fill:before{content:"\e744"}.i-icon-setup:before{content:"\e745"}.i-icon-share_fill:before{content:"\e746"}.i-icon-share:before{content:"\e747"}.i-icon-success_fill:before{content:"\e748"}.i-icon-success:before{content:"\e749"}.i-icon-suspend:before{content:"\e74a"}.i-icon-switch:before{content:"\e74b"}.i-icon-systemprompt_fill:before{content:"\e74c"}.i-icon-systemprompt:before{content:"\e74d"}.i-icon-tailor:before{content:"\e74e"}.i-icon-task:before{content:"\e74f"}.i-icon-task_fill:before{content:"\e750"}.i-icon-tasklist_fill:before{content:"\e751"}.i-icon-tasklist:before{content:"\e752"}.i-icon-time_fill:before{content:"\e753"}.i-icon-time:before{content:"\e754"}.i-icon-translation_fill:before{content:"\e755"}.i-icon-translation:before{content:"\e756"}.i-icon-trash:before{content:"\e757"}.i-icon-trash_fill:before{content:"\e758"}.i-icon-undo:before{content:"\e759"}.i-icon-video:before{content:"\e75a"}.i-icon-video_fill:before{content:"\e75b"}.i-icon-warning_fill:before{content:"\e75c"}.i-icon-warning:before{content:"\e75d"}.i-icon-search:before{content:"\e75e"}.i-icon-searchfill:before{content:"\e75f"}.i-icon-publishgoods_fill:before{content:"\e760"}.i-icon-shop_fill:before{content:"\e761"}.i-icon-transaction_fill:before{content:"\e762"}.i-icon-packup:before{content:"\e763"}.i-icon-unfold:before{content:"\e764"}.i-icon-financial_fill:before{content:"\e765"}.i-icon-commodity:before{content:"\e766"} \ No newline at end of file diff --git a/dist/index-item/index.js b/dist/index-item/index.js new file mode 100644 index 0000000..ed818df --- /dev/null +++ b/dist/index-item/index.js @@ -0,0 +1,32 @@ +Component({ + externalClasses: ['i-class'], + properties : { + name : { + type : String, + value : '' + } + }, + relations : { + '../index/index' : { + type : 'parent' + } + }, + data : { + top : 0, + height : 0, + currentName : '' + }, + methods: { + updateDataChange() { + const className = '.i-index-item'; + const query = wx.createSelectorQuery().in(this); + query.select( className ).boundingClientRect((res)=>{ + this.setData({ + top : res.top, + height : res.height, + currentName : this.data.name + }) + }).exec() + } + } +}) \ No newline at end of file diff --git a/dist/index-item/index.json b/dist/index-item/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/index-item/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/index-item/index.wxml b/dist/index-item/index.wxml new file mode 100644 index 0000000..8986c8d --- /dev/null +++ b/dist/index-item/index.wxml @@ -0,0 +1,11 @@ + + {{name}} + + + + + + module.exports = { + + } + diff --git a/dist/index-item/index.wxss b/dist/index-item/index.wxss new file mode 100644 index 0000000..aeecf8d --- /dev/null +++ b/dist/index-item/index.wxss @@ -0,0 +1 @@ +.i-index-item-header{height:30px;line-height:30px;background:#eee;font-size:14px;padding-left:10px;width:100%;box-sizing:border-box}.i-index-item-content{font-size:14px} \ No newline at end of file diff --git a/dist/index/index.js b/dist/index/index.js new file mode 100644 index 0000000..c556f19 --- /dev/null +++ b/dist/index/index.js @@ -0,0 +1,158 @@ +Component({ + externalClasses: ['i-class'], + properties : { + height : { + type : String, + value : '300' + }, + itemHeight : { + type : Number, + value : 18 + } + }, + relations : { + '../index-item/index' : { + type : 'child', + linked(){ + this._updateDataChange(); + }, + linkChanged () { + this._updateDataChange(); + }, + unlinked () { + this._updateDataChange(); + } + } + }, + data : { + scrollTop : 0, + fixedData : [], + current : 0, + timer : null, + startTop : 0, + itemLength : 0, + currentName : '', + isTouches : false + }, + methods : { + loop(){}, + _updateDataChange( ){ + const indexItems = this.getRelationNodes('../index-item/index'); + const len = indexItems.length; + const fixedData = this.data.fixedData; + /* + * 使用函数节流限制重复去设置数组内容进而限制多次重复渲染 + * 暂时没有研究微信在渲染的时候是否会进行函数节流 + */ + if (len > 0) { + + if( this.data.timer ){ + clearTimeout( this.data.timer ) + this.setData({ + timer : null + }) + } + + this.data.timer = setTimeout(()=>{ + const data = []; + indexItems.forEach((item) => { + if( item.data.name && fixedData.indexOf( item.data.name ) === -1 ){ + data.push(item.data.name); + item.updateDataChange(); + } + }) + this.setData({ + fixedData : data, + itemLength : indexItems.length + }) + //组件加载完成之后重新设置顶部高度 + this.setTouchStartVal(); + },0); + this.setData({ + timer : this.data.timer + }) + + } + }, + handlerScroll(event){ + const detail = event.detail; + const scrollTop = detail.scrollTop; + const indexItems = this.getRelationNodes('../index-item/index'); + indexItems.forEach((item,index)=>{ + let data = item.data; + let offset = data.top + data.height; + if( scrollTop < offset && scrollTop >= data.top ){ + this.setData({ + current : index, + currentName : data.currentName + }) + } + }) + }, + getCurrentItem(index){ + const indexItems = this.getRelationNodes('../index-item/index'); + let result = {}; + result = indexItems[index].data; + result.total = indexItems.length; + return result; + }, + triggerCallback(options){ + this.triggerEvent('change',options) + }, + handlerFixedTap(event){ + const eindex = event.currentTarget.dataset.index; + const item = this.getCurrentItem(eindex); + this.setData({ + scrollTop : item.top, + currentName : item.currentName, + isTouches : true + }) + this.triggerCallback({ + index : eindex, + current : item.currentName + }) + }, + handlerTouchMove(event){ + const data = this.data; + const touches = event.touches[0] || {}; + const pageY = touches.pageY; + const rest = pageY - data.startTop; + let index = Math.ceil( rest/data.itemHeight ); + index = index >= data.itemLength ? data.itemLength -1 : index; + const movePosition = this.getCurrentItem(index); + + /* + * 当touch选中的元素和当前currentName不相等的时候才震动一下 + * 微信震动事件 + */ + if( movePosition.name !== this.data.currentName ){ + wx.vibrateShort(); + } + + this.setData({ + scrollTop : movePosition.top, + currentName : movePosition.name, + isTouches : true + }) + + this.triggerCallback({ + index : index, + current : movePosition.name + }) + }, + handlerTouchEnd(){ + this.setData({ + isTouches : false + }) + }, + setTouchStartVal(){ + const className = '.i-index-fixed'; + const query = wx.createSelectorQuery().in(this); + query.select( className ).boundingClientRect((res)=>{ + this.setData({ + startTop : res.top + }) + }).exec() + } + } +}) \ No newline at end of file diff --git a/dist/index/index.json b/dist/index/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/index/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/index/index.wxml b/dist/index/index.wxml new file mode 100644 index 0000000..f83d847 --- /dev/null +++ b/dist/index/index.wxml @@ -0,0 +1,38 @@ + + + + + + {{item}} + + + {{currentName}} + + + + module.exports = { + setScrollStyle : function(height){ + var units = ['%','px','rem','rpx','em','rem']; + var hasUnits = false; + for( var i = 0; i < units.length;i++ ){ + var u = units[i]; + if( height.indexOf( u ) > -1 ){ + hasUnits = true; + break; + } + } + return 'height:'+ ( hasUnits ? height : height+'px' ); + } + } + diff --git a/dist/index/index.wxss b/dist/index/index.wxss new file mode 100644 index 0000000..c0887c1 --- /dev/null +++ b/dist/index/index.wxss @@ -0,0 +1 @@ +.i-index{width:100%;height:100%}.i-index-line{position:absolute;left:0;width:100%;height:1rpx;background-color:#f7f7f7;top:50%}.i-index-content{background:#fff;position:relative;z-index:1;display:inline-block;padding:0 10px}.i-index-fixed{position:fixed;right:0;top:50%;z-index:10;padding-left:10px;transform:translateY(-50%)}.i-index-fixed-item{display:block;height:18px;line-height:18px;padding:0 5px;text-align:center;color:#2d8cf0;font-size:12px;border-radius:50%}.i-index-fixed-item-current{background:#2d8cf0;color:#fff}.i-index-tooltip{position:fixed;left:50%;top:50%;transform:translate3d(-50%,-50%,0);background:rgba(0,0,0,.7);color:#fff;font-size:24px;border-radius:50%;width:80px;height:80px;line-height:80px;text-align:center} \ No newline at end of file diff --git a/dist/input-number/index.js b/dist/input-number/index.js new file mode 100644 index 0000000..7a7d3f5 --- /dev/null +++ b/dist/input-number/index.js @@ -0,0 +1,101 @@ +function addNum (num1, num2) { + let sq1, sq2, m; + try { + sq1 = num1.toString().split('.')[1].length; + } + catch (e) { + sq1 = 0; + } + try { + sq2 = num2.toString().split('.')[1].length; + } + catch (e) { + sq2 = 0; + } + m = Math.pow(10, Math.max(sq1, sq2)); + return (Math.round(num1 * m) + Math.round(num2 * m)) / m; +} + +Component({ + externalClasses: ['i-class'], + + properties: { + // small || default || large + size: String, + value: { + type: Number, + value: 1 + }, + min: { + type: Number, + value: -Infinity + }, + max: { + type: Number, + value: Infinity + }, + step: { + type: Number, + value: 1 + } + }, + + + methods: { + handleChangeStep(e, type) { + const { dataset = {} } = e.currentTarget; + const { disabled } = dataset; + const { step } = this.data; + let { value } = this.data; + + if (disabled) return null; + + if (type === 'minus') { + value = addNum(value, -step); + } else if (type === 'plus') { + value = addNum(value, step); + } + + if (value < this.data.min || value > this.data.max) return null; + + this.handleEmit(value, type); + }, + + handleMinus(e) { + this.handleChangeStep(e, 'minus'); + }, + + handlePlus(e) { + this.handleChangeStep(e, 'plus'); + }, + + handleBlur(e) { + let { value } = e.detail; + const { min, max } = this.data; + + if (!value) { + setTimeout(() => { + this.handleEmit(value); + }, 16); + return; + } + + value = +value; + if (value > max) { + value = max; + } else if (value < min) { + value = min; + } + + this.handleEmit(value); + }, + handleEmit (value, type) { + const data = { + value: value + }; + if (type) data.type = type; + + this.triggerEvent('change', data); + } + } +}); diff --git a/dist/input-number/index.json b/dist/input-number/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/input-number/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/input-number/index.wxml b/dist/input-number/index.wxml new file mode 100644 index 0000000..b3503f4 --- /dev/null +++ b/dist/input-number/index.wxml @@ -0,0 +1,5 @@ + + - + + + + diff --git a/dist/input-number/index.wxss b/dist/input-number/index.wxss new file mode 100644 index 0000000..f696bb4 --- /dev/null +++ b/dist/input-number/index.wxss @@ -0,0 +1 @@ +.i-input-number{color:#495060}.i-input-number view{display:inline-block;line-height:20px;padding:5px 0;text-align:center;min-width:40px;box-sizing:border-box;vertical-align:middle;font-size:12px;border:1rpx solid #dddee1}.i-input-number-minus{border-right:none;border-radius:2px 0 0 2px}.i-input-number-plus{border-left:none;border-radius:0 2px 2px 0}.i-input-number-text{border:1rpx solid #dddee1;display:inline-block;text-align:center;vertical-align:middle;height:30px;width:40px;min-height:auto;font-size:12px;line-height:30px}.i-input-number-disabled{border-color:#dddee1;color:#bbbec4;background:#f7f7f7} \ No newline at end of file diff --git a/dist/input/index.js b/dist/input/index.js new file mode 100644 index 0000000..c9d4c41 --- /dev/null +++ b/dist/input/index.js @@ -0,0 +1,61 @@ +Component({ + behaviors: ['wx://form-field'], + + externalClasses: ['i-class'], + + properties: { + title: { + type: String + }, + // text || textarea || password || number + type: { + type: String, + value: 'text' + }, + disabled: { + type: Boolean, + value: false + }, + placeholder: { + type: String, + value: '' + }, + autofocus: { + type: Boolean, + value: false + }, + mode: { + type: String, + value: 'normal' + }, + right: { + type: Boolean, + value: false + }, + error: { + type: Boolean, + value: false + }, + maxlength: { + type: Number + } + }, + + methods: { + handleInputChange(event) { + const { detail = {} } = event; + const { value = '' } = detail; + this.setData({ value }); + + this.triggerEvent('change', event); + }, + + handleInputFocus(event) { + this.triggerEvent('focus', event); + }, + + handleInputBlur(event) { + this.triggerEvent('blur', event); + } + } +}); diff --git a/dist/input/index.json b/dist/input/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/input/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/input/index.wxml b/dist/input/index.wxml new file mode 100644 index 0000000..52b0ee3 --- /dev/null +++ b/dist/input/index.wxml @@ -0,0 +1,31 @@ + + {{ title }} + + + diff --git a/dist/input/index.wxss b/dist/input/index.wxss new file mode 100644 index 0000000..9e7e9c1 --- /dev/null +++ b/dist/input/index.wxss @@ -0,0 +1 @@ +.i-cell{position:relative;padding:12px 15px;display:flex;background:#fff;align-items:center;line-height:1.4;font-size:14px;overflow:hidden}.i-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px;left:15px;right:0}.i-cell-last::after{display:none}.i-cell-icon{margin-right:5px}.i-cell-icon:empty{display:none}.i-cell-bd{flex:1}.i-cell-text{line-height:24px;font-size:14px}.i-cell-desc{line-height:1.2;font-size:12px;color:#80848f}.i-cell-ft{position:relative;text-align:right;color:#495060}.i-cell-access .i-cell-ft{padding-right:13px}.i-cell-access .i-cell-ft::after{content:" ";display:inline-block;width:6px;height:6px;position:absolute;top:50%;right:2px;border-width:2px 2px 0 0;border-color:#dddee1;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.i-input{padding:7px 15px;color:#495060}.i-input-wrapped{margin:10px 15px;background-color:#fff}.i-input-wrapped::after{left:0;border-width:1px;border-radius:4px}.i-input-error{color:#ed3f14}.i-input-title{color:#495060;min-width:65px;padding-right:10px}.i-input-input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.i-input-placeholder{font-size:14px}.i-input-input-right{text-align:right}.i-input.i-input-wrapped::after{display:block}.i-input-wrapped.i-input-error::after{border-color:#ed3f14} \ No newline at end of file diff --git a/dist/load-more/index.js b/dist/load-more/index.js new file mode 100644 index 0000000..d0cd46c --- /dev/null +++ b/dist/load-more/index.js @@ -0,0 +1,14 @@ +Component({ + externalClasses: ['i-class'], + + properties: { + loading: { + type: Boolean, + value: true + }, + tip: { + type: String, + value: '' + } + }, +}); diff --git a/dist/load-more/index.json b/dist/load-more/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/load-more/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/load-more/index.wxml b/dist/load-more/index.wxml new file mode 100644 index 0000000..66571af --- /dev/null +++ b/dist/load-more/index.wxml @@ -0,0 +1,8 @@ + + + + {{ tip }} + 正在加载 + + + \ No newline at end of file diff --git a/dist/load-more/index.wxss b/dist/load-more/index.wxss new file mode 100644 index 0000000..ffe4026 --- /dev/null +++ b/dist/load-more/index.wxss @@ -0,0 +1 @@ +.i-load-more{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.i-load-more-loading{display:inline-block;margin-right:12px;vertical-align:middle;width:14px;height:14px;background:0 0;border-radius:50%;border:2px solid #e9eaec;border-color:#e9eaec #e9eaec #e9eaec #2d8cf0;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-load-more-tip{display:inline-block;vertical-align:middle;color:#495060}.i-load-more-line{border-top:1px solid #dddee1;display:flex;border-top:0}.i-load-more-line::before{position:relative;top:-1px;-webkit-box-flex:1;-webkit-flex:1;flex:1;content:'';border-top:1px solid #dddee1}.i-load-more-line::after{position:relative;top:-1px;-webkit-box-flex:1;-webkit-flex:1;flex:1;content:'';border-top:1px solid #dddee1}.i-load-more-line .i-load-more-tip{position:relative;top:-.9em;padding:0 .55em}.i-load-more-empty{width:4px;height:4px;border-radius:50%;background-color:#e5e5e5;display:inline-block;position:relative;vertical-align:0;top:-.16em}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/dist/message/index.js b/dist/message/index.js new file mode 100644 index 0000000..21a6d68 --- /dev/null +++ b/dist/message/index.js @@ -0,0 +1,45 @@ +const default_data = { + visible: false, + content: '', + duration: 2, + type: 'default', // default || success || warning || error +}; + +let timmer = null; + +Component({ + externalClasses: ['i-class'], + + data: { + ...default_data + }, + + methods: { + handleShow (options) { + const { type = 'default', duration = 2 } = options; + + this.setData({ + ...options, + type, + duration, + visible: true + }); + + const d = this.data.duration * 1000; + + if (timmer) clearTimeout(timmer); + if (d !== 0) { + timmer = setTimeout(() => { + this.handleHide(); + timmer = null; + }, d); + } + }, + + handleHide () { + this.setData({ + ...default_data + }); + } + } +}); \ No newline at end of file diff --git a/dist/message/index.json b/dist/message/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/message/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/message/index.wxml b/dist/message/index.wxml new file mode 100644 index 0000000..aecaad9 --- /dev/null +++ b/dist/message/index.wxml @@ -0,0 +1,3 @@ + + {{ content }} + \ No newline at end of file diff --git a/dist/message/index.wxss b/dist/message/index.wxss new file mode 100644 index 0000000..e6a79a6 --- /dev/null +++ b/dist/message/index.wxss @@ -0,0 +1 @@ +.i-message{display:block;width:100%;min-height:32px;line-height:2.3;position:fixed;top:0;left:0;right:0;background:#2d8cf0;color:#fff;text-align:center;font-size:14px;z-index:1010;opacity:0;-webkit-transform:translateZ(0) translateY(-100%);transition:all .4s ease-in-out}.i-message-show{-webkit-transform:translateZ(0) translateY(0);opacity:1}.i-message-default{background:#2d8cf0}.i-message-success{background:#19be6b}.i-message-warning{background:#f90}.i-message-error{background:#ed3f14} \ No newline at end of file diff --git a/dist/modal/index.js b/dist/modal/index.js new file mode 100644 index 0000000..ae178e5 --- /dev/null +++ b/dist/modal/index.js @@ -0,0 +1,54 @@ +Component({ + externalClasses: ['i-class', 'i-class-mask'], + + properties: { + visible: { + type: Boolean, + value: false + }, + title: { + type: String, + value: '' + }, + showOk: { + type: Boolean, + value: true + }, + showCancel: { + type: Boolean, + value: true + }, + okText: { + type: String, + value: '确定' + }, + cancelText: { + type: String, + value: '取消' + }, + // 按钮组,有此值时,不显示 ok 和 cancel 按钮 + actions: { + type: Array, + value: [] + }, + // horizontal || vertical + actionMode: { + type: String, + value: 'horizontal' + } + }, + + methods: { + handleClickItem ({ currentTarget = {} }) { + const dataset = currentTarget.dataset || {}; + const { index } = dataset; + this.triggerEvent('click', { index }); + }, + handleClickOk () { + this.triggerEvent('ok'); + }, + handleClickCancel () { + this.triggerEvent('cancel'); + } + } +}); diff --git a/dist/modal/index.json b/dist/modal/index.json new file mode 100644 index 0000000..50d034a --- /dev/null +++ b/dist/modal/index.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "i-grid": "../grid/index", + "i-grid-item": "../grid-item/index", + "i-button": "../button/index", + "i-icon": "../icon/index" + } +} diff --git a/dist/modal/index.wxml b/dist/modal/index.wxml new file mode 100644 index 0000000..11bcbd4 --- /dev/null +++ b/dist/modal/index.wxml @@ -0,0 +1,40 @@ + + + + + {{ title }} + + + + + + + + + + + + + + + + + + + {{ cancelText }} + + + {{ okText }} + + + + + + + \ No newline at end of file diff --git a/dist/modal/index.wxss b/dist/modal/index.wxss new file mode 100644 index 0000000..d1c42fc --- /dev/null +++ b/dist/modal/index.wxss @@ -0,0 +1 @@ +.i-modal{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;height:100%;z-index:1000;display:flex;outline:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;transform:translateZ(1px);opacity:0;visibility:hidden}.i-modal-show{visibility:visible;opacity:1}.i-modal-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);z-index:1000;transition:all .2s ease-in-out;opacity:0;visibility:hidden}.i-modal-mask-show{opacity:1;visibility:visible}.i-modal-main{width:270px;position:relative}.i-modal-content{border-radius:7px;padding-top:15px;position:relative;background-color:#fff;border:0;background-clip:padding-box;text-align:center;height:100%;overflow:hidden}.i-modal-body{max-height:100px;margin-bottom:15px;font-size:14px;color:#80848f;height:100%;line-height:1.5;overflow:auto}.i-modal-title{padding:6px 15px 15px;margin:0;font-size:18px;line-height:1;color:#1c2438;text-align:center}.i-modal-actions{margin:0 1px}.i-modal-action-vertical{position:relative}.i-modal-action-vertical:after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-modal-grid{border-radius:0 0 7px 7px;border-left:none}.i-modal-grid-item,.i-modal-grid-item-last{padding:0;border-bottom:none}.i-modal-grid-item-last{border-right:none}.i-modal-btn-ok{color:#2d8cf0!important}.i-modal-btn-loading{display:inline-block;vertical-align:middle;margin-right:10px;width:12px;height:12px;background:0 0;border-radius:50%;border:2px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-modal-btn-text{display:inline-block;vertical-align:middle}.i-modal-btn-icon{font-size:14px!important;margin-right:4px}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/dist/notice-bar/index.js b/dist/notice-bar/index.js new file mode 100644 index 0000000..7043dbd --- /dev/null +++ b/dist/notice-bar/index.js @@ -0,0 +1,112 @@ +const VALID_MODE = ['closeable']; +const FONT_COLOR = '#f60'; +const BG_COLOR = '#fff7cc'; + +Component({ + externalClasses: ['i-class'], + + properties: { + closable: { + type: Boolean, + value: false + }, + icon: { + type: String, + value: '' + }, + loop: { + type: Boolean, + value: false + }, + // 背景颜色 + backgroundcolor: { + type: String, + value: '#fefcec' + }, + // 字体及图标颜色 + color: { + type: String, + value: '#f76a24' + }, + // 滚动速度 + speed: { + type: Number, + value: 1000 + } + }, + + data: { + show: true, + wrapWidth: 0, + width: 0, + duration: 0, + animation: null, + timer: null, + }, + detached() { + this.destroyTimer(); + }, + ready() { + if (this.data.loop) { + this.initAnimation(); + } + }, + + methods: { + initAnimation() { + wx.createSelectorQuery().in(this).select('.i-noticebar-content-wrap').boundingClientRect((wrapRect) => { + wx.createSelectorQuery().in(this).select('.i-noticebar-content').boundingClientRect((rect) => { + const duration = rect.width / 40 * this.data.speed; + const animation = wx.createAnimation({ + duration: duration, + timingFunction: "linear", + }); + this.setData({ + wrapWidth: wrapRect.width, + width: rect.width, + duration: duration, + animation: animation + }, () => { + this.startAnimation(); + }); + }).exec(); + + }).exec(); + }, + startAnimation() { + //reset + if (this.data.animation.option.transition.duration !== 0) { + this.data.animation.option.transition.duration = 0; + const resetAnimation = this.data.animation.translateX(this.data.wrapWidth).step(); + this.setData({ + animationData: resetAnimation.export() + }); + } + this.data.animation.option.transition.duration = this.data.duration; + const animationData = this.data.animation.translateX(-this.data.width).step(); + setTimeout(() => { + this.setData({ + animationData: animationData.export() + }); + }, 100); + const timer = setTimeout(() => { + this.startAnimation(); + }, this.data.duration); + this.setData({ + timer, + }); + }, + destroyTimer() { + if (this.data.timer) { + clearTimeout(this.data.timer); + } + }, + handleClose() { + this.destroyTimer(); + this.setData({ + show: false, + timer: null + }); + } + } +}); diff --git a/dist/notice-bar/index.json b/dist/notice-bar/index.json new file mode 100644 index 0000000..db3afc0 --- /dev/null +++ b/dist/notice-bar/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-icon": "../icon/index" + } +} diff --git a/dist/notice-bar/index.wxml b/dist/notice-bar/index.wxml new file mode 100644 index 0000000..5de1e11 --- /dev/null +++ b/dist/notice-bar/index.wxml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dist/notice-bar/index.wxss b/dist/notice-bar/index.wxss new file mode 100644 index 0000000..9ea2aa7 --- /dev/null +++ b/dist/notice-bar/index.wxss @@ -0,0 +1 @@ +.i-noticebar{display:flex;height:72rpx;line-height:72rpx;font-size:14px;color:#f76a24;background-color:#fefcec;overflow:hidden}.i-noticebar-icon{display:flex;margin-left:30rpx;align-items:center}.i-noticebar-icon+view{margin-left:10rpx}.i-noticebar-operation{display:flex;margin-right:16rpx;align-items:center}.i-noticebar-content-wrap{position:relative;flex:1;margin:0 30rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.i-noticebar-content-wrap .i-noticebar-content{position:absolute;transition-duration:20s} \ No newline at end of file diff --git a/dist/page/index.js b/dist/page/index.js new file mode 100644 index 0000000..e0f44c5 --- /dev/null +++ b/dist/page/index.js @@ -0,0 +1,42 @@ +Component({ + externalClasses: ['i-class'], + + options: { + multipleSlots: true + }, + + properties: { + // button || number || pointer + mode: { + type: String, + value: 'button' + }, + current: { + type: Number, + value: 1 + }, + total: { + type: Number, + value: 0 + }, + // 是否隐藏数值 + simple: { + type: Boolean, + value: false + } + }, + + methods: { + handleChange (type) { + this.triggerEvent('change', { + type: type + }); + }, + handlePrev () { + this.handleChange('prev'); + }, + handleNext () { + this.handleChange('next'); + } + } +}); diff --git a/dist/page/index.json b/dist/page/index.json new file mode 100644 index 0000000..7b1a128 --- /dev/null +++ b/dist/page/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-button": "../button/index" + } +} diff --git a/dist/page/index.wxml b/dist/page/index.wxml new file mode 100644 index 0000000..a84d47b --- /dev/null +++ b/dist/page/index.wxml @@ -0,0 +1,14 @@ + + + + + + {{ current }}/{{total}} + + + + + + + + diff --git a/dist/page/index.wxss b/dist/page/index.wxss new file mode 100644 index 0000000..06c5c3b --- /dev/null +++ b/dist/page/index.wxss @@ -0,0 +1 @@ +.i-page{display:block;width:100%;height:44px;overflow:hidden;box-sizing:border-box;position:relative}.i-page-prev{position:absolute;left:10px;top:0}.i-page-next{position:absolute;right:10px;top:0}.i-page-number{width:100%;height:44px;line-height:44px;margin:0 auto;text-align:center}.i-page-number-current{display:inline;color:#2d8cf0}.i-page-pointer{width:100%;height:44px;line-height:44px;margin:0 auto;text-align:center}.i-page-pointer-dot{display:inline-block;width:8px;height:8px;margin:0 2px;border-radius:50%;background:#bbbec4}.i-page-pointer-dot.current{background:#80848f}.i-page-button{display:inline-block;margin:0} \ No newline at end of file diff --git a/dist/panel/index.js b/dist/panel/index.js new file mode 100644 index 0000000..b572da5 --- /dev/null +++ b/dist/panel/index.js @@ -0,0 +1,19 @@ +Component({ + externalClasses: ['i-class'], + + properties: { + title: { + type: String, + value: '' + }, + // 标题顶部距离 + hideTop: { + type: Boolean, + value: false + }, + hideBorder: { + type: Boolean, + value: false + } + } +}); diff --git a/dist/panel/index.json b/dist/panel/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/panel/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/panel/index.wxml b/dist/panel/index.wxml new file mode 100644 index 0000000..aa91c20 --- /dev/null +++ b/dist/panel/index.wxml @@ -0,0 +1,4 @@ + + {{ title }} + + diff --git a/dist/panel/index.wxss b/dist/panel/index.wxss new file mode 100644 index 0000000..edee3b8 --- /dev/null +++ b/dist/panel/index.wxss @@ -0,0 +1 @@ +.i-panel{position:relative;overflow:hidden}.i-panel-title{font-size:14px;line-height:1;color:#1c2438;padding:20px 16px 10px}.i-panel-title-hide-top{padding-top:0}.i-panel-content{position:relative;background:#fff;overflow:hidden}.i-panel-content::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px;border-bottom-width:1px}.i-panel-without-border::after{border:0 none} \ No newline at end of file diff --git a/dist/progress/index.js b/dist/progress/index.js new file mode 100644 index 0000000..b87b962 --- /dev/null +++ b/dist/progress/index.js @@ -0,0 +1,23 @@ +Component({ + externalClasses: ['i-class'], + + properties: { + percent: { + type: Number, + value: 0 + }, + // normal || active || wrong || success + status: { + type: String, + value: 'normal' + }, + strokeWidth: { + type: Number, + value: 10 + }, + hideInfo: { + type: Boolean, + value: false + } + } +}); diff --git a/dist/progress/index.json b/dist/progress/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/progress/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/progress/index.wxml b/dist/progress/index.wxml new file mode 100644 index 0000000..09b5abc --- /dev/null +++ b/dist/progress/index.wxml @@ -0,0 +1,10 @@ + + + + + + + + {{ percent }}% + + \ No newline at end of file diff --git a/dist/progress/index.wxss b/dist/progress/index.wxss new file mode 100644 index 0000000..21b9d9c --- /dev/null +++ b/dist/progress/index.wxss @@ -0,0 +1 @@ +.i-progress{display:inline-block;width:100%;font-size:12px;position:relative}.i-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0;box-sizing:border-box}.i-progress-show-info .i-progress-outer{padding-right:55px;margin-right:-55px}.i-progress-inner{display:inline-block;width:100%;background-color:#f3f3f3;border-radius:100px;vertical-align:middle}.i-progress-bg{border-radius:100px;background-color:#2db7f5;transition:all .2s linear;position:relative}.i-progress-text{display:inline-block;margin-left:5px;text-align:left;font-size:1em;vertical-align:middle}.i-progress-active .i-progress-bg:before{content:'';opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;background:#fff;border-radius:10px;animation:i-progress-active 2s ease-in-out infinite}.i-progress-wrong .i-progress-bg{background-color:#ed3f14}.i-progress-wrong .i-progress-text{color:#ed3f14}.i-progress-success .i-progress-bg{background-color:#19be6b}.i-progress-success .i-progress-text{color:#19be6b}@keyframes i-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}} \ No newline at end of file diff --git a/dist/radio-group/index.js b/dist/radio-group/index.js new file mode 100644 index 0000000..db76e41 --- /dev/null +++ b/dist/radio-group/index.js @@ -0,0 +1,38 @@ +Component({ + externalClasses: ['i-class'], + relations: { + '../radio/index': { + type: 'child', + linked() { + this.changeCurrent(); + }, + linkChanged() { + this.changeCurrent(); + }, + unlinked() { + this.changeCurrent(); + } + } + }, + properties: { + current: { + type: String, + value: '', + observer: 'changeCurrent' + }, + }, + methods: { + changeCurrent(val = this.data.current) { + let items = this.getRelationNodes('../radio/index'); + const len = items.length; + if (len > 0) { + items.forEach(item => { + item.changeCurrent(val === item.data.value); + }); + } + }, + emitEvent(current) { + this.triggerEvent('change', current); + } + } +}); diff --git a/dist/radio-group/index.json b/dist/radio-group/index.json new file mode 100644 index 0000000..edf138d --- /dev/null +++ b/dist/radio-group/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-cell-group": "../cell-group/index" + } +} diff --git a/dist/radio-group/index.wxml b/dist/radio-group/index.wxml new file mode 100644 index 0000000..6940180 --- /dev/null +++ b/dist/radio-group/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/dist/radio-group/index.wxss b/dist/radio-group/index.wxss new file mode 100644 index 0000000..e69de29 diff --git a/dist/radio/index.js b/dist/radio/index.js new file mode 100644 index 0000000..cb73db5 --- /dev/null +++ b/dist/radio/index.js @@ -0,0 +1,56 @@ +const prefixCls = 'i-radio'; + +Component({ + externalClasses: ['i-class'], + relations: { + '../radio-group/index': { + type: 'parent' + } + }, + properties: { + value: { + type: String, + value: '' + }, + checked: { + type: Boolean, + value: false + }, + disabled: { + type: Boolean, + value: false + }, + color: { + type: String, + value: '#2d8cf0' + }, + position: { + type: String, + value: 'left', //left right + observer: 'setPosition' + } + }, + data: { + checked: true, + positionCls: `${prefixCls}-radio-left`, + }, + attached() { + this.setPosition(); + }, + methods: { + changeCurrent(current) { + this.setData({ checked: current }); + }, + radioChange() { + if (this.data.disabled) return; + const item = { current: !this.data.checked, value: this.data.value }; + const parent = this.getRelationNodes('../radio-group/index')[0]; + parent ? parent.emitEvent(item) : this.triggerEvent('change', item); + }, + setPosition() { + this.setData({ + positionCls: this.data.position.indexOf('left') !== -1 ? `${prefixCls}-radio-left` : `${prefixCls}-radio-right`, + }); + } + } +}); diff --git a/dist/radio/index.json b/dist/radio/index.json new file mode 100644 index 0000000..e2ab49a --- /dev/null +++ b/dist/radio/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-cell": "../cell/index" + } +} diff --git a/dist/radio/index.wxml b/dist/radio/index.wxml new file mode 100644 index 0000000..1e20b79 --- /dev/null +++ b/dist/radio/index.wxml @@ -0,0 +1,8 @@ + + + + + diff --git a/dist/radio/index.wxss b/dist/radio/index.wxss new file mode 100644 index 0000000..c52b211 --- /dev/null +++ b/dist/radio/index.wxss @@ -0,0 +1 @@ +.i-radio-cell::after{display:block}.i-radio-radio-left{float:left}.i-radio-radio-right{float:right}.i-radio-radio{vertical-align:middle}.i-radio-title{display:inline-block;vertical-align:middle} \ No newline at end of file diff --git a/dist/rate/index.js b/dist/rate/index.js new file mode 100644 index 0000000..a7e374a --- /dev/null +++ b/dist/rate/index.js @@ -0,0 +1,69 @@ +Component({ + externalClasses: ['i-class'], + properties : { + count : { + type : Number, + value : 5 + }, + value : { + type : Number, + value : 0 + }, + disabled : { + type : Boolean, + value : false + }, + size : { + type : Number, + value : 20 + }, + name : { + type : String, + value : '' + } + }, + data : { + touchesStart : { + pageX : 0 + } + }, + methods : { + handleClick(e){ + const data = this.data; + if( data.disabled ){ + return; + } + const index = e.currentTarget.dataset.index; + this.triggerEvent('change',{ + index : index + 1 + }) + }, + handleTouchMove(e){ + const data = this.data; + if( data.disabled ){ + return; + } + if( !e.changedTouches[0] ){ + return; + } + const movePageX = e.changedTouches[0].pageX; + const space = movePageX - data.touchesStart.pageX; + + if( space <= 0 ){ + return; + } + let setIndex = Math.ceil( space/data.size ); + setIndex = setIndex > data.count ? data.count : setIndex ; + this.triggerEvent('change',{ + index : setIndex + }) + } + }, + ready(){ + const className = '.i-rate'; + var query = wx.createSelectorQuery().in(this) + query.select( className ).boundingClientRect((res)=>{ + this.data.touchesStart.pageX = res.left || 0; + }).exec() + } +}); diff --git a/dist/rate/index.json b/dist/rate/index.json new file mode 100644 index 0000000..687543c --- /dev/null +++ b/dist/rate/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents":{ + "i-icon": "../icon/index" + } +} diff --git a/dist/rate/index.wxml b/dist/rate/index.wxml new file mode 100644 index 0000000..d600660 --- /dev/null +++ b/dist/rate/index.wxml @@ -0,0 +1,23 @@ + + + + + + + + +var prefixCls = 'i-rate'; +module.exports = { + getCurrent : function( value,index ){ + if( index < value ){ + return prefixCls + '-current' + } + } +} + diff --git a/dist/rate/index.wxss b/dist/rate/index.wxss new file mode 100644 index 0000000..e889107 --- /dev/null +++ b/dist/rate/index.wxss @@ -0,0 +1 @@ +.i-rate{margin:0;padding:0;font-size:20px;display:inline-block;vertical-align:middle;font-weight:400;font-style:normal}.i-rate-hide-input{display:none}.i-rate-star{display:inline-block;color:#e9e9e9}.i-rate-current{color:#f5a623}.i-rate-text{display:inline-block;vertical-align:middle;margin-left:6px;font-size:14px} \ No newline at end of file diff --git a/dist/row/index.js b/dist/row/index.js new file mode 100644 index 0000000..3428387 --- /dev/null +++ b/dist/row/index.js @@ -0,0 +1,9 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../col/index': { + type: 'child' + } + } +}); diff --git a/dist/row/index.json b/dist/row/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/row/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/row/index.wxml b/dist/row/index.wxml new file mode 100644 index 0000000..fe8159e --- /dev/null +++ b/dist/row/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/row/index.wxss b/dist/row/index.wxss new file mode 100644 index 0000000..3b8b432 --- /dev/null +++ b/dist/row/index.wxss @@ -0,0 +1 @@ +.i-row:after{content:"";display:table;clear:both} \ No newline at end of file diff --git a/dist/slide/index.js b/dist/slide/index.js new file mode 100644 index 0000000..a397f4f --- /dev/null +++ b/dist/slide/index.js @@ -0,0 +1,15 @@ +Component({ + externalClasses: ['i-class'], + options: { + // 在组件定义时的选项中启用多slot支持 + multipleSlots: true + }, + methods : { + handleTap2(){ + console.log(event,1111111) + }, + handleTap3(){ + + } + } +}); diff --git a/dist/slide/index.json b/dist/slide/index.json new file mode 100644 index 0000000..6b1e67d --- /dev/null +++ b/dist/slide/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": + { + "i-button": "../button/index", + "i-icon": "../icon/index" + } +} diff --git a/dist/slide/index.wxml b/dist/slide/index.wxml new file mode 100644 index 0000000..a13c673 --- /dev/null +++ b/dist/slide/index.wxml @@ -0,0 +1,4 @@ + + 1111 + + \ No newline at end of file diff --git a/dist/slide/index.wxss b/dist/slide/index.wxss new file mode 100644 index 0000000..e69de29 diff --git a/dist/spin/index.js b/dist/spin/index.js new file mode 100644 index 0000000..3297f81 --- /dev/null +++ b/dist/spin/index.js @@ -0,0 +1,23 @@ +Component({ + externalClasses: ['i-class'], + + properties: { + // small || default || large + size: { + type: String, + value: 'default' + }, + fix: { + type: Boolean, + value: false + }, + fullscreen: { + type: Boolean, + value: false + }, + custom: { + type: Boolean, + value: false + } + } +}); diff --git a/dist/spin/index.json b/dist/spin/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/spin/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/spin/index.wxml b/dist/spin/index.wxml new file mode 100644 index 0000000..8c25439 --- /dev/null +++ b/dist/spin/index.wxml @@ -0,0 +1,6 @@ + +
+ +
+
+
diff --git a/dist/spin/index.wxss b/dist/spin/index.wxss new file mode 100644 index 0000000..8ed714a --- /dev/null +++ b/dist/spin/index.wxss @@ -0,0 +1 @@ +.i-spin{color:#2d8cf0;vertical-align:middle;text-align:center}.i-spin-dot{position:relative;display:block;border-radius:50%;background-color:#2d8cf0;width:20px;height:20px;animation:ani-spin-bounce 1s 0s ease-in-out infinite}.i-spin-large .i-spin-dot{width:32px;height:32px}.i-spin-small .i-spin-dot{width:12px;height:12px}.i-spin-fix{position:absolute;top:0;left:0;z-index:8;width:100%;height:100%;background-color:rgba(255,255,255,.9)}.i-spin-fullscreen{z-index:2010}.i-spin-fullscreen-wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.i-spin-fix .i-spin-main{position:absolute;top:50%;left:50%;-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.i-spin-fix .i-spin-dot{display:inline-block}.i-spin-show-text .i-spin-dot,.i-spin-text{display:none}.i-spin-show-text .i-spin-text{display:block;font-size:14px}@keyframes ani-spin-bounce{0%{transform:scale(0)}100%{transform:scale(1);opacity:0}} \ No newline at end of file diff --git a/dist/step/index.js b/dist/step/index.js new file mode 100644 index 0000000..06a81a2 --- /dev/null +++ b/dist/step/index.js @@ -0,0 +1,52 @@ +Component({ + externalClasses: ['i-class'], + properties : { + status : { + type : String, + //wait、process、finish、error + value : '' + }, + title : { + type : String, + value : '' + }, + content : { + type : String, + value : '' + }, + icon : { + type : String, + value : '' + } + }, + options: { + // 在组件定义时的选项中启用多slot支持 + multipleSlots: true + }, + relations : { + '../steps/index' : { + type : 'parent' + } + }, + data : { + //step length + len : 1, + //current in step index + index : 0, + //parent component select current index + current : 0, + //css direction + direction : 'horizontal' + }, + methods : { + updateDataChange( options ){ + this.setData({ + len : options.len, + index : options.index, + current : options.current, + direction : options.direction + }) + } + } + +}) \ No newline at end of file diff --git a/dist/step/index.json b/dist/step/index.json new file mode 100644 index 0000000..ffb5dee --- /dev/null +++ b/dist/step/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-icon": "../icon/index" + } +} diff --git a/dist/step/index.wxml b/dist/step/index.wxml new file mode 100644 index 0000000..63549dc --- /dev/null +++ b/dist/step/index.wxml @@ -0,0 +1,70 @@ + + + {{ index+1 }} + + + + + + + + {{title}} + + + + + + {{content}} + + + + + + + +var allStatus = ['wait','process','finish','error']; +module.exports = { + noIco : function( status,current,index,icon ){ + var aindex = allStatus.indexOf(status); + var noIcon = true; + if( index < current || icon !== '' ){ + noIcon = false; + } + return noIcon; + }, + getIcoClass : function( status,ico ){ + var class = ''; + if( status === 'error' ){ + class = 'close'; + }else{ + class = 'right'; + } + if( ico !== '' ){ + class = ico; + } + return class; + }, + getItemStyle : function(len,direction){ + if( direction === 'horizontal' ){ + return 'width :'+100/len + '%'; + }else{ + return 'width : 100%;'; + } + }, + getClass : function( status,current,index ) { + //wait、process、finish、error + var startClass = 'i-step-' + var classes = ''; + var cindex = allStatus.indexOf( status ); + if( cindex !== -1 ){ + classes = startClass + allStatus[cindex]; + } + if( index < current ){ + classes = startClass + 'finish'; + }else if( index === current ){ + classes = startClass + 'process'; + } + return classes; + } +} + \ No newline at end of file diff --git a/dist/step/index.wxss b/dist/step/index.wxss new file mode 100644 index 0000000..284b42a --- /dev/null +++ b/dist/step/index.wxss @@ -0,0 +1 @@ +.i-step-ico{width:24px;height:100%;border-radius:100%;background:#fff;position:relative;z-index:2;margin:0 auto;border:#dddee1 solid 1px}.i-step-ico-in{vertical-align:baseline}.i-step-line{position:absolute;left:50%;top:12px;width:100%;height:1px;background:#dddee1}.i-step-horizontal .i-step-ico::after{position:absolute;top:11px;left:23px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-horizontal .i-step-item-main{text-align:center}.i-step-horizontal .i-step-ico::before{position:absolute;top:11px;left:-11px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-ico{box-sizing:border-box;font-size:12px}.i-step-process .i-step-ico{border:#2d8cf0 solid 1px;color:#fff;background:#2d8cf0}.i-step-wait .i-step-ico{border:#e9eaec solid 1px;color:#e9eaec}.i-step-wait .i-step-line{background:#2d8cf0}.i-step-finish .i-step-ico{border:#2d8cf0 solid 1px;color:#2d8cf0}.i-step-finish .i-step-line{background:#2d8cf0}.i-step-error .i-step-ico{border:#ed3f14 solid 1px;color:#ed3f14}.i-step-error .i-step-line{background:#ed3f14}.i-step-item{font-size:12px;position:relative;display:inline-block;box-sizing:border-box;padding-left:10px;vertical-align:top}.i-step-item-ico{width:100%;height:24px;line-height:24px;text-align:center}.i-step-item-main{margin-top:10px;clear:both}.i-step-item-title{font-size:14px;font-weight:700;color:#1c2438}.i-step-item-content{font-size:12px;font-weight:700;margin-top:2px;color:#80848f}.i-step-vertical{padding-bottom:30px}.i-step-vertical .i-step-item-ico{width:24px;float:left}.i-step-vertical .i-step-item-main{margin-left:40px;margin-top:0;clear:inherit}.i-step-vertical .i-step-line{position:absolute;height:100%;top:0;left:10px;margin:0 0 0 12px;width:1px} \ No newline at end of file diff --git a/dist/steps/index.js b/dist/steps/index.js new file mode 100644 index 0000000..06bed88 --- /dev/null +++ b/dist/steps/index.js @@ -0,0 +1,50 @@ +Component({ + externalClasses: ['i-class'], + properties : { + current : { + type : Number, + value : -1, + observer : '_updateDataChange' + }, + status : { + type : String, + //wait、process、finish、error + value : '' + }, + direction : { + type : String, + //value has horizontal or vertical + value : 'horizontal' + } + }, + relations : { + '../step/index' : { + type : 'child', + linked(){ + this._updateDataChange(); + }, + linkChanged () { + this._updateDataChange(); + }, + unlinked () { + this._updateDataChange(); + } + } + }, + methods: { + _updateDataChange() { + let steps = this.getRelationNodes('../step/index'); + const len = steps.length; + if (len > 0) { + steps.forEach((step, index) => { + step.updateDataChange({ + len : len, + index : index, + current : this.data.current, + direction : this.data.direction + }); + }); + } + } + } +}) \ No newline at end of file diff --git a/dist/steps/index.json b/dist/steps/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/steps/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/steps/index.wxml b/dist/steps/index.wxml new file mode 100644 index 0000000..d9c7942 --- /dev/null +++ b/dist/steps/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/dist/steps/index.wxss b/dist/steps/index.wxss new file mode 100644 index 0000000..616ed04 --- /dev/null +++ b/dist/steps/index.wxss @@ -0,0 +1 @@ +.i-steps{width:100%} \ No newline at end of file diff --git a/dist/sticky-item/index.js b/dist/sticky-item/index.js new file mode 100644 index 0000000..4fc3dbe --- /dev/null +++ b/dist/sticky-item/index.js @@ -0,0 +1,40 @@ +Component({ + externalClasses: ['i-class'], + options: { + multipleSlots: true + }, + relations : { + '../sticky/index' : { + type : 'parent' + } + }, + data : { + top : 0, + height : 0, + isFixed : false, + index : -1, + }, + methods: { + updateScrollTopChange(scrollTop){ + const data = this.data; + const top = data.top; + const height = data.height; + this.setData({ + isFixed : ( scrollTop >= top && scrollTop < top + height ) ? true : false + }) + }, + updateDataChange(index) { + const className = '.i-sticky-item'; + const query = wx.createSelectorQuery().in(this); + query.select( className ).boundingClientRect((res)=>{ + if( res ){ + this.setData({ + top : res.top, + height : res.height, + index : index + }) + } + }).exec() + } + } +}) \ No newline at end of file diff --git a/dist/sticky-item/index.json b/dist/sticky-item/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/sticky-item/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/sticky-item/index.wxml b/dist/sticky-item/index.wxml new file mode 100644 index 0000000..613a5c0 --- /dev/null +++ b/dist/sticky-item/index.wxml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dist/sticky-item/index.wxss b/dist/sticky-item/index.wxss new file mode 100644 index 0000000..7328f0f --- /dev/null +++ b/dist/sticky-item/index.wxss @@ -0,0 +1 @@ +.i-sticky-item-header{background:#eee;font-size:14px;width:100%;height:32px;line-height:32px}.i-sticky-item-content{font-size:14px}.i-sticky-title{width:100%;padding:0 15px;box-sizing:border-box;background:#eee}.i-sticky-fixed .i-sticky-title{position:fixed;top:0} \ No newline at end of file diff --git a/dist/sticky/index.js b/dist/sticky/index.js new file mode 100644 index 0000000..546aa4c --- /dev/null +++ b/dist/sticky/index.js @@ -0,0 +1,63 @@ +Component({ + externalClasses: ['i-class'], + properties : { + scrollTop : { + type : Number, + observer(val){ + this._updateScrollTopChange(); + } + } + }, + relations : { + '../sticky-item/index' : { + type : 'child', + linked(){ + this._updateDataChange(); + }, + linkChanged () { + this._updateDataChange(); + }, + unlinked () { + this._updateDataChange(); + } + } + }, + data : { + timer : null, + itemLength : 0, + }, + methods : { + _updateScrollTopChange(){ + const stickies = this.getRelationNodes('../sticky-item/index'); + if( stickies.length > 0 ){ + stickies.forEach((item) => { + if( item ){ + item.updateScrollTopChange( this.data.scrollTop ); + } + }) + } + }, + _updateDataChange( ){ + const stickies = this.getRelationNodes('../sticky-item/index'); + if( stickies.length > 0 ){ + if( this.data.timer ){ + clearTimeout( this.data.timer ) + this.setData({ + timer : null + }) + } + this.data.timer = setTimeout(()=>{ + stickies.forEach((item,index) => { + if( item ){ + item.updateDataChange(index); + } + }) + },0) + this.setData({ + timer : this.data.timer + }) + } + } + } + +}) \ No newline at end of file diff --git a/dist/sticky/index.json b/dist/sticky/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/sticky/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/sticky/index.wxml b/dist/sticky/index.wxml new file mode 100644 index 0000000..aee0c63 --- /dev/null +++ b/dist/sticky/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/dist/sticky/index.wxss b/dist/sticky/index.wxss new file mode 100644 index 0000000..e69de29 diff --git a/dist/swipeout/index.js b/dist/swipeout/index.js new file mode 100644 index 0000000..b23748c --- /dev/null +++ b/dist/swipeout/index.js @@ -0,0 +1,161 @@ + /* +* touch事件判断方式 +* https://github.com/madrobby/zepto/blob/master/src/touch.js#files +*/ +function swipeDirection(x1, x2, y1, y2) { + return Math.abs(x1 - x2) >= + Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down') +} + +Component({ + externalClasses: ['i-class'], + properties: { + actions: { + value: [], + type: Array, + observer : '_updateButtonSize' + }, + unclosable : { + value : false, + type : Boolean + }, + toggle : { + value : false, + type : Boolean, + observer : 'closeButtonGroup' + }, + operateWidth : { + type : Number, + value : 160 + } + }, + options: { + // 在组件定义时的选项中启用多slot支持 + multipleSlots: true + }, + data : { + //touch start position + tStart : { + pageX : 0, + pageY : 0 + }, + //限制滑动距离 + limitMove : 0, + //element move position + position : { + pageX : 0, + pageY : 0 + } + }, + methods : { + //阻止事件冒泡 + loop(){}, + _updateButtonSize(){ + const actions = this.data.actions; + if( actions.length > 0 ){ + const query = wx.createSelectorQuery().in(this); + let limitMovePosition = 0; + actions.forEach(item => { + limitMovePosition += item.width || 0; + }); + this.data.limitMove = limitMovePosition; + /* + * 动态获取每个传进值的按钮尺寸不能正确获取,在安卓上少了6px + * 暂时实现需要在actions里面传递宽度 + * 需要后期调研 + */ + //query.selectAll('.i-swipeout-button-right-item').boundingClientRect((rects)=>{ + // if( rects ){ + // console.log(rects,1111111) + // rects.forEach(item => { + // limitMovePosition += item.width; + // }); + // this.data.limitMove = limitMovePosition; + // console.log(limitMovePosition,111111111) + // } + // }).exec() + }else{ + this.data.limitMove = this.data.operateWidth; + + } + }, + handlerTouchstart(event){ + const touches = event.touches ? event.touches[0] : {}; + const tStart = this.data.tStart; + if( touches ){ + for( let i in tStart ){ + if( touches[i] ){ + tStart[i] = touches[i]; + } + } + } + }, + swipper(touches){ + const data = this.data; + const start = data.tStart; + const spacing = { + pageX : touches.pageX - start.pageX, + pageY : touches.pageY - start.pageY + } + if( data.limitMove < Math.abs( spacing.pageX ) ){ + spacing.pageX = -data.limitMove; + + } + this.setData({ + 'position' : spacing + }) + }, + handlerTouchmove(event){ + const start = this.data.tStart; + const touches = event.touches ? event.touches[0] : {}; + if( touches ){ + const direction = swipeDirection( start.pageX,touches.pageX,start.pageY,touches.pageY ); + if( direction === 'Left' ){ + this.swipper( touches ); + } + } + }, + handlerTouchend(event){ + const start = this.data.tStart; + const touches = event.changedTouches ? event.changedTouches[0] : {}; + if( touches ){ + const direction = swipeDirection( start.pageX,touches.pageX,start.pageY,touches.pageY ); + const spacing = { + pageX : touches.pageX - start.pageX, + pageY : touches.pageY - start.pageY + } + if( Math.abs( spacing.pageX ) >= 40 && direction === "Left" ){ + spacing.pageX = spacing.pageX < 0 ? - this.data.limitMove : this.data.limitMove; + }else{ + spacing.pageX = 0; + } + this.setData({ + 'position' : spacing + }) + } + }, + handlerButton(event){ + if( !this.data.unclosable ){ + this.closeButtonGroup(); + } + const dataset = event.currentTarget.dataset; + this.triggerEvent('change',{ + index : dataset.index + }) + }, + closeButtonGroup(){ + this.setData({ + 'position' : {pageX : 0,pageY : 0} + }) + }, + //控制自定义组件 + handlerParentButton(event){ + if( !this.data.unclosable ){ + this.closeButtonGroup(); + } + } + }, + ready(){ + this._updateButtonSize(); + } +}); diff --git a/dist/swipeout/index.json b/dist/swipeout/index.json new file mode 100644 index 0000000..c63f9a6 --- /dev/null +++ b/dist/swipeout/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "i-cell": "../cell/index", + "i-icon": "../icon/index" + } +} \ No newline at end of file diff --git a/dist/swipeout/index.wxml b/dist/swipeout/index.wxml new file mode 100644 index 0000000..f588015 --- /dev/null +++ b/dist/swipeout/index.wxml @@ -0,0 +1,39 @@ + + + + + + + + + + {{item.name}} + + + + + + + + + module.exports = { + setStyle : function( item ){ + var defaults = '#f7f7f7'; + return 'background:' + ( item.background ? item.background : defaults ) +';' + 'color:'+ item.color; + }, + setPosition : function( position ){ + return 'transform:translate(' + position.pageX + 'px,0);'; + } + } + \ No newline at end of file diff --git a/dist/swipeout/index.wxss b/dist/swipeout/index.wxss new file mode 100644 index 0000000..597cffc --- /dev/null +++ b/dist/swipeout/index.wxss @@ -0,0 +1 @@ +.i-swipeout-wrap{border-bottom:#dddee1 solid 1px;background:#fff;position:relative;overflow:hidden}.i-swipeout-item{width:100%;padding:15px 20px;box-sizing:border-box;transition:transform .2s ease;font-size:14px}.i-swipeout-content{white-space:nowrap;overflow:hidden}.i-swipeout-button-right-group{position:absolute;right:-100%;top:0;height:100%;z-index:1;width:100%}.i-swipeout-button-right-item{height:100%;float:left;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;justify-content:center} \ No newline at end of file diff --git a/dist/switch/index.js b/dist/switch/index.js new file mode 100644 index 0000000..5ebccfa --- /dev/null +++ b/dist/switch/index.js @@ -0,0 +1,38 @@ +Component({ + externalClasses: ['i-class'], + properties : { + value : { + type : Boolean, + value : false + }, + //large small default + size : { + type : String, + value : 'default' + }, + // is or not disable + disabled : { + type : Boolean, + value : false + }, + // hidden inut name + name : { + type : String, + value : '' + } + }, + options: { + // 在组件定义时的选项中启用多slot支持 + multipleSlots: true + }, + methods : { + toggle(){ + if( this.data.disabled ) return; + const data = this.data; + const value = data.value ? false : true; + this.triggerEvent('change',{ + value : value + }) + } + } +}); diff --git a/dist/switch/index.json b/dist/switch/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/switch/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/switch/index.wxml b/dist/switch/index.wxml new file mode 100644 index 0000000..a180254 --- /dev/null +++ b/dist/switch/index.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + +var sizes = ['large', 'default']; +var prefixCls = 'i-switch'; +module.exports = { + setSize : function( size ){ + var index = sizes.indexOf( size ); + return prefixCls + ( index > -1 ? ( '-'+size ) : 'default' ) + }, + setCurrent : function( value,disabled ){ + var className = value && !disabled ? prefixCls + '-checked' : ''; + if( disabled ){ + className += ' ' + prefixCls + '-disabled'; + } + return className; + } +} + \ No newline at end of file diff --git a/dist/switch/index.wxss b/dist/switch/index.wxss new file mode 100644 index 0000000..128fea6 --- /dev/null +++ b/dist/switch/index.wxss @@ -0,0 +1 @@ +.i-switch{display:inline-block;width:48px;height:24px;line-height:24px;border-radius:24px;vertical-align:middle;border:1px solid #ccc;background-color:#ccc;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:all .2s ease-in-out}.i-switch-hide-input{display:none;opacity:0}.i-switch-inner{color:#fff;font-size:12px;position:absolute;left:25px;vertical-align:middle}.i-switch-inner .i-icon{width:12px;height:12px;text-align:center;vertical-align:middle}.i-switch:after{content:'';width:22px;height:22px;border-radius:22px;background-color:#fff;position:absolute;left:1px;top:1px;cursor:pointer;transition:left .2s ease-in-out,width .2s ease-in-out}.i-switch-checked:after{left:8px}.i-switch-large{width:60px}.i-switch-large.i-switch-checked:after{left:37px}.i-switch-checked:after{left:25px}.i-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0}.i-switch-checked .i-switch-inner{left:8px}.i-switch-checked:after{left:25px}.i-switch-disabled{background:#f3f3f3;border-color:#f3f3f3}.i-switch-disabled:after{background:#ccc;cursor:not-allowed}.i-switch-disabled .i-switch-inner{color:#ccc} \ No newline at end of file diff --git a/dist/tab-bar-item/index.js b/dist/tab-bar-item/index.js new file mode 100644 index 0000000..0c24c1a --- /dev/null +++ b/dist/tab-bar-item/index.js @@ -0,0 +1,62 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../tab-bar/index': { + type: 'parent' + } + }, + + properties: { + icon: { + type: String, + value: '' + }, + currentIcon: { + type: String, + value: '' + }, + img: { + type: String, + value: '' + }, + currentImg: { + type: String, + value: '' + }, + key: { + type: String, + value: '' + }, + title: { + type: String, + value: '' + }, + dot: { + type: Boolean, + value: false + }, + count: { + type: Number, + value: 0 + } + }, + + data: { + current: false, + currentColor: '' + }, + + methods: { + changeCurrent (current) { + this.setData({ current }); + }, + changeCurrentColor (currentColor) { + this.setData({ currentColor }); + }, + handleClickItem () { + const parent = this.getRelationNodes('../tab-bar/index')[0]; + parent.emitEvent(this.data.key); + } + } +}); diff --git a/dist/tab-bar-item/index.json b/dist/tab-bar-item/index.json new file mode 100644 index 0000000..918aaf8 --- /dev/null +++ b/dist/tab-bar-item/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": + { + "i-badge": "../badge/index", + "i-icon": "../icon/index" + } +} diff --git a/dist/tab-bar-item/index.wxml b/dist/tab-bar-item/index.wxml new file mode 100644 index 0000000..7153909 --- /dev/null +++ b/dist/tab-bar-item/index.wxml @@ -0,0 +1,10 @@ + + + + + + {{ title }} + {{ title }} + + + \ No newline at end of file diff --git a/dist/tab-bar-item/index.wxss b/dist/tab-bar-item/index.wxss new file mode 100644 index 0000000..0f8a9c8 --- /dev/null +++ b/dist/tab-bar-item/index.wxss @@ -0,0 +1 @@ +.i-tab-bar-item{flex:1;display:flex;width:100%;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;text-align:center}.i-tab-bar-item-icon{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;color:#80848f}.i-tab-bar-item-icon-current{color:#2d8cf0}.i-tab-bar-item-img{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;width:22px;height:22px}.i-tab-bar-item-title{font-size:10px;margin:3px 0 0;line-height:1;text-align:center;box-sizing:border-box;color:#80848f}.i-tab-bar-item-title-current{color:#2d8cf0}.i-tab-bar-item-img{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;color:#80848f} \ No newline at end of file diff --git a/dist/tab-bar/index.js b/dist/tab-bar/index.js new file mode 100644 index 0000000..ca02fe4 --- /dev/null +++ b/dist/tab-bar/index.js @@ -0,0 +1,66 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../tab-bar-item/index': { + type: 'child', + linked () { + this.changeCurrent(); + }, + linkChanged () { + this.changeCurrent(); + }, + unlinked () { + this.changeCurrent(); + } + } + }, + + properties: { + current: { + type: String, + value: '', + observer: 'changeCurrent' + }, + color: { + type: String, + value: '' + }, + fixed: { + type: Boolean, + value: false + } + }, + + data: { + list: [] + }, + + methods: { + changeCurrent (val = this.data.current) { + let items = this.getRelationNodes('../tab-bar-item/index'); + const len = items.length; + + if (len > 0) { + const list = []; + items.forEach(item => { + item.changeCurrent(item.data.key === val); + item.changeCurrentColor(this.data.color); + list.push({ + key: item.data.key + }); + }); + this.setData({ + list: list + }); + } + }, + emitEvent (key) { + this.triggerEvent('change', { key }); + }, + handleClickItem (e) { + const key = e.currentTarget.dataset.key; + this.emitEvent(key); + } + } +}); diff --git a/dist/tab-bar/index.json b/dist/tab-bar/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/tab-bar/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/tab-bar/index.wxml b/dist/tab-bar/index.wxml new file mode 100644 index 0000000..9dbfbea --- /dev/null +++ b/dist/tab-bar/index.wxml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dist/tab-bar/index.wxss b/dist/tab-bar/index.wxss new file mode 100644 index 0000000..5c6fd9c --- /dev/null +++ b/dist/tab-bar/index.wxss @@ -0,0 +1 @@ +.i-tab-bar{display:flex;width:100%;height:50px;box-sizing:border-box;position:relative;justify-content:space-around;align-items:center;-webkit-box-align:center;background:#fff}.i-tab-bar::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-tab-bar-fixed{position:fixed;bottom:0;z-index:2}.i-tab-bar-list{position:absolute;top:0;bottom:0;left:0;right:0}.i-tab-bar-layer{display:block;float:left;height:100%} \ No newline at end of file diff --git a/dist/tab/index.js b/dist/tab/index.js new file mode 100644 index 0000000..c8d3079 --- /dev/null +++ b/dist/tab/index.js @@ -0,0 +1,50 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../tabs/index': { + type: 'parent' + } + }, + + properties: { + key: { + type: String, + value: '' + }, + title: { + type: String, + value: '' + }, + dot: { + type: Boolean, + value: false + }, + count: { + type: Number, + value: 0 + } + }, + + data: { + current: false, + currentColor: '', + scroll: false + }, + + methods: { + changeCurrent (current) { + this.setData({ current }); + }, + changeCurrentColor (currentColor) { + this.setData({ currentColor }); + }, + changeScroll (scroll) { + this.setData({ scroll }); + }, + handleClickItem () { + const parent = this.getRelationNodes('../tabs/index')[0]; + parent.emitEvent(this.data.key); + } + } +}); diff --git a/dist/tab/index.json b/dist/tab/index.json new file mode 100644 index 0000000..eb6877d --- /dev/null +++ b/dist/tab/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-badge": "../badge/index" + } +} diff --git a/dist/tab/index.wxml b/dist/tab/index.wxml new file mode 100644 index 0000000..29d3955 --- /dev/null +++ b/dist/tab/index.wxml @@ -0,0 +1,9 @@ + + + + {{ title }} + {{ title }} + + + + \ No newline at end of file diff --git a/dist/tab/index.wxss b/dist/tab/index.wxss new file mode 100644 index 0000000..135637b --- /dev/null +++ b/dist/tab/index.wxss @@ -0,0 +1 @@ +.i-tabs-tab{flex:1;display:flex;width:100%;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;text-align:center;position:relative}.i-tabs-tab-bar{display:block;width:100%;height:2px;background:0 0;position:absolute;bottom:0;left:0;background:#2d8cf0}.i-tabs-tab-title{font-size:14px;text-align:center;box-sizing:border-box;color:#80848f}.i-tabs-tab-title-current{color:#2d8cf0}.i-tabs-tab-scroll{display:inline-block;width:60px} \ No newline at end of file diff --git a/dist/tabs/index.js b/dist/tabs/index.js new file mode 100644 index 0000000..b9d0326 --- /dev/null +++ b/dist/tabs/index.js @@ -0,0 +1,56 @@ +Component({ + externalClasses: ['i-class'], + + relations: { + '../tab/index': { + type: 'child', + linked () { + this.changeCurrent(); + }, + linkChanged () { + this.changeCurrent(); + }, + unlinked () { + this.changeCurrent(); + } + } + }, + + properties: { + current: { + type: String, + value: '', + observer: 'changeCurrent' + }, + color: { + type: String, + value: '' + }, + scroll: { + type: Boolean, + value: false + }, + fixed: { + type: Boolean, + value: false + } + }, + + methods: { + changeCurrent (val = this.data.current) { + let items = this.getRelationNodes('../tab/index'); + const len = items.length; + + if (len > 0) { + items.forEach(item => { + item.changeScroll(this.data.scroll); + item.changeCurrent(item.data.key === val); + item.changeCurrentColor(this.data.color); + }); + } + }, + emitEvent (key) { + this.triggerEvent('change', { key }); + } + } +}); diff --git a/dist/tabs/index.json b/dist/tabs/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/dist/tabs/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/tabs/index.wxml b/dist/tabs/index.wxml new file mode 100644 index 0000000..b61d51b --- /dev/null +++ b/dist/tabs/index.wxml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/dist/tabs/index.wxss b/dist/tabs/index.wxss new file mode 100644 index 0000000..985fb18 --- /dev/null +++ b/dist/tabs/index.wxss @@ -0,0 +1 @@ +.i-tabs{display:flex;width:100%;height:42px;line-height:42px;box-sizing:border-box;position:relative;justify-content:space-around;align-items:center;-webkit-box-align:center;background:#fff}.i-tabs::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-tabs-scroll{display:block;overflow-x:auto;white-space:nowrap}.i-tabs-fixed{position:fixed;top:0;z-index:2} \ No newline at end of file diff --git a/dist/tag/index.js b/dist/tag/index.js new file mode 100644 index 0000000..338440a --- /dev/null +++ b/dist/tag/index.js @@ -0,0 +1,42 @@ +Component({ + externalClasses: ['i-class'], + properties : { + //slot name + name : { + type : String, + value : '' + }, + //can click or not click + checkable : { + type : Boolean, + value : false + }, + //is current choose + checked : { + type : Boolean, + value : true + }, + //background and color setting + color : { + type : String, + value : 'default' + }, + //control fill or not + type : { + type : String, + value : 'dot' + } + }, + methods : { + tapTag(){ + const data = this.data; + if( data.checkable ){ + const checked = data.checked ? false : true; + this.triggerEvent('change',{ + name : data.name || '', + checked : checked + }); + } + } + } +}) \ No newline at end of file diff --git a/dist/tag/index.json b/dist/tag/index.json new file mode 100644 index 0000000..1dd6c7f --- /dev/null +++ b/dist/tag/index.json @@ -0,0 +1,3 @@ +{ + "component" : true +} \ No newline at end of file diff --git a/dist/tag/index.wxml b/dist/tag/index.wxml new file mode 100644 index 0000000..ed2c675 --- /dev/null +++ b/dist/tag/index.wxml @@ -0,0 +1,27 @@ + + + + +module.exports = { + getClass : function(color,type,checked,checkable) { + var initColorList = ['blue', 'green', 'red', 'yellow', 'default']; + var theme = ''; + var className = 'i-tag-'; + if( initColorList.indexOf( color ) > -1 ){ + theme = className + color; + } + if( type === 'border' ){ + theme = className+color+'-border'; + } + if( checkable && checked ){ + theme = className+color+'-checked'; + }else if( checkable && !checked ){ + theme = ( type === 'border' ? className + color +'-border' : className+'none' ); + } + + return theme; + } +} + \ No newline at end of file diff --git a/dist/tag/index.wxss b/dist/tag/index.wxss new file mode 100644 index 0000000..e19f976 --- /dev/null +++ b/dist/tag/index.wxss @@ -0,0 +1 @@ +.i-tag{display:inline-block;height:18px;line-height:18px;padding:0 4px;border-radius:2px;background:#fff;font-size:11px;vertical-align:middle;border:1rpx solid #dddee1}.i-tag-none{border-color:#fff}.i-tag-default{border-color:#dddee1;background:#e9eaec}.i-tag-red{background:#ed3f14;color:#fff}.i-tag-red-border{color:#ed3f14;background:#fff;border-color:#ed3f14}.i-tag-red-checked{background:#ed3f14;color:#fff;border-color:#ed3f14}.i-tag-green{background:#19be6b;color:#fff;border-color:#19be6b}.i-tag-green-border{color:#19be6b;background:#fff;border-color:#19be6b}.i-tag-green-checked{background:#19be6b;color:#fff;border-color:#19be6b}.i-tag-blue{background:#2d8cf0;color:#fff;border-color:#2d8cf0}.i-tag-blue-border{color:#2d8cf0;background:#fff;border-color:#2d8cf0}.i-tag-blue-checked{background:#2d8cf0;color:#fff;border-color:#2d8cf0}.i-tag-yellow{background:#f90;color:#fff;border-color:#f90}.i-tag-yellow-border{color:#f90;background:#fff;border-color:#f90}.i-tag-yellow-checked{background:#f90;color:#fff;border-color:#f90}.i-tag-default-checked{background:#e9eaec;color:#495060;border-color:#e9eaec} \ No newline at end of file diff --git a/dist/toast/index.js b/dist/toast/index.js new file mode 100644 index 0000000..6493111 --- /dev/null +++ b/dist/toast/index.js @@ -0,0 +1,48 @@ +const default_data = { + visible: false, + content: '', + icon: '', + image: '', + duration: 2, + mask: true, + type: 'default', // default || success || warning || error || loading +}; + +let timmer = null; + +Component({ + externalClasses: ['i-class'], + + data: { + ...default_data + }, + + methods: { + handleShow (options) { + const { type = 'default', duration = 2 } = options; + + this.setData({ + ...options, + type, + duration, + visible: true + }); + + const d = this.data.duration * 1000; + + if (timmer) clearTimeout(timmer); + if (d !== 0) { + timmer = setTimeout(() => { + this.handleHide(); + timmer = null; + }, d); + } + }, + + handleHide () { + this.setData({ + ...default_data + }); + } + } +}); diff --git a/dist/toast/index.json b/dist/toast/index.json new file mode 100644 index 0000000..31309b1 --- /dev/null +++ b/dist/toast/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": + { + "i-icon": "../icon/index" + } +} diff --git a/dist/toast/index.wxml b/dist/toast/index.wxml new file mode 100644 index 0000000..ca5f732 --- /dev/null +++ b/dist/toast/index.wxml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + {{ content }} + \ No newline at end of file diff --git a/dist/toast/index.wxss b/dist/toast/index.wxss new file mode 100644 index 0000000..5b3bd7f --- /dev/null +++ b/dist/toast/index.wxss @@ -0,0 +1 @@ +.i-toast{position:fixed;top:35%;left:50%;transform:translate3d(-50%,-50%,0);background:rgba(0,0,0,.7);color:#fff;font-size:14px;line-height:1.5em;margin:0 auto;box-sizing:border-box;padding:10px 18px;text-align:center;border-radius:4px;z-index:1010}.i-toast-mask{position:fixed;top:0;bottom:0;left:0;right:0;z-index:1010}.i-toast-icon{font-size:38px!important;margin-bottom:6px}.i-toast-image{max-width:100px;max-height:100px}.i-toast-loading{display:inline-block;vertical-align:middle;width:28px;height:28px;background:0 0;border-radius:50%;border:2px solid #fff;border-color:#fff #fff #fff #2d8cf0;animation:btn-spin .8s linear;animation-iteration-count:infinite}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/pages/bind-document/bind-document.js b/pages/bind-document/bind-document.js index 9b57e55..d3ac3ea 100644 --- a/pages/bind-document/bind-document.js +++ b/pages/bind-document/bind-document.js @@ -6,6 +6,11 @@ Page({ */ data: { + radioItems: [ + { name: '1', value: '学生', checked: 'true'}, + { name: '2', value: '家长'}, + { name: '2', value: '辅导员'}, + ], }, /** diff --git a/pages/bind-document/bind-document.json b/pages/bind-document/bind-document.json index 8835af0..b6e3692 100644 --- a/pages/bind-document/bind-document.json +++ b/pages/bind-document/bind-document.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "mp-form": "weui-miniprogram/form/form" + } } \ No newline at end of file diff --git a/pages/bind-document/bind-document.wxml b/pages/bind-document/bind-document.wxml index d65088e..803dbd7 100644 --- a/pages/bind-document/bind-document.wxml +++ b/pages/bind-document/bind-document.wxml @@ -1,2 +1,45 @@ - -pages/bind-document.wxml + + +

绑定您的个人档案

+ 在这里将您的账户与您在学院留存的档案绑定,以便确认您的身份。绑定完成后,系统将通过档案获知您的账号与其他账号的关系。 +
+ + + + 账号类型 + + + + + + + + 档案口令 + + + + + + + + + + + + + + 查询档案 + +
diff --git a/pages/get-user-info/get-user-info.js b/pages/get-user-info/get-user-info.js new file mode 100644 index 0000000..5621248 --- /dev/null +++ b/pages/get-user-info/get-user-info.js @@ -0,0 +1,108 @@ +// pages/get-user-info/get-user-info.js + +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + bindGetUserInfo: function (e) { + + if (e.detail.userInfo) { + // 用户按了允许授权按钮 + var that = this; + // 插入登录的用户的相关信息到数据库 + + new Promise((resolve, reject) => { + const eventChannel = this.getOpenerEventChannel() + eventChannel.emit('acceptDataFromOpenedPage', {data: 'refresh'}) + resolve(e.detail.userInfo) + }).then((userInfo)=> { + // 设置账户基本信息 + app.globalData.userInfo = userInfo + }).then(() => { + // 授权成功后,跳转进入小程序首页 + wx.navigateTo({ + url: '/pages/index/index' + }) + }) + + + + } else { + //用户按了拒绝按钮 + wx.showModal({ + title:'警告', + content:'您点击了拒绝授权,将无法进入小程序,请授权之后再进入!!!', + showCancel:false, + confirmText:'返回授权', + success:function(res){ + if (res.confirm) { + console.log('用户点击了“返回授权”') + } + } + }) + } + }, +}) \ No newline at end of file diff --git a/pages/get-user-info/get-user-info.json b/pages/get-user-info/get-user-info.json new file mode 100644 index 0000000..53876d6 --- /dev/null +++ b/pages/get-user-info/get-user-info.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "i-row": "../../dist/row/index", + "i-col": "../../dist/col/index", + "i-button": "../../dist/button/index", + "i-input": "../../dist/input/index" + } +} \ No newline at end of file diff --git a/pages/get-user-info/get-user-info.wxml b/pages/get-user-info/get-user-info.wxml new file mode 100644 index 0000000..440530d --- /dev/null +++ b/pages/get-user-info/get-user-info.wxml @@ -0,0 +1,11 @@ + + +

个人信息授权

+ 我们需要您进行基本信息授权,我们将用这些信息以初始化您的账户。 +
+ + + + + +
diff --git a/pages/get-user-info/get-user-info.wxss b/pages/get-user-info/get-user-info.wxss new file mode 100644 index 0000000..7f7336f --- /dev/null +++ b/pages/get-user-info/get-user-info.wxss @@ -0,0 +1 @@ +/* pages/get-user-info/get-user-info.wxss */ \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index e64bc94..9689376 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,6 +1,7 @@ // index.js import {getDocument} from '../../api/document' +import {login, checkProfile, setProfile, getProfile} from '../../api/user' // 获取应用实例 const app = getApp() @@ -10,7 +11,157 @@ Page({ motto: 'Hello World', userInfo: {}, hasUserInfo: false, - canIUse: true + canIUse: true, + loading: true, + unrecoverable: false, + refresh: false, + unrecoverableInfo: '', + }, + handleLogin() { + return new Promise((resolve, reject) => { + wx.login({ + success: (res) => { + // 发送 res.code 到后台换取 openId, sessionKey, unionId + login(app.globalData.appID, res.code).then(res => { + console.log(res) + if(res.userBanned) { + return Promise.reject("用户被封禁") + } else { + app.globalData.login = true + // 设置登录时间 + app.globalData.loginTime = Date.now() + // 设置登录信息 + const userBaseInfo = {} + userBaseInfo.openid = res.openid + userBaseInfo.postmark = res.postmark + userBaseInfo.token = res.token + + app.globalData.userBaseInfo = userBaseInfo + return Promise.resolve(userBaseInfo) + } + }).catch(err => { + if(err === "用户被封禁") { + this.setData({ + loading: false, + unrecoverable: true + }) + } + }).then((res) => { + // 获得并设置用户个人账号信息 + return this.handleUserInfo() + }) + } + }) + }) + }, + handleUserInfo() { + let that = this + return new Promise((resolve, reject) => { + resolve(checkProfile()) + }).then((uploaded) => { + if(!uploaded) { + console.log(app.globalData.userInfo) + if(app.globalData.userInfo) { + // 上传账户基本信息到服务器 + return setProfile(app.globalData.userInfo).then((res) => { + that.data.hasUserInfo = true + return Promise.resolve(res) + }).catch(err => { + return Promise.reject(err) + }) + } else { + // 获取账户基本信息 + wx.getSetting({ + success: res => { + if (res.authSetting['scope.userInfo']) { + // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 + wx.getUserInfo({ + success: res => { + new Promise((resolve, reject) => { + // 可以将 res 发送给后台解码出 unionId + const userInfo = res.userInfo + resolve(userInfo) + }).then((res) => { + // 上传账户基本信息到服务器 + return setProfile(res).then((res) => { + return Promise.resolve(res) + }).catch(err => { + console.log(err) + }) + }).then(() => { + that.data.hasUserInfo = true + that.onLoad() + }) + } + }) + } else { + wx.navigateTo({ + url: '../get-user-info/get-user-info', + events: { + // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 + acceptDataFromOpenedPage: function(data) { + console.log(data) + // 是否在跳转回来时刷新该页面 + if(data === "refresh") { + this.setData({ + refresh: true + }) + } + }, + someEvent: function(data) { + console.log(data) + } + }, + }) + } + } + }) + } + + } else { + return new Promise((resolve, reject) => { + return getProfile().then(res => { + // 设置账户基本信息 + app.globalData.userInfo = res + that.data.hasUserInfo = true + resolve(res) + }) + }) + } + }).then(userInfo => { + console.log(userInfo) + + // 检查账户基本信息是否设置到位 + if(!this.data.hasUserInfo) { + return Promise.reject(this.data.hasUserInfo) + } + + app.globalData.userInfo = userInfo + this.setData({ + userInfo, + hasUserInfo: true + }) + + return Promise.resolve(this.data.hasUserInfo) + + }).then((res) => { + console.log(app.globalData) + // 获取与用户关联的档案 + return getDocument(app.globalData.userBaseInfo.openid).then(res => { + console.log(res) + if(res === null) { + wx.navigateTo({ + url: '../bind-document/bind-document' + }) + } + }) + }).catch(err => { + console.log("账户基本信息未设置") + }).finally(() => { + this.setData({ + loading: false + }) + }) }, // 事件处理函数 bindViewTap() { @@ -19,42 +170,22 @@ Page({ }) }, onLoad() { - - if (app.globalData.userInfo) { + new Promise((resolve, reject) => { + return this.handleLogin() + }); + + }, + onShow() { + if(this.data.refresh) + this.onLoad() + }, + getLoginStatus(e) { + if(e.userBanned === true) { this.setData({ - userInfo: app.globalData.userInfo, - hasUserInfo: true - }) - } else if (this.data.canIUse) { - - // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 - // 所以此处加入 callback 以防止这种情况 - app.userInfoReadyCallback = res => { - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - console.log(app.globalData) - getDocument(app.globalData.userBaseInfo.openid).then(res => { - console.log(res) - }).catch(err => { - console.log(err ) - }) - - } - } else { - // 在没有 open-type=getUserInfo 版本的兼容处理 - wx.getUserInfo({ - success: res => { - app.globalData.userInfo = res.userInfo - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - } + loading: false, + unrecoverable: true }) } - }, getUserInfo(e) { console.log(e) diff --git a/pages/index/index.json b/pages/index/index.json index 8835af0..207522e 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "i-spin": "../../dist/spin/index" + } } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 0243bda..bde0682 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -10,4 +10,6 @@ {{motto}} + + 您的账号已被封禁 diff --git a/utils/request.js b/utils/request.js index 8ecc432..8b376b9 100644 --- a/utils/request.js +++ b/utils/request.js @@ -28,7 +28,7 @@ const refresh_token = app => { }).then(() => { // 停止刷新状态 refreshing = false; - // 执行所有的代发请求 + // 执行所有的缓存的请求 pendings.forEach(element => { do_request(app, element) }) @@ -50,18 +50,14 @@ const do_request = (app, options) => { // 检查登录状态 if(app.globalData.login) { const userBaseInfo = app.globalData.userBaseInfo + // 生成随机特征值 let random_code = `RandomCode [${userBaseInfo.openid}][${header_options.timestamp}][${app.globalData.appID}]` - console.log(random_code) random_code = sha1(random_code) - console.log(random_code) - + // 生成客户端签名 let signed = `SIGN [${userBaseInfo.postmark}][${random_code}][${userBaseInfo.token}]` - signed = sha1(signed) - console.log(signed) - + // 填写头部验证部分 header_options['signed'] = signed; - header_options['postmark'] = userBaseInfo.postmark; } @@ -70,6 +66,8 @@ const do_request = (app, options) => { if(data && method === 'post') { header_options['Content-Type'] = 'application/x-www-form-urlencoded' } + + // 调用微信接口进行网络请求 wx.request({ header: { ...header_options @@ -77,6 +75,7 @@ const do_request = (app, options) => { ...options, success: function(res) { const data = res.data + // 检查返回状态码 if(data.status >= 200 && data.status < 300) { resolve(data.data) } else { @@ -100,12 +99,16 @@ const request = options => { if(loginTime != null && loginTime + 1000 * 60 < Date.now()) { app.globalData.loginTime = null refreshing = true + // 执行token刷新 refresh_token(app) } + // 检查是否正在刷新 if(refreshing) { + // 缓存请求 pendings.push(options) } else { + // 进行请求 do_request(app, options).then(res => { resolve(res) }).catch(err => {