|
|
@@ -1,9 +1,17 @@
|
|
|
import { DiaLogCompControl, YTHeader, YTRequest, yTRouter } from 'basic'
|
|
|
+import { OrderApi } from '../../apis/OrderApi'
|
|
|
import { buttonComp } from '../../components/BuilderIndex'
|
|
|
import { CustomTextStyle } from '../../style/CustomTextStyle'
|
|
|
|
|
|
@ComponentV2
|
|
|
struct CashPledgePage {
|
|
|
+ @Local deposit: number = 0.00
|
|
|
+
|
|
|
+ // 获取押金缴纳情况
|
|
|
+ async getCashPledgeStatus(){
|
|
|
+ let ans = await OrderApi.getUserDeposit()
|
|
|
+ this.deposit = Number.parseFloat(ans.deposit)
|
|
|
+ }
|
|
|
|
|
|
// 打开弹窗
|
|
|
openDiaLog(){
|
|
|
@@ -14,9 +22,9 @@ struct CashPledgePage {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 前往缴纳押金页面
|
|
|
router2CashPledgeSecond(){
|
|
|
+ if(this.deposit >= 100) return
|
|
|
yTRouter.router2CashPledgeSecond()
|
|
|
}
|
|
|
|
|
|
@@ -25,6 +33,10 @@ struct CashPledgePage {
|
|
|
yTRouter.router2CashPledgeRecord()
|
|
|
}
|
|
|
|
|
|
+ aboutToAppear(): void {
|
|
|
+ this.getCashPledgeStatus()
|
|
|
+ }
|
|
|
+
|
|
|
build() {
|
|
|
NavDestination() {
|
|
|
Column({space: 12}) {
|
|
|
@@ -49,7 +61,7 @@ struct CashPledgePage {
|
|
|
Text('自用卡')
|
|
|
.attributeModifier(new CustomTextStyle({size: 12, weight: 500, color: '#FFFFFF'}))
|
|
|
|
|
|
- Text(`298.00`)
|
|
|
+ Text(this.deposit.toFixed(2))
|
|
|
.attributeModifier(new CustomTextStyle({size: 28, weight: 500, color: '#FFFFFF'}))
|
|
|
|
|
|
}.width('100%').height(104)
|
|
|
@@ -65,7 +77,7 @@ struct CashPledgePage {
|
|
|
.attributeModifier(new CustomTextStyle({size: 14, weight: 500, color: '#000000'}))
|
|
|
|
|
|
Row({space: 10}){
|
|
|
- Text('去缴纳')
|
|
|
+ Text(this.deposit >= 100 ? '已缴纳' : '去缴纳')
|
|
|
.attributeModifier(new CustomTextStyle({size: 14, weight: 500, color: '#C7C7CC'}))
|
|
|
|
|
|
Image($r('[basic].media.ic_public_arrow_left'))
|