Browse Source

文章html富文本点击跳转,

使用正则表达式:ubb 转 html ,
zyh
w-R 3 years ago
parent
commit
21a1c79d1d
  1. 5
      lib/retrofit/min_api.dart
  2. 2
      lib/settlement/settlement_view/settlement_order_commodity.dart
  3. 1
      lib/store/shopping/activity_prefecture_details.dart
  4. 92
      lib/store/shopping/shopping_cart/shopping_cart_page.dart
  5. 7
      lib/store/shopping/shopping_mall_home.dart
  6. 2
      lib/store/store_view/store_info.dart

5
lib/retrofit/min_api.dart

@ -31,11 +31,6 @@ part 'min_api.g.dart';
// const base_url = "http://192.168.10.236:8765/app/";///
// const baseUrl = "http://192.168.10.236:8765/app/";///
const base_url = "http://192.168.10.142:8765/app/";///
const baseUrl = "http://192.168.10.142:8765/app/";///
// const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/";

2
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -134,7 +134,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
margin: EdgeInsets.only(
left: 16.w,
),
height: 44.h,
// height: 44.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,

1
lib/store/shopping/activity_prefecture_details.dart

@ -65,6 +65,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<ActivityAreaList> baseData =

92
lib/store/shopping/shopping_cart/shopping_cart_page.dart

@ -2,6 +2,9 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/shopping/shopping_home/recommend_goods_list_view.dart';
import 'package:huixiang/utils/font_weight.dart';
@ -23,12 +26,101 @@ class ShoppingCartPage extends StatefulWidget {
class _ShoppingCartPage extends State<ShoppingCartPage>
with AutomaticKeepAliveClientMixin {
ApiService apiService;
MinApiService minService;
ShoppingCart shopCarGoods;
String pName;
String pid;
String cName;
String cid;
int tableId = 0;
@override
void initState() {
super.initState();
}
///
clearShopCar() async {
BaseData<bool> baseData = await minService.clearShoppingCart();
if (baseData.isSuccess) {
shopCarGoods = null;
setState(() {});
}
}
///
Future<ShoppingCart> queryShopCar() async {
pName="";//
pid="";//
cName="";//
cid="";//
BaseData<List<ShoppingCart>> baseDate =
await minService.getShoppingCart(tableId);
if (baseDate != null &&
baseDate.isSuccess &&
baseDate.data != null &&
baseDate.data.length > 0) {
if( baseDate.data[0].selectDiscount ==1){
baseDate.data[0].couponList.forEach((element) {
if(element.isMaxCoupon){
cName = element.promotionName;
cid = element.id;
}
});
}else if(baseDate.data[0].selectDiscount==2){
baseDate.data[0].promotionInfoList.forEach((element) {
if(element.isMaxPromotion){
pName=element.name;
pid=element.id;
}
});
}
return baseDate.data[0];
} else {
return null;
}
}
/// key,UI
GlobalKey shopCartKey = GlobalKey();
///1
Future<ShoppingCart> shopCartAdd(
ShoppingCartSkuItemListBean cartSkuItem) async {
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
cartSkuItem.buyNum += 1;
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
this.shopCarGoods = await queryShopCar();
if (shopCartKey != null) {
shopCartKey.currentState.setState(() {});
}
setState(() {});
}
return this.shopCarGoods;
}
///1
Future<ShoppingCart> shopCartReduce(
ShoppingCartSkuItemListBean cartSkuItem) async {
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
cartSkuItem.buyNum -= 1;
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
this.shopCarGoods = await queryShopCar();
if (shopCartKey != null) {
shopCartKey.currentState.setState(() {});
}
setState(() {});
}
return this.shopCarGoods;
}
final SwiperController controller = SwiperController();
@override

7
lib/store/shopping/shopping_mall_home.dart

@ -54,10 +54,12 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
void initState() {
super.initState();
if (widget.arguments != null) choiceIndex = widget.arguments["type"];
tenant = widget.arguments["tenant"];
storeId = widget.arguments["id"];
debugPrint(
"store_param tenant:$tenant storeId:$storeId");
SharedPreferences.getInstance().then((value) {
minLogin(value);
queryStoreInfo();
@ -159,7 +161,8 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
ShoppingHomePage(
storeInfo,
),
if (choiceIndex == 1) ShoppingCartPage(),
if (choiceIndex == 1) ShoppingCartPage(
),
Align(
alignment: Alignment.bottomCenter,
child: Container(

2
lib/store/store_view/store_info.dart

@ -30,7 +30,7 @@ class _StoreInfoView extends State<StoreInfoView> {
top: 5.h,
bottom: 6.h,
),
height: 138.h,
height: 160.h,
padding: EdgeInsets.all(12.w),
decoration: BoxDecoration(
color: Colors.white,

Loading…
Cancel
Save