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) {
def flutterVersionCode = "522"
def flutterVersionCode = "523"
if (flutterVersionCode == null) {
flutterVersionCode = '522'
flutterVersionCode = '523'
}
def flutterVersionName = "5.2.2"
def flutterVersionName = "5.2.3"
if (flutterVersionName == null) {
flutterVersionName = '5.2.2'
flutterVersionName = '5.2.3'
}
... ...
... ... @@ -34,4 +34,8 @@
-keep public class * extends android.app.Service
-keep class com.heytap.mcssdk.** {*;}
-keep class com.heytap.msp.push.** { *;}
-keep class com.tencent.wework.api.** {
*;
}
... ...
... ... @@ -53,6 +53,7 @@ class GetDzSellerConfSunModel {
String saiyouyun;
Bookinginfo bookinginfo;
String isAllowUpdate;
GetDzSellerConfSunModel(
{this.id,
... ... @@ -77,7 +78,8 @@ class GetDzSellerConfSunModel {
this.isNotice,
this.isMarketing,
this.saiyouyun,
this.bookinginfo});
this.bookinginfo,
this.isAllowUpdate});
GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
... ... @@ -107,6 +109,7 @@ class GetDzSellerConfSunModel {
bookinginfo = json['bookinginfo'] != null
? new Bookinginfo.fromJson(json['bookinginfo'])
: null;
isAllowUpdate = json['is_allow_update'] ?? '1';
}
Map<String, dynamic> toJson() {
... ... @@ -136,6 +139,7 @@ class GetDzSellerConfSunModel {
if (this.bookinginfo != null) {
data['bookinginfo'] = this.bookinginfo.toJson();
}
data['is_allow_update'] = this.isAllowUpdate;
return data;
}
... ...
... ... @@ -91,6 +91,8 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
? true
: false;
rechargeData =
marketingCenterProvider.markDataModel.marketing.rechargeData;
couponDataList =
... ...
... ... @@ -4693,15 +4693,15 @@ class InvicationPageState extends State<InvicationPage>
radius: ScreenUtil().setWidth(8),
isBold: false,
onPressed: () async {
bool isSuccess = await Utils.goShareInvicationToWeChat(
dynamic isSuccess = await Utils.goShareInvicationToWeChat(
context,
widget.rid,
Provider.of<UserModel>(context, listen: false).user.openid,
isWechat: false);
print(isSuccess);
if (isSuccess) {
// _addForward();
}
// if (isSuccess) {
// // _addForward();
// }
},
),
HEmptyView(20),
... ...
... ... @@ -54,6 +54,7 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
bool isCoupon = false; // 代金券
bool isRecharge = false; //充值券
RechargeListSunModel rechargeData;
String rechargeContent = '';
... ... @@ -161,6 +162,8 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
? true
: false;
rechargeData =
marketingCenterProvider.markDataModel.marketing.rechargeData;
couponDataList =
... ...
... ... @@ -40,6 +40,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
bool isLink = false; //充值优惠活动链接
bool isCoupon = false; // 代金券
bool isRecharge = false; //充值券
String welcome = '';
String qiniuUrl = '';
... ... @@ -90,6 +91,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
? true
: false;
rechargeData =
marketingCenterProvider.markDataModel.marketing.rechargeData;
... ... @@ -496,7 +498,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
// context,
// from: 'statistics',
// hasModify: false);
if (temp!= null && temp['coupon'] != null) {
if (temp != null && temp['coupon'] != null) {
couponDataListComments = temp['coupon'];
setState(() {});
... ...
... ... @@ -9,9 +9,11 @@ import '../../../models/recharge_list_model.dart';
import '../../../provider/marketing_center_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/MyDivider.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/v_empty_view.dart';
... ... @@ -44,15 +46,22 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
List<CouponSunModel> couponDataList = [];
bool isComments = false; //启用评价设置
bool isCommentsCoupon = false; //启用评价送券
bool isCommentsCoupon = false; //启用评价送券
List<CouponSunModel> couponDataListComments = [];
int indexSelect = 0;
List<String> timesData = [];
@override
void initState() {
super.initState();
timesData = ['不允许修改', '开餐1小时之前', '开餐2小时之前', '预订日期1天之前', '预订日期2天之前'];
WidgetsBinding.instance.addPostFrameCallback((_) {
getSellerTemplateConf();
_getDzSellerConf();
});
}
... ... @@ -113,6 +122,22 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
}
}
_getDzSellerConf() async {
await marketingCenterProvider.getDzSellerConf(context);
if (marketingCenterProvider.dzSellerConfModel != null) {
indexSelect =
int.parse(marketingCenterProvider.dzSellerConfModel.isAllowUpdate) -
1;
if (indexSelect < 0 || indexSelect > 4) {
indexSelect = 0;
}
setState(() {
});
}
}
///向客人开放提前点餐功能
_setOrderBtnShow() async {
... ... @@ -147,6 +172,58 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
}
}
Widget _itemWidget(String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Padding(
padding: EdgeInsets.only(
left: w(16), top: w(12), bottom: w(12), right: w(12)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: TextStyle(
color: MyColours.color_515151, fontSize: font(16)),
),
Spacer(),
Container(
padding:
EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)),
child: Image.asset(
Utils.getImgPath(isOrder ? 'swich_on' : 'swich_off'),
width: w(44),
),
)
// RoundButton(
// text: '预览',
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// borderColor: MyColours.color_438E93,
// textColor: MyColours.color_438E93,
// radius: ScreenUtil().setWidth(22),
// fontSize: 24,
// width: w(72),
// height: ScreenUtil().setWidth(44),
// isBold: true,
// onPressed: () {
// NavigatorUtil.goMarkingPreviewPage(context);
// },
// ),
])));
}
_setConfing() async {
await marketingCenterProvider.setConfing(
context,
{
'sid': Provider.of<UserModel>(context,listen: false).user.sellerid,
'key': 'is_allow_update',
'value': '${indexSelect + 1}'
},
needToast: false);
}
@override
Widget build(BuildContext context) {
marketingCenterProvider =
... ... @@ -160,52 +237,61 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
child: SingleChildScrollView(
child: Column(
children: [
_itemWidget('向客人开放提前点餐功能', onTap: () {
setState(() {
isOrder = !isOrder;
});
}),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(20),
InkWell(
onTap: () {
setState(() {
isOrder = !isOrder;
});
DialogUtil.showSelectCusmanDialog(context, timesData,
(value) {
if (value != null) {
setState(() {
indexSelect = value.first;
});
}
}, selecteds: indexSelect == null ? [] : [indexSelect])
.then((value) {});
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
top: w(14),
bottom: w(10),
right: w(12)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'向客人开放提前点餐功能',
'是否允许客人修改菜品',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
fontSize: font(14)),
),
Spacer(),
HEmptyView(20),
Expanded(
child: Text(
timesData[indexSelect],
textAlign: TextAlign.right,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)),
)),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
horizontal: w(11), vertical: w(4)),
child: Image.asset(
Utils.getImgPath(
isOrder ? 'swich_on' : 'swich_off'),
width: w(44),
"assets/arrow_right_new.png",
width: w(9),
height: w(16),
),
)
// RoundButton(
// text: '预览',
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// borderColor: MyColours.color_438E93,
// textColor: MyColours.color_438E93,
// radius: ScreenUtil().setWidth(22),
// fontSize: 24,
// width: w(72),
// height: ScreenUtil().setWidth(44),
// isBold: true,
// onPressed: () {
// NavigatorUtil.goMarkingPreviewPage(context);
// },
// ),
]))),
Padding(
padding: EdgeInsets.only(left: w(16)),
... ... @@ -228,6 +314,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
isBold: true,
onPressed: () async {
//调用接口
_setConfing();
_setOrderBtnShow();
})
],
... ...
... ... @@ -40,6 +40,7 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
bool isLink = false; //充值优惠活动链接
bool isCoupon = false; // 代金券
bool isRecharge = false; //充值券
String welcome = '';
String qiniuUrl = '';
... ... @@ -90,6 +91,7 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
? true
: false;
rechargeData =
marketingCenterProvider.markDataModel.marketing.rechargeData;
... ...
... ... @@ -2089,6 +2089,8 @@ class Utils {
isSuccess = await shareToWeChat(model);
} else {
Loading.showLoading(context);
String _path =
"pages/customer/index.html?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid";
FlutterWxwork flutterWxwork = FlutterWxwork();
... ... @@ -2100,17 +2102,19 @@ class Utils {
print(registerResult);
// isSuccess = await flutterWxwork.shareText(text: "dddddddd");
isSuccess = await flutterWxwork.shareMiniProgram(
dynamic isSuccess = await flutterWxwork.shareMiniProgram(
userName: 'gh_487873d353b3@app',
path: _path,
hdImageData: _thumbnail,
title: _title,
description: _description,
);
Loading.hideLoading(context);
// var isSuccess = await flutterWxwork.shareImage();
print(isSuccess);
} else {
Loading.hideLoading(context);
Utils.showToast('未安装企业微信');
}
}
... ...
rootProject.name = 'flutter_wxwork'
include ':lib:wxwork',//新增,写上你新写的module
include ':lib:wxwork'//新增,写上你新写的module
... ...
... ... @@ -37,6 +37,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
import android.view.View;
import java.io.FileOutputStream;
... ... @@ -61,6 +62,8 @@ import java.util.Map;
/**
* FlutterWxworkPlugin
*/
... ... @@ -83,12 +86,19 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "flutter_wxwork");
channel.setMethodCallHandler(this);
context = flutterPluginBinding.getApplicationContext();
iwwapi = WWAPIFactory.createWWAPI(context);
}
@Override
... ... @@ -152,6 +162,11 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
} else if (call.method.equals("shareImagePath")) {
}else if (call.method.equals("shareMiniProgram")) {
WWMediaMiniProgram miniProgram = new WWMediaMiniProgram();
miniProgram.appPkg = "com.naji.one_key";
miniProgram.appName = "周到安排商家";//app name of this android pkg
... ... @@ -178,9 +193,12 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
// 在这里处理下载到的Bitmap对象
// miniProgram.hdImageData = getBytesFromBitmap(bitmap);
miniProgram.title = arguments.get("title");
// 数据加载完毕后隐藏加载动画
result.success(true);
iwwapi.sendMessage(miniProgram, new IWWAPIEventHandler() {
@Override
public void handleResp(BaseMessage resp) {
if(resp instanceof WWSimpleRespMessage){
WWSimpleRespMessage rsp = (WWSimpleRespMessage)resp;
// String t = "";
... ... @@ -193,7 +211,9 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
map.put("errCode", String.valueOf(rsp.errMsg));
result.success(map);
// result.success(map);
}else{
// result.success(true);
}
}
});
... ... @@ -293,6 +313,8 @@ public class FlutterWxworkPlugin implements FlutterPlugin, MethodCallHandler {
}
// 转换图片格式为字节数组
public static byte[] bmpToByteArray(final Bitmap bmp, final boolean needRecycle) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
\ No newline at end of file
... ... @@ -25,7 +25,7 @@ FlutterMethodChannel *channel;
NSString *scheme = dic[@"scheme"];
NSString *corpId = dic[@"corpId"];
NSString *agentId = dic[@"agentId"];
result([NSString stringWithFormat:@"%hhd",[WWKApi registerApp:scheme corpId:corpId agentId:agentId]]);
result(@([WWKApi registerApp:scheme corpId:corpId agentId:agentId]));
} else if ([@"auth" isEqualToString:call.method]){
WWKSSOReq *req = [[WWKSSOReq alloc] init];
// state参数为这次请求的唯一标示,客户端需要维护其唯一性。SSO回调时会原样返回
... ... @@ -205,8 +205,8 @@ FlutterMethodChannel *channel;
NSData *imageData = data;
dispatch_async(dispatch_get_main_queue(), ^{
NSMutableDictionary *mDic = [[NSMutableDictionary alloc]init];
result(mDic);
WWKSendMessageReq *req = [[WWKSendMessageReq alloc] init];
WWKMessageMiniAppAttachment *attachment = [[WWKMessageMiniAppAttachment alloc] init];
attachment.userName = call.arguments[@"userName"]; //必须是应用关联的小程序,注意要有@app后缀
... ...
... ... @@ -28,7 +28,7 @@ Future<bool> shareImagePath(String path) {
return FlutterWxworkPlatform.instance.shareImagePath(path);
}
Future<bool> shareMiniProgram(
Future<dynamic> shareMiniProgram(
{String userName, //必须是应用关联的小程序,注意要有@app后缀
String path,
String hdImageData,
... ...
... ... @@ -56,13 +56,13 @@ class MethodChannelFlutterWxwork extends FlutterWxworkPlatform {
}
@override
Future<bool> shareMiniProgram(
Future<dynamic> shareMiniProgram(
{String userName, //必须是应用关联的小程序,注意要有@app后缀
String path,
String hdImageData,
String title = "分享标题",
String description= ""}) async {
final shareMiniProgram = await methodChannel.invokeMethod<bool>(
final shareMiniProgram = await methodChannel.invokeMethod<dynamic>(
'shareMiniProgram', <String, String>{
'userName': userName,
'path': path,
... ...
... ... @@ -49,7 +49,7 @@ abstract class FlutterWxworkPlatform extends PlatformInterface {
throw UnimplementedError('auth() has not been implemented.');
}
Future<bool> shareMiniProgram(
Future<dynamic> shareMiniProgram(
{String userName, //必须是应用关联的小程序,注意要有@app后缀
String path,
String hdImageData,
... ...