Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
dcb636c6
提交
dcb636c6
authored
2月 26, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、获取积分 传优惠前id
上级
4898a2c6
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
46 行增加
和
41 行删除
+46
-41
shop.dart
lib/apis/shop.dart
+2
-0
controller.dart
lib/pages/book_pay/controller.dart
+6
-3
controller.dart
lib/pages/credit_points/controller.dart
+36
-36
index.dart
lib/pages/credit_points/index.dart
+2
-2
没有找到文件。
lib/apis/shop.dart
浏览文件 @
dcb636c6
...
@@ -58,11 +58,13 @@ abstract class ShopAPI {
...
@@ -58,11 +58,13 @@ abstract class ShopAPI {
///
///
static
Future
<
CreditPointModel
>
creditPoints
({
static
Future
<
CreditPointModel
>
creditPoints
({
required
String
price
,
required
String
price
,
required
String
couponRecId
,
})
async
{
})
async
{
final
result
=
await
HttpService
.
to
.
post
(
final
result
=
await
HttpService
.
to
.
post
(
'/v1/coupon/Coupon/getIntegral'
,
'/v1/coupon/Coupon/getIntegral'
,
params:
{
params:
{
'price'
:
price
,
'price'
:
price
,
'coupon_rec_id'
:
couponRecId
},
},
);
);
if
(
result
.
data
is
!
Map
)
return
CreditPointModel
();
if
(
result
.
data
is
!
Map
)
return
CreditPointModel
();
...
...
lib/pages/book_pay/controller.dart
浏览文件 @
dcb636c6
...
@@ -44,7 +44,7 @@ class BookPayController extends GetxController {
...
@@ -44,7 +44,7 @@ class BookPayController extends GetxController {
@override
@override
void
onReady
()
{
void
onReady
()
{
_getCreditPoints
(
price:
originalPrice
.
toString
());
_getCreditPoints
(
price:
originalPrice
.
toString
()
,
couponRecId:
useCouponModel
.
couponRecId
.
toString
()
);
_getShow
();
_getShow
();
computeFinalPrice
();
computeFinalPrice
();
_getCouponNumber
();
_getCouponNumber
();
...
@@ -56,6 +56,8 @@ class BookPayController extends GetxController {
...
@@ -56,6 +56,8 @@ class BookPayController extends GetxController {
useCouponModel
=
model
;
useCouponModel
=
model
;
print
(
'使用优惠券。。。。。。。。。。。。。。。。
${model.couponRecId}
'
);
print
(
'使用优惠券。。。。。。。。。。。。。。。。
${model.couponRecId}
'
);
computeFinalPrice
();
computeFinalPrice
();
// 使用优惠券后重新获取积分
_getCreditPoints
(
price:
finalPrice
.
toString
(),
couponRecId:
useCouponModel
.
couponRecId
.
toString
());
}
}
/// 支付方式 默认第一个
/// 支付方式 默认第一个
...
@@ -96,9 +98,10 @@ class BookPayController extends GetxController {
...
@@ -96,9 +98,10 @@ class BookPayController extends GetxController {
/// 获取积分
/// 获取积分
void
_getCreditPoints
({
void
_getCreditPoints
({
required
String
price
required
String
price
,
required
String
couponRecId
})
async
{
})
async
{
creditPointModel
=
await
ShopAPI
.
creditPoints
(
price:
price
);
creditPointModel
=
await
ShopAPI
.
creditPoints
(
price:
price
,
couponRecId:
useCouponModel
.
couponRecId
.
toString
()
);
update
();
update
();
}
}
/// 是否展示优惠券 和积分使用 模型
/// 是否展示优惠券 和积分使用 模型
...
...
lib/pages/credit_points/controller.dart
浏览文件 @
dcb636c6
part of
credit_points
;
//
part of credit_points;
//
class
CreditPointController
extends
GetxController
{
//
class CreditPointController extends GetxController {
final
String
price
;
//
final String price;
CreditPointController
(
this
.
price
);
//
CreditPointController(this.price);
CreditPointModel
creditPointModel
=
CreditPointModel
();
//
CreditPointModel creditPointModel = CreditPointModel();
//
bool
use
=
false
;
//
bool use = false;
//
//
//
//
//
@override
//
@override
void
onReady
()
{
//
void onReady() {
_getCreditPoints
(
price:
price
);
//
_getCreditPoints(price: price);
super
.
onReady
();
//
super.onReady();
}
//
}
//
void
setUse
(){
//
void setUse(){
use
=
!
use
;
//
use = !use;
update
();
//
update();
}
//
}
//
//
void
_getCreditPoints
({
//
void _getCreditPoints({
required
String
price
//
required String price
})
async
{
//
}) async {
creditPointModel
=
await
ShopAPI
.
creditPoints
(
price:
price
);
//
creditPointModel = await ShopAPI.creditPoints(price: price);
update
();
//
update();
}
//
}
//
}
//
}
//
//
//
lib/pages/credit_points/index.dart
浏览文件 @
dcb636c6
...
@@ -14,4 +14,4 @@ import '../../models/index.dart';
...
@@ -14,4 +14,4 @@ import '../../models/index.dart';
import
'../book_pay/index.dart'
;
import
'../book_pay/index.dart'
;
part
'view.dart'
;
part
'view.dart'
;
part
'controller.dart'
;
// part 'controller.dart';
\ No newline at end of file
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论