Commit 3a7b72d487ae45ffc566d52845d614f53079d060

Authored by wdn127929
1 parent 433f8f98

客户经理转发记录订座详情页修改订单和查看电话号码权限

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "274"
def flutterVersionCode = "275"
if (flutterVersionCode == null) {
flutterVersionCode = '274'
flutterVersionCode = '275'
}
def flutterVersionName = "2.7.4"
def flutterVersionName = "2.7.5"
if (flutterVersionName == null) {
flutterVersionName = '2.7.4'
flutterVersionName = '2.7.5'
}
apply plugin: 'com.android.application'
... ...
import 'package:json_annotation/json_annotation.dart';
part 'add_forward_model.g.dart';
@JsonSerializable()
class AddForwardModel extends Object {
@JsonKey(name: 'ret')
int ret;
@JsonKey(name: 'data')
AddForwardSunModel data;
@JsonKey(name: 'msg')
String msg;
AddForwardModel(
this.ret,
this.data,
this.msg,
);
factory AddForwardModel.fromJson(Map<String, dynamic> srcJson) =>
_$AddForwardModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$AddForwardModelToJson(this);
}
@JsonSerializable()
class AddForwardSunModel extends Object {
@JsonKey(name: 'uid')
int uid;
@JsonKey(name: 'rid')
int rid;
@JsonKey(name: 'sid')
int sid;
@JsonKey(name: 'cdate')
int cdate;
@JsonKey(name: 'id')
String id;
AddForwardSunModel(
this.uid,
this.rid,
this.sid,
this.cdate,
this.id,
);
factory AddForwardSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$AddForwardSunModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$AddForwardSunModelToJson(this);
}
... ...
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'add_forward_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AddForwardModel _$AddForwardModelFromJson(Map<String, dynamic> json) {
return AddForwardModel(
json['ret'] as int,
json['data'] == null
? null
: AddForwardSunModel.fromJson(json['data'] as Map<String, dynamic>),
json['msg'] as String,
);
}
Map<String, dynamic> _$AddForwardModelToJson(AddForwardModel instance) =>
<String, dynamic>{
'ret': instance.ret,
'data': instance.data,
'msg': instance.msg,
};
AddForwardSunModel _$AddForwardSunModelFromJson(Map<String, dynamic> json) {
return AddForwardSunModel(
json['uid'] as int,
json['rid'] as int,
json['sid'] as int,
json['cdate'] as int,
json['id'] as String,
);
}
Map<String, dynamic> _$AddForwardSunModelToJson(AddForwardSunModel instance) =>
<String, dynamic>{
'uid': instance.uid,
'rid': instance.rid,
'sid': instance.sid,
'cdate': instance.cdate,
'id': instance.id,
};
... ...
... ... @@ -8,6 +8,7 @@ class Message {
Message();
String id;
String uid;
dynamic message_type;
String handle_time; //10在线预订 11取消预订
String read_time;
... ...
... ... @@ -9,6 +9,7 @@ part of 'message.dart';
Message _$MessageFromJson(Map<String, dynamic> json) {
return Message()
..id = json['id'] as String
..uid = json['uid'] as String
..message_type = json['message_type']
..handle_time = json['handle_time'] as String
..read_time = json['read_time'] as String
... ... @@ -28,6 +29,7 @@ Message _$MessageFromJson(Map<String, dynamic> json) {
Map<String, dynamic> _$MessageToJson(Message instance) => <String, dynamic>{
'id': instance.id,
'uid': instance.uid,
'message_type': instance.message_type,
'handle_time': instance.handle_time,
'read_time': instance.read_time,
... ...
... ... @@ -12,6 +12,7 @@ class Notebook {
String orderid;
String openid;
String sid;
String uid;
String room_demand;
String tid;
String pnum;
... ... @@ -140,6 +141,9 @@ class OrderInfo extends Object {
@JsonKey(name: 'sid')
String sid;
@JsonKey(name: 'uid')
String uid;
@JsonKey(name: 'rid')
String rid;
... ... @@ -209,6 +213,7 @@ class OrderInfo extends Object {
this.outTradeNo,
this.openid,
this.sid,
this.uid,
this.rid,
this.sellername,
this.tablename,
... ...
... ... @@ -12,6 +12,7 @@ Notebook _$NotebookFromJson(Map<String, dynamic> json) {
..orderid = json['orderid'] as String
..openid = json['openid'] as String
..sid = json['sid'] as String
..uid = json['uid'] as String
..room_demand = json['room_demand'] as String
..tid = json['tid'] as String
..pnum = json['pnum'] as String
... ... @@ -54,6 +55,7 @@ Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{
'orderid': instance.orderid,
'openid': instance.openid,
'sid': instance.sid,
'uid': instance.uid,
'room_demand': instance.room_demand,
'tid': instance.tid,
'pnum': instance.pnum,
... ... @@ -96,6 +98,7 @@ OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
json['out_trade_no'] as String,
json['openid'] as String,
json['sid'] as String,
json['uid'] as String,
json['rid'] as String,
json['sellername'] as String,
json['tablename'] as String,
... ... @@ -125,6 +128,7 @@ Map<String, dynamic> _$OrderInfoToJson(OrderInfo instance) => <String, dynamic>{
'out_trade_no': instance.outTradeNo,
'openid': instance.openid,
'sid': instance.sid,
'uid': instance.uid,
'rid': instance.rid,
'sellername': instance.sellername,
'tablename': instance.tablename,
... ...
... ... @@ -74,6 +74,7 @@ class NotebookDetail {
}
String id;
String uid;
String abolition;
String tableinfo;
String pnum;
... ...
... ... @@ -9,6 +9,7 @@ part of 'notebook_detail.dart';
NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
return NotebookDetail()
..id = json['id'] as String
..uid = json['uid'] as String
..tableinfo = json['tableinfo'] as String
..abolition = json['abolition'] as String
..pnum = json['pnum'] as String
... ...
... ... @@ -106,5 +106,7 @@ class HttpUrl {
static const String get_area_by_sellerid =
"?service=App.Tables.GetRegionBySellerid"; // 获取区域列表
static const String add_table = "?service=App.Tables.AddTable"; // 添加商家桌位信息
static const String add_forward =
"?service=App.Activity.AddForward"; // 客户经理转发记录
}
... ...
... ... @@ -102,7 +102,8 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
//已拒绝
//已处理
Future.delayed(Duration(milliseconds: 200), () {
NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,
NavigatorUtil.goNotebookDetailPage(
context, detailEntity.id, detailEntity.uid,
fromNotify: widget.fromNotify, replace: true);
});
setMessageStatus();
... ... @@ -359,7 +360,8 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
"status": status, //5安排包间 6 拒绝订单
"tid": tid,
"mid": widget.mid,
"cause": json.encode(causeMap)
"cause": json.encode(causeMap),
"uid": userModel.user.openid,
};
if (status == "6") {
isPause = (ac == "1" ? true : false);
... ...
... ... @@ -36,9 +36,10 @@ import '../../app.dart';
class NotebookDetailPage extends StatefulWidget {
final String rid;
final String mid;
final String uid;
final bool fromNotify;
NotebookDetailPage(this.rid, {this.fromNotify = false, this.mid});
NotebookDetailPage(this.rid, {this.fromNotify = false, this.mid, this.uid});
@override
State<StatefulWidget> createState() {
... ... @@ -191,7 +192,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
"status": status, //5安排包间 6 拒绝订单
"tid": tid,
// "mid": widget.mid,
"cause": json.encode(causeMap)
"cause": json.encode(causeMap),
"uid": userModel.user.openid,
};
bool success =
await detailModel.setReserveStatus(context, params, ifPush: false);
... ... @@ -452,7 +454,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
_onlineCheckEditProvider =
Provider.of<OnlineCheckEditProvider>(context, listen: true);
UserModel userModel = Provider.of<UserModel>(context, listen: false);
print(userModel.user.role_name);
print(userModel.user.openid);
print(widget.rid);
print(widget.uid);
return Scaffold(
body: SafeArea(
child: WillPopScope(
... ... @@ -615,8 +621,15 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
DialogUtil.goPhone(formatPhone);
}
},
child:
RowMultiText("客户电话", formatPhone),
child: RowMultiText(
"客户电话",
userModel.user.role_name !=
'管理员' &&
widget.uid != "null" &&
widget.uid !=
userModel.user.openid
? Utils.starPhone(formatPhone)
: formatPhone),
),
Offstage(
offstage: detailEntity.cusdem == '' ||
... ... @@ -1045,7 +1058,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
horizontal: ScreenUtil().setHeight(40)),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_199095,
color: userModel.user.role_name != '管理员' &&
widget.uid != "null" &&
widget.uid != userModel.user.openid
? MyColours.color_999999
: MyColours.color_199095,
width: ScreenUtil().setWidth(2)),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10)),
... ... @@ -1058,18 +1075,46 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
Expanded(
child: _cancelAndChangeBtn(() {
print('点击变更预订');
NavigatorUtil.goNoteBookChangePage(
context, detailEntity, widget.rid);
}, '变更预订')),
if (userModel.user.role_name != '管理员' &&
widget.uid != "null" &&
widget.uid != userModel.user.openid) {
} else {
NavigatorUtil.goNoteBookChangePage(
context, detailEntity, widget.rid);
}
}, '变更预订',
fontColor: userModel.user.role_name !=
'管理员' &&
widget.uid != "null" &&
widget.uid !=
userModel.user.openid
? MyColours.color_999999
: MyColours.color_199095)),
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setWidth(50),
color: MyColours.color_199095,
color: userModel.user.role_name != '管理员' &&
widget.uid != "null" &&
widget.uid != userModel.user.openid
? MyColours.color_999999
: MyColours.color_199095,
),
Expanded(
child: _cancelAndChangeBtn(() {
_showCancelWidget(context);
}, '取消预订')),
if (userModel.user.role_name != '管理员' &&
widget.uid != "null" &&
widget.uid != userModel.user.openid) {
} else {
_showCancelWidget(context);
}
}, '取消预订',
fontColor: userModel.user.role_name !=
'管理员' &&
widget.uid != "null" &&
widget.uid !=
userModel.user.openid
? MyColours.color_999999
: MyColours.color_199095)),
],
)),
),
... ...
... ... @@ -125,7 +125,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
fromNotify: true);
break;
case "11":
NavigatorUtil.goNotebookDetailPage(context, notifyParam['rid'],
NavigatorUtil.goNotebookDetailPage(
context, notifyParam['rid'], notifyParam["uid"],
mid: notifyParam['mid'], fromNotify: true);
break;
case "12":
... ... @@ -251,7 +252,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
break;
case "11":
NavigatorUtil.goNotebookDetailPage(
context, custom['rid'].toString(),
context, custom['rid'].toString(), custom["uid"].toString(),
mid: custom['mid'].toString(), fromNotify: true);
break;
case "12":
... ...
... ... @@ -323,6 +323,21 @@ class InvicationPageState extends State<InvicationPage> {
await couponProvider.sendSms(context, params);
}
// 客户经理转发记录
_addForward() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"rid": widget.rid,
"sid": userModel.user.sellerid,
"uid": userModel.user.openid
};
bool success = await couponProvider.addForwardAsReserve(context, params);
if (success) {
print('yes');
}
}
@override
Widget build(BuildContext context) {
// Utils.changeStatusColor(color: Colors.transparent);
... ... @@ -870,6 +885,9 @@ class InvicationPageState extends State<InvicationPage> {
.user
.openid);
print(isSuccess);
if (isSuccess) {
_addForward();
}
// couponProvider.couponsShow = [];
// couponProvider.couponsShow
// .addAll(couponProvider.coupons);
... ... @@ -884,7 +902,9 @@ class InvicationPageState extends State<InvicationPage> {
listen: false)
.user
.openid);
print(isSuccess);
if (isSuccess) {
_addForward();
}
}
},
),
... ...
... ... @@ -66,12 +66,12 @@ class MessageDialogItem extends StatelessWidget {
if (isTreated) {
if (message.message_type == "10") {
NavigatorUtil.goNotebookDetailPage(
context, message.rid.toString());
context, message.rid.toString(),message.uid);
} else if (message.message_type == "1") {
NavigatorUtil.goHasOrderFoodPage(context, rid: message.rid);
} else if (message.message_type == "11") {
NavigatorUtil.goNotebookDetailPage(
context, message.rid.toString());
context, message.rid.toString(),message.uid);
} else if (message.message_type == "12") {
//在线买单消息查看
NavigatorUtil.goOnlineCheckDetailPage(context,
... ... @@ -185,7 +185,7 @@ class MessageDialogItem extends StatelessWidget {
: false);
} else if (message.message_type == "11") {
NavigatorUtil.goNotebookDetailPage(
context, message.rid.toString(),
context, message.rid.toString(),message.uid,
replace: messageDialogModel.messages.isEmpty
? true
: false);
... ...
... ... @@ -56,12 +56,12 @@ class MessageItem extends StatelessWidget {
if (isTreated) {
if (message.message_type == "10") {
NavigatorUtil.goNotebookDetailPage(
context, message.rid.toString());
context, message.rid.toString(), message.uid);
} else if (message.message_type == "1") {
NavigatorUtil.goHasOrderFoodPage(context, rid: message.rid);
} else if (message.message_type == "11") {
NavigatorUtil.goNotebookDetailPage(
context, message.rid.toString());
context, message.rid.toString(), message.uid);
} else if (message.message_type == "12") {
//在线买单消息查看
NavigatorUtil.goOnlineCheckDetailPage(context,
... ... @@ -173,7 +173,7 @@ class MessageItem extends StatelessWidget {
context, message.rid.toString(), message.id);
} else if (message.message_type == "11") {
NavigatorUtil.goNotebookDetailPage(
context, message.rid.toString());
context, message.rid.toString(), message.uid);
bus.emit("remove_untreated_message", message.id);
Map<String, String> params = {
... ...
... ... @@ -57,7 +57,8 @@ class NotebookItemState extends State<NoteBookItem> {
GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
NavigatorUtil.goNotebookDetailPage(context, notebook.id);
NavigatorUtil.goNotebookDetailPage(
context, notebook.id, notebook.uid);
},
child: Row(
children: <Widget>[
... ...
... ... @@ -239,8 +239,10 @@ class TableManagerPageState extends State<TableManagerPage> {
if (value != null) {
switch (value) {
case 1: //查看详情
NavigatorUtil.goNotebookDetailPage(context,
tableManagerModel.tableMap[table.id].id);
NavigatorUtil.goNotebookDetailPage(
context,
tableManagerModel.tableMap[table.id].id,
tableManagerModel.tableMap[table.id].uid);
break;
case 2: //订座
NavigatorUtil.goNoteBookChangePage(
... ...
... ... @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/constant/error.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/add_forward_model.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/models/wx_send_sms_model.dart';
import 'package:one_key/net/dio_util.dart';
... ... @@ -476,4 +477,34 @@ class CouponProvider with ChangeNotifier {
Utils.showToast(baseResp.msg ?? "");
}
}
/// 客户经理转发记录
Future<dynamic> addForwardAsReserve(
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.add_forward,
data: params, showLoading: isShowLoading, needHeader: false)
.catchError((error) {
print(error.toString());
if (error is MyError) {}
return false;
});
AddForwardSunModel sunModel;
if (baseResp.code == Constant.status_success) {
if (baseResp.data != null) {
sunModel = AddForwardModel.fromJson(baseResp.responseData).data;
return true;
} else {
// Utils.showToast(baseResp.msg ?? "修改失败");
return false;
}
} else {
if (baseResp != null) {
// Utils.showToast(baseResp.msg ?? "");
}
return false;
}
}
}
... ...
... ... @@ -608,7 +608,8 @@ class EnterModel with ChangeNotifier {
"rdate": rdate, //预定用餐时间范围:时间戳 开始时间戳(time)-结束时间戳(time)
"ddate": '$ddate'.substring(0, 10), //到店时间
"ddate_solt": ddateSolt,
"channel":'5'
"channel":'5',
"uid":userModel.user.openid
};
print(params.toString());
BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
... ...
... ... @@ -649,7 +649,8 @@ class HomeEnterModel with ChangeNotifier {
"rdate": rdate, //预定用餐时间范围:时间戳 开始时间戳(time)-结束时间戳(time)
"ddate": '${ddate}'.substring(0, 10), //到店时间
'is_set_ddate': '1',
"channel": '5'
"channel": '5',
"uid": userModel.user.openid
};
print(params);
... ...
... ... @@ -658,7 +658,8 @@ class NotebookDetailChangeModel with ChangeNotifier {
"rdate": rdate, //预定用餐时间范围:时间戳 开始时间戳(time)-结束时间戳(time)
"ddate": '${ddate}'.substring(0, 10), //到店时间
'is_set_ddate': "1",
"channel": '5'
"channel": '5',
"uid": userModel.user.openid
};
if (detailEntity.id.isNotEmpty && detailEntity.id != "-1") {
params['rid'] = detailEntity.id;
... ...
... ... @@ -105,10 +105,12 @@ class NotebookDetailModel extends ChangeNotifier {
.catchError((error) {
print(error.toString());
});
if (baseResp == null)return false;
if (baseResp.code == Constant.status_success&&baseResp.data!=null) {
if (baseResp == null) return false;
if (baseResp.code == Constant.status_success && baseResp.data != null) {
if (ifPush) {
NavigatorUtil.goNotebookDetailPage(context, params["rid"],
UserModel userModel = Provider.of<UserModel>(context, listen: false);
NavigatorUtil.goNotebookDetailPage(
context, params["rid"], userModel.user.openid,
replace: true);
}
return true;
... ...
... ... @@ -41,10 +41,10 @@ class NavigatorUtil {
}
/// 订单详情
static void goNotebookDetailPage(BuildContext context, String rid,
static void goNotebookDetailPage(BuildContext context, String rid,String uid,
{String mid = "", bool fromNotify = false, replace = false}) {
_navigateTo(context,
"${Routes.reserve_detail}?rid=$rid&mid=$mid&fromNotify=$fromNotify",
"${Routes.reserve_detail}?rid=$rid&mid=$mid&uid=$uid&fromNotify=$fromNotify",
replace: replace);
}
... ...
... ... @@ -80,12 +80,14 @@ var reserveDetailHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
String rid = params['rid'].first;
String mid = params['mid'].first;
String uid = params['uid'].first;
bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
return ChangeNotifierProvider<NotebookDetailModel>(
create: (_) => NotebookDetailModel(),
child: NotebookDetailPage(
rid,
mid: mid,
uid: uid,
fromNotify: fromNotify,
));
});
... ...