diff --git a/android/app/src/main/kotlin/com/zsw/huixiang/BridgePlugin.kt b/android/app/src/main/kotlin/com/zsw/huixiang/BridgePlugin.kt index 279e101e..3620352b 100644 --- a/android/app/src/main/kotlin/com/zsw/huixiang/BridgePlugin.kt +++ b/android/app/src/main/kotlin/com/zsw/huixiang/BridgePlugin.kt @@ -1,6 +1,7 @@ package com.zsw.huixiang import android.content.Context +import android.content.Intent import android.net.Uri import android.text.TextUtils import android.util.Log @@ -37,6 +38,17 @@ class BridgePlugin : FlutterPlugin, MethodChannel.MethodCallHandler { } } result.success("") + } else if (call.method == "toAppStore") { + try { + val intent = Intent(Intent.ACTION_VIEW); + intent.data = Uri.parse("market://search?q="+ context.packageName); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + result.success("") + } catch (e : Exception) { + result.success("0") + e.printStackTrace(); + } } } diff --git a/ios/Runner/AppDelegate.mm b/ios/Runner/AppDelegate.mm index 07e4232a..a8430e65 100644 --- a/ios/Runner/AppDelegate.mm +++ b/ios/Runner/AppDelegate.mm @@ -85,6 +85,11 @@ } result(@""); } + if (condition[method isEqual:@"toAppStore"]) { + NSString *appURL = @"https://itunes.apple.com/cn/app/1575124838?action=write-review"; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appURL]]; + result(@""); + } //result(FlutterMethodNotImplemented); }]; @@ -107,6 +112,11 @@ } result(@""); } + if (condition[method isEqual:@"toAppStore"]) { + NSString *appURL = @"https://itunes.apple.com/cn/app/1575124838?action=write-review"; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appURL]]; + result(@""); + } //result(FlutterMethodNotImplemented); }]; // 通过通用链接唤起 App diff --git a/lib/main_page.dart b/lib/main_page.dart index 431770e3..38b8b871 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -321,11 +321,11 @@ class _MainPage extends State with WidgetsBindingObserver { firstCurve: Curves.easeIn, secondCurve: Curves.ease, sizeCurve: Curves.easeInOut, + duration: Duration(milliseconds: 50), firstChild: Container( padding: EdgeInsets.all(4), height: 82.h, - alignment: - Platform.isAndroid ? Alignment.center : Alignment.topCenter, + alignment: Platform.isAndroid ? Alignment.center : Alignment.topCenter, child: Image.asset( icons[index], width: 45, @@ -365,7 +365,6 @@ class _MainPage extends State with WidgetsBindingObserver { crossFadeState: isSelected ? CrossFadeState.showFirst : CrossFadeState.showSecond, - duration: Duration(milliseconds: 200), ), ), ), diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index a920b9d5..48adb96b 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -315,4 +315,9 @@ abstract class ApiService { ///评论点赞 @GET("/memberComment/likes/{id}") Future commentLike(@Path("id") String id); + + ///评论删除 + @GET("/memberComment/delete/{id}") + Future delComment(@Path("id") String id); + } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart deleted file mode 100644 index 296b3887..00000000 --- a/lib/retrofit/retrofit_api.g.dart +++ /dev/null @@ -1,897 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'retrofit_api.dart'; - -// ************************************************************************** -// RetrofitGenerator -// ************************************************************************** - -class _ApiService implements ApiService { - _ApiService(this._dio, {this.baseUrl}) { - ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; - } - - final Dio _dio; - - String baseUrl; - - @override - Future upload(data, folderId) async { - ArgumentError.checkNotNull(data, 'data'); - ArgumentError.checkNotNull(folderId, 'folderId'); - const _extra = {}; - final queryParameters = {}; - final _data = FormData(); - _data.files.add(MapEntry( - 'file', - MultipartFile.fromFileSync(data.path, - filename: data.path.split(Platform.pathSeparator).last))); - if (folderId != null) { - _data.fields.add(MapEntry('folderId', folderId.toString())); - } - final _result = await _dio.request>('/file/upload', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future searchPoi(lat, lng, keywords, size, page) async { - ArgumentError.checkNotNull(lat, 'lat'); - ArgumentError.checkNotNull(lng, 'lng'); - ArgumentError.checkNotNull(keywords, 'keywords'); - ArgumentError.checkNotNull(size, 'size'); - ArgumentError.checkNotNull(page, 'page'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request( - 'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = _result.data; - return value; - } - - @override - Future memberLogin(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/auth/platform/memberLogin', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future sendVerify(mobile) async { - ArgumentError.checkNotNull(mobile, 'mobile'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/auth/sendVerify/$mobile', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditGoods(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditGoods/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future goodsCategory(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditGoodsCategory/page', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditGoodsById(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/creditGoods/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/info', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future editInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/member/editMemberInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future signInInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/member/signInInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future signIn() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/signIn', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future recharge(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/wallet/recharge', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future receiveCoupon(couponId) async { - ArgumentError.checkNotNull(couponId, 'couponId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/coupon/receive?couponId=$couponId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrderList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditOrder/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrder(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditOrder/create', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future addAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/add', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future deleteAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/delete', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryAddress(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/address/detail/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryMemberAddress() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/address/queryMemberAddress', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future updateAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/update', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryCoupon(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/coupon/centreList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryCard(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/coupon/packageList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryStore(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/store/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future informationList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/information/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future informationInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/information/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrderReceive(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/creditOrder/receive/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryHome() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/home/home', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryStoreInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/store/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryArticle(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/information/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryBanner(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/banner/page', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryHomeBrand() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/home/brand', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future minLogin(storeId) async { - ArgumentError.checkNotNull(storeId, 'storeId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/auth/mini/login/$storeId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryBillInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/member/listBill', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future rankList() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/rankList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future orderList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/order/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future orderDetail(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/order/orderDetail?id=$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future continuePay(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/order/continuePay', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future receiveToCard(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/creditOrder/receive/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future vipList() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/vipList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future vipDetail(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/member/vipDetail/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future msgList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/app-msg/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryMsg(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/app-msg/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future informationLikes(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/information/likes/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future memberComment(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/memberComment', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future memberCommentList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/memberComment/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future commentLike(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/memberComment/likes/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } -} diff --git a/lib/setting/about_page.dart b/lib/setting/about_page.dart index 9be338b6..addaa294 100644 --- a/lib/setting/about_page.dart +++ b/lib/setting/about_page.dart @@ -1,7 +1,11 @@ +import 'dart:io'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/utils/bridge.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:package_info/package_info.dart'; @@ -77,13 +81,24 @@ class _AboutPage extends State { S.of(context).banben(version), ), textItem(S.of(context).tebieshengming), - textItem(S.of(context).shiyongbangzhu), - GestureDetector( - child: settingSingleItem(S.of(context).geiwopingfen), + InkWell( onTap: () { - + Navigator.of(context) + .pushNamed('/router/help_feedback_page'); }, + child: textItem(S.of(context).shiyongbangzhu), ), + if (!Platform.isAndroid) + GestureDetector( + child: settingSingleItem(S.of(context).geiwopingfen), + onTap: () { + Bridge.toAppStore().then((value) { + if (Platform.isAndroid && value == "0") { + SmartDialog.showToast("手机没有安装应用市场app", alignment: Alignment.center); + } + }); + }, + ), GestureDetector( child: settingSingleItem(S.of(context).yinsishengming), onTap: () { diff --git a/lib/union/store_details_page.dart b/lib/union/store_details_page.dart index 430d996c..ecf64222 100644 --- a/lib/union/store_details_page.dart +++ b/lib/union/store_details_page.dart @@ -216,7 +216,8 @@ class _StoreDetailsPage extends State return; } - BaseData baseData = await apiService.commentLike(id).catchError((onError) {}); + BaseData baseData = + await apiService.commentLike(id).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { memberList.forEach((element) { @@ -231,7 +232,8 @@ class _StoreDetailsPage extends State } }); }); - }/* else { + } + /* else { if (baseData.msg == "您已点过赞") { setState(() { memberList.forEach((element) { @@ -463,8 +465,7 @@ class _StoreDetailsPage extends State child: Row( children: [ Text( - S - .of(context) + S.of(context) .pinglun_(commentTotal.toString()), style: TextStyle( fontSize: 16.sp, @@ -537,30 +538,39 @@ class _StoreDetailsPage extends State } SharedPreferences.getInstance().then((value) { showModalBottomSheet( - context: context, - backgroundColor: Colors.transparent, - builder: (context) { - return CommentMenu( - (type) { - print("click: $type"); - if (type == "huifu") { - reply(memberComment); - } else if (type == "shanchu") { - delComment(); - } - }, - isSelf: userId == value.getString("userId"), - ); - }); + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return CommentMenu( + (type) { + print("click: $type"); + if (type == "huifu") { + reply(memberComment); + } else if (type == "shanchu") { + delCommentTips(); + } + }, + isSelf: userId == value.getString("userId"), + ); + }, + ); }); } - delComment() { + delCommentTips() { SmartDialog.show(widget: Tips(() { - SmartDialog.dismiss(); + delComment(); })); } + delComment() async { + BaseData baseData = await apiService.delComment( + widget.arguments["activityId"] ?? widget.arguments["articleId"]); + if (baseData != null && baseData.isSuccess) { + queryMemberCommentList(); + } + } + reply(memberComment) { FocusScope.of(context).requestFocus(commentFocus); parenId = memberComment.id; @@ -772,6 +782,7 @@ class _StoreDetailsPage extends State Container( alignment: Alignment.topRight, child: LikeButton( + padding: EdgeInsets.all(10), size: 16, circleSize: 16, circleColor: CircleColor( @@ -784,22 +795,22 @@ class _StoreDetailsPage extends State likeBuilder: (bool isLiked) { return isLiked ? Image.asset( - "assets/image/icon_like.png", - width: 16, - height: 16, - ) + "assets/image/icon_like.png", + width: 16, + height: 16, + ) : Image.asset( - "assets/image/icon_like_h.png", - width: 16, - height: 16, - ); + "assets/image/icon_like_h.png", + width: 16, + height: 16, + ); }, isLiked: memberList.liked ?? false, onTap: (isLiked) async { await queryCommentLike(memberList.id); return (memberList == null || memberList.liked == null) ? false - : !memberList.liked; + : memberList.liked; }, likeCount: memberList.likes, countBuilder: (int count, bool isLiked, String text) { diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 63470a74..9b493607 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -519,10 +519,13 @@ class _UnionPage extends State SizedBox( width: 2.w, ), - Image.asset( - "assets/image/icon_union_location_black.png", - width: 14.w, - height: 14.h, + Container( + margin: EdgeInsets.only(top: 1.5), + child: Image.asset( + "assets/image/icon_union_location_black.png", + width: 14.w, + height: 14.h, + ), ), SizedBox( width: 2.w, diff --git a/lib/utils/bridge.dart b/lib/utils/bridge.dart index a458f0ef..94fefb82 100644 --- a/lib/utils/bridge.dart +++ b/lib/utils/bridge.dart @@ -11,6 +11,10 @@ class Bridge { return await _channel1.invokeMethod('action'); } + static Future toAppStore() async { + return await _channel1.invokeMethod('toAppStore'); + } + } diff --git a/lib/view_widget/tips_dialog.dart b/lib/view_widget/tips_dialog.dart index 793a1671..a9599780 100644 --- a/lib/view_widget/tips_dialog.dart +++ b/lib/view_widget/tips_dialog.dart @@ -1,5 +1,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; @@ -53,7 +54,9 @@ class _Tips extends State { children: [ Expanded( child: InkWell( - onTap: widget.tips, + onTap: () { + SmartDialog.dismiss(); + }, child: Container( width: double.infinity, height: 90.h, @@ -76,7 +79,10 @@ class _Tips extends State { ), Expanded( child: InkWell( - onTap: widget.tips, + onTap: () { + SmartDialog.dismiss(); + widget.tips(); + }, child: Container( width: double.infinity, height: 90.h,