paycenterwxmicro.html
9.83 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
258
259
260
261
262
263
264
265
266
{template 'common/header'}
<ul class="nav nav-tabs">
<li {if $op == 'pay'}class="active"{/if}><a href="{php echo url('paycenter/wxmicro/pay');}">刷卡收款</a></li>
</ul>
{if $op == 'pay'}
<style>
.panel .panel-heading input[name="fee"] {
line-height:60px;
height:60px; font-size:40px;
padding-top:10px;
text-align:right;
}
.panel .panel-heading .form-group{
margin-bottom: 0px;
}
.panel .panel-body .row .col-md-4{
margin-bottom: 15px;
}
.panel .panel-body .row .col-md-4 button, .panel-footer .row .col-md-6 button{
line-height: 40px;
font-size: 20px;
}
#wechat-pay .modal-content .form-group p{
font-size: 16px;
}
#wechat-pay .modal-content .form-group p span{
color: red;
}
#wechat-pay .modal-content .modal-body{
text-align: center;
}
.row .col-md-3 .panel .panel-body span{
font-size: 22px;
color: #666;
display: block;
}
</style>
<div class="clearfix" ng-controller="microPay" id="microPay">
<div class="row">
<div class="col-md-3">
<div class="panel panel-default text-center">
<div class="panel-heading">
<img src="resource/images/money.png" height="50">
</div>
<div class="panel-body">
<span>¥{$credit_total}</span>
今日收款
</div>
</div>
</div>
<div class="col-md-3">
<div class="panel panel-default text-center">
<div class="panel-heading">
<img src="resource/images/wx-icon.png" height="50">
</div>
<div class="panel-body">
<span>¥{$wechat_total}</span>
今日收款
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">¥</span>
<input type="text" name="fee" class="form-control input-lg" ng-model="micro.config.fee" ng-init="micro.config.fee" placeholder="支付金额(至少0.01元)" disabled>
<span class="input-group-addon">元</span>
</div>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-4" ng-repeat="num in micro.config.nums">
<button type="button" class="btn btn-info btn-lg btn-block" ng-click="micro.num(num[0])">{{num[1]}}</button>
</div>
</div>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-md-6">
<a ng-if="micro.config.fee == '0'" ng-click="micro.mcardPay()" class="btn btn-success btn-lg btn-block ">会员卡支付(-)</a>
<a ng-if="micro.config.fee !='0'" data-toggle="modal" ng-click="micro.mcardPay('1')" class="btn btn-success btn-lg btn-block mccard">会员卡支付(-)</a>
</div>
<div class="col-md-6">
<a ng-if="micro.config.fee == '0'" ng-click="micro.mcardPay()" class="btn btn-success btn-lg btn-block">微信刷卡支付(+)</a>
<a ng-if="micro.config.fee != '0'" ng-click="micro.mcardPay('2')" data-toggle="modal" class="btn btn-success btn-lg btn-block">微信刷卡支付(+)</a>
<div class="modal fade" id="wechat-pay">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body" style="text-align:center;">
<div class="form-group">
<h2>刷卡支付</h2>
<p>收款金额为<span> {{micro.config.fee}}元</span></p>
<p class="js-userpaying" style="display:none;"><span>用户正在支付中</span></p>
<input type="text" name="code" class="form-control js-input input-lg" ng-model="micro.config.code" tabindex="4" placeholder="微信刷卡支付授权码(请链接扫码枪扫码)">
</div>
<div class="form-group">
<p class="js-pay-warning text-left" style="color:red;"></p>
</div>
<div class="form-group text-right">
<a class="btn btn-primary btn-lg" id="micro-submit" ng-click="micro.submit()" ng-disabled="micro.last_money < 0">确认收款</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
消费记录(最近10条)
</div>
<div class="panel-body">
<table class="table table-hover">
<tr>
<th>#</th>
<th>消费方式</th>
<th>金额</th>
<th>优惠金额</th>
<th>实际支付</th>
<th>状态</th>
</tr>
{loop $paycenter_records $record}
<tr>
<td>{$record['id']}</td>
<td>
{if $record['cash'] == '0'}
<span class="label label-info">会员卡支付</span>
{elseif !empty($record['cash']) && $record['credit2'] == '0' && $record['credit1'] == '0'}
<span class="label label-success">微信支付</span>
{elseif !empty($record['cash']) && (!empty($record['credit2']) || !empty($record['credit1']))}
<span class="label label-warning">混合支付</span>
{/if}
</td>
<td>{$record['fee']}</td>
<td>{php echo $record['fee'] - $record['final_fee']}</td>
<td>{$record['final_fee']}</td>
<td>
{if $record['status'] == '1'}
<span class="label label-primary">支付成功</span>
{else}
<span class="label label-danger">支付失败</span>
{/if}
</td>
</tr>
{/loop}
</table>
</div>
</div>
</div>
{/if}
{if !empty($card_set)}
<div ng-show="micro.config.body && micro.config.fee" class="modal fade" id="mcard-pay" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="form-group">
<label>会员卡卡号</label>
<input type="text" name="cardsn" class="form-control js-input" ng-model="micro.config.cardsn" tabindex="1" placeholder="请输入11位会员卡卡号">
</div>
<div ng-show="micro.config.card_error" ng-bind="micro.config.card_error" class="text-danger"></div>
<div ng-show="micro.config.loading" ng-bind="micro.config.loading"></div>
<div ng-show="micro.config.member.uid > 0">
<table class="table table-hover table-bordered" ng-show="micro.config.member.uid">
<tr>
<td colspan="4" style="text-align:center"><h4>{{micro.config.cardsn}}</h4></td>
</tr>
<tr>
<th width="100">姓名</th>
<td>{{micro.config.member.realname}}</td>
<th>手机号</th>
<td>{{micro.config.member.mobile}}</td>
</tr>
<tr>
<th>积分</th>
<td>{{micro.config.member.credit1}}</td>
<th>余额</th>
<td>{{micro.config.member.credit2}}</td>
</tr>
<tr>
<th>会员等级</th>
<td>{{micro.config.member.groupname}}</td>
<th>优惠信息</th>
<td>{{micro.config.member.discount_cn}}</td>
</tr>
</table>
<div class="form-group" ng-if="micro.config.member.uid > 0">
<label>实际支付金额</label>
<input type="text" name="fact_fee" class="form-control" ng-model="micro.config.fact_fee" readonly>
</div>
<div ng-if="micro.config.fact_fee > 0">
<div class="form-group">
<label>支付方式</label>
<table class="table table-hover table-bordered">
<tr>
<td>
<label class="checkbox-inline">余额支付</label>
<div class="input-group">
<input type="text" class="form-control js-input" tabindex="2" name="credit2" ng-model="micro.config.credit2"/>
<span class="input-group-addon">元</span>
</div>
</td>
</tr>
<tr ng-if="micro.config.card.offset_rate > 0">
<td>
<label class="checkbox-inline">积分抵现</label>
<div class="input-group">
<span class="input-group-addon">当前积分可抵扣<span>{{micro.config.member.credit1 / micro.config.card.offset_rate | credit1_num}}</span>元,选择抵扣</span>
<input type="text" tabindex="3" class="form-control js-input" id="offset_money" ng-model="micro.config.offset_money"/>
<span class="input-group-addon">元</span>
</div>
</td>
</tr>
</table>
</div>
<div class="form-group" ng-if="micro.config.is_showCode == '1'">
<label>微信需支付</label>
<div class="input-group">
<input type="text" name="cash" class="form-control" ng-model="micro.last_money" readonly><span class="input-group-addon">元</span>
</div>
<label>刷卡授权码</label>
<input type="text" name="code" class="form-control js-input" ng-model="micro.config.code" tabindex="4" placeholder="微信刷卡支付授权码(请链接扫码枪扫码)">
</div>
<div class="form-group">
<div ng-show="micro.last_money >= 0">
应支付<span ng-bind="micro.config.fact_fee"></span>元,余额抵扣<span ng-bind="micro.config.credit2"></span>元,还需支付<span ng-bind="micro.last_money"></span>元.
</div>
<div ng-show="micro.last_money < 0">
超额支付
</div>
</div>
</div>
</div>
<div class="form-group text-right" ng-show="micro.config.member.uid > 0">
<a class="btn btn-primary js-mc-pay" id="micro-submit" ng-click="micro.submit()" ng-disabled="micro.last_money < 0">确认收款</a>
<a class="btn btn-success" id="micro-query" ng-show="micro.show_query == 1" ng-click="micro.query()">查询支付情况</a>
</div>
</div>
</div>
</div>
</div>
{/if}
</div>
<script>
$(function(){
angular.module('paycenterApp').value('config', {
'card_set_str' : '{$card_set_str}',
'card_check_url' : '{php echo $this->createWeburl('paycenter', array('op' => 'check'))}',
'pay_url' : '{php echo $this->createWeburl('paycenter', array('op' => ''))}',
'query_url' : '{php echo $this->createWeburl('paycenter', array('op' => 'query'))}',
'checkpay_url' : '{php echo $this->createWeburl('paycenter', array('op' => 'checkpay'))}',
'redirect_url' : '{php echo $this->createWeburl('paycenter')}'
});
angular.bootstrap(document, ['paycenterApp']);
});
</script>
{template 'common/footer'}