|
|
@@ -13,6 +13,7 @@ import 'package:bbyyy/https/MyDio.dart';
|
|
|
import 'package:bbyyy/https/url.dart';
|
|
|
import 'package:bbyyy/my_tools/const.dart';
|
|
|
import 'package:bbyyy/my_tools/dims.dart';
|
|
|
+import 'package:bbyyy/my_tools/easy_loading/easy_loading.dart';
|
|
|
import 'package:bbyyy/my_tools/event_bus.dart';
|
|
|
import 'package:bbyyy/my_tools/my_colors.dart';
|
|
|
import 'package:bbyyy/my_tools/my_cookie.dart';
|
|
|
@@ -52,6 +53,9 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
int selectedIndex = 0;
|
|
|
RefreshController controller = RefreshController(initialRefresh: true);
|
|
|
int page = 1;
|
|
|
+ bool collect = false;
|
|
|
+ bool needRE = false;
|
|
|
+ bool canSendGood = false;
|
|
|
|
|
|
_GangInPageState();
|
|
|
|
|
|
@@ -82,6 +86,7 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
if (widget.data.ownerUid == MyCookie().getUID()) {
|
|
|
selectedIndex = 1;
|
|
|
}
|
|
|
+ queryWhetherToFollow();
|
|
|
queryStoreInformation();
|
|
|
}
|
|
|
|
|
|
@@ -145,8 +150,8 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
),
|
|
|
PopupMenuButton<String>(
|
|
|
icon: Icon(Icons.more_horiz),
|
|
|
- onSelected: (v){
|
|
|
- switch(v){
|
|
|
+ onSelected: (v) {
|
|
|
+ switch (v) {
|
|
|
case '扫一扫':
|
|
|
MyTools().toPage(context, ScanPage(), (then) {
|
|
|
if (then is String) {
|
|
|
@@ -164,7 +169,7 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
store: store,
|
|
|
qrUID: then,
|
|
|
),
|
|
|
- (then) {});
|
|
|
+ (then) {});
|
|
|
MyTools().hideKeyboard(context);
|
|
|
controller.requestRefresh();
|
|
|
});
|
|
|
@@ -173,17 +178,19 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
});
|
|
|
break;
|
|
|
case '发布商品':
|
|
|
- MyTools().toPage(context, ReleaseGoodsPage(null,widget.data.shopName), (then) {
|
|
|
+ MyTools().toPage(
|
|
|
+ context, ReleaseGoodsPage(null, widget.data.shopName),
|
|
|
+ (then) {
|
|
|
controller.requestRefresh();
|
|
|
});
|
|
|
break;
|
|
|
case '货帮详情':
|
|
|
MyTools().toPage(context, GangInformationPage(widget.data),
|
|
|
- (then) {
|
|
|
- if (then == '删除货帮') {
|
|
|
- Navigator.pop(context, '删除货帮');
|
|
|
- }
|
|
|
- });
|
|
|
+ (then) {
|
|
|
+ if (then == '删除货帮') {
|
|
|
+ Navigator.pop(context, '删除货帮');
|
|
|
+ }
|
|
|
+ });
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
@@ -191,12 +198,24 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
},
|
|
|
itemBuilder: (context) {
|
|
|
return <PopupMenuEntry<String>>[
|
|
|
+ if(canSendGood)
|
|
|
PopupMenuItem<String>(
|
|
|
value: '发布商品',
|
|
|
child: Row(
|
|
|
children: [
|
|
|
- SvgPicture.asset('images/svg/发布商品_icon.svg',height: 22,width: 22,),
|
|
|
- Container(child: Text('发布商品',style: TextStyle(fontSize: 14,color: MyColors.c333333),),margin: EdgeInsets.only(left: 5),),
|
|
|
+ SvgPicture.asset(
|
|
|
+ 'images/svg/发布商品_icon.svg',
|
|
|
+ height: 22,
|
|
|
+ width: 22,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ child: Text(
|
|
|
+ '发布商品',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14, color: MyColors.c333333),
|
|
|
+ ),
|
|
|
+ margin: EdgeInsets.only(left: 5),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -204,8 +223,19 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
value: '货帮详情',
|
|
|
child: Row(
|
|
|
children: [
|
|
|
- SvgPicture.asset('images/svg/货帮详情_icon.svg',height: 20,width: 20,),
|
|
|
- Container(child: Text('货帮详情',style: TextStyle(fontSize: 14,color: MyColors.c333333),),margin: EdgeInsets.only(left: 5),),
|
|
|
+ SvgPicture.asset(
|
|
|
+ 'images/svg/货帮详情_icon.svg',
|
|
|
+ height: 20,
|
|
|
+ width: 20,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ child: Text(
|
|
|
+ '货帮详情',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14, color: MyColors.c333333),
|
|
|
+ ),
|
|
|
+ margin: EdgeInsets.only(left: 5),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -214,8 +244,19 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
value: '扫一扫',
|
|
|
child: Row(
|
|
|
children: [
|
|
|
- SvgPicture.asset('images/svg/扫一扫_icon.svg',height: 20,width: 20,),
|
|
|
- Container(child: Text('扫一扫',style: TextStyle(fontSize: 14,color: MyColors.c333333),),margin: EdgeInsets.only(left: 5),),
|
|
|
+ SvgPicture.asset(
|
|
|
+ 'images/svg/扫一扫_icon.svg',
|
|
|
+ height: 20,
|
|
|
+ width: 20,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ child: Text(
|
|
|
+ '扫一扫',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14, color: MyColors.c333333),
|
|
|
+ ),
|
|
|
+ margin: EdgeInsets.only(left: 5),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -231,276 +272,114 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
margin: EdgeInsets.all(10),
|
|
|
child: Column(
|
|
|
children: [
|
|
|
- GestureDetector(
|
|
|
- onTap: () {
|
|
|
- showDialog(
|
|
|
- context: context,
|
|
|
- builder: (BuildContext context) {
|
|
|
- return Material(
|
|
|
- color: Colors.black12,
|
|
|
- child: Center(
|
|
|
- child: Column(
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(
|
|
|
+ right: 10, top: 6, left: 6, bottom: 6),
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ shopInfo();
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: ClipRRect(
|
|
|
+ child: MyViews()
|
|
|
+ .netImg(imgURL(widget.data.shopPic), 65, 65),
|
|
|
+ borderRadius: BorderRadius.circular(4),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ height: 65,
|
|
|
+ margin: EdgeInsets.only(right: 6),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
children: [
|
|
|
- Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- borderRadius: BorderRadius.circular(16),
|
|
|
- color: Colors.white,
|
|
|
- ),
|
|
|
- height: 510,
|
|
|
- margin:
|
|
|
- EdgeInsets.symmetric(horizontal: 28),
|
|
|
- padding: EdgeInsets.symmetric(
|
|
|
- horizontal: 14, vertical: 15),
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- height: MediaQuery.of(context)
|
|
|
- .size
|
|
|
- .width -
|
|
|
- 71,
|
|
|
- width: MediaQuery.of(context)
|
|
|
- .size
|
|
|
- .width -
|
|
|
- 56,
|
|
|
- child: ClipRRect(
|
|
|
- child: MyViews().netImg(
|
|
|
- imgURL(widget.data.shopPic),
|
|
|
- MediaQuery.of(context)
|
|
|
- .size
|
|
|
- .width -
|
|
|
- 84,
|
|
|
- MediaQuery.of(context)
|
|
|
- .size
|
|
|
- .width -
|
|
|
- 84),
|
|
|
- borderRadius:
|
|
|
- BorderRadius.circular(4),
|
|
|
- ),
|
|
|
- ),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- SvgPicture.asset(
|
|
|
- 'images/svg/店铺.svg',
|
|
|
- height: 21,
|
|
|
- width: 21,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- width: 6,
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: Text(
|
|
|
- widget.data.shopName,
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c333333,
|
|
|
- fontSize: 16),
|
|
|
- ))
|
|
|
- ],
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 10,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- store != null &&
|
|
|
- store.introduction.isNotEmpty
|
|
|
- ? '货帮介绍:${store.introduction}'
|
|
|
- : '货帮介绍:暂无',
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c333333,
|
|
|
- fontSize: 12,
|
|
|
- ),
|
|
|
- maxLines: 3,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- softWrap: true,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 10,
|
|
|
- ),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- SvgPicture.asset(
|
|
|
- 'images/svg/地址.svg',
|
|
|
- color: MyColors.c666666,
|
|
|
- height: 12,
|
|
|
- width: 12,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- width: 5,
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: Text(
|
|
|
- store != null &&
|
|
|
- store.address.isNotEmpty
|
|
|
- ? store.address
|
|
|
- : '暂无',
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c666666,
|
|
|
- fontSize: 11),
|
|
|
- maxLines: 1,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- softWrap: true,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 10,
|
|
|
- ),
|
|
|
- Visibility(
|
|
|
- visible: store != null &&
|
|
|
- store.mobile.isNotEmpty,
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () {
|
|
|
- launch('tel:${store.mobile}');
|
|
|
- },
|
|
|
- behavior:
|
|
|
- HitTestBehavior.translucent,
|
|
|
- child: Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: MyColors.cFF4233,
|
|
|
- borderRadius:
|
|
|
- BorderRadius.circular(20),
|
|
|
- ),
|
|
|
- height: 40,
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- SvgPicture.asset(
|
|
|
- 'images/svg/电话.svg',
|
|
|
- color: Colors.white,
|
|
|
- height: 24,
|
|
|
- width: 24,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- width: 4,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- store == null
|
|
|
- ? ''
|
|
|
- : store.mobile,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 15),
|
|
|
- ),
|
|
|
- ],
|
|
|
- mainAxisAlignment:
|
|
|
- MainAxisAlignment.center,
|
|
|
- ),
|
|
|
- alignment: Alignment.center,
|
|
|
- ),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- mainAxisAlignment:
|
|
|
- MainAxisAlignment.spaceAround,
|
|
|
- crossAxisAlignment:
|
|
|
- CrossAxisAlignment.start,
|
|
|
+ Text(
|
|
|
+ widget.data.shopName,
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 13),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ softWrap: true,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ mainAxisAlignment:
|
|
|
+ MainAxisAlignment.spaceBetween,
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: Text(
|
|
|
+ store != null &&
|
|
|
+ store.introduction.isNotEmpty
|
|
|
+ ? '货帮介绍:${store.introduction}'
|
|
|
+ : '货帮介绍:暂无',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c666666,
|
|
|
+ fontSize: 11),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ softWrap: true,
|
|
|
),
|
|
|
),
|
|
|
+ ],
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ SvgPicture.asset(
|
|
|
+ 'images/svg/地址.svg',
|
|
|
+ color: MyColors.c666666,
|
|
|
+ height: 12,
|
|
|
+ width: 12,
|
|
|
+ ),
|
|
|
Container(
|
|
|
- margin: EdgeInsets.only(top: 20),
|
|
|
- child: IconButton(
|
|
|
- icon: Icon(
|
|
|
- Icons.cancel,
|
|
|
- color: MyColors.cC9C9C9,
|
|
|
- size: 24,
|
|
|
- ),
|
|
|
- onPressed: () {
|
|
|
- Navigator.pop(context);
|
|
|
- }),
|
|
|
- )
|
|
|
+ width: 5,
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Text(
|
|
|
+ store != null && store.address.isNotEmpty
|
|
|
+ ? store.address
|
|
|
+ : '暂无',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c666666,
|
|
|
+ fontSize: 11),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ softWrap: true,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
],
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
),
|
|
|
- ),
|
|
|
- );
|
|
|
- },
|
|
|
- );
|
|
|
- },
|
|
|
- behavior: HitTestBehavior.translucent,
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(
|
|
|
- right: 10, top: 6, left: 6, bottom: 6),
|
|
|
- child: ClipRRect(
|
|
|
- child: MyViews()
|
|
|
- .netImg(imgURL(widget.data.shopPic), 65, 65),
|
|
|
- borderRadius: BorderRadius.circular(4),
|
|
|
+ ],
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
),
|
|
|
),
|
|
|
- Expanded(
|
|
|
+ ),
|
|
|
+ Visibility(
|
|
|
+ visible: !widget.data.privateShop,
|
|
|
+ child: GestureDetector(
|
|
|
child: Container(
|
|
|
- height: 65,
|
|
|
- margin: EdgeInsets.only(right: 6),
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Text(
|
|
|
- widget.data.shopName,
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c333333, fontSize: 13),
|
|
|
- maxLines: 1,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- softWrap: true,
|
|
|
- ),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: Text(
|
|
|
- store != null &&
|
|
|
- store.introduction.isNotEmpty
|
|
|
- ? '货帮介绍:${store.introduction}'
|
|
|
- : '货帮介绍:暂无',
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c666666,
|
|
|
- fontSize: 11),
|
|
|
- maxLines: 1,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- softWrap: true,
|
|
|
- ),
|
|
|
- ),
|
|
|
- SvgPicture.asset(
|
|
|
- 'images/svg/箭头.svg',
|
|
|
- color: MyColors.c666666,
|
|
|
- height: 10,
|
|
|
- width: 10,
|
|
|
- )
|
|
|
- ],
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- ),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- SvgPicture.asset(
|
|
|
- 'images/svg/地址.svg',
|
|
|
- color: MyColors.c666666,
|
|
|
- height: 12,
|
|
|
- width: 12,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- width: 5,
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: Text(
|
|
|
- store != null &&
|
|
|
- store.address.isNotEmpty
|
|
|
- ? store.address
|
|
|
- : '暂无',
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c666666,
|
|
|
- fontSize: 11),
|
|
|
- maxLines: 1,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- softWrap: true,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ margin: EdgeInsets.all(12),
|
|
|
+ child: SvgPicture.asset(
|
|
|
+ collect
|
|
|
+ ? 'images/svg/已收藏.svg'
|
|
|
+ : 'images/svg/未收藏.svg',
|
|
|
+ height: 20,
|
|
|
+ width: 20,
|
|
|
),
|
|
|
),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
+ onTap: () {
|
|
|
+ EasyLoading.show();
|
|
|
+ collectionShop();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
Container(
|
|
|
height: 0.5,
|
|
|
@@ -1276,6 +1155,16 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
StoreBeanEntity().fromJson(json.decode(response.data.toString()));
|
|
|
store = entity.data.data[0];
|
|
|
hideMember = store.hideMembers;
|
|
|
+
|
|
|
+ //自己的公开店铺
|
|
|
+ if (!store.private &&
|
|
|
+ store.ownerUid == MyCookie().getUID()) {
|
|
|
+ canSendGood = true;
|
|
|
+ }
|
|
|
+ //自己在某个允许顾客间交易的私有店铺中
|
|
|
+ if (store.innerTrade) {
|
|
|
+ canSendGood = true;
|
|
|
+ }
|
|
|
setState(() {});
|
|
|
}
|
|
|
endRe(controller);
|
|
|
@@ -1318,4 +1207,230 @@ class _GangInPageState extends State<GangInPage> {
|
|
|
}
|
|
|
}, (error) {});
|
|
|
}
|
|
|
+
|
|
|
+ void shopInfo() {
|
|
|
+ showDialog(
|
|
|
+ context: context,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: (){
|
|
|
+ Navigator.pop(context);
|
|
|
+ },
|
|
|
+ child: Material(
|
|
|
+ color: Colors.black12,
|
|
|
+ child: Center(
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: (){},
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(16),
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ height: 510,
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 28),
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 14, vertical: 15),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ height: MediaQuery.of(context).size.width - 71,
|
|
|
+ width: MediaQuery.of(context).size.width - 56,
|
|
|
+ child: ClipRRect(
|
|
|
+ child: MyViews().netImg(
|
|
|
+ imgURL(widget.data.shopPic),
|
|
|
+ MediaQuery.of(context).size.width - 84,
|
|
|
+ MediaQuery.of(context).size.width - 84),
|
|
|
+ borderRadius: BorderRadius.circular(4),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ SvgPicture.asset(
|
|
|
+ 'images/svg/店铺.svg',
|
|
|
+ height: 21,
|
|
|
+ width: 21,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ width: 6,
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Text(
|
|
|
+ widget.data.shopName,
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 16),
|
|
|
+ ))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 10,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ store != null && store.introduction.isNotEmpty
|
|
|
+ ? '货帮介绍:${store.introduction}'
|
|
|
+ : '货帮介绍:暂无',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333,
|
|
|
+ fontSize: 12,
|
|
|
+ ),
|
|
|
+ maxLines: 3,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ softWrap: true,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 10,
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ SvgPicture.asset(
|
|
|
+ 'images/svg/地址.svg',
|
|
|
+ color: MyColors.c666666,
|
|
|
+ height: 12,
|
|
|
+ width: 12,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ width: 5,
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Text(
|
|
|
+ store != null && store.address.isNotEmpty
|
|
|
+ ? store.address
|
|
|
+ : '暂无',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c666666, fontSize: 11),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ softWrap: true,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 10,
|
|
|
+ ),
|
|
|
+ Visibility(
|
|
|
+ visible: store != null && store.mobile.isNotEmpty,
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ launch('tel:${store.mobile}');
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: MyColors.cFF4233,
|
|
|
+ borderRadius: BorderRadius.circular(20),
|
|
|
+ ),
|
|
|
+ height: 40,
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ SvgPicture.asset(
|
|
|
+ 'images/svg/电话.svg',
|
|
|
+ color: Colors.white,
|
|
|
+ height: 24,
|
|
|
+ width: 24,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ width: 4,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ store == null ? '' : store.mobile,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white, fontSize: 15),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ ),
|
|
|
+ alignment: Alignment.center,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ void collectionShop() {
|
|
|
+ if (!collect) {
|
|
|
+ MyDio().save({
|
|
|
+ 'key': 'shop_user',
|
|
|
+ 'object': {
|
|
|
+ 'review_state': 1,
|
|
|
+ 'user_uid': MyCookie().getUID(),
|
|
|
+ 'shop_uid': widget.data.shopUid,
|
|
|
+ 'role': shopUserMember
|
|
|
+ }
|
|
|
+ }, (response, hasError) {
|
|
|
+ if (!hasError) {
|
|
|
+ needRE = !needRE;
|
|
|
+ EventBus().emit('needRE', needRE);
|
|
|
+ showToast('收藏成功');
|
|
|
+ queryWhetherToFollow();
|
|
|
+ }
|
|
|
+ }, (error) {});
|
|
|
+ } else {
|
|
|
+ MyDio().del({
|
|
|
+ 'key': 'shop_user',
|
|
|
+ 'ids': [shopUserID]
|
|
|
+ }, (response, hasError) {
|
|
|
+ if (!hasError) {
|
|
|
+ needRE = !needRE;
|
|
|
+ EventBus().emit('needRE', needRE);
|
|
|
+ showToast('取消收藏');
|
|
|
+ collect = false;
|
|
|
+ shopUserID = null;
|
|
|
+ setState(() {});
|
|
|
+ }
|
|
|
+ }, (error) {});
|
|
|
+ }
|
|
|
+
|
|
|
+ // MyDio().update({
|
|
|
+ // "key": "shop_user",
|
|
|
+ // "values": {"collected": !widget.data.collected, "id": widget.data.id}
|
|
|
+ // }, (response, hasError) {
|
|
|
+ // if (!hasError) {
|
|
|
+ // if (collect) {
|
|
|
+ // showToast('取消收藏');
|
|
|
+ // } else {
|
|
|
+ // showToast('收藏成功');
|
|
|
+ // }
|
|
|
+ // collect = !collect;
|
|
|
+ //
|
|
|
+ // setState(() {});
|
|
|
+ // }
|
|
|
+ // }, (error) {
|
|
|
+ // showToast('收藏失败');
|
|
|
+ // });
|
|
|
+ }
|
|
|
+
|
|
|
+ int shopUserID;
|
|
|
+
|
|
|
+ void queryWhetherToFollow() {
|
|
|
+ MyDio().query({
|
|
|
+ "key": "shop_user",
|
|
|
+ "filters": {
|
|
|
+ "conditions": [
|
|
|
+ "shop_uid==${widget.data.shopUid}",
|
|
|
+ "user_uid==${MyCookie().getUID()}"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "dims": shopUserDims,
|
|
|
+ "paging": [1, 1]
|
|
|
+ }, (response, hasError) {
|
|
|
+ if (!hasError) {
|
|
|
+ MyShopBeanEntity entity =
|
|
|
+ MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
|
|
|
+ collect = entity.data.data.length != 0;
|
|
|
+ if (entity.data.data.isNotEmpty) {
|
|
|
+ shopUserID = entity.data.data[0].id;
|
|
|
+ }
|
|
|
+ setState(() {});
|
|
|
+ }
|
|
|
+ }, (error) {});
|
|
|
+ }
|
|
|
}
|