Browse Source

优惠券更改

zyh
w-R 3 years ago
parent
commit
96cddc48de
  1. 5
      lib/community/community_child_page.dart
  2. 25
      lib/community/community_view/community_dynamic.dart
  3. 2
      lib/home/home_view/discount_zone.dart
  4. 6
      lib/home/home_view/home_recommend_goods.dart
  5. 8
      lib/home/home_view/top_selling_list.dart
  6. 2
      lib/main_page.dart
  7. 1
      lib/union/union_list.dart
  8. 1
      lib/union/union_page.dart
  9. 43
      lib/utils/flutter_utils.dart
  10. 2
      lib/view_widget/custom_image.dart

5
lib/community/community_child_page.dart

@ -177,8 +177,11 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
text: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", text: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~",
fontSize: 16.sp, fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w),
):ListView.builder( )
:
ListView.builder(
controller: sc, controller: sc,
shrinkWrap: true,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return InkWell( return InkWell(
child: CommunityDynamic( child: CommunityDynamic(

25
lib/community/community_view/community_dynamic.dart

@ -67,15 +67,6 @@ class _CommunityDynamic extends State<CommunityDynamic> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then(
(value) => {
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
),
},
);
initVideo(); initVideo();
} }
@ -120,6 +111,14 @@ class _CommunityDynamic extends State<CommunityDynamic> {
//// ////
_vipFollow(followId, isFollow) async { _vipFollow(followId, isFollow) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.follow(followId); BaseData baseData = await apiService.follow(followId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
widget.exitFull(); widget.exitFull();
@ -133,6 +132,14 @@ class _CommunityDynamic extends State<CommunityDynamic> {
/// ///
_deleteDynamic(id) async { _deleteDynamic(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.deleteTrend(id); BaseData baseData = await apiService.deleteTrend(id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
widget.exitFull(); widget.exitFull();

2
lib/home/home_view/discount_zone.dart

@ -120,7 +120,7 @@ class _DiscountZone extends State<DiscountZone> {
color: Color(0xFFFFA607), color: Color(0xFFFFA607),
), ),
):Text( ):Text(
"有效期至 ${coupon.useEndTime.substring(0, coupon.useEndTime.indexOf(" "))}", "发放时间: ${coupon.useEndTime.substring(0, coupon.publishStartTime.indexOf(" "))}",
maxLines:1, maxLines:1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(

6
lib/home/home_view/home_recommend_goods.dart

@ -41,7 +41,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( Container(
height: 235.h, height: 260.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
color: Colors.white, color: Colors.white,
@ -92,8 +92,8 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
commodityZone?.productImg ?? "", commodityZone?.productImg ?? "",
fit: BoxFit.contain, fit: BoxFit.contain,
radius: BorderRadius.circular(4.r), radius: BorderRadius.circular(4.r),
width: 158.w, width: 158,
height: 158.h, height: 158,
errorSrc: "assets/image/default_2_1.webp", errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp", fadeSrc: "assets/image/default_2_1.webp",
), ),

8
lib/home/home_view/top_selling_list.dart

@ -147,15 +147,15 @@ class _TopSellingList extends State<TopSellingList> {
goodList.productImg ?? "", goodList.productImg ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4),
width: 54.w, width: 54,
height: 54.h, height: 54,
errorSrc: "assets/image/default_2_1.webp", errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp", fadeSrc: "assets/image/default_2_1.webp",
), ),
Image.asset( Image.asset(
index == 0 ? "assets/image/ranking1.webp" :(index == 1 ? "assets/image/ranking2.webp": "assets/image/ranking3.webp"), index == 0 ? "assets/image/ranking1.webp" :(index == 1 ? "assets/image/ranking2.webp": "assets/image/ranking3.webp"),
width: 25.w, width: 25,
height: 25.h, height: 25,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
], ],

2
lib/main_page.dart

@ -356,7 +356,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
// baseData.data.appLastVersion = "1.0.4"; // baseData.data.appLastVersion = "1.0.4";
// baseData.data.appLastVersionUp = "1.0.1"; // baseData.data.appLastVersionUp = "1.0.1";
if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion) if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion)
&& AppUtils.versionCompare(value.getString("appLastVersion"),baseData.data?.appLastVersion)){ && AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,

1
lib/union/union_list.dart

@ -238,6 +238,7 @@ class _UnionList extends State<UnionList> {
], ],
)), )),
if(store.distance != null)
Container( Container(
width: 59.w, width: 59.w,
height: 18.h, height: 18.h,

1
lib/union/union_page.dart

@ -110,6 +110,7 @@ class UnionPageState extends State<UnionPage>
} }
}); });
getLatLng();
startLocation(false); startLocation(false);
} }

43
lib/utils/flutter_utils.dart

@ -8,10 +8,11 @@ import 'package:intl/intl.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
class AppUtils { class AppUtils {
///线 ///线
static Future<String> calculateDistance(BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async { static Future<String> calculateDistance(
double mi = await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng); BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async {
double mi =
await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng);
NumberFormat numberFormat = NumberFormat("#.#"); NumberFormat numberFormat = NumberFormat("#.#");
return "${numberFormat.format(mi / 1000)}"; return "${numberFormat.format(mi / 1000)}";
} }
@ -21,12 +22,14 @@ class AppUtils {
try { try {
var localVersionArr = localVersion.split("."); var localVersionArr = localVersion.split(".");
var serverVersionArr = serverVersion.split("."); var serverVersionArr = serverVersion.split(".");
if((int.tryParse(localVersionArr[0]) < int.tryParse(serverVersionArr[0])) if (int.tryParse(localVersionArr[0]) > int.tryParse(serverVersionArr[0]))
|| (int.tryParse(localVersionArr[1]) < int.tryParse(serverVersionArr[1])) return false;
|| (int.tryParse(localVersionArr[2]) < int.tryParse(serverVersionArr[2]))) if (int.tryParse(localVersionArr[1]) > int.tryParse(serverVersionArr[1]))
return true;
}catch(ex){ }
return false; return false;
if (int.tryParse(localVersionArr[2]) > int.tryParse(serverVersionArr[2]))
return false;
} catch (ex) {}
return true;
} }
static String trimEnd(String resString, String char) { static String trimEnd(String resString, String char) {
@ -58,8 +61,7 @@ class AppUtils {
} }
static String phoneEncode(String phone) { static String phoneEncode(String phone) {
if(phone == null || phone.length != 11) if (phone == null || phone.length != 11) return phone;
return phone;
return phone.substring(0, 3) + "****" + phone.substring(phone.length - 4); return phone.substring(0, 3) + "****" + phone.substring(phone.length - 4);
} }
@ -196,28 +198,34 @@ class AppUtils {
static String dioErrorTypeToString(DioErrorType type) { static String dioErrorTypeToString(DioErrorType type) {
String errorStr = ""; String errorStr = "";
switch (type) { switch (type) {
case DioErrorType.CANCEL:{ case DioErrorType.CANCEL:
{
errorStr = "取消请求"; errorStr = "取消请求";
break; break;
} }
case DioErrorType.CONNECT_TIMEOUT:{ case DioErrorType.CONNECT_TIMEOUT:
{
errorStr = "链接超时"; errorStr = "链接超时";
break; break;
} }
case DioErrorType.RECEIVE_TIMEOUT:{ case DioErrorType.RECEIVE_TIMEOUT:
{
errorStr = "响应超时"; errorStr = "响应超时";
break; break;
} }
case DioErrorType.SEND_TIMEOUT:{ case DioErrorType.SEND_TIMEOUT:
{
errorStr = "请求超时"; errorStr = "请求超时";
break; break;
} }
case DioErrorType.RESPONSE:{ case DioErrorType.RESPONSE:
{
errorStr = "服务器异常"; errorStr = "服务器异常";
break; break;
} }
case DioErrorType.DEFAULT: case DioErrorType.DEFAULT:
default:{ default:
{
errorStr = "请求异常"; errorStr = "请求异常";
break; break;
} }
@ -228,8 +236,7 @@ class AppUtils {
static String textSubStr(String input, int length) { static String textSubStr(String input, int length) {
length -= 1; length -= 1;
if(length < 0 || input.length < length) if (length < 0 || input.length < length) return input;
return input;
return "${input.substring(0, length)}..."; return "${input.substring(0, length)}...";
} }
} }

2
lib/view_widget/custom_image.dart

@ -54,7 +54,7 @@ class MImage extends StatelessWidget {
MediaQuery.of(context).size.height:constraints.constrainHeight()) * scaleIndex).toInt(); MediaQuery.of(context).size.height:constraints.constrainHeight()) * scaleIndex).toInt();
/// ///
if ((src??"").startsWith("http")) { if ((src??"").startsWith("http")) {
if(!noCompress) if(noCompress)
imageUrl = src; imageUrl = src;
else else
imageUrl = "$src?imageView2/1/w/${_w}/h/${_h}/format/jpg/q/75"; imageUrl = "$src?imageView2/1/w/${_w}/h/${_h}/format/jpg/q/75";

Loading…
Cancel
Save