|
|
@@ -330,15 +330,18 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
child: Container(
|
|
|
padding: EdgeInsets.all(8),
|
|
|
child: Text(
|
|
|
- poi==null?'选址地址':'${poi.pname}${poi.cityname}${poi.adname}${poi.address}',
|
|
|
+ poi == null
|
|
|
+ ? '选址地址'
|
|
|
+ : '${poi.pname}${poi.cityname}${poi.adname}${poi.address}',
|
|
|
style: TextStyle(
|
|
|
color: MyColors.c999999,
|
|
|
fontSize: 14),
|
|
|
),
|
|
|
),
|
|
|
onTap: () {
|
|
|
- MyTools().toPage(context, MapDemoPage(), (then){
|
|
|
- if(then is PoiBeanPois){
|
|
|
+ MyTools().toPage(context, MapDemoPage(),
|
|
|
+ (then) {
|
|
|
+ if (then is PoiBeanPois) {
|
|
|
setState(() {
|
|
|
print(json.encode(then));
|
|
|
poi = then;
|
|
|
@@ -466,99 +469,38 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
|
|
|
//店铺收费
|
|
|
//付费方式
|
|
|
- if(fixedPrices.isNotEmpty)
|
|
|
- Column(children: [
|
|
|
- Container(
|
|
|
- height: 10,
|
|
|
- color: MyColors.cF7F7F7,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- child: Container(
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- MyViews()
|
|
|
- .myText('货帮入驻付费方式', MyColors.c333333, 15),
|
|
|
- DropdownButtonHideUnderline(
|
|
|
- child: DropdownButton(
|
|
|
- isDense: true,
|
|
|
- items: sortItems,
|
|
|
- onChanged: (v) {
|
|
|
- MyTools().hideKeyboard(context);
|
|
|
- setState(() {
|
|
|
- typeIndex = fixedPrices.indexWhere((element) => element.title==v);
|
|
|
- setFee();
|
|
|
- });
|
|
|
- },
|
|
|
- value: fixedPrices[typeIndex].title,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- ),
|
|
|
- ),
|
|
|
- padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
|
|
|
- height: 50,
|
|
|
- ),
|
|
|
- ],),
|
|
|
- //店铺佣金类型
|
|
|
- Visibility(
|
|
|
- child: Column(
|
|
|
+ if (fixedPrices.isNotEmpty)
|
|
|
+ Column(
|
|
|
children: [
|
|
|
Container(
|
|
|
- height: 0.5,
|
|
|
+ height: 10,
|
|
|
color: MyColors.cF7F7F7,
|
|
|
- margin: EdgeInsets.symmetric(horizontal: 15),
|
|
|
),
|
|
|
Container(
|
|
|
child: Container(
|
|
|
child: Row(
|
|
|
children: [
|
|
|
MyViews().myText(
|
|
|
- '平台费用收取方式', MyColors.c333333, 15),
|
|
|
- Expanded(
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- // Row(
|
|
|
- // children: [
|
|
|
- // Checkbox(
|
|
|
- // activeColor: MyColors.cFF4233,
|
|
|
- // checkColor: Colors.white,
|
|
|
- // value:
|
|
|
- // shopCommissionType == 0,
|
|
|
- // onChanged: (v) {
|
|
|
- // MyTools()
|
|
|
- // .hideKeyboard(context);
|
|
|
- // shopCommissionType = 0;
|
|
|
- // setFee();
|
|
|
- // setState(() {});
|
|
|
- // },
|
|
|
- // ),
|
|
|
- // MyViews().myText('固定金额',
|
|
|
- // MyColors.c333333, 15)
|
|
|
- // ],
|
|
|
- // ),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Checkbox(
|
|
|
- activeColor: MyColors.cFF4233,
|
|
|
- checkColor: Colors.white,
|
|
|
- value:fixedPrices.isEmpty?false:
|
|
|
- fixedPrices[typeIndex].percent,
|
|
|
- onChanged: (v) {
|
|
|
- // MyTools()
|
|
|
- // .hideKeyboard(context);
|
|
|
- // shopCommissionType = 1;
|
|
|
- // setFee();
|
|
|
- // setState(() {});
|
|
|
- },
|
|
|
- ),
|
|
|
- MyViews().myText('按照比例',
|
|
|
- MyColors.c333333, 15)
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
- mainAxisAlignment:
|
|
|
- MainAxisAlignment.end,
|
|
|
+ '货帮入驻付费方式', MyColors.c333333, 15),
|
|
|
+ DropdownButtonHideUnderline(
|
|
|
+ child: DropdownButton(
|
|
|
+ isDense: true,
|
|
|
+ items: sortItems,
|
|
|
+ onChanged: (v) {
|
|
|
+ MyTools().hideKeyboard(context);
|
|
|
+ setState(() {
|
|
|
+ typeIndex = fixedPrices
|
|
|
+ .indexWhere((element) =>
|
|
|
+ element.title == v);
|
|
|
+ if(fixedPrices[typeIndex].type==1){
|
|
|
+ feePricing = '${fixedPrices[typeIndex].base+fixedPrices[typeIndex].pricing}';
|
|
|
+ }else{
|
|
|
+ feePricing = '${fixedPrices[typeIndex].base}';
|
|
|
+ }
|
|
|
+ // setFee();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ value: fixedPrices[typeIndex].title,
|
|
|
),
|
|
|
),
|
|
|
],
|
|
|
@@ -571,35 +513,221 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
- visible: fixedPrices.isNotEmpty,
|
|
|
- ),
|
|
|
- //支付价格
|
|
|
- if(fixedPrices.isNotEmpty)
|
|
|
- Column(children: [
|
|
|
- Container(
|
|
|
- height: 0.5,
|
|
|
- color: MyColors.cF7F7F7,
|
|
|
- margin: EdgeInsets.symmetric(horizontal: 15),
|
|
|
+
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 30),
|
|
|
+ child: Column(children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '基本费用',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 12),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '${fixedPrices.isEmpty ? 0.0 : fixedPrices[typeIndex].base}',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.cFF4233, fontSize: 12),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
),
|
|
|
- Container(
|
|
|
- child: Container(
|
|
|
- child: Row(
|
|
|
+ if (fixedPrices.isNotEmpty &&
|
|
|
+ fixedPrices[typeIndex].type == 1)
|
|
|
+ Column(children: [
|
|
|
+ Container(height: 8,),
|
|
|
+ Row(
|
|
|
children: [
|
|
|
- MyViews().myText('支付价格', MyColors.c333333, 15),
|
|
|
- MyViews().myText(
|
|
|
- fixedPrices.isEmpty?'0元':fixedPrices[typeIndex].percent
|
|
|
- ? '${NumUtil.multiply(fixedPrices[typeIndex].pricing, 100)}%'
|
|
|
- :'${fixedPrices[typeIndex].pricing}元',
|
|
|
- MyColors.c333333,
|
|
|
- 15),
|
|
|
+ Text(
|
|
|
+ '年服务费',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 12),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '${fixedPrices[typeIndex].pricing}',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.cFF4233, fontSize: 12),
|
|
|
+ ),
|
|
|
],
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
),
|
|
|
+ ],),
|
|
|
+ if (fixedPrices.isNotEmpty &&
|
|
|
+ fixedPrices[typeIndex].type == 2)
|
|
|
+ Column(
|
|
|
+ children: [
|
|
|
+ Container(height: 8,),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '收费类型',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 12),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '${fixedPrices[typeIndex].percent?'比例收取':'固定金额'}',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.cFF4233, fontSize: 12),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
- padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
|
|
|
- height: 50,
|
|
|
- ),
|
|
|
+
|
|
|
+ if (fixedPrices.isNotEmpty &&
|
|
|
+ fixedPrices[typeIndex].type == 2)
|
|
|
+ Column(
|
|
|
+ children: [
|
|
|
+ Container(height: 8,),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '${fixedPrices[typeIndex].percent?'收取金额(每笔)':'收取金额(每笔)'}',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 12),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '${fixedPrices[typeIndex].percent
|
|
|
+ ? '${NumUtil.multiply(fixedPrices[typeIndex].pricing, 100)}%'
|
|
|
+ : '${fixedPrices[typeIndex].pricing}元'}',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.cFF4233, fontSize: 12),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+
|
|
|
+ Container(height: 8,),
|
|
|
+ // Row(
|
|
|
+ // children: [
|
|
|
+ // Text(
|
|
|
+ // '总金额',
|
|
|
+ // style: TextStyle(
|
|
|
+ // color: MyColors.c333333, fontSize: 12),
|
|
|
+ // ),
|
|
|
+ // Text(
|
|
|
+ // '${fixedPrices[typeIndex].type==1?(fixedPrices[typeIndex].pricing+fixedPrices[typeIndex].base).toStringAsFixed(2):
|
|
|
+ // fixedPrices[typeIndex].base.toStringAsFixed(2)}',
|
|
|
+ // style: TextStyle(
|
|
|
+ // color: MyColors.cFF4233, fontSize: 16),
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ // ),
|
|
|
+ Container(height: 8,),
|
|
|
],),
|
|
|
+ ),
|
|
|
+ // //店铺佣金类型
|
|
|
+ // Visibility(
|
|
|
+ // child: Column(
|
|
|
+ // children: [
|
|
|
+ // Container(
|
|
|
+ // height: 0.5,
|
|
|
+ // color: MyColors.cF7F7F7,
|
|
|
+ // margin: EdgeInsets.symmetric(horizontal: 15),
|
|
|
+ // ),
|
|
|
+ // Container(
|
|
|
+ // child: Container(
|
|
|
+ // child: Row(
|
|
|
+ // children: [
|
|
|
+ // MyViews().myText(
|
|
|
+ // '平台费用收取方式', MyColors.c333333, 15),
|
|
|
+ // Expanded(
|
|
|
+ // child: Row(
|
|
|
+ // children: [
|
|
|
+ // // Row(
|
|
|
+ // // children: [
|
|
|
+ // // Checkbox(
|
|
|
+ // // activeColor: MyColors.cFF4233,
|
|
|
+ // // checkColor: Colors.white,
|
|
|
+ // // value:
|
|
|
+ // // shopCommissionType == 0,
|
|
|
+ // // onChanged: (v) {
|
|
|
+ // // MyTools()
|
|
|
+ // // .hideKeyboard(context);
|
|
|
+ // // shopCommissionType = 0;
|
|
|
+ // // setFee();
|
|
|
+ // // setState(() {});
|
|
|
+ // // },
|
|
|
+ // // ),
|
|
|
+ // // MyViews().myText('固定金额',
|
|
|
+ // // MyColors.c333333, 15)
|
|
|
+ // // ],
|
|
|
+ // // ),
|
|
|
+ // Row(
|
|
|
+ // children: [
|
|
|
+ // Checkbox(
|
|
|
+ // activeColor: MyColors.cFF4233,
|
|
|
+ // checkColor: Colors.white,
|
|
|
+ // value: fixedPrices.isEmpty
|
|
|
+ // ? false
|
|
|
+ // : fixedPrices[typeIndex]
|
|
|
+ // .percent,
|
|
|
+ // onChanged: (v) {
|
|
|
+ // // MyTools()
|
|
|
+ // // .hideKeyboard(context);
|
|
|
+ // // shopCommissionType = 1;
|
|
|
+ // // setFee();
|
|
|
+ // // setState(() {});
|
|
|
+ // },
|
|
|
+ // ),
|
|
|
+ // MyViews().myText('按照比例',
|
|
|
+ // MyColors.c333333, 15)
|
|
|
+ // ],
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // mainAxisAlignment:
|
|
|
+ // MainAxisAlignment.end,
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // mainAxisAlignment:
|
|
|
+ // MainAxisAlignment.spaceBetween,
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
|
|
|
+ // height: 50,
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // ),
|
|
|
+ // visible: fixedPrices.isNotEmpty,
|
|
|
+ // ),
|
|
|
+ // //支付价格
|
|
|
+ // if (fixedPrices.isNotEmpty)
|
|
|
+ // Column(
|
|
|
+ // children: [
|
|
|
+ // Container(
|
|
|
+ // height: 0.5,
|
|
|
+ // color: MyColors.cF7F7F7,
|
|
|
+ // margin: EdgeInsets.symmetric(horizontal: 15),
|
|
|
+ // ),
|
|
|
+ // Container(
|
|
|
+ // child: Container(
|
|
|
+ // child: Row(
|
|
|
+ // children: [
|
|
|
+ // MyViews()
|
|
|
+ // .myText('支付价格', MyColors.c333333, 15),
|
|
|
+ // MyViews().myText(
|
|
|
+ // fixedPrices.isEmpty
|
|
|
+ // ? '0元'
|
|
|
+ // : fixedPrices[typeIndex].percent
|
|
|
+ // ? '${NumUtil.multiply(fixedPrices[typeIndex].pricing, 100)}%'
|
|
|
+ // : '${fixedPrices[typeIndex].pricing}元',
|
|
|
+ // MyColors.c333333,
|
|
|
+ // 15),
|
|
|
+ // ],
|
|
|
+ // mainAxisAlignment:
|
|
|
+ // MainAxisAlignment.spaceBetween,
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
|
|
|
+ // height: 50,
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // ),
|
|
|
|
|
|
//是否私有店铺
|
|
|
Container(
|
|
|
@@ -622,7 +750,7 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
// typeIndex = v ? 2 : 0;
|
|
|
// print(
|
|
|
// '--------------\nprivate-----$private\nshopCommissionType-----$shopCommissionType\ntypeIndex-----$typeIndex\nprivate-----$private\n--------------');
|
|
|
- setFee();
|
|
|
+ // setFee();
|
|
|
});
|
|
|
},
|
|
|
activeColor: MyColors.cFF4233,
|
|
|
@@ -1072,7 +1200,7 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
}
|
|
|
|
|
|
Future<void> createAGang(UploadImageBeanEntity data) async {
|
|
|
- if(poi==null){
|
|
|
+ if (poi == null) {
|
|
|
showToast('请选择地址');
|
|
|
return;
|
|
|
}
|
|
|
@@ -1101,25 +1229,27 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
: double.parse(_amountCharged.text.toString());
|
|
|
object['shop_commission_percent'] = commissionCommissionType == 1;
|
|
|
}
|
|
|
- if (poi!=null) {
|
|
|
+ if (poi != null) {
|
|
|
object['longitude'] = double.parse(poi.location.split(',')[0]);
|
|
|
object['latitude'] = double.parse(poi.location.split(',')[1]);
|
|
|
- object['auto_address'] = '${poi.pname}${poi.cityname}${poi.adname}${poi.address}';
|
|
|
- object['address'] = '${poi.pname}${poi.cityname}${poi.adname}${poi.address}';
|
|
|
+ object['auto_address'] =
|
|
|
+ '${poi.pname}${poi.cityname}${poi.adname}${poi.address}';
|
|
|
+ object['address'] =
|
|
|
+ '${poi.pname}${poi.cityname}${poi.adname}${poi.address}';
|
|
|
object['province'] = poi.pname;
|
|
|
object['city'] = poi.cityname;
|
|
|
object['county'] = poi.adname;
|
|
|
}
|
|
|
MyDio().save({'key': 'shop', 'object': object}, (response, hasError) {
|
|
|
if (!hasError) {
|
|
|
- if (typeIndex == 0) {
|
|
|
+ // if (typeIndex == 0) {
|
|
|
AnnualFeeOrderBeanEntity entity = AnnualFeeOrderBeanEntity()
|
|
|
.fromJson(json.decode(response.data.toString()));
|
|
|
annualFeeOrder(entity);
|
|
|
- } else {
|
|
|
- showToast('创建成功');
|
|
|
- Navigator.pop(context);
|
|
|
- }
|
|
|
+ // } else {
|
|
|
+ // showToast('创建成功');
|
|
|
+ // Navigator.pop(context);
|
|
|
+ // }
|
|
|
}
|
|
|
}, (error) {});
|
|
|
}
|
|
|
@@ -1142,21 +1272,24 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
getFixedPrice() {
|
|
|
MyDio().query({
|
|
|
"key": "platform_pricing",
|
|
|
- "dims": ["id", "type", "pricing", "title",
|
|
|
- "percent"],
|
|
|
+ "dims": ["id", "type", "pricing", "title", "base", "percent"],
|
|
|
"filters": {}
|
|
|
}, (response, hasError) {
|
|
|
if (!hasError) {
|
|
|
FixedPriceBeanEntity fixedPrice = FixedPriceBeanEntity()
|
|
|
.fromJson(json.decode(response.data.toString()));
|
|
|
fixedPrices = fixedPrice.data;
|
|
|
- setFee();
|
|
|
+ if(fixedPrices[typeIndex].type==1){
|
|
|
+ feePricing = '${fixedPrices[typeIndex].base+fixedPrices[typeIndex].pricing}';
|
|
|
+ }else{
|
|
|
+ feePricing = '${fixedPrices[typeIndex].base}';
|
|
|
+ }
|
|
|
+ // setFee();
|
|
|
setState(() {});
|
|
|
}
|
|
|
}, (error) {});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
void setFee() {
|
|
|
print('==================================');
|
|
|
print(types[typeIndex]);
|
|
|
@@ -1222,7 +1355,7 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
height: 45,
|
|
|
child: Column(
|
|
|
children: [
|
|
|
- MyViews().myText('平台年费', MyColors.c333333, 13),
|
|
|
+ MyViews().myText('平台服务费', MyColors.c333333, 13),
|
|
|
Row(
|
|
|
children: [
|
|
|
MyViews()
|
|
|
@@ -1361,7 +1494,7 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
|
|
|
buyerName: MyCookie().getName(),
|
|
|
buyerPic: MyCookie().getPic(),
|
|
|
commodityCount: 1,
|
|
|
- commodityTitle: '年费',
|
|
|
+ commodityTitle: '货帮服务费',
|
|
|
commodityCover: '',
|
|
|
sellName: '平台',
|
|
|
sellPic: '',
|