Commit 53120056 authored by 关振斌's avatar 关振斌

update: wxshare

parent acb9d7e1
{ {
"cSpell.words": [ "cSpell.words": [
"debouncetimer",
"roduct" "roduct"
] ],
"vue.features.codeActions.enable": false
} }
\ No newline at end of file
...@@ -47,7 +47,7 @@ PODS: ...@@ -47,7 +47,7 @@ PODS:
- FirebaseAuth (~> 10.7.0) - FirebaseAuth (~> 10.7.0)
- Firebase/CoreOnly (10.7.0): - Firebase/CoreOnly (10.7.0):
- FirebaseCore (= 10.7.0) - FirebaseCore (= 10.7.0)
- firebase_auth (4.4.0): - firebase_auth (4.4.1):
- Firebase/Auth (= 10.7.0) - Firebase/Auth (= 10.7.0)
- firebase_core - firebase_core
- Flutter - Flutter
...@@ -79,6 +79,8 @@ PODS: ...@@ -79,6 +79,8 @@ PODS:
- OrderedSet (~> 5.0) - OrderedSet (~> 5.0)
- flutter_keyboard_visibility (0.0.1): - flutter_keyboard_visibility (0.0.1):
- Flutter - Flutter
- flutter_native_splash (0.0.1):
- Flutter
- flutter_tts (0.0.1): - flutter_tts (0.0.1):
- Flutter - Flutter
- flutter_vibrate (0.0.1): - flutter_vibrate (0.0.1):
...@@ -88,6 +90,9 @@ PODS: ...@@ -88,6 +90,9 @@ PODS:
- fluttertoast (0.0.2): - fluttertoast (0.0.2):
- Flutter - Flutter
- Toast - Toast
- fluwx (0.0.1):
- Flutter
- WechatOpenSDK-XCFramework (~> 2.0.2)
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
...@@ -150,6 +155,7 @@ PODS: ...@@ -150,6 +155,7 @@ PODS:
- Flutter - Flutter
- webview_flutter_wkwebview (0.0.1): - webview_flutter_wkwebview (0.0.1):
- Flutter - Flutter
- WechatOpenSDK-XCFramework (2.0.2)
DEPENDENCIES: DEPENDENCIES:
- app_settings (from `.symlinks/plugins/app_settings/ios`) - app_settings (from `.symlinks/plugins/app_settings/ios`)
...@@ -164,10 +170,12 @@ DEPENDENCIES: ...@@ -164,10 +170,12 @@ DEPENDENCIES:
- flutter_inapp_purchase (from `.symlinks/plugins/flutter_inapp_purchase/ios`) - flutter_inapp_purchase (from `.symlinks/plugins/flutter_inapp_purchase/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`) - flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- flutter_vibrate (from `.symlinks/plugins/flutter_vibrate/ios`) - flutter_vibrate (from `.symlinks/plugins/flutter_vibrate/ios`)
- fluttercontactpicker (from `.symlinks/plugins/fluttercontactpicker/ios`) - fluttercontactpicker (from `.symlinks/plugins/fluttercontactpicker/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- keyboard_utils (from `.symlinks/plugins/keyboard_utils/ios`) - keyboard_utils (from `.symlinks/plugins/keyboard_utils/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`) - open_filex (from `.symlinks/plugins/open_filex/ios`)
...@@ -202,6 +210,7 @@ SPEC REPOS: ...@@ -202,6 +210,7 @@ SPEC REPOS:
- SwiftyGif - SwiftyGif
- Toast - Toast
- Try - Try
- WechatOpenSDK-XCFramework
EXTERNAL SOURCES: EXTERNAL SOURCES:
app_settings: app_settings:
...@@ -228,6 +237,8 @@ EXTERNAL SOURCES: ...@@ -228,6 +237,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_inappwebview/ios" :path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_keyboard_visibility: flutter_keyboard_visibility:
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios" :path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
flutter_native_splash:
:path: ".symlinks/plugins/flutter_native_splash/ios"
flutter_tts: flutter_tts:
:path: ".symlinks/plugins/flutter_tts/ios" :path: ".symlinks/plugins/flutter_tts/ios"
flutter_vibrate: flutter_vibrate:
...@@ -236,6 +247,8 @@ EXTERNAL SOURCES: ...@@ -236,6 +247,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluttercontactpicker/ios" :path: ".symlinks/plugins/fluttercontactpicker/ios"
fluttertoast: fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios" :path: ".symlinks/plugins/fluttertoast/ios"
fluwx:
:path: ".symlinks/plugins/fluwx/ios"
image_picker_ios: image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
keyboard_utils: keyboard_utils:
...@@ -276,7 +289,7 @@ SPEC CHECKSUMS: ...@@ -276,7 +289,7 @@ SPEC CHECKSUMS:
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920 file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Firebase: 0219acf760880eeec8ce479895bd7767466d9f81 Firebase: 0219acf760880eeec8ce479895bd7767466d9f81
firebase_auth: 5984ebaf5463319e304ab1c0966b06994bd1c69a firebase_auth: 5a84572b7f5315a3aff5b07c62bb0cd5a28cade5
firebase_core: d85432877e814811e040e7659f9c82faeab66e04 firebase_core: d85432877e814811e040e7659f9c82faeab66e04
FirebaseAuth: dd64c01631df724b09f33e584625775c52f7d71f FirebaseAuth: dd64c01631df724b09f33e584625775c52f7d71f
FirebaseCore: e317665b9d744727a97e623edbbed009320afdd7 FirebaseCore: e317665b9d744727a97e623edbbed009320afdd7
...@@ -286,10 +299,12 @@ SPEC CHECKSUMS: ...@@ -286,10 +299,12 @@ SPEC CHECKSUMS:
flutter_inapp_purchase: 5c6a1ac3f11b11d0c8c0321c0c41c1f05805e4c8 flutter_inapp_purchase: 5c6a1ac3f11b11d0c8c0321c0c41c1f05805e4c8
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721 flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
flutter_vibrate: 9f4c2ab57008965f78969472367c329dd77eb801 flutter_vibrate: 9f4c2ab57008965f78969472367c329dd77eb801
fluttercontactpicker: d582836dea6b5d489f3d259f35d7817ae82ee5e6 fluttercontactpicker: d582836dea6b5d489f3d259f35d7817ae82ee5e6
fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0 fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0
fluwx: e9e728cfdb80e82dac5f4ff974b1901a7939dcd0
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749 GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
GTMSessionFetcher: c9e714f7eec91a55641e2bab9f45fd83a219b882 GTMSessionFetcher: c9e714f7eec91a55641e2bab9f45fd83a219b882
...@@ -315,6 +330,7 @@ SPEC CHECKSUMS: ...@@ -315,6 +330,7 @@ SPEC CHECKSUMS:
vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241 vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126 video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 51; objectVersion = 54;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
...@@ -205,6 +205,7 @@ ...@@ -205,6 +205,7 @@
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
...@@ -241,6 +242,7 @@ ...@@ -241,6 +242,7 @@
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
...@@ -345,7 +347,7 @@ ...@@ -345,7 +347,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
...@@ -364,7 +366,7 @@ ...@@ -364,7 +366,7 @@
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = Z99J24WADU; DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1; FLUTTER_BUILD_NAME = 1.0.3;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师"; INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -427,7 +429,7 @@ ...@@ -427,7 +429,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
...@@ -476,7 +478,7 @@ ...@@ -476,7 +478,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
...@@ -497,7 +499,7 @@ ...@@ -497,7 +499,7 @@
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = Z99J24WADU; DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1; FLUTTER_BUILD_NAME = 1.0.3;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师"; INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -524,7 +526,7 @@ ...@@ -524,7 +526,7 @@
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = Z99J24WADU; DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1; FLUTTER_BUILD_NAME = 1.0.3;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师"; INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
<dict> <dict>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Editor</string> <string>Editor</string>
<key>CFBundleURLName</key>
<string>wxac6457d4b052cc48</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array/> <array/>
</dict> </dict>
...@@ -41,12 +43,21 @@ ...@@ -41,12 +43,21 @@
<array> <array>
<string>weixin</string> <string>weixin</string>
<string>weixinULAPI</string> <string>weixinULAPI</string>
<string>weixinOpenSDK</string> <string>weixinURLParamsAPI</string>
</array> </array>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSMicrophoneUsageDescription</key>
<string>只有您‘允许使用麦克风’AI写作大师才能听您说话</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>需要相册权限发送图片</string> <string>需要相册权限发送图片</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>只有您‘允许使用麦克风’AI写作大师才能听您说话</string>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
<true/> <true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
...@@ -66,11 +77,7 @@ ...@@ -66,11 +77,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>NSMicrophoneUsageDescription</key>
<string>只有您‘允许使用麦克风’AI写作大师才能听您说话</string>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<key>NSSpeechRecognitionUsageDescription</key>
<string>只有您‘允许使用麦克风’AI写作大师才能听您说话</string>
</dict> </dict>
</plist> </plist>
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<key>com.apple.developer.associated-domains</key> <key>com.apple.developer.associated-domains</key>
<array> <array>
<string>applinks:www.hahagpt.com/app/</string> <string>applinks:www.hahagpt.com/app/</string>
<string>applinks:order.1clickpass.com/app/</string>
<string>applinks:order.1clickpass.com</string>
</array> </array>
</dict> </dict>
</plist> </plist>
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<dict> <dict>
<key>com.apple.developer.associated-domains</key> <key>com.apple.developer.associated-domains</key>
<array> <array>
<string>applinks:www.fusiontech.cn/</string> <string>applinks:www.hahagpt.com/app/</string>
<string>applinks:order.1clickpass.com/app/</string>
<string>applinks:order.1clickpass.com</string>
</array> </array>
</dict> </dict>
</plist> </plist>
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<dict> <dict>
<key>com.apple.developer.associated-domains</key> <key>com.apple.developer.associated-domains</key>
<array> <array>
<string>applinks:www.fusiontech.cn/</string> <string>applinks:order.1clickpass.com/app/</string>
<string>applinks:www.hahagpt.com/app/</string>
<string>applinks:order.1clickpass.com</string>
</array> </array>
</dict> </dict>
</plist> </plist>
...@@ -6,6 +6,7 @@ import 'package:chart/common/utils/utils.dart'; ...@@ -6,6 +6,7 @@ import 'package:chart/common/utils/utils.dart';
import '../../entity/login_entity.dart'; import '../../entity/login_entity.dart';
import '../../entity/user_entity.dart'; import '../../entity/user_entity.dart';
import '../entities/applePayList.dart';
/// 用户 /// 用户
class UserAPI { class UserAPI {
...@@ -41,6 +42,16 @@ class UserAPI { ...@@ -41,6 +42,16 @@ class UserAPI {
// UserLoginResponseEntity.fromJson(response); // UserLoginResponseEntity.fromJson(response);
} }
static Future<ApplePayListEntity> applePayList() async {
var response = await HttpUtil().get(
'/goods/goodsListForIos',
);
// print(response + '1response');
return ApplePayListEntity.fromJson(response);
// UserLoginResponseEntity.fromJson(response);
}
// Future<ApplePayEntity>? applePayCallBack(Map<String, dynamic> parameters) { // Future<ApplePayEntity>? applePayCallBack(Map<String, dynamic> parameters) {
// return HttpUtil.instance // return HttpUtil.instance
// ?.post(AppUrls.applePayCallBack, parameters: parameters) // ?.post(AppUrls.applePayCallBack, parameters: parameters)
...@@ -194,12 +205,12 @@ class UserAPI { ...@@ -194,12 +205,12 @@ class UserAPI {
} }
static Future<SceneEntity> getSceneList() async { static Future<SceneEntity> getSceneList() async {
try{ try {
var response = await HttpUtil().get( var response = await HttpUtil().get(
'/scene/getSceneList', '/scene/getSceneList',
); );
return SceneEntity.fromJson(response); return SceneEntity.fromJson(response);
}catch(e){ } catch (e) {
return Future.error(e); return Future.error(e);
} }
......
import 'package:get/get.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import '../db/db_helper.dart';
class TaskController extends GetxController {
//this will hold the data and update the ui
@override
void onReady() {
getTasks();
super.onReady();
}
final taskList = <Chat.ChatMessage>[].obs;
// add data to table
Future<int> addTask({required Chat.ChatMessage chat}) async {
return await DBHelper.insert(chat);
}
// get all the data from table
void getTasks() async {
List<Map<String, dynamic>> chatList = await DBHelper.query();
taskList.assignAll(
chatList.map((data) => Chat.ChatMessage.fromJson(data)).toList());
}
// delete data from table
void deleteTask(Chat.ChatMessage chat) async {
await DBHelper.delete(chat);
getTasks();
}
// update data int table
void markTaskCompleted(int id) async {
await DBHelper.update(id);
getTasks();
}
}
import 'package:sqflite/sqflite.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
//~/lib/controllers
class DBHelper {
static Database? _db;
static const int _version = 1;
static const String _tableName = 'tasks';
static Future<void> initDb() async {
if (_db != null) {
return;
}
try {
String _path = await getDatabasesPath() + 'tasks.db';
_db = await openDatabase(
_path,
version: _version,
onCreate: (db, version) {
return db.execute(
"CREATE TABLE $_tableName(id INTEGER PRIMARY KEY AUTOINCREMENT, title STRING, note TEXT, date STRING, startTime STRING, endTime STRING, remind INTEGER, repeat STRING, color INTEGER, isCompleted INTEGER)",
);
},
);
} catch (e) {
print(e);
}
}
static Future<int> insert(Chat.ChatMessage task) async {
print("insert function called");
return await _db!.insert(_tableName, task.toJson());
}
static Future<int> delete(Chat.ChatMessage task) async =>
await _db!.delete(_tableName, where: 'id = ?', whereArgs: [task.text]);
static Future<List<Map<String, dynamic>>> query() async {
print("query function called");
return _db!.query(_tableName);
}
static Future<int> update(int id) async {
print("update function called");
return await _db!.rawUpdate('''
UPDATE tasks
SET isCompleted = ?
WHERE id = ?
''', [1, id]);
}
}
class ApplePayListEntity {
int? status;
String? message;
List<PayListItem>? data;
int? timestamp;
ApplePayListEntity({this.status, this.message, this.data, this.timestamp});
ApplePayListEntity.fromJson(Map<String, dynamic> json) {
status = json['status'];
message = json['message'];
if (json['data'] != null) {
data = <PayListItem>[];
json['data'].forEach((v) {
data!.add(new PayListItem.fromJson(v));
});
}
timestamp = json['timestamp'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['status'] = this.status;
data['message'] = this.message;
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
data['timestamp'] = this.timestamp;
return data;
}
}
class PayListItem {
int? id;
String? goodsName;
String? goodsDesc;
double? amount;
double? originalPrice;
int? integral;
String? createTime;
String? updateTime;
String? appleProductId;
int? isShelf;
int? goodsType;
int? count;
String? dayDesc;
PayListItem(
{this.id,
this.goodsName,
this.goodsDesc,
this.amount,
this.originalPrice,
this.integral,
this.createTime,
this.updateTime,
this.appleProductId,
this.isShelf,
this.goodsType,
this.count,
this.dayDesc});
PayListItem.fromJson(Map<String, dynamic> json) {
id = json['id'];
goodsName = json['goodsName'];
goodsDesc = json['goodsDesc'];
amount = json['amount'];
originalPrice = json['originalPrice'];
integral = json['integral'];
createTime = json['createTime'];
updateTime = json['updateTime'];
appleProductId = json['appleProductId'];
isShelf = json['isShelf'];
goodsType = json['goodsType'];
count = json['count'];
dayDesc = json['dayDesc'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['goodsName'] = this.goodsName;
data['goodsDesc'] = this.goodsDesc;
data['amount'] = this.amount;
data['originalPrice'] = this.originalPrice;
data['integral'] = this.integral;
data['createTime'] = this.createTime;
data['updateTime'] = this.updateTime;
data['appleProductId'] = this.appleProductId;
data['isShelf'] = this.isShelf;
data['goodsType'] = this.goodsType;
data['count'] = this.count;
data['dayDesc'] = this.dayDesc;
return data;
}
}
...@@ -62,7 +62,7 @@ class UserStore extends GetxController { ...@@ -62,7 +62,7 @@ class UserStore extends GetxController {
} else { } else {
ApplicationController.to.state.isNetWorkErr = false; ApplicationController.to.state.isNetWorkErr = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
await refreshInfo(); // await refreshInfo();
// Get.offAndToNamed(AppRoutes.Application); // Get.offAndToNamed(AppRoutes.Application);
// AppRoutes.WILL_COME // AppRoutes.WILL_COME
...@@ -73,7 +73,7 @@ class UserStore extends GetxController { ...@@ -73,7 +73,7 @@ class UserStore extends GetxController {
// Got a new connectivity status! // Got a new connectivity status!
}); });
if (GetPlatform.isAndroid) { if (GetPlatform.isAndroid || GetPlatform.isIOS) {
token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY); token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY);
var profileOffline = var profileOffline =
StorageService.to.getString(STORAGE_USER_PROFILE_KEY); StorageService.to.getString(STORAGE_USER_PROFILE_KEY);
...@@ -110,41 +110,35 @@ class UserStore extends GetxController { ...@@ -110,41 +110,35 @@ class UserStore extends GetxController {
} }
void logout() { void logout() {
StorageService.to.remove(STORAGE_USER_TOKEN_KEY); StorageService.to.remove(STORAGE_USER_TOKEN_KEY);
StorageService.to.remove(STORAGE_USER_PROFILE_KEY); StorageService.to.remove(STORAGE_USER_PROFILE_KEY);
_profile.value = IntegralEntity( _profile.value = IntegralEntity(
id: '', token: '', username: '', integral: 0, expireTime: null); id: '', token: '', username: '', integral: 0, expireTime: null);
_isLogin.value = false; _isLogin.value = false;
} }
Future refreshInfo() async {
if (GetPlatform.isIOS) {
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
final res = await UserAPI.appleLogin({ Future refreshInfo() async {
"phone": iosInfo.data['identifierForVendor'], if (GetPlatform.isIOS) {
}); IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
final value = IntegralEntity( final res = await UserAPI.appleLogin({
expireTime: res.expireTime == null ? null : res.expireTime, "phone": iosInfo.data['identifierForVendor'],
id: res.id, });
token: res.token,
username: res.username,
integral: res.integral,
);
token = res.token;
_profile.value = _profile(value);
if (profile.id != '') { final value = IntegralEntity(
_isLogin.value = true; 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);
// await MainController.to.asyncLoadBannerData(); if (profile.id != '') {
_isLogin.value = true;
} }
}
handleLogin(IntegralEntity res) async {
await setToken(res.token); await setToken(res.token);
// IntegralEntity userInfo = await UserAPI.getUserIntegral(); // IntegralEntity userInfo = await UserAPI.getUserIntegral();
await getUserInfo(IntegralEntity( await getUserInfo(IntegralEntity(
...@@ -156,77 +150,93 @@ class UserStore extends GetxController { ...@@ -156,77 +150,93 @@ class UserStore extends GetxController {
)); ));
_isLogin.value = true; _isLogin.value = true;
Get.back(); Get.back();
// Get.put(ApplicationController()); // await MainController.to.asyncLoadBannerData();
// Get.offAndToNamed(AppRoutes.Application);
} }
}
getUserInfo(IntegralEntity userInfo) async { handleLogin(IntegralEntity res) async {
await setToken(userInfo.token); await setToken(res.token);
// IntegralEntity userInfo = await UserAPI.getUserIntegral();
await getUserInfo(IntegralEntity(
id: res.id,
username: res.username,
token: res.token,
integral: res.integral,
expireTime: res.expireTime,
));
_isLogin.value = true;
Get.back();
// Get.put(ApplicationController());
// Get.offAndToNamed(AppRoutes.Application);
}
await saveProfile(userInfo); getUserInfo(IntegralEntity userInfo) async {
await setToken(userInfo.token);
// token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY); await saveProfile(userInfo);
// if (token.isNotEmpty) { // token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY);
// return;
// }
// IntegralEntity userInfo = await UserAPI.getUserIntegral();
// print("$userInfo"); // if (token.isNotEmpty) {
// return;
// }
// IntegralEntity userInfo = await UserAPI.getUserIntegral();
// var info = await UserAPI.getUserIntegral(); // print("$userInfo");
// if (token.isEmpty) {
// } // var info = await UserAPI.getUserIntegral();
} // if (token.isEmpty) {
@override // }
dispose() { }
subscription?.cancel();
super.dispose();
}
// 保存 token @override
Future<void> setToken(String value) async { dispose() {
await StorageService.to.setString(STORAGE_USER_TOKEN_KEY, value); subscription?.cancel();
token = value; super.dispose();
} }
// 获取 profile // 保存 token
Future<void> getProfile() async { Future<void> setToken(String value) async {
// print("objectobjectobjectobjectobjectobject"); await StorageService.to.setString(STORAGE_USER_TOKEN_KEY, value);
// if (token.isEmpty) return; token = value;
// var result = await UserAPI.profile(); }
// _profile(result);
// _isLogin.value = true;
// StorageService.to.setString(STORAGE_USER_PROFILE_KEY, jsonEncode(result));
}
// 保存 profile // 获取 profile
Future<void> saveProfile(IntegralEntity profile) async { Future<void> getProfile() async {
_profile.value = profile; // print("objectobjectobjectobjectobjectobject");
var copiedMap = Map.from(profile.toMap()); // if (token.isEmpty) return;
// var result = await UserAPI.profile();
// _profile(result);
// _isLogin.value = true;
// StorageService.to.setString(STORAGE_USER_PROFILE_KEY, jsonEncode(result));
}
copiedMap.update("expireTime", (value) => value?.toIso8601String()); // 保存 profile
Future<void> saveProfile(IntegralEntity profile) async {
_profile.value = profile;
var copiedMap = Map.from(profile.toMap());
StorageService.to copiedMap.update("expireTime", (value) => value?.toIso8601String());
.setString(STORAGE_USER_PROFILE_KEY, jsonEncode(copiedMap));
}
// // 保存 profile StorageService.to
// Future<void> saveProfile(UserLoginResponseEntity profile) async { .setString(STORAGE_USER_PROFILE_KEY, jsonEncode(copiedMap));
// _isLogin.value = true; }
// StorageService.to.setString(STORAGE_USER_PROFILE_KEY, jsonEncode(profile));
// }
// 注销 // // 保存 profile
Future<void> onLogout() async { // Future<void> saveProfile(UserLoginResponseEntity profile) async {
// if (_isLogin.value) await UserAPI.logout(); // _isLogin.value = true;
await StorageService.to.remove(STORAGE_USER_TOKEN_KEY); // StorageService.to.setString(STORAGE_USER_PROFILE_KEY, jsonEncode(profile));
_isLogin.value = false; // }
token = '';
saveProfile(IntegralEntity( // 注销
id: '', username: '', token: '', expireTime: null, integral: 0)); Future<void> onLogout() async {
Get.toNamed(AppRoutes.Application); // if (_isLogin.value) await UserAPI.logout();
await StorageService.to.remove(STORAGE_USER_TOKEN_KEY);
_isLogin.value = false;
token = '';
saveProfile(IntegralEntity(
id: '', username: '', token: '', expireTime: null, integral: 0));
Get.toNamed(AppRoutes.Application);
} }
} }
...@@ -17,7 +17,7 @@ class Loading { ...@@ -17,7 +17,7 @@ class Loading {
..maskColor = Colors.black.withOpacity(0.6) ..maskColor = Colors.black.withOpacity(0.6)
..userInteractions = true ..userInteractions = true
..dismissOnTap = false ..dismissOnTap = false
..maskType = EasyLoadingMaskType.custom; ..maskType = EasyLoadingMaskType.black;
} }
static void show([String? text]) { static void show([String? text]) {
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
// const SERVER_API_URL = 'https://yapi.baidu.com/mock/41008'; // const SERVER_API_URL = 'https://yapi.baidu.com/mock/41008';
// const SERVER_API_URL = 'http://192.168.120.175: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://101.34.153.228:8083/api';//线上
// const SERVER_API_URL = 'http://192.168.110.12:8083/api';//线上
//http://192.168.110.12:8083/api/doc.html
// const SERVER_API_URL = 'http://192.168.121.180:8083/api';//线上 // const SERVER_API_URL = 'http://192.168.121.180:8083/api';//线上
//http://192.168.2.178:8083/api/doc.html //http://192.168.2.178:8083/api/doc.html
// const SERVER_API_URL = "http://192.168.120.108:8083/api"; // const SERVER_API_URL = "http://192.168.120.108:8083/api";
......
import 'dart:io'; import 'dart:io';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:chart/pages/frame/product/bindings.dart'; import 'package:chart/pages/frame/product/bindings.dart';
import 'package:chart/pages/home/index.dart'; import 'package:chart/pages/home/index.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
...@@ -19,6 +19,8 @@ import 'package:glassy/glassy_config.dart'; ...@@ -19,6 +19,8 @@ import 'package:glassy/glassy_config.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
void main() async { void main() async {
// WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
// FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
await Global.init(); await Global.init();
Glassy().setConfig(GlassyConfig( Glassy().setConfig(GlassyConfig(
radius: 16, radius: 16,
...@@ -28,9 +30,9 @@ void main() async { ...@@ -28,9 +30,9 @@ void main() async {
runApp(ChatApp()); runApp(ChatApp());
/// Android的一些全局配置項 /// Android的一些全局配置項
if(Platform.isAndroid) { if (Platform.isAndroid) {
var systemUiOverlayStyle = var systemUiOverlayStyle =
const SystemUiOverlayStyle(systemNavigationBarColor: Colors.black); const SystemUiOverlayStyle(systemNavigationBarColor: Colors.black);
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
} }
} }
......
...@@ -136,66 +136,70 @@ class _MessageListState extends State<MessageList> { ...@@ -136,66 +136,70 @@ class _MessageListState extends State<MessageList> {
final bool isPlaceHolder = message.user.id == '0'; final bool isPlaceHolder = message.user.id == '0';
if (isPlaceHolder) { if (isPlaceHolder) {
// //
return InkWell( return Container(
onTap: () { margin: const EdgeInsets.only(
scrollController.animateTo( left: 10, right: 10, bottom: 20),
0.0, child: Column(
duration: const Duration(milliseconds: 300), children: [
curve: Curves.easeInOut, Row(
); children: [
widget.messageOptions.onPressMessage!(message); Icon(
}, Icons.timelapse_sharp,
child: Container( color: Color.fromARGB(255, 117, 194, 245),
margin: const EdgeInsets.only( ),
left: 10, right: 10, bottom: 20), SizedBox(width: 10),
child: Column( Text(message.customProperties!['title']),
children: [ ],
Row( ),
children: [ Container(
Icon( margin: const EdgeInsets.only(top: 20),
Icons.timelapse_sharp, decoration: BoxDecoration(
color: Color.fromARGB(255, 117, 194, 245), borderRadius: BorderRadius.circular(10),
), gradient: const LinearGradient(
SizedBox(width: 10), colors: [
Text(message.customProperties!['title']), Color(0xFF3d3f54),
], Color(0xFF333450),
), Color(0xFF2b2b4d)
Container( ],
padding: const EdgeInsets.symmetric( begin: Alignment.topCenter,
vertical: 15, horizontal: 20), end: Alignment.bottomCenter,
decoration: BoxDecoration( )),
borderRadius: BorderRadius.circular(10), child: InkWell(
gradient: const LinearGradient( borderRadius: BorderRadius.circular(10),
colors: [ onTap: () {
Color(0xFF3d3f54), scrollController.animateTo(
Color(0xFF333450), 0.0,
Color(0xFF2b2b4d) duration:
], const Duration(milliseconds: 300),
begin: Alignment.topCenter, curve: Curves.easeInOut,
end: Alignment.bottomCenter, );
)), widget.messageOptions
margin: const EdgeInsets.only(top: 20), .onPressMessage!(message);
child: Row( },
mainAxisAlignment: child: Ink(
MainAxisAlignment.spaceBetween, padding: const EdgeInsets.symmetric(
children: [ vertical: 15, horizontal: 20),
Expanded( child: Row(
child: Text( mainAxisAlignment:
message.text, MainAxisAlignment.spaceBetween,
overflow: TextOverflow.ellipsis, children: [
maxLines: 1, Expanded(
style: const TextStyle( child: Text(
color: Color.fromARGB( message.text,
255, 170, 170, 194)), overflow: TextOverflow.ellipsis,
)), maxLines: 1,
const Icon( style: const TextStyle(
Icons.arrow_forward, color: Color.fromARGB(
color: Color(0xFF9c67f6), 255, 170, 170, 194)),
), )),
]), const Icon(
), Icons.arrow_forward,
], color: Color(0xFF9c67f6),
), ),
]),
)),
),
],
), ),
); );
} }
......
...@@ -114,7 +114,7 @@ class ApplicationController extends GetxController { ...@@ -114,7 +114,7 @@ class ApplicationController extends GetxController {
// tab栏动画 // tab栏动画
void handleNavBarTap(int index) async { void handleNavBarTap(int index) async {
Vibrate.feedback(FeedbackType.impact); Vibrate.feedback(FeedbackType.impact);
if (! await _canHandleNavBar(index)) { if (!await _canHandleNavBar(index)) {
return; return;
} else { } else {
try { try {
...@@ -127,7 +127,7 @@ class ApplicationController extends GetxController { ...@@ -127,7 +127,7 @@ class ApplicationController extends GetxController {
} }
// 判断是否能够跳转至私人助理页面 // 判断是否能够跳转至私人助理页面
Future<bool> _canHandleNavBar(int index,{bool autoChange = true}) async { Future<bool> _canHandleNavBar(int index, {bool autoChange = true}) async {
///私人助手index ///私人助手index
int asssitIndex = 2; int asssitIndex = 2;
// android平台私人助理页需要登录才可以查看 // android平台私人助理页需要登录才可以查看
...@@ -226,7 +226,7 @@ class ApplicationController extends GetxController { ...@@ -226,7 +226,7 @@ class ApplicationController extends GetxController {
icon: Image(image: AssetImage("assets/images/home.png"), width: 30.0), icon: Image(image: AssetImage("assets/images/home.png"), width: 30.0),
activeIcon: Image( activeIcon: Image(
image: AssetImage("assets/images/home-selected.png"), width: 30.0), image: AssetImage("assets/images/home-selected.png"), width: 30.0),
label: '百晓通', label: 'AI聊天',
backgroundColor: AppColors.primaryBackground, backgroundColor: AppColors.primaryBackground,
), ),
const BottomNavigationBarItem( const BottomNavigationBarItem(
......
...@@ -4,9 +4,11 @@ import 'package:chart/common/apis/user.dart'; ...@@ -4,9 +4,11 @@ import 'package:chart/common/apis/user.dart';
import 'package:chart/common/store/store.dart'; import 'package:chart/common/store/store.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart'; import 'package:chart/package/chat_dash/dash_chat_2.dart';
import 'package:flutter_client_sse/flutter_client_sse.dart'; import 'package:flutter_client_sse/flutter_client_sse.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart'; import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat; import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import '../../common/routers/names.dart';
import '../../common/values/values.dart'; import '../../common/values/values.dart';
import 'index.dart'; import 'index.dart';
...@@ -72,12 +74,19 @@ class AssistantItemController extends GetxController { ...@@ -72,12 +74,19 @@ class AssistantItemController extends GetxController {
try { try {
await initEventSource(); await initEventSource();
state.isLoading = true; state.isLoading = true;
await UserAPI.sceneConversion({ int res = await UserAPI.sceneConversion({
"conversionId": state.actId, "conversionId": state.actId,
"question": message.text, "question": message.text,
"sceneId": state.selectItem['sceneId'], "sceneId": state.selectItem['sceneId'],
}); });
if (res == 401) {
_updateMessage('请登录后体验功能!');
state.isLoading = false;
EasyLoading.showInfo('您还为登录,请登录后体验功能。');
Get.toNamed(AppRoutes.SIGN_IN);
}
} catch (e) { } catch (e) {
_updateMessage('服务器异常');
state.isLoading = false; state.isLoading = false;
} }
......
...@@ -15,6 +15,16 @@ class GridWidget extends GetView<AssistantController> { ...@@ -15,6 +15,16 @@ class GridWidget extends GetView<AssistantController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Obx(() => SmartRefresher( return Obx(() => SmartRefresher(
header: ClassicHeader(
releaseText: "松开刷新",
refreshingText: "刷新数据中",
completeText: "刷新数据成功",
idleText: "下拉刷新"),
footer: ClassicFooter(
loadingText: "正在加载中...",
// loadStyle: LoadStyle.ShowWhenLoading,
// completeDuration: Duration(milliseconds: 500),
noDataText: '没有更多数据啦'),
enablePullDown: controller.enablePullDown.value, enablePullDown: controller.enablePullDown.value,
enablePullUp: controller.enablePullUp.value, enablePullUp: controller.enablePullUp.value,
onRefresh: controller.onRefresh, onRefresh: controller.onRefresh,
...@@ -155,8 +165,7 @@ class GridWidget extends GetView<AssistantController> { ...@@ -155,8 +165,7 @@ class GridWidget extends GetView<AssistantController> {
increaseHeightBy: -5.00, increaseHeightBy: -5.00,
increaseWidthBy: -10.00, increaseWidthBy: -10.00,
callback: () { callback: () {
controller controller.onTap(element);
.onTap(element);
}, },
// controller.requestPurchase, // controller.requestPurchase,
gradient: gradient:
...@@ -185,10 +194,8 @@ class GridWidget extends GetView<AssistantController> { ...@@ -185,10 +194,8 @@ class GridWidget extends GetView<AssistantController> {
Text("${element.sceneDesc}", Text("${element.sceneDesc}",
maxLines: 2, maxLines: 2,
textAlign: TextAlign.left, textAlign: TextAlign.left,
overflow: overflow: TextOverflow.ellipsis,
TextOverflow.ellipsis, style: TextStyle(fontSize: 10))
style:
TextStyle(fontSize: 10))
]), ]),
), ),
) )
......
...@@ -2,6 +2,7 @@ import 'dart:convert'; ...@@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:chart/common/apis/apis.dart'; import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/entities/detail.dart'; import 'package:chart/common/entities/detail.dart';
import 'package:chart/common/routers/names.dart';
import 'package:chart/common/store/user.dart'; import 'package:chart/common/store/user.dart';
import 'package:chart/common/values/server.dart'; import 'package:chart/common/values/server.dart';
import 'package:clipboard/clipboard.dart'; import 'package:clipboard/clipboard.dart';
...@@ -74,11 +75,19 @@ class CreationDetailController extends GetxController { ...@@ -74,11 +75,19 @@ class CreationDetailController extends GetxController {
EasyLoading.show(status: "AI正在生成中..."); EasyLoading.show(status: "AI正在生成中...");
try { try {
state.isLoading = true; state.isLoading = true;
await NewsAPI.sendMessageByDetailId(state.detailList.value, state.id); final res = await NewsAPI.sendMessageByDetailId(
state.detailList.value, state.id);
if (state.genText.isNotEmpty) { if (state.genText.isNotEmpty) {
state.genText = ''; state.genText = '';
} }
if (res == 401) {
state.genText = '您还为登录,请登录后体验功能。';
EasyLoading.showInfo('您还为登录,请登录后体验功能。');
Get.toNamed(AppRoutes.SIGN_IN);
state.isLoading = false;
}
// state.isLoading = false; // state.isLoading = false;
} catch (e) { } catch (e) {
state.isLoading = false; state.isLoading = false;
...@@ -94,7 +103,6 @@ class CreationDetailController extends GetxController { ...@@ -94,7 +103,6 @@ class CreationDetailController extends GetxController {
sse = SSEClient.subscribeToSSE( sse = SSEClient.subscribeToSSE(
url: "$SERVER_API_URL/openAi/connect/${UserStore.to.profile.id}", url: "$SERVER_API_URL/openAi/connect/${UserStore.to.profile.id}",
header: {}).listen((event) async { header: {}).listen((event) async {
print('$event 1213213131');
if (event.data!.trim().isEmpty) { if (event.data!.trim().isEmpty) {
return; return;
} else if (event.id == "[DONE]") { } else if (event.id == "[DONE]") {
......
...@@ -285,18 +285,9 @@ class HelloWidget extends GetView<CreationDetailController> { ...@@ -285,18 +285,9 @@ class HelloWidget extends GetView<CreationDetailController> {
increaseWidthBy: Get.width * .7, increaseWidthBy: Get.width * .7,
callback: controller.genInner, callback: controller.genInner,
shapeRadius: const BorderRadius.all(Radius.circular(5)), shapeRadius: const BorderRadius.all(Radius.circular(5)),
// controller.requestPurchase,
// gradient: Gradients.cosmicFusion,
// background-image: linear-gradient(180deg, #3d3f54, #333450, #2b2b4d);
elevation: 0, elevation: 0,
gradient: const LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
// 61, 63, 84
// 180deg,
// #be6afb,
// #9c67f6,
// #7965f8
Color(0xFFbe6afb), Color(0xFFbe6afb),
Color(0xFF9c67f6), Color(0xFF9c67f6),
Color(0xFF7965f8) Color(0xFF7965f8)
......
...@@ -223,13 +223,23 @@ class GridWidget extends GetView<CreationController> { ...@@ -223,13 +223,23 @@ class GridWidget extends GetView<CreationController> {
// ) // )
], ],
); );
return Obx(() => SmartRefresher( return Obx(() => SmartRefresher(
enablePullDown: controller.enablePullDown.value, header: ClassicHeader(
enablePullUp: controller.enablePullUp.value, releaseText: "松开刷新",
onRefresh: controller.onRefresh, refreshingText: "刷新数据中",
controller: controller.refreshController, completeText: "刷新数据成功",
child: customScrollView, idleText: "下拉刷新"),
)); footer: ClassicFooter(
loadingText: "正在加载中...",
// loadStyle: LoadStyle.ShowWhenLoading,
// completeDuration: Duration(milliseconds: 500),
noDataText: '没有更多数据啦'),
enablePullDown: controller.enablePullDown.value,
enablePullUp: controller.enablePullUp.value,
onRefresh: controller.onRefresh,
controller: controller.refreshController,
child: customScrollView,
));
// return Container( // return Container(
// alignment: Alignment.center, // alignment: Alignment.center,
......
...@@ -49,6 +49,7 @@ class UserEulaPage extends GetView<UserEulaController> { ...@@ -49,6 +49,7 @@ class UserEulaPage extends GetView<UserEulaController> {
builder: (_) { builder: (_) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Color.fromARGB(255, 30, 34, 61),
leading: IconButton( leading: IconButton(
tooltip: '返回上一页', tooltip: '返回上一页',
icon: const Icon( icon: const Icon(
......
...@@ -50,14 +50,12 @@ class AndroidPayListController extends GetxController { ...@@ -50,14 +50,12 @@ class AndroidPayListController extends GetxController {
super.onInit(); super.onInit();
try { try {
await initializedPlugins(); await initializedPlugins();
EasyLoading.show(status: "正在获取套餐中..."); EasyLoading.show(status: "正在获取套餐中...");
await _getProduct(); await _getProduct();
state.loadingList = false; state.loadingList = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
} catch (e) {
} catch(e){
state.loadingList = false; state.loadingList = false;
} }
...@@ -117,10 +115,11 @@ class AndroidPayListController extends GetxController { ...@@ -117,10 +115,11 @@ class AndroidPayListController extends GetxController {
try { try {
List<GoodEntity> goodsList = await NewsAPI.getGoodsList(); List<GoodEntity> goodsList = await NewsAPI.getGoodsList();
final list = goodsList.reversed;
// print(goodsList); // print(goodsList);
state.items.addAll(goodsList); state.items.addAll(list);
EasyLoading.dismiss(); EasyLoading.dismiss();
if(goodsList.isNotEmpty) { if (goodsList.isNotEmpty) {
state.setSelectedItem = goodsList.first; state.setSelectedItem = goodsList.first;
} }
} catch (e) { } catch (e) {
......
...@@ -68,7 +68,7 @@ class PayItemWidget extends GetView<AndroidPayListController> { ...@@ -68,7 +68,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
text: text:
" ${c.profile.expireTime.year}-${c.profile.expireTime.month}-${c.profile.expireTime.day} "), " ${c.profile.expireTime.year}-${c.profile.expireTime.month}-${c.profile.expireTime.day} "),
const TextSpan( const TextSpan(
text: '过期,如果您是自动续费会员将会在过期日前一天自动续费。', text: '过期',
style: TextStyle( style: TextStyle(
color: Color.fromARGB(255, 160, 165, 184), color: Color.fromARGB(255, 160, 165, 184),
fontSize: 14, fontSize: 14,
......
...@@ -20,10 +20,13 @@ class PayListController extends GetxController { ...@@ -20,10 +20,13 @@ class PayListController extends GetxController {
final state = PayListState(); final state = PayListState();
final List<String> _productLists = [ final List<String> _productLists = [
"com.wudi.app.prod_id_10",
"com.wudi.app.prod_id_6",
"com.wudi.monthly_pass.chat",
"com.wudi.chat.week_pass", "com.wudi.chat.week_pass",
"com.wudi.monthly_pass_chat_subscription", "com.wudi.monthly_pass_chat_subscription",
"com.wudi.quarterly_pass_chat_subscription", "com.wudi.quarterly_pass_chat_subscription",
// "com.wudi.chat.halfyear_pass", "com.wudi.chat.halfyear_pass",
"com.wudi.yearly_pass_chat" "com.wudi.yearly_pass_chat"
]; ];
...@@ -98,9 +101,9 @@ class PayListController extends GetxController { ...@@ -98,9 +101,9 @@ class PayListController extends GetxController {
if (res?.status == 200) { if (res?.status == 200) {
state.loading = false; state.loading = false;
EasyLoading.showSuccess(res.message);
Vibrate.feedback(FeedbackType.success); Vibrate.feedback(FeedbackType.success);
EasyLoading.dismiss(); EasyLoading.showSuccess(res.message);
UserAPI.getUserInfo().then((value) async { UserAPI.getUserInfo().then((value) async {
await UserStore.to.saveProfile(IntegralEntity( await UserStore.to.saveProfile(IntegralEntity(
id: UserStore.to.profile.id, id: UserStore.to.profile.id,
...@@ -133,18 +136,18 @@ class PayListController extends GetxController { ...@@ -133,18 +136,18 @@ class PayListController extends GetxController {
await FlutterInappPurchase.instance.clearTransactionIOS(); await FlutterInappPurchase.instance.clearTransactionIOS();
EasyLoading.showError("${res?.message}}"); EasyLoading.showError("${res?.message}}");
state.loading = false; state.loading = false;
EasyLoading.dismiss();
Get.back();
Vibrate.feedback(FeedbackType.error); Vibrate.feedback(FeedbackType.error);
} }
}); });
_purchaseErrorSubscription = _purchaseErrorSubscription =
FlutterInappPurchase.purchaseError.listen((purchaseError) { FlutterInappPurchase.purchaseError.listen((purchaseError) {
// print('purchase-error: $purchaseError');
Vibrate.feedback(FeedbackType.error); Vibrate.feedback(FeedbackType.error);
EasyLoading.showError('支付订单失败'); Get.back();
EasyLoading.dismiss();
state.loading = false; state.loading = false;
EasyLoading.showError('支付订单失败');
}); });
} }
...@@ -177,13 +180,11 @@ class PayListController extends GetxController { ...@@ -177,13 +180,11 @@ class PayListController extends GetxController {
try { try {
List<IAPItem> items = List<IAPItem> items =
await FlutterInappPurchase.instance.getProducts(_productLists); await FlutterInappPurchase.instance.getProducts(_productLists);
final reversedItems = items.reversed;
state.items.addAll(items); state.items.addAll(reversedItems);
// for (var item in items) { // for (var item in items) {
// // print('${item.toString()}'); // state.items.add(item);
// // this._items.add(item);
// } // }
} catch (e) { } catch (e) {
print("_getProductError$e"); print("_getProductError$e");
} }
...@@ -193,7 +194,7 @@ class PayListController extends GetxController { ...@@ -193,7 +194,7 @@ class PayListController extends GetxController {
state.loading = true; state.loading = true;
Vibrate.feedback(FeedbackType.selection); Vibrate.feedback(FeedbackType.selection);
// print("${item.productId}"); // print("${item.productId}");
EasyLoading.show(status: '支付中...'); // EasyLoading.show(status: '支付中...');
// IAPItem item // IAPItem item
FlutterInappPurchase.instance.requestPurchase(state.selected); FlutterInappPurchase.instance.requestPurchase(state.selected);
} }
......
...@@ -7,7 +7,7 @@ class PayListState { ...@@ -7,7 +7,7 @@ class PayListState {
set title(value) => this._title.value = value; set title(value) => this._title.value = value;
get title => this._title.value; get title => this._title.value;
final _selected = "com.wudi.yearly_pass_chat".obs; final _selected = "com.wudi.app.prod_id_10".obs;
set selected(value) => _selected.value = value; set selected(value) => _selected.value = value;
get selected => _selected.value; get selected => _selected.value;
......
...@@ -3,6 +3,7 @@ import 'dart:math'; ...@@ -3,6 +3,7 @@ import 'dart:math';
import 'package:card_swiper/card_swiper.dart'; import 'package:card_swiper/card_swiper.dart';
import 'package:chart/common/routers/names.dart'; import 'package:chart/common/routers/names.dart';
import 'package:chart/common/store/user.dart'; import 'package:chart/common/store/user.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart'; import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
...@@ -199,7 +200,7 @@ class PayItemWidget extends GetView<PayListController> { ...@@ -199,7 +200,7 @@ class PayItemWidget extends GetView<PayListController> {
Obx( Obx(
() => Container( () => Container(
width: Get.width, width: Get.width,
height: 140, height: 160,
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: ListView( child: ListView(
// This next line does the trick. // This next line does the trick.
...@@ -217,10 +218,12 @@ class PayItemWidget extends GetView<PayListController> { ...@@ -217,10 +218,12 @@ class PayItemWidget extends GetView<PayListController> {
controller.state.selected = element.productId!; controller.state.selected = element.productId!;
}, },
child: Ink( child: Ink(
width: 120,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 15, vertical: 20), horizontal: 15, vertical: 20),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
// border: ,Color.argb(255, 62, 67, 95) // border: ,Color.argb(255, 62, 67, 95)
border: Border.all( border: Border.all(
width: 1, width: 1,
...@@ -252,6 +255,7 @@ class PayItemWidget extends GetView<PayListController> { ...@@ -252,6 +255,7 @@ class PayItemWidget extends GetView<PayListController> {
children: [ children: [
Text( Text(
element.title!, element.title!,
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: controller.state.selected == color: controller.state.selected ==
...@@ -563,6 +567,30 @@ class PayItemWidget extends GetView<PayListController> { ...@@ -563,6 +567,30 @@ class PayItemWidget extends GetView<PayListController> {
increaseHeightBy: 10.00, increaseHeightBy: 10.00,
increaseWidthBy: Get.width * .7, increaseWidthBy: Get.width * .7,
callback: () { callback: () {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return Center(
child: Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Colors.black.withAlpha(135),
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
CupertinoActivityIndicator(radius: 16.00),
Text("支付中...")
],
)),
);
},
);
controller.requestPurchase(); controller.requestPurchase();
}, },
isEnabled: !controller.state.loading, isEnabled: !controller.state.loading,
......
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart'; import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart'; import 'package:sign_in_with_apple/sign_in_with_apple.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
...@@ -11,8 +12,9 @@ import 'package:chart/common/utils/utils.dart'; ...@@ -11,8 +12,9 @@ import 'package:chart/common/utils/utils.dart';
import 'package:chart/common/widgets/widgets.dart'; import 'package:chart/common/widgets/widgets.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:social_login_buttons/social_login_buttons.dart'; import 'package:social_login_buttons/social_login_buttons.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
// import 'package:fluwx/fluwx.dart';
import '../../../entity/login_entity.dart'; import '../../../entity/login_entity.dart';
import '../../../entity/user_entity.dart'; import '../../../entity/user_entity.dart';
...@@ -22,13 +24,14 @@ class SignInController extends GetxController { ...@@ -22,13 +24,14 @@ class SignInController extends GetxController {
final state = SignInState(); final state = SignInState();
SignInController(); SignInController();
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
RxBool showClear = false.obs; RxBool showClear = false.obs;
RxBool codeEnable = false.obs; RxBool codeEnable = false.obs;
RxBool checkBox = false.obs; RxBool checkBox = false.obs;
RxBool loginBtnEable = false.obs; RxBool loginBtnEable = false.obs;
RxString codeTileStr = "获取验证码".obs; RxString codeTileStr = "获取验证码".obs;
final smsLoading = false.obs;
// 隐私政策是否勾选 // 隐私政策是否勾选
RxBool privactChecked = false.obs; RxBool privactChecked = false.obs;
...@@ -72,10 +75,10 @@ class SignInController extends GetxController { ...@@ -72,10 +75,10 @@ class SignInController extends GetxController {
// 执行登录操作 // 执行登录操作
handleSignIn() async { handleSignIn() async {
if (Platform.isAndroid && privactChecked == false) { // if (Platform.isAndroid && privactChecked == false) {
EasyLoading.showToast("请阅读并同意《用户协议》《隐私政策》"); // EasyLoading.showToast("请阅读并同意《用户协议》《隐私政策》");
return; // return;
} // }
if (!GetUtils.isPhoneNumber(mobileMemberController.text)) { if (!GetUtils.isPhoneNumber(mobileMemberController.text)) {
EasyLoading.showToast("请输入手机号"); EasyLoading.showToast("请输入手机号");
return; return;
...@@ -154,6 +157,43 @@ class SignInController extends GetxController { ...@@ -154,6 +157,43 @@ class SignInController extends GetxController {
// } // }
} }
handleTouristsLogin() async {
EasyLoading.show(status: '登录中...');
// Map<String, dynamic> routeParams =
// ModalRoute.of(context)!.settings?.arguments as Map<String, dynamic>;
// final DateTime expireTime;
// final int integral;
try {
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
final res = await UserAPI.appleLogin({
"phone": iosInfo.data['identifierForVendor'],
});
// LoginEntity? res = await UserAPI.login({
// "smsCode": codeController.text,
// "phone": mobileMemberController.text,
// // "id": UserStore.to.profile.id,
// });
Vibrate.feedback(FeedbackType.success);
EasyLoading.showSuccess("登录成功");
EasyLoading.dismiss();
UserStore.to.handleLogin(IntegralEntity(
id: res.id,
username: res.username,
token: res.token,
expireTime: res.expireTime,
integral: res.integral));
// appLogin
} catch (e) {
Vibrate.feedback(FeedbackType.error);
EasyLoading.showError("登录失败");
EasyLoading.dismiss();
}
}
setLoginBtnStatus() { setLoginBtnStatus() {
if (mobileMemberController.text.length >= 3) { if (mobileMemberController.text.length >= 3) {
loginBtnEable.value = true; loginBtnEable.value = true;
...@@ -184,46 +224,63 @@ class SignInController extends GetxController { ...@@ -184,46 +224,63 @@ class SignInController extends GetxController {
_cancelTimer(); _cancelTimer();
_seconds = 60; _seconds = 60;
verifyStr.value = '重新发送'; verifyStr.value = '重新发送';
codeEnable.value = true; codeEnable.value = false;
codeTileStr.value = "重新发送验证码"; codeTileStr.value = "重新发送验证码";
return; return;
} else {
verifyStr.value = '已发送$_seconds' + 's';
codeTileStr.value = "${_seconds}s后重试";
codeEnable.value = true;
_seconds--;
} }
verifyStr.value = '已发送$_seconds' + 's';
codeTileStr.value = "${_seconds}s后重试";
codeEnable.value = false;
_seconds--;
}); });
} }
chageCodeStatus() async { sendSms() async {
if (!mobileMemberController.text.isNotEmpty) { try {
EasyLoading.showToast('请先输入手机号'); startTimer();
return; await UserAPI.sendSms({"phone": mobileMemberController.text});
} Get.back();
if (codeEnable.value == false) { EasyLoading.showToast('验证码发送成功,请注意查收',
EasyLoading.show(status: "验证码发送太过频繁,请稍后再试"); maskType: EasyLoadingMaskType.none);
return; } catch (e) {
} finally {
smsLoading.value = false;
} }
if (codeEnable.value) { }
EasyLoading.show(status: "发送验证码中");
MsmEntity? res =
await UserAPI.sendSms({"phone": mobileMemberController.text});
EasyLoading.dismiss();
if (res.status == 200) { chageCodeStatus() async {
EasyLoading.showToast('验证码发送成功,请注意查收'); sendSms();
startTimer();
} else {
EasyLoading.showToast(res.message);
}
// MsmEntity? res = await UserService().sendSms({"phone": phone}); // if (codeEnable.value == false) {
} else if (!chinaPhoneNumber(mobileMemberController.text)) { // EasyLoading.show(status: "验证码发送太过频繁,请稍后再试");
EasyLoading.showToast("手机号输入有误"); // EasyLoading.dismiss();
// EasyLoading.show(status: "手机号输入有误"); // return;
} else { // }
EasyLoading.showToast("验证码已发送"); // if (codeEnable.value) {
} // try {
// EasyLoading.show(status: "发送验证码中");
// smsLoading.value = true;
// MsmEntity? res =
// await UserAPI.sendSms({"phone": mobileMemberController.text});
// EasyLoading.dismiss();
// if (res.status == 200) {
// EasyLoading.showToast('验证码发送成功,请注意查收');
// startTimer();
// } else {
// EasyLoading.showToast(res.message);
// }
// } finally {
// smsLoading.value = false;
// }
// // MsmEntity? res = await UserService().sendSms({"phone": phone});
// } else if (!chinaPhoneNumber(mobileMemberController.text)) {
// EasyLoading.showToast("手机号输入有误");
// // EasyLoading.show(status: "手机号输入有误");
// } else {
// EasyLoading.showToast("验证码已发送");
// }
} }
bool chinaPhoneNumber(String input) { bool chinaPhoneNumber(String input) {
...@@ -303,15 +360,15 @@ class SignInController extends GetxController { ...@@ -303,15 +360,15 @@ class SignInController extends GetxController {
@override @override
void onReady() { void onReady() {
super.onReady(); super.onReady();
mobileMemberController.addListener(() { // mobileMemberController.addListener(() {
showClear.value = mobileMemberController.text.isNotEmpty; // showClear.value = mobileMemberController.text.isNotEmpty;
codeEnable.value = chinaPhoneNumber(mobileMemberController.text); // codeEnable.value = chinaPhoneNumber(mobileMemberController.text);
setLoginBtnStatus(); // setLoginBtnStatus();
}); // });
codeController.addListener(() { // codeController.addListener(() {
setLoginBtnStatus(); // setLoginBtnStatus();
}); // });
initPlatformState(); // initPlatformState();
} }
@override @override
......
This diff is collapsed.
...@@ -18,7 +18,7 @@ class WelcomeController extends GetxController { ...@@ -18,7 +18,7 @@ class WelcomeController extends GetxController {
// 跳转 注册界面 // 跳转 注册界面
handleHome() async { handleHome() async {
await UserStore.to.refreshInfo(); // await UserStore.to.refreshInfo();
await ConfigStore.to.saveAlreadyOpen(); await ConfigStore.to.saveAlreadyOpen();
// ApplicationController.to.state.isNetWorkErr = false; // ApplicationController.to.state.isNetWorkErr = false;
Get.offAndToNamed(AppRoutes.Application); Get.offAndToNamed(AppRoutes.Application);
......
...@@ -81,7 +81,8 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin { ...@@ -81,7 +81,8 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin {
/// 右上角分享管理相关菜单 /// 右上角分享管理相关菜单
List<Widget> topRightBarMenus() { List<Widget> topRightBarMenus() {
/// 选中数据不为空 或者 展示选择菜单右侧即显示 分享相关控制 /// 选中数据不为空 或者 展示选择菜单右侧即显示 分享相关控制
return (selectedItems.isEmpty == true && chatRowCheckRadioShowed.value == false) return (selectedItems.isEmpty == true &&
chatRowCheckRadioShowed.value == false)
? [ ? [
RotationTransition( RotationTransition(
turns: animation, turns: animation,
...@@ -455,7 +456,9 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin { ...@@ -455,7 +456,9 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin {
//只有Android才会存在登录情况 //只有Android才会存在登录情况
if (GetPlatform.isAndroid) { if (GetPlatform.isAndroid) {
var rev = await Get.toNamed(AppRoutes.SIGN_IN); var rev = await Get.toNamed(AppRoutes.SIGN_IN);
print(rev); } else {
EasyLoading.showInfo("请先登录");
await Get.toNamed(AppRoutes.SIGN_IN);
} }
} else { } else {
if (GetPlatform.isAndroid) { if (GetPlatform.isAndroid) {
...@@ -517,15 +520,15 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin { ...@@ -517,15 +520,15 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin {
), ),
// ItemModel('收藏', Icons.collections), // ItemModel('收藏', Icons.collections),
// ItemModel('删除', Icons.delete), // ItemModel('删除', Icons.delete),
ItemModel('多选', Icons.playlist_add_check, (message, controller) { // ItemModel('多选', Icons.playlist_add_check, (message, controller) {
state.messageList.forEach((element) { // state.messageList.forEach((element) {
element.showMenu = true; // element.showMenu = true;
}); // });
state.messageList // state.messageList
.replaceRange(0, state.messageList.length - 1, state.messageList); // .replaceRange(0, state.messageList.length - 1, state.messageList);
controller.hideMenu(); // controller.hideMenu();
chatRowCheckRadioShowed.value = true; // chatRowCheckRadioShowed.value = true;
}), // }),
// ItemModel('引用', Icons.format_quote), // ItemModel('引用', Icons.format_quote),
// ItemModel('提醒', Icons.add_alert), // ItemModel('提醒', Icons.add_alert),
// ItemModel('搜一搜', Icons.search), // ItemModel('搜一搜', Icons.search),
...@@ -574,7 +577,7 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin { ...@@ -574,7 +577,7 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin {
margin: EdgeInsets.only(top: 2), margin: EdgeInsets.only(top: 2),
child: Text( child: Text(
item.title, item.title,
style: TextStyle(color: Colors.white, fontSize: 12), style: TextStyle(color: Colors.white, fontSize: 8),
), ),
), ),
], ],
...@@ -632,11 +635,27 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin { ...@@ -632,11 +635,27 @@ class HomeController extends GetxController with SingleGetTickerProviderMixin {
tabMessage(ChatMessage message) { tabMessage(ChatMessage message) {
if (message.user.id == '0' && !state.isLoading) { if (message.user.id == '0' && !state.isLoading) {
sendMessage(Chat.ChatMessage( final textMessage = Chat.ChatMessage(
text: "${message.text}",
user: _user, user: _user,
createdAt: DateTime.now(), createdAt: DateTime.now(),
)); // id: const Uuid().v4(),
text: "${message.text}",
);
_addMessage(textMessage);
final receiveMessage = Chat.ChatMessage(
user: receiveUser,
createdAt: DateTime.now(),
status: MessageStatus.pending,
// id: const Uuid().v4(),
text: message.customProperties!['question'],
);
_addMessage(receiveMessage);
// sendMessage(Chat.ChatMessage(
// text: "${message.text}",
// user: _user,
// createdAt: DateTime.now(),
// ));
} }
// Clipboard.setData(ClipboardData(text: message?.text)); // Clipboard.setData(ClipboardData(text: message?.text));
// EasyLoading.showSuccess("复制成功"); // EasyLoading.showSuccess("复制成功");
......
...@@ -19,43 +19,145 @@ class ChatPageState { ...@@ -19,43 +19,145 @@ class ChatPageState {
createdAt: DateTime.now(), createdAt: DateTime.now(),
// id: const Uuid().v4(), // id: const Uuid().v4(),
text: "【有志者,事竟成】用英文怎么说", text: "【有志者,事竟成】用英文怎么说",
customProperties: {"title": '语言翻译', 'icon': 'a'}), customProperties: {
"title": '语言翻译',
'icon': 'a',
'question': """
Where there's a will, there's a way.
"""
}),
Chat.ChatMessage( Chat.ChatMessage(
user: _userPlaceHolder, user: _userPlaceHolder,
createdAt: DateTime.now(), createdAt: DateTime.now(),
// id: const Uuid().v4(), // id: const Uuid().v4(),
text: "请帮我列出双色球的预测方法?", text: "请帮我列出双色球的预测方法?",
customProperties: {"title": '难题破解', 'icon': 'a'}), customProperties: {
"title": '难题破解',
'icon': 'a',
"question":
'很抱歉,作为AI语言模型,我不能提供双色球的预测方法。彩票的结果是随机的,没有任何方法可以准确地预测彩票号码。请记住,购买彩票应该是一种娱乐方式,而不是一种赚钱的方法。请理性购彩,不要过度投注。'
}),
Chat.ChatMessage( Chat.ChatMessage(
user: _userPlaceHolder, user: _userPlaceHolder,
createdAt: DateTime.now(), createdAt: DateTime.now(),
// id: const Uuid().v4(), // id: const Uuid().v4(),
text: "外星人真实存在吗?", text: "外星人真实存在吗?",
customProperties: {"title": '宇宙奥义', 'icon': 'a'}), customProperties: {
"title": '宇宙奥义',
'icon': 'a',
'question':
"作为AI语言模型,我不能确定外星人是否真实存在,因为目前还没有确凿的证据证明外星人的存在。然而,科学家们一直在寻找外星生命的迹象,并且在宇宙中发现了一些可能存在生命的地方。但是,我们需要更多的研究和证据来确定外星生命是否真的存在。"
}),
Chat.ChatMessage( Chat.ChatMessage(
user: _userPlaceHolder, user: _userPlaceHolder,
createdAt: DateTime.now(), createdAt: DateTime.now(),
// id: const Uuid().v4(), // id: const Uuid().v4(),
text: "三星堆文化来自何方?", text: "三星堆文化来自何方?",
customProperties: {"title": '历史谜题', 'icon': 'a'}), customProperties: {
"title": '历史谜题',
'icon': 'a',
"question": """
三星堆文化是中国古代文明之一,起源于四川省广汉市三星堆遗址。该文化的发现和研究始于20世纪80年代,是中国考古学的一项重大发现。
根据考古学家的研究,三星堆文化的起源可以追溯到公元前约1600年至公元前1046年的商朝晚期至西周早期。该文化的主要特征是青铜器制作技术高超,同时还有大量的玉器、陶器和石器等文物出土。此外,三星堆文化还有独特的祭祀和宗教信仰,如青铜人像、神树、神兽等。
至于三星堆文化的来源和发展,目前还没有确切的答案。有学者认为,三星堆文化可能是由多个地区的文化相互影响和融合而成的,也有学者认为,三星堆文化可能是由外来移民带来的。不过,这些都需要更多的考古和研究来证实。
"""
}),
Chat.ChatMessage( Chat.ChatMessage(
user: _userPlaceHolder, user: _userPlaceHolder,
createdAt: DateTime.now(), createdAt: DateTime.now(),
// id: const Uuid().v4(), // id: const Uuid().v4(),
text: "若xy-x+y=0,且xy>0,则1/x-1/y的值为多少?", text: "若xy-x+y=0,且xy>0,则1/x-1/y的值为多少?",
customProperties: {"title": '学习工作', 'icon': 'a'}), customProperties: {
"title": '学习工作',
'icon': 'a',
'question': """
我们可以将xy-x+y=0变形为 (x+1)(y-1)=1,因为xy>0,所以x和y的符号相同。
假设x和y都是正数,则有:
(x+1)(y-1)=1
y-1=1/(x+1)
y=1/(x+1)+1
将y代入原方程得:
x(1/(x+1)+1)-1/(x+1)-1=0
x/(x+1)+x-1/(x+1)-1=0
x/(x+1)-1/(x+1)+x-1=0
(x-1)/(x+1)+x-1=0
(x-1)+(x-1)^2=0
(x-1)(x+2)=0
因为x>0,所以x=1,y=2。
因此,1/x-1/y=1/1-1/2=1/2。
因此,1/x-1/y的值为1/2。
"""
}),
Chat.ChatMessage( Chat.ChatMessage(
user: _userPlaceHolder, user: _userPlaceHolder,
createdAt: DateTime.now(), createdAt: DateTime.now(),
// id: const Uuid().v4(), // id: const Uuid().v4(),
text: "怎么做辣椒炒肉?", text: "怎么做辣椒炒肉?",
customProperties: {"title": '美食烹饪', 'icon': 'a'}), customProperties: {
"title": '美食烹饪',
'icon': 'a',
"question": """
辣椒炒肉是一道非常常见的中式家常菜,下面是一份简单易学的辣椒炒肉的做法:
所需材料:
瘦猪肉(切成小块):250克
青红辣椒(切成小段):适量
姜蒜末:适量
料酒:适量
生抽:适量
盐:适量
糖:适量
淀粉:适量
食用油:适量
步骤:
将瘦猪肉切成小块,加入料酒、生抽、盐、糖和淀粉,搅拌均匀腌制10分钟。
热锅凉油,加入腌制好的猪肉块煸炒至变色,盛出备用。
锅中留底油,加入姜蒜末和青红辣椒段煸炒出香味。
将煸炒好的猪肉块倒入锅中,继续翻炒均匀。
最后加入少量盐和糖调味,翻炒均匀即可。
辣椒炒肉的口感香辣可口,适合搭配米饭食用。如果你喜欢更辣的口味,可以根据个人口味加入更多的辣椒。
"""
}),
Chat.ChatMessage( Chat.ChatMessage(
user: _userPlaceHolder, user: _userPlaceHolder,
createdAt: DateTime.now(), createdAt: DateTime.now(),
// id: const Uuid().v4(), // id: const Uuid().v4(),
text: "身高180cm,体重180斤,那么BMI值是多少?", text: "身高180cm,体重180斤,那么BMI值是多少?",
customProperties: {"title": '健康养身', 'icon': 'a'}) customProperties: {
"title": '健康养身',
'icon': 'a',
"question": """
BMI(Body Mass Index,身体质量指数)是衡量一个人体重与身高之间关系的指标。计算公式为:BMI = 体重(kg)/身高(m)的平方。
首先,将身高从厘米转换为米,即180cm=1.8m。
其次,将体重从斤转换为千克,即180斤=90公斤。
最后,代入公式计算BMI值:
BMI = 90 / (1.8 x 1.8) ≈ 27.8
因此,身高180cm,体重180斤的人的BMI值约为27.8,属于超重范畴。
"""
})
].obs; ].obs;
// get _messageList => // get _messageList =>
......
import 'dart:io'; import 'dart:io';
import 'package:chart/pages/my/widgets/share.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:fluwx/fluwx.dart';
import 'package:share_plus/share_plus.dart';
import '../../common/routers/names.dart'; import '../../common/routers/names.dart';
import 'package:fluwx/fluwx.dart' as fluwx;
class MyController extends GetxController { class MyController extends GetxController {
MyController(); MyController();
...@@ -11,6 +14,61 @@ class MyController extends GetxController { ...@@ -11,6 +14,61 @@ class MyController extends GetxController {
update(["my"]); update(["my"]);
} }
dynamic getShareModel(ShareType shareType, ShareInfo shareInfo) {
var scene = fluwx.WeChatScene.SESSION;
switch (shareType) {
case ShareType.SESSION:
scene = fluwx.WeChatScene.SESSION;
break;
case ShareType.TIMELINE:
scene = fluwx.WeChatScene.TIMELINE;
break;
case ShareType.COPY_LINK:
break;
case ShareType.DOWNLOAD:
break;
}
if (shareInfo.img != null) {
return fluwx.WeChatShareWebPageModel(
shareInfo.url,
title: shareInfo.title,
thumbnail: fluwx.WeChatImage.network(shareInfo.img),
scene: scene,
);
} else {
return fluwx.WeChatShareWebPageModel(
shareInfo.url,
title: shareInfo.title,
scene: scene,
);
}
}
_initFluwx() async {
await registerWxApi(
appId: 'wxac6457d4b052cc48',
doOnAndroid: true,
doOnIOS: true,
universalLink: 'https://order.1clickpass.com/app/',
);
var result = await isWeChatInstalled;
print('is installed $result');
}
handleToWx() async {
await fluwx.openWeChatCustomerServiceChat(
url: "https://work.weixin.qq.com/kfid/kfc4e77a401df6f7d09",
corpId: "wwe816b5b616eaf0f3");
// fluwx.shareToWeChat(
// WeChatShareTextModel("source text", scene: WeChatScene.TIMELINE));
}
handleShare() async {
await Share.shareWithResult(
'https://apps.apple.com/cn/app/ai%E5%86%99%E4%BD%9C%E5%A4%A7%E5%B8%88/id1671136252');
}
void onTap() {} void onTap() {}
// @override // @override
...@@ -22,6 +80,7 @@ class MyController extends GetxController { ...@@ -22,6 +80,7 @@ class MyController extends GetxController {
void onReady() { void onReady() {
super.onReady(); super.onReady();
_initData(); _initData();
_initFluwx();
} }
// @override // @override
......
This diff is collapsed.
import 'package:flutter/material.dart';
/// 点击事件
typedef OnItemClickListener = void Function(int index);
typedef DoAction = void Function(ShareType shareType, ShareInfo shareInfo);
enum ShareType { SESSION, TIMELINE, COPY_LINK, DOWNLOAD }
/// 定义分享内容
class ShareInfo {
/// 标题
String title;
/// 连接
String url;
/// 图片
var img;
/// 描述
String describe;
ShareInfo(this.title, this.url, {this.img, this.describe = ""});
static ShareInfo fromJson(Map map) {
return ShareInfo(map['title'], map['url'],
img: map['img'], describe: map['describe']);
}
}
/// 分享操作
class ShareOpt {
final String title;
final String img;
final DoAction doAction;
final ShareType shareType;
const ShareOpt(
{this.title = "",
this.img = "",
this.shareType = ShareType.SESSION,
required this.doAction});
}
/// 弹出窗
class ShareWidget extends StatefulWidget {
final List<ShareOpt> list;
final ShareInfo shareInfo;
const ShareWidget(this.shareInfo, {Key? key, required this.list})
: super(key: key);
@override
_ShareWidgetState createState() => _ShareWidgetState();
}
class _ShareWidgetState extends State<ShareWidget> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
height: 170,
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(
left: 10,
right: 10,
),
//边框设置
decoration: BoxDecoration(
//背景
color: Colors.white,
//设置四周边框
border: Border.all(
width: 1,
color: Colors.white,
),
//设置四周圆角角度
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
//设置 child 居中
alignment: Alignment.center,
height: 100.0,
child: Padding(
padding: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 0.0),
child: new Container(
height: 100.0,
child: new GridView.builder(
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
mainAxisSpacing: 5.0,
childAspectRatio: 1.0),
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
behavior: HitTestBehavior.opaque, // 空白地方也可以点击
onTap: () {
Navigator.pop(context);
widget.list[index].doAction(
widget.list[index].shareType, widget.shareInfo);
},
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.fromLTRB(0.0, 6.0, 0.0, 6.0),
child: new Image.asset(
widget.list[index].img,
width: 50.0,
height: 50.0,
fit: BoxFit.fill,
),
),
Text(widget.list[index].title)
],
),
);
},
itemCount: widget.list.length,
),
),
),
),
Container(
margin: EdgeInsets.only(
left: 10,
right: 10,
top: 10,
bottom: 10,
),
//边框设置
decoration: BoxDecoration(
//背景
color: Colors.white,
//设置四周边框
border: Border.all(
width: 1,
color: Colors.white,
),
//设置四周圆角角度
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
//设置 child 居中
alignment: Alignment.center,
height: 50.0,
child: GestureDetector(
onTap: () => Navigator.pop(context),
behavior: HitTestBehavior.opaque,
// 在空白的范围内就都可以点击,否则只有点击children里的text 或者image才有效果
child: Center(
child: new Padding(
padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),
child: const Text(
'取消',
),
),
),
),
),
],
),
);
}
}
...@@ -50,6 +50,7 @@ class PrivacyPage extends GetView<PrivacyController> { ...@@ -50,6 +50,7 @@ class PrivacyPage extends GetView<PrivacyController> {
builder: (_) { builder: (_) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Color.fromARGB(255, 30, 34, 61),
leading: IconButton( leading: IconButton(
tooltip: '返回上一页', tooltip: '返回上一页',
icon: const Icon( icon: const Icon(
......
...@@ -26,6 +26,16 @@ class _NewsPageListState extends State<NewsPageList> ...@@ -26,6 +26,16 @@ class _NewsPageListState extends State<NewsPageList>
return GetX<UserDetailController>( return GetX<UserDetailController>(
init: controller, init: controller,
builder: (controller) => SmartRefresher( builder: (controller) => SmartRefresher(
header: ClassicHeader(
releaseText: "松开刷新",
refreshingText: "刷新数据中",
completeText: "刷新数据成功",
idleText: "下拉刷新"),
footer: ClassicFooter(
loadingText: "正在加载中...",
// loadStyle: LoadStyle.ShowWhenLoading,
// completeDuration: Duration(milliseconds: 500),
noDataText: '没有更多数据啦'),
enablePullUp: true, enablePullUp: true,
controller: controller.refreshController, controller: controller.refreshController,
onRefresh: controller.onRefresh, onRefresh: controller.onRefresh,
......
This diff is collapsed.
...@@ -128,9 +128,10 @@ dependencies: ...@@ -128,9 +128,10 @@ dependencies:
speech_to_text: ^6.1.1 speech_to_text: ^6.1.1
flutter_persistent_keyboard_height: ^1.0.5 flutter_persistent_keyboard_height: ^1.0.5
bruno: ^3.3.0 bruno: ^3.3.0
keyboard_actions: ^4.2.0
sqflite: ^2.2.7
fluwx: ^3.13.1
flutter_native_splash: ^2.2.19
# package:bubble/bubble.dart # package:bubble/bubble.dart
dev_dependencies: dev_dependencies:
...@@ -200,3 +201,142 @@ flutter: ...@@ -200,3 +201,142 @@ flutter:
# #
# For details regarding fonts from package dependencies, # For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages # see https://flutter.dev/custom-fonts/#from-packages
flutter_native_splash:
# This package generates native code to customize Flutter's default white native splash screen
# with background color and splash image.
# Customize the parameters below, and run the following command in the terminal:
# flutter pub run flutter_native_splash:create
# To restore Flutter's default white splash screen, run the following command in the terminal:
# flutter pub run flutter_native_splash:remove
# color or background_image is the only required parameter. Use color to set the background
# of your splash screen to a solid color. Use background_image to set the background of your
# splash screen to a png image. This is useful for gradients. The image will be stretch to the
# size of the app. Only one parameter can be used, color and background_image cannot both be set.
color: "#e1f5fe"
#background_image: "assets/background.png"
# Optional parameters are listed below. To enable a parameter, uncomment the line by removing
# the leading # character.
# The image parameter allows you to specify an image used in the splash screen. It must be a
# png file and should be sized for 4x pixel density.
image: assets/images/logo_icon.png
# The branding property allows you to specify an image used as branding in the splash screen.
# It must be a png file. It is supported for Android, iOS and the Web. For Android 12,
# see the Android 12 section below.
#branding: assets/dart.png
# To position the branding image at the bottom of the screen you can use bottom, bottomRight,
# and bottomLeft. The default values is bottom if not specified or specified something else.
#branding_mode: bottom
# The color_dark, background_image_dark, image_dark, branding_dark are parameters that set the background
# and image when the device is in dark mode. If they are not specified, the app will use the
# parameters from above. If the image_dark parameter is specified, color_dark or
# background_image_dark must be specified. color_dark and background_image_dark cannot both be
# set.
color_dark: "#042a49"
#background_image_dark: "assets/dark-background.png"
image_dark: assets/images/logo_icon.png
#branding_dark: assets/dart_dark.png
# Android 12 handles the splash screen differently than previous versions. Please visit
# https://developer.android.com/guide/topics/ui/splash-screen
# Following are Android 12 specific parameter.
android_12:
# The image parameter sets the splash screen icon image. If this parameter is not specified,
# the app's launcher icon will be used instead.
# Please note that the splash screen will be clipped to a circle on the center of the screen.
# App icon with an icon background: This should be 960×960 pixels, and fit within a circle
# 640 pixels in diameter.
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
# 768 pixels in diameter.
image: assets/images/logo_icon.png
# Splash screen background color.
color: "#42a5f5"
# App icon background color.
icon_background_color: "#eeeeee"
# The branding property allows you to specify an image used as branding in the splash screen.
#branding: assets/dart.png
# The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that
# apply when the device is in dark mode. If they are not specified, the app will use the
# parameters from above.
#image_dark: assets/android12splash-invert.png
#color_dark: "#042a49"
#icon_background_color_dark: "#111111"
# The android, ios and web parameters can be used to disable generating a splash screen on a given
# platform.
#android: false
#ios: false
#web: false
# Platform specific images can be specified with the following parameters, which will override
# the respective parameter. You may specify all, selected, or none of these parameters:
#color_android: "#42a5f5"
#color_dark_android: "#042a49"
#color_ios: "#42a5f5"
#color_dark_ios: "#042a49"
#color_web: "#42a5f5"
#color_dark_web: "#042a49"
#image_android: assets/splash-android.png
#image_dark_android: assets/splash-invert-android.png
#image_ios: assets/splash-ios.png
#image_dark_ios: assets/splash-invert-ios.png
#image_web: assets/splash-web.png
#image_dark_web: assets/splash-invert-web.png
#background_image_android: "assets/background-android.png"
#background_image_dark_android: "assets/dark-background-android.png"
#background_image_ios: "assets/background-ios.png"
#background_image_dark_ios: "assets/dark-background-ios.png"
#background_image_web: "assets/background-web.png"
#background_image_dark_web: "assets/dark-background-web.png"
#branding_android: assets/brand-android.png
#branding_dark_android: assets/dart_dark-android.png
#branding_ios: assets/brand-ios.png
#branding_dark_ios: assets/dart_dark-ios.png
# The position of the splash image can be set with android_gravity, ios_content_mode, and
# web_image_mode parameters. All default to center.
#
# android_gravity can be one of the following Android Gravity (see
# https://developer.android.com/reference/android/view/Gravity): bottom, center,
# center_horizontal, center_vertical, clip_horizontal, clip_vertical, end, fill, fill_horizontal,
# fill_vertical, left, right, start, or top.
#android_gravity: center
#
# ios_content_mode can be one of the following iOS UIView.ContentMode (see
# https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill,
# scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight,
# bottomLeft, or bottomRight.
#ios_content_mode: center
#
# web_image_mode can be one of the following modes: center, contain, stretch, and cover.
#web_image_mode: center
# The screen orientation can be set in Android with the android_screen_orientation parameter.
# Valid parameters can be found here:
# https://developer.android.com/guide/topics/manifest/activity-element#screen
#android_screen_orientation: sensorLandscape
# To hide the notification bar, use the fullscreen parameter. Has no effect in web since web
# has no notification bar. Defaults to false.
# NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads.
# To show the notification bar, add the following code to your Flutter app:
# WidgetsFlutterBinding.ensureInitialized();
# SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);
fullscreen: true
# If you have changed the name(s) of your info.plist file(s), you can specify the filename(s)
# with the info_plist_files parameter. Remove only the # characters in the three lines below,
# do not remove any spaces:
#info_plist_files:
# - 'ios/Runner/Info-Debug.plist'
# - 'ios/Runner/Info-Release.plist'
\ No newline at end of file
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