Showing
16 changed files
with
323 additions
and
376 deletions
| @@ -48,6 +48,13 @@ PODS: | @@ -48,6 +48,13 @@ PODS: | ||
| 48 | - flutter_bugly (0.0.1): | 48 | - flutter_bugly (0.0.1): |
| 49 | - Bugly | 49 | - Bugly |
| 50 | - Flutter | 50 | - Flutter |
| 51 | + - flutter_inappwebview (0.0.1): | ||
| 52 | + - Flutter | ||
| 53 | + - flutter_inappwebview/Core (= 0.0.1) | ||
| 54 | + - OrderedSet (~> 5.0) | ||
| 55 | + - flutter_inappwebview/Core (0.0.1): | ||
| 56 | + - Flutter | ||
| 57 | + - OrderedSet (~> 5.0) | ||
| 51 | - flutter_native_image (0.0.1): | 58 | - flutter_native_image (0.0.1): |
| 52 | - Flutter | 59 | - Flutter |
| 53 | - flutter_sms (1.1.0): | 60 | - flutter_sms (1.1.0): |
| @@ -70,6 +77,7 @@ PODS: | @@ -70,6 +77,7 @@ PODS: | ||
| 70 | - Flutter | 77 | - Flutter |
| 71 | - install_plugin (0.0.1): | 78 | - install_plugin (0.0.1): |
| 72 | - Flutter | 79 | - Flutter |
| 80 | + - OrderedSet (5.0.0) | ||
| 73 | - package_info (0.0.1): | 81 | - package_info (0.0.1): |
| 74 | - Flutter | 82 | - Flutter |
| 75 | - path_provider (0.0.1): | 83 | - path_provider (0.0.1): |
| @@ -119,6 +127,7 @@ DEPENDENCIES: | @@ -119,6 +127,7 @@ DEPENDENCIES: | ||
| 119 | - flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`) | 127 | - flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`) |
| 120 | - flutter_app_update (from `.symlinks/plugins/flutter_app_update/ios`) | 128 | - flutter_app_update (from `.symlinks/plugins/flutter_app_update/ios`) |
| 121 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) | 129 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) |
| 130 | + - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) | ||
| 122 | - flutter_native_image (from `.symlinks/plugins/flutter_native_image/ios`) | 131 | - flutter_native_image (from `.symlinks/plugins/flutter_native_image/ios`) |
| 123 | - flutter_sms (from `.symlinks/plugins/flutter_sms/ios`) | 132 | - flutter_sms (from `.symlinks/plugins/flutter_sms/ios`) |
| 124 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) | 133 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) |
| @@ -151,6 +160,7 @@ SPEC REPOS: | @@ -151,6 +160,7 @@ SPEC REPOS: | ||
| 151 | - AMapSearch | 160 | - AMapSearch |
| 152 | - Bugly | 161 | - Bugly |
| 153 | - FMDB | 162 | - FMDB |
| 163 | + - OrderedSet | ||
| 154 | - Reachability | 164 | - Reachability |
| 155 | - TPNS-iOS | 165 | - TPNS-iOS |
| 156 | - WechatOpenSDK | 166 | - WechatOpenSDK |
| @@ -184,6 +194,8 @@ EXTERNAL SOURCES: | @@ -184,6 +194,8 @@ EXTERNAL SOURCES: | ||
| 184 | :path: ".symlinks/plugins/flutter_app_update/ios" | 194 | :path: ".symlinks/plugins/flutter_app_update/ios" |
| 185 | flutter_bugly: | 195 | flutter_bugly: |
| 186 | :path: ".symlinks/plugins/flutter_bugly/ios" | 196 | :path: ".symlinks/plugins/flutter_bugly/ios" |
| 197 | + flutter_inappwebview: | ||
| 198 | + :path: ".symlinks/plugins/flutter_inappwebview/ios" | ||
| 187 | flutter_native_image: | 199 | flutter_native_image: |
| 188 | :path: ".symlinks/plugins/flutter_native_image/ios" | 200 | :path: ".symlinks/plugins/flutter_native_image/ios" |
| 189 | flutter_sms: | 201 | flutter_sms: |
| @@ -251,6 +263,7 @@ SPEC CHECKSUMS: | @@ -251,6 +263,7 @@ SPEC CHECKSUMS: | ||
| 251 | flutter_app_badger: 65de4d6f0c34a891df49e6cfb8a1c0496426fa68 | 263 | flutter_app_badger: 65de4d6f0c34a891df49e6cfb8a1c0496426fa68 |
| 252 | flutter_app_update: 65f61da626cb111d1b24674abc4b01728d7723bc | 264 | flutter_app_update: 65f61da626cb111d1b24674abc4b01728d7723bc |
| 253 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 | 265 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 |
| 266 | + flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721 | ||
| 254 | flutter_native_image: 9c0b7451838484458e5b0fae007b86a4c2d4bdfe | 267 | flutter_native_image: 9c0b7451838484458e5b0fae007b86a4c2d4bdfe |
| 255 | flutter_sms: 91ce41530f55c85d6524d82307a5d555844c086a | 268 | flutter_sms: 91ce41530f55c85d6524d82307a5d555844c086a |
| 256 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 | 269 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 |
| @@ -261,6 +274,7 @@ SPEC CHECKSUMS: | @@ -261,6 +274,7 @@ SPEC CHECKSUMS: | ||
| 261 | foundation_fluttify: 0c45145e3fad1fb99188e4979daed5b24cd9b278 | 274 | foundation_fluttify: 0c45145e3fad1fb99188e4979daed5b24cd9b278 |
| 262 | image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 | 275 | image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 |
| 263 | install_plugin: a13e7ddd2bab0c701b48cd359c26d0394125b6fb | 276 | install_plugin: a13e7ddd2bab0c701b48cd359c26d0394125b6fb |
| 277 | + OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c | ||
| 264 | package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 | 278 | package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 |
| 265 | path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c | 279 | path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c |
| 266 | permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 | 280 | permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 |
| @@ -301,6 +301,7 @@ | @@ -301,6 +301,7 @@ | ||
| 301 | inputPaths = ( | 301 | inputPaths = ( |
| 302 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", | 302 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", |
| 303 | "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", | 303 | "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", |
| 304 | + "${BUILT_PRODUCTS_DIR}/OrderedSet/OrderedSet.framework", | ||
| 304 | "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", | 305 | "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", |
| 305 | "${BUILT_PRODUCTS_DIR}/audioplayers/audioplayers.framework", | 306 | "${BUILT_PRODUCTS_DIR}/audioplayers/audioplayers.framework", |
| 306 | "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", | 307 | "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", |
| @@ -309,6 +310,7 @@ | @@ -309,6 +310,7 @@ | ||
| 309 | "${BUILT_PRODUCTS_DIR}/easy_contact_picker/easy_contact_picker.framework", | 310 | "${BUILT_PRODUCTS_DIR}/easy_contact_picker/easy_contact_picker.framework", |
| 310 | "${BUILT_PRODUCTS_DIR}/flutter_app_badger/flutter_app_badger.framework", | 311 | "${BUILT_PRODUCTS_DIR}/flutter_app_badger/flutter_app_badger.framework", |
| 311 | "${BUILT_PRODUCTS_DIR}/flutter_app_update/flutter_app_update.framework", | 312 | "${BUILT_PRODUCTS_DIR}/flutter_app_update/flutter_app_update.framework", |
| 313 | + "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", | ||
| 312 | "${BUILT_PRODUCTS_DIR}/flutter_native_image/flutter_native_image.framework", | 314 | "${BUILT_PRODUCTS_DIR}/flutter_native_image/flutter_native_image.framework", |
| 313 | "${BUILT_PRODUCTS_DIR}/flutter_sms/flutter_sms.framework", | 315 | "${BUILT_PRODUCTS_DIR}/flutter_sms/flutter_sms.framework", |
| 314 | "${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework", | 316 | "${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework", |
| @@ -332,6 +334,7 @@ | @@ -332,6 +334,7 @@ | ||
| 332 | name = "[CP] Embed Pods Frameworks"; | 334 | name = "[CP] Embed Pods Frameworks"; |
| 333 | outputPaths = ( | 335 | outputPaths = ( |
| 334 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", | 336 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", |
| 337 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OrderedSet.framework", | ||
| 335 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", | 338 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", |
| 336 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/audioplayers.framework", | 339 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/audioplayers.framework", |
| 337 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", | 340 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", |
| @@ -340,6 +343,7 @@ | @@ -340,6 +343,7 @@ | ||
| 340 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/easy_contact_picker.framework", | 343 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/easy_contact_picker.framework", |
| 341 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_badger.framework", | 344 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_badger.framework", |
| 342 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_update.framework", | 345 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_update.framework", |
| 346 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", | ||
| 343 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_native_image.framework", | 347 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_native_image.framework", |
| 344 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_sms.framework", | 348 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_sms.framework", |
| 345 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework", | 349 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework", |
| @@ -631,7 +635,7 @@ | @@ -631,7 +635,7 @@ | ||
| 631 | CURRENT_PROJECT_VERSION = 317; | 635 | CURRENT_PROJECT_VERSION = 317; |
| 632 | DEVELOPMENT_TEAM = 8J59HM8B82; | 636 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 633 | ENABLE_BITCODE = NO; | 637 | ENABLE_BITCODE = NO; |
| 634 | - FLUTTER_BUILD_MODE = release; | 638 | + FLUTTER_BUILD_MODE = debug; |
| 635 | FRAMEWORK_SEARCH_PATHS = ( | 639 | FRAMEWORK_SEARCH_PATHS = ( |
| 636 | "$(inherited)", | 640 | "$(inherited)", |
| 637 | "$(PROJECT_DIR)/Flutter", | 641 | "$(PROJECT_DIR)/Flutter", |
| @@ -83,7 +83,7 @@ class CustomerListSunModel extends Object with ISuspensionBean { | @@ -83,7 +83,7 @@ class CustomerListSunModel extends Object with ISuspensionBean { | ||
| 83 | String monthCount; | 83 | String monthCount; |
| 84 | @JsonKey(name: 'label') | 84 | @JsonKey(name: 'label') |
| 85 | String label; | 85 | String label; |
| 86 | - bool select = true; | 86 | + bool select = false; |
| 87 | 87 | ||
| 88 | List<String> pinyinList; //全拼数组 | 88 | List<String> pinyinList; //全拼数组 |
| 89 | String pinyin; //全拼字母 | 89 | String pinyin; //全拼字母 |
| @@ -73,7 +73,7 @@ class _CouponPageState extends State<CouponPage> { | @@ -73,7 +73,7 @@ class _CouponPageState extends State<CouponPage> { | ||
| 73 | 73 | ||
| 74 | @override | 74 | @override |
| 75 | void dispose() { | 75 | void dispose() { |
| 76 | - EventBus().emit('changeStatusColor'); | 76 | + bus.off('changeStatusColor'); |
| 77 | // bus.off("refresh_coupon_list"); | 77 | // bus.off("refresh_coupon_list"); |
| 78 | super.dispose(); | 78 | super.dispose(); |
| 79 | } | 79 | } |
| @@ -112,18 +112,19 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -112,18 +112,19 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 112 | width: ScreenUtil().setWidth(2)))), | 112 | width: ScreenUtil().setWidth(2)))), |
| 113 | child: Row( | 113 | child: Row( |
| 114 | children: [ | 114 | children: [ |
| 115 | - InkWell( | 115 | + GestureDetector( |
| 116 | + behavior: HitTestBehavior.opaque, | ||
| 116 | onTap: () { | 117 | onTap: () { |
| 117 | if (widget.fromPage != FromPage.FromPageShowCutomerList) { | 118 | if (widget.fromPage != FromPage.FromPageShowCutomerList) { |
| 118 | List<CustomerListSunModel> data = | 119 | List<CustomerListSunModel> data = |
| 119 | widget.provider.userHistorys; | 120 | widget.provider.userHistorys; |
| 120 | data[index].select = !data[index].select; | 121 | data[index].select = !data[index].select; |
| 121 | if (data[index].select) { | 122 | if (data[index].select) { |
| 122 | - widget.provider.addData(index); | 123 | + widget.provider.addDataMy(index); |
| 123 | } else { | 124 | } else { |
| 124 | - widget.provider.cancelData(index); | 125 | + widget.provider.cancelDataMy(index); |
| 125 | } | 126 | } |
| 126 | - widget.provider.getCheckValue(); | 127 | + widget.provider.getCheckValueMy(); |
| 127 | } | 128 | } |
| 128 | }, | 129 | }, |
| 129 | child: Stack( | 130 | child: Stack( |
| @@ -190,140 +191,164 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -190,140 +191,164 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 190 | )), | 191 | )), |
| 191 | HEmptyView(20), | 192 | HEmptyView(20), |
| 192 | Expanded( | 193 | Expanded( |
| 193 | - child: Column( | ||
| 194 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 195 | - children: [ | ||
| 196 | - Row( | ||
| 197 | - crossAxisAlignment: CrossAxisAlignment.end, | ||
| 198 | - children: [ | ||
| 199 | - model.rnameStr != null && model.rnameStr != '' | ||
| 200 | - ? Row( | ||
| 201 | - crossAxisAlignment: CrossAxisAlignment.end, | ||
| 202 | - children: [ | ||
| 203 | - Container( | ||
| 204 | - constraints: BoxConstraints( | ||
| 205 | - maxWidth: ScreenUtil().setWidth(200)), | ||
| 206 | - child: Text( | ||
| 207 | - model.rnameStr, | ||
| 208 | - overflow: TextOverflow.ellipsis, | ||
| 209 | - style: TextStyle( | ||
| 210 | - color: MyColours.color_333333, | ||
| 211 | - fontSize: ScreenUtil().setSp(36), | ||
| 212 | - fontWeight: FontWeight.bold), | ||
| 213 | - )), | ||
| 214 | - HEmptyView(10), | ||
| 215 | - Padding( | ||
| 216 | - padding: EdgeInsets.only( | ||
| 217 | - bottom: ScreenUtil().setWidth(4)), | ||
| 218 | - child: Text( | ||
| 219 | - model.sexStr != '' | ||
| 220 | - ? '[${model.sexStr}]' | ||
| 221 | - : '', | ||
| 222 | - style: TextStyle( | ||
| 223 | - color: MyColours.color_333333, | ||
| 224 | - fontSize: ScreenUtil().setSp(22), | ||
| 225 | - ), | ||
| 226 | - )), | ||
| 227 | - HEmptyView(10), | ||
| 228 | - ], | ||
| 229 | - ) | ||
| 230 | - : SizedBox(), | ||
| 231 | - model.label != null | ||
| 232 | - ? Container( | ||
| 233 | - padding: EdgeInsets.only( | ||
| 234 | - bottom: ScreenUtil().setWidth(4)), | ||
| 235 | - constraints: BoxConstraints( | ||
| 236 | - maxWidth: ScreenUtil().setWidth(150)), | ||
| 237 | - child: Text( | ||
| 238 | - model.label, | ||
| 239 | - overflow: TextOverflow.ellipsis, | ||
| 240 | - style: TextStyle( | ||
| 241 | - color: Color.fromRGBO(193, 194, 63, 1), | ||
| 242 | - fontSize: ScreenUtil().setSp(22), | ||
| 243 | - ), | ||
| 244 | - )) | ||
| 245 | - : SizedBox() | ||
| 246 | - ], | ||
| 247 | - ), | ||
| 248 | - VEmptyView(10), | ||
| 249 | - widget.fromPage == FromPage.FromPageMyCustomer && | ||
| 250 | - ((model.company != null && model.company != '') || | ||
| 251 | - (model.phone != null && model.phone != '')) | ||
| 252 | - ? Padding( | ||
| 253 | - padding: EdgeInsets.only( | ||
| 254 | - bottom: ScreenUtil().setWidth(10)), | ||
| 255 | - child: Row( | 194 | + child: GestureDetector( |
| 195 | + behavior: HitTestBehavior.opaque, | ||
| 196 | + onTap: () { | ||
| 197 | + if (widget.fromPage != | ||
| 198 | + FromPage.FromPageShowCutomerList) { | ||
| 199 | + NavigatorUtil.goMyCustomerDetailPage( | ||
| 200 | + context, model, widget.fromPage); | ||
| 201 | + } | ||
| 202 | + }, | ||
| 203 | + child: Column( | ||
| 204 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 205 | + children: [ | ||
| 206 | + Row( | ||
| 256 | crossAxisAlignment: CrossAxisAlignment.end, | 207 | crossAxisAlignment: CrossAxisAlignment.end, |
| 257 | children: [ | 208 | children: [ |
| 258 | - model.company != null && model.company != '' | 209 | + model.rnameStr != null && model.rnameStr != '' |
| 210 | + ? Row( | ||
| 211 | + crossAxisAlignment: | ||
| 212 | + CrossAxisAlignment.end, | ||
| 213 | + children: [ | ||
| 214 | + Container( | ||
| 215 | + constraints: BoxConstraints( | ||
| 216 | + maxWidth: | ||
| 217 | + ScreenUtil().setWidth(200)), | ||
| 218 | + child: Text( | ||
| 219 | + model.rnameStr, | ||
| 220 | + overflow: TextOverflow.ellipsis, | ||
| 221 | + style: TextStyle( | ||
| 222 | + color: MyColours.color_333333, | ||
| 223 | + fontSize: | ||
| 224 | + ScreenUtil().setSp(36), | ||
| 225 | + fontWeight: FontWeight.bold), | ||
| 226 | + )), | ||
| 227 | + HEmptyView(10), | ||
| 228 | + Padding( | ||
| 229 | + padding: EdgeInsets.only( | ||
| 230 | + bottom: | ||
| 231 | + ScreenUtil().setWidth(4)), | ||
| 232 | + child: Text( | ||
| 233 | + model.sexStr != '' | ||
| 234 | + ? '[${model.sexStr}]' | ||
| 235 | + : '', | ||
| 236 | + style: TextStyle( | ||
| 237 | + color: MyColours.color_333333, | ||
| 238 | + fontSize: | ||
| 239 | + ScreenUtil().setSp(22), | ||
| 240 | + ), | ||
| 241 | + )), | ||
| 242 | + HEmptyView(10), | ||
| 243 | + ], | ||
| 244 | + ) | ||
| 245 | + : SizedBox(), | ||
| 246 | + model.label != null | ||
| 259 | ? Container( | 247 | ? Container( |
| 260 | padding: EdgeInsets.only( | 248 | padding: EdgeInsets.only( |
| 261 | - right: ScreenUtil().setWidth(10)), | 249 | + bottom: ScreenUtil().setWidth(4)), |
| 262 | constraints: BoxConstraints( | 250 | constraints: BoxConstraints( |
| 263 | - maxWidth: ScreenUtil().setWidth(200)), | 251 | + maxWidth: ScreenUtil().setWidth(150)), |
| 264 | child: Text( | 252 | child: Text( |
| 265 | - '[${model.company}]', | 253 | + model.label, |
| 266 | overflow: TextOverflow.ellipsis, | 254 | overflow: TextOverflow.ellipsis, |
| 267 | style: TextStyle( | 255 | style: TextStyle( |
| 268 | - color: MyColours.color_999999, | ||
| 269 | - fontSize: ScreenUtil().setSp(30)), | 256 | + color: |
| 257 | + Color.fromRGBO(193, 194, 63, 1), | ||
| 258 | + fontSize: ScreenUtil().setSp(22), | ||
| 259 | + ), | ||
| 270 | )) | 260 | )) |
| 271 | - : SizedBox(), | ||
| 272 | - model.phone != null && model.phone != '' | ||
| 273 | - ? Text( | ||
| 274 | - model.phone, | ||
| 275 | - overflow: TextOverflow.ellipsis, | ||
| 276 | - style: TextStyle( | ||
| 277 | - color: MyColours.color_999999, | ||
| 278 | - fontSize: ScreenUtil().setSp(30)), | ||
| 279 | - ) | ||
| 280 | - : SizedBox(), | 261 | + : SizedBox() |
| 281 | ], | 262 | ], |
| 282 | - )) | ||
| 283 | - : SizedBox(), | ||
| 284 | - Row( | ||
| 285 | - // crossAxisAlignment: CrossAxisAlignment.end, | ||
| 286 | - children: [ | ||
| 287 | - Text( | ||
| 288 | - Utils.formatFromYmd(model.ddate), | ||
| 289 | - style: TextStyle( | ||
| 290 | - color: Color.fromRGBO(208, 31, 37, 1), | ||
| 291 | - fontSize: ScreenUtil().setSp(24), | ||
| 292 | - fontWeight: FontWeight.bold), | ||
| 293 | - ), | ||
| 294 | - HEmptyView(10), | ||
| 295 | - Text( | ||
| 296 | - model.ddateSolt != null ? model.ddateSolt : '', | ||
| 297 | - style: TextStyle( | ||
| 298 | - color: Color.fromRGBO(208, 31, 37, 1), | ||
| 299 | - fontSize: ScreenUtil().setSp(24), | ||
| 300 | - ), | ||
| 301 | - ), | ||
| 302 | - model.monthCount == '0' || model.monthCount == null | ||
| 303 | - ? SizedBox() | ||
| 304 | - : Padding( | ||
| 305 | - padding: EdgeInsets.only( | ||
| 306 | - left: ScreenUtil().setWidth(10)), | ||
| 307 | - child: Text( | ||
| 308 | - '30天内${model.monthCount}单', | 263 | + ), |
| 264 | + VEmptyView(10), | ||
| 265 | + widget.fromPage == FromPage.FromPageMyCustomer && | ||
| 266 | + ((model.company != null && | ||
| 267 | + model.company != '') || | ||
| 268 | + (model.phone != null && | ||
| 269 | + model.phone != '')) | ||
| 270 | + ? Padding( | ||
| 271 | + padding: EdgeInsets.only( | ||
| 272 | + bottom: ScreenUtil().setWidth(10)), | ||
| 273 | + child: Row( | ||
| 274 | + crossAxisAlignment: CrossAxisAlignment.end, | ||
| 275 | + children: [ | ||
| 276 | + model.company != null && | ||
| 277 | + model.company != '' | ||
| 278 | + ? Container( | ||
| 279 | + padding: EdgeInsets.only( | ||
| 280 | + right: ScreenUtil() | ||
| 281 | + .setWidth(10)), | ||
| 282 | + constraints: BoxConstraints( | ||
| 283 | + maxWidth: ScreenUtil() | ||
| 284 | + .setWidth(200)), | ||
| 285 | + child: Text( | ||
| 286 | + '[${model.company}]', | ||
| 287 | + overflow: TextOverflow.ellipsis, | ||
| 288 | + style: TextStyle( | ||
| 289 | + color: | ||
| 290 | + MyColours.color_999999, | ||
| 291 | + fontSize: | ||
| 292 | + ScreenUtil().setSp(30)), | ||
| 293 | + )) | ||
| 294 | + : SizedBox(), | ||
| 295 | + model.phone != null && model.phone != '' | ||
| 296 | + ? Text( | ||
| 297 | + model.phone, | ||
| 298 | + overflow: TextOverflow.ellipsis, | ||
| 299 | + style: TextStyle( | ||
| 300 | + color: MyColours.color_999999, | ||
| 301 | + fontSize: | ||
| 302 | + ScreenUtil().setSp(30)), | ||
| 303 | + ) | ||
| 304 | + : SizedBox(), | ||
| 305 | + ], | ||
| 306 | + )) | ||
| 307 | + : SizedBox(), | ||
| 308 | + Row( | ||
| 309 | + // crossAxisAlignment: CrossAxisAlignment.end, | ||
| 310 | + children: [ | ||
| 311 | + Text( | ||
| 312 | + Utils.formatFromYmd(model.ddate), | ||
| 309 | style: TextStyle( | 313 | style: TextStyle( |
| 310 | - color: MyColours.color_199095, | 314 | + color: Color.fromRGBO(208, 31, 37, 1), |
| 315 | + fontSize: ScreenUtil().setSp(24), | ||
| 316 | + fontWeight: FontWeight.bold), | ||
| 317 | + ), | ||
| 318 | + HEmptyView(10), | ||
| 319 | + Text( | ||
| 320 | + model.ddateSolt != null ? model.ddateSolt : '', | ||
| 321 | + style: TextStyle( | ||
| 322 | + color: Color.fromRGBO(208, 31, 37, 1), | ||
| 311 | fontSize: ScreenUtil().setSp(24), | 323 | fontSize: ScreenUtil().setSp(24), |
| 312 | ), | 324 | ), |
| 313 | ), | 325 | ), |
| 314 | - ), | ||
| 315 | - HEmptyView(10), | ||
| 316 | - Text( | ||
| 317 | - '累计${model.leiji}单', | ||
| 318 | - style: TextStyle( | ||
| 319 | - color: MyColours.color_199095, | ||
| 320 | - fontSize: ScreenUtil().setSp(24), | ||
| 321 | - ), | ||
| 322 | - ) | ||
| 323 | - ], | ||
| 324 | - ), | ||
| 325 | - ], | ||
| 326 | - )) | 326 | + model.monthCount == '0' || |
| 327 | + model.monthCount == null | ||
| 328 | + ? SizedBox() | ||
| 329 | + : Padding( | ||
| 330 | + padding: EdgeInsets.only( | ||
| 331 | + left: ScreenUtil().setWidth(10)), | ||
| 332 | + child: Text( | ||
| 333 | + '30天内${model.monthCount}单', | ||
| 334 | + style: TextStyle( | ||
| 335 | + color: MyColours.color_199095, | ||
| 336 | + fontSize: ScreenUtil().setSp(24), | ||
| 337 | + ), | ||
| 338 | + ), | ||
| 339 | + ), | ||
| 340 | + HEmptyView(10), | ||
| 341 | + Text( | ||
| 342 | + '累计${model.leiji}单', | ||
| 343 | + style: TextStyle( | ||
| 344 | + color: MyColours.color_199095, | ||
| 345 | + fontSize: ScreenUtil().setSp(24), | ||
| 346 | + ), | ||
| 347 | + ) | ||
| 348 | + ], | ||
| 349 | + ), | ||
| 350 | + ], | ||
| 351 | + ))) | ||
| 327 | ], | 352 | ], |
| 328 | ), | 353 | ), |
| 329 | ) | 354 | ) |
| @@ -354,15 +379,7 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -354,15 +379,7 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 354 | itemBuilder: (BuildContext context, int index) { | 379 | itemBuilder: (BuildContext context, int index) { |
| 355 | // if (index == 0) return _buildHeader(); | 380 | // if (index == 0) return _buildHeader(); |
| 356 | CustomerListSunModel model = widget.contacts[index]; | 381 | CustomerListSunModel model = widget.contacts[index]; |
| 357 | - return InkWell( | ||
| 358 | - onTap: () { | ||
| 359 | - if (widget.fromPage != FromPage.FromPageShowCutomerList) { | ||
| 360 | - NavigatorUtil.goMyCustomerDetailPage( | ||
| 361 | - context, model, widget.fromPage); | ||
| 362 | - } | ||
| 363 | - }, | ||
| 364 | - child: _buildListItem(model, index), | ||
| 365 | - ); | 382 | + return _buildListItem(model, index); |
| 366 | }, | 383 | }, |
| 367 | physics: BouncingScrollPhysics(), | 384 | physics: BouncingScrollPhysics(), |
| 368 | indexBarData: SuspensionUtil.getTagIndexList(widget.contacts), | 385 | indexBarData: SuspensionUtil.getTagIndexList(widget.contacts), |
| @@ -151,7 +151,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | @@ -151,7 +151,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | ||
| 151 | if (sucess) { | 151 | if (sucess) { |
| 152 | Utils.showToast('保存成功'); | 152 | Utils.showToast('保存成功'); |
| 153 | bus.emit('refresh_guest_info'); | 153 | bus.emit('refresh_guest_info'); |
| 154 | - bus.emit('refresh_guest_list'); | 154 | + bus.emit('refresh_guest_list_my'); |
| 155 | Navigator.pop(context); | 155 | Navigator.pop(context); |
| 156 | // 刷新前一页 | 156 | // 刷新前一页 |
| 157 | } | 157 | } |
| @@ -46,7 +46,7 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | @@ -46,7 +46,7 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | ||
| 46 | 46 | ||
| 47 | @override | 47 | @override |
| 48 | void dispose() { | 48 | void dispose() { |
| 49 | - EventBus().emit('refresh_guest_info'); | 49 | + bus.off('refresh_guest_info'); |
| 50 | super.dispose(); | 50 | super.dispose(); |
| 51 | } | 51 | } |
| 52 | 52 |
| @@ -77,18 +77,24 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | @@ -77,18 +77,24 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | ||
| 77 | } | 77 | } |
| 78 | }); | 78 | }); |
| 79 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 79 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 80 | + bool first = true; | ||
| 81 | + if (widget.fromPage == FromPage.FromPageMakeRecord) { | ||
| 82 | + customerProvider.selectCustomer = customerMakingProvider.selectCustomer; | ||
| 83 | + customerProvider.labels = customerMakingProvider.labels; | ||
| 84 | + first = false; | ||
| 85 | + } | ||
| 80 | customerProvider.initData(); | 86 | customerProvider.initData(); |
| 81 | - _getContantData(); | 87 | + _getContantData(first: first); |
| 82 | _filterLabelList(); | 88 | _filterLabelList(); |
| 83 | }); | 89 | }); |
| 84 | - bus.on("refresh_guest_list", (arg) { | 90 | + bus.on("refresh_guest_list_my", (arg) { |
| 85 | _getContantData(); | 91 | _getContantData(); |
| 86 | }); | 92 | }); |
| 87 | } | 93 | } |
| 88 | 94 | ||
| 89 | @override | 95 | @override |
| 90 | void dispose() { | 96 | void dispose() { |
| 91 | - EventBus().emit('refresh_guest_list'); | 97 | + bus.off('refresh_guest_list_my'); |
| 92 | super.dispose(); | 98 | super.dispose(); |
| 93 | } | 99 | } |
| 94 | 100 | ||
| @@ -107,7 +113,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | @@ -107,7 +113,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | ||
| 107 | } | 113 | } |
| 108 | } | 114 | } |
| 109 | 115 | ||
| 110 | - _getContantData({bool showLoading = true}) async { | 116 | + _getContantData({bool showLoading = true, bool first = false}) async { |
| 111 | if (showLoading) { | 117 | if (showLoading) { |
| 112 | customerProvider.pageState = PageState.Loading; | 118 | customerProvider.pageState = PageState.Loading; |
| 113 | } | 119 | } |
| @@ -167,6 +173,9 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | @@ -167,6 +173,9 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | ||
| 167 | // params['reserve_sort'] 1 等于 2 小于 3 大于 | 173 | // params['reserve_sort'] 1 等于 2 小于 3 大于 |
| 168 | 174 | ||
| 169 | await customerProvider.getCustomerList(context, params); | 175 | await customerProvider.getCustomerList(context, params); |
| 176 | + if (first) { | ||
| 177 | + customerProvider.addAllMy(); | ||
| 178 | + } | ||
| 170 | // await customerProvider.searchData(customerProvider.controller.text); | 179 | // await customerProvider.searchData(customerProvider.controller.text); |
| 171 | } | 180 | } |
| 172 | 181 | ||
| @@ -193,9 +202,9 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | @@ -193,9 +202,9 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | ||
| 193 | InkWell( | 202 | InkWell( |
| 194 | onTap: () { | 203 | onTap: () { |
| 195 | if (customerProvider.checkValue) { | 204 | if (customerProvider.checkValue) { |
| 196 | - customerProvider.cancelAll(); | 205 | + customerProvider.cancelAllMy(); |
| 197 | } else { | 206 | } else { |
| 198 | - customerProvider.addAll(); | 207 | + customerProvider.addAllMy(); |
| 199 | } | 208 | } |
| 200 | }, | 209 | }, |
| 201 | child: Row( | 210 | child: Row( |
| @@ -232,7 +241,16 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | @@ -232,7 +241,16 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | ||
| 232 | customerMakingProvider.fromPage = widget.fromPage; | 241 | customerMakingProvider.fromPage = widget.fromPage; |
| 233 | NavigatorUtil.goMyMakeMarkingPage(context); | 242 | NavigatorUtil.goMyMakeMarkingPage(context); |
| 234 | } else { | 243 | } else { |
| 244 | + customerMakingProvider.labels = customerProvider.labels; | ||
| 245 | + customerMakingProvider.selectCustomer = | ||
| 246 | + customerProvider.selectCustomer; | ||
| 247 | + customerMakingProvider.fromPage = widget.fromPage; | ||
| 235 | Navigator.pop(context); | 248 | Navigator.pop(context); |
| 249 | + // Map temp = { | ||
| 250 | + // 'labels': customerProvider.labels, | ||
| 251 | + // 'selectCustomer': customerProvider.selectCustomer | ||
| 252 | + // }; | ||
| 253 | + // Navigator.of(context).pop(temp); | ||
| 236 | } | 254 | } |
| 237 | }, | 255 | }, |
| 238 | child: Container( | 256 | child: Container( |
| @@ -56,7 +56,7 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -56,7 +56,7 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 56 | _getGuestInfoCday(); | 56 | _getGuestInfoCday(); |
| 57 | // 刷新 | 57 | // 刷新 |
| 58 | bus.emit('refresh_guest_info'); | 58 | bus.emit('refresh_guest_info'); |
| 59 | - bus.emit('refresh_guest_list'); | 59 | + bus.emit('refresh_guest_list_my'); |
| 60 | // Navigator.pop(context); | 60 | // Navigator.pop(context); |
| 61 | 61 | ||
| 62 | } | 62 | } |
| @@ -66,20 +66,6 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | @@ -66,20 +66,6 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | ||
| 66 | } | 66 | } |
| 67 | }); | 67 | }); |
| 68 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 68 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 69 | - for (CustomerListSunModel item in customerMakingProvider.selectCustomer) { | ||
| 70 | - gid += '${item.id},'; | ||
| 71 | - if (Platform.isIOS) { | ||
| 72 | - iosPhone.add(item.phone); | ||
| 73 | - } else { | ||
| 74 | - andriodPhone += "${item.phone};"; | ||
| 75 | - } | ||
| 76 | - } | ||
| 77 | - if (gid.endsWith(',')) { | ||
| 78 | - gid = gid.substring(0, gid.length - 1); | ||
| 79 | - } | ||
| 80 | - if (!Platform.isIOS && andriodPhone.endsWith(';')) { | ||
| 81 | - andriodPhone = andriodPhone.substring(0, andriodPhone.length - 1); | ||
| 82 | - } | ||
| 83 | _couponNetworkData(isShowLoading: false); | 69 | _couponNetworkData(isShowLoading: false); |
| 84 | if (widget.fromPage == FromPage.FromPageMakeRecordDetail) { | 70 | if (widget.fromPage == FromPage.FromPageMakeRecordDetail) { |
| 85 | _getGuestByGid(); | 71 | _getGuestByGid(); |
| @@ -87,6 +73,25 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | @@ -87,6 +73,25 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | ||
| 87 | }); | 73 | }); |
| 88 | } | 74 | } |
| 89 | 75 | ||
| 76 | + _getPhoneAndGid() { | ||
| 77 | + andriodPhone = ''; | ||
| 78 | + iosPhone = []; | ||
| 79 | + for (CustomerListSunModel item in customerMakingProvider.selectCustomer) { | ||
| 80 | + gid += '${item.id},'; | ||
| 81 | + if (Platform.isIOS) { | ||
| 82 | + iosPhone.add(item.phone); | ||
| 83 | + } else { | ||
| 84 | + andriodPhone += "${item.phone};"; | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + if (gid.endsWith(',')) { | ||
| 88 | + gid = gid.substring(0, gid.length - 1); | ||
| 89 | + } | ||
| 90 | + if (!Platform.isIOS && andriodPhone.endsWith(';')) { | ||
| 91 | + andriodPhone = andriodPhone.substring(0, andriodPhone.length - 1); | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | + | ||
| 90 | @override | 95 | @override |
| 91 | void dispose() { | 96 | void dispose() { |
| 92 | super.dispose(); | 97 | super.dispose(); |
| @@ -110,6 +115,7 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | @@ -110,6 +115,7 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | ||
| 110 | gid = widget.selfList.gid; | 115 | gid = widget.selfList.gid; |
| 111 | customerMakingProvider.labels = customerProvider.labels; | 116 | customerMakingProvider.labels = customerProvider.labels; |
| 112 | customerMakingProvider.selectCustomer = customerProvider.selectCustomer; | 117 | customerMakingProvider.selectCustomer = customerProvider.selectCustomer; |
| 118 | + _getPhoneAndGid(); | ||
| 113 | // customerMakingProvider.fromPage = widget.fromPage; | 119 | // customerMakingProvider.fromPage = widget.fromPage; |
| 114 | 120 | ||
| 115 | customerMakingProvider.controller.text = widget.selfList.content; | 121 | customerMakingProvider.controller.text = widget.selfList.content; |
| @@ -211,7 +217,7 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | @@ -211,7 +217,7 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | ||
| 211 | // }, rCallback: () async { | 217 | // }, rCallback: () async { |
| 212 | if (Platform.isIOS) { | 218 | if (Platform.isIOS) { |
| 213 | // List<String> phoneNumber = ['18161963378', '18729572142', '18765432345']; | 219 | // List<String> phoneNumber = ['18161963378', '18729572142', '18765432345']; |
| 214 | - String message = "test"; | 220 | + String message = customerMakingProvider.controller.text; |
| 215 | try { | 221 | try { |
| 216 | String _result = await sendSMS(message: message, recipients: iosPhone); | 222 | String _result = await sendSMS(message: message, recipients: iosPhone); |
| 217 | print(_result); | 223 | print(_result); |
| @@ -486,12 +492,35 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | @@ -486,12 +492,35 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { | ||
| 486 | )), | 492 | )), |
| 487 | HEmptyView(10), | 493 | HEmptyView(10), |
| 488 | InkWell( | 494 | InkWell( |
| 489 | - onTap: () { | 495 | + onTap: () async { |
| 490 | needClear = false; | 496 | needClear = false; |
| 491 | if (widget.fromPage == | 497 | if (widget.fromPage == |
| 492 | FromPage.FromPageMakeRecordDetail) { | 498 | FromPage.FromPageMakeRecordDetail) { |
| 493 | - NavigatorUtil.goMyCustomerListPage( | 499 | + customerMakingProvider.selectCustomer = |
| 500 | + customerProvider.selectCustomer; | ||
| 501 | + | ||
| 502 | + // Map temp = | ||
| 503 | + await NavigatorUtil.goMyCustomerListPage( | ||
| 494 | context, FromPage.FromPageMakeRecord); | 504 | context, FromPage.FromPageMakeRecord); |
| 505 | + | ||
| 506 | + customerProvider.labels = | ||
| 507 | + customerMakingProvider.labels; | ||
| 508 | + customerProvider.selectCustomer = | ||
| 509 | + customerMakingProvider.selectCustomer; | ||
| 510 | + | ||
| 511 | + // { | ||
| 512 | + // 'labels': customerProvider.labels, | ||
| 513 | + // 'selectCustomer': customerProvider.selectCustomer | ||
| 514 | + // }; | ||
| 515 | + // customerProvider.labels = temp['labels']; | ||
| 516 | + // customerProvider.selectCustomer = | ||
| 517 | + // temp['selectCustomer']; | ||
| 518 | + // customerMakingProvider.labels = temp['labels']; | ||
| 519 | + // customerMakingProvider.selectCustomer = | ||
| 520 | + // temp['selectCustomer']; | ||
| 521 | + _getPhoneAndGid(); | ||
| 522 | + setState(() {}); | ||
| 523 | + // customerMakingProvider.fromPage = widget.fromPage; | ||
| 495 | } else { | 524 | } else { |
| 496 | Navigator.pop(context); | 525 | Navigator.pop(context); |
| 497 | } | 526 | } |
| @@ -76,106 +76,6 @@ class _ShowCustomerListPageState extends State<ShowCustomerListPage> | @@ -76,106 +76,6 @@ class _ShowCustomerListPageState extends State<ShowCustomerListPage> | ||
| 76 | // await customerProvider.searchData(customerProvider.controller.text); | 76 | // await customerProvider.searchData(customerProvider.controller.text); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | -// ///选中的联系人widget | ||
| 80 | - Widget _selectContantWidget() { | ||
| 81 | - return Container( | ||
| 82 | - // constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)), | ||
| 83 | - // height: ScreenUtil().setWidth(400), | ||
| 84 | - width: double.infinity, | ||
| 85 | - padding: EdgeInsets.all(ScreenUtil().setWidth(40)), | ||
| 86 | - decoration: BoxDecoration( | ||
| 87 | - color: MyColours.color_ffffff, | ||
| 88 | - boxShadow: [ | ||
| 89 | - BoxShadow( | ||
| 90 | - color: MyColours.color_333333, | ||
| 91 | - blurRadius: ScreenUtil().setWidth(14)) | ||
| 92 | - ], | ||
| 93 | - borderRadius: BorderRadius.only( | ||
| 94 | - topLeft: Radius.circular(ScreenUtil().setWidth(30)), | ||
| 95 | - topRight: Radius.circular(ScreenUtil().setWidth(30)), | ||
| 96 | - )), | ||
| 97 | - child: Row( | ||
| 98 | - children: [ | ||
| 99 | - InkWell( | ||
| 100 | - onTap: () { | ||
| 101 | - if (customerProvider.checkValue) { | ||
| 102 | - customerProvider.cancelAll(); | ||
| 103 | - } else { | ||
| 104 | - customerProvider.addAll(); | ||
| 105 | - } | ||
| 106 | - }, | ||
| 107 | - child: Row( | ||
| 108 | - children: [ | ||
| 109 | - Image.asset( | ||
| 110 | - Utils.getImgPath(customerProvider.checkValue | ||
| 111 | - ? 'c_mul_select' | ||
| 112 | - : 'c_mul_select_un'), | ||
| 113 | - width: ScreenUtil().setWidth(30)), | ||
| 114 | - HEmptyView(10), | ||
| 115 | - Text( | ||
| 116 | - '全选', | ||
| 117 | - style: TextStyle( | ||
| 118 | - fontSize: ScreenUtil().setSp(26), | ||
| 119 | - color: MyColours.color_333333), | ||
| 120 | - ), | ||
| 121 | - HEmptyView(20), | ||
| 122 | - ], | ||
| 123 | - ), | ||
| 124 | - ), | ||
| 125 | - | ||
| 126 | - Expanded( | ||
| 127 | - child: InkWell( | ||
| 128 | - onTap: () { | ||
| 129 | - if (customerProvider.selectCustomer == null || | ||
| 130 | - customerProvider.selectCustomer.length == 0) { | ||
| 131 | - Utils.showToast('请至少选择1名顾客'); | ||
| 132 | - return; | ||
| 133 | - } | ||
| 134 | - if (widget.fromPage == FromPage.FromPageHome) { | ||
| 135 | - customerMakingProvider.labels = customerProvider.labels; | ||
| 136 | - customerMakingProvider.selectCustomer = | ||
| 137 | - customerProvider.selectCustomer; | ||
| 138 | - customerMakingProvider.fromPage = widget.fromPage; | ||
| 139 | - NavigatorUtil.goMakeMarkingPage(context, | ||
| 140 | - fromPage: FromPage.FromPageCustomerList); | ||
| 141 | - } else { | ||
| 142 | - Navigator.pop(context); | ||
| 143 | - } | ||
| 144 | - }, | ||
| 145 | - child: Container( | ||
| 146 | - alignment: Alignment.center, | ||
| 147 | - padding: EdgeInsets.all(ScreenUtil().setWidth(20)), | ||
| 148 | - decoration: BoxDecoration( | ||
| 149 | - borderRadius: | ||
| 150 | - BorderRadius.circular(ScreenUtil().setWidth(40)), | ||
| 151 | - color: MyColours.color_199095), | ||
| 152 | - child: Text( | ||
| 153 | - '已选[${customerProvider.labels}]${customerProvider.selectCustomer.length}位顾客,下发营销任务', | ||
| 154 | - overflow: TextOverflow.ellipsis, | ||
| 155 | - maxLines: 1, | ||
| 156 | - style: TextStyle( | ||
| 157 | - fontSize: ScreenUtil().setSp(28), | ||
| 158 | - color: MyColours.color_ffffff, | ||
| 159 | - ), | ||
| 160 | - )), | ||
| 161 | - )), | ||
| 162 | - // Expanded( | ||
| 163 | - // child: RoundButton( | ||
| 164 | - // // width: ScreenUtil().setWidth(600), | ||
| 165 | - // height: ScreenUtil().setWidth(80), | ||
| 166 | - // radius: ScreenUtil().setWidth(40), | ||
| 167 | - // text: '已选 [全部] 80位顾客,下发营销任务frfrfrfrfrffrfrfr', | ||
| 168 | - // fontSize: 28, | ||
| 169 | - // textColor: MyColours.color_ffffff, | ||
| 170 | - // gradientStart: MyColours.color_199095, | ||
| 171 | - // gradientEnd: MyColours.color_199095, | ||
| 172 | - // onPressed: () {}, | ||
| 173 | - // )) | ||
| 174 | - ], | ||
| 175 | - ), | ||
| 176 | - ); | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | /// 搜索框 | 79 | /// 搜索框 |
| 180 | Widget _searchWidget() { | 80 | Widget _searchWidget() { |
| 181 | return Container( | 81 | return Container( |
| @@ -117,11 +117,11 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -117,11 +117,11 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 117 | widget.provider.customerBySellerList; | 117 | widget.provider.customerBySellerList; |
| 118 | data[index].select = !data[index].select; | 118 | data[index].select = !data[index].select; |
| 119 | if (data[index].select) { | 119 | if (data[index].select) { |
| 120 | - widget.provider.addData(index); | 120 | + // widget.provider.addData(index); |
| 121 | } else { | 121 | } else { |
| 122 | - widget.provider.cancelData(index); | 122 | + // widget.provider.cancelData(index); |
| 123 | } | 123 | } |
| 124 | - widget.provider.getCheckValue(); | 124 | + // widget.provider.getCheckValue(); |
| 125 | }, | 125 | }, |
| 126 | child: Stack( | 126 | child: Stack( |
| 127 | alignment: Alignment.bottomCenter, | 127 | alignment: Alignment.bottomCenter, |
| @@ -47,7 +47,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | @@ -47,7 +47,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | ||
| 47 | 47 | ||
| 48 | @override | 48 | @override |
| 49 | void dispose() { | 49 | void dispose() { |
| 50 | - EventBus().emit('refresh_guest_info'); | 50 | + bus.off('refresh_guest_info'); |
| 51 | super.dispose(); | 51 | super.dispose(); |
| 52 | } | 52 | } |
| 53 | 53 |
| @@ -73,7 +73,7 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -73,7 +73,7 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 73 | 73 | ||
| 74 | @override | 74 | @override |
| 75 | void dispose() { | 75 | void dispose() { |
| 76 | - EventBus().emit('refresh_guest_list'); | 76 | + bus.off('refresh_guest_list'); |
| 77 | super.dispose(); | 77 | super.dispose(); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| @@ -127,9 +127,9 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -127,9 +127,9 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 127 | InkWell( | 127 | InkWell( |
| 128 | onTap: () { | 128 | onTap: () { |
| 129 | if (customerProvider.checkValue) { | 129 | if (customerProvider.checkValue) { |
| 130 | - customerProvider.cancelAll(); | 130 | + // customerProvider.cancelAll(); |
| 131 | } else { | 131 | } else { |
| 132 | - customerProvider.addAll(); | 132 | + // customerProvider.addAll(); |
| 133 | } | 133 | } |
| 134 | }, | 134 | }, |
| 135 | child: Row( | 135 | child: Row( |
| @@ -37,7 +37,7 @@ class _MarketingRecordsPageState extends State<MarketingRecordsPage> { | @@ -37,7 +37,7 @@ class _MarketingRecordsPageState extends State<MarketingRecordsPage> { | ||
| 37 | 37 | ||
| 38 | @override | 38 | @override |
| 39 | void dispose() { | 39 | void dispose() { |
| 40 | - EventBus().emit('refresh_store_marking_records_page'); | 40 | + bus.off('refresh_store_marking_records_page'); |
| 41 | super.dispose(); | 41 | super.dispose(); |
| 42 | } | 42 | } |
| 43 | 43 |
| @@ -291,10 +291,15 @@ class CustomerProvider extends ChangeNotifier { | @@ -291,10 +291,15 @@ class CustomerProvider extends ChangeNotifier { | ||
| 291 | pageState = PageState.Empty; | 291 | pageState = PageState.Empty; |
| 292 | } else { | 292 | } else { |
| 293 | pageState = PageState.Success; | 293 | pageState = PageState.Success; |
| 294 | - | 294 | + List<String> idList = []; |
| 295 | for (int i = 0; i < userHistorys.length; i++) { | 295 | for (int i = 0; i < userHistorys.length; i++) { |
| 296 | CustomerListSunModel item = userHistorys[i]; | 296 | CustomerListSunModel item = userHistorys[i]; |
| 297 | - | 297 | + idList.add(item.id); |
| 298 | + for (CustomerListSunModel value in selectCustomer) { | ||
| 299 | + if (value.id == item.id) { | ||
| 300 | + item.select = true; //原来选中的继续保持选中 | ||
| 301 | + } | ||
| 302 | + } | ||
| 298 | if (item.rname != null) { | 303 | if (item.rname != null) { |
| 299 | item.pinyin = | 304 | item.pinyin = |
| 300 | PinyinHelper.getPinyin(item.rname).replaceAll(' ', ''); | 305 | PinyinHelper.getPinyin(item.rname).replaceAll(' ', ''); |
| @@ -302,6 +307,16 @@ class CustomerProvider extends ChangeNotifier { | @@ -302,6 +307,16 @@ class CustomerProvider extends ChangeNotifier { | ||
| 302 | 307 | ||
| 303 | userHistorys[i] = item; | 308 | userHistorys[i] = item; |
| 304 | } | 309 | } |
| 310 | + // 把选中的列表,剔除掉现在结果里没有的 | ||
| 311 | + List<CustomerListSunModel> temp = []; | ||
| 312 | + for (CustomerListSunModel value in selectCustomer) { | ||
| 313 | + if (idList.contains(value.id)) { | ||
| 314 | + temp.add(value); | ||
| 315 | + } | ||
| 316 | + } | ||
| 317 | + selectCustomer = temp; //把选中的列表,剔除掉现在结果里没有的 | ||
| 318 | + getCheckValueMy(); | ||
| 319 | + //对于以前有选中的数据,接口请求后,继续赋值 | ||
| 305 | 320 | ||
| 306 | myHandleList(userHistorys, needRefresh: true); | 321 | myHandleList(userHistorys, needRefresh: true); |
| 307 | } | 322 | } |
| @@ -397,6 +412,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -397,6 +412,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 397 | } | 412 | } |
| 398 | notifyListeners(); | 413 | notifyListeners(); |
| 399 | }); | 414 | }); |
| 415 | + | ||
| 400 | if (baseResp != null && baseResp.code == Constant.status_success) { | 416 | if (baseResp != null && baseResp.code == Constant.status_success) { |
| 401 | List<CustomerListSunModel> user = | 417 | List<CustomerListSunModel> user = |
| 402 | baseResp.data.map<CustomerListSunModel>((value) { | 418 | baseResp.data.map<CustomerListSunModel>((value) { |
| @@ -407,26 +423,10 @@ class CustomerProvider extends ChangeNotifier { | @@ -407,26 +423,10 @@ class CustomerProvider extends ChangeNotifier { | ||
| 407 | } else { | 423 | } else { |
| 408 | for (int i = 0; i < user.length; i++) { | 424 | for (int i = 0; i < user.length; i++) { |
| 409 | CustomerListSunModel item = user[i]; | 425 | CustomerListSunModel item = user[i]; |
| 410 | - item.pinyinFirst = ''; | ||
| 411 | - item.pinyinList = []; | ||
| 412 | - item.pinyinList = []; | 426 | + item.select = true; |
| 413 | if (item.rname != null) { | 427 | if (item.rname != null) { |
| 414 | item.pinyin = | 428 | item.pinyin = |
| 415 | PinyinHelper.getPinyin(item.rname).replaceAll(' ', ''); | 429 | PinyinHelper.getPinyin(item.rname).replaceAll(' ', ''); |
| 416 | - List<String> pinyinList = | ||
| 417 | - PinyinHelper.getPinyin(item.rname).split(' '); | ||
| 418 | - | ||
| 419 | - String pinyinAll = ''; //组装全拼组合 | ||
| 420 | - for (int j = 0; j < pinyinList.length; j++) { | ||
| 421 | - String letter = pinyinList[j]; | ||
| 422 | - pinyinAll += pinyinList[j]; | ||
| 423 | - item.pinyinList.add(pinyinAll); | ||
| 424 | - if (letter.length > 0) { | ||
| 425 | - item.pinyinFirst += pinyinList[j].substring(0, 1); | ||
| 426 | - } else { | ||
| 427 | - item.pinyinFirst += ''; | ||
| 428 | - } | ||
| 429 | - } | ||
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | user[i] = item; | 432 | user[i] = item; |
| @@ -709,112 +709,77 @@ class CustomerProvider extends ChangeNotifier { | @@ -709,112 +709,77 @@ class CustomerProvider extends ChangeNotifier { | ||
| 709 | } | 709 | } |
| 710 | 710 | ||
| 711 | //全选按钮执行“全选” | 711 | //全选按钮执行“全选” |
| 712 | - addAll() async { | ||
| 713 | - // List<CustomerListSunModel> temp = returnNowList(); | ||
| 714 | - // //把数据状态全部改成true,即选中状态 | ||
| 715 | - // selectCustomer = []; | ||
| 716 | - // for (var i = 0; i < temp.length; i++) { | ||
| 717 | - // temp[i].select = true; | ||
| 718 | - // selectCustomer.add(temp[i]); | ||
| 719 | - // } | ||
| 720 | - // _giveValue(temp); | ||
| 721 | - // checkValue = true; | ||
| 722 | - // labelsValue(); | ||
| 723 | - // notifyListeners(); | ||
| 724 | - } | ||
| 725 | - | ||
| 726 | - labelsValue() { | ||
| 727 | - // List<CustomerListSunModel> temp = returnNowList(); | ||
| 728 | - // List<String> tempLabel = []; | ||
| 729 | - // for (CustomerListSunModel item in temp) { | ||
| 730 | - // if (item.select && item.attr != null) { | ||
| 731 | - // tempLabel.add(item.attr); | ||
| 732 | - // } | ||
| 733 | - // } | ||
| 734 | - // tempLabel = tempLabel.toSet().toList(); | ||
| 735 | - // labels = Utils.listToStringEnglish(tempLabel); | 712 | + addAllMy() async { |
| 713 | + //把数据状态全部改成true,即选中状态 | ||
| 714 | + selectCustomer = []; | ||
| 715 | + for (var i = 0; i < userHistorys.length; i++) { | ||
| 716 | + userHistorys[i].select = true; | ||
| 717 | + selectCustomer.add(userHistorys[i]); | ||
| 718 | + } | ||
| 719 | + checkValue = true; | ||
| 720 | + labelsValueMy(); | ||
| 721 | + notifyListeners(); | ||
| 736 | } | 722 | } |
| 737 | 723 | ||
| 738 | - _giveValue(List<CustomerListSunModel> temp) { | ||
| 739 | - // if (index == 0) { | ||
| 740 | - // userHistorysShow = temp; //全部 | ||
| 741 | - // } else if (index == 1) { | ||
| 742 | - // userHistorysShowHuoyue = temp; //活跃 | ||
| 743 | - // } else if (index == 2) { | ||
| 744 | - // userHistorysShowChenshui = temp; //沉睡 | ||
| 745 | - // } else if (index == 3) { | ||
| 746 | - // userHistorysShowLiushi = temp; //流失 | ||
| 747 | - // } | 724 | + labelsValueMy() { |
| 725 | + List<String> tempLabel = []; | ||
| 726 | + for (CustomerListSunModel item in userHistorys) { | ||
| 727 | + if (item.select && item.attr != null) { | ||
| 728 | + tempLabel.add(item.attr); | ||
| 729 | + } | ||
| 730 | + } | ||
| 731 | + tempLabel = tempLabel.toSet().toList(); | ||
| 732 | + labels = Utils.listToStringEnglish(tempLabel); | ||
| 748 | } | 733 | } |
| 749 | 734 | ||
| 750 | ///清除选择 | 735 | ///清除选择 |
| 751 | clearSelect() { | 736 | clearSelect() { |
| 752 | - selectCustomer = []; | ||
| 753 | - labelsValue(); | 737 | + // selectCustomer = []; |
| 738 | + // labelsValue(); | ||
| 754 | // couponsShow = []; | 739 | // couponsShow = []; |
| 755 | } | 740 | } |
| 756 | 741 | ||
| 757 | //全选按钮执行“全不选” | 742 | //全选按钮执行“全不选” |
| 758 | - cancelAll() async { | ||
| 759 | - // List<CustomerListSunModel> temp = returnNowList(); | ||
| 760 | - // selectCustomer = []; | ||
| 761 | - // //把数据状态全部改成false,即不选中状态 | ||
| 762 | - // for (var i = 0; i < temp.length; i++) { | ||
| 763 | - // temp[i].select = false; | ||
| 764 | - // } | ||
| 765 | - // _giveValue(temp); | ||
| 766 | - // checkValue = false; | ||
| 767 | - // labelsValue(); | ||
| 768 | - // notifyListeners(); | 743 | + cancelAllMy() async { |
| 744 | + selectCustomer = []; | ||
| 745 | + //把数据状态全部改成false,即不选中状态 | ||
| 746 | + for (var i = 0; i < userHistorys.length; i++) { | ||
| 747 | + userHistorys[i].select = false; | ||
| 748 | + } | ||
| 749 | + | ||
| 750 | + checkValue = false; | ||
| 751 | + labels = ''; | ||
| 752 | + notifyListeners(); | ||
| 769 | } | 753 | } |
| 770 | 754 | ||
| 771 | //选中 | 755 | //选中 |
| 772 | - addData(int index) { | ||
| 773 | - // List<CustomerListSunModel> temp = returnNowList(); | ||
| 774 | - // temp[index].select = true; | ||
| 775 | - // _giveValue(temp); | ||
| 776 | - // selectCustomer.add(temp[index]); | ||
| 777 | - // labelsValue(); | ||
| 778 | - // notifyListeners(); | 756 | + addDataMy(int index) { |
| 757 | + // userHistorys[index].select = true; | ||
| 758 | + selectCustomer.add(userHistorys[index]); | ||
| 759 | + labelsValueMy(); | ||
| 760 | + notifyListeners(); | ||
| 779 | } | 761 | } |
| 780 | 762 | ||
| 781 | - // ///返回目前选中的list | ||
| 782 | - // List<CustomerListSunModel> returnNowList() { | ||
| 783 | - // List<CustomerListSunModel> temp = []; | ||
| 784 | - // if (index == 0) { | ||
| 785 | - // temp = userHistorysShow; //全部 | ||
| 786 | - // } else if (index == 1) { | ||
| 787 | - // temp = userHistorysShowHuoyue; //活跃 | ||
| 788 | - // } else if (index == 2) { | ||
| 789 | - // temp = userHistorysShowChenshui; //沉睡 | ||
| 790 | - // } else if (index == 3) { | ||
| 791 | - // temp = userHistorysShowLiushi; //流失 | ||
| 792 | - // } | ||
| 793 | - // return temp; | ||
| 794 | - // } | ||
| 795 | - | ||
| 796 | //未选中 | 763 | //未选中 |
| 797 | - cancelData(int index) { | ||
| 798 | - // List<CustomerListSunModel> temp = returnNowList(); | ||
| 799 | - // temp[index].select = false; | ||
| 800 | - // _giveValue(temp); | ||
| 801 | - // selectCustomer.removeWhere((element) => element == temp[index].id); | ||
| 802 | - // labelsValue(); | ||
| 803 | - // notifyListeners(); | 764 | + cancelDataMy(int index) { |
| 765 | + // userHistorys[index].select = false; | ||
| 766 | + selectCustomer | ||
| 767 | + .removeWhere((element) => element.id == userHistorys[index].id); | ||
| 768 | + labelsValueMy(); | ||
| 769 | + notifyListeners(); | ||
| 804 | } | 770 | } |
| 805 | 771 | ||
| 806 | //获取全选按钮的状态 true or false | 772 | //获取全选按钮的状态 true or false |
| 807 | - getCheckValue() { | ||
| 808 | - // List<CustomerListSunModel> listData = returnNowList(); | ||
| 809 | - // bool temp = listData.any((value) { | ||
| 810 | - // return value.select == false; | ||
| 811 | - // }); | ||
| 812 | - // if (temp == true) { | ||
| 813 | - // checkValue = false; | ||
| 814 | - // } else { | ||
| 815 | - // checkValue = true; | ||
| 816 | - // } | ||
| 817 | - // notifyListeners(); | 773 | + getCheckValueMy() { |
| 774 | + bool temp = userHistorys.any((value) { | ||
| 775 | + return value.select == false; | ||
| 776 | + }); | ||
| 777 | + if (temp == true) { | ||
| 778 | + checkValue = false; | ||
| 779 | + } else { | ||
| 780 | + checkValue = true; | ||
| 781 | + } | ||
| 782 | + notifyListeners(); | ||
| 818 | } | 783 | } |
| 819 | 784 | ||
| 820 | // searchData(String key) { | 785 | // searchData(String key) { |
-
Please register or login to post a comment