Showing
10 changed files
with
255 additions
and
115 deletions
assets/bj_left.png
0 → 100644
8.49 KB
assets/bj_right.png
0 → 100644
8.4 KB
assets/yd_bianji.png
0 → 100644
1.16 KB
assets/yd_down.png
0 → 100644
25.4 KB
assets/yd_up.png
0 → 100644
25.5 KB
| @@ -158,101 +158,183 @@ class InvicationPageState extends State<InvicationPage> { | @@ -158,101 +158,183 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 158 | child: Stack( | 158 | child: Stack( |
| 159 | children: [ | 159 | children: [ |
| 160 | Padding( | 160 | Padding( |
| 161 | - padding: EdgeInsets.only(top: ScreenUtil().setWidth(0)), | 161 | + padding: |
| 162 | + EdgeInsets.only(top: ScreenUtil().setWidth(35 * 2)), | ||
| 162 | child: Column(children: [ | 163 | child: Column(children: [ |
| 163 | Expanded( | 164 | Expanded( |
| 164 | child: ListView( | 165 | child: ListView( |
| 165 | controller: controller, | 166 | controller: controller, |
| 166 | physics: BouncingScrollPhysics(), | 167 | physics: BouncingScrollPhysics(), |
| 167 | children: <Widget>[ | 168 | children: <Widget>[ |
| 168 | - VEmptyView(60), | ||
| 169 | Center( | 169 | Center( |
| 170 | child: Column( | 170 | child: Column( |
| 171 | children: <Widget>[ | 171 | children: <Widget>[ |
| 172 | Image.asset( | 172 | Image.asset( |
| 173 | "assets/img_ydap.png", | 173 | "assets/img_ydap.png", |
| 174 | - width: ScreenUtil().setWidth(190 * 2), | ||
| 175 | - height: ScreenUtil().setHeight(200), | 174 | + width: ScreenUtil().setWidth(220 * 2), |
| 175 | + height: ScreenUtil().setHeight(120 * 2), | ||
| 176 | ), | 176 | ), |
| 177 | - VEmptyView(69), | ||
| 178 | - Row( | ||
| 179 | - mainAxisSize: MainAxisSize.min, | ||
| 180 | - children: <Widget>[ | ||
| 181 | - Container( | ||
| 182 | - width: ScreenUtil().setWidth(108), | ||
| 183 | - height: ScreenUtil().setHeight(2), | ||
| 184 | - color: MyColours.color_979797, | ||
| 185 | - ), | ||
| 186 | - Container( | ||
| 187 | - width: ScreenUtil().setWidth(442), | ||
| 188 | - height: ScreenUtil().setHeight(43), | ||
| 189 | - alignment: Alignment.center, | ||
| 190 | - decoration: BoxDecoration( | ||
| 191 | - border: Border.all( | ||
| 192 | - color: MyColours.color_979797, | ||
| 193 | - width: | ||
| 194 | - ScreenUtil().setWidth(2)), | ||
| 195 | - borderRadius: BorderRadius.all( | ||
| 196 | - Radius.circular(ScreenUtil() | ||
| 197 | - .setWidth(18)))), | ||
| 198 | - child: Text( | ||
| 199 | - "订包间,用周到安排", | ||
| 200 | - style: TextStyle( | ||
| 201 | - color: MyColours.color_999999, | ||
| 202 | - fontSize: ScreenUtil().setSp(28)), | 177 | + VEmptyView(20), |
| 178 | + Container( | ||
| 179 | + margin: EdgeInsets.symmetric( | ||
| 180 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 181 | + padding: EdgeInsets.all( | ||
| 182 | + ScreenUtil().setWidth(60)), | ||
| 183 | + decoration: BoxDecoration( | ||
| 184 | + gradient: LinearGradient( | ||
| 185 | + begin: Alignment.topCenter, | ||
| 186 | + end: Alignment.bottomCenter, | ||
| 187 | + colors: [ | ||
| 188 | + MyColours.color_F7F1E8, | ||
| 189 | + MyColours.color_E3D6C7, | ||
| 190 | + ], | ||
| 203 | ), | 191 | ), |
| 204 | - ), | ||
| 205 | - Container( | ||
| 206 | - width: ScreenUtil().setWidth(108), | ||
| 207 | - height: ScreenUtil().setHeight(2), | ||
| 208 | - color: MyColours.color_979797, | ||
| 209 | - ), | ||
| 210 | - ], | ||
| 211 | - ), | ||
| 212 | - _middleWidget("餐厅", user.sellername), | ||
| 213 | - _middleWidget("包间", | ||
| 214 | - widget.tableInfo.replaceAll("\n", "")), | ||
| 215 | - _middleWidget("时间", dateTimeStr), | ||
| 216 | - VEmptyView(80), | ||
| 217 | - Column( | ||
| 218 | - children: <Widget>[ | ||
| 219 | - Row( | ||
| 220 | - mainAxisSize: MainAxisSize.min, | ||
| 221 | - children: <Widget>[ | ||
| 222 | - Image.asset( | ||
| 223 | - "assets/invication_map.png", | ||
| 224 | - width: ScreenUtil().setWidth(22), | ||
| 225 | - height: ScreenUtil().setWidth(28), | 192 | + borderRadius: BorderRadius.circular( |
| 193 | + ScreenUtil().setWidth(10))), | ||
| 194 | + child: Column( | ||
| 195 | + crossAxisAlignment: | ||
| 196 | + CrossAxisAlignment.center, | ||
| 197 | + children: [ | ||
| 198 | + Container( | ||
| 199 | + color: Colors.red, | ||
| 200 | + height: 160, | ||
| 201 | + ), | ||
| 202 | + VEmptyView(40), | ||
| 203 | + Image.asset( | ||
| 204 | + "assets/yd_up.png", | ||
| 205 | + width: ScreenUtil().setWidth(195 * 2), | ||
| 206 | + height: | ||
| 207 | + ScreenUtil().setHeight(33 * 2), | ||
| 208 | + ), | ||
| 209 | + VEmptyView(60), | ||
| 210 | + Container( | ||
| 211 | + height: ScreenUtil().setWidth(48), | ||
| 212 | + child: Text( | ||
| 213 | + user.sellername, | ||
| 214 | + style: TextStyle( | ||
| 215 | + letterSpacing: ScreenUtil() | ||
| 216 | + .setWidth(2.13 * 2), | ||
| 217 | + color: MyColours.color_794F28, | ||
| 218 | + fontWeight: FontWeight.bold, | ||
| 219 | + fontSize: | ||
| 220 | + ScreenUtil().setSp(34)), | ||
| 221 | + ), | ||
| 222 | + ), | ||
| 223 | + VEmptyView(30), | ||
| 224 | + Container( | ||
| 225 | + height: ScreenUtil().setWidth(36), | ||
| 226 | + child: Text( | ||
| 227 | + '已为您安排在包间', | ||
| 228 | + style: TextStyle( | ||
| 229 | + letterSpacing: ScreenUtil() | ||
| 230 | + .setWidth(1.7 * 2), | ||
| 231 | + color: MyColours.color_C19E5B, | ||
| 232 | + fontSize: | ||
| 233 | + ScreenUtil().setSp(26)), | ||
| 226 | ), | 234 | ), |
| 227 | - Container( | ||
| 228 | - margin: EdgeInsets.symmetric( | ||
| 229 | - horizontal: | ||
| 230 | - ScreenUtil().setWidth(13)), | ||
| 231 | - child: Text("地址导航", | 235 | + ), |
| 236 | + VEmptyView(12), | ||
| 237 | + Row( | ||
| 238 | + mainAxisAlignment: | ||
| 239 | + MainAxisAlignment.center, | ||
| 240 | + children: [ | ||
| 241 | + Image.asset( | ||
| 242 | + "assets/bj_left.png", | ||
| 243 | + width: | ||
| 244 | + ScreenUtil().setWidth(30 * 2), | ||
| 245 | + height: ScreenUtil() | ||
| 246 | + .setHeight(58 * 2), | ||
| 247 | + ), | ||
| 248 | + Container( | ||
| 249 | + height: ScreenUtil().setWidth(48), | ||
| 250 | + child: Text( | ||
| 251 | + widget.tableInfo | ||
| 252 | + .replaceAll("\n", ""), | ||
| 232 | style: TextStyle( | 253 | style: TextStyle( |
| 254 | + letterSpacing: ScreenUtil() | ||
| 255 | + .setWidth(2.13 * 2), | ||
| 233 | color: | 256 | color: |
| 234 | - MyColours.color_CEB689, | ||
| 235 | - fontSize: ScreenUtil() | ||
| 236 | - .setSp(28))), | 257 | + MyColours.color_794F28, |
| 258 | + fontWeight: FontWeight.bold, | ||
| 259 | + fontSize: | ||
| 260 | + ScreenUtil().setSp(34)), | ||
| 261 | + ), | ||
| 262 | + ), | ||
| 263 | + Image.asset( | ||
| 264 | + "assets/bj_right.png", | ||
| 265 | + width: | ||
| 266 | + ScreenUtil().setWidth(30 * 2), | ||
| 267 | + height: ScreenUtil() | ||
| 268 | + .setHeight(58 * 2), | ||
| 269 | + ), | ||
| 270 | + ], | ||
| 271 | + ), | ||
| 272 | + VEmptyView(18), | ||
| 273 | + RoundButton( | ||
| 274 | + text: '浏览照片', | ||
| 275 | + width: ScreenUtil().setWidth(68 * 2), | ||
| 276 | + height: ScreenUtil().setWidth(24 * 2), | ||
| 277 | + fontSize: 24, | ||
| 278 | + textColor: MyColours.color_794F28, | ||
| 279 | + isBold: false, | ||
| 280 | + gradientStart: | ||
| 281 | + Color.fromRGBO(121, 79, 40, 0.1), | ||
| 282 | + gradientEnd: | ||
| 283 | + Color.fromRGBO(121, 79, 40, 0.1), | ||
| 284 | + ), | ||
| 285 | + VEmptyView(60), | ||
| 286 | + Container( | ||
| 287 | + height: ScreenUtil().setWidth(40), | ||
| 288 | + child: Text( | ||
| 289 | + '时间:${dateTimeStr}', | ||
| 290 | + style: TextStyle( | ||
| 291 | + letterSpacing: ScreenUtil() | ||
| 292 | + .setWidth(1.8 * 2), | ||
| 293 | + color: MyColours.color_794F28, | ||
| 294 | + fontWeight: FontWeight.bold, | ||
| 295 | + fontSize: | ||
| 296 | + ScreenUtil().setSp(28)), | ||
| 237 | ), | 297 | ), |
| 238 | - Image.asset( | ||
| 239 | - "assets/invication_arrow_right.png", | ||
| 240 | - width: ScreenUtil().setWidth(14), | ||
| 241 | - height: ScreenUtil().setWidth(22), | 298 | + ), |
| 299 | + VEmptyView(20), | ||
| 300 | + Container( | ||
| 301 | + // height: ScreenUtil().setWidth(40), | ||
| 302 | + child: Text( | ||
| 303 | + '地址:${user.sellerAddr}', | ||
| 304 | + maxLines: 3, | ||
| 305 | + overflow: TextOverflow.ellipsis, | ||
| 306 | + textAlign: TextAlign.center, | ||
| 307 | + style: TextStyle( | ||
| 308 | + letterSpacing: ScreenUtil() | ||
| 309 | + .setWidth(1.8 * 2), | ||
| 310 | + color: MyColours.color_794F28, | ||
| 311 | + fontWeight: FontWeight.bold, | ||
| 312 | + fontSize: | ||
| 313 | + ScreenUtil().setSp(28)), | ||
| 242 | ), | 314 | ), |
| 243 | - ], | ||
| 244 | - ), | ||
| 245 | - Container( | ||
| 246 | - margin: EdgeInsets.only( | ||
| 247 | - top: ScreenUtil().setHeight(20)), | ||
| 248 | - child: Text( | ||
| 249 | - user.sellerAddr, | ||
| 250 | - style: TextStyle( | ||
| 251 | - color: MyColours.color_F2F2F2, | ||
| 252 | - fontSize: ScreenUtil().setSp(36)), | ||
| 253 | ), | 315 | ), |
| 254 | - ) | ||
| 255 | - ], | 316 | + // VEmptyView(20), |
| 317 | + // RoundButton( | ||
| 318 | + // text: '一键导航', | ||
| 319 | + // width: ScreenUtil().setWidth(68 * 2), | ||
| 320 | + // height: ScreenUtil().setWidth(24 * 2), | ||
| 321 | + // fontSize: 24, | ||
| 322 | + // textColor: MyColours.color_794F28, | ||
| 323 | + // isBold: false, | ||
| 324 | + // gradientStart: | ||
| 325 | + // Color.fromRGBO(121, 79, 40, 0.1), | ||
| 326 | + // gradientEnd: | ||
| 327 | + // Color.fromRGBO(121, 79, 40, 0.1), | ||
| 328 | + // ), | ||
| 329 | + VEmptyView(60), | ||
| 330 | + Image.asset( | ||
| 331 | + "assets/yd_down.png", | ||
| 332 | + width: ScreenUtil().setWidth(195 * 2), | ||
| 333 | + height: | ||
| 334 | + ScreenUtil().setHeight(33 * 2), | ||
| 335 | + ), | ||
| 336 | + ], | ||
| 337 | + ), | ||
| 256 | ) | 338 | ) |
| 257 | ], | 339 | ], |
| 258 | ), | 340 | ), |
| @@ -4,6 +4,7 @@ import 'package:cached_network_image/cached_network_image.dart'; | @@ -4,6 +4,7 @@ import 'package:cached_network_image/cached_network_image.dart'; | ||
| 4 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 5 | import 'package:flutter_screenutil/screenutil.dart'; | 5 | import 'package:flutter_screenutil/screenutil.dart'; |
| 6 | import 'package:one_key/models/upload_img_model.dart'; | 6 | import 'package:one_key/models/upload_img_model.dart'; |
| 7 | +import 'package:one_key/pages/online_check/photo_view_wiget.dart'; | ||
| 7 | import 'package:one_key/pages/online_check/progress.dart'; | 8 | import 'package:one_key/pages/online_check/progress.dart'; |
| 8 | import 'package:one_key/provider/base_info_provider.dart'; | 9 | import 'package:one_key/provider/base_info_provider.dart'; |
| 9 | import 'package:one_key/provider/upload_img_provider.dart'; | 10 | import 'package:one_key/provider/upload_img_provider.dart'; |
| @@ -165,6 +166,38 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -165,6 +166,38 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 165 | ); | 166 | ); |
| 166 | } | 167 | } |
| 167 | 168 | ||
| 169 | + //查看大图 | ||
| 170 | + _showPhotoView(BuildContext context, int index, List imgs, | ||
| 171 | + {isShow = false, List dashName}) async { | ||
| 172 | + // if (imgs.length == 1 && | ||
| 173 | + // imgs[0] == | ||
| 174 | + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') { | ||
| 175 | + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png'; | ||
| 176 | + // } | ||
| 177 | + Utils.setBarStatus(false, color: Colors.black); | ||
| 178 | + dynamic result = await showGeneralDialog( | ||
| 179 | + context: context, | ||
| 180 | + barrierDismissible: false, | ||
| 181 | + // barrierColor: Colors.red, | ||
| 182 | + barrierLabel: | ||
| 183 | + MaterialLocalizations.of(context).modalBarrierDismissLabel, | ||
| 184 | + transitionDuration: const Duration(milliseconds: 150), | ||
| 185 | + pageBuilder: (BuildContext context, Animation animation, | ||
| 186 | + Animation secondaryAnimation) { | ||
| 187 | + Widget child = Stack( | ||
| 188 | + children: <Widget>[ | ||
| 189 | + PhotoPreview( | ||
| 190 | + initialIndex: index, | ||
| 191 | + photoList: imgs, | ||
| 192 | + isShow: isShow, | ||
| 193 | + dashName: dashName) | ||
| 194 | + ], | ||
| 195 | + ); | ||
| 196 | + return child; | ||
| 197 | + }); | ||
| 198 | + Utils.setBarStatus(true, color: Colors.white); | ||
| 199 | + } | ||
| 200 | + | ||
| 168 | ///#相机拍照,单图选择 | 201 | ///#相机拍照,单图选择 |
| 169 | Future _getFromPictureOrCamera( | 202 | Future _getFromPictureOrCamera( |
| 170 | String title, UploadImgModel imgModel, imageSource) async { | 203 | String title, UploadImgModel imgModel, imageSource) async { |
| @@ -211,30 +244,51 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -211,30 +244,51 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 211 | Spacer(), | 244 | Spacer(), |
| 212 | Stack( | 245 | Stack( |
| 213 | children: [ | 246 | children: [ |
| 214 | - ClipRRect( | ||
| 215 | - borderRadius: | ||
| 216 | - BorderRadius.circular(ScreenUtil().setWidth(radius)), | ||
| 217 | - child: model.file == null | ||
| 218 | - ? model.qiniuUrl != null | ||
| 219 | - ? CachedNetworkImage( | ||
| 220 | - imageUrl: model.qiniuUrl, | ||
| 221 | - fit: BoxFit.cover, | ||
| 222 | - width: ScreenUtil().setWidth(imgSize * 2), | ||
| 223 | - height: ScreenUtil().setWidth(imgSize * 2), | ||
| 224 | - ) | ||
| 225 | - : Image.asset( | ||
| 226 | - Utils.getImgPath( | ||
| 227 | - title == '头像' ? 'touxiang' : 'erweima'), | ||
| 228 | - fit: BoxFit.cover, | ||
| 229 | - width: ScreenUtil().setWidth(imgSize * 2), | ||
| 230 | - height: ScreenUtil().setWidth(imgSize * 2), | ||
| 231 | - ) | ||
| 232 | - : Image.file( | ||
| 233 | - model.file, | ||
| 234 | - fit: BoxFit.cover, | ||
| 235 | - width: ScreenUtil().setWidth(imgSize * 2), | ||
| 236 | - height: ScreenUtil().setWidth(imgSize * 2), | ||
| 237 | - ), | 247 | + InkWell( |
| 248 | + onTap: () { | ||
| 249 | + double process; | ||
| 250 | + String qiniuUrl; | ||
| 251 | + List<String> tempList = []; | ||
| 252 | + if (title == '头像') { | ||
| 253 | + process = _uploadImageProvider.touxiang.process; | ||
| 254 | + qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl; | ||
| 255 | + } else { | ||
| 256 | + process = _uploadImageProvider.erweima.process; | ||
| 257 | + qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 258 | + } | ||
| 259 | + | ||
| 260 | + if (qiniuUrl != null) { | ||
| 261 | + tempList.add(qiniuUrl); | ||
| 262 | + | ||
| 263 | + ///没有上传完成的不可以点击 | ||
| 264 | + _showPhotoView(context, 0, tempList); | ||
| 265 | + } | ||
| 266 | + }, | ||
| 267 | + child: ClipRRect( | ||
| 268 | + borderRadius: | ||
| 269 | + BorderRadius.circular(ScreenUtil().setWidth(radius)), | ||
| 270 | + child: model.file == null | ||
| 271 | + ? model.qiniuUrl != null | ||
| 272 | + ? CachedNetworkImage( | ||
| 273 | + imageUrl: model.qiniuUrl, | ||
| 274 | + fit: BoxFit.cover, | ||
| 275 | + width: ScreenUtil().setWidth(imgSize * 2), | ||
| 276 | + height: ScreenUtil().setWidth(imgSize * 2), | ||
| 277 | + ) | ||
| 278 | + : Image.asset( | ||
| 279 | + Utils.getImgPath( | ||
| 280 | + title == '头像' ? 'touxiang' : 'erweima'), | ||
| 281 | + fit: BoxFit.cover, | ||
| 282 | + width: ScreenUtil().setWidth(imgSize * 2), | ||
| 283 | + height: ScreenUtil().setWidth(imgSize * 2), | ||
| 284 | + ) | ||
| 285 | + : Image.file( | ||
| 286 | + model.file, | ||
| 287 | + fit: BoxFit.cover, | ||
| 288 | + width: ScreenUtil().setWidth(imgSize * 2), | ||
| 289 | + height: ScreenUtil().setWidth(imgSize * 2), | ||
| 290 | + ), | ||
| 291 | + ), | ||
| 238 | ), | 292 | ), |
| 239 | model.file == null && model.qiniuUrl == null | 293 | model.file == null && model.qiniuUrl == null |
| 240 | ? Offstage( | 294 | ? Offstage( |
| @@ -78,4 +78,8 @@ class MyColours { | @@ -78,4 +78,8 @@ class MyColours { | ||
| 78 | static const Color color_7B512A = Color(0xff7B512A); | 78 | static const Color color_7B512A = Color(0xff7B512A); |
| 79 | static const Color color_262628 = Color(0xff262628); | 79 | static const Color color_262628 = Color(0xff262628); |
| 80 | static const Color color_FDA31D = Color(0xffFDA31D); | 80 | static const Color color_FDA31D = Color(0xffFDA31D); |
| 81 | + static const Color color_F7F1E8 = Color(0xffF7F1E8); | ||
| 82 | + static const Color color_E3D6C7 = Color(0xffE3D6C7); | ||
| 83 | + static const Color color_794F28 = Color(0xff794F28); | ||
| 84 | + static const Color color_C19E5B = Color(0xffC19E5B); | ||
| 81 | } | 85 | } |
| @@ -269,22 +269,22 @@ class Utils { | @@ -269,22 +269,22 @@ class Utils { | ||
| 269 | String _path = "pages/customer/index?id=$rid&hasInvitation=1"; | 269 | String _path = "pages/customer/index?id=$rid&hasInvitation=1"; |
| 270 | String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店"; | 270 | String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店"; |
| 271 | //跳转小程序 | 271 | //跳转小程序 |
| 272 | - // var model = new WeChatShareMiniProgramModel( | ||
| 273 | - // webPageUrl: _webPageUrl, | ||
| 274 | - // userName: _userName, | ||
| 275 | - // title: _title, | ||
| 276 | - // path: _path, | ||
| 277 | - // description: _description, | ||
| 278 | - // thumbnail: WeChatImage.network(_thumbnail)); | 272 | + var model = new WeChatShareMiniProgramModel( |
| 273 | + webPageUrl: _webPageUrl, | ||
| 274 | + userName: _userName, | ||
| 275 | + title: _title, | ||
| 276 | + path: _path, | ||
| 277 | + description: _description, | ||
| 278 | + thumbnail: WeChatImage.network(_thumbnail)); | ||
| 279 | //分享链接 | 279 | //分享链接 |
| 280 | - var model = WeChatShareWebPageModel( | ||
| 281 | - // 'https://xt04.colorcun.com/h5/index.html#/?id=$rid&hasInvitation=1', | ||
| 282 | - 'https://xt04.colorcun.com/h5/index.html?id=$rid&hasInvitation=1&hasSellerShare=1', | ||
| 283 | - title: _title, | ||
| 284 | - description: _description, | ||
| 285 | - thumbnail: WeChatImage.network(_thumbnail), | ||
| 286 | - scene: WeChatScene.SESSION, | ||
| 287 | - ); | 280 | + // var model = WeChatShareWebPageModel( |
| 281 | + // // 'https://xt04.colorcun.com/h5/index.html#/?id=$rid&hasInvitation=1', | ||
| 282 | + // 'https://xt04.colorcun.com/h5/index.html?id=$rid&hasInvitation=1&hasSellerShare=1', | ||
| 283 | + // title: _title, | ||
| 284 | + // description: _description, | ||
| 285 | + // thumbnail: WeChatImage.network(_thumbnail), | ||
| 286 | + // scene: WeChatScene.SESSION, | ||
| 287 | + // ); | ||
| 288 | 288 | ||
| 289 | bool isSuccess = await shareToWeChat(model); | 289 | bool isSuccess = await shareToWeChat(model); |
| 290 | return isSuccess; | 290 | return isSuccess; |
-
Please register or login to post a comment