|
|
|
// import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
// import 'package:flutter/material.dart';
|
|
|
|
// import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
// import 'package:one_key/pages/my/marketing_center/theme_model.dart';
|
|
|
|
// 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/seller_template_color_list_model.dart';
|
|
|
|
// import '../../../provider/marketing_center_provider.dart';
|
|
|
|
// import '../../../provider/user_model.dart';
|
|
|
|
// import '../../../res/colors.dart';
|
|
|
|
// import '../../../utils/dialog_util.dart';
|
|
|
|
// import '../../../utils/event_bus.dart';
|
|
|
|
// import '../../../utils/screen_util.dart';
|
|
|
|
// import '../../../utils/utils.dart';
|
|
|
|
// import '../../../widgets/MyDivider.dart';
|
|
|
|
// import '../../../widgets/round_button.dart';
|
|
|
|
// import '../../online_check/photo_view_wiget.dart';
|
|
|
|
// import 'package:card_swiper/card_swiper.dart';
|
|
|
|
|
|
|
|
// import 'dart:convert' as convert;
|
|
|
|
|
|
|
|
// /**
|
|
|
|
// *
|
|
|
|
// * 邀请函主题选择页面预览
|
|
|
|
// */
|
|
|
|
|
|
|
|
// class InvitationThemeHomePage extends StatefulWidget {
|
|
|
|
// // final SellerTemplateColorListSunModel themeSunModel;
|
|
|
|
// InvitationThemeHomePage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// _InvitationThemeHomePageState createState() =>
|
|
|
|
// _InvitationThemeHomePageState();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
|
|
|
|
// MarketingCenterProvider marketingCenterProvider;
|
|
|
|
// ScrollController controller = ScrollController();
|
|
|
|
|
|
|
|
// //当前店铺选中的颜色和板式
|
|
|
|
|
|
|
|
// String themeColor;
|
|
|
|
// String themeType; //模版类型
|
|
|
|
// String url;
|
|
|
|
// String themeTitle = ''; //标题样式
|
|
|
|
|
|
|
|
// ThemeModel themeModelCurrunt; //有配色对应的当前页面模版数据
|
|
|
|
// SellerTemplateColorListSunModel themeSunModel;
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// void initState() {
|
|
|
|
// super.initState();
|
|
|
|
// // if (themeSunModel.themeColorDefault != null) {
|
|
|
|
// // themeColor = themeSunModel.themeColorDefault;
|
|
|
|
// // url = themeSunModel
|
|
|
|
// // .colors[themeSunModel.colors
|
|
|
|
// // .indexWhere((element) => element.colorName == themeColor)]
|
|
|
|
// // .url;
|
|
|
|
// // } else {
|
|
|
|
// // if (themeSunModel.colors.length > 0) {
|
|
|
|
// // themeColor = themeSunModel.colors[0].colorName;
|
|
|
|
// // url = themeSunModel.colors[0].url;
|
|
|
|
// // } else {
|
|
|
|
// // url = themeSunModel.url;
|
|
|
|
// // }
|
|
|
|
// // }
|
|
|
|
|
|
|
|
// // themeType = themeSunModel.id;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// // _selectTheme(String id) {
|
|
|
|
// // List<ThemeSunModel> temp = [];
|
|
|
|
// // temp.addAll(themeModelCurrunt.urls);
|
|
|
|
// // temp.addAll(themeDatasno);
|
|
|
|
// // List<String> tempUrls = temp.map((e) => e.url).toList();
|
|
|
|
|
|
|
|
// // // List<String> temp =
|
|
|
|
// // // themeModel.urls.map((e) => e.url).toList();
|
|
|
|
// // // print(temp);
|
|
|
|
|
|
|
|
// // // List<String> temp =
|
|
|
|
// // // themeDatasno.map((e) => e.url).toList();
|
|
|
|
// // print(temp);
|
|
|
|
// // _showPhotoView(
|
|
|
|
// // context, temp.indexWhere((element) => element.id == id), tempUrls,
|
|
|
|
// // (index) {
|
|
|
|
// // //选中的index
|
|
|
|
// // themeType = temp[index].id; //当前选中模版的id
|
|
|
|
// // setState(() {});
|
|
|
|
// // });
|
|
|
|
// // }
|
|
|
|
|
|
|
|
// double _scale = 1.0;
|
|
|
|
// double _previousScale = 1.0;
|
|
|
|
// Offset _panOffset = Offset(0, 0);
|
|
|
|
// Offset _previousPanOffset = Offset(0, 0);
|
|
|
|
|
|
|
|
// void _onScaleUpdate(ScaleUpdateDetails details) {
|
|
|
|
// setState(() {
|
|
|
|
// _previousScale = _scale;
|
|
|
|
// _scale *= details.scale;
|
|
|
|
// _previousPanOffset = _panOffset;
|
|
|
|
// _panOffset = _panOffset -
|
|
|
|
// details.focalPoint -
|
|
|
|
// _panOffset +
|
|
|
|
// details.localFocalPoint;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
// _showPhotoView(BuildContext context, int index, List<String> imgs,
|
|
|
|
// {isShow = false, List dashName}) async {
|
|
|
|
// // if (imgs.length == 1 &&
|
|
|
|
// // imgs[0] ==
|
|
|
|
// // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
|
|
|
|
// // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
|
|
|
|
// // }
|
|
|
|
// Utils.setBarStatus(false, color: Colors.black);
|
|
|
|
// dynamic result = await showGeneralDialog(
|
|
|
|
// context: context,
|
|
|
|
// barrierDismissible: false,
|
|
|
|
// // barrierColor: Colors.red,
|
|
|
|
// barrierLabel:
|
|
|
|
// MaterialLocalizations.of(context).modalBarrierDismissLabel,
|
|
|
|
// transitionDuration: const Duration(milliseconds: 150),
|
|
|
|
// pageBuilder: (BuildContext context, Animation animation,
|
|
|
|
// Animation secondaryAnimation) {
|
|
|
|
// Widget child = Stack(
|
|
|
|
// alignment: Alignment.bottomCenter,
|
|
|
|
// children: <Widget>[
|
|
|
|
// PhotoPreview(
|
|
|
|
// initialIndex: index,
|
|
|
|
// photoList: imgs,
|
|
|
|
// isShow: isShow,
|
|
|
|
// dashName: dashName,
|
|
|
|
// needMask: false,
|
|
|
|
// needTap: false,
|
|
|
|
// callback: (curruntIndex) {
|
|
|
|
// //选中某个模版
|
|
|
|
// // callback(curruntIndex);
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
// // Positioned(
|
|
|
|
// // bottom: w(20),
|
|
|
|
// // child: InkWell(
|
|
|
|
// // onTap: () {
|
|
|
|
// // callback(index);
|
|
|
|
// // },
|
|
|
|
// // child: Container(
|
|
|
|
// // padding: EdgeInsets.symmetric(
|
|
|
|
// // horizontal: w(30), vertical: w(10)),
|
|
|
|
// // decoration: BoxDecoration(
|
|
|
|
// // color: MyColours.color_ffffff,
|
|
|
|
// // borderRadius: BorderRadius.circular(r(30)),
|
|
|
|
// // ),
|
|
|
|
// // child: Text(
|
|
|
|
// // '应用',
|
|
|
|
// // style: TextStyle(
|
|
|
|
// // decoration: TextDecoration.none,
|
|
|
|
// // color: MyColours.color_515151,
|
|
|
|
// // fontSize: font(16)),
|
|
|
|
// // ),
|
|
|
|
// // ),
|
|
|
|
// // ))
|
|
|
|
// ],
|
|
|
|
// );
|
|
|
|
// return Material(child: child);
|
|
|
|
// });
|
|
|
|
// Utils.setBarStatus(true, color: Colors.white);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
// marketingCenterProvider =
|
|
|
|
// Provider.of<MarketingCenterProvider>(context, listen: true);
|
|
|
|
// return Scaffold(
|
|
|
|
// backgroundColor: MyColours.color_ffffff,
|
|
|
|
// appBar: SystemAppBar('客户通知设置'),
|
|
|
|
// body: Column(
|
|
|
|
// children: [
|
|
|
|
// Expanded(
|
|
|
|
// child: SingleChildScrollView(
|
|
|
|
// child: Column(
|
|
|
|
// children: [
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// DialogUtil.showThemeColorSelectDialogNew(
|
|
|
|
// context, themeSunModel.colors, callback: (object) {
|
|
|
|
// print(object);
|
|
|
|
// setState(() {
|
|
|
|
// themeColor = object;
|
|
|
|
// url = themeSunModel
|
|
|
|
// .colors[themeSunModel.colors.indexWhere(
|
|
|
|
// (element) => element.colorName == object)]
|
|
|
|
// .url;
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: w(16), top: w(12), bottom: w(12), right: w(24)),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// children: [
|
|
|
|
// Text(
|
|
|
|
// '主题颜色选择',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: font(16)),
|
|
|
|
// ),
|
|
|
|
// Spacer(),
|
|
|
|
// Text(
|
|
|
|
// themeColor??'',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: themeColor == '当前主题不可用'
|
|
|
|
// ? MyColours.color_BFC4D4
|
|
|
|
// : MyColours.color_515151,
|
|
|
|
// fontSize: font(16)),
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: w(11), vertical: w(4)),
|
|
|
|
// child: Image.asset(
|
|
|
|
// "assets/arrow_right_new.png",
|
|
|
|
// width: w(9),
|
|
|
|
// height: w(16),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// // RoundButton(
|
|
|
|
// // text: '预览',
|
|
|
|
// // gradientStart: MyColours.color_ffffff,
|
|
|
|
// // gradientEnd: MyColours.color_ffffff,
|
|
|
|
// // borderColor: MyColours.color_438E93,
|
|
|
|
// // textColor: MyColours.color_438E93,
|
|
|
|
// // radius: ScreenUtil().setWidth(22),
|
|
|
|
// // fontSize: 24,
|
|
|
|
// // width: w(72),
|
|
|
|
// // height: ScreenUtil().setWidth(44),
|
|
|
|
// // isBold: true,
|
|
|
|
// // onPressed: () {
|
|
|
|
// // NavigatorUtil.goMarkingPreviewPage(context);
|
|
|
|
// // },
|
|
|
|
// // ),
|
|
|
|
// ]))),
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.only(left: w(16)),
|
|
|
|
// child: MyDivider(double.infinity, w(0.5),
|
|
|
|
// color: MyColours.color_E7E7E7)),
|
|
|
|
// // VEmptyView(24),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {},
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: w(16), top: w(12), bottom: w(12), right: w(16)),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// children: [
|
|
|
|
// Text(
|
|
|
|
// '介绍模块标题样式',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: font(16)),
|
|
|
|
// ),
|
|
|
|
// Spacer(),
|
|
|
|
// Text(
|
|
|
|
// '当前主题不可用',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: themeTitle == '当前主题不可用'
|
|
|
|
// ? MyColours.color_BFC4D4
|
|
|
|
// : MyColours.color_515151,
|
|
|
|
// fontSize: font(16)),
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: w(11), vertical: w(4)),
|
|
|
|
// child: Image.asset(
|
|
|
|
// "assets/arrow_right_new.png",
|
|
|
|
// width: w(9),
|
|
|
|
// height: w(16),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// // RoundButton(
|
|
|
|
// // text: '预览',
|
|
|
|
// // gradientStart: MyColours.color_ffffff,
|
|
|
|
// // gradientEnd: MyColours.color_ffffff,
|
|
|
|
// // borderColor: MyColours.color_438E93,
|
|
|
|
// // textColor: MyColours.color_438E93,
|
|
|
|
// // radius: ScreenUtil().setWidth(22),
|
|
|
|
// // fontSize: 24,
|
|
|
|
// // width: w(72),
|
|
|
|
// // height: ScreenUtil().setWidth(44),
|
|
|
|
// // isBold: true,
|
|
|
|
// // onPressed: () {
|
|
|
|
// // NavigatorUtil.goMarkingPreviewPage(context);
|
|
|
|
// // },
|
|
|
|
// // ),
|
|
|
|
// ]))),
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.only(left: w(16)),
|
|
|
|
// child: MyDivider(double.infinity, w(0.5),
|
|
|
|
// color: MyColours.color_E7E7E7)),
|
|
|
|
// Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: w(16), top: w(12), bottom: w(12), right: w(16)),
|
|
|
|
// child: Text(
|
|
|
|
// '通知主题选择(左右滑动选择要使用的主题)',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151, fontSize: font(16)),
|
|
|
|
// )),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// Swiper(
|
|
|
|
|
|
|
|
// itemBuilder: (BuildContext context,int index){
|
|
|
|
// return Image.network("http://nosqn.colorcun.com/app/seller-hj-empty.png",fit: BoxFit.fill,);
|
|
|
|
// },
|
|
|
|
// itemCount: 3,
|
|
|
|
// pagination: SwiperPagination(),
|
|
|
|
// control: SwiperControl(),
|
|
|
|
// ),
|
|
|
|
// // GestureDetector(
|
|
|
|
// // onScaleUpdate: _onScaleUpdate,
|
|
|
|
// // child: Transform(
|
|
|
|
// // alignment: Alignment.center,
|
|
|
|
// // transform: Matrix4.identity()
|
|
|
|
// // ..translate(_panOffset.dx, _panOffset.dy)
|
|
|
|
// // ..scale(_scale),
|
|
|
|
// // child: Image.network(
|
|
|
|
// // 'http://nosqn.colorcun.com/app/seller-hj-empty.png',
|
|
|
|
// // fit: BoxFit.contain,
|
|
|
|
// // ),
|
|
|
|
// // ),
|
|
|
|
// // ),
|
|
|
|
// // InkWell(
|
|
|
|
// // onTap: () {
|
|
|
|
// // _showPhotoView(context, 0, [url]);
|
|
|
|
// // },
|
|
|
|
// // child: CachedNetworkImage(
|
|
|
|
// // imageUrl: url,
|
|
|
|
// // width: ScreenUtil().screenWidth - w(32),
|
|
|
|
// // fit: BoxFit.fitWidth,
|
|
|
|
// // alignment: Alignment.topCenter,
|
|
|
|
// // )),
|
|
|
|
// ],
|
|
|
|
// ))),
|
|
|
|
// Container(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// top: w(12), bottom: w(25), left: w(45), right: w(45)),
|
|
|
|
// child: RoundButton(
|
|
|
|
// onPressed: () async {
|
|
|
|
// //接口成功后刷新并返回前一页
|
|
|
|
// //接口
|
|
|
|
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// 'sid': Provider.of<UserModel>(context, listen: false)
|
|
|
|
// .user
|
|
|
|
// .sellerid,
|
|
|
|
// 'type': themeType,
|
|
|
|
// 'lite_class': themeColor == null
|
|
|
|
// ? null
|
|
|
|
// : themeSunModel
|
|
|
|
// .colors[themeSunModel.colors.indexWhere(
|
|
|
|
// (element) => element.colorName == themeColor)]
|
|
|
|
// .liteClass
|
|
|
|
// };
|
|
|
|
|
|
|
|
// bool success = await marketingCenterProvider
|
|
|
|
// .setSellerTemplateConf(context, params,
|
|
|
|
// showLoading: true);
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('设置成功');
|
|
|
|
// //选择当前模版+主题色
|
|
|
|
// bus.emit('theme_color_type', {
|
|
|
|
// 'themeColor': themeColor,
|
|
|
|
// 'themeType': themeType,
|
|
|
|
// });
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// text: '确定',
|
|
|
|
// fontSize: 32,
|
|
|
|
// isBold: true,
|
|
|
|
// textColor: MyColours.color_F8F9FD,
|
|
|
|
// height: ScreenUtil().setWidth(43 * 2),
|
|
|
|
// // width: ScreenUtil().setWidth(130 * 2),
|
|
|
|
// radius: ScreenUtil().setWidth(10),
|
|
|
|
// )),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
// } |
...
|
...
|
|