修改打包命令

修复ios支付问题
hmxc
张萌 3 years ago
parent 39a57b9534
commit af4c1f22b8

@ -18,8 +18,25 @@
<string>$(FLUTTER_BUILD_NAME)</string> <string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>alipay</string>
<key>CFBundleURLSchemes</key>
<array>
<string>akuCommunity</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>alipays</string>
</array>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
@ -31,6 +48,10 @@
</dict> </dict>
<key>NSAppleMusicUsageDescription</key> <key>NSAppleMusicUsageDescription</key>
<string>请允许访问,否则无法在小蜜蜂社区中发送及保存照片.</string> <string>请允许访问,否则无法在小蜜蜂社区中发送及保存照片.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>无需使用蓝牙</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>无需使用蓝牙</string>
<key>NSCalendarsUsageDescription</key> <key>NSCalendarsUsageDescription</key>
<string>请允许访问,否则无法查看您每日的浏览记录.</string> <string>请允许访问,否则无法查看您每日的浏览记录.</string>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
@ -47,14 +68,12 @@
<string>我们需要访问您的照片,用于上传报修状况等相关功能</string> <string>我们需要访问您的照片,用于上传报修状况等相关功能</string>
<key>NSSpeechRecognitionUsageDescription</key> <key>NSSpeechRecognitionUsageDescription</key>
<string>请允许访问,否则无法将语音消息转换为文字.</string> <string>请允许访问,否则无法将语音消息转换为文字.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>无需使用蓝牙</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>无需使用蓝牙</string>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main</string> <string>Main</string>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
@ -70,7 +89,5 @@
<false/> <false/>
<key>io.flutter.embedded_views_preview</key> <key>io.flutter.embedded_views_preview</key>
<true/> <true/>
<key>UIStatusBarHidden</key>
<true/>
</dict> </dict>
</plist> </plist>

@ -1,13 +1,12 @@
import 'dart:convert'; import 'dart:convert';
import 'package:aku_community/models/pay/pay_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:power_logger/power_logger.dart'; import 'package:power_logger/power_logger.dart';
import 'package:tobias/tobias.dart'; import 'package:tobias/tobias.dart';
import 'package:aku_community/models/pay/pay_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
enum PAYTYPE { enum PAYTYPE {
/// ///
ALI, ALI,
@ -53,7 +52,17 @@ class PayUtil {
/// ///
Future<bool> callAliPay(String order, String apiPath) async { Future<bool> callAliPay(String order, String apiPath) async {
Map<dynamic, dynamic> result = await aliPay(order); var install = await isAliPayInstalled();
if (!install) {
BotToast.showText(text: '未安装支付宝!');
return false;
}
Map<dynamic, dynamic> result = {};
try {
result = await aliPay(order);
} catch (e) {
print(e.toString());
}
_resultStatus = result['resultStatus']; _resultStatus = result['resultStatus'];
if (_resultStatus == '9000') { if (_resultStatus == '9000') {
String _res = result['result']; String _res = result['result'];

@ -1,13 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
@ -22,6 +12,14 @@ import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/widget/bee_divider.dart'; import 'package:aku_community/widget/bee_divider.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/views/horizontal_image_view.dart'; import 'package:aku_community/widget/views/horizontal_image_view.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart';
class FixedDetailPage extends StatefulWidget { class FixedDetailPage extends StatefulWidget {
final int id; final int id;
@ -402,7 +400,7 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
.callAliPay(baseModel.message!, API.pay.reportReapirCheck); .callAliPay(baseModel.message!, API.pay.reportReapirCheck);
if (result) { if (result) {
Get.back(); Get.back();
Get.off(PayFinishPage()); Get.off(() => PayFinishPage());
} }
} else { } else {
Get.back(); Get.back();
@ -528,7 +526,7 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
MaterialButton( MaterialButton(
minWidth: 375.w, minWidth: 375.w,
onPressed: () { onPressed: () {
Get.off(FixedEvaluatePage(_model)); Get.off(() => FixedEvaluatePage(_model));
}, },
child: '立即评价'.text.white.size(32.sp).bold.make(), child: '立即评价'.text.white.size(32.sp).bold.make(),
padding: EdgeInsets.symmetric(vertical: 26.w), padding: EdgeInsets.symmetric(vertical: 26.w),

@ -233,7 +233,7 @@ class _GoodsDetailPageState extends State<GoodsDetailPage> {
color: kPrimaryColor, color: kPrimaryColor,
height: 80.w, height: 80.w,
onPressed: () async { onPressed: () async {
Get.off(GoodsOrderDetailPage( Get.off(() => GoodsOrderDetailPage(
model: _goodsModel, model: _goodsModel,
name: _nameController.text, name: _nameController.text,
phone: _phoneController.text)); phone: _phoneController.text));

@ -1,11 +1,3 @@
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
@ -22,6 +14,12 @@ import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bee_numberic_button.dart'; import 'package:aku_community/widget/buttons/bee_numberic_button.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart'; import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/user_tool.dart'; import 'package:aku_community/widget/others/user_tool.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class GoodsOrderDetailPage extends StatefulWidget { class GoodsOrderDetailPage extends StatefulWidget {
final GoodsDetailModel model; final GoodsDetailModel model;
@ -50,6 +48,7 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
@override @override
void dispose() { void dispose() {
_refreshController.dispose(); _refreshController.dispose();
BotToast.closeAllLoading();
super.dispose(); super.dispose();
} }
@ -105,7 +104,7 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
bool result = await PayUtil() bool result = await PayUtil()
.callAliPay(baseModel.message!, API.pay.shoppingCheck); .callAliPay(baseModel.message!, API.pay.shoppingCheck);
if (result) { if (result) {
Get.off(PayFinishPage()); Get.off(() => PayFinishPage());
} }
} else { } else {
BotToast.showText(text: baseModel.message!); BotToast.showText(text: baseModel.message!);

@ -2,7 +2,7 @@ name: aku_community
description: A new Flutter project. description: A new Flutter project.
publish_to: "none" publish_to: "none"
version: 1.8.1-dev+45 version: 1.8.2-dev+46
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"

@ -16,9 +16,11 @@ buildApk() async {
String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm'); String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm');
String version = await getVersion(); String version = await getVersion();
await runAsync('rm', arguments: ['-rf', Config.apkDir]);
await runAsync('mkdir', arguments: ['-p', Config.apkDir]);
await runAsync('mv', arguments: [ await runAsync('mv', arguments: [
Config.buildPath, Config.buildPath,
'${Config.buildDir}/${Config.packageName}_${version}_release_$date.apk' '${Config.apkDir}/${Config.packageName}_${version}_release_$date.apk'
]); ]);
} }
@ -37,9 +39,11 @@ buildApkDev() async {
); );
String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm'); String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm');
String version = await getVersion(); String version = await getVersion();
await runAsync('rm', arguments: ['-rf', Config.apkDevDir]);
await runAsync('mkdir', arguments: ['-p', Config.apkDevDir]);
await runAsync('mv', arguments: [ await runAsync('mv', arguments: [
Config.buildPath, Config.buildPath,
'${Config.buildDir}/${Config.packageName}_${version}_beta_$date.apk' '${Config.apkDevDir}/${Config.packageName}_${version}_beta_$date.apk'
]); ]);
} }

@ -9,6 +9,11 @@ class Config {
static String get buildPath => static String get buildPath =>
'./build/app/outputs/flutter-apk/app-release.apk'; './build/app/outputs/flutter-apk/app-release.apk';
/// ///
static String get buildDir => './build/app/outputs/flutter-apk'; static String get apkDevDir =>
'/users/zhangmeng/team/bee/app/aku_community/dev';
///
static String get apkDir =>
'/users/zhangmeng/team/bee/app/aku_community/release';
} }

@ -1,4 +1,5 @@
import 'dart:io'; import 'dart:io';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:grinder/grinder.dart'; import 'package:grinder/grinder.dart';
import 'package:path/path.dart'; import 'package:path/path.dart';
@ -43,6 +44,21 @@ void addVersionPatch() async {
await File(yamlPath).writeAsString(result); await File(yamlPath).writeAsString(result);
} }
@Task('add major version number')
void addVersionMajor() async {
String projectPath = Directory('.').absolute.path;
String yamlPath = join(projectPath, 'pubspec.yaml');
String yamlContent = await File(yamlPath).readAsString();
dynamic content = loadYaml(yamlContent);
String version = content['version'];
//rename version
Version resultVersion = VersionTool.fromText(version).nextMajorTag('dev');
String result = yamlContent.replaceFirst(version, resultVersion.toString());
await File(yamlPath).writeAsString(result);
}
@Task() @Task()
Future<String> getVersion() async { Future<String> getVersion() async {
String projectPath = Directory('.').absolute.path; String projectPath = Directory('.').absolute.path;

Loading…
Cancel
Save