BidSuccessDialog.vue
6.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<template>
<view class="dialog-container">
<view class="bg-image" :style="{ backgroundImage: `url(${backgroundImageUrl})` }"></view>
<view class="dialog-body">
<view class="dialog-icon">
<van-image width="100" height="100" fit="cover"
src="https://img02.glsx.com.cn/aus/images/order/payment.png"></van-image>
</view>
<view class="dialog-header">
恭喜你中拍成功!
</view>
<view v-if="auctionVehicle.auction.auctionMode != 2" class="dialog-content">
<text>请尽快支付款项以锁定车辆!</text>
</view>
<view v-if="auctionVehicle.auction.auctionMode == 2 && isNextAucVeh" class="nextTip">
是否前往参拍下一辆车?
</view>
<view v-if="auctionVehicle.auction.auctionMode == 2" class="dialog-auctionMode">
<view class="auctionMode-img">
<van-image width="28" height="28" style="margin: 6px;float: left;" fit="cover"
src="https://img02.glsx.com.cn/aus/images/roundBid/title_icon.png"></van-image>
</view>
<view class="auctionMode-text">
已中拍车辆可在【我的-购车订单】中进行付款与确认购车
<text style="color: #185EFE; cursor: pointer;display: inline-block;"
@click.stop="signContract()">前往购车确认</text>
</view>
</view>
<view v-if="!isNextAucVeh" class="dialog-footer">
<van-button class="dialog-footer_but" type="default" round block @click="handleClose()">取消</van-button>
<van-button class="dialog-footer_but" type="primary" style="margin-left: 12px;" hairline round block
@click="signContract()">前往支付车款</van-button>
</view>
<view v-if="isNextAucVeh" class="dialog-footer">
<van-button class="dialog-footer_but" type="default" round block @click="handleClose()">取消</van-button>
<van-button class="dialog-footer_but" type="primary" style="margin-left: 12px;" hairline round block @click="toNextAucVeh()">
继续参拍
<text v-if="nextAucVehData.remainSecond">({{ Math.floor(nextAucVehData.remainSecond || 0) }}s)</text>
</van-button>
</view>
</view>
</view>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-facing-decorator";
import { BACKGROUND_IMAGE_2 } from "@/static/ResourceConstants";
@Component({
components: {}
})
export default class BidSuccessDialog extends Vue {
backgroundImageUrl = BACKGROUND_IMAGE_2;
@Prop({ type: Number, required: true })
orderId: number;
@Prop({ type: Object, required: true })
auctionVehicle: any;
nextAucVehData = {
aucvehId: '',
remainSecond: 0,
};
isNextAucVeh = false;
isHandleClose = false;
initData(data: any) {
if (this.nextAucVehData.remainSecond) {
return;
}
this.isHandleClose = false;
const { aucvehId, remainSecond } = data || {};
this.nextAucVehData.aucvehId = aucvehId || '';
this.nextAucVehData.remainSecond = remainSecond || 0;
this.isNextAucVeh = aucvehId ? true : false;
this.setTimeoutSecond();
}
setTimeoutSecond() {
if (this.nextAucVehData.aucvehId) {
if (this.nextAucVehData.remainSecond && Number(this.nextAucVehData.remainSecond) > 0) {
setTimeout(() => {
this.nextAucVehData.remainSecond = Math.floor(Number(this.nextAucVehData.remainSecond)) - 1;
this.setTimeoutSecond();
}, 1000);
} else {
this.nextAucVehData.remainSecond = 0;
if (!this.isHandleClose) {
this.toNextAucVeh();
}
}
}
}
handleClose() {
this.isHandleClose = true;
this.$emit('close');
}
//跳转到下一辆车
toNextAucVeh() {
this.$emit('close');
uni.navigateTo({ url: '/module/auction/AuctionVehiclePage?aucvehId=' + this.nextAucVehData.aucvehId });
}
signContract() {
console.log('signContract called', this.orderId); // 添加调试信息
// uni.navigateTo({ url: '/module/order/contract/ContractPage?orderId=' + this.orderId });
uni.navigateTo({url: '/module/order/OrderDetailPage?orderId=' + this.orderId})
this.$emit('close');
}
}
</script>
<style lang="scss" scoped>
.dialog-container {
//height: 200px;
//min-height: 100vh;
/* 避免内容被顶部导航栏遮挡(可选) */
//padding-top: var(--status-bar-height);
//box-sizing: border-box;
}
.bg-image {
background-attachment: inherit;
/* 将背景图固定不动 */
}
.dialog-body {
padding: 20px;
}
.dialog-icon {
text-align: center;
}
.dialog-header {
position: relative;
font-size: 26px;
font-weight: 500;
color: #185EFE;
text-align: center;
}
.dialog-content {
position: relative;
text-align: center;
text {
font-size: 13px;
font-weight: 400;
line-height: 18.2px;
color: #333333;
}
}
.dialog-footer {
width: 100%;
margin-top: 24px;
margin-bottom: 24px;
float: left;
}
.dialog-footer_but {
width: -webkit-calc(50% - 6px);
width: -moz-calc(50% - 6px);
width: calc(50% - 6px);
float: left;
}
.dialog-auctionMode {
width: 100%;
height: 56px;
border-radius: 4px;
background: linear-gradient(0deg, #edf6ff 0%, #f7fbff 100%);
margin-top: 16px;
float: left;
}
.auctionMode-img {
width: 40px;
height: 40px;
background: linear-gradient(0deg, #cce5ff 0%, #e6f4fe00 100%);
border-radius: 50%;
margin: 8px;
float: left;
}
.auctionMode-text {
width: -webkit-calc(100% - 64px);
width: -moz-calc(100% - 64px);
width: calc(100% - 64px);
float: left;
color: #676d7d;
font-size: 12px;
line-height: 20px;
margin: 8px 0;
position: relative; // 确保元素在正确的层级
z-index: 1; // 确保元素在上方
text {
display: inline-block; // 确保文本块可点击
padding: 2px 0; // 增加点击区域
}
}
.nextTip {
width: 100%;
height: 22px;
float: left;
margin-top: 8px;
text-align: center;
color: #676d7d;
font-size: 14px;
font-weight: 常规体;
font-family: "苹方-简";
line-height: 22px;
}
</style>