-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
696 changed files
with
5,423 additions
and
4,566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
require('./libs/Mixins.js'); | ||
|
||
const themeListeners = []; | ||
const listeners = []; | ||
|
||
App({ | ||
globalData: { | ||
theme: 'light', // dark | ||
}, | ||
themeChanged(theme) { | ||
this.globalData.theme = theme; | ||
themeListeners.forEach((listener) => { | ||
listener(theme); | ||
}); | ||
}, | ||
watchThemeChange(listener) { | ||
if (themeListeners.indexOf(listener) < 0) { | ||
themeListeners.push(listener); | ||
} | ||
}, | ||
unWatchThemeChange(listener) { | ||
const index = themeListeners.indexOf(listener); | ||
if (index > -1) { | ||
themeListeners.splice(index, 1); | ||
} | ||
}, | ||
}); | ||
globalData: { | ||
theme: 'light', // dark | ||
mode: '', // 模式(care:关怀模式) | ||
}, | ||
changeGlobalData(data) { | ||
this.globalData = Object.assign({}, this.globalData, data); | ||
listeners.forEach((listener) => { | ||
listener(this.globalData); | ||
}); | ||
}, | ||
watchGlobalDataChanged(listener) { | ||
if (listeners.indexOf(listener) < 0) { | ||
listeners.push(listener); | ||
} | ||
}, | ||
unWatchGlobalDataChanged(listener) { | ||
const index = listeners.indexOf(listener); | ||
if (index > -1) { | ||
listeners.splice(index, 1); | ||
} | ||
}, | ||
onThemeChange(resp) { | ||
this.changeGlobalData({ | ||
theme: resp.theme, | ||
}); | ||
}, | ||
onLaunch() { | ||
// TODO: 检测适老化 | ||
}, | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
Page({ | ||
mixins: [require('../../mixin/themeChanged')], | ||
data: { | ||
showIOSDialog: false, | ||
showAndroidDialog: false, | ||
}, | ||
close: function() { | ||
this.setData({ | ||
showIOSDialog: false, | ||
showAndroidDialog: false | ||
}); | ||
}, | ||
openIOS: function () { | ||
this.setData({ | ||
showIOSDialog: true | ||
}); | ||
}, | ||
openAndroid: function () { | ||
this.setData({ | ||
showAndroidDialog: true | ||
}); | ||
} | ||
mixins: [require('../../mixin/common')], | ||
data: { | ||
showIOSDialog: false, | ||
showAndroidDialog: false, | ||
}, | ||
close() { | ||
this.setData({ | ||
showIOSDialog: false, | ||
showAndroidDialog: false, | ||
}); | ||
}, | ||
openIOS() { | ||
this.setData({ | ||
showIOSDialog: true, | ||
}); | ||
}, | ||
openAndroid() { | ||
this.setData({ | ||
showAndroidDialog: true, | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Page({ | ||
mixins: [require('../../mixin/themeChanged')], | ||
}); | ||
mixins: [require('../../mixin/common')], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,44 @@ | ||
<page-meta root-font-size="system"/> | ||
<view class="page" data-weui-theme="{{theme}}"> | ||
<view class="page__hd"> | ||
<view class="page__title">Article</view> | ||
<view class="page__desc">文章</view> | ||
</view> | ||
<view class="page__bd"> | ||
<view class="weui-article"> | ||
<view class="weui-article__h1">大标题</view> | ||
<view class="weui-article__section"> | ||
<view class="weui-article__h2">章标题</view> | ||
<view class="weui-article__section"> | ||
<view class="weui-article__h3">1.1 节标题</view> | ||
<view class="weui-article__p"> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo | ||
consequat. | ||
</view> | ||
<view class="weui-article__p"> | ||
<image class="weui-article__img" src="../images/pic_article.png" mode="aspectFit" style="height: 180px" /> | ||
<image class="weui-article__img" src="../images/pic_article.png" mode="aspectFit" style="height: 180px" /> | ||
</view> | ||
<view class="page" data-weui-theme="{{theme}}" data-weui-mode="{{mode}}"> | ||
<view class="weui-article"> | ||
<view aria-role="heading" aria-level="4" class="weui-article__h1">大标题</view> | ||
<view class="weui-article__section"> | ||
<view class="weui-article__h2">章标题</view> | ||
<view class="weui-article__section"> | ||
<view class="weui-article__h3">1.1 节标题</view> | ||
<view class="weui-article__p"> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo | ||
consequat. | ||
</view> | ||
<view class="weui-article__p"> | ||
<image class="weui-article__img" src="../images/pic_article.png" mode="aspectFit" style="height: 180px;" /> | ||
<image class="weui-article__img" src="../images/pic_article.png" mode="aspectFit" style="height: 180px;" /> | ||
</view> | ||
</view> | ||
<view class="weui-article__section"> | ||
<view class="weui-article__h3">1.2 节标题</view> | ||
<view class="weui-article__section"> | ||
<view class="weui-article__h4">1.2.1 小节标题</view> | ||
<view class="weui-article__p"> | ||
<view class="weui-a11y-combo"> | ||
<view class="weui-a11y-combo__helper" aria-labelledby="txt1 txt2" readonly aria-role="option"></view> | ||
<text id="txt1" class="weui-a11y-combo__content" aria-hidden="true">Lorem ipsum dolor sit amet, consectetur adipisicing elit</text> | ||
<navigator id="txt2" class="weui-a11y-combo__content weui-link weui-wa-hotarea">read more</navigator> | ||
</view> | ||
</view> | ||
<view class="weui-article__section"> | ||
<view class="weui-article__h3">1.2 节标题</view> | ||
<view class="weui-article__p"> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non | ||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
</view> | ||
</view> | ||
<view class="weui-article__section"> | ||
<view class="weui-article__h4">1.2.1 小节标题</view> | ||
<view class="weui-article__p"> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non | ||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Page({ | ||
mixins: [require('../../mixin/themeChanged')], | ||
}); | ||
mixins: [require('../../mixin/common')], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
Page({ | ||
mixins: [require('../../mixin/themeChanged')], | ||
openDefault: function () { | ||
wx.navigateTo({ | ||
url: 'button_default' | ||
}) | ||
}, | ||
openBottomfixed: function () { | ||
wx.navigateTo({ | ||
url: 'button_bottom_fixed' | ||
}) | ||
}, | ||
mixins: [require('../../mixin/common')], | ||
openDefault() { | ||
wx.navigateTo({ | ||
url: 'button_default', | ||
}); | ||
}, | ||
openBottomfixed() { | ||
wx.navigateTo({ | ||
url: 'button_bottom_fixed', | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
Page({ | ||
mixins: [require('../../mixin/themeChanged')], | ||
}); | ||
mixins: [require('../../mixin/common')], | ||
data: { | ||
wrap: false, | ||
}, | ||
onShow() { | ||
wx.createSelectorQuery().select('#js_btn') | ||
.boundingClientRect((rect) => { | ||
if (rect.height > 48) { | ||
this.setData({ wrap: true }); | ||
} | ||
}) | ||
.exec(); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
<page-meta root-font-size="system"/> | ||
<view class="page" data-weui-theme="{{theme}}"> | ||
<view class="weui-bottom-fixed-opr-page"> | ||
|
||
<view class="page" data-weui-theme="{{theme}}" data-weui-mode="{{mode}}"> | ||
<view class="weui-bottom-fixed-opr-page {{wrap ? 'weui-bottom-fixed-opr-page_btn-wrap' : ''}}"> | ||
<view class="weui-bottom-fixed-opr-page__content"> | ||
<view class="weui-bottom-fixed-opr-demo">Dolor tempora dolore aperiam fuga necessitatibus? Odio atque tempora deleniti voluptates voluptatem. Dolorem earum voluptas blanditiis labore quisquam? Quibusdam nesciunt consequatur aliquam ea corrupti animi, itaque consequatur neque? At porroSit nemo aliquid quas error doloremque Reiciendis ratione repellendus quae sit commodi amet architecto? Aut officiis aliquam fugit nulla at necessitatibus Optio totam quibusdam laboriosam aperiam libero! Officiis reiciendis Elit quaerat sed vero perferendis architecto consequatur. Consequuntur ad illum dolore ut accusamus. Cum possimus odit sequi quaerat beatae, eveniet. Rerum dolore ipsam quia consectetur iste Veniam mollitia dolores tempore? Dolor tempora dolore aperiam fuga necessitatibus? Odio atque tempora deleniti voluptates voluptatem. Dolorem earum voluptas blanditiis labore quisquam? Quibusdam nesciunt consequatur aliquam ea corrupti animi, itaque consequatur neque? At porroSit nemo aliquid quas error doloremque Reiciendis ratione repellendus quae sit commodi amet architecto? Aut officiis aliquam fugit nulla at necessitatibus Optio totam quibusdam laboriosam aperiam libero! Officiis reiciendis Elit quaerat sed vero perferendis architecto consequatur. Consequuntur ad illum dolore ut accusamus. Cum possimus odit sequi quaerat beatae, eveniet. Rerum dolore ipsam quia consectetur iste Veniam mollitia dolores tempore? </view> | ||
</view> | ||
<view class="weui-bottom-fixed-opr"> | ||
<navigator class="weui-btn weui-btn_primary" aria-role="button" url="javascript:;">完成</navigator> | ||
<view class="weui-bottom-fixed-opr" id="js_opr"> | ||
<navigator class="weui-btn weui-btn_primary" id="js_btn" aria-role="button" url="javascript:;">阅读并同意</navigator> | ||
<navigator class="weui-btn weui-btn_default" aria-role="button" url="javascript:;">取消</navigator> | ||
</view> | ||
</view> | ||
</view> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Page({ | ||
mixins: [require('../../mixin/themeChanged')], | ||
}); | ||
mixins: [require('../../mixin/common')], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.