Commit 64b5db77ad2754e26a2fa8cd9824e6c55a837942

Authored by wdn127929
1 parent 54dbe176

店铺介绍UI ok

@@ -340,7 +340,9 @@ class _FirstImagePageState extends State<FirstImagePage> { @@ -340,7 +340,9 @@ class _FirstImagePageState extends State<FirstImagePage> {
340 fit: BoxFit.cover, 340 fit: BoxFit.cover,
341 ), 341 ),
342 Container( 342 Container(
343 - height: w(25), 343 + width: w(150),
  344 + height: w(30),
  345 + color: MyColours.color_4D000000,
344 alignment: Alignment.center, 346 alignment: Alignment.center,
345 child: Text( 347 child: Text(
346 '点击图片可以更换', 348 '点击图片可以更换',
@@ -355,8 +357,9 @@ class _FirstImagePageState extends State<FirstImagePage> { @@ -355,8 +357,9 @@ class _FirstImagePageState extends State<FirstImagePage> {
355 width: double.infinity, 357 width: double.infinity,
356 height: w(210), 358 height: w(210),
357 child: Column( 359 child: Column(
  360 + mainAxisAlignment: MainAxisAlignment.center,
358 children: [ 361 children: [
359 - VEmptyView(80), 362 + // VEmptyView(80),
360 Image.asset( 363 Image.asset(
361 Utils.getImgPath('add_img'), 364 Utils.getImgPath('add_img'),
362 width: w(63), 365 width: w(63),
@@ -138,10 +138,16 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -138,10 +138,16 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
138 )); 138 ));
139 } 139 }
140 140
141 - Widget _introduceWidget() { 141 + Widget _introduceWidget(EdgeInsets edgeInsets,
  142 + {double width = double.infinity,
  143 + Color textColor = MyColours.color_515151,
  144 + Color hintColor = MyColours.color_999999,
  145 + BoxDecoration boxDecoration}) {
142 return Container( 146 return Container(
  147 + width: width,
143 alignment: Alignment.centerLeft, 148 alignment: Alignment.centerLeft,
144 - padding: EdgeInsets.all(w(15)), 149 + padding: edgeInsets,
  150 + decoration: boxDecoration,
145 child: Column( 151 child: Column(
146 crossAxisAlignment: CrossAxisAlignment.start, 152 crossAxisAlignment: CrossAxisAlignment.start,
147 children: [ 153 children: [
@@ -156,13 +162,13 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -156,13 +162,13 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
156 VEmptyView(16), 162 VEmptyView(16),
157 Text( 163 Text(
158 '${sellername}', 164 '${sellername}',
159 - style: TextStyle(color: MyColours.color_515151, fontSize: font(14)), 165 + style: TextStyle(color: textColor, fontSize: font(14)),
160 ), 166 ),
161 VEmptyView(32), 167 VEmptyView(32),
162 Container( 168 Container(
163 width: double.infinity, 169 width: double.infinity,
164 - margin: EdgeInsets.symmetric(horizontal: w(10)),  
165 - padding: EdgeInsets.symmetric(horizontal: w(8)), 170 + // margin: EdgeInsets.symmetric(horizontal: w(10)),
  171 + // padding: EdgeInsets.symmetric(horizontal: w(6)),
166 decoration: BoxDecoration( 172 decoration: BoxDecoration(
167 border: Border( 173 border: Border(
168 left: BorderSide( 174 left: BorderSide(
@@ -179,7 +185,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -179,7 +185,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
179 focusNode: storeIntroduceNode, 185 focusNode: storeIntroduceNode,
180 style: TextStyle( 186 style: TextStyle(
181 height: 2, 187 height: 2,
182 - color: MyColours.color_515151, 188 + color: textColor,
183 fontSize: ScreenUtil().setSp(20), 189 fontSize: ScreenUtil().setSp(20),
184 textBaseline: TextBaseline.alphabetic), 190 textBaseline: TextBaseline.alphabetic),
185 textAlignVertical: TextAlignVertical.center, 191 textAlignVertical: TextAlignVertical.center,
@@ -187,7 +193,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -187,7 +193,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
187 decoration: InputDecoration( 193 decoration: InputDecoration(
188 hintText: "点这里录入餐厅介绍文字", 194 hintText: "点这里录入餐厅介绍文字",
189 hintStyle: TextStyle( 195 hintStyle: TextStyle(
190 - color: MyColours.color_999999, 196 + color: hintColor,
191 fontSize: ScreenUtil().setSp(20), 197 fontSize: ScreenUtil().setSp(20),
192 ), 198 ),
193 contentPadding: EdgeInsets.zero, 199 contentPadding: EdgeInsets.zero,
@@ -205,7 +211,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -205,7 +211,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
205 ); 211 );
206 } 212 }
207 213
208 - Widget _uploadImage(bool hasupload) { 214 + Widget _uploadImage(bool hasupload, {EdgeInsets padding = EdgeInsets.zero}) {
209 return InkWell( 215 return InkWell(
210 onTap: () {}, 216 onTap: () {},
211 child: hasupload 217 child: hasupload
@@ -220,7 +226,10 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -220,7 +226,10 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
220 height: w(280), 226 height: w(280),
221 ), 227 ),
222 Container( 228 Container(
223 - height: w(25), 229 + width: w(150),
  230 + height: w(30),
  231 + color: MyColours.color_4D000000,
  232 + margin: padding,
224 alignment: Alignment.center, 233 alignment: Alignment.center,
225 child: Text( 234 child: Text(
226 '点击图片可以更换', 235 '点击图片可以更换',
@@ -234,9 +243,10 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -234,9 +243,10 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
234 color: MyColours.color_d9d9d9, 243 color: MyColours.color_d9d9d9,
235 width: double.infinity, 244 width: double.infinity,
236 height: w(280), 245 height: w(280),
  246 + padding: padding,
237 child: Column( 247 child: Column(
  248 + mainAxisAlignment: MainAxisAlignment.center,
238 children: [ 249 children: [
239 - VEmptyView(80),  
240 Image.asset( 250 Image.asset(
241 Utils.getImgPath('add_img'), 251 Utils.getImgPath('add_img'),
242 width: w(63), 252 width: w(63),
@@ -259,6 +269,81 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -259,6 +269,81 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
259 )); 269 ));
260 } 270 }
261 271
  272 + ///无文字
  273 + Widget _noTextWidget() {
  274 + return Column(
  275 + children: [
  276 + _uploadImage(false),
  277 + VEmptyView(18),
  278 + _uploadImage(true),
  279 + VEmptyView(18),
  280 + _uploadImage(false),
  281 + VEmptyView(18),
  282 + _uploadImage(true),
  283 + ],
  284 + );
  285 + }
  286 +
  287 + ///图文合并
  288 + Widget _mergingWidget() {
  289 + return Column(
  290 + children: [
  291 + Stack(
  292 + children: [
  293 + _uploadImage(
  294 + false,
  295 + padding: EdgeInsets.only(left: w(160)),
  296 + ),
  297 + Positioned(
  298 + child: _introduceWidget(
  299 + EdgeInsets.only(
  300 + left: w(15), top: w(23), right: w(7), bottom: w(42)),
  301 + textColor: MyColours.color_ffffff,
  302 + hintColor: MyColours.color_ffffff,
  303 + boxDecoration: BoxDecoration(
  304 + gradient: LinearGradient(
  305 + stops: [0, 1],
  306 + begin: Alignment.topCenter,
  307 + end: Alignment.bottomCenter,
  308 + colors: [
  309 + MyColours.color_0C0F0E,
  310 + MyColours.color_4D0C0F0E,
  311 + ],
  312 + ),
  313 + )),
  314 + width: w(160),
  315 + ),
  316 + ],
  317 + ),
  318 + VEmptyView(18),
  319 + _uploadImage(true),
  320 + VEmptyView(18),
  321 + _uploadImage(false),
  322 + VEmptyView(18),
  323 + _uploadImage(true),
  324 + ],
  325 + );
  326 + }
  327 +
  328 + ///图文分开
  329 + Widget _separateWidget() {
  330 + return Column(
  331 + crossAxisAlignment: CrossAxisAlignment.start,
  332 + children: [
  333 + _introduceWidget(EdgeInsets.all(w(15)),
  334 + boxDecoration: BoxDecoration(color: MyColours.color_ffffff)),
  335 + VEmptyView(18),
  336 + _uploadImage(false),
  337 + VEmptyView(18),
  338 + _uploadImage(true),
  339 + VEmptyView(18),
  340 + _uploadImage(false),
  341 + VEmptyView(18),
  342 + _uploadImage(true),
  343 + ],
  344 + );
  345 + }
  346 +
262 @override 347 @override
263 Widget build(BuildContext context) { 348 Widget build(BuildContext context) {
264 return Scaffold( 349 return Scaffold(
@@ -288,15 +373,11 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -288,15 +373,11 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
288 ), 373 ),
289 ), 374 ),
290 VEmptyView(24), 375 VEmptyView(24),
291 - _introduceWidget(),  
292 - VEmptyView(18),  
293 - _uploadImage(false),  
294 - VEmptyView(18),  
295 - _uploadImage(true),  
296 - VEmptyView(18),  
297 - _uploadImage(false),  
298 - VEmptyView(18),  
299 - _uploadImage(true), 376 + currIndex == 0
  377 + ? _noTextWidget()
  378 + : currIndex == 1
  379 + ? _mergingWidget()
  380 + : _separateWidget(),
300 VEmptyView(18), 381 VEmptyView(18),
301 ], 382 ],
302 ), 383 ),
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 2
3 class MyColours { 3 class MyColours {
  4 + static const Color color_4D0C0F0E = Color(0x4D0C0F0E);
  5 + static const Color color_4D000000 = Color(0x4D000000);
4 static const Color color_B39437 = Color(0xFFB39437); 6 static const Color color_B39437 = Color(0xFFB39437);
5 static const Color color_EEAE74 = Color(0xFFEEAE74); 7 static const Color color_EEAE74 = Color(0xFFEEAE74);
6 static const Color color_C76216 = Color(0xFFC76216); 8 static const Color color_C76216 = Color(0xFFC76216);