Commit 2ffc9c3c authored by 关振斌's avatar 关振斌

update

parent fa129e94
......@@ -7,11 +7,15 @@ PODS:
- Flutter
- alipay_kit_ios/vendor (5.0.0):
- Flutter
- "app_settings (3.0.0+1)":
- Flutter
- babstrap_settings_screen (0.0.1):
- Flutter
- connectivity_plus (0.0.1):
- Flutter
- ReachabilitySwift
- device_info_plus (0.0.1):
- Flutter
- DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
......@@ -51,11 +55,11 @@ PODS:
- FirebaseAuth (~> 10.3.0)
- Firebase/CoreOnly (10.3.0):
- FirebaseCore (= 10.3.0)
- firebase_auth (4.2.6):
- firebase_auth (4.2.10):
- Firebase/Auth (= 10.3.0)
- firebase_core
- Flutter
- firebase_core (2.5.0):
- firebase_core (2.7.1):
- Firebase/CoreOnly (= 10.3.0)
- Flutter
- FirebaseAuth (10.3.0):
......@@ -147,8 +151,10 @@ PODS:
DEPENDENCIES:
- alipay_kit_ios (from `.symlinks/plugins/alipay_kit_ios/ios`)
- app_settings (from `.symlinks/plugins/app_settings/ios`)
- babstrap_settings_screen (from `.symlinks/plugins/babstrap_settings_screen/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
......@@ -194,10 +200,14 @@ SPEC REPOS:
EXTERNAL SOURCES:
alipay_kit_ios:
:path: ".symlinks/plugins/alipay_kit_ios/ios"
app_settings:
:path: ".symlinks/plugins/app_settings/ios"
babstrap_settings_screen:
:path: ".symlinks/plugins/babstrap_settings_screen/ios"
connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
firebase_auth:
......@@ -247,14 +257,16 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
alipay_kit_ios: bfa484b12d4690cc48a803f39ed5fb58fa774d2e
app_settings: d103828c9f5d515c4df9ee754dabd443f7cedcf3
babstrap_settings_screen: 535097da0fa521a47fef6f6678ff2b464ee15937
connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Firebase: f92fc551ead69c94168d36c2b26188263860acd9
firebase_auth: b196f91b4f7c6d72015c3c12aaa82eb6972b2c2c
firebase_core: f95c8bbe65213d406d592573ad42a12d64849cb8
firebase_auth: e94093901bee37bdba241fd8647c1d3ea6f55c8b
firebase_core: 1ae9f9aa76e6e1edc14fb181637ad466fd6c6fa4
FirebaseAuth: 0e415d29d846c1dce2fb641e46f35e9888d9bec6
FirebaseCore: 988754646ab3bd4bdcb740f1bfe26b9f6c0d5f2a
FirebaseCoreInternal: e463f41bb935cd049505bf7e9a5bdd7dcea90df6
......@@ -268,24 +280,24 @@ SPEC CHECKSUMS:
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GoogleUtilities: c2bdc4cf2ce786c4d2e6b3bcfd599a25ca78f06f
GTMSessionFetcher: c9e714f7eec91a55641e2bab9f45fd83a219b882
image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
SDWebImage: 8ab87d4b3e5cc4927bd47f78db6ceb0b94442577
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
smart_auth: 4bedbc118723912d0e45a07e8ab34039c19e04f2
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: fb12c43172927bb5cf75aeebd073f883801f1993
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241
video_player_avfoundation: e489aac24ef5cf7af82702979ed16f2a5ef84cff
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
......
......@@ -14,7 +14,6 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
C059CC5B29B6DFCC0068B7F5 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C059CC5A29B6DFCC0068B7F5 /* StoreKit.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -48,7 +47,6 @@
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C059CC5929B6DFA10068B7F5 /* RunnerDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerDebug.entitlements; sourceTree = "<group>"; };
C059CC5A29B6DFCC0068B7F5 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
C08A8E50299A2161008F4DB8 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
C0C4655B29A3007E00C47A11 /* RunnerProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerProfile.entitlements; sourceTree = "<group>"; };
D2718D25F9034030E31B924F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
......@@ -60,7 +58,6 @@
buildActionMask = 2147483647;
files = (
8B8F5CAD6B019351870A46AE /* Pods_Runner.framework in Frameworks */,
C059CC5B29B6DFCC0068B7F5 /* StoreKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -70,7 +67,6 @@
36FEE18528C617843FAFC14B /* Frameworks */ = {
isa = PBXGroup;
children = (
C059CC5A29B6DFCC0068B7F5 /* StoreKit.framework */,
5A7A6DEAB487D7E066FC9441 /* Pods_Runner.framework */,
);
name = Frameworks;
......
......@@ -4,10 +4,6 @@
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleLocalizations</key>
<array>
<string>zh</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
......@@ -18,6 +14,10 @@
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLocalizations</key>
<array>
<string>zh</string>
</array>
<key>CFBundleName</key>
<string>chart</string>
<key>CFBundlePackageType</key>
......@@ -28,10 +28,21 @@
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict/>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array/>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
<string>weixinULAPI</string>
<string>weixinOpenSDK</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSPhotoLibraryUsageDescription</key>
......
......@@ -2,10 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:www.fusiontech.cn/</string>
......
......@@ -2,10 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:www.fusiontech.cn/</string>
......
......@@ -2,10 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:www.fusiontech.cn/</string>
......
......@@ -15,6 +15,15 @@ class UserAPI {
return LoginEntity.fromMap(response['data']);
}
/// 登录
static Future<LoginEntity> appleLogin(Map<String, dynamic> parameters) async {
var response = await HttpUtil().post(
'/user/appleLogin',
data: parameters,
);
return LoginEntity.fromMap(response['data']);
}
// /pay/notifyApplePay
static Future<ApplePayEntity> notifyApplePay(
Map<String, dynamic> parameters) async {
......@@ -49,10 +58,14 @@ class UserAPI {
//创建会话
static Future<int> createConversion() async {
var response = await HttpUtil().get(
'/openAi/createConversion',
);
return response['data'];
try {
var response = await HttpUtil().get(
'/openAi/createConversion',
);
return response['data'];
} catch (e) {
return 401;
}
}
static Future<int> endConversion(Map<String, dynamic> parameters) async {
......
......@@ -14,5 +14,6 @@ class AppRoutes {
static const PRIVACT = '/privacy';
static const USER_PRIVACT = '/user_privacy';
static const WILL_COME = '/will_come';
static const USER_EULA = '/eula';
// UserPrivacyPage
}
import 'package:chart/pages/chat/view.dart';
import 'package:chart/pages/eula/bindings.dart';
import 'package:chart/pages/eula/view.dart';
import 'package:chart/pages/frame/android_pay_list/view.dart';
import 'package:chart/pages/frame/notfound/index.dart';
import 'package:chart/pages/frame/pay_list/view.dart';
......@@ -75,6 +77,17 @@ class AppPages {
// ]
),
GetPage(
name: AppRoutes.USER_EULA,
page: () => UserEulaPage(), //ApplicationPage(),
binding: UserEulaBinding(), // ApplicationBinding(),
middlewares: [
// RouteAuthMiddleware(priority: 1),
],
// children: [
// ]
),
GetPage(
name: AppRoutes.SIGN_IN,
page: () => SignInPage(),
......
......@@ -12,7 +12,7 @@ class ConfigStore extends GetxController {
PackageInfo? _platform;
String get version => _platform?.version ?? '-';
bool get isRelease => bool.fromEnvironment("dart.vm.product");
Locale locale = Locale('en', 'US');
Locale locale = Locale('zh', 'CN');
List<Locale> languages = [
Locale('en', 'US'),
Locale('zh', 'CN'),
......
import 'dart:convert';
import 'package:chart/pages/main/controller.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/entities/entities.dart';
import 'package:chart/common/routers/routes.dart';
......@@ -7,12 +9,20 @@ import 'package:chart/common/services/services.dart';
import 'package:chart/common/values/values.dart';
import 'package:chart/entity/login_entity.dart';
import 'package:chart/pages/application/index.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
// import 'package:connectivity_plus/connectivity_plus.dart';
// import 'package:highlight/languages/rust.dart';
// import 'package:social_login_buttons/social_login_buttons.dart';
import '../../entity/user_entity.dart';
class UserStore extends GetxController {
static UserStore get to => Get.put(UserStore());
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
var subscription;
// Get.find();
// static StorageService get to => Get.put(StorageService());
......@@ -30,35 +40,82 @@ class UserStore extends GetxController {
bool get hasToken => token.isNotEmpty;
@override
void onInit() {
void onInit() async {
super.onInit();
token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY);
var profileOffline = StorageService.to.getString(STORAGE_USER_PROFILE_KEY);
if (profileOffline.isNotEmpty) {
var l = jsonDecode(profileOffline);
final copiedMap = Map.from(l);
// Map<String, dynamic> map = json.decode(l);
copiedMap.update("expireTime",
(value) => value == null ? null : DateTime?.parse(value));
// copiedMap
final value = IntegralEntity(
expireTime: copiedMap['expireTime'],
id: copiedMap['id'],
token: copiedMap['token'],
username: copiedMap['username'],
integral: copiedMap['integral']);
_profile.value = _profile(value);
if (profile.id != '') {
_isLogin.value = true;
subscription = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
print("resultresultresultresult$result");
if (result == ConnectivityResult.none ||
result == ConnectivityResult.other) {
} else {
refreshInfo();
// asyncLoadBannerData();
// Get.back();
}
// Got a new connectivity status!
});
if (GetPlatform.isAndroid) {
token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY);
var profileOffline =
StorageService.to.getString(STORAGE_USER_PROFILE_KEY);
if (profileOffline.isNotEmpty) {
var l = jsonDecode(profileOffline);
final copiedMap = Map.from(l);
// Map<String, dynamic> map = json.decode(l);
copiedMap.update("expireTime",
(value) => value == null ? null : DateTime?.parse(value));
// copiedMap
final value = IntegralEntity(
expireTime: copiedMap['expireTime'],
id: copiedMap['id'],
token: copiedMap['token'],
username: copiedMap['username'],
integral: copiedMap['integral']);
_profile.value = _profile(value);
if (profile.id != '') {
_isLogin.value = true;
}
}
// _profile(IntegralEntity.fromMap();
// IntegralEntity.fromMap(result['data']);
// _profile(UserLoginResponseEntity.fromJson(jsonDecode(profileOffline)));
} else {
// refreshInfo();
// appleLogin
// "phone": "",
// "smsCode": ""
// print('Running on ${iosInfo.data['identifierForVendor']}');
}
}
Future refreshInfo() async {
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
final res = await UserAPI.appleLogin({
"phone": iosInfo.data['identifierForVendor'],
});
final value = IntegralEntity(
expireTime: res.expireTime == null ? null : res.expireTime,
id: res.id,
token: res.token,
username: res.username,
integral: res.integral,
);
token = res.token;
_profile.value = _profile(value);
if (profile.id != '') {
_isLogin.value = true;
}
await MainController.to.asyncLoadBannerData();
}
handleLogin(IntegralEntity res) async {
......@@ -97,6 +154,12 @@ class UserStore extends GetxController {
// }
}
@override
dispose() {
subscription?.cancel();
super.dispose();
}
// 保存 token
Future<void> setToken(String value) async {
await StorageService.to.setString(STORAGE_USER_TOKEN_KEY, value);
......
// baidu yapi
// const SERVER_API_URL = 'https://yapi.baidu.com/mock/41008';
// const SERVER_API_URL = 'http://192.168.110.127:8083/api';
// const SERVER_API_URL = 'http://192.168.120.175:8083/api';
const SERVER_API_URL = 'http://101.34.153.228:8083/api';//线上
// const SERVER_API_URL = 'http://192.168.2.178:8083/api';//线上
//http://192.168.2.178:8083/api/doc.html
......
......@@ -36,6 +36,7 @@ class ChatApp extends StatelessWidget {
theme: AppTheme.light,
debugShowCheckedModeBanner: false,
initialRoute: AppPages.INITIAL,
// initialBinding: AllControllerBinding(),
getPages: AppPages.routes,
builder: EasyLoading.init(),
......
......@@ -41,6 +41,7 @@ class CategoryController extends GetxController {
}
void onLoading() {
print("${state.newsList.length}-${total}321321312321321");
if (state.newsList.length < total) {
fetchNewsList().then((_) {
refreshController.loadComplete();
......@@ -57,20 +58,22 @@ class CategoryController extends GetxController {
// 拉取数据
Future<void> fetchNewsList({bool isRefresh = false}) async {
//
var result = await NewsAPI.getConversionByUserId(
{'page': curPage, "size": pageSize});
if (isRefresh == true) {
curPage = 1;
total = result.total!;
state.newsList.clear();
} else {
curPage++;
try {
var result = await NewsAPI.getConversionByUserId(
{'page': curPage, "size": pageSize});
if (isRefresh == true) {
curPage = 1;
total = result.total!;
state.newsList.clear();
} else {
curPage++;
}
state.newsList.addAll(result.records!);
} catch (e) {
print(e);
}
state.newsList.addAll(result.records!);
print("${state.newsList.length}");
}
/// 生命周期
......
......@@ -30,6 +30,16 @@ class _NewsPageListState extends State<NewsPageList>
controller: controller.refreshController,
onRefresh: controller.onRefresh,
onLoading: controller.onLoading,
header: ClassicHeader(
releaseText: "松开刷新",
refreshingText: "刷新数据中",
completeText: "刷新数据成功",
idleText: "下拉刷新"),
footer: ClassicFooter(
loadingText: "正在加载中...",
// loadStyle: LoadStyle.ShowWhenLoading,
// completeDuration: Duration(milliseconds: 500),
noDataText: '没有更多数据啦'),
child: CustomScrollView(
slivers: [
SliverPadding(
......
import 'package:get/get.dart';
import 'controller.dart';
class UserEulaBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<UserEulaController>(() => UserEulaController());
}
}
import 'package:get/get.dart';
import 'index.dart';
class UserEulaController extends GetxController {
UserEulaController();
final state = UserEulaState();
// tap
void handleTap(int index) {
Get.snackbar(
"标题",
"消息",
);
}
/// 在 widget 内存中分配后立即调用。
@override
void onInit() {
super.onInit();
}
/// 在 onInit() 之后调用 1 帧。这是进入的理想场所
@override
void onReady() {
super.onReady();
}
/// 在 [onDelete] 方法之前调用。
@override
void onClose() {
super.onClose();
}
/// dispose 释放内存
@override
void dispose() {
super.dispose();
}
}
library user_privacy;
export './state.dart';
export './controller.dart';
export './bindings.dart';
export './view.dart';
import 'package:get/get.dart';
class UserEulaState {
final _title = """
1、用户通过付费订阅后可免费使用AI聊天无限次,AI写作,写小说等高级功能订阅后可使用。
2.您可选择通过授权Apple支付(iOS端)AI写作大师会员服务(支持自动续费功能),订阅的金额分别为:AI写作大师连续包年会员(1年),价格498/年;AI写作大师连续包月会员(1个月),价格48/月。
3.您可通过下述途径解除连续订阅的自动扣费服务,连续订阅将在您解除后的下一个服务期限(计费周期)开始前自动终止:
打开App store---点击右上角头像图标,进入账户页面---点击管理订阅---取消订阅
以上解除方式会因第三方支付机构的软件升级等原因而不时发生变化,如因前述原因导致您无法操作解除连续订阅服务,请您第一时间按照本规则内载明的联系方式联系得到客服解决。
4.如调整连续订阅的计费标准,则会在下一个服务期限(计费周期)扣费前,通过短信、微信公众号留言等方式向您确认是否以调整后的计费标准进行代扣,如您明确回复拒绝或不予回复的,您购买的连续订阅服务将在已付费服务期限(计费周期)届满后自动终止。
5.本服务为在线使用的数字化商品服务,一经购买成功后,不提供退货退款。
6.其他未尽事宜,以《服务协议和隐私协议》的规定为准。
"""
.obs;
set title(value) => _title.value = value;
get title => _title.value;
}
import 'package:chart/common/values/values.dart';
import 'package:chart/common/widgets/widgets.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'index.dart';
import 'widgets/widgets.dart';
class UserEulaPage extends GetView<UserEulaController> {
const UserEulaPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView() {
return GlassmorphicContainer(
height: double.infinity,
width: double.infinity,
// flex: 1,
borderRadius: 16,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
blur: 14,
alignment: Alignment.bottomCenter,
border: 2,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(0.2),
Color(0xFF0FFFF).withOpacity(0.2),
],
),
child: const HelloWidget(),
// margin: EdgeInsets.only(bottom: 16.h),
borderGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(1),
Color(0xFFFFFFF),
Color(0xFF0FFFF).withOpacity(1),
],
));
}
@override
Widget build(BuildContext context) {
return GetBuilder<UserEulaController>(
builder: (_) {
return Scaffold(
appBar: transparentAppBar(
leading: IconButton(
tooltip: '返回上一页',
icon: const Icon(
Icons.arrow_back,
color: AppColors.primaryElementText,
),
onPressed: () async {
// Get.back();
// Get.offAll(ApplicationPage());
// await Get.off(ApplicationPage());
// Get.toNamed(AppRoutes.Application);
Get.back();
// await Get.toNamed();
// Navigator.of(context).pop();
//_nextPage(-1);
},
),
title: const Text(
"服务协议",
style: TextStyle(color: Colors.white),
)),
body: Container(
height: double.infinity,
width: double.infinity,
child: WebView(
initialUrl: "https://p.kdocs.cn/s/UODC2BAAYQ",
),
));
},
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:webview_flutter/webview_flutter.dart';
import '../index.dart';
/// hello
class HelloWidget extends GetView<UserEulaController> {
const HelloWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
// Obx(() => ListView(
// padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
// children: [
// Text(
// controller.state.title,
// style: TextStyle(
// fontFamily: 'Montserrat',
// fontSize: 18,
// color: Colors.white),
// )
// ],
// )),
);
}
}
library widgets;
export './hello.dart';
......@@ -155,6 +155,7 @@ class ChatNewController extends GetxController {
_addMessage(receiveErrorMessage);
EasyLoading.dismiss();
Vibrate.feedback(FeedbackType.error);
Get.toNamed(AppRoutes.SIGN_IN);
}
} catch (e) {
print("eeeeeeee$e");
......@@ -307,6 +308,7 @@ class ChatNewController extends GetxController {
sse = SSEClient.subscribeToSSE(
url: "$SERVER_API_URL/openAi/connect/${UserStore.to.profile.id}",
header: {}).listen((event) async {
print(event);
if (event.data!.trim().isEmpty) {
return;
} else if (event.id == "[DONE]") {
......@@ -322,6 +324,8 @@ class ChatNewController extends GetxController {
_updateMessage("${jsonMap['content']}" as String);
}
});
// print(sse);
}
Future createConversionId() async {
......
......@@ -5,6 +5,7 @@ import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/store/store.dart';
import 'package:chart/entity/user_entity.dart';
import 'package:chart/pages/application/index.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_inapp_purchase/flutter_inapp_purchase.dart';
import 'package:flutter_inapp_purchase/modules.dart';
......@@ -19,9 +20,8 @@ class PayListController extends GetxController {
final state = PayListState();
final List<String> _productLists = [
"com.wudi.app.weekly_pass",
"com.wudi.app.monthly_pass",
"com.wudi.app.60stars"
"com.wudi.monthly_pass_chat",
"com.wudi.yearly_pass_chat",
];
final List<dynamic> _mapData = [
......@@ -136,6 +136,30 @@ class PayListController extends GetxController {
});
}
void restorePurchases() async {
Vibrate.feedback(FeedbackType.selection);
EasyLoading.show(status: '恢复购买中...');
List<PurchasedItem>? purchases =
await FlutterInappPurchase.instance.getAvailablePurchases();
for (var purchase in purchases!) {
// com.wudi.yearly_pass_chat
if (purchase.productId == 'com.wudi.yearly_pass_chat' ||
purchase.productId == "com.wudi.monthly_pass_chat") {
// // IAPItem item
FlutterInappPurchase.instance.requestPurchase(purchase.productId!);
EasyLoading.showSuccess("恢复购买成功");
} else {
EasyLoading.dismiss();
}
// print("${item.productId}");
// 处理以前购买的产品
}
}
Future _getProduct() async {
try {
List<IAPItem> items =
......
......@@ -7,7 +7,7 @@ class PayListState {
set title(value) => this._title.value = value;
get title => this._title.value;
final _selected = "com.wudi.app.60stars".obs;
final _selected = "com.wudi.monthly_pass_chat".obs;
set selected(value) => _selected.value = value;
get selected => _selected.value;
......
import 'dart:convert';
import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/store/user.dart';
import 'package:chart/common/values/values.dart';
import 'package:chart/entity/user_entity.dart';
......@@ -171,7 +172,8 @@ class ProductController extends GetxController {
// state.isWhite = true;
// state.loading = false;
} else {
EasyLoading.showError("你还未登录,请登录后再使用");
// EasyLoading.showError("你还未登录,请登录后再使用");
Get.toNamed(AppRoutes.SIGN_IN);
state.isWhite = false;
state.loading = false;
// Get.snackbar("错误提示", "您的问题还没有填完", colorText: Colors.white);
......@@ -184,7 +186,8 @@ class ProductController extends GetxController {
print("$str");
} else {
Get.snackbar("错误提示", "您的问题还没有填完", colorText: Colors.white);
EasyLoading.showInfo("为了生成完整内容,请输入两项内容在进行创作");
// Get.snackbar("错误提示", "您的问题还没有填完", colorText: Colors.white);
}
}
......@@ -201,13 +204,16 @@ class ProductController extends GetxController {
}
showModal() {
// print("awaitawaitawaitawaitawaitawaitawait");
if (UserStore.to.isLogin) {
state.inderText = '';
// Share.share('Text I wish to share');
Get.bottomSheet(
FormWidget(),
);
} else {
Get.toNamed(AppRoutes.SIGN_IN);
}
state.inderText = '';
// Share.share('Text I wish to share');
Get.bottomSheet(
FormWidget(),
);
// useRootNavigator: false,
// // backgroundColor: Colors.white,
// shape: const RoundedRectangleBorder(
......
......@@ -17,6 +17,7 @@ class WelcomeController extends GetxController {
// 跳转 注册界面
handleHome() async {
await UserStore.to.refreshInfo();
await ConfigStore.to.saveAlreadyOpen();
Get.offAndToNamed(AppRoutes.Application);
}
......
......@@ -13,7 +13,7 @@ import '../../entity/user_entity.dart';
import 'index.dart';
class MainController extends GetxController {
MainController();
static MainController get to => Get.put(MainController());
/// 响应式成员变量
......@@ -129,9 +129,12 @@ class MainController extends GetxController {
/// onInit 之后
@override
void onReady() {
super.onReady();
// asyncLoadAllData();
asyncLoadBannerData();
super.onReady();
// if (UserStore.to.token.isNotEmpty) {
// }
}
/// 关闭页面
......
......@@ -15,7 +15,8 @@ class NewsCategoriesWidget extends GetView<MainController> {
@override
Widget build(BuildContext context) {
final userC = Get.put(UserStore());
return Obx(() => controller.state.bannerList == null
final bC = Get.put(MainController());
return Obx(() => bC.state.bannerList == null
? Container()
: Container(
// color: Colors.red,
......@@ -31,51 +32,61 @@ class NewsCategoriesWidget extends GetView<MainController> {
crossAxisAlignment: CrossAxisAlignment.start,
// ignore: prefer_const_literals_to_create_immutables
children: [
// ignore: prefer_const_constructors
Obx(
() => userC.isLogin
? Container(
width: 200,
child: Text(
// userC.isLogin
// ?
"Hi, ${userC.profile.username}",
// : "您还未登录",
maxLines: 1,
textAlign: TextAlign.left,
overflow: TextOverflow.clip,
softWrap: true,
// ignore: prefer_const_constructors
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 20),
),
)
: Container(
width: 200,
child: GestureDetector(
onTap: () {
Vibrate.feedback(FeedbackType.impact);
Get.toNamed(AppRoutes.SIGN_IN);
},
child: Text(
// userC.isLogin
// ?
"点我登录",
// : "您还未登录",
maxLines: 1,
textAlign: TextAlign.left,
overflow: TextOverflow.clip,
softWrap: true,
// ignore: prefer_const_constructors
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 20),
)),
),
),
GetPlatform.isIOS
? Text(
"AI写作大师", maxLines: 1,
textAlign: TextAlign.left,
overflow: TextOverflow.clip,
softWrap: true,
// ignore: prefer_const_constructors
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 20),
)
: Obx(() => userC.isLogin
? Container(
width: 200,
child: Text(
// userC.isLogin
// ?
"Hi, ${userC.profile.username}",
// : "您还未登录",
maxLines: 1,
textAlign: TextAlign.left,
overflow: TextOverflow.clip,
softWrap: true,
// ignore: prefer_const_constructors
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 20),
),
)
: Container(
width: 200,
child: GestureDetector(
onTap: () {
Vibrate.feedback(
FeedbackType.impact);
Get.toNamed(AppRoutes.SIGN_IN);
},
child: Text(
// userC.isLogin
// ?
"点我登录",
// : "您还未登录",
maxLines: 1,
textAlign: TextAlign.left,
overflow: TextOverflow.clip,
softWrap: true,
// ignore: prefer_const_constructors
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 20),
)),
)),
SizedBox(height: 30),
// ignore: prefer_const_constructors
Text(
......@@ -95,8 +106,8 @@ class NewsCategoriesWidget extends GetView<MainController> {
if (GetPlatform.isAndroid) {
Get.toNamed(AppRoutes.AN_PAY_LIST);
} else {
Get.toNamed(AppRoutes.AN_PAY_LIST);
// Get.toNamed(AppRoutes.PAY_LIST);
// Get.toNamed(AppRoutes.AN_PAY_LIST);
Get.toNamed(AppRoutes.PAY_LIST);
}
// AN_PAY_LIST
......
......@@ -18,8 +18,9 @@ class SiperBannerWidget extends GetView<MainController> {
@override
Widget build(BuildContext context) {
final c = Get.put(MainController());
List<Widget> _renderList(int index) {
return controller.state.bannerList!
return c.state.bannerList!
.asMap()
.keys
.map((idx) => _generateWidget(
......@@ -27,7 +28,7 @@ class SiperBannerWidget extends GetView<MainController> {
.toList();
}
return Obx(() => controller.state.bannerList == null
return Obx(() => c.state.bannerList == null
? Container()
: Container(
height: 230,
......
......@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'index.dart';
import 'widgets/widgets.dart';
......@@ -68,18 +69,23 @@ class PrivacyPage extends GetView<PrivacyController> {
},
),
title: const Text(
"隐私协议",
"隐私政策",
style: TextStyle(color: Colors.white),
)),
body: Container(
height: double.infinity,
width: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg.png").image,
fit: BoxFit.cover),
child: WebView(
initialUrl: "https://p.kdocs.cn/s/YXFCYBAAYQ",
),
child: _buildView(),
// 【金山文档】 隐私政策
// decoration: BoxDecoration(
// image: DecorationImage(
// image: Image.asset("assets/images/bg.png").image,
// fit: BoxFit.cover),
// ),
// child: _buildView(),
),
);
},
......
This diff is collapsed.
......@@ -6,6 +6,7 @@ import FlutterMacOS
import Foundation
import connectivity_plus
import device_info_plus
import firebase_auth
import firebase_core
import package_info
......@@ -19,6 +20,7 @@ import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
......
This diff is collapsed.
......@@ -117,6 +117,8 @@ dependencies:
eventsource: ^0.4.0
flutter_client_sse: ^1.0.0
highlight: ^0.7.0
device_info_plus: ^8.1.0
app_settings: ^4.2.0
# package:bubble/bubble.dart
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment