|
@@ -56,12 +56,12 @@ import 'dart:typed_data'; |
|
@@ -56,12 +56,12 @@ import 'dart:typed_data'; |
|
56
|
typedef BookTimeSetCallback = void Function(bool needChange);
|
56
|
typedef BookTimeSetCallback = void Function(bool needChange);
|
|
57
|
|
57
|
|
|
58
|
class Utils {
|
58
|
class Utils {
|
|
59
|
- static Future<bool> isImageLargerThan64KB(Uint8List? imageBytes) async {
|
59
|
+ static Future<bool> isImageLargerThan120KB(Uint8List? imageBytes) async {
|
|
60
|
if (imageBytes == null) {
|
60
|
if (imageBytes == null) {
|
|
61
|
return false;
|
61
|
return false;
|
|
62
|
}
|
62
|
}
|
|
63
|
var fileSize = imageBytes.lengthInBytes;
|
63
|
var fileSize = imageBytes.lengthInBytes;
|
|
64
|
- return fileSize > 64 * 1024; // 64KB = 64 * 1024 bytes
|
64
|
+ return fileSize > 120 * 1024; // 64KB = 120 * 1024 bytes
|
|
65
|
}
|
65
|
}
|
|
66
|
|
66
|
|
|
67
|
static List<CallLogEntry> removeDuplicates(List<CallLogEntry> items) {
|
67
|
static List<CallLogEntry> removeDuplicates(List<CallLogEntry> items) {
|
|
@@ -1453,13 +1453,13 @@ class Utils { |
|
@@ -1453,13 +1453,13 @@ class Utils { |
|
1453
|
|
1453
|
|
|
1454
|
Fluwx fluwx = Fluwx();
|
1454
|
Fluwx fluwx = Fluwx();
|
|
1455
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
1455
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
1456
|
- Uint8List? result;
|
1456
|
+ Uint8List? result=pngByte;
|
|
1457
|
|
1457
|
|
|
1458
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
1458
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
1459
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
1459
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
1460
|
result = resultnew == null
|
1460
|
result = resultnew == null
|
|
1461
|
? null
|
1461
|
? null
|
|
1462
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
1462
|
+ : await compressImage(resultnew, mb: 120/ 1024);
|
|
1463
|
}
|
1463
|
}
|
|
1464
|
var model = new WeChatShareMiniProgramModel(
|
1464
|
var model = new WeChatShareMiniProgramModel(
|
|
1465
|
miniProgramType: Constant.wxMiniProgramType,
|
1465
|
miniProgramType: Constant.wxMiniProgramType,
|
|
@@ -1501,12 +1501,12 @@ class Utils { |
|
@@ -1501,12 +1501,12 @@ class Utils { |
|
1501
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
1501
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
|
1502
|
Fluwx fluwx = Fluwx();
|
1502
|
Fluwx fluwx = Fluwx();
|
|
1503
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
1503
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
1504
|
- Uint8List? result;
|
|
|
|
1505
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
1504
|
+ Uint8List? result=pngByte;
|
|
|
|
1505
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
1506
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
1506
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
1507
|
result = resultnew == null
|
1507
|
result = resultnew == null
|
|
1508
|
? null
|
1508
|
? null
|
|
1509
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
1509
|
+ : await compressImage(resultnew, mb: 120 / 1024);
|
|
1510
|
}
|
1510
|
}
|
|
1511
|
var model = new WeChatShareMiniProgramModel(
|
1511
|
var model = new WeChatShareMiniProgramModel(
|
|
1512
|
// miniProgramType: , //体验版
|
1512
|
// miniProgramType: , //体验版
|
|
@@ -1596,12 +1596,12 @@ class Utils { |
|
@@ -1596,12 +1596,12 @@ class Utils { |
|
1596
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
1596
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
|
1597
|
Fluwx fluwx = Fluwx();
|
1597
|
Fluwx fluwx = Fluwx();
|
|
1598
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
1598
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
1599
|
- Uint8List? result;
|
|
|
|
1600
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
1599
|
+ Uint8List? result=pngByte;
|
|
|
|
1600
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
1601
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
1601
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
1602
|
result = resultnew == null
|
1602
|
result = resultnew == null
|
|
1603
|
? null
|
1603
|
? null
|
|
1604
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
1604
|
+ : await compressImage(resultnew, mb: 120 / 1024);
|
|
1605
|
}
|
1605
|
}
|
|
1606
|
var model = new WeChatShareMiniProgramModel(
|
1606
|
var model = new WeChatShareMiniProgramModel(
|
|
1607
|
miniProgramType: Constant.wxMiniProgramType,
|
1607
|
miniProgramType: Constant.wxMiniProgramType,
|
|
@@ -2029,12 +2029,12 @@ class Utils { |
|
@@ -2029,12 +2029,12 @@ class Utils { |
|
2029
|
String _description = "诚邀您参加储值优惠活动,点击查看详情。";
|
2029
|
String _description = "诚邀您参加储值优惠活动,点击查看详情。";
|
|
2030
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
2030
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
|
2031
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
2031
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
2032
|
- Uint8List? result;
|
|
|
|
2033
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
2032
|
+ Uint8List? result=pngByte;
|
|
|
|
2033
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
2034
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
2034
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
2035
|
result = resultnew == null
|
2035
|
result = resultnew == null
|
|
2036
|
? null
|
2036
|
? null
|
|
2037
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
2037
|
+ : await compressImage(resultnew, mb: 120 / 1024);
|
|
2038
|
}
|
2038
|
}
|
|
2039
|
|
2039
|
|
|
2040
|
//跳转小程序
|
2040
|
//跳转小程序
|
|
@@ -2091,12 +2091,12 @@ class Utils { |
|
@@ -2091,12 +2091,12 @@ class Utils { |
|
2091
|
String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店";
|
2091
|
String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店";
|
|
2092
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
2092
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
|
2093
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
2093
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
2094
|
- Uint8List? result;
|
|
|
|
2095
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
2094
|
+ Uint8List? result = pngByte;
|
|
|
|
2095
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
2096
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
2096
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
2097
|
result = resultnew == null
|
2097
|
result = resultnew == null
|
|
2098
|
? null
|
2098
|
? null
|
|
2099
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
2099
|
+ : await compressImage(resultnew, mb: 120 / 1024);
|
|
2100
|
}
|
2100
|
}
|
|
2101
|
//跳转小程序
|
2101
|
//跳转小程序
|
|
2102
|
Fluwx fluwx = Fluwx();
|
2102
|
Fluwx fluwx = Fluwx();
|
|
@@ -2197,12 +2197,12 @@ class Utils { |
|
@@ -2197,12 +2197,12 @@ class Utils { |
|
2197
|
String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店";
|
2197
|
String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店";
|
|
2198
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
2198
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
|
2199
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
2199
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
2200
|
- Uint8List? result;
|
|
|
|
2201
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
2200
|
+ Uint8List? result = pngByte;
|
|
|
|
2201
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
2202
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
2202
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
2203
|
result = resultnew == null
|
2203
|
result = resultnew == null
|
|
2204
|
? null
|
2204
|
? null
|
|
2205
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
2205
|
+ : await compressImage(resultnew, mb: 120 / 1024);
|
|
2206
|
}
|
2206
|
}
|
|
2207
|
// print(result!.length/1024);
|
2207
|
// print(result!.length/1024);
|
|
2208
|
//跳转小程序
|
2208
|
//跳转小程序
|
|
@@ -2264,12 +2264,12 @@ class Utils { |
|
@@ -2264,12 +2264,12 @@ class Utils { |
|
2264
|
//跳转小程序
|
2264
|
//跳转小程序
|
|
2265
|
Fluwx fluwx = Fluwx();
|
2265
|
Fluwx fluwx = Fluwx();
|
|
2266
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
2266
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
2267
|
- Uint8List? result;
|
|
|
|
2268
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
2267
|
+ Uint8List? result = pngByte;
|
|
|
|
2268
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
2269
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
2269
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
2270
|
result = resultnew == null
|
2270
|
result = resultnew == null
|
|
2271
|
? null
|
2271
|
? null
|
|
2272
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
2272
|
+ : await compressImage(resultnew, mb: 120 / 1024);
|
|
2273
|
}
|
2273
|
}
|
|
2274
|
var model = new WeChatShareMiniProgramModel(
|
2274
|
var model = new WeChatShareMiniProgramModel(
|
|
2275
|
webPageUrl: _webPageUrl,
|
2275
|
webPageUrl: _webPageUrl,
|
|
@@ -3094,17 +3094,17 @@ class Utils { |
|
@@ -3094,17 +3094,17 @@ class Utils { |
|
3094
|
"pages/customer/detail_owner_invitation_new?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid&paymentId=$depositId";
|
3094
|
"pages/customer/detail_owner_invitation_new?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid&paymentId=$depositId";
|
|
3095
|
}
|
3095
|
}
|
|
3096
|
Fluwx fluwx = Fluwx();
|
3096
|
Fluwx fluwx = Fluwx();
|
|
3097
|
- Uint8List? result;
|
|
|
|
3098
|
- if (liteStyle == '0') {
|
|
|
|
3099
|
- Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
|
|
3100
|
-
|
|
|
|
3101
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
|
|
|
3102
|
- Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
|
|
3103
|
- result = resultnew == null
|
|
|
|
3104
|
- ? null
|
|
|
|
3105
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
|
|
|
3106
|
- }
|
3097
|
+ Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
|
|
3098
|
+ Uint8List? result = pngByte;
|
|
|
|
3099
|
+ // if (liteStyle == '0') {
|
|
|
|
3100
|
+
|
|
|
|
3101
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
|
|
3102
|
+ Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
|
|
3103
|
+ result = resultnew == null
|
|
|
|
3104
|
+ ? null
|
|
|
|
3105
|
+ : await compressImage(resultnew, mb: 120 / 1024);
|
|
3107
|
}
|
3106
|
}
|
|
|
|
3107
|
+ // }
|
|
3108
|
|
3108
|
|
|
3109
|
var model = new WeChatShareMiniProgramModel(
|
3109
|
var model = new WeChatShareMiniProgramModel(
|
|
3110
|
webPageUrl: _webPageUrl,
|
3110
|
webPageUrl: _webPageUrl,
|
|
@@ -3200,7 +3200,7 @@ class Utils { |
|
@@ -3200,7 +3200,7 @@ class Utils { |
|
3200
|
String _thumbnail = sellerImage == null || sellerImage == ''
|
3200
|
String _thumbnail = sellerImage == null || sellerImage == ''
|
|
3201
|
? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
|
3201
|
? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
|
|
3202
|
: sellerImage;
|
3202
|
: sellerImage;
|
|
3203
|
- late Uint8List _thumbnailUint8List;
|
3203
|
+ late Uint8List? _thumbnailUint8List;
|
|
3204
|
print(size(_thumbnail.length));
|
3204
|
print(size(_thumbnail.length));
|
|
3205
|
|
3205
|
|
|
3206
|
String dsoltStr = '${ddateHm == null || ddateHm == '' ? '' : ddateHm}';
|
3206
|
String dsoltStr = '${ddateHm == null || ddateHm == '' ? '' : ddateHm}';
|
|
@@ -3280,15 +3280,15 @@ class Utils { |
|
@@ -3280,15 +3280,15 @@ class Utils { |
|
3280
|
"pages/customer/detail_owner_invitation_new?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid&paymentId=$depositId";
|
3280
|
"pages/customer/detail_owner_invitation_new?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid&paymentId=$depositId";
|
|
3281
|
}
|
3281
|
}
|
|
3282
|
Fluwx fluwx = Fluwx();
|
3282
|
Fluwx fluwx = Fluwx();
|
|
3283
|
- Uint8List? result;
|
3283
|
+ // Uint8List? result;
|
|
3284
|
if (liteStyle == '0') {
|
3284
|
if (liteStyle == '0') {
|
|
3285
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
3285
|
Uint8List? pngByte = await WxSdk.fetchImageAsUint8List(_thumbnail);
|
|
3286
|
-
|
|
|
|
3287
|
- if (pngByte != null && await isImageLargerThan64KB(pngByte)) {
|
3286
|
+ _thumbnailUint8List = pngByte;
|
|
|
|
3287
|
+ if (pngByte != null && await isImageLargerThan120KB(pngByte)) {
|
|
3288
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
3288
|
Uint8List? resultnew = await realComporessList(pngByte); //压缩图片
|
|
3289
|
- result = resultnew == null
|
3289
|
+ _thumbnailUint8List= resultnew == null
|
|
3290
|
? null
|
3290
|
? null
|
|
3291
|
- : await compressImage(resultnew, mb: 64 / 1024);
|
3291
|
+ : await compressImage(resultnew, mb: 120 / 1024);
|
|
3292
|
}
|
3292
|
}
|
|
3293
|
}
|
3293
|
}
|
|
3294
|
// print(_thumbnailUint8List.length/1024);
|
3294
|
// print(_thumbnailUint8List.length/1024);
|
|
@@ -3303,7 +3303,7 @@ class Utils { |
|
@@ -3303,7 +3303,7 @@ class Utils { |
|
3303
|
// miniProgramType: //开发版
|
3303
|
// miniProgramType: //开发版
|
|
3304
|
// thumbnail: WeChatImage.binary(source)
|
3304
|
// thumbnail: WeChatImage.binary(source)
|
|
3305
|
// thumbnail: WeChatImage.network(_thumbnail)
|
3305
|
// thumbnail: WeChatImage.network(_thumbnail)
|
|
3306
|
- thumbData: liteStyle == '0' ? result : _thumbnailUint8List);
|
3306
|
+ thumbData: _thumbnailUint8List);
|
|
3307
|
|
3307
|
|
|
3308
|
// thumbData: );
|
3308
|
// thumbData: );
|
|
3309
|
|
3309
|
|