├── Chapter_9 ├── android │ ├── gradle.properties │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── icon_logo.png │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── yugangtalk │ │ │ │ │ └── read │ │ │ │ │ └── MainActivity.java │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── build.gradle ├── images │ ├── img_bg.png │ ├── icon_home.png │ ├── icon_love.png │ ├── icon_my.png │ ├── icon_star.png │ ├── icon_user.png │ ├── img_card.png │ ├── img_login.png │ ├── icon_praise.png │ ├── img_header.jpeg │ ├── icon_love_card.png │ ├── icon_setting.png │ ├── img_book_card.png │ ├── img_book_yskf.jpg │ ├── img_register.png │ ├── icon_arrow_right.png │ ├── icon_collection.png │ ├── icon_my_default.png │ ├── icon_home_default.png │ ├── icon_star_checked.png │ └── icon_star_default.png ├── ios │ ├── Runner │ │ ├── Assets.xcassets │ │ │ ├── Contents.json │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── icon_logo58.png │ │ │ │ ├── icon_logo87.png │ │ │ │ └── Contents.json │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── AppDelegate.m │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Podfile ├── lib │ ├── common │ │ ├── ColorsUtil.dart │ │ ├── DialogUtils.dart │ │ └── DbProvider.dart │ ├── models │ │ ├── BookTab.dart │ │ ├── Constants.dart │ │ ├── Book.dart │ │ └── Comment.dart │ ├── api │ │ ├── Api.dart │ │ └── NetUtils.dart │ ├── widgets │ │ └── CommentBar.dart │ └── pages │ │ ├── BookStore.dart │ │ ├── SettingPage.dart │ │ └── CollectBooksPage.dart ├── README.md ├── test │ └── widget_test.dart └── pubspec.yaml ├── Chapter_6 ├── pages │ ├── tab1 │ │ ├── tab1.json │ │ ├── tab1.wxss │ │ ├── tab1.js │ │ └── tab1.wxml │ ├── container-base │ │ ├── container-base.json │ │ ├── container-base.wxss │ │ ├── container-base.js │ │ └── container-base.wxml │ ├── container-form │ │ ├── container-form.json │ │ ├── container-form.wxss │ │ ├── container-form.js │ │ └── container-form.wxml │ ├── container-map │ │ ├── container-map.json │ │ ├── container-map.wxss │ │ ├── container-map.js │ │ └── container-map.wxml │ ├── container-view │ │ ├── container-view.json │ │ ├── container-view.js │ │ ├── container-view.wxml │ │ └── container-view.wxss │ ├── container-media │ │ ├── container-media.json │ │ ├── container-media.wxss │ │ ├── container-media.wxml │ │ └── container-media.js │ ├── container-swiper │ │ ├── container-swiper.json │ │ ├── container-swiper.js │ │ ├── container-swiper.wxml │ │ └── container-swiper.wxss │ ├── container-web-view │ │ ├── container-web-view.json │ │ ├── container-web-view.wxml │ │ ├── container-web-view.wxss │ │ └── container-web-view.js │ └── container-scroll-view │ │ ├── container-scroll-view.json │ │ ├── container-scroll-view.js │ │ ├── container-scroll-view.wxml │ │ └── container-scroll-view.wxss ├── app.js ├── app.wxss ├── app.json └── project.config.json ├── Chapter_7 ├── pages │ ├── home │ │ ├── home.json │ │ ├── home.wxml │ │ ├── home.js │ │ └── home.wxss │ ├── mine │ │ ├── mine.json │ │ ├── mine.js │ │ ├── mine.wxml │ │ └── mine.wxss │ ├── detail │ │ ├── detail.json │ │ └── detail.wxml │ ├── sign-in │ │ ├── sign-in.json │ │ ├── sign-in.wxml │ │ ├── sign-in.wxss │ │ └── sign-in.js │ ├── sign-up │ │ ├── sign-up.json │ │ ├── sign-up.wxml │ │ ├── sign-up.js │ │ └── sign-up.wxss │ ├── favorite │ │ ├── favorite.json │ │ ├── favorite.wxml │ │ ├── favorite.js │ │ └── favorite.wxss │ └── settings │ │ ├── settings.wxml │ │ ├── settings.wxss │ │ └── settings.js ├── images │ ├── book.jpg │ ├── logo.png │ ├── mine │ │ ├── btn_get_2x.png │ │ ├── ic_agree_2x.png │ │ ├── bg_mine_hot_2x.png │ │ ├── ic_collect_2x.png │ │ └── ic_favorite_2x.png │ ├── detail │ │ ├── ic_agree_2x.png │ │ ├── ic_favorite_normal_2x.png │ │ └── ic_favorite_selected_2x.png │ ├── sign_up │ │ ├── bg_avatar_2x.png │ │ └── btn_sign_up_2x.png │ ├── sign_in │ │ └── btn_sign_in_2x.png │ └── tabbar │ │ ├── ic_home_normal_2x.png │ │ ├── ic_mine_normal_2x.png │ │ ├── ic_home_selected_2x.png │ │ └── ic_mine_selected_2x.png ├── config │ ├── api.js │ └── config.js ├── app.js ├── sitemap.json ├── app.wxss ├── utils │ └── money.js ├── project.config.json └── app.json ├── Chapter_5 ├── app.json ├── android │ ├── settings.gradle │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── logo.png │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── logo.png │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ └── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── shudan │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ ├── BUCK │ │ └── proguard-rules.pro │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── keystores │ │ ├── debug.keystore.properties │ │ └── BUCK │ ├── local.properties │ ├── build.gradle │ ├── gradle.properties │ └── gradlew.bat ├── shudan.keystore ├── app │ ├── img │ │ ├── default.png │ │ ├── icon1@2x.png │ │ ├── icon1@3x.png │ │ ├── icon2@2x.png │ │ ├── icon2@3x.png │ │ ├── icon3@2x.png │ │ ├── icon3@3x.png │ │ ├── me_like@2x.png │ │ ├── me_like@3x.png │ │ ├── me_rect@2x.png │ │ ├── me_rect@3x.png │ │ ├── login_btn@2x.png │ │ ├── login_btn@3x.png │ │ ├── me_dianzan@2x.png │ │ ├── me_dianzan@3x.png │ │ ├── me_header@2x.png │ │ ├── me_header@3x.png │ │ ├── me_lingqu@2x.png │ │ ├── me_lingqu@3x.png │ │ ├── me_setting@2x.png │ │ ├── me_setting@3x.png │ │ ├── right_arrow.png │ │ ├── default_icon@2x.png │ │ ├── default_icon@3x.png │ │ ├── drawer_arrow@2x.png │ │ ├── drawer_arrow@3x.png │ │ ├── drawer_icon1@2x.png │ │ ├── drawer_icon1@3x.png │ │ ├── drawer_icon2@2x.png │ │ ├── drawer_icon2@3x.png │ │ ├── drawer_icon3@2x.png │ │ ├── drawer_icon3@3x.png │ │ ├── me_selected@2x.png │ │ ├── me_selected@3x.png │ │ ├── me_shoucang@2x.png │ │ ├── me_shoucang@3x.png │ │ ├── register_btn@2x.png │ │ ├── register_btn@3x.png │ │ ├── home_unselect@2x.png │ │ ├── home_unselect@3x.png │ │ ├── register_header@2x.png │ │ ├── register_header@3x.png │ │ ├── shudan_dianzan@2x.png │ │ ├── shudan_dianzan@3x.png │ │ ├── shudan_shoucang@2x.png │ │ ├── shudan_shoucang@3x.png │ │ ├── shudan_underline@2x.png │ │ ├── shudan_underline@3x.png │ │ ├── shudan_unshoucang@2x.png │ │ └── shudan_unshoucang@3x.png │ ├── util │ │ ├── StringUtil.js │ │ ├── AsyncStorageUtil.js │ │ ├── ToastUtil.js │ │ └── HttpUtil.js │ ├── common │ │ ├── CommonStyle.js │ │ └── Constant.js │ ├── component │ │ └── BaseComponent.js │ ├── view │ │ ├── login │ │ │ ├── SplashView.js │ │ │ └── RegisterView.js │ │ ├── shudan │ │ │ ├── ShanDanListView.js │ │ │ └── ShuDanView.js │ │ └── drawer │ │ │ └── DrawerView.js │ └── navigate │ │ └── AppStack.js ├── ios │ ├── ShuDan │ │ ├── Images.xcassets │ │ │ ├── Contents.json │ │ │ ├── logo.png │ │ │ └── AppIcon.appiconset │ │ │ │ ├── icon-1024.png │ │ │ │ ├── icon-20@2x.png │ │ │ │ ├── icon-20@3x.png │ │ │ │ ├── icon-29@2x.png │ │ │ │ ├── icon-29@3x.png │ │ │ │ ├── icon-40@2x.png │ │ │ │ ├── icon-40@3x.png │ │ │ │ ├── icon-60@2x.png │ │ │ │ ├── icon-60@3x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── AppDelegate.m │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ └── LaunchScreen.xib │ ├── bundle │ │ ├── index.jsbundle.meta │ │ └── assets │ │ │ └── app │ │ │ └── img │ │ │ ├── default.png │ │ │ ├── icon1@2x.png │ │ │ ├── icon1@3x.png │ │ │ ├── icon2@2x.png │ │ │ ├── icon2@3x.png │ │ │ ├── icon3@2x.png │ │ │ ├── icon3@3x.png │ │ │ ├── me_like@2x.png │ │ │ ├── me_like@3x.png │ │ │ ├── me_rect@2x.png │ │ │ ├── me_rect@3x.png │ │ │ ├── login_btn@2x.png │ │ │ ├── login_btn@3x.png │ │ │ ├── me_header@2x.png │ │ │ ├── me_header@3x.png │ │ │ ├── me_lingqu@2x.png │ │ │ ├── me_lingqu@3x.png │ │ │ ├── default_icon@2x.png │ │ │ ├── default_icon@3x.png │ │ │ ├── drawer_arrow@2x.png │ │ │ ├── drawer_arrow@3x.png │ │ │ ├── drawer_icon1@2x.png │ │ │ ├── drawer_icon1@3x.png │ │ │ ├── drawer_icon2@2x.png │ │ │ ├── drawer_icon2@3x.png │ │ │ ├── drawer_icon3@2x.png │ │ │ ├── drawer_icon3@3x.png │ │ │ ├── me_dianzan@2x.png │ │ │ ├── me_dianzan@3x.png │ │ │ ├── me_selected@2x.png │ │ │ ├── me_selected@3x.png │ │ │ ├── me_setting@2x.png │ │ │ ├── me_setting@3x.png │ │ │ ├── me_shoucang@2x.png │ │ │ ├── me_shoucang@3x.png │ │ │ ├── register_btn@2x.png │ │ │ ├── register_btn@3x.png │ │ │ ├── home_unselect@2x.png │ │ │ ├── home_unselect@3x.png │ │ │ ├── shudan_dianzan@2x.png │ │ │ ├── shudan_dianzan@3x.png │ │ │ ├── register_header@2x.png │ │ │ ├── register_header@3x.png │ │ │ ├── shudan_shoucang@2x.png │ │ │ ├── shudan_shoucang@3x.png │ │ │ ├── shudan_underline@2x.png │ │ │ └── shudan_underline@3x.png │ ├── ShuDanTests │ │ ├── Info.plist │ │ └── ShuDanTests.m │ ├── ShuDan-tvOSTests │ │ └── Info.plist │ └── ShuDan-tvOS │ │ └── Info.plist ├── index.js ├── App.js └── package.json ├── 36627.jpg └── README.md /Chapter_9/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /Chapter_6/pages/tab1/tab1.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "常用组件" 3 | } -------------------------------------------------------------------------------- /Chapter_7/pages/home/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "首页" 3 | } -------------------------------------------------------------------------------- /Chapter_7/pages/mine/mine.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "我的" 3 | } -------------------------------------------------------------------------------- /Chapter_5/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ShuDan", 3 | "displayName": "ShuDan" 4 | } -------------------------------------------------------------------------------- /Chapter_7/pages/detail/detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "图书详情" 3 | } -------------------------------------------------------------------------------- /Chapter_7/pages/sign-in/sign-in.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "登录" 3 | } -------------------------------------------------------------------------------- /Chapter_7/pages/sign-up/sign-up.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "注册" 3 | } -------------------------------------------------------------------------------- /Chapter_7/pages/favorite/favorite.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "收藏" 3 | } -------------------------------------------------------------------------------- /36627.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/36627.jpg -------------------------------------------------------------------------------- /Chapter_5/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ShuDan' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-base/container-base.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "基础组件" 3 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-form/container-form.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "表单组件" 3 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-map/container-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "map" 3 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-view/container-view.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "view" 3 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-media/container-media.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "媒体组件" 3 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-swiper/container-swiper.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "swiper" 3 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-web-view/container-web-view.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "web-view" 3 | } -------------------------------------------------------------------------------- /Chapter_5/shudan.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/shudan.keystore -------------------------------------------------------------------------------- /Chapter_6/app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function () { 4 | 5 | }, 6 | globalData: { 7 | } 8 | }) -------------------------------------------------------------------------------- /Chapter_6/pages/container-scroll-view/container-scroll-view.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "scroll-view" 3 | } -------------------------------------------------------------------------------- /Chapter_7/images/book.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/book.jpg -------------------------------------------------------------------------------- /Chapter_7/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/logo.png -------------------------------------------------------------------------------- /Chapter_9/images/img_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/img_bg.png -------------------------------------------------------------------------------- /Chapter_5/app/img/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/default.png -------------------------------------------------------------------------------- /Chapter_5/app/img/icon1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/icon1@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/icon1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/icon1@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/icon2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/icon2@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/icon2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/icon2@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/icon3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/icon3@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/icon3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/icon3@3x.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_home.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_love.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_love.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_my.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_star.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_user.png -------------------------------------------------------------------------------- /Chapter_9/images/img_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/img_card.png -------------------------------------------------------------------------------- /Chapter_9/images/img_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/img_login.png -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ShuDan 3 | 4 | -------------------------------------------------------------------------------- /Chapter_5/app/img/me_like@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_like@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_like@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_like@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_rect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_rect@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_rect@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_rect@3x.png -------------------------------------------------------------------------------- /Chapter_7/config/api.js: -------------------------------------------------------------------------------- 1 | let host = "http://renyugang.io/api/read.php"; 2 | 3 | 4 | module.exports = { 5 | host: host, 6 | 7 | }; -------------------------------------------------------------------------------- /Chapter_9/images/icon_praise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_praise.png -------------------------------------------------------------------------------- /Chapter_9/images/img_header.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/img_header.jpeg -------------------------------------------------------------------------------- /Chapter_5/app/img/login_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/login_btn@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/login_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/login_btn@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_dianzan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_dianzan@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_dianzan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_dianzan@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_header@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_header@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_header@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_header@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_lingqu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_lingqu@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_lingqu@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_lingqu@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_setting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_setting@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_setting@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_setting@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/right_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/right_arrow.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Chapter_7/app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function () { 4 | 5 | }, 6 | globalData: { 7 | userInfo: null 8 | } 9 | }) -------------------------------------------------------------------------------- /Chapter_9/images/icon_love_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_love_card.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_setting.png -------------------------------------------------------------------------------- /Chapter_9/images/img_book_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/img_book_card.png -------------------------------------------------------------------------------- /Chapter_9/images/img_book_yskf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/img_book_yskf.jpg -------------------------------------------------------------------------------- /Chapter_9/images/img_register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/img_register.png -------------------------------------------------------------------------------- /Chapter_5/app/img/default_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/default_icon@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/default_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/default_icon@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/drawer_arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/drawer_arrow@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/drawer_arrow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/drawer_arrow@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/drawer_icon1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/drawer_icon1@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/drawer_icon1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/drawer_icon1@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/drawer_icon2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/drawer_icon2@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/drawer_icon2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/drawer_icon2@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/drawer_icon3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/drawer_icon3@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/drawer_icon3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/drawer_icon3@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_selected@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_selected@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_shoucang@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_shoucang@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/me_shoucang@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/me_shoucang@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/register_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/register_btn@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/register_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/register_btn@3x.png -------------------------------------------------------------------------------- /Chapter_7/images/mine/btn_get_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/mine/btn_get_2x.png -------------------------------------------------------------------------------- /Chapter_7/images/mine/ic_agree_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/mine/ic_agree_2x.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_arrow_right.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_collection.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_my_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_my_default.png -------------------------------------------------------------------------------- /Chapter_5/app/img/home_unselect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/home_unselect@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/home_unselect@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/home_unselect@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/register_header@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/register_header@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/register_header@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/register_header@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/shudan_dianzan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/shudan_dianzan@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/shudan_dianzan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/shudan_dianzan@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/shudan_shoucang@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/shudan_shoucang@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/shudan_shoucang@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/shudan_shoucang@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/index.jsbundle.meta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/index.jsbundle.meta -------------------------------------------------------------------------------- /Chapter_7/images/detail/ic_agree_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/detail/ic_agree_2x.png -------------------------------------------------------------------------------- /Chapter_7/images/mine/bg_mine_hot_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/mine/bg_mine_hot_2x.png -------------------------------------------------------------------------------- /Chapter_7/images/mine/ic_collect_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/mine/ic_collect_2x.png -------------------------------------------------------------------------------- /Chapter_7/images/mine/ic_favorite_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/mine/ic_favorite_2x.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_home_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_home_default.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_star_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_star_checked.png -------------------------------------------------------------------------------- /Chapter_9/images/icon_star_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/images/icon_star_default.png -------------------------------------------------------------------------------- /Chapter_9/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /Chapter_5/app/img/shudan_underline@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/shudan_underline@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/shudan_underline@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/shudan_underline@3x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/shudan_unshoucang@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/shudan_unshoucang@2x.png -------------------------------------------------------------------------------- /Chapter_5/app/img/shudan_unshoucang@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/app/img/shudan_unshoucang@3x.png -------------------------------------------------------------------------------- /Chapter_7/images/sign_up/bg_avatar_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/sign_up/bg_avatar_2x.png -------------------------------------------------------------------------------- /Chapter_9/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /Chapter_5/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './App'; 3 | 4 | AppRegistry.registerComponent('ShuDan', () => App); 5 | -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/logo.png -------------------------------------------------------------------------------- /Chapter_7/images/sign_in/btn_sign_in_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/sign_in/btn_sign_in_2x.png -------------------------------------------------------------------------------- /Chapter_7/images/sign_up/btn_sign_up_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/sign_up/btn_sign_up_2x.png -------------------------------------------------------------------------------- /Chapter_7/images/tabbar/ic_home_normal_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/tabbar/ic_home_normal_2x.png -------------------------------------------------------------------------------- /Chapter_7/images/tabbar/ic_mine_normal_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/tabbar/ic_mine_normal_2x.png -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/default.png -------------------------------------------------------------------------------- /Chapter_7/images/tabbar/ic_home_selected_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/tabbar/ic_home_selected_2x.png -------------------------------------------------------------------------------- /Chapter_7/images/tabbar/ic_mine_selected_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/tabbar/ic_mine_selected_2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/icon1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/icon1@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/icon1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/icon1@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/icon2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/icon2@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/icon2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/icon2@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/icon3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/icon3@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/icon3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/icon3@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_like@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_like@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_like@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_like@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_rect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_rect@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_rect@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_rect@3x.png -------------------------------------------------------------------------------- /Chapter_7/images/detail/ic_favorite_normal_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/detail/ic_favorite_normal_2x.png -------------------------------------------------------------------------------- /Chapter_5/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Chapter_5/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/login_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/login_btn@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/login_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/login_btn@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_header@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_header@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_header@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_header@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_lingqu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_lingqu@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_lingqu@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_lingqu@3x.png -------------------------------------------------------------------------------- /Chapter_7/images/detail/ic_favorite_selected_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_7/images/detail/ic_favorite_selected_2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/default_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/default_icon@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/default_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/default_icon@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/drawer_arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/drawer_arrow@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/drawer_arrow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/drawer_arrow@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/drawer_icon1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/drawer_icon1@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/drawer_icon1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/drawer_icon1@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/drawer_icon2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/drawer_icon2@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/drawer_icon2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/drawer_icon2@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/drawer_icon3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/drawer_icon3@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/drawer_icon3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/drawer_icon3@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_dianzan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_dianzan@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_dianzan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_dianzan@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_selected@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_selected@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_setting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_setting@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_setting@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_setting@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_shoucang@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_shoucang@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/me_shoucang@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/me_shoucang@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/register_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/register_btn@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/register_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/register_btn@3x.png -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/res/mipmap-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/android/app/src/main/res/mipmap-xhdpi/logo.png -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/res/mipmap-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/android/app/src/main/res/mipmap-xxhdpi/logo.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/home_unselect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/home_unselect@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/home_unselect@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/home_unselect@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/shudan_dianzan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/shudan_dianzan@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/shudan_dianzan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/shudan_dianzan@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/register_header@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/register_header@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/register_header@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/register_header@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/shudan_shoucang@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/shudan_shoucang@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/shudan_shoucang@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/shudan_shoucang@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/shudan_underline@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/shudan_underline@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/bundle/assets/app/img/shudan_underline@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/bundle/assets/app/img/shudan_underline@3x.png -------------------------------------------------------------------------------- /Chapter_9/lib/common/ColorsUtil.dart: -------------------------------------------------------------------------------- 1 | class ColorsUtil{ 2 | static int THEME_BLACK = 0XFF353535; 3 | static int TYPEFACE_BLACK = 0XFF636362; 4 | static int TYPEFACE_BLUE = 0XFF36BAE0; 5 | } -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/res/mipmap-xxhdpi/icon_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/android/app/src/main/res/mipmap-xxhdpi/icon_logo.png -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Chapter_7/sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-20@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-20@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_logo58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_logo58.png -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_logo87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_logo87.png -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /Chapter_5/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/android-exchange/cross-platform-guide/HEAD/Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /Chapter_6/pages/container-web-view/container-web-view.wxml: -------------------------------------------------------------------------------- 1 | 2 | web-view 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cross-platform-guide 2 | 《大前端入门指南》书中源代码 3 | 4 | 关注微信公众号「玉刚说」
5 | 回复 “大前端入门”
6 | 获得本书互动答疑内容
7 | cover 8 | -------------------------------------------------------------------------------- /Chapter_5/app/util/StringUtil.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 判断是否未空 3 | * @param {*字符串} str 4 | */ 5 | export function isEmpity(str){ 6 | if(str==null||str==""||str.legth==0){ 7 | return true; 8 | } 9 | return false; 10 | } -------------------------------------------------------------------------------- /Chapter_9/lib/models/BookTab.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:read/pages/BookList.dart'; 3 | 4 | /** 5 | * 定义TAB页对象 针对每个TAB也给不同的对象 6 | */ 7 | class BookTab{ 8 | String text; 9 | BookList bookList; 10 | BookTab(this.text,this.bookList); 11 | } -------------------------------------------------------------------------------- /Chapter_7/pages/settings/settings.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 退出登录 5 | 关于 6 | 7 | -------------------------------------------------------------------------------- /Chapter_9/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter_6/app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | .container { 3 | height: 100%; 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: space-between; 8 | padding: 200rpx 0; 9 | box-sizing: border-box; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter_5/app/common/CommonStyle.js: -------------------------------------------------------------------------------- 1 | import{StyleSheet}from'react-native'; 2 | 3 | const CommonStyle= StyleSheet.create({ 4 | root:{ 5 | flex:1, 6 | backgroundColor:'#F4F4F4' 7 | } 8 | }); 9 | 10 | export default CommonStyle; -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Chapter_5/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /Chapter_7/config/config.js: -------------------------------------------------------------------------------- 1 | // pages/config/config.js 2 | 3 | module.exports = { 4 | cacheKey: { //配置缓存中的key,方便统一管理 5 | userInfo: "userInfo", 6 | username: "username", 7 | password: "password", 8 | favoriteBooks: "favoriteBooks", 9 | } 10 | }; -------------------------------------------------------------------------------- /Chapter_5/app/common/Constant.js: -------------------------------------------------------------------------------- 1 | import{Dimensions}from'react-native'; 2 | 3 | const Constant={ 4 | screenWidth:Dimensions.get('window').width, 5 | screenHeight:Dimensions.get('window').height, 6 | baseUrl:'http://renyugang.io/api/read.php?' 7 | } 8 | 9 | export default Constant; -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Chapter_9/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-map/container-map.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f2f2f2; 3 | } 4 | 5 | .title { 6 | height: 100rpx; 7 | color: #808080; 8 | line-height: 100rpx; 9 | font-size: 32rpx; 10 | margin: 20rpx 40rpx; 11 | } 12 | 13 | .item-container { 14 | margin: 20rpx 40rpx; 15 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-base/container-base.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f2f2f2; 3 | } 4 | 5 | .title { 6 | height: 100rpx; 7 | color: #808080; 8 | line-height: 100rpx; 9 | font-size: 32rpx; 10 | margin: 20rpx 40rpx; 11 | } 12 | 13 | .item-container { 14 | margin: 20rpx 40rpx; 15 | } -------------------------------------------------------------------------------- /Chapter_9/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter_9/lib/api/Api.dart: -------------------------------------------------------------------------------- 1 | class Api { 2 | 3 | 4 | static final String HOST = "http://renyugang.io/api/read.php"; 5 | // 资讯列表 6 | static final String BOOK_LIST = HOST+"?action=list"; 7 | 8 | static final String BOOK_TAB = HOST; 9 | static final String BOOK_DETAIL = HOST+"?action=detail&q="; 10 | 11 | 12 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-web-view/container-web-view.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f2f2f2; 3 | } 4 | 5 | .title { 6 | height: 100rpx; 7 | color: #808080; 8 | line-height: 100rpx; 9 | font-size: 32rpx; 10 | margin: 20rpx 40rpx; 11 | } 12 | 13 | .item-container { 14 | margin: 20rpx 40rpx; 15 | } -------------------------------------------------------------------------------- /Chapter_9/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-map/container-map.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | 3 | data: { 4 | }, 5 | onLoad: function (options) { 6 | 7 | }, 8 | onReady: function () { 9 | 10 | }, 11 | onShow: function () { 12 | 13 | }, 14 | onHide: function () { 15 | 16 | }, 17 | onUnload: function () { 18 | 19 | } 20 | }) -------------------------------------------------------------------------------- /Chapter_9/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-view/container-view.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | 3 | data: { 4 | 5 | }, 6 | onLoad: function (options) { 7 | 8 | }, 9 | onReady: function () { 10 | 11 | }, 12 | onShow: function () { 13 | 14 | }, 15 | onHide: function () { 16 | 17 | }, 18 | onUnload: function () { 19 | 20 | } 21 | }) -------------------------------------------------------------------------------- /Chapter_6/pages/container-swiper/container-swiper.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | 3 | data: { 4 | 5 | }, 6 | onLoad: function (options) { 7 | 8 | }, 9 | onReady: function () { 10 | 11 | }, 12 | onShow: function () { 13 | 14 | }, 15 | onHide: function () { 16 | 17 | }, 18 | onUnload: function () { 19 | 20 | } 21 | }) -------------------------------------------------------------------------------- /Chapter_6/pages/container-web-view/container-web-view.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | 3 | data: { 4 | }, 5 | onLoad: function (options) { 6 | 7 | }, 8 | onReady: function () { 9 | 10 | }, 11 | onShow: function () { 12 | 13 | }, 14 | onHide: function () { 15 | 16 | }, 17 | onUnload: function () { 18 | 19 | } 20 | }) -------------------------------------------------------------------------------- /Chapter_6/pages/container-scroll-view/container-scroll-view.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | 3 | data: { 4 | 5 | }, 6 | onLoad: function (options) { 7 | 8 | }, 9 | onReady: function () { 10 | 11 | }, 12 | onShow: function () { 13 | 14 | }, 15 | onHide: function () { 16 | 17 | }, 18 | onUnload: function () { 19 | 20 | } 21 | }) -------------------------------------------------------------------------------- /Chapter_7/pages/settings/settings.wxss: -------------------------------------------------------------------------------- 1 | /* pages/settings/settings.wxss */ 2 | 3 | .list-container { 4 | width: 100%; 5 | margin-top: 80rpx; 6 | } 7 | 8 | .list-container .item { 9 | width: 100%; 10 | height: 120rpx; 11 | padding: 0 80rpx; 12 | margin-top: 10rpx; 13 | line-height: 120rpx; 14 | background-color: #ffffff; 15 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-base/container-base.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | 3 | data: { 4 | text: "这是一个 text!" 5 | }, 6 | onLoad: function (options) { 7 | 8 | }, 9 | onReady: function () { 10 | 11 | }, 12 | onShow: function () { 13 | 14 | }, 15 | onHide: function () { 16 | 17 | }, 18 | onUnload: function () { 19 | 20 | } 21 | }) -------------------------------------------------------------------------------- /Chapter_6/pages/container-media/container-media.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f2f2f2; 3 | } 4 | 5 | .title { 6 | height: 100rpx; 7 | color: #808080; 8 | line-height: 100rpx; 9 | font-size: 32rpx; 10 | margin: 20rpx 40rpx; 11 | } 12 | 13 | .item-container { 14 | margin: 20rpx 40rpx; 15 | } 16 | 17 | button { 18 | margin-top: 20rpx; 19 | } -------------------------------------------------------------------------------- /Chapter_7/app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | 3 | page, view, scroll-view, swiper, icon, text, progress, button, checkbox, form, input, label, picker, picker-view, radio, slider, switch, textarea, navigator, image, map, canvas, web-view, cover-view { 4 | box-sizing: border-box; 5 | } 6 | 7 | page { 8 | background-color: #eae9e7; 9 | font-family: PingFangSC-Regular; 10 | } -------------------------------------------------------------------------------- /Chapter_5/android/local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Tue Jan 15 21:34:52 CST 2019 8 | sdk.dir=D\:\\mySpace\\android\\android-sdk 9 | -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /Chapter_7/utils/money.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 格式化余额保留两位小数 3 | * 4 | * @param {*} money 分 5 | */ 6 | function formatMoney(money) { 7 | let last = money % 100; 8 | let index = 2; 9 | if (last == 0) { 10 | index = 0; 11 | } else if (last % 10 == 0) { 12 | index = 1; 13 | } 14 | return (money / 100).toFixed(index); 15 | } 16 | 17 | module.exports = { 18 | formatMoney: formatMoney 19 | }; -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | @interface AppDelegate : UIResponder 11 | 12 | @property (nonatomic, strong) UIWindow *window; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-map/container-map.wxml: -------------------------------------------------------------------------------- 1 | 2 | map 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-form/container-form.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f2f2f2; 3 | } 4 | 5 | .title { 6 | height: 100rpx; 7 | color: #808080; 8 | line-height: 100rpx; 9 | font-size: 32rpx; 10 | margin: 20rpx 40rpx; 11 | } 12 | 13 | .item-container { 14 | margin: 20rpx 40rpx; 15 | } 16 | 17 | button { 18 | margin-top: 20rpx; 19 | } 20 | 21 | input, textarea { 22 | background-color: #ffffff; 23 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-swiper/container-swiper.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter_9/lib/models/Constants.dart: -------------------------------------------------------------------------------- 1 | class Constants { 2 | 3 | static final String REDIRECT_URL = "http://yubo725.top/osc/osc.php"; 4 | 5 | static final String LOGIN_URL = "https://www.oschina.net/action/oauth2/authorize?client_id=4rWcDXCNTV5gMWxtagxI&response_type=code&redirect_uri=" + REDIRECT_URL; 6 | 7 | static final String OSC_CLIENT_ID = "4rWcDXCNTV5gMWxtagxI"; 8 | 9 | static final String END_LINE_TAG = "COMPLETE"; 10 | 11 | 12 | } -------------------------------------------------------------------------------- /Chapter_7/pages/favorite/favorite.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{item.name}} 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-view/container-view.wxml: -------------------------------------------------------------------------------- 1 | 2 | 横向布局 3 | 4 | A 5 | B 6 | C 7 | 8 | 纵向布局 9 | 10 | A 11 | B 12 | C 13 | 14 | -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/java/com/yugangtalk/read/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.yugangtalk.read; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/java/com/shudan/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.shudan; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "ShuDan"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-swiper/container-swiper.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f2f2f2; 3 | padding: 40rpx 0; 4 | } 5 | 6 | swiper { 7 | width: 100%; 8 | height: 400rpx; 9 | } 10 | 11 | .a { 12 | width: 100%; 13 | height: 400rpx; 14 | background-color: chocolate; 15 | } 16 | 17 | .b { 18 | width: 100%; 19 | height: 400rpx; 20 | background-color: bisque; 21 | } 22 | 23 | .c { 24 | width: 100%; 25 | height: 400rpx; 26 | background-color: cadetblue; 27 | } -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-base/container-base.wxml: -------------------------------------------------------------------------------- 1 | 2 | text 3 | 4 | {{text}} 5 | {{text}} 6 | {{text}} 7 | 8 | progress 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Chapter_9/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /Chapter_6/pages/tab1/tab1.wxss: -------------------------------------------------------------------------------- 1 | /* pages/tab1/tab1.wxss */ 2 | 3 | page { 4 | background-color: #f2f2f2; 5 | padding-bottom: 40rpx; 6 | } 7 | 8 | .item-container { 9 | background-color: #fff; 10 | margin: 20rpx 40rpx 0; 11 | padding: 10rpx 40rpx; 12 | } 13 | 14 | .item-container .title { 15 | height: 100rpx; 16 | color: #808080; 17 | line-height: 100rpx; 18 | font-size: 32rpx; 19 | } 20 | 21 | .item-container .item { 22 | height: 100rpx; 23 | line-height: 100rpx; 24 | font-size: 42rpx; 25 | border-top: 2rpx solid #f2f2f2; 26 | } -------------------------------------------------------------------------------- /Chapter_5/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | Platform, 10 | StyleSheet, 11 | Text, 12 | View, 13 | BackHandler 14 | } from 'react-native'; 15 | import { RootStack } from './app/navigate/AppStack'; 16 | 17 | export default class App extends Component { 18 | constructor(props) { 19 | super(props); 20 | 21 | } 22 | 23 | render() { 24 | return ( 25 | 26 | ); 27 | } 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /Chapter_9/README.md: -------------------------------------------------------------------------------- 1 | # read 2 | 3 | A new Flutter application. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.io/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /Chapter_9/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /Chapter_9/lib/models/Book.dart: -------------------------------------------------------------------------------- 1 | class Book { 2 | static const columnBookId = "book_id"; 3 | static const columnName = "name"; 4 | static const columnImg = "img"; 5 | 6 | int id; 7 | String name; 8 | String bookId; 9 | String image; 10 | 11 | Book(this.name,this.bookId,this.image ); 12 | 13 | Book.fromMap(Map map) { 14 | 15 | name = map[columnName]; 16 | bookId = map[columnBookId]; 17 | image = map[columnImg]; 18 | } 19 | 20 | Map toMap() { 21 | var map = { columnName: name,columnImg:image,columnBookId:bookId}; 22 | 23 | return map; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Chapter_7/pages/favorite/favorite.js: -------------------------------------------------------------------------------- 1 | // pages/favorite/favorite.js 2 | import config from '../../config/config.js'; 3 | 4 | Page({ 5 | data: { 6 | dataList: [] 7 | }, 8 | onLoad: function (query) { 9 | //读取收藏的图书列表 10 | let favoriteBooks = wx.getStorageSync(config.cacheKey.favoriteBooks); 11 | this.setData({ 12 | dataList: favoriteBooks 13 | }); 14 | }, 15 | onItemClick: function (e) {//图书点击跳转到详情页 16 | let item = e.currentTarget.dataset.item; 17 | wx.navigateTo({ 18 | url: "/pages/detail/detail?id=" + item.id + "&name=" + item.name 19 | }); 20 | } 21 | }) -------------------------------------------------------------------------------- /Chapter_6/pages/container-scroll-view/container-scroll-view.wxml: -------------------------------------------------------------------------------- 1 | 2 | 横向滚动 3 | 4 | 5 | A 6 | B 7 | C 8 | 9 | 10 | 纵向滚动 11 | 12 | 13 | A 14 | B 15 | C 16 | 17 | 18 | -------------------------------------------------------------------------------- /Chapter_7/pages/mine/mine.js: -------------------------------------------------------------------------------- 1 | // pages/mine/mine.js 2 | 3 | Page({ 4 | data: { 5 | userInfo: null 6 | }, 7 | onLoad: function (options) { 8 | this.setData({ //读取全局数据保存到当前页面中 9 | userInfo: getApp().globalData.userInfo 10 | }); 11 | }, 12 | onReady: function () { }, 13 | onShow: function () { }, 14 | onHide: function () { }, 15 | onUnload: function () { }, 16 | toFavorite: function () { 17 | wx.navigateTo({ 18 | url: '/pages/favorite/favorite' 19 | }); 20 | }, 21 | toSettings: function () { 22 | wx.navigateTo({ 23 | url: '/pages/settings/settings' 24 | }); 25 | } 26 | }) -------------------------------------------------------------------------------- /Chapter_6/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/tab1/tab1", 4 | "pages/container-view/container-view", 5 | "pages/container-scroll-view/container-scroll-view", 6 | "pages/container-swiper/container-swiper", 7 | "pages/container-base/container-base", 8 | "pages/container-form/container-form", 9 | "pages/container-media/container-media", 10 | "pages/container-map/container-map", 11 | "pages/container-web-view/container-web-view" 12 | ], 13 | "window": { 14 | "backgroundTextStyle": "light", 15 | "navigationBarBackgroundColor": "#fff", 16 | "navigationBarTitleText": "DEMO", 17 | "navigationBarTextStyle": "black" 18 | } 19 | } -------------------------------------------------------------------------------- /Chapter_9/lib/models/Comment.dart: -------------------------------------------------------------------------------- 1 | class Comment { 2 | static const columnId = "_id"; 3 | static const columnName = "name"; 4 | static const columnContent = "content"; 5 | static const columnBook = "book"; 6 | 7 | int id; 8 | String name; 9 | String content; 10 | String book; 11 | 12 | 13 | Comment( this.name, this.content, this.book,[this.id]); 14 | 15 | Comment.fromMap(Map map) { 16 | id = map[columnId]; 17 | name = map[columnName]; 18 | content = map[columnContent]; 19 | book = map[columnBook]; 20 | } 21 | 22 | Map toMap() { 23 | var map = {columnName: name, columnContent: content,columnBook:book}; 24 | 25 | return map; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Chapter_5/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Chapter_6/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": true, 8 | "es6": true, 9 | "postcss": true, 10 | "minified": true, 11 | "newFeature": true 12 | }, 13 | "compileType": "miniprogram", 14 | "libVersion": "2.3.2", 15 | "appid": "wxb718b9428af58220", 16 | "projectname": "Demo", 17 | "debugOptions": { 18 | "hidedInDevtools": [] 19 | }, 20 | "isGameTourist": false, 21 | "condition": { 22 | "search": { 23 | "current": -1, 24 | "list": [] 25 | }, 26 | "conversation": { 27 | "current": -1, 28 | "list": [] 29 | }, 30 | "game": { 31 | "currentL": -1, 32 | "list": [] 33 | }, 34 | "miniprogram": { 35 | "current": -1, 36 | "list": [] 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Chapter_7/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件。", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": true, 8 | "es6": true, 9 | "postcss": true, 10 | "minified": true, 11 | "newFeature": true 12 | }, 13 | "compileType": "miniprogram", 14 | "libVersion": "2.0.4", 15 | "appid": "wx6f4dd17ad695f91f", 16 | "projectname": "GBook", 17 | "isGameTourist": false, 18 | "simulatorType": "wechat", 19 | "simulatorPluginLibVersion": {}, 20 | "condition": { 21 | "search": { 22 | "current": -1, 23 | "list": [] 24 | }, 25 | "conversation": { 26 | "current": -1, 27 | "list": [] 28 | }, 29 | "game": { 30 | "currentL": -1, 31 | "list": [] 32 | }, 33 | "miniprogram": { 34 | "current": -1, 35 | "list": [] 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Chapter_7/pages/favorite/favorite.wxss: -------------------------------------------------------------------------------- 1 | /* pages/favorite/favorite.wxss */ 2 | 3 | .list-container { 4 | width: 100%; 5 | padding: 40rpx 0; 6 | } 7 | 8 | .list-container .item { 9 | width: 100%; 10 | height: 200rpx; 11 | padding: 0 80rpx; 12 | line-height: 200rpx; 13 | margin-top: 10rpx; 14 | background-color: #ffffff; 15 | /* 使用 flex 布局 */ 16 | display: flex; 17 | /* 方向为纵向 */ 18 | flex-direction: row; 19 | /* 设置为不可换行 */ 20 | flex-wrap: nowrap; 21 | /* 从左边开始布局 */ 22 | justify-content: flex-start; 23 | /* 垂直居中 */ 24 | align-content: center; 25 | align-items: center; 26 | } 27 | 28 | .list-container .item .cover { 29 | width: 160rpx; 30 | height: 160rpx; 31 | } 32 | 33 | .list-container .item .title { 34 | margin-left: 20rpx; 35 | } -------------------------------------------------------------------------------- /Chapter_9/lib/api/NetUtils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:http/http.dart' as http; 3 | 4 | class NetUtils { 5 | static Future get(String url, {Map params}) async { 6 | if (params != null && params.isNotEmpty) { 7 | StringBuffer sb = new StringBuffer('?'); 8 | params.forEach((key, value) { 9 | sb.write('$key' + '=' + '$value' + '&'); 10 | }); 11 | String paramStr = sb.toString(); 12 | paramStr = paramStr.substring(0, paramStr.length - 1); 13 | url += paramStr; 14 | } 15 | http.Response res = await http.get(url); 16 | return res.body; 17 | } 18 | 19 | static Future post(String url, {Map params}) async { 20 | http.Response res = await http.post(url, body: params); 21 | return res.body; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Chapter_7/pages/sign-in/sign-in.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 您好! 6 | 欢迎来到登录页面 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Chapter_7/pages/sign-up/sign-up.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 您好! 9 | 欢迎来到注册页面 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Chapter_7/pages/settings/settings.js: -------------------------------------------------------------------------------- 1 | // pages/settings/settings.js 2 | import config from '../../config/config.js'; 3 | Page({ 4 | data: { 5 | 6 | }, 7 | onLoad: function (options) {}, 8 | onReady: function () {}, 9 | onShow: function () {}, 10 | onHide: function () {}, 11 | onUnload: function () {}, 12 | toSignOut: function () { 13 | let that = this; 14 | wx.showModal({ 15 | title: '提示', 16 | content: '确定要退出登录吗?', 17 | success: function (res) { 18 | if (res.confirm) { 19 | that.doSignOut(); 20 | } 21 | } 22 | }); 23 | }, 24 | doSignOut: function () { 25 | wx.removeStorageSync(config.cacheKey.userInfo); 26 | wx.showToast({ 27 | title: "退出登录成功!", 28 | icon: "success", 29 | mask: true 30 | }); 31 | wx.reLaunch({ 32 | url: '/pages/sign-in/sign-in' 33 | }); 34 | } 35 | }) -------------------------------------------------------------------------------- /Chapter_5/app/util/AsyncStorageUtil.js: -------------------------------------------------------------------------------- 1 | import { AsyncStorage } from 'react-native'; 2 | /** 3 | * 持久存储工具 4 | */ 5 | 6 | var AsyncStorageUtil = { 7 | setValue: function (key, value, callBcak) { 8 | if (value) { 9 | return AsyncStorage.setItem(key, value, (error) => callBcak(error)); 10 | } 11 | }, 12 | setValues: function (multiParis, callBcak) { 13 | if (multiParis) { 14 | return AsyncStorage.multiSet(multiParis, (errors) => callBcak(errors)); 15 | } 16 | }, 17 | getValue: function (key, callBcak) { 18 | 19 | return AsyncStorage.getItem(key, (error, result) => callBcak(error, result)); 20 | }, 21 | removeValue: function (key, callBcak) { 22 | 23 | return AsyncStorage.removeItem(key, (error) => callBcak(error)); 24 | } 25 | } 26 | 27 | export default AsyncStorageUtil; 28 | -------------------------------------------------------------------------------- /Chapter_5/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ShuDanApp", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest", 8 | "bundle-ios": "node node_modules/react-native/local-cli/cli.js bundle --entry-file index.js --platform ios --dev false --bundle-output ./ios/bundle/index.ios.jsbundle --assets-dest ./ios/bundle" 9 | }, 10 | "dependencies": { 11 | "react": "16.3.0-alpha.0", 12 | "react-native": "0.55.0", 13 | "react-native-scrollable-tab-view": "^0.8.0", 14 | "react-navigation": "^2.11.2" 15 | }, 16 | "devDependencies": { 17 | "babel-jest": "23.4.2", 18 | "babel-preset-react-native": "4.0.0", 19 | "jest": "23.5.0", 20 | "react-test-renderer": "16.3.0-alpha.0" 21 | }, 22 | "jest": { 23 | "preset": "react-native" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDanTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Chapter_9/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Chapter_7/pages/mine/mine.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{userInfo.username}} 5 | 6 | 7 | 8 | 9 | 10 | 强力推荐卡 11 | 最给力的书单都在这里 12 | 13 | 14 | 15 | 16 | 17 | 18 | 我想要的书籍 19 | 我收藏的书籍 20 | 设置 21 | 22 | -------------------------------------------------------------------------------- /Chapter_5/app/util/ToastUtil.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 弹框的工具类 4 | */ 5 | import { Alert, ToastAndroid, Platform } from 'react-native'; 6 | 7 | export const toastShort = (content, isAlert) => { 8 | if (isAlert || Platform.OS === 'ios') { 9 | setTimeout(() => { Alert.alert('提示', content.toString()) }, 500); 10 | } else { 11 | ToastAndroid.show(content.toString(), ToastAndroid.SHORT); 12 | } 13 | }; 14 | 15 | export const promptEvent = (content, isAlert) => { 16 | if (isAlert || Platform.OS === 'ios') { 17 | setTimeout(() => { Alert.alert('提示', content.toString()) }, 500); 18 | } else { 19 | ToastAndroid.show(content.toString(), ToastAndroid.SHORT); 20 | } 21 | }; 22 | 23 | export const toastLong = (content, isAlert) => { 24 | if (isAlert || Platform.OS === 'ios') { 25 | Alert.alert('提示', content.toString()); 26 | } else { 27 | ToastAndroid.show(content.toString(), ToastAndroid.LONG); 28 | } 29 | }; -------------------------------------------------------------------------------- /Chapter_7/pages/home/home.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | {{item.name}} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | {{item.name}} 20 | 21 | 22 | -------------------------------------------------------------------------------- /Chapter_5/app/component/BaseComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { BackHandler } from 'react-native'; 3 | class BaseComponent extends Component { 4 | constructor(props) { 5 | super(props); 6 | this.backHandler = BackHandler.addEventListener('hardwareBackPress', this._onBackAndroid); 7 | } 8 | componentWillMount() { 9 | 10 | } 11 | componentWillUnmount() { 12 | this.backHandler && this.backHandler.remove(); 13 | } 14 | 15 | _onBackAndroid = () => { 16 | if (!this.props.navigation) { 17 | return false; 18 | } 19 | let { routeName } = this.props.navigation.state; 20 | if (routeName == "Login" || routeName == 'ShuDan'||routeName=='Me') { 21 | BackHandler.exitApp() 22 | return true; 23 | }else{ 24 | this.props.navigation.goBack(); 25 | return true; 26 | } 27 | } 28 | 29 | } 30 | 31 | export default BaseComponent; -------------------------------------------------------------------------------- /Chapter_5/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | STORE_FILE=../../shudan.keystore 22 | KEY_ALIAS=shudan-alias 23 | STORE_FILE_PASSWORD=123456 24 | KEY_ALIAS_PASSWORD=123456 -------------------------------------------------------------------------------- /Chapter_6/pages/container-view/container-view.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f2f2f2; 3 | padding: 40rpx; 4 | } 5 | 6 | .title { 7 | height: 100rpx; 8 | color: #808080; 9 | line-height: 100rpx; 10 | font-size: 32rpx; 11 | margin-top: 20rpx; 12 | } 13 | 14 | .flex-row { 15 | display: flex; 16 | flex-direction: row; 17 | flex-wrap: nowrap; 18 | justify-content: center; 19 | align-content: center; 20 | align-items: center; 21 | } 22 | 23 | .flex-row view { 24 | width: 150rpx; 25 | height: 300rpx; 26 | text-align: center; 27 | line-height: 300rpx; 28 | } 29 | 30 | .flex-column { 31 | display: flex; 32 | flex-direction: column; 33 | flex-wrap: nowrap; 34 | justify-content: center; 35 | align-content: center; 36 | align-items: center; 37 | } 38 | 39 | .flex-column view { 40 | width: 300rpx; 41 | height: 150rpx; 42 | text-align: center; 43 | line-height: 150rpx; 44 | } 45 | 46 | .a { 47 | background-color: chocolate; 48 | } 49 | 50 | .b { 51 | background-color: bisque; 52 | } 53 | 54 | .c { 55 | background-color: cadetblue; 56 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-scroll-view/container-scroll-view.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f2f2f2; 3 | padding: 40rpx; 4 | } 5 | 6 | .title { 7 | height: 100rpx; 8 | color: #808080; 9 | line-height: 100rpx; 10 | font-size: 32rpx; 11 | margin-top: 20rpx; 12 | } 13 | 14 | .scroll-view { 15 | width: 500rpx; 16 | height: 300rpx; 17 | } 18 | 19 | .flex-row { 20 | width: 1200rpx; 21 | height: 300rpx; 22 | display: flex; 23 | flex-direction: row; 24 | flex-wrap: nowrap; 25 | justify-content: center; 26 | align-content: center; 27 | align-items: center; 28 | } 29 | 30 | .flex-row view { 31 | width: 400rpx; 32 | height: 300rpx; 33 | text-align: center; 34 | line-height: 300rpx; 35 | } 36 | 37 | .flex-column { 38 | width: 500rpx; 39 | height: 600rpx; 40 | } 41 | 42 | .flex-column view { 43 | width: 500rpx; 44 | height: 200rpx; 45 | text-align: center; 46 | line-height: 200rpx; 47 | } 48 | 49 | .a { 50 | background-color: chocolate; 51 | } 52 | 53 | .b { 54 | background-color: bisque; 55 | } 56 | 57 | .c { 58 | background-color: cadetblue; 59 | } -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Chapter_7/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/home/home", 4 | "pages/sign-in/sign-in", 5 | "pages/sign-up/sign-up", 6 | "pages/settings/settings", 7 | "pages/mine/mine", 8 | "pages/detail/detail", 9 | "pages/favorite/favorite" 10 | ], 11 | "window": { 12 | "backgroundTextStyle": "light", 13 | "navigationBarBackgroundColor": "#353535", 14 | "navigationBarTitleText": "WeChat", 15 | "navigationBarTextStyle": "white" 16 | }, 17 | "tabBar": { 18 | "color": "#636362", 19 | "selectedColor": "#636362", 20 | "backgroundColor": "#EAE9E7", 21 | "borderStyle": "white", 22 | "list": [ 23 | { 24 | "pagePath": "pages/home/home", 25 | "iconPath": "images/tabbar/ic_home_normal_2x.png", 26 | "selectedIconPath": "images/tabbar/ic_home_selected_2x.png", 27 | "text": "首页" 28 | }, 29 | { 30 | "pagePath": "pages/mine/mine", 31 | "iconPath": "images/tabbar/ic_mine_normal_2x.png", 32 | "selectedIconPath": "images/tabbar/ic_mine_selected_2x.png", 33 | "text": "我的" 34 | } 35 | ] 36 | }, 37 | "sitemapLocation": "sitemap.json" 38 | } -------------------------------------------------------------------------------- /Chapter_9/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:read/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "minimum-system-version" : "7.0", 7 | "extent" : "full-screen", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "minimum-system-version" : "7.0", 14 | "extent" : "full-screen", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "landscape", 19 | "idiom" : "ipad", 20 | "minimum-system-version" : "7.0", 21 | "extent" : "full-screen", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "portrait", 26 | "idiom" : "iphone", 27 | "minimum-system-version" : "7.0", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "minimum-system-version" : "7.0", 34 | "subtype" : "retina4", 35 | "scale" : "2x" 36 | }, 37 | { 38 | "orientation" : "portrait", 39 | "idiom" : "ipad", 40 | "minimum-system-version" : "7.0", 41 | "extent" : "full-screen", 42 | "scale" : "1x" 43 | } 44 | ], 45 | "info" : { 46 | "version" : 1, 47 | "author" : "xcode" 48 | } 49 | } -------------------------------------------------------------------------------- /Chapter_6/pages/tab1/tab1.js: -------------------------------------------------------------------------------- 1 | // pages/tab1/tab1.js 2 | Page({ 3 | 4 | data: { 5 | 6 | }, 7 | onLoad: function (options) { 8 | 9 | }, 10 | onReady: function () { 11 | 12 | }, 13 | onShow: function () { 14 | 15 | }, 16 | onHide: function () { 17 | 18 | }, 19 | onUnload: function () { 20 | 21 | }, 22 | toView: function () { 23 | wx.navigateTo({ url: '/pages/container-view/container-view' }); 24 | }, 25 | toScrollView: function () { 26 | wx.navigateTo({ url: '/pages/container-scroll-view/container-scroll-view' }); 27 | }, 28 | toSwiper: function () { 29 | wx.navigateTo({ url: '/pages/container-swiper/container-swiper' }); 30 | }, 31 | toBase: function () { 32 | wx.navigateTo({ url: '/pages/container-base/container-base' }); 33 | }, 34 | toForm: function () { 35 | wx.navigateTo({ url: '/pages/container-form/container-form' }); 36 | }, 37 | toMedia: function () { 38 | wx.navigateTo({ url: '/pages/container-media/container-media' }); 39 | }, 40 | toMap: function () { 41 | wx.navigateTo({ url: '/pages/container-map/container-map' }); 42 | }, 43 | toWebView: function () { 44 | wx.navigateTo({ url: '/pages/container-web-view/container-web-view' }); 45 | }, 46 | }) -------------------------------------------------------------------------------- /Chapter_5/android/app/src/main/java/com/shudan/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.shudan; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 17 | @Override 18 | public boolean getUseDeveloperSupport() { 19 | return BuildConfig.DEBUG; 20 | } 21 | 22 | @Override 23 | protected List getPackages() { 24 | return Arrays.asList( 25 | new MainReactPackage() 26 | ); 27 | } 28 | 29 | @Override 30 | protected String getJSMainModuleName() { 31 | return "index"; 32 | } 33 | }; 34 | 35 | @Override 36 | public ReactNativeHost getReactNativeHost() { 37 | return mReactNativeHost; 38 | } 39 | 40 | @Override 41 | public void onCreate() { 42 | super.onCreate(); 43 | SoLoader.init(this, /* native exopackage */ false); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-media/container-media.wxml: -------------------------------------------------------------------------------- 1 | 2 | image 3 | 4 | 5 | 6 | audio 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | video 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Chapter_7/pages/home/home.js: -------------------------------------------------------------------------------- 1 | // pages/home/home.js 2 | import config from '../../config/config.js'; 3 | import data from '../../utils/data.js'; 4 | 5 | Page({ 6 | data: { 7 | tabList: [], 8 | currentTabIndex: 0, //当前选择的 tab 9 | dataList: [] 10 | }, 11 | onLoad: function (options) { 12 | //读取用户登录信息 13 | let userInfo = wx.getStorageSync(config.cacheKey.userInfo); 14 | if (userInfo) { //用户已登录,则直将用户信息保存到全局变量中 15 | getApp().globalData.userInfo = userInfo; 16 | this.toLoadData(); 17 | } else { 18 | wx.reLaunch({ //用户未登录,则直接跳转至登录页面 19 | url: "/pages/sign-in/sign-in" 20 | }); 21 | } 22 | }, 23 | toLoadData: function () { 24 | this.setData({ 25 | tabList: data.home.tabList, 26 | dataList: data.home.dataList 27 | }); 28 | }, 29 | onTabItemClick: function (e) { 30 | console.error(e); 31 | let item = e.currentTarget.dataset.item; 32 | let index = e.currentTarget.dataset.index; 33 | this.setData({ 34 | currentTabIndex: index 35 | }); 36 | }, 37 | onItemClick: function (e) { 38 | let item = e.currentTarget.dataset.item; 39 | wx.navigateTo({ //通过 url 传递参数,是不是跟 html 很像? 40 | url: "/pages/detail/detail?id=" + item.id + "&name=" + item.name 41 | }); 42 | } 43 | }); -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | NSURL *jsCodeLocation; 18 | 19 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 20 | 21 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 22 | moduleName:@"ShuDan" 23 | initialProperties:nil 24 | launchOptions:launchOptions]; 25 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 26 | 27 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 28 | UIViewController *rootViewController = [UIViewController new]; 29 | rootViewController.view = rootView; 30 | self.window.rootViewController = rootViewController; 31 | [self.window makeKeyAndVisible]; 32 | return YES; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Chapter_7/pages/detail/detail.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{bookInfo.name}} 8 | {{isMarked?'已收藏':'收藏'}} 9 | 10 | {{bookInfo.introduce}} 11 | 评论 12 | 13 | 14 | 15 | 16 | 17 | 18 | {{item.username}} 19 | {{item.content}} 20 | 21 | 0 22 | 23 | 24 | 25 | 暂无评论 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-form/container-form.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | checkBoxItems: [ 4 | { name: 'USA', value: '美国' }, 5 | { name: 'CHN', value: '中国', checked: 'true' }, 6 | { name: 'BRA', value: '巴西' }, 7 | { name: 'JPN', value: '日本' }, 8 | { name: 'ENG', value: '英国' }, 9 | { name: 'TUR', value: '法国' }], 10 | radioItems: [ 11 | { name: '男', value: '1' }, 12 | { name: '女', value: '2', checked: 'true' }], 13 | array: ['美国', '中国', '巴西', '日本'], 14 | index: 1 15 | }, 16 | onLoad: function (options) { 17 | 18 | 19 | }, 20 | onReady: function () { 21 | 22 | }, 23 | onShow: function () { 24 | 25 | }, 26 | onHide: function () { 27 | 28 | }, 29 | onUnload: function () { 30 | 31 | }, 32 | checkboxChange: function (e) { 33 | console.log('checkbox 发生 change 事件,携带 value 值为:', e.detail.value); 34 | }, 35 | radioChange: function (e) { 36 | console.log('radio 发生 change 事件,携带 value 值为:', e.detail.value); 37 | }, 38 | formSubmit: function () { 39 | console.log('表单提交 formSubmit'); 40 | }, 41 | formReset: function () { 42 | console.log('表单重置 formReset'); 43 | }, 44 | sliderChange: function (e) { 45 | console.log('slider 发生 change 事件,携带 value 值为:', e.detail.value); 46 | }, 47 | switchChange: function (e) { 48 | console.log('switch 发生 change 事件,携带 value 值为:', e.detail.value); 49 | } 50 | }) -------------------------------------------------------------------------------- /Chapter_7/pages/sign-up/sign-up.js: -------------------------------------------------------------------------------- 1 | // pages/sign-up/sign-up.js 2 | import config from '../../config/config.js'; 3 | Page({ 4 | data: { 5 | username: "", 6 | password: "" 7 | }, 8 | onUsernameInput: function (e) {//当用户名输入框有内容输入时被回调 9 | this.setData({//将输入内容保存到 username 中 10 | username: e.detail.value 11 | }); 12 | }, 13 | onPasswordInput: function (e) {//当密码输入框有内容输入时被回调 14 | this.setData({//将输入内容保存到 password 中 15 | password: e.detail.value 16 | }); 17 | }, 18 | toSignUp: function () {//当注册按钮点击时被调用 19 | if (!this.data.username) {//用户名为空,提示用户输入用户名 20 | wx.showToast({ 21 | title: "请输入用户名!", 22 | icon: "none", 23 | mask: true 24 | }); 25 | return; 26 | } 27 | if (!this.data.password) {//密码为空,提示用户输入密码 28 | wx.showToast({ 29 | title: "请输入密码!", 30 | icon: "none", 31 | mask: true 32 | }); 33 | return; 34 | } 35 | //分别将用户名,密码保存到 local storage 中 36 | wx.setStorageSync(config.cacheKey.username, this.data.username); 37 | wx.setStorageSync(config.cacheKey.password, this.data.password); 38 | wx.showToast({ 39 | title: "注册成功请登录", 40 | icon: "success", 41 | mask: true 42 | }); 43 | wx.reLaunch({//关闭所有页面,并打开登录页面 44 | url: '/pages/sign-in/sign-in' 45 | }); 46 | } 47 | }) -------------------------------------------------------------------------------- /Chapter_5/app/view/login/SplashView.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { View, Text, StyleSheet, Image } from 'react-native'; 3 | import BaseComponent from '../../component/BaseComponent'; 4 | import AsyncStorageUtil from '../../util/AsyncStorageUtil'; 5 | class SplashView extends BaseComponent { 6 | static navigationOptions = { 7 | headerStyle: { 8 | height: 0 9 | } 10 | 11 | }; 12 | /** 13 | * 设置定时器 14 | */ 15 | componentDidMount() { 16 | this.timer = setTimeout(() => { 17 | AsyncStorageUtil.getValue("userName", (error, result) => { 18 | if (result) { 19 | this.props.navigation.navigate('Tab'); 20 | }else{ 21 | this.props.navigation.navigate('Login'); 22 | } 23 | }); 24 | 25 | }, 1000); 26 | } 27 | /** 28 | * 清除定时器 29 | */ 30 | componentWillUnmount() { 31 | this.timer && clearTimeout(this.timer); 32 | } 33 | render() { 34 | return ( 35 | 36 | 37 | 38 | ); 39 | } 40 | } 41 | 42 | 43 | const styles = StyleSheet.create({ 44 | root: { 45 | alignItems: "center", 46 | justifyContent: "center", 47 | backgroundColor:'#FFFFFF', 48 | flex:1 49 | } 50 | }) 51 | 52 | export default SplashView -------------------------------------------------------------------------------- /Chapter_7/pages/sign-up/sign-up.wxss: -------------------------------------------------------------------------------- 1 | /* pages/sign-up/sign-up.wxss */ 2 | 3 | page { 4 | background-color: #ffffff; 5 | } 6 | 7 | .container { 8 | /* 设置为绝对定位 */ 9 | position: absolute; 10 | top: 50%; 11 | left: 50%; 12 | /* 使用 transform 将 image 向上和向左偏移 50% */ 13 | transform: translate(-50%, -50%); 14 | width: 100%; 15 | padding: 0 80rpx; 16 | } 17 | 18 | .logo-container { 19 | text-align: center; 20 | } 21 | 22 | .logo { 23 | width: 200rpx; 24 | height: 200rpx; 25 | } 26 | 27 | .tips-container { 28 | text-align: center; 29 | font-family: SourceHanSansCN-Medium; 30 | font-weight: 500; 31 | color: rgba(99, 99, 98, 1); 32 | line-height: 64rpx; 33 | } 34 | 35 | .tips-container .title { 36 | font-size: 36rpx; 37 | } 38 | 39 | .tips-container .tips { 40 | font-size: 28rpx; 41 | } 42 | 43 | .input-username, .input-password { 44 | width: 100%; 45 | height: 80rpx; 46 | border-bottom: 4rpx dashed rgba(130, 129, 129, 1); 47 | font-size: 28rpx; 48 | font-family: SourceHanSansCN-Medium; 49 | font-weight: 500; 50 | color: rgba(130, 129, 129, 1); 51 | line-height: 80rpx; 52 | } 53 | 54 | .input-password { 55 | margin-top: 40rpx; 56 | } 57 | 58 | .btn-sign-up { 59 | margin: 117rpx auto 111rpx; 60 | width: 303rpx; 61 | height: 81rpx; 62 | background-image: url(https://raw.githubusercontent.com/jeanboydev/GBook/master/images/sign_up/btn_sign_up_2x.png); 63 | background-repeat: no-repeat; 64 | background-size: 303rpx 81rpx; 65 | } -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon-20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon-20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon-29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon-40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon-40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "icon-60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "1024x1024", 53 | "idiom" : "ios-marketing", 54 | "filename" : "icon-1024.png", 55 | "scale" : "1x" 56 | } 57 | ], 58 | "info" : { 59 | "version" : 1, 60 | "author" : "xcode" 61 | } 62 | } -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | read 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Chapter_6/pages/container-media/container-media.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | 3 | data: { 4 | poster: 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000', 5 | name: '此时此刻', 6 | author: '许巍', 7 | audioSrc: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46', 8 | }, 9 | onLoad: function (options) { 10 | 11 | }, 12 | onReady: function () { 13 | // 使用 wx.createAudioContext 获取 audio 上下文 context 14 | this.audioCtx = wx.createAudioContext('myAudio') 15 | 16 | // 使用 wx.createVideoContext 获取 video 上下文 context 17 | this.videoContext = wx.createVideoContext('myVideo') 18 | }, 19 | onShow: function () { 20 | 21 | }, 22 | onHide: function () { 23 | 24 | }, 25 | onUnload: function () { 26 | 27 | }, 28 | audioPlay: function () { 29 | this.audioCtx.play() 30 | }, 31 | audioPause: function () { 32 | this.audioCtx.pause() 33 | }, 34 | audio14: function () { 35 | this.audioCtx.seek(14) 36 | }, 37 | audioStart: function () { 38 | this.audioCtx.seek(0) 39 | }, 40 | bindButtonTap: function () { 41 | var that = this 42 | wx.chooseVideo({ 43 | sourceType: ['album', 'camera'], 44 | maxDuration: 60, 45 | camera: ['front', 'back'], 46 | success: function (res) { 47 | that.setData({ 48 | src: res.tempFilePath 49 | }) 50 | } 51 | }) 52 | } 53 | }) -------------------------------------------------------------------------------- /Chapter_9/lib/widgets/CommentBar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:read/common/DbProvider.dart'; 3 | import 'package:read/models/Comment.dart'; 4 | import 'package:read/pages/BookDetailPage.dart'; 5 | 6 | class CommentBar extends StatefulWidget { 7 | @override 8 | State createState() { 9 | return _CommentBarState(); 10 | } 11 | } 12 | 13 | class _CommentBarState extends State { 14 | String _name; 15 | String _book; 16 | //文本编辑控制器 可用于监听文本内容的改变 17 | TextEditingController editController = new TextEditingController(); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Container( 22 | color: Colors.white, 23 | padding: EdgeInsets.symmetric(vertical: 2.0), 24 | child: Row( 25 | children: [ 26 | Expanded( 27 | child: TextField( 28 | controller: editController, 29 | style: TextStyle(height: 0.8, color: Colors.black), 30 | decoration: InputDecoration( 31 | hintText: '在此发表评论', 32 | border: InputBorder.none, 33 | filled: true, 34 | fillColor: Colors.grey, 35 | ), 36 | ), 37 | ), 38 | SizedBox( 39 | width: 8.0, 40 | ), 41 | RaisedButton( 42 | onPressed: () { 43 | DbProvider cp = new DbProvider(); 44 | 45 | cp.insert(new Comment(_name, _book, editController.text)); 46 | 47 | }, 48 | color: Colors.blue, 49 | child: Text( 50 | '评论', 51 | style: TextStyle(color: Colors.white), 52 | ), 53 | ) 54 | ], 55 | ), 56 | ); 57 | } 58 | 59 | 60 | } 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Chapter_6/pages/tab1/tab1.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 视图容器 5 | view 6 | scroll-view 7 | swiper 8 | 9 | 10 | 基础内容 11 | text 12 | progress 13 | 14 | 15 | 表单组件 16 | button 17 | checkbox 18 | radio 19 | input 20 | textarea 21 | form 22 | slider 23 | switch 24 | picker 25 | 26 | 27 | 媒体组件 28 | image 29 | audio 30 | video 31 | 32 | 33 | 地图 34 | map 35 | 36 | 37 | 开放能力 38 | web-view 39 | 40 | -------------------------------------------------------------------------------- /Chapter_5/app/util/HttpUtil.js: -------------------------------------------------------------------------------- 1 | import { toastShort } from './ToastUtil'; 2 | 3 | function httpFetch(url, method, formData, callBack) { 4 | 5 | let headParams = { 6 | 'Content-Type': 'application/x-www-form-urlencoded', 7 | 'Param-Decode': 'false', 8 | } 9 | let paramsArray = []; 10 | 11 | if (formData) { 12 | Object.keys(formData).forEach(key => { 13 | formData[key] ? paramsArray.push(key + '=' + encodeURIComponent(formData[key])) : '' 14 | }); 15 | } 16 | let parms = { 17 | method: method, 18 | headers: headParams, 19 | timeout: 10 * 1000, 20 | body: method === 'GET' ? null : paramsArray.join('&'), 21 | } 22 | 23 | 24 | fetch(url, parms).then((response) => { 25 | if (response.ok) { 26 | 27 | return response.json(); 28 | } else { 29 | if (callBack.onError) { 30 | callBack.onError(response.code, "") 31 | } else { 32 | toastShort(response.code, false) 33 | } 34 | } 35 | }).then((responseJson) => { 36 | // console.log("http:" + url + "response:" + JSON.parse(responseJson)); 37 | if (responseJson&&responseJson.code==0) { 38 | callBack.onSuccess(responseJson); 39 | }else{ 40 | if(callBack.onError){ 41 | callBack.onError(responseJson.code,responseJson.message); 42 | } 43 | } 44 | }).catch((error) => { 45 | // console.log("http:" + url + "response:" + error); 46 | let errMsg = error.toString(); 47 | if (callBack.onError) { 48 | callBack.onError("-1", errMsg); 49 | } else { 50 | toastShort(errMsg, false); 51 | } 52 | }) 53 | } 54 | 55 | export { httpFetch }; -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Chapter_5/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.shudan", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.shudan", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Chapter_5/ios/ShuDan/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ShuDan 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | NSAllowsArbitraryLoads 46 | 47 | NSExceptionDomains 48 | 49 | localhost 50 | 51 | NSExceptionAllowsInsecureHTTPLoads 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Chapter_7/pages/sign-in/sign-in.wxss: -------------------------------------------------------------------------------- 1 | /* pages/sign-in/sign-in.wxss */ 2 | 3 | page { 4 | background-color: #ffffff; 5 | } 6 | 7 | .container { 8 | /* 组合使用开始,使用绝对定位 */ 9 | position: absolute; 10 | top: 50%; 11 | left: 50%; 12 | /* 使用 transform 将 view 在屏幕上垂直水平居中*/ 13 | transform: translate(-50%, -50%); 14 | /* 组合使用结束 */ 15 | width: 100%; 16 | padding: 0 80rpx; 17 | } 18 | 19 | .tips-container { 20 | text-align: center; 21 | font-family: SourceHanSansCN-Medium; 22 | font-weight: 500; 23 | color: rgba(99, 99, 98, 1); 24 | line-height: 64rpx; 25 | } 26 | 27 | .tips-container .title { 28 | font-size: 36rpx; 29 | } 30 | 31 | .tips-container .tips { 32 | font-size: 44rpx; 33 | } 34 | 35 | .input-username, .input-password { 36 | width: 100%; 37 | height: 80rpx; 38 | background: rgba(229, 229, 229, 1); 39 | border-radius: 15rpx; 40 | font-size: 28rpx; 41 | font-family: SourceHanSansCN-Medium; 42 | font-weight: 500; 43 | color: rgba(130, 129, 129, 1); 44 | line-height: 80rpx; 45 | padding: 0 15rpx; 46 | } 47 | 48 | .input-username { 49 | margin-top: 84rpx; 50 | } 51 | 52 | .input-password { 53 | margin-top: 20rpx; 54 | } 55 | 56 | .sign-up-container { 57 | width: 100%; 58 | height: 80rpx; 59 | margin-top: 20rpx; 60 | position: relative; 61 | } 62 | 63 | .sign-up-container .btn-sign-up { 64 | height: 70rpx; 65 | position: absolute; 66 | left: 0; 67 | line-height: 70rpx; 68 | font-size: 28rpx; 69 | font-family: SourceHanSansCN-Medium; 70 | font-weight: 500; 71 | color: rgba(89, 193, 227, 1); 72 | } 73 | 74 | .btn-sign-in { 75 | margin: 52rpx auto 111rpx; 76 | width: 303rpx; 77 | height: 81rpx; 78 | background-image: url(https://raw.githubusercontent.com/jeanboydev/GBook/master/images/sign_in/btn_sign_in_2x.png); 79 | background-repeat: no-repeat; 80 | background-size: 303rpx 81rpx; 81 | } -------------------------------------------------------------------------------- /Chapter_7/pages/home/home.wxss: -------------------------------------------------------------------------------- 1 | /* pages/home/home.wxss */ 2 | 3 | page { 4 | background-color: #F4F4F4; 5 | } 6 | 7 | .tab-menu { 8 | min-width: 750rpx; 9 | height: 104rpx; 10 | background-color: #EAE9E7; 11 | /* 使用 flex 布局 */ 12 | display: flex; 13 | /* 方向为纵向 */ 14 | flex-direction: row; 15 | /* 设置为不可换行 */ 16 | flex-wrap: nowrap; 17 | /* 从左边开始布局 */ 18 | justify-content: flex-start; 19 | /* 垂直居中 */ 20 | align-content: center; 21 | align-items: center; 22 | padding: 0 34rpx; 23 | } 24 | 25 | .tab-menu .item { 26 | height: 74rpx; 27 | line-height: 74rpx; 28 | padding: 0 10rpx; 29 | margin-right: 34rpx; 30 | font-size: 28rpx; 31 | font-family: SourceHanSansCN-Medium; 32 | font-weight: bold; 33 | color: rgba(99, 99, 98, 1); 34 | } 35 | 36 | .tab-menu .active { 37 | border-bottom: #636362 solid 4rpx; 38 | } 39 | 40 | .list-container { 41 | width: 100%; 42 | padding: 60rpx 0 60rpx 60rpx; 43 | /* 使用 flex 布局 */ 44 | display: flex; 45 | /* 方向为纵向 */ 46 | flex-direction: row; 47 | /* 设置为可换行 */ 48 | flex-wrap: wrap; 49 | /* 从左边开始布局 */ 50 | justify-content: flex-start; 51 | /* 垂直居中 */ 52 | align-content: center; 53 | align-items: center; 54 | } 55 | 56 | .list-container .item { 57 | /* 这里使用到了 css 中的 calc 计算函数,详见下面介绍 */ 58 | width: calc((100% - 180rpx) / 3); 59 | margin-right: 60rpx; 60 | margin-top: 20rpx; 61 | border-radius: 10rpx; 62 | padding: 5rpx; 63 | } 64 | 65 | .list-container .item .cover { 66 | width: 100%; 67 | height: 240rpx; 68 | border: 2rpx solid #B9B9BB; 69 | background-color: #ffffff; 70 | border-radius: 6rpx; 71 | } 72 | 73 | .list-container .item .cover image { 74 | width: 100%; 75 | height: 100%; 76 | } 77 | 78 | .list-container .item .name { 79 | text-align: center; 80 | height: 70rpx; 81 | font-size: 24rpx; 82 | font-family: SourceHanSansCN-Medium; 83 | font-weight: 500; 84 | color: rgba(52, 52, 52, 1); 85 | line-height: 70rpx; 86 | } -------------------------------------------------------------------------------- /Chapter_7/pages/sign-in/sign-in.js: -------------------------------------------------------------------------------- 1 | // pages/sign-in/sign-in.js 2 | import config from '../../config/config.js'; 3 | Page({ 4 | data: { 5 | username: "", 6 | password: "" 7 | }, 8 | onLoad: function (options) {}, //生命周期回调函数 9 | onReady: function () {}, //生命周期回调函数 10 | onShow: function () {}, //生命周期回调函数 11 | onHide: function () {}, //生命周期回调函数 12 | onUnload: function () {}, //生命周期回调函数 13 | onUsernameInput: function (e) { //上面为输入框绑定的键盘事件监听回调函数 14 | // e.detail.value 是取到键盘输入的值 15 | this.setData({ 16 | username: e.detail.value 17 | }); 18 | }, 19 | onPasswordInput: function (e) { 20 | this.setData({ 21 | password: e.detail.value 22 | }); 23 | }, 24 | toSignIn: function () { //上面为按钮绑定的点击事件回调函数 25 | if (!this.data.username) { //用户名为空 26 | wx.showToast({ //吐司以下提示用户输入用户名 27 | title: "请输入用户名!", 28 | icon: "none", 29 | mask: true 30 | }); 31 | return; 32 | } 33 | if (!this.data.password) { 34 | wx.showToast({ 35 | title: "请输入密码!", 36 | icon: "none", 37 | mask: true 38 | }); 39 | return; 40 | } 41 | //读取本地已经存入的用户注册的信息 42 | let authUsername = wx.getStorageSync(config.cacheKey.username); 43 | let authPassword = wx.getStorageSync(config.cacheKey.password); 44 | if (this.data.username != authUsername) { 45 | wx.showToast({ 46 | title: "用户名不正确!", 47 | icon: "none", 48 | mask: true 49 | }); 50 | return; 51 | } 52 | if (this.data.password != authPassword) { 53 | wx.showToast({ 54 | title: "密码不正确!", 55 | icon: "none", 56 | mask: true 57 | }); 58 | return; 59 | } 60 | //将用户登录的信息记录下 61 | wx.setStorageSync(config.cacheKey.userInfo, { 62 | username: this.data.username 63 | }); 64 | //跳转到首页,并关闭当前以及其他页面 65 | wx.reLaunch({ 66 | url: '/pages/home/home' 67 | }); 68 | }, 69 | toSignUp: function () { 70 | //跳转到注册页面,不关闭当前页面 71 | wx.navigateTo({ 72 | url: '/pages/sign-up/sign-up' 73 | }); 74 | } 75 | }) -------------------------------------------------------------------------------- /Chapter_9/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.yugangtalk.read" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /Chapter_9/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Chapter_9/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "filename" : "icon_logo58.png", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "iphone", 22 | "filename" : "icon_logo87.png", 23 | "scale" : "3x" 24 | }, 25 | { 26 | "idiom" : "iphone", 27 | "size" : "40x40", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "idiom" : "iphone", 32 | "size" : "40x40", 33 | "scale" : "3x" 34 | }, 35 | { 36 | "idiom" : "iphone", 37 | "size" : "60x60", 38 | "scale" : "2x" 39 | }, 40 | { 41 | "idiom" : "iphone", 42 | "size" : "60x60", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "idiom" : "ipad", 47 | "size" : "20x20", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "idiom" : "ipad", 52 | "size" : "20x20", 53 | "scale" : "2x" 54 | }, 55 | { 56 | "idiom" : "ipad", 57 | "size" : "29x29", 58 | "scale" : "1x" 59 | }, 60 | { 61 | "idiom" : "ipad", 62 | "size" : "29x29", 63 | "scale" : "2x" 64 | }, 65 | { 66 | "idiom" : "ipad", 67 | "size" : "40x40", 68 | "scale" : "1x" 69 | }, 70 | { 71 | "idiom" : "ipad", 72 | "size" : "40x40", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "idiom" : "ipad", 77 | "size" : "76x76", 78 | "scale" : "1x" 79 | }, 80 | { 81 | "idiom" : "ipad", 82 | "size" : "76x76", 83 | "scale" : "2x" 84 | }, 85 | { 86 | "idiom" : "ipad", 87 | "size" : "83.5x83.5", 88 | "scale" : "2x" 89 | }, 90 | { 91 | "idiom" : "ios-marketing", 92 | "size" : "1024x1024", 93 | "scale" : "1x" 94 | } 95 | ], 96 | "info" : { 97 | "version" : 1, 98 | "author" : "xcode" 99 | } 100 | } -------------------------------------------------------------------------------- /Chapter_6/pages/container-form/container-form.wxml: -------------------------------------------------------------------------------- 1 | 2 | button 3 | 4 | 5 | 6 | 7 | 8 | checkbox 9 | 10 | 11 | 15 | 16 | 17 | radio 18 | 19 | 20 | 24 | 25 | 26 | input 27 | 28 | 29 | 30 | textarea 31 | 32 |