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. 2
      lib/mine/mine_page.dart
  8. 1
      lib/union/union_list.dart
  9. 1
      lib/union/union_page.dart
  10. 107
      lib/utils/flutter_utils.dart
  11. 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: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w),
):ListView.builder(
)
:
ListView.builder(
controller: sc,
shrinkWrap: true,
itemBuilder: (context, position) {
return InkWell(
child: CommunityDynamic(

25
lib/community/community_view/community_dynamic.dart

@ -67,15 +67,6 @@ class _CommunityDynamic extends State<CommunityDynamic> {
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then(
(value) => {
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
),
},
);
initVideo();
}
@ -120,6 +111,14 @@ class _CommunityDynamic extends State<CommunityDynamic> {
////
_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);
if (baseData != null && baseData.isSuccess) {
widget.exitFull();
@ -133,6 +132,14 @@ class _CommunityDynamic extends State<CommunityDynamic> {
///
_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);
if (baseData != null && baseData.isSuccess) {
widget.exitFull();

2
lib/home/home_view/discount_zone.dart

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

6
lib/home/home_view/home_recommend_goods.dart

@ -41,7 +41,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 235.h,
height: 260.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Colors.white,
@ -92,8 +92,8 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
commodityZone?.productImg ?? "",
fit: BoxFit.contain,
radius: BorderRadius.circular(4.r),
width: 158.w,
height: 158.h,
width: 158,
height: 158,
errorSrc: "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 ?? "",
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
width: 54.w,
height: 54.h,
width: 54,
height: 54,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
Image.asset(
index == 0 ? "assets/image/ranking1.webp" :(index == 1 ? "assets/image/ranking2.webp": "assets/image/ranking3.webp"),
width: 25.w,
height: 25.h,
width: 25,
height: 25,
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.appLastVersionUp = "1.0.1";
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(
context: context,
barrierDismissible: false,

2
lib/mine/mine_page.dart

@ -245,7 +245,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
),
Container(
margin: EdgeInsets.only(top: 258 .h),
margin: EdgeInsets.only(top: 258.h),
child: Column(
children: [
///

1
lib/union/union_list.dart

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

1
lib/union/union_page.dart

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

107
lib/utils/flutter_utils.dart

@ -8,36 +8,39 @@ import 'package:intl/intl.dart';
import 'package:path_provider/path_provider.dart';
class AppUtils {
///线
static Future<String> calculateDistance(BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async {
double mi = await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng);
static Future<String> calculateDistance(
BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async {
double mi =
await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng);
NumberFormat numberFormat = NumberFormat("#.#");
return "${numberFormat.format(mi / 1000)}";
}
///
static bool versionCompare(String localVersion,String serverVersion){
try{
static bool versionCompare(String localVersion, String serverVersion) {
try {
var localVersionArr = localVersion.split(".");
var serverVersionArr = serverVersion.split(".");
if((int.tryParse(localVersionArr[0]) < int.tryParse(serverVersionArr[0]))
|| (int.tryParse(localVersionArr[1]) < int.tryParse(serverVersionArr[1]))
|| (int.tryParse(localVersionArr[2]) < int.tryParse(serverVersionArr[2])))
return true;
}catch(ex){ }
return false;
}
static String trimEnd(String resString,String char){
while(resString.endsWith(char)){
resString = resString.substring(0,resString.length - 1);
if (int.tryParse(localVersionArr[0]) > int.tryParse(serverVersionArr[0]))
return false;
if (int.tryParse(localVersionArr[1]) > int.tryParse(serverVersionArr[1]))
return false;
if (int.tryParse(localVersionArr[2]) > int.tryParse(serverVersionArr[2]))
return false;
} catch (ex) {}
return true;
}
static String trimEnd(String resString, String char) {
while (resString.endsWith(char)) {
resString = resString.substring(0, resString.length - 1);
}
return resString;
}
////
static String calculateDouble(double res){
static String calculateDouble(double res) {
String resString = res.toStringAsFixed(2);
resString = trimEnd(resString, "0");
resString = trimEnd(resString, ".");
@ -57,10 +60,9 @@ class AppUtils {
return exp.hasMatch(mobile);
}
static String phoneEncode(String phone){
if(phone == null || phone.length != 11)
return phone;
return phone.substring(0,3) + "****" + phone.substring(phone.length-4);
static String phoneEncode(String phone) {
if (phone == null || phone.length != 11) return phone;
return phone.substring(0, 3) + "****" + phone.substring(phone.length - 4);
}
static double textScale(context) {
@ -193,34 +195,40 @@ class AppUtils {
}
}
static String dioErrorTypeToString(DioErrorType type){
static String dioErrorTypeToString(DioErrorType type) {
String errorStr = "";
switch(type){
case DioErrorType.CANCEL:{
errorStr = "取消请求";
break;
}
case DioErrorType.CONNECT_TIMEOUT:{
errorStr = "链接超时";
break;
}
case DioErrorType.RECEIVE_TIMEOUT:{
errorStr = "响应超时";
break;
}
case DioErrorType.SEND_TIMEOUT:{
errorStr = "请求超时";
break;
}
case DioErrorType.RESPONSE:{
errorStr = "服务器异常";
break;
}
switch (type) {
case DioErrorType.CANCEL:
{
errorStr = "取消请求";
break;
}
case DioErrorType.CONNECT_TIMEOUT:
{
errorStr = "链接超时";
break;
}
case DioErrorType.RECEIVE_TIMEOUT:
{
errorStr = "响应超时";
break;
}
case DioErrorType.SEND_TIMEOUT:
{
errorStr = "请求超时";
break;
}
case DioErrorType.RESPONSE:
{
errorStr = "服务器异常";
break;
}
case DioErrorType.DEFAULT:
default:{
errorStr = "请求异常";
break;
}
default:
{
errorStr = "请求异常";
break;
}
}
errorStr += ",请检查手机网络是否正常";
return errorStr;
@ -228,8 +236,7 @@ class AppUtils {
static String textSubStr(String input, int length) {
length -= 1;
if(length < 0 || input.length < length)
return input;
return "${input.substring(0,length)}...";
if (length < 0 || input.length < length) return input;
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();
///
if ((src??"").startsWith("http")) {
if(!noCompress)
if(noCompress)
imageUrl = src;
else
imageUrl = "$src?imageView2/1/w/${_w}/h/${_h}/format/jpg/q/75";

Loading…
Cancel
Save