Commit f16782e90ec083e367bd343e9869834882b5b1bd

Authored by wdn127929
1 parent 4d7541b0

更换微信、过期优惠券自己显示自己

... ... @@ -699,7 +699,7 @@
CURRENT_PROJECT_VERSION = 5233;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
FLUTTER_BUILD_MODE = debug;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
... ...
... ... @@ -665,7 +665,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (couponProvider.couponSunModel.liteQrcode != null)
if (couponProvider.couponSunModel.liteQrcode != null &&
couponProvider.couponSunModel.isType == '1')
RoundButton(
text: '生成海报',
width: w(100),
... ... @@ -678,11 +679,27 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
isBold: true,
fontSize: 28,
onPressed: () async {
NavigatorUtil.goCouponPosterPage(
context,
widget.idstr,
couponProvider.couponSunModel.use,
couponProvider.couponSunModel);
if (couponProvider.couponSunModel.status != '1') {
Utils.showToast('请先启用优惠券后再进行操作!');
return;
}
// 谁可以发放
// 可以发放的才能分享
if (couponProvider.couponSunModel.uidList
.split(',')
.contains(Provider.of<UserModel>(context,
listen: false)
.user
.openid)) {
NavigatorUtil.goCouponPosterPage(
context,
widget.idstr,
couponProvider.couponSunModel.use,
couponProvider.couponSunModel);
} else {
Utils.showToast('您没有此权限');
}
},
),
if (couponProvider.couponSunModel.liteQrcode != null)
... ... @@ -702,11 +719,24 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
if (couponProvider.couponSunModel.isType == '1' &&
couponProvider.couponSunModel.status == '1') {
//店铺券
Utils.goShareBuyCouponToWeChat(
context,
widget.idstr,
couponProvider.couponSunModel.use,
couponProvider.couponSunModel);
// 谁可以发放
// 可以发放的才能分享
if (couponProvider.couponSunModel.uidList
.split(',')
.contains(Provider.of<UserModel>(context,
listen: false)
.user
.openid)) {
//包含当前登录人
Utils.goShareBuyCouponToWeChat(
context,
widget.idstr,
couponProvider.couponSunModel.use,
couponProvider.couponSunModel);
} else {
Utils.showToast('您没有此权限');
}
} else if (couponProvider.couponSunModel.isType ==
'2' &&
couponProvider.couponSunModel.status == '1') {
... ...
... ... @@ -11,11 +11,14 @@ import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../models/coupon_model.dart';
/**
* 历史券
*/
class CouponHistoryPage extends StatefulWidget {
CouponHistoryPage({Key key}) : super(key: key);
final int index;
CouponHistoryPage({Key key, this.index}) : super(key: key);
@override
_CouponHistoryPageState createState() => _CouponHistoryPageState();
... ... @@ -33,6 +36,27 @@ class _CouponHistoryPageState extends State<CouponHistoryPage> {
};
await couponProvider.getCustomerHistoryActivity(context, params,
isShowLoading: isShowLoading);
List<CouponSunModel> temp = []; //优惠券历史列表
if (widget.index == 1) {
//店铺历史优惠券
couponProvider.couponListHistory.forEach((element) {
if (element.isType == '1') {
temp.add(element);
}
});
couponProvider.couponListHistory = temp;
} else if (widget.index == 2) {
//店铺历史优惠券
couponProvider.couponListHistory.forEach((element) {
if (element.isType == '2') {
temp.add(element);
}
});
couponProvider.couponListHistory = temp;
}
setState(() {});
}
@override
... ...
... ... @@ -171,7 +171,7 @@ class _CouponSunPageState extends State<CouponSunPage> {
// getMessage(showLoading: true);
if (pageState == PageState.Empty) {
NavigatorUtil.goCouponHistoryPage(context);
NavigatorUtil.goCouponHistoryPage(context, widget.index);
} else {
_couponNetworkData(widget.index);
}
... ... @@ -213,7 +213,8 @@ class _CouponSunPageState extends State<CouponSunPage> {
children: [
InkWell(
onTap: () {
NavigatorUtil.goCouponHistoryPage(context);
NavigatorUtil.goCouponHistoryPage(
context, widget.index);
},
child: RichText(
text: TextSpan(
... ...
... ... @@ -1412,9 +1412,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
case AppLifecycleState.resumed: //应用前台可见
// if (widget.initialIndex == 1 && needRefreshTemp == false) {
// } else {
// _clearBadge(() {
_clearBadge(() {
// _getAllUnMessages();
// });
});
// }
break;
... ...
... ... @@ -279,7 +279,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
///获取二维码
_getWechatQrcode({bool need = false}) async {
String sid = Provider.of<UserModel>(context, listen: false).user.sellerid;
String id = Provider.of<UserModel>(context, listen: false).user.openid;
// String id = Provider.of<UserModel>(context, listen: false).user.openid;
// https: //xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode/sellerid/商家ID/uid/当前账号ID
Response response = await DioUtil.getInstance().getDio().get(
"https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=${data.id}");
... ... @@ -312,6 +312,10 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
userModel = Provider.of<UserModel>(context, listen: false);
personnelProvider = Provider.of<PersonnelProvider>(context, listen: true);
Color wechatColor = data?.openid == null || data?.openid == 'null'
? MyColours.color_438E93
: MyColours.color_8EBBBE;
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
... ... @@ -424,62 +428,62 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
Positioned(
top: ScreenUtil().setWidth(13 * 2),
left: ScreenUtil().setWidth(35 * 2),
child:
data?.headimgurl != null && data?.headimgurl != 'null'
? ClipRRect(
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(80)),
child: CachedNetworkImage(
imageUrl: data?.headimgurl,
child: data?.headimgurl != null &&
data?.headimgurl != 'null' &&
data?.headimgurl != ''
? ClipRRect(
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(80)),
child: CachedNetworkImage(
imageUrl: data?.headimgurl,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(80 * 2),
))
: Stack(alignment: Alignment.center, children: [
Container(
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(80 * 2),
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(80)))),
Align(
alignment: Alignment.center,
child: Image.asset(
Utils.getImgPath('personnal_no_image'),
fit: BoxFit.cover,
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(80 * 2),
))
: Stack(alignment: Alignment.center, children: [
Container(
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(80 * 2),
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(80)))),
Align(
alignment: Alignment.center,
child: Image.asset(
Utils.getImgPath('personnal_no_image'),
fit: BoxFit.cover,
width: ScreenUtil().setWidth(50 * 2),
height: ScreenUtil().setWidth(50 * 2)),
),
]),
width: ScreenUtil().setWidth(50 * 2),
height: ScreenUtil().setWidth(50 * 2)),
),
]),
)
],
),
VEmptyView(114),
data?.openid == null || data?.openid == 'null'
? RoundButton(
text: '绑定微信',
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(30 * 2),
fontSize: 32,
isBold: true,
textColor: MyColours.color_ffffff,
radius: ScreenUtil().setWidth(12),
onPressed: () {
if (dcAdduserCode != '' && dcAdduserCode != null) {
DialogUtil.openAlertDialogImage(
context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
} else {
_getWechatQrcode(need: true);
}
})
: SizedBox(),
data?.openid == null || data?.openid == 'null'
? VEmptyView(48)
: SizedBox(),
RoundButton(
text: data?.openid == null || data?.openid == 'null'
? '绑定微信'
: '更换微信',
gradientStart: wechatColor,
gradientEnd: wechatColor,
borderColor: wechatColor,
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(30 * 2),
fontSize: 32,
isBold: true,
textColor: MyColours.color_ffffff,
radius: ScreenUtil().setWidth(12),
onPressed: () {
if (dcAdduserCode != '' && dcAdduserCode != null) {
DialogUtil.openAlertDialogImage(
context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
} else {
_getWechatQrcode(need: true);
}
}),
VEmptyView(48),
InkWell(
onTap: () {
NavigatorUtil.goPersonnelPasswordEditPage(context,
... ...
... ... @@ -312,7 +312,8 @@ class _PersonnelManagePageState extends State<PersonnelManagePage> {
child: Row(
children: [
model.headimgurl != null &&
model.headimgurl != 'null'
model.headimgurl != 'null' &&
model.headimgurl != ''
? ClipRRect(
borderRadius:
BorderRadius.circular(
... ...
... ... @@ -268,8 +268,8 @@ class NavigatorUtil {
}
/// 优惠券历史列表
static void goCouponHistoryPage(BuildContext context, {replace = false}) {
_navigateTo(context, "${Routes.coupon_history}", replace: replace);
static void goCouponHistoryPage(BuildContext context,int index, {replace = false}) {
_navigateTo(context, "${Routes.coupon_history}?index=${index}", replace: replace);
}
/// 创建优惠券
... ...
... ... @@ -635,9 +635,9 @@ var handleCouponPageHandler = new Handler(
///优惠券历史列表
var handleCouponHistoryPageHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// String rid = params["rid"].first;
String index = params["index"].first;
// bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
return CouponHistoryPage();
return CouponHistoryPage(index: int.parse(index));
});
///创建优惠券
... ... @@ -3234,10 +3234,11 @@ var smsTemplateSettingPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// String rid = params["rid"].first;
String smsTemplate = params["smsTemplate"].first;
String bookinginfo = params["bookinginfo"].first;
String bookinginfo = params["bookinginfo"].first;
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
child: SmsTemplateSettingPage(smsTemplate: smsTemplate,bookinginfo:bookinginfo));
child: SmsTemplateSettingPage(
smsTemplate: smsTemplate, bookinginfo: bookinginfo));
});
//优惠券海报
... ...