Commit 7c5a5ae20964cf9173b798f12d5007a3f0df5aaa

Authored by wdn127929
1 parent 6dd0144e

设置提前点餐可修改时间配置

Showing 26 changed files with 178 additions and 60 deletions
@@ -18,19 +18,19 @@ if (flutterRoot == null) { @@ -18,19 +18,19 @@ if (flutterRoot == null) {
18 18
19 19
20 20
21 -def flutterVersionCode = "522" 21 +def flutterVersionCode = "523"
22 if (flutterVersionCode == null) { 22 if (flutterVersionCode == null) {
23 - flutterVersionCode = '522' 23 + flutterVersionCode = '523'
24 24
25 25
26 26
27 } 27 }
28 28
29 29
30 -def flutterVersionName = "5.2.2" 30 +def flutterVersionName = "5.2.3"
31 31
32 if (flutterVersionName == null) { 32 if (flutterVersionName == null) {
33 - flutterVersionName = '5.2.2' 33 + flutterVersionName = '5.2.3'
34 34
35 35
36 } 36 }
@@ -34,4 +34,8 @@ @@ -34,4 +34,8 @@
34 -keep public class * extends android.app.Service 34 -keep public class * extends android.app.Service
35 -keep class com.heytap.mcssdk.** {*;} 35 -keep class com.heytap.mcssdk.** {*;}
36 -keep class com.heytap.msp.push.** { *;} 36 -keep class com.heytap.msp.push.** { *;}
  37 +-keep class com.tencent.wework.api.** {
  38 + *;
  39 +}
  40 +
37 41
@@ -53,6 +53,7 @@ class GetDzSellerConfSunModel { @@ -53,6 +53,7 @@ class GetDzSellerConfSunModel {
53 53
54 String saiyouyun; 54 String saiyouyun;
55 Bookinginfo bookinginfo; 55 Bookinginfo bookinginfo;
  56 + String isAllowUpdate;
56 57
57 GetDzSellerConfSunModel( 58 GetDzSellerConfSunModel(
58 {this.id, 59 {this.id,
@@ -77,7 +78,8 @@ class GetDzSellerConfSunModel { @@ -77,7 +78,8 @@ class GetDzSellerConfSunModel {
77 this.isNotice, 78 this.isNotice,
78 this.isMarketing, 79 this.isMarketing,
79 this.saiyouyun, 80 this.saiyouyun,
80 - this.bookinginfo}); 81 + this.bookinginfo,
  82 + this.isAllowUpdate});
81 83
82 GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) { 84 GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) {
83 id = json['id']; 85 id = json['id'];
@@ -107,6 +109,7 @@ class GetDzSellerConfSunModel { @@ -107,6 +109,7 @@ class GetDzSellerConfSunModel {
107 bookinginfo = json['bookinginfo'] != null 109 bookinginfo = json['bookinginfo'] != null
108 ? new Bookinginfo.fromJson(json['bookinginfo']) 110 ? new Bookinginfo.fromJson(json['bookinginfo'])
109 : null; 111 : null;
  112 + isAllowUpdate = json['is_allow_update'] ?? '1';
110 } 113 }
111 114
112 Map<String, dynamic> toJson() { 115 Map<String, dynamic> toJson() {
@@ -136,6 +139,7 @@ class GetDzSellerConfSunModel { @@ -136,6 +139,7 @@ class GetDzSellerConfSunModel {
136 if (this.bookinginfo != null) { 139 if (this.bookinginfo != null) {
137 data['bookinginfo'] = this.bookinginfo.toJson(); 140 data['bookinginfo'] = this.bookinginfo.toJson();
138 } 141 }
  142 + data['is_allow_update'] = this.isAllowUpdate;
139 143
140 return data; 144 return data;
141 } 145 }
@@ -91,6 +91,8 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -91,6 +91,8 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
91 ? true 91 ? true
92 : false; 92 : false;
93 93
  94 +
  95 +
94 rechargeData = 96 rechargeData =
95 marketingCenterProvider.markDataModel.marketing.rechargeData; 97 marketingCenterProvider.markDataModel.marketing.rechargeData;
96 couponDataList = 98 couponDataList =
@@ -4693,15 +4693,15 @@ class InvicationPageState extends State<InvicationPage> @@ -4693,15 +4693,15 @@ class InvicationPageState extends State<InvicationPage>
4693 radius: ScreenUtil().setWidth(8), 4693 radius: ScreenUtil().setWidth(8),
4694 isBold: false, 4694 isBold: false,
4695 onPressed: () async { 4695 onPressed: () async {
4696 - bool isSuccess = await Utils.goShareInvicationToWeChat( 4696 + dynamic isSuccess = await Utils.goShareInvicationToWeChat(
4697 context, 4697 context,
4698 widget.rid, 4698 widget.rid,
4699 Provider.of<UserModel>(context, listen: false).user.openid, 4699 Provider.of<UserModel>(context, listen: false).user.openid,
4700 isWechat: false); 4700 isWechat: false);
4701 print(isSuccess); 4701 print(isSuccess);
4702 - if (isSuccess) {  
4703 - // _addForward();  
4704 - } 4702 + // if (isSuccess) {
  4703 + // // _addForward();
  4704 + // }
4705 }, 4705 },
4706 ), 4706 ),
4707 HEmptyView(20), 4707 HEmptyView(20),
@@ -54,6 +54,7 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { @@ -54,6 +54,7 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
54 bool isCoupon = false; // 代金券 54 bool isCoupon = false; // 代金券
55 bool isRecharge = false; //充值券 55 bool isRecharge = false; //充值券
56 56
  57 +
57 RechargeListSunModel rechargeData; 58 RechargeListSunModel rechargeData;
58 String rechargeContent = ''; 59 String rechargeContent = '';
59 60
@@ -161,6 +162,8 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { @@ -161,6 +162,8 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
161 ? true 162 ? true
162 : false; 163 : false;
163 164
  165 +
  166 +
164 rechargeData = 167 rechargeData =
165 marketingCenterProvider.markDataModel.marketing.rechargeData; 168 marketingCenterProvider.markDataModel.marketing.rechargeData;
166 couponDataList = 169 couponDataList =
@@ -40,6 +40,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -40,6 +40,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
40 bool isLink = false; //充值优惠活动链接 40 bool isLink = false; //充值优惠活动链接
41 bool isCoupon = false; // 代金券 41 bool isCoupon = false; // 代金券
42 bool isRecharge = false; //充值券 42 bool isRecharge = false; //充值券
  43 +
43 String welcome = ''; 44 String welcome = '';
44 String qiniuUrl = ''; 45 String qiniuUrl = '';
45 46
@@ -90,6 +91,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -90,6 +91,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
90 marketingCenterProvider.markDataModel.marketing.isRecharge == '1' 91 marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
91 ? true 92 ? true
92 : false; 93 : false;
  94 +
93 95
94 rechargeData = 96 rechargeData =
95 marketingCenterProvider.markDataModel.marketing.rechargeData; 97 marketingCenterProvider.markDataModel.marketing.rechargeData;
@@ -496,7 +498,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -496,7 +498,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
496 // context, 498 // context,
497 // from: 'statistics', 499 // from: 'statistics',
498 // hasModify: false); 500 // hasModify: false);
499 - if (temp!= null && temp['coupon'] != null) { 501 + if (temp != null && temp['coupon'] != null) {
500 couponDataListComments = temp['coupon']; 502 couponDataListComments = temp['coupon'];
501 503
502 setState(() {}); 504 setState(() {});
@@ -9,9 +9,11 @@ import '../../../models/recharge_list_model.dart'; @@ -9,9 +9,11 @@ import '../../../models/recharge_list_model.dart';
9 import '../../../provider/marketing_center_provider.dart'; 9 import '../../../provider/marketing_center_provider.dart';
10 import '../../../provider/user_model.dart'; 10 import '../../../provider/user_model.dart';
11 import '../../../res/colors.dart'; 11 import '../../../res/colors.dart';
  12 +import '../../../utils/dialog_util.dart';
12 import '../../../utils/screen_util.dart'; 13 import '../../../utils/screen_util.dart';
13 import '../../../utils/utils.dart'; 14 import '../../../utils/utils.dart';
14 import '../../../widgets/MyDivider.dart'; 15 import '../../../widgets/MyDivider.dart';
  16 +import '../../../widgets/h_empty_view.dart';
15 import '../../../widgets/round_button.dart'; 17 import '../../../widgets/round_button.dart';
16 import '../../../widgets/v_empty_view.dart'; 18 import '../../../widgets/v_empty_view.dart';
17 19
@@ -44,15 +46,22 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -44,15 +46,22 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
44 46
45 List<CouponSunModel> couponDataList = []; 47 List<CouponSunModel> couponDataList = [];
46 bool isComments = false; //启用评价设置 48 bool isComments = false; //启用评价设置
47 - bool isCommentsCoupon = false; //启用评价送券 49 + bool isCommentsCoupon = false; //启用评价送券
48 List<CouponSunModel> couponDataListComments = []; 50 List<CouponSunModel> couponDataListComments = [];
49 51
  52 + int indexSelect = 0;
  53 +
  54 + List<String> timesData = [];
  55 +
50 @override 56 @override
51 void initState() { 57 void initState() {
52 super.initState(); 58 super.initState();
53 59
  60 + timesData = ['不允许修改', '开餐1小时之前', '开餐2小时之前', '预订日期1天之前', '预订日期2天之前'];
  61 +
54 WidgetsBinding.instance.addPostFrameCallback((_) { 62 WidgetsBinding.instance.addPostFrameCallback((_) {
55 getSellerTemplateConf(); 63 getSellerTemplateConf();
  64 + _getDzSellerConf();
56 }); 65 });
57 } 66 }
58 67
@@ -113,6 +122,22 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -113,6 +122,22 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
113 } 122 }
114 } 123 }
115 124
  125 + _getDzSellerConf() async {
  126 + await marketingCenterProvider.getDzSellerConf(context);
  127 +
  128 + if (marketingCenterProvider.dzSellerConfModel != null) {
  129 + indexSelect =
  130 + int.parse(marketingCenterProvider.dzSellerConfModel.isAllowUpdate) -
  131 + 1;
  132 + if (indexSelect < 0 || indexSelect > 4) {
  133 + indexSelect = 0;
  134 + }
  135 + setState(() {
  136 +
  137 + });
  138 + }
  139 + }
  140 +
116 ///向客人开放提前点餐功能 141 ///向客人开放提前点餐功能
117 142
118 _setOrderBtnShow() async { 143 _setOrderBtnShow() async {
@@ -147,6 +172,58 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -147,6 +172,58 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
147 } 172 }
148 } 173 }
149 174
  175 + Widget _itemWidget(String title, {GestureTapCallback onTap}) {
  176 + return InkWell(
  177 + onTap: onTap,
  178 + child: Padding(
  179 + padding: EdgeInsets.only(
  180 + left: w(16), top: w(12), bottom: w(12), right: w(12)),
  181 + child: Row(
  182 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  183 + children: [
  184 + Text(
  185 + title,
  186 + style: TextStyle(
  187 + color: MyColours.color_515151, fontSize: font(16)),
  188 + ),
  189 + Spacer(),
  190 + Container(
  191 + padding:
  192 + EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)),
  193 + child: Image.asset(
  194 + Utils.getImgPath(isOrder ? 'swich_on' : 'swich_off'),
  195 + width: w(44),
  196 + ),
  197 + )
  198 + // RoundButton(
  199 + // text: '预览',
  200 + // gradientStart: MyColours.color_ffffff,
  201 + // gradientEnd: MyColours.color_ffffff,
  202 + // borderColor: MyColours.color_438E93,
  203 + // textColor: MyColours.color_438E93,
  204 + // radius: ScreenUtil().setWidth(22),
  205 + // fontSize: 24,
  206 + // width: w(72),
  207 + // height: ScreenUtil().setWidth(44),
  208 + // isBold: true,
  209 + // onPressed: () {
  210 + // NavigatorUtil.goMarkingPreviewPage(context);
  211 + // },
  212 + // ),
  213 + ])));
  214 + }
  215 +
  216 + _setConfing() async {
  217 + await marketingCenterProvider.setConfing(
  218 + context,
  219 + {
  220 + 'sid': Provider.of<UserModel>(context,listen: false).user.sellerid,
  221 + 'key': 'is_allow_update',
  222 + 'value': '${indexSelect + 1}'
  223 + },
  224 + needToast: false);
  225 + }
  226 +
150 @override 227 @override
151 Widget build(BuildContext context) { 228 Widget build(BuildContext context) {
152 marketingCenterProvider = 229 marketingCenterProvider =
@@ -160,52 +237,61 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -160,52 +237,61 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
160 child: SingleChildScrollView( 237 child: SingleChildScrollView(
161 child: Column( 238 child: Column(
162 children: [ 239 children: [
  240 + _itemWidget('向客人开放提前点餐功能', onTap: () {
  241 + setState(() {
  242 + isOrder = !isOrder;
  243 + });
  244 + }),
  245 + Padding(
  246 + padding: EdgeInsets.only(left: w(16)),
  247 + child: MyDivider(double.infinity, w(0.5),
  248 + color: MyColours.color_E7E7E7)),
  249 + VEmptyView(20),
163 InkWell( 250 InkWell(
164 onTap: () { 251 onTap: () {
165 - setState(() {  
166 - isOrder = !isOrder;  
167 - }); 252 + DialogUtil.showSelectCusmanDialog(context, timesData,
  253 + (value) {
  254 + if (value != null) {
  255 + setState(() {
  256 + indexSelect = value.first;
  257 + });
  258 + }
  259 + }, selecteds: indexSelect == null ? [] : [indexSelect])
  260 + .then((value) {});
168 }, 261 },
169 child: Padding( 262 child: Padding(
170 padding: EdgeInsets.only( 263 padding: EdgeInsets.only(
171 left: w(16), 264 left: w(16),
172 - top: w(12),  
173 - bottom: w(12), 265 + top: w(14),
  266 + bottom: w(10),
174 right: w(12)), 267 right: w(12)),
175 child: Row( 268 child: Row(
176 mainAxisAlignment: MainAxisAlignment.spaceBetween, 269 mainAxisAlignment: MainAxisAlignment.spaceBetween,
177 children: [ 270 children: [
178 Text( 271 Text(
179 - '向客人开放提前点餐功能', 272 + '是否允许客人修改菜品',
180 style: TextStyle( 273 style: TextStyle(
181 color: MyColours.color_515151, 274 color: MyColours.color_515151,
182 - fontSize: font(16)), 275 + fontSize: font(14)),
183 ), 276 ),
184 - Spacer(), 277 + HEmptyView(20),
  278 + Expanded(
  279 + child: Text(
  280 + timesData[indexSelect],
  281 + textAlign: TextAlign.right,
  282 + style: TextStyle(
  283 + color: MyColours.color_515151,
  284 + fontSize: font(14)),
  285 + )),
185 Container( 286 Container(
186 padding: EdgeInsets.symmetric( 287 padding: EdgeInsets.symmetric(
187 - horizontal: w(7), vertical: w(4)), 288 + horizontal: w(11), vertical: w(4)),
188 child: Image.asset( 289 child: Image.asset(
189 - Utils.getImgPath(  
190 - isOrder ? 'swich_on' : 'swich_off'),  
191 - width: w(44), 290 + "assets/arrow_right_new.png",
  291 + width: w(9),
  292 + height: w(16),
192 ), 293 ),
193 ) 294 )
194 - // RoundButton(  
195 - // text: '预览',  
196 - // gradientStart: MyColours.color_ffffff,  
197 - // gradientEnd: MyColours.color_ffffff,  
198 - // borderColor: MyColours.color_438E93,  
199 - // textColor: MyColours.color_438E93,  
200 - // radius: ScreenUtil().setWidth(22),  
201 - // fontSize: 24,  
202 - // width: w(72),  
203 - // height: ScreenUtil().setWidth(44),  
204 - // isBold: true,  
205 - // onPressed: () {  
206 - // NavigatorUtil.goMarkingPreviewPage(context);  
207 - // },  
208 - // ),  
209 ]))), 295 ]))),
210 Padding( 296 Padding(
211 padding: EdgeInsets.only(left: w(16)), 297 padding: EdgeInsets.only(left: w(16)),
@@ -228,6 +314,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -228,6 +314,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
228 isBold: true, 314 isBold: true,
229 onPressed: () async { 315 onPressed: () async {
230 //调用接口 316 //调用接口
  317 + _setConfing();
231 _setOrderBtnShow(); 318 _setOrderBtnShow();
232 }) 319 })
233 ], 320 ],
@@ -40,6 +40,7 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { @@ -40,6 +40,7 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
40 bool isLink = false; //充值优惠活动链接 40 bool isLink = false; //充值优惠活动链接
41 bool isCoupon = false; // 代金券 41 bool isCoupon = false; // 代金券
42 bool isRecharge = false; //充值券 42 bool isRecharge = false; //充值券
  43 +
43 String welcome = ''; 44 String welcome = '';
44 String qiniuUrl = ''; 45 String qiniuUrl = '';
45 46
@@ -90,6 +91,7 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { @@ -90,6 +91,7 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
90 marketingCenterProvider.markDataModel.marketing.isRecharge == '1' 91 marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
91 ? true 92 ? true
92 : false; 93 : false;
  94 +
93 95
94 rechargeData = 96 rechargeData =
95 marketingCenterProvider.markDataModel.marketing.rechargeData; 97 marketingCenterProvider.markDataModel.marketing.rechargeData;
@@ -2089,6 +2089,8 @@ class Utils { @@ -2089,6 +2089,8 @@ class Utils {
2089 2089
2090 isSuccess = await shareToWeChat(model); 2090 isSuccess = await shareToWeChat(model);
2091 } else { 2091 } else {
  2092 + Loading.showLoading(context);
  2093 +
2092 String _path = 2094 String _path =
2093 "pages/customer/index.html?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid"; 2095 "pages/customer/index.html?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid";
2094 FlutterWxwork flutterWxwork = FlutterWxwork(); 2096 FlutterWxwork flutterWxwork = FlutterWxwork();
@@ -2100,17 +2102,19 @@ class Utils { @@ -2100,17 +2102,19 @@ class Utils {
2100 print(registerResult); 2102 print(registerResult);
2101 2103
2102 // isSuccess = await flutterWxwork.shareText(text: "dddddddd"); 2104 // isSuccess = await flutterWxwork.shareText(text: "dddddddd");
2103 - isSuccess = await flutterWxwork.shareMiniProgram( 2105 + dynamic isSuccess = await flutterWxwork.shareMiniProgram(
2104 userName: 'gh_487873d353b3@app', 2106 userName: 'gh_487873d353b3@app',
2105 path: _path, 2107 path: _path,
2106 hdImageData: _thumbnail, 2108 hdImageData: _thumbnail,
2107 title: _title, 2109 title: _title,
2108 description: _description, 2110 description: _description,
2109 ); 2111 );
  2112 + Loading.hideLoading(context);
2110 2113
2111 // var isSuccess = await flutterWxwork.shareImage(); 2114 // var isSuccess = await flutterWxwork.shareImage();
2112 print(isSuccess); 2115 print(isSuccess);
2113 } else { 2116 } else {
  2117 + Loading.hideLoading(context);
2114 Utils.showToast('未安装企业微信'); 2118 Utils.showToast('未安装企业微信');
2115 } 2119 }
2116 } 2120 }
1 rootProject.name = 'flutter_wxwork' 1 rootProject.name = 'flutter_wxwork'
2 -include ':lib:wxwork',//新增,写上你新写的module 2 +include ':lib:wxwork'//新增,写上你新写的module
3 3
@@ -37,6 +37,7 @@ import android.os.Parcel; @@ -37,6 +37,7 @@ import android.os.Parcel;
37 import android.os.Parcelable; 37 import android.os.Parcelable;
38 import java.io.ByteArrayOutputStream; 38 import java.io.ByteArrayOutputStream;
39 import java.io.ByteArrayInputStream; 39 import java.io.ByteArrayInputStream;
  40 +import android.view.View;
40 41
41 42
42 import java.io.FileOutputStream; 43 import java.io.FileOutputStream;
@@ -61,6 +62,8 @@ import java.util.Map; @@ -61,6 +62,8 @@ import java.util.Map;
61 62
62 63
63 64
  65 +
  66 +
64 /** 67 /**
65 * FlutterWxworkPlugin 68 * FlutterWxworkPlugin
66 */ 69 */
@@ -83,12 +86,19 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler { @@ -83,12 +86,19 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
83 86
84 87
85 88
  89 +
  90 +
86 @Override 91 @Override
87 public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { 92 public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
88 channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "flutter_wxwork"); 93 channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "flutter_wxwork");
89 channel.setMethodCallHandler(this); 94 channel.setMethodCallHandler(this);
90 context = flutterPluginBinding.getApplicationContext(); 95 context = flutterPluginBinding.getApplicationContext();
91 iwwapi = WWAPIFactory.createWWAPI(context); 96 iwwapi = WWAPIFactory.createWWAPI(context);
  97 +
  98 +
  99 +
  100 +
  101 +
92 } 102 }
93 103
94 @Override 104 @Override
@@ -152,6 +162,11 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler { @@ -152,6 +162,11 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
152 } else if (call.method.equals("shareImagePath")) { 162 } else if (call.method.equals("shareImagePath")) {
153 }else if (call.method.equals("shareMiniProgram")) { 163 }else if (call.method.equals("shareMiniProgram")) {
154 164
  165 +
  166 +
  167 +
  168 +
  169 +
155 WWMediaMiniProgram miniProgram = new WWMediaMiniProgram(); 170 WWMediaMiniProgram miniProgram = new WWMediaMiniProgram();
156 miniProgram.appPkg = "com.naji.one_key"; 171 miniProgram.appPkg = "com.naji.one_key";
157 miniProgram.appName = "周到安排商家";//app name of this android pkg 172 miniProgram.appName = "周到安排商家";//app name of this android pkg
@@ -178,9 +193,12 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler { @@ -178,9 +193,12 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
178 // 在这里处理下载到的Bitmap对象 193 // 在这里处理下载到的Bitmap对象
179 // miniProgram.hdImageData = getBytesFromBitmap(bitmap); 194 // miniProgram.hdImageData = getBytesFromBitmap(bitmap);
180 miniProgram.title = arguments.get("title"); 195 miniProgram.title = arguments.get("title");
  196 + // 数据加载完毕后隐藏加载动画
  197 + result.success(true);
181 iwwapi.sendMessage(miniProgram, new IWWAPIEventHandler() { 198 iwwapi.sendMessage(miniProgram, new IWWAPIEventHandler() {
182 @Override 199 @Override
183 public void handleResp(BaseMessage resp) { 200 public void handleResp(BaseMessage resp) {
  201 +
184 if(resp instanceof WWSimpleRespMessage){ 202 if(resp instanceof WWSimpleRespMessage){
185 WWSimpleRespMessage rsp = (WWSimpleRespMessage)resp; 203 WWSimpleRespMessage rsp = (WWSimpleRespMessage)resp;
186 // String t = ""; 204 // String t = "";
@@ -193,7 +211,9 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler { @@ -193,7 +211,9 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
193 map.put("errCode", String.valueOf(rsp.errMsg)); 211 map.put("errCode", String.valueOf(rsp.errMsg));
194 212
195 213
196 - result.success(map); 214 +// result.success(map);
  215 + }else{
  216 +// result.success(true);
197 } 217 }
198 } 218 }
199 }); 219 });
@@ -293,6 +313,8 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler { @@ -293,6 +313,8 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
293 } 313 }
294 314
295 315
  316 +
  317 +
296 // 转换图片格式为字节数组 318 // 转换图片格式为字节数组
297 public static byte[] bmpToByteArray(final Bitmap bmp, final boolean needRecycle) { 319 public static byte[] bmpToByteArray(final Bitmap bmp, final boolean needRecycle) {
298 ByteArrayOutputStream output = new ByteArrayOutputStream(); 320 ByteArrayOutputStream output = new ByteArrayOutputStream();
1 -<?xml version="1.0" encoding="utf-8"?>  
2 -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
3 - android:layout_width="match_parent"  
4 - android:layout_height="match_parent">  
5 -  
6 -</LinearLayout>  
1 -<?xml version="1.0" encoding="utf-8"?>  
2 -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
3 - android:layout_width="match_parent"  
4 - android:layout_height="match_parent">  
5 -  
6 -</RelativeLayout>  
@@ -25,7 +25,7 @@ FlutterMethodChannel *channel; @@ -25,7 +25,7 @@ FlutterMethodChannel *channel;
25 NSString *scheme = dic[@"scheme"]; 25 NSString *scheme = dic[@"scheme"];
26 NSString *corpId = dic[@"corpId"]; 26 NSString *corpId = dic[@"corpId"];
27 NSString *agentId = dic[@"agentId"]; 27 NSString *agentId = dic[@"agentId"];
28 - result([NSString stringWithFormat:@"%hhd",[WWKApi registerApp:scheme corpId:corpId agentId:agentId]]); 28 + result(@([WWKApi registerApp:scheme corpId:corpId agentId:agentId]));
29 } else if ([@"auth" isEqualToString:call.method]){ 29 } else if ([@"auth" isEqualToString:call.method]){
30 WWKSSOReq *req = [[WWKSSOReq alloc] init]; 30 WWKSSOReq *req = [[WWKSSOReq alloc] init];
31 // state参数为这次请求的唯一标示,客户端需要维护其唯一性。SSO回调时会原样返回 31 // state参数为这次请求的唯一标示,客户端需要维护其唯一性。SSO回调时会原样返回
@@ -205,8 +205,8 @@ FlutterMethodChannel *channel; @@ -205,8 +205,8 @@ FlutterMethodChannel *channel;
205 NSData *imageData = data; 205 NSData *imageData = data;
206 206
207 dispatch_async(dispatch_get_main_queue(), ^{ 207 dispatch_async(dispatch_get_main_queue(), ^{
208 -  
209 - 208 + NSMutableDictionary *mDic = [[NSMutableDictionary alloc]init];
  209 + result(mDic);
210 WWKSendMessageReq *req = [[WWKSendMessageReq alloc] init]; 210 WWKSendMessageReq *req = [[WWKSendMessageReq alloc] init];
211 WWKMessageMiniAppAttachment *attachment = [[WWKMessageMiniAppAttachment alloc] init]; 211 WWKMessageMiniAppAttachment *attachment = [[WWKMessageMiniAppAttachment alloc] init];
212 attachment.userName = call.arguments[@"userName"]; //必须是应用关联的小程序,注意要有@app后缀 212 attachment.userName = call.arguments[@"userName"]; //必须是应用关联的小程序,注意要有@app后缀
@@ -28,7 +28,7 @@ Future<bool> shareImagePath(String path) { @@ -28,7 +28,7 @@ Future<bool> shareImagePath(String path) {
28 return FlutterWxworkPlatform.instance.shareImagePath(path); 28 return FlutterWxworkPlatform.instance.shareImagePath(path);
29 } 29 }
30 30
31 - Future<bool> shareMiniProgram( 31 + Future<dynamic> shareMiniProgram(
32 {String userName, //必须是应用关联的小程序,注意要有@app后缀 32 {String userName, //必须是应用关联的小程序,注意要有@app后缀
33 String path, 33 String path,
34 String hdImageData, 34 String hdImageData,
@@ -56,13 +56,13 @@ class MethodChannelFlutterWxwork extends FlutterWxworkPlatform { @@ -56,13 +56,13 @@ class MethodChannelFlutterWxwork extends FlutterWxworkPlatform {
56 } 56 }
57 57
58 @override 58 @override
59 - Future<bool> shareMiniProgram( 59 + Future<dynamic> shareMiniProgram(
60 {String userName, //必须是应用关联的小程序,注意要有@app后缀 60 {String userName, //必须是应用关联的小程序,注意要有@app后缀
61 String path, 61 String path,
62 String hdImageData, 62 String hdImageData,
63 String title = "分享标题", 63 String title = "分享标题",
64 String description= ""}) async { 64 String description= ""}) async {
65 - final shareMiniProgram = await methodChannel.invokeMethod<bool>( 65 + final shareMiniProgram = await methodChannel.invokeMethod<dynamic>(
66 'shareMiniProgram', <String, String>{ 66 'shareMiniProgram', <String, String>{
67 'userName': userName, 67 'userName': userName,
68 'path': path, 68 'path': path,
@@ -49,7 +49,7 @@ abstract class FlutterWxworkPlatform extends PlatformInterface { @@ -49,7 +49,7 @@ abstract class FlutterWxworkPlatform extends PlatformInterface {
49 throw UnimplementedError('auth() has not been implemented.'); 49 throw UnimplementedError('auth() has not been implemented.');
50 } 50 }
51 51
52 - Future<bool> shareMiniProgram( 52 + Future<dynamic> shareMiniProgram(
53 {String userName, //必须是应用关联的小程序,注意要有@app后缀 53 {String userName, //必须是应用关联的小程序,注意要有@app后缀
54 String path, 54 String path,
55 String hdImageData, 55 String hdImageData,