Showing
5 changed files
with
91 additions
and
76 deletions
| @@ -10,10 +10,10 @@ class Constant { | @@ -10,10 +10,10 @@ class Constant { | ||
| 10 | * | 10 | * |
| 11 | * 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!! | 11 | * 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!! |
| 12 | * */ | 12 | * */ |
| 13 | - static const WXMiniProgramType wxMiniProgramType = | ||
| 14 | - WXMiniProgramType.release; //正式版 | ||
| 15 | // static const WXMiniProgramType wxMiniProgramType = | 13 | // static const WXMiniProgramType wxMiniProgramType = |
| 16 | - // WXMiniProgramType.preview; //体验版 | 14 | + // WXMiniProgramType.release; //正式版 |
| 15 | + static const WXMiniProgramType wxMiniProgramType = | ||
| 16 | + WXMiniProgramType.preview; //体验版 | ||
| 17 | // static const WXMiniProgramType wxMiniProgramType = | 17 | // static const WXMiniProgramType wxMiniProgramType = |
| 18 | // WXMiniProgramType.test; //开发版 | 18 | // WXMiniProgramType.test; //开发版 |
| 19 | 19 |
| 1 | - | ||
| 2 | import 'dart:convert'; | 1 | import 'dart:convert'; |
| 3 | 2 | ||
| 3 | +import 'package:common_utils/common_utils.dart'; | ||
| 4 | + | ||
| 4 | class MealListModel { | 5 | class MealListModel { |
| 5 | int? ret; | 6 | int? ret; |
| 6 | List<MealListSunModel>? data; | 7 | List<MealListSunModel>? data; |
| @@ -43,6 +44,7 @@ class MealListSunModel { | @@ -43,6 +44,7 @@ class MealListSunModel { | ||
| 43 | List<DateStrModel>? dateStr; | 44 | List<DateStrModel>? dateStr; |
| 44 | String? status; | 45 | String? status; |
| 45 | String? cdate; | 46 | String? cdate; |
| 47 | + dynamic isFlag; | ||
| 46 | 48 | ||
| 47 | MealListSunModel( | 49 | MealListSunModel( |
| 48 | {this.id, | 50 | {this.id, |
| @@ -51,7 +53,8 @@ class MealListSunModel { | @@ -51,7 +53,8 @@ class MealListSunModel { | ||
| 51 | this.dateSel, | 53 | this.dateSel, |
| 52 | this.dateStr, | 54 | this.dateStr, |
| 53 | this.status, | 55 | this.status, |
| 54 | - this.cdate}); | 56 | + this.cdate, |
| 57 | + this.isFlag}); | ||
| 55 | 58 | ||
| 56 | MealListSunModel.fromJson(Map<String, dynamic> json) { | 59 | MealListSunModel.fromJson(Map<String, dynamic> json) { |
| 57 | if (json["id"] is String) { | 60 | if (json["id"] is String) { |
| @@ -86,6 +89,15 @@ class MealListSunModel { | @@ -86,6 +89,15 @@ class MealListSunModel { | ||
| 86 | if (json["cdate"] is String) { | 89 | if (json["cdate"] is String) { |
| 87 | cdate = json["cdate"]; | 90 | cdate = json["cdate"]; |
| 88 | } | 91 | } |
| 92 | + isFlag = json["is_flag"] ?? '0'; | ||
| 93 | + // if (type == '1' && dateSel != null) { | ||
| 94 | + // List<String> date = dateSel!.split(','); | ||
| 95 | + // date.map((item) { | ||
| 96 | + // String timeStr = item + ' ' + "00:00:00"; | ||
| 97 | + // int? ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳 | ||
| 98 | + | ||
| 99 | + // }); | ||
| 100 | + // } | ||
| 89 | } | 101 | } |
| 90 | 102 | ||
| 91 | Map<String, dynamic> toJson() { | 103 | Map<String, dynamic> toJson() { |
| @@ -97,6 +109,7 @@ class MealListSunModel { | @@ -97,6 +109,7 @@ class MealListSunModel { | ||
| 97 | _data["date_str"] = dateStr; | 109 | _data["date_str"] = dateStr; |
| 98 | _data["status"] = status; | 110 | _data["status"] = status; |
| 99 | _data["cdate"] = cdate; | 111 | _data["cdate"] = cdate; |
| 112 | + _data["is_flag"] = isFlag; | ||
| 100 | return _data; | 113 | return _data; |
| 101 | } | 114 | } |
| 102 | } | 115 | } |
| @@ -567,7 +567,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -567,7 +567,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 567 | // position = '请填写职位'; | 567 | // position = '请填写职位'; |
| 568 | // phone = '请填写电话'; | 568 | // phone = '请填写电话'; |
| 569 | // qiniuUrl = ''; | 569 | // qiniuUrl = ''; |
| 570 | - _setCustomerActivityBaseinfo(); | 570 | + // _setCustomerActivityBaseinfo(); |
| 571 | } | 571 | } |
| 572 | 572 | ||
| 573 | if (detailModel.reserveImgText != null) { | 573 | if (detailModel.reserveImgText != null) { |
| @@ -1772,38 +1772,38 @@ class InvicationPageState extends State<InvicationPage> | @@ -1772,38 +1772,38 @@ class InvicationPageState extends State<InvicationPage> | ||
| 1772 | // } | 1772 | // } |
| 1773 | 1773 | ||
| 1774 | //客户经理添加/修改基本信息 | 1774 | //客户经理添加/修改基本信息 |
| 1775 | - _setCustomerActivityBaseinfo() async { | ||
| 1776 | - Map<String, String?> params = { | ||
| 1777 | - 'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid, | ||
| 1778 | - "uid": Provider.of<UserModel>(context, listen: false).user!.openid, | ||
| 1779 | - "name": user!.sellername, | ||
| 1780 | - "photo": user!.sellerimage != '' && user!.sellerimage != null | ||
| 1781 | - ? user!.sellerimage | ||
| 1782 | - : 'http://nosqn.colorcun.com/yd_person.png', | ||
| 1783 | - "position": '经理', | ||
| 1784 | - 'phone': user!.sellerphone ?? '' | ||
| 1785 | - }; | ||
| 1786 | - if (user!.userphone != null) { | ||
| 1787 | - params['phone'] = user!.userphone; | ||
| 1788 | - } | 1775 | + // _setCustomerActivityBaseinfo() async { |
| 1776 | + // Map<String, String?> params = { | ||
| 1777 | + // 'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid, | ||
| 1778 | + // "uid": Provider.of<UserModel>(context, listen: false).user!.openid, | ||
| 1779 | + // "name": user!.sellername, | ||
| 1780 | + // "photo": user!.sellerimage != '' && user!.sellerimage != null | ||
| 1781 | + // ? user!.sellerimage | ||
| 1782 | + // : 'http://nosqn.colorcun.com/yd_person.png', | ||
| 1783 | + // "position": '经理', | ||
| 1784 | + // 'phone': user!.sellerphone ?? '' | ||
| 1785 | + // }; | ||
| 1786 | + // if (user!.userphone != null) { | ||
| 1787 | + // params['phone'] = user!.userphone; | ||
| 1788 | + // } | ||
| 1789 | 1789 | ||
| 1790 | - bool isSuccess = await _baseIndoProvider | ||
| 1791 | - .setCustomerActivityBaseinfo(context, params, isShowLoading: false); | ||
| 1792 | - // detailModel.baseInfoSunModel = null; | ||
| 1793 | - if (isSuccess) { | ||
| 1794 | - name = user!.sellername; | ||
| 1795 | - qiniuUrl = user!.sellerimage != '' && user!.sellerimage != null | ||
| 1796 | - ? user!.sellerimage | ||
| 1797 | - : 'http://nosqn.colorcun.com/yd_person.png'; | ||
| 1798 | - // _uploadImageProvider.erweima.qiniuUrl = | ||
| 1799 | - // detailModel.baseInfoSunModel.qrcode; | ||
| 1800 | - phone = user!.userphone != null ? user!.userphone : '填写电话'; | ||
| 1801 | - position = '经理'; | ||
| 1802 | - _getReserveDetailRelationData(); | 1790 | + // bool isSuccess = await _baseIndoProvider |
| 1791 | + // .setCustomerActivityBaseinfo(context, params, isShowLoading: false); | ||
| 1792 | + // // detailModel.baseInfoSunModel = null; | ||
| 1793 | + // if (isSuccess) { | ||
| 1794 | + // name = user!.sellername; | ||
| 1795 | + // qiniuUrl = user!.sellerimage != '' && user!.sellerimage != null | ||
| 1796 | + // ? user!.sellerimage | ||
| 1797 | + // : 'http://nosqn.colorcun.com/yd_person.png'; | ||
| 1798 | + // // _uploadImageProvider.erweima.qiniuUrl = | ||
| 1799 | + // // detailModel.baseInfoSunModel.qrcode; | ||
| 1800 | + // phone = user!.userphone != null ? user!.userphone : '填写电话'; | ||
| 1801 | + // position = '经理'; | ||
| 1802 | + // _getReserveDetailRelationData(); | ||
| 1803 | 1803 | ||
| 1804 | - setState(() {}); | ||
| 1805 | - } | ||
| 1806 | - } | 1804 | + // setState(() {}); |
| 1805 | + // } | ||
| 1806 | + // } | ||
| 1807 | 1807 | ||
| 1808 | // _getCustomerActivityBaseinfo() async { | 1808 | // _getCustomerActivityBaseinfo() async { |
| 1809 | // Map<String, String?> params = { | 1809 | // Map<String, String?> params = { |
| 1 | - | ||
| 2 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 3 | import 'package:one_key/models/meal_list_model.dart'; | 2 | import 'package:one_key/models/meal_list_model.dart'; |
| 4 | import 'package:one_key/provider/user_model.dart'; | 3 | import 'package:one_key/provider/user_model.dart'; |
| @@ -133,8 +132,6 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { | @@ -133,8 +132,6 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { | ||
| 133 | String str = e.replaceAll(' ', ''); | 132 | String str = e.replaceAll(' ', ''); |
| 134 | List strlist = str.split('-'); | 133 | List strlist = str.split('-'); |
| 135 | 134 | ||
| 136 | - | ||
| 137 | - | ||
| 138 | return str + | 135 | return str + |
| 139 | ' ${Utils.lunarCalendarHolidaysShow(DateTime(int.parse(strlist[0]), int.parse(strlist[1]), int.parse(strlist[2])))}'; | 136 | ' ${Utils.lunarCalendarHolidaysShow(DateTime(int.parse(strlist[0]), int.parse(strlist[1]), int.parse(strlist[2])))}'; |
| 140 | }).join(' ') | 137 | }).join(' ') |
| @@ -145,8 +142,10 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { | @@ -145,8 +142,10 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { | ||
| 145 | 142 | ||
| 146 | return InkWell( | 143 | return InkWell( |
| 147 | onTap: () { | 144 | onTap: () { |
| 148 | - NavigatorUtil.goBookTimeSettingEditPage(context, | ||
| 149 | - sunModel: sunModel); | 145 | + if ('${sunModel.isFlag}' != '1') { |
| 146 | + NavigatorUtil.goBookTimeSettingEditPage(context, | ||
| 147 | + sunModel: sunModel); | ||
| 148 | + } | ||
| 150 | }, | 149 | }, |
| 151 | child: Container( | 150 | child: Container( |
| 152 | margin: EdgeInsets.only( | 151 | margin: EdgeInsets.only( |
| @@ -168,7 +167,8 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { | @@ -168,7 +167,8 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { | ||
| 168 | EdgeInsets.symmetric(horizontal: w(12)), | 167 | EdgeInsets.symmetric(horizontal: w(12)), |
| 169 | height: w(33), | 168 | height: w(33), |
| 170 | decoration: BoxDecoration( | 169 | decoration: BoxDecoration( |
| 171 | - color: sunModel.status == '1' | 170 | + color: sunModel.status == '1' && |
| 171 | + '${sunModel.isFlag}' != '1' | ||
| 172 | ? MyColours.color_438E93 | 172 | ? MyColours.color_438E93 |
| 173 | : MyColours.color_999999, | 173 | : MyColours.color_999999, |
| 174 | borderRadius: BorderRadius.only( | 174 | borderRadius: BorderRadius.only( |
| @@ -185,40 +185,42 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { | @@ -185,40 +185,42 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { | ||
| 185 | fontSize: font(18), | 185 | fontSize: font(18), |
| 186 | color: MyColours.color_ffffff), | 186 | color: MyColours.color_ffffff), |
| 187 | ), | 187 | ), |
| 188 | - RoundButton( | ||
| 189 | - width: w(32), | ||
| 190 | - height: w(19), | ||
| 191 | - radius: r(5), | ||
| 192 | - text: | ||
| 193 | - sunModel.status == '1' ? '停用' : '启用', | ||
| 194 | - fontSize: 24, | ||
| 195 | - textColor: MyColours.color_ffffff, | ||
| 196 | - gradientStart: Colors.transparent, | ||
| 197 | - gradientEnd: Colors.transparent, | ||
| 198 | - borderColor: MyColours.color_ffffff, | ||
| 199 | - onPressed: () async { | ||
| 200 | - String status = ''; | ||
| 201 | - if (sunModel.status == '1') { | ||
| 202 | - status = '0'; | ||
| 203 | - } else { | ||
| 204 | - status = '1'; | ||
| 205 | - } | ||
| 206 | - Map<String, String?> params = { | ||
| 207 | - 'id': sunModel.id, | ||
| 208 | - 'sellerid': sunModel.sellerid, | ||
| 209 | - 'type': sunModel.type, | ||
| 210 | - 'status': status | ||
| 211 | - }; | 188 | + if ('${sunModel.isFlag}' != '1') |
| 189 | + RoundButton( | ||
| 190 | + width: w(32), | ||
| 191 | + height: w(19), | ||
| 192 | + radius: r(5), | ||
| 193 | + text: sunModel.status == '1' | ||
| 194 | + ? '停用' | ||
| 195 | + : '启用', | ||
| 196 | + fontSize: 24, | ||
| 197 | + textColor: MyColours.color_ffffff, | ||
| 198 | + gradientStart: Colors.transparent, | ||
| 199 | + gradientEnd: Colors.transparent, | ||
| 200 | + borderColor: MyColours.color_ffffff, | ||
| 201 | + onPressed: () async { | ||
| 202 | + String status = ''; | ||
| 203 | + if (sunModel.status == '1') { | ||
| 204 | + status = '0'; | ||
| 205 | + } else { | ||
| 206 | + status = '1'; | ||
| 207 | + } | ||
| 208 | + Map<String, String?> params = { | ||
| 209 | + 'id': sunModel.id, | ||
| 210 | + 'sellerid': sunModel.sellerid, | ||
| 211 | + 'type': sunModel.type, | ||
| 212 | + 'status': status | ||
| 213 | + }; | ||
| 212 | 214 | ||
| 213 | - bool sucess = await storeBaseInfoP | ||
| 214 | - .setSellerMealSection( | ||
| 215 | - context, params); | ||
| 216 | - if (sucess) { | ||
| 217 | - getSellerMealSection(); | ||
| 218 | - } | ||
| 219 | - }, | ||
| 220 | - // onPressed: widget.onPressedSwich, | ||
| 221 | - ) | 215 | + bool sucess = await storeBaseInfoP |
| 216 | + .setSellerMealSection( | ||
| 217 | + context, params); | ||
| 218 | + if (sucess) { | ||
| 219 | + getSellerMealSection(); | ||
| 220 | + } | ||
| 221 | + }, | ||
| 222 | + // onPressed: widget.onPressedSwich, | ||
| 223 | + ) | ||
| 222 | ], | 224 | ], |
| 223 | ), | 225 | ), |
| 224 | ), | 226 | ), |
| @@ -1340,7 +1340,7 @@ class InvicationPageSimState extends State<InvicationPageSim> | @@ -1340,7 +1340,7 @@ class InvicationPageSimState extends State<InvicationPageSim> | ||
| 1340 | // position = '请填写职位'; | 1340 | // position = '请填写职位'; |
| 1341 | // phone = '请填写电话'; | 1341 | // phone = '请填写电话'; |
| 1342 | // qiniuUrl = ''; | 1342 | // qiniuUrl = ''; |
| 1343 | - _setCustomerActivityBaseinfo(); | 1343 | + // _setCustomerActivityBaseinfo(); |
| 1344 | } | 1344 | } |
| 1345 | } | 1345 | } |
| 1346 | 1346 |
-
Please register or login to post a comment