Commit bb9b30813b98de40b1ec9e60aeeaf7574478c5d9

Authored by liangchengyou
2 parents 7d6a6ddc 8433764f

Merge branch 'master' into feature/1.0.1

* master:
  feat:注释闪页代码,解决登陆失效问题
  feat:添加ios快速打包脚本
  feat:首页未登陆状态下逻辑调整
.gitignore
... ... @@ -65,6 +65,9 @@
65 65 **/ios/Flutter/flutter_assets/
66 66 **/ios/ServiceDefinitions.json
67 67 **/ios/Runner/GeneratedPluginRegistrant.*
  68 +**/ios/xcode_build_ipa_adh
  69 +**/ios/xcode_build_ipa_aps
  70 +**/ios/xcode_build_ipa_dev
68 71  
69 72 # Exceptions to above rules.
70 73 !**/ios/**/default.mode1v3
... ...
ios/Runner.xcodeproj/project.pbxproj
... ... @@ -495,7 +495,7 @@
495 495 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
496 496 CLANG_ENABLE_MODULES = YES;
497 497 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
498   - CURRENT_PROJECT_VERSION = 4;
  498 + CURRENT_PROJECT_VERSION = 5;
499 499 DEVELOPMENT_TEAM = T8P9KW8GWH;
500 500 ENABLE_BITCODE = NO;
501 501 INFOPLIST_FILE = Runner/Info.plist;
... ... @@ -680,7 +680,7 @@
680 680 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
681 681 CLANG_ENABLE_MODULES = YES;
682 682 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
683   - CURRENT_PROJECT_VERSION = 4;
  683 + CURRENT_PROJECT_VERSION = 5;
684 684 DEVELOPMENT_TEAM = T8P9KW8GWH;
685 685 ENABLE_BITCODE = NO;
686 686 INFOPLIST_FILE = Runner/Info.plist;
... ... @@ -709,7 +709,7 @@
709 709 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
710 710 CLANG_ENABLE_MODULES = YES;
711 711 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
712   - CURRENT_PROJECT_VERSION = 4;
  712 + CURRENT_PROJECT_VERSION = 5;
713 713 DEVELOPMENT_TEAM = T8P9KW8GWH;
714 714 ENABLE_BITCODE = NO;
715 715 INFOPLIST_FILE = Runner/Info.plist;
... ...
ios/scripts/config_help.txt 0 → 100644
  1 +Available keys for -exportOptionsPlist:
  2 +
  3 +compileBitcode : Bool
  4 +
  5 +For non-App Store exports, should Xcode re-compile the app from bitcode? Defaults to YES.
  6 +
  7 +embedOnDemandResourcesAssetPacksInBundle : Bool
  8 +
  9 +For non-App Store exports, if the app uses On Demand Resources and this is YES, asset packs are embedded in the app bundle so that the app can be tested without a server to host asset packs. Defaults to YES unless onDemandResourcesAssetPacksBaseURL is specified.
  10 +
  11 +iCloudContainerEnvironment : String
  12 +
  13 +If the app is using CloudKit, this configures the "com.apple.developer.icloud-container-environment" entitlement. Available options vary depending on the type of provisioning profile used, but may include: Development and Production.
  14 +
  15 +installerSigningCertificate : String
  16 +
  17 +For manual signing only. Provide a certificate name, SHA-1 hash, or automatic selector to use for signing. Automatic selectors allow Xcode to pick the newest installed certificate of a particular type. The available automatic selectors are "Mac Installer Distribution" and "Developer ID Installer". Defaults to an automatic certificate selector matching the current distribution method.
  18 +
  19 +manifest : Dictionary
  20 +
  21 +For non-App Store exports, users can download your app over the web by opening your distribution manifest file in a web browser. To generate a distribution manifest, the value of this key should be a dictionary with three sub-keys: appURL, displayImageURL, fullSizeImageURL. The additional sub-key assetPackManifestURL is required when using on-demand resources.
  22 +
  23 +method : String
  24 +
  25 +Describes how Xcode should export the archive. Available options: app-store, package, ad-hoc, enterprise, development, developer-id, and mac-application. The list of options varies based on the type of archive. Defaults to development.
  26 +
  27 +onDemandResourcesAssetPacksBaseURL : String
  28 +
  29 +For non-App Store exports, if the app uses On Demand Resources and embedOnDemandResourcesAssetPacksInBundle isn't YES, this should be a base URL specifying where asset packs are going to be hosted. This configures the app to download asset packs from the specified URL.
  30 +
  31 +provisioningProfiles : Dictionary
  32 +
  33 +For manual signing only. Specify the provisioning profile to use for each executable in your app. Keys in this dictionary are the bundle identifiers of executables; values are the provisioning profile name or UUID to use.
  34 +
  35 +signingCertificate : String
  36 +
  37 +For manual signing only. Provide a certificate name, SHA-1 hash, or automatic selector to use for signing. Automatic selectors allow Xcode to pick the newest installed certificate of a particular type. The available automatic selectors are "Mac App Distribution", "iOS Developer", "iOS Distribution", "Developer ID Application", and "Mac Developer". Defaults to an automatic certificate selector matching the current distribution method.
  38 +
  39 +signingStyle : String
  40 +
  41 +The signing style to use when re-signing the app for distribution. Options are manual or automatic. Apps that were automatically signed when archived can be signed manually or automatically during distribution, and default to automatic. Apps that were manually signed when archived must be manually signed during distribtion, so the value of signingStyle is ignored.
  42 +
  43 +stripSwiftSymbols : Bool
  44 +
  45 +Should symbols be stripped from Swift libraries in your IPA? Defaults to YES.
  46 +
  47 +teamID : String
  48 +
  49 +The Developer Portal team to use for this export. Defaults to the team used to build the archive.
  50 +
  51 +thinning : String
  52 +
  53 +For non-App Store exports, should Xcode thin the package for one or more device variants? Available options: <none> (Xcode produces a non-thinned universal app), <thin-for-all-variants> (Xcode produces a universal app and all available thinned variants), or a model identifier for a specific device (e.g. "iPhone7,1"). Defaults to <none>.
  54 +
  55 +uploadBitcode : Bool
  56 +
  57 +For App Store exports, should the package include bitcode? Defaults to YES.
  58 +
  59 +uploadSymbols : Bool
  60 +
  61 +For App Store exports, should the package include symbols? Defaults to YES.
... ...
ios/scripts/xcodebuild_adh_config.plist 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>teamID</key>
  6 + <string>T8P9KW8GWH</string>
  7 + <key>method</key>
  8 + <string>ad-hoc</string>
  9 + <key>provisioningProfiles</key>
  10 + <dict>
  11 + <key>Your Bundle ID</key>
  12 + <string>com.englishplanet</string>
  13 + </dict>
  14 +</dict>
  15 +</plist>
... ...
ios/scripts/xcodebuild_adh_config.sh 0 → 100755
  1 +#!/bin/sh
  2 +
  3 +#使用方法:bash -l ./xcodebuild_adh_config.sh
  4 +
  5 +# Your configuration information
  6 +
  7 +target_name="Runner.xcworkspace" # 有效值 ****.xcodeproj / ****.xcworkspace (cocoapods项目)
  8 +project_name="Runner" # 工程名
  9 +work_type="workspace" # 有效值 project / workspace (cocoapods项目)
  10 +api_token="221a0bc6f118f239032f539d4c657efc" # fir token
  11 +
  12 +
  13 +sctipt_path=$(cd `dirname $0`; pwd)
  14 +echo sctipt_path=${sctipt_path}
  15 +work_path=${sctipt_path}/..
  16 +rm -rf ${work_path}/build
  17 +
  18 +#cd ../
  19 +#pod install --no-repo-update
  20 +#cd ${sctipt_path}
  21 +
  22 +out_sub_path=`date "+%Y-%m-%d-%H-%M-%S"`
  23 +out_base_path="xcode_build_ipa_adh"
  24 +out_path=${work_path}/${out_base_path}/${out_sub_path}
  25 +mkdir -p ${out_path}
  26 +
  27 +
  28 +if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
  29 + source $HOME/.rvm/scripts/rvm
  30 + rvm use system
  31 +fi
  32 +
  33 +xcodebuild -$work_type ${work_path}/$target_name -scheme $project_name -configuration Release -sdk iphoneos clean
  34 +xcodebuild archive -$work_type ${work_path}/$target_name -scheme $project_name -configuration Release -archivePath ${out_path}/$project_name.xcarchive
  35 +
  36 +xcodebuild -exportArchive -archivePath ${out_path}/$project_name.xcarchive -exportPath ${out_path} -exportOptionsPlist ${sctipt_path}/xcodebuild_adh_config.plist
  37 +
  38 +echo ${out_path}/$project_name.ipa
  39 +
  40 +if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
  41 + source ~/.rvm/scripts/rvm
  42 + rvm use default
  43 +fi
  44 +
  45 +#发不到fir
  46 +#fir p ${out_path}/$project_name.ipa -T $api_token -c 发布release版本
  47 +
  48 +exit 0
... ...
ios/scripts/xcodebuild_aps_config.plist 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>teamID</key>
  6 + <string>T8P9KW8GWH</string>
  7 + <key>method</key>
  8 + <string>app-store</string>
  9 + <key>provisioningProfiles</key>
  10 + <dict>
  11 + <key>Your Bundle ID</key>
  12 + <string>com.englishplanet</string>
  13 + </dict>
  14 +</dict>
  15 +</plist>
... ...
ios/scripts/xcodebuild_aps_config.sh 0 → 100755
  1 +#!/bin/sh
  2 +
  3 +#使用方法:bash -l ./xcodebuild_aps_config.sh
  4 +
  5 +# Your configuration information
  6 +
  7 +target_name="Runner.xcworkspace" # 有效值 ****.xcodeproj / ****.xcworkspace (cocoapods项目)
  8 +project_name="Runner" # 工程名
  9 +work_type="workspace" # 有效值 project / workspace (cocoapods项目)
  10 +api_token="221a0bc6f118f239032f539d4c657efc" # fir token
  11 +
  12 +
  13 +sctipt_path=$(cd `dirname $0`; pwd)
  14 +echo sctipt_path=${sctipt_path}
  15 +work_path=${sctipt_path}/..
  16 +rm -rf ${work_path}/build
  17 +
  18 +#cd ../
  19 +#pod install --no-repo-update
  20 +#cd ${sctipt_path}
  21 +
  22 +out_sub_path=`date "+%Y-%m-%d-%H-%M-%S"`
  23 +out_base_path="xcode_build_ipa_aps"
  24 +out_path=${work_path}/${out_base_path}/${out_sub_path}
  25 +mkdir -p ${out_path}
  26 +
  27 +
  28 +if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
  29 + source $HOME/.rvm/scripts/rvm
  30 + rvm use system
  31 +fi
  32 +
  33 +xcodebuild -$work_type ${work_path}/$target_name -scheme $project_name -configuration Release -sdk iphoneos clean
  34 +xcodebuild archive -$work_type ${work_path}/$target_name -scheme $project_name -configuration Release -archivePath ${out_path}/$project_name.xcarchive
  35 +
  36 +xcodebuild -exportArchive -archivePath ${out_path}/$project_name.xcarchive -exportPath ${out_path} -exportOptionsPlist ${sctipt_path}/xcodebuild_aps_config.plist
  37 +
  38 +echo ${out_path}/$project_name.ipa
  39 +
  40 +if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
  41 + source ~/.rvm/scripts/rvm
  42 + rvm use default
  43 +fi
  44 +
  45 +#发不到fir
  46 +#fir p ${out_path}/$project_name.ipa -T $api_token -c 发布release版本
  47 +
  48 +exit 0
... ...
ios/scripts/xcodebuild_dev_config.plist 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>teamID</key>
  6 + <string>T8P9KW8GWH</string>
  7 + <key>method</key>
  8 + <string>development</string>
  9 + <key>provisioningProfiles</key>
  10 + <dict>
  11 + <key>Your Bundle ID</key>
  12 + <string>com.englishplanet</string>
  13 + </dict>
  14 +</dict>
  15 +</plist>
... ...
ios/scripts/xcodebuild_dev_config.sh 0 → 100755
  1 +#!/bin/sh
  2 +
  3 +#使用方法:bash -l ./xcodebuild_dev_config.sh
  4 +
  5 +# Your configuration information
  6 +
  7 +target_name="Runner.xcworkspace" # 有效值 ****.xcodeproj / ****.xcworkspace (cocoapods项目)
  8 +project_name="Runner" # 工程名
  9 +work_type="workspace" # 有效值 project / workspace (cocoapods项目)
  10 +api_token="221a0bc6f118f239032f539d4c657efc" # fir token
  11 +
  12 +
  13 +sctipt_path=$(cd `dirname $0`; pwd)
  14 +echo sctipt_path=${sctipt_path}
  15 +work_path=${sctipt_path}/..
  16 +rm -rf ${work_path}/build
  17 +
  18 +#cd ../
  19 +#pod install --no-repo-update
  20 +#cd ${sctipt_path}
  21 +
  22 +out_sub_path=`date "+%Y-%m-%d-%H-%M-%S"`
  23 +out_base_path="xcode_build_ipa_dev"
  24 +out_path=${work_path}/${out_base_path}/${out_sub_path}
  25 +mkdir -p ${out_path}
  26 +
  27 +
  28 +if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
  29 +source $HOME/.rvm/scripts/rvm
  30 +rvm use system
  31 +fi
  32 +
  33 +xcodebuild -$work_type ${work_path}/$target_name -scheme $project_name -configuration Debug -sdk iphoneos clean
  34 +xcodebuild archive -$work_type ${work_path}/$target_name -scheme $project_name -configuration Debug -archivePath ${out_path}/$project_name.xcarchive
  35 +
  36 +xcodebuild -exportArchive -archivePath ${out_path}/$project_name.xcarchive -exportPath ${out_path} -exportOptionsPlist ${sctipt_path}/xcodebuild_dev_config.plist
  37 +
  38 +echo ${out_path}/$project_name.ipa
  39 +
  40 +if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
  41 +source ~/.rvm/scripts/rvm
  42 +rvm use default
  43 +fi
  44 +
  45 +#上传fir
  46 +#fir p ${out_path}/$project_name.ipa -T $api_token -c 发布debug版本
  47 +
  48 +exit 0
... ...
lib/app/splash_page.dart
... ... @@ -9,7 +9,6 @@ import &#39;package:limiting_direction_csx/limiting_direction_csx.dart&#39;;
9 9 import 'package:wow_english/common/core/user_util.dart';
10 10 import 'package:wow_english/common/extension/string_extension.dart';
11 11 import 'package:wow_english/common/request/config.dart';
12   -import 'package:wow_english/common/request/dao/user_dao.dart';
13 12 import 'package:wow_english/models/user_entity.dart';
14 13 import 'package:wow_english/route/route.dart';
15 14 import 'package:wow_english/utils/log_util.dart';
... ... @@ -46,12 +45,12 @@ class _TransitionViewState extends State&lt;TransitionView&gt; {
46 45 // 调一下接口判断一下有效性再往下
47 46 if (userEntity != null) {
48 47 DateTime startTime = DateTime.now();
49   - try {
50   - userEntity = await UserDao.getUserInfo();
51   - UserUtil.saveUser(userEntity);
52   - } catch (e) {
53   - e.logE();
54   - }
  48 + // try {
  49 + // userEntity = await UserDao.getUserInfo();
  50 + // UserUtil.saveUser(userEntity);
  51 + // } catch (e) {
  52 + // e.logE();
  53 + // }
55 54 apartInMilliseconds = DateTime.now().difference(startTime).inMilliseconds;
56 55 }
57 56 Log.d('Splash getUserInfo 耗时:${apartInMilliseconds}ms');
... ...
lib/pages/home/home_page.dart
... ... @@ -33,7 +33,11 @@ class _HomePageView extends StatelessWidget {
33 33 if (type == HeaderActionType.video) {
34 34 pushNamed(AppRouteName.reAfter);
35 35 } else if (type == HeaderActionType.phase) {
36   - pushNamed(AppRouteName.lesson);
  36 + if(UserUtil.token.isEmpty) {
  37 + pushNamed(AppRouteName.login);
  38 + } else {
  39 + pushNamed(AppRouteName.lesson);
  40 + }
37 41 } else if (type == HeaderActionType.listen) {
38 42 pushNamed(AppRouteName.listen);
39 43 } else if (type == HeaderActionType.shop) {
... ... @@ -104,6 +108,10 @@ class _HomePageView extends StatelessWidget {
104 108 //彩蛋
105 109 return GestureDetector(
106 110 onTap: () {
  111 + if(UserUtil.token.isEmpty) {
  112 + pushNamed(AppRouteName.login);
  113 + return;
  114 + }
107 115 if (data!.lock!) {
108 116 showToast('当前课程暂未解锁');
109 117 return;
... ... @@ -117,6 +125,10 @@ class _HomePageView extends StatelessWidget {
117 125 } else {
118 126 return GestureDetector(
119 127 onTap: () {
  128 + if(UserUtil.token.isEmpty) {
  129 + pushNamed(AppRouteName.login);
  130 + return;
  131 + }
120 132 if (data!.lock!) {
121 133 showToast('当前课程暂未解锁');
122 134 return;
... ...
lib/pages/lessons/widgets/lesson_item_widget.dart
... ... @@ -27,6 +27,7 @@ class LessonItemWidget extends StatelessWidget {
27 27  
28 28 Widget _unSelectWidget() {
29 29 return Container(
  30 + padding: const EdgeInsets.all(20),
30 31 decoration: BoxDecoration(
31 32 image: DecorationImage(
32 33 image: AssetImage('gendubeij'.assetPng)
... ...
lib/pages/repeataftercontent/widgets/repeat_video_widget.dart
... ... @@ -102,7 +102,7 @@ class _RepeatVideoWidgetState extends State&lt;RepeatVideoWidget&gt; {
102 102 height: double.infinity,
103 103 alignment: Alignment.center,
104 104 decoration: BoxDecoration(
105   - color: Colors.white,
  105 + color: Colors.black,
106 106 border: Border.all(
107 107 width: 1.0,
108 108 color: const Color(0xFF140C10),
... ...