|
@@ -5,6 +5,7 @@ import 'dart:typed_data'; |
|
@@ -5,6 +5,7 @@ import 'dart:typed_data'; |
|
5
|
|
5
|
|
|
6
|
import 'package:common_utils/common_utils.dart';
|
6
|
import 'package:common_utils/common_utils.dart';
|
|
7
|
import 'package:connectivity/connectivity.dart';
|
7
|
import 'package:connectivity/connectivity.dart';
|
|
|
|
8
|
+import 'package:contacts_service/contacts_service.dart';
|
|
8
|
// import 'package:connectivity_plus/connectivity_plus.dart';
|
9
|
// import 'package:connectivity_plus/connectivity_plus.dart';
|
|
9
|
import 'package:device_info/device_info.dart';
|
10
|
import 'package:device_info/device_info.dart';
|
|
10
|
import 'package:dio/dio.dart';
|
11
|
import 'package:dio/dio.dart';
|
|
@@ -36,6 +37,7 @@ import 'package:path_provider/path_provider.dart'; |
|
@@ -36,6 +37,7 @@ import 'package:path_provider/path_provider.dart'; |
|
36
|
import 'package:image_cropper/image_cropper.dart';
|
37
|
import 'package:image_cropper/image_cropper.dart';
|
|
37
|
import 'dart:math';
|
38
|
import 'dart:math';
|
|
38
|
|
39
|
|
|
|
|
40
|
+import '../constant/constant.dart';
|
|
39
|
import '../models/cookbook_model.dart';
|
41
|
import '../models/cookbook_model.dart';
|
|
40
|
import '../models/coupon_model.dart';
|
42
|
import '../models/coupon_model.dart';
|
|
41
|
import '../models/recharge_list_model.dart';
|
43
|
import '../models/recharge_list_model.dart';
|
|
@@ -1202,7 +1204,7 @@ class Utils { |
|
@@ -1202,7 +1204,7 @@ class Utils { |
|
1202
|
username: "gh_487873d353b3",
|
1204
|
username: "gh_487873d353b3",
|
|
1203
|
path:
|
1205
|
path:
|
|
1204
|
"pack-book/pages/book/b_index?seller_id=${model.user.sellerid}&seller_openid=seller_openid&manager_id=&goPath=${subPath}",
|
1206
|
"pack-book/pages/book/b_index?seller_id=${model.user.sellerid}&seller_openid=seller_openid&manager_id=&goPath=${subPath}",
|
|
1205
|
- miniProgramType: WXMiniProgramType.RELEASE);
|
1207
|
+ miniProgramType: Constant.wxMiniProgramType);
|
|
1206
|
}
|
1208
|
}
|
|
1207
|
|
1209
|
|
|
1208
|
//跳转小程序新建店铺页面
|
1210
|
//跳转小程序新建店铺页面
|
|
@@ -1211,7 +1213,7 @@ class Utils { |
|
@@ -1211,7 +1213,7 @@ class Utils { |
|
1211
|
launchWeChatMiniProgram(
|
1213
|
launchWeChatMiniProgram(
|
|
1212
|
username: "gh_1007de739c65",
|
1214
|
username: "gh_1007de739c65",
|
|
1213
|
path: "pages/login/l_login",
|
1215
|
path: "pages/login/l_login",
|
|
1214
|
- miniProgramType: WXMiniProgramType.RELEASE);
|
1216
|
+ miniProgramType: Constant.wxMiniProgramType);
|
|
1215
|
}
|
1217
|
}
|
|
1216
|
|
1218
|
|
|
1217
|
//分享排菜单
|
1219
|
//分享排菜单
|
|
@@ -1220,7 +1222,14 @@ class Utils { |
|
@@ -1220,7 +1222,14 @@ class Utils { |
|
1220
|
String title,
|
1222
|
String title,
|
|
1221
|
String rid,
|
1223
|
String rid,
|
|
1222
|
String oid,
|
1224
|
String oid,
|
|
1223
|
- String img}) async {
|
1225
|
+ String img,
|
|
|
|
1226
|
+ String priceSum,
|
|
|
|
1227
|
+ String memberPriceSum,
|
|
|
|
1228
|
+ String planPriceSum,
|
|
|
|
1229
|
+ String remark,
|
|
|
|
1230
|
+ String name,
|
|
|
|
1231
|
+ String address,
|
|
|
|
1232
|
+ String service}) async {
|
|
1224
|
Loading.showLoading(context);
|
1233
|
Loading.showLoading(context);
|
|
1225
|
String _webPageUrl = "http://colorcun.com/";
|
1234
|
String _webPageUrl = "http://colorcun.com/";
|
|
1226
|
// String _thumbnail = img;
|
1235
|
// String _thumbnail = img;
|
|
@@ -1238,12 +1247,12 @@ class Utils { |
|
@@ -1238,12 +1247,12 @@ class Utils { |
|
1238
|
// "pack-cookbook/pages/success?rid=$rid&identity=2&hasOnlyShow=1";
|
1247
|
// "pack-cookbook/pages/success?rid=$rid&identity=2&hasOnlyShow=1";
|
|
1239
|
print(data);
|
1248
|
print(data);
|
|
1240
|
String _path =
|
1249
|
String _path =
|
|
1241
|
- "pack-cookbook/pages/success_new?cookbooklist=${json.encode(data)}&hasSuccess=1&oid=$oid&rid=$rid&identity=2&hasOnlyShow=1&sellerName=${Provider.of<UserModel>(context, listen: false).user.sellername}&sid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&type=2";
|
1250
|
+ "pack-cookbook/pages/success_new?cookbooklist=${json.encode(data)}&hasSuccess=1&oid=$oid&rid=$rid&identity=2&hasOnlyShow=1&sellerName=${Provider.of<UserModel>(context, listen: false).user.sellername}&sid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&type=2&priceSum=${priceSum}&memberPriceSum=${memberPriceSum}&planPriceSum=${planPriceSum}&remark=${remark}&name=${name}&address=${address}&service=${service}";
|
|
1242
|
String _description = "OneKey";
|
1251
|
String _description = "OneKey";
|
|
1243
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
1252
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
|
1244
|
print(_path);
|
1253
|
print(_path);
|
|
1245
|
var model = new WeChatShareMiniProgramModel(
|
1254
|
var model = new WeChatShareMiniProgramModel(
|
|
1246
|
- miniProgramType: WXMiniProgramType.RELEASE,
|
1255
|
+ miniProgramType: Constant.wxMiniProgramType,
|
|
1247
|
webPageUrl: _webPageUrl,
|
1256
|
webPageUrl: _webPageUrl,
|
|
1248
|
userName: _userName,
|
1257
|
userName: _userName,
|
|
1249
|
title: _title,
|
1258
|
title: _title,
|
|
@@ -1257,7 +1266,7 @@ class Utils { |
|
@@ -1257,7 +1266,7 @@ class Utils { |
|
1257
|
Loading.hideLoading(context);
|
1266
|
Loading.hideLoading(context);
|
|
1258
|
}
|
1267
|
}
|
|
1259
|
|
1268
|
|
|
1260
|
- //分享已点菜品----跳转小程序提前点餐
|
1269
|
+ //请客户点菜----跳转小程序提前点餐
|
|
1261
|
static goShareOrderPageToWeChat(BuildContext context,
|
1270
|
static goShareOrderPageToWeChat(BuildContext context,
|
|
1262
|
{String title, String rid, String img, String oid, String sid}) async {
|
1271
|
{String title, String rid, String img, String oid, String sid}) async {
|
|
1263
|
Loading.showLoading(context);
|
1272
|
Loading.showLoading(context);
|
|
@@ -1279,9 +1288,9 @@ class Utils { |
|
@@ -1279,9 +1288,9 @@ class Utils { |
|
1279
|
String _description = "OneKey";
|
1288
|
String _description = "OneKey";
|
|
1280
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
1289
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
|
1281
|
var model = new WeChatShareMiniProgramModel(
|
1290
|
var model = new WeChatShareMiniProgramModel(
|
|
1282
|
- // miniProgramType: WXMiniProgramType.PREVIEW, //体验版
|
|
|
|
1283
|
- miniProgramType: WXMiniProgramType.RELEASE, //正式版
|
|
|
|
1284
|
- // miniProgramType: WXMiniProgramType.TEST //开发版
|
1291
|
+ // miniProgramType: , //体验版
|
|
|
|
1292
|
+ miniProgramType: Constant.wxMiniProgramType, //正式版
|
|
|
|
1293
|
+ // miniProgramType: //开发版
|
|
1285
|
webPageUrl: _webPageUrl,
|
1294
|
webPageUrl: _webPageUrl,
|
|
1286
|
userName: _userName,
|
1295
|
userName: _userName,
|
|
1287
|
title: _title,
|
1296
|
title: _title,
|
|
@@ -1320,7 +1329,7 @@ class Utils { |
|
@@ -1320,7 +1329,7 @@ class Utils { |
|
1320
|
String _description = "OneKey";
|
1329
|
String _description = "OneKey";
|
|
1321
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
1330
|
// Uint8List source = await testComporessList(context, _thumbnail);
|
|
1322
|
var model = new WeChatShareMiniProgramModel(
|
1331
|
var model = new WeChatShareMiniProgramModel(
|
|
1323
|
- miniProgramType: WXMiniProgramType.RELEASE,
|
1332
|
+ miniProgramType: Constant.wxMiniProgramType,
|
|
1324
|
webPageUrl: _webPageUrl,
|
1333
|
webPageUrl: _webPageUrl,
|
|
1325
|
userName: _userName,
|
1334
|
userName: _userName,
|
|
1326
|
title: _title,
|
1335
|
title: _title,
|
|
@@ -1335,12 +1344,12 @@ class Utils { |
|
@@ -1335,12 +1344,12 @@ class Utils { |
|
1335
|
}
|
1344
|
}
|
|
1336
|
|
1345
|
|
|
1337
|
//拉起小程序已点菜品
|
1346
|
//拉起小程序已点菜品
|
|
1338
|
- static goMiniProgramOrderFood({String rid}) {
|
|
|
|
1339
|
- launchWeChatMiniProgram(
|
|
|
|
1340
|
- username: "gh_487873d353b3",
|
|
|
|
1341
|
- path: "pack-cookbook/pages/success?rid=$rid&identity=2",
|
|
|
|
1342
|
- miniProgramType: WXMiniProgramType.RELEASE);
|
|
|
|
1343
|
- }
|
1347
|
+ // static goMiniProgramOrderFood({String rid}) {
|
|
|
|
1348
|
+ // launchWeChatMiniProgram(
|
|
|
|
1349
|
+ // username: "gh_487873d353b3",
|
|
|
|
1350
|
+ // path: "pack-cookbook/pages/success?rid=$rid&identity=2",
|
|
|
|
1351
|
+ // miniProgramType: WXMiniProgramType.RELEASE);
|
|
|
|
1352
|
+ // }
|
|
1344
|
|
1353
|
|
|
1345
|
//跳转拨打电话页面
|
1354
|
//跳转拨打电话页面
|
|
1346
|
static goHelp(BuildContext context) async {
|
1355
|
static goHelp(BuildContext context) async {
|
|
@@ -1649,9 +1658,9 @@ class Utils { |
|
@@ -1649,9 +1658,9 @@ class Utils { |
|
1649
|
title: _title,
|
1658
|
title: _title,
|
|
1650
|
path: _path,
|
1659
|
path: _path,
|
|
1651
|
description: _description,
|
1660
|
description: _description,
|
|
1652
|
- // miniProgramType: WXMiniProgramType.PREVIEW, //体验版
|
|
|
|
1653
|
- miniProgramType: WXMiniProgramType.RELEASE, //正式版
|
|
|
|
1654
|
- // miniProgramType: WXMiniProgramType.TEST //开发版
|
1661
|
+ // miniProgramType: , //体验版
|
|
|
|
1662
|
+ miniProgramType:Constant.wxMiniProgramType, //正式版
|
|
|
|
1663
|
+ // miniProgramType: //开发版
|
|
1655
|
// thumbnail: WeChatImage.binary(source)
|
1664
|
// thumbnail: WeChatImage.binary(source)
|
|
1656
|
thumbnail: WeChatImage.network(_thumbnail)
|
1665
|
thumbnail: WeChatImage.network(_thumbnail)
|
|
1657
|
// thumbnail: WeChatImage.binary(image)
|
1666
|
// thumbnail: WeChatImage.binary(image)
|
|
@@ -1730,12 +1739,12 @@ class Utils { |
|
@@ -1730,12 +1739,12 @@ class Utils { |
|
1730
|
var model = new WeChatShareMiniProgramModel(
|
1739
|
var model = new WeChatShareMiniProgramModel(
|
|
1731
|
webPageUrl: _webPageUrl,
|
1740
|
webPageUrl: _webPageUrl,
|
|
1732
|
userName: _userName,
|
1741
|
userName: _userName,
|
|
1733
|
- title: 'ff',
|
1742
|
+ title: _title,
|
|
1734
|
path: _path,
|
1743
|
path: _path,
|
|
1735
|
- description: 'hhh',
|
|
|
|
1736
|
- // miniProgramType: WXMiniProgramType.PREVIEW, //体验版
|
|
|
|
1737
|
- miniProgramType: WXMiniProgramType.RELEASE, //正式版
|
|
|
|
1738
|
- // miniProgramType: WXMiniProgramType.TEST //开发版
|
1744
|
+ // description: 'hhh',
|
|
|
|
1745
|
+ // miniProgramType: , //体验版
|
|
|
|
1746
|
+ miniProgramType: Constant.wxMiniProgramType, //正式版
|
|
|
|
1747
|
+ // miniProgramType: //开发版
|
|
1739
|
// thumbnail: WeChatImage.binary(source)
|
1748
|
// thumbnail: WeChatImage.binary(source)
|
|
1740
|
thumbnail: WeChatImage.network(_thumbnail),
|
1749
|
thumbnail: WeChatImage.network(_thumbnail),
|
|
1741
|
// hdImagePath: WeChatImage.network(_thumbnail), thumbnail: null,
|
1750
|
// hdImagePath: WeChatImage.network(_thumbnail), thumbnail: null,
|
|
@@ -1788,9 +1797,9 @@ class Utils { |
|
@@ -1788,9 +1797,9 @@ class Utils { |
|
1788
|
title: _title,
|
1797
|
title: _title,
|
|
1789
|
path: _path,
|
1798
|
path: _path,
|
|
1790
|
description: _description,
|
1799
|
description: _description,
|
|
1791
|
- // miniProgramType: WXMiniProgramType.PREVIEW, //体验版
|
|
|
|
1792
|
- miniProgramType: WXMiniProgramType.RELEASE, //正式版
|
|
|
|
1793
|
- // miniProgramType: WXMiniProgramType.TEST //开发版
|
1800
|
+ // miniProgramType: , //体验版
|
|
|
|
1801
|
+ miniProgramType: Constant.wxMiniProgramType, //正式版
|
|
|
|
1802
|
+ // miniProgramType: //开发版
|
|
1794
|
// thumbnail: WeChatImage.binary(source)
|
1803
|
// thumbnail: WeChatImage.binary(source)
|
|
1795
|
thumbnail: WeChatImage.network(_thumbnail)
|
1804
|
thumbnail: WeChatImage.network(_thumbnail)
|
|
1796
|
// thumbnail: WeChatImage.binary(image)
|
1805
|
// thumbnail: WeChatImage.binary(image)
|
|
@@ -1842,9 +1851,9 @@ class Utils { |
|
@@ -1842,9 +1851,9 @@ class Utils { |
|
1842
|
title: _title,
|
1851
|
title: _title,
|
|
1843
|
path: _path,
|
1852
|
path: _path,
|
|
1844
|
description: _description,
|
1853
|
description: _description,
|
|
1845
|
- miniProgramType: WXMiniProgramType.PREVIEW, //体验版
|
1854
|
+ miniProgramType: Constant.wxMiniProgramType, //体验版
|
|
1846
|
// miniProgramType: WXMiniProgramType.RELEASE, //正式版
|
1855
|
// miniProgramType: WXMiniProgramType.RELEASE, //正式版
|
|
1847
|
- // miniProgramType: WXMiniProgramType.TEST //开发版
|
1856
|
+ // miniProgramType: //开发版
|
|
1848
|
// thumbnail: WeChatImage.binary(source)
|
1857
|
// thumbnail: WeChatImage.binary(source)
|
|
1849
|
thumbnail: WeChatImage.network(_thumbnail)
|
1858
|
thumbnail: WeChatImage.network(_thumbnail)
|
|
1850
|
// thumbnail: WeChatImage.binary(image)
|
1859
|
// thumbnail: WeChatImage.binary(image)
|