my_order_insure.html
9.3 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<script src="../../assets/js/fontsize.js"></script>
<link rel="stylesheet" href="../../assets/css/api.css"/>
<link rel="stylesheet" href="../../assets/css/style.css">
<link rel="stylesheet" href="../../assets/css/index.css">
<link rel="stylesheet" href="../../assets/css/doc.css">
<link rel="stylesheet" href="../../assets/css/pay.css">
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<title></title>
<style type="text/css">
.hr {
height: 0.11rem;
background-color: #f2f2f2;
}
.pay_date {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.2rem 0.53rem 0.2rem 0.77rem;
font-size: 14px;
color: #424242;
}
.bordert {
border-top: 1px solid #ececec;
}
.order_num {
padding: 0.2rem 0.44rem;
background-color: #f2f2f2;
font-size: 14px;
color: #424242;
}
.order_btn_box {
display: flex;
align-items: center;
justify-content: flex-end;
margin: 0.82rem 0;
padding: 0 0.5rem;
font-size: 17px;
color: #D8B25F;
}
.order_btn_box span {
border: 1px solid #D8B25F;
border-radius: 0.16rem;
width: 1.81rem;
text-align: center;
padding: 0.15rem 0;
margin-left: 0.44rem;
}
</style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<div class="pay_time" v-if="order_type=='待付款'">支付剩余时间:{{minute}}:{{second}}</div>
<div class="pay_box">
<div class="pay_item_title">
<span class="pay_item_title_span">{{order_info.post_title}}</span>
<span>{{order_info.order_type}}</span>
</div>
<div class="pay_detail">
<div class="pay_detail_item">
<span class="iconfont icon-xingbie"></span>
<span class="pay_detail_label">投保金额</span>
<span>¥8868</span>
</div>
<div class="pay_detail_item">
<span class="iconfont icon-chuhangriqi"></span>
<span class="pay_detail_label">生效日期</span>
<span>{{order_info.birthday}}</span></div>
<div class="pay_detail_item">
<span class="iconfont icon-shijian1"></span>
<span class="pay_detail_label">截止日期</span>
<span>{{order_info.service_time}}</span></div>
</div>
</div>
<div class="hr"></div>
<div class="pay_date">
<span>下单日期</span><span>{{order_info.addtime}}</span>
</div>
<!--<div class="swiper_item" @click="go_detail(order_info.gid)">-->
<div class="swiper_item">
<div class="swiper_item_img"><img :src="order_info.icon" alt=""></div>
<div class="swiper_item_right">
<div class="swiper_item_title">{{order_info.post_title}}</div>
<div class="swiper_item_content">{{order_info.other_title}}</div>
<div class="swiper_item_type">
<div class="swiper_item_type1" v-for="(item,item2_index) in order_info.tag">
<div class="icon_img"><img :src="item.url" alt=""></div>
<span>{{item.text}}</span>
</div>
</div>
<div class="swiper_item_money">¥{{order_info.price}}</div>
</div>
</div>
<div class="pay_date bordert">
<span>总服务费</span><span>{{order_info.good_price?order_info.good_price:0}}元</span>
</div>
<div class="order_num">订单号:{{order_info.order_sn}}</div>
<div class="order_btn_box" v-if="order_type=='待付款'">
<span @click="cancel_order" v-if="order_type=='进行中'||order_type=='待付款'">取消支付</span>
<span @click="pay_moneny">支付</span>
</div>
<div class="order_btn_box" v-else-if="order_type=='进行中'"><span @click="cancel_order">取消支付</span></div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/weui.min.js"></script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/index.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
minutes: 30,
seconds: 0,
order_id: '',
order_type: '',
order_info: [],
time: []
},
created: function () {
apiready = function () {
app.add();
app.order_id = api.pageParam.order_id;
app.order_type = api.pageParam.order_type;
app.myOrder();
}
},
watch: {
second: {
handler(newVal) {
this.num(newVal)
}
},
minute: {
handler(newVal) {
this.num(newVal)
}
}
},
computed: {
second: function () {
return this.num(this.seconds)
},
minute: function () {
return this.num(this.minutes)
}
},
methods: {
num: function (n) {
return n < 10 ? "0" + n : "" + n
},
add: function () {
var time = window.setInterval(function () {
if (app.seconds == 0 && app.minutes != 0) {
app.seconds = 59;
app.minutes -= 1;
} else if (app.minutes == 0 && app.seconds == 0) {
app.seconds = 0;
window.clearInterval(time);
if (app.order_type == '待付款') {
app.cancel_order();
closeWindow('my_order')
}
} else {
app.seconds -= 1
}
}, 1000);
},
pay_moneny: function () {
openView('my_pay', 'my/my_pay', '支付', 'my_pay', false, {order_id: app.order_id});
},
myOrder: function () {
var post = {
order_id: app.order_id
};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken(),
};
getRequest('post', 'user/Order/getOrderInfo', post, header).then(function (res) {
// alert(JSON.stringify(res));
if (res.data.code == 1) {
app.time = (res.data.data.timeout).split(':');
app.seconds = parseInt(app.time[1]);
app.minutes = parseInt(app.time[0]);
app.order_info = res.data.data;
loadEnd();
} else {
toastMsg(res.data.msg)
}
})
},
// 取消订单
cancel_order: function () {
api.showProgress({
title: '取消订单',
text: '正在取消订单',
modal: false
});
var post = {
order_id: app.order_id
};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken(),
};
getRequest('post', 'user/Order/cancleOrder', post, header).then(function (res) {
// alert(JSON.stringify(res));
if (res.data.code == 1) {
// toastMsg(res.data.msg);
api.hideProgress();
toastMsg(res.data.msg);
setTimeout(res => {
openView('my_orderlist', 'my/my_orderlist', '我的订单')
}, 2000)
} else {
toastMsg(res.data.msg)
}
});
},
// 去详情页
// go_detail:function (id) {
// api.openWin({
// name: 'care_w',
// url: '../index/care_w.html',
// pageParam: {
// id: id,
// cid: app.cid,
// }
// })
// }
}
})
</script>