mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-24 03:35:59 +08:00
finish create payment
This commit is contained in:
27
core/static/script/admin/index.coffee
Normal file
27
core/static/script/admin/index.coffee
Normal file
@@ -0,0 +1,27 @@
|
||||
$ ->
|
||||
$(document).ajaxError (e, reply) ->
|
||||
if reply.status is 400
|
||||
error = reply.responseJSON.error
|
||||
ErrorHandle.flushInfo 'alert', error
|
||||
$.ajaxSetup {
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
}
|
||||
|
||||
#充值记录
|
||||
$ '.create-payment'
|
||||
.on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
$('#account_id').html $(this).closest('tr').data 'id'
|
||||
$('#crate_payment_modal').modal 'show'
|
||||
|
||||
$ '#create_payment_button'
|
||||
.on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
$.post '/admin/create_payment/', JSON.stringify {
|
||||
account_id: ($ '#account_id').html()
|
||||
type: 'taobao'
|
||||
amount: ($ '#amont').val()
|
||||
order_id: ($ '#order_id').val()
|
||||
}
|
||||
.success ->
|
||||
location.reload()
|
||||
@@ -1,6 +1,5 @@
|
||||
$ ->
|
||||
$(document).ajaxError (e, reply) ->
|
||||
console.log reply
|
||||
if reply.status is 400
|
||||
error = reply.responseJSON.error
|
||||
ErrorHandle.flushInfo 'alert', error
|
||||
|
||||
@@ -6,7 +6,7 @@ prepend head
|
||||
block main
|
||||
header= t('admin.admin_panel')
|
||||
|
||||
.modal.fade#crate_payment
|
||||
.modal.fade#crate_payment_modal
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
.modal-header
|
||||
@@ -14,6 +14,10 @@ block main
|
||||
h4.modal-title 创建充值记录
|
||||
.modal-body
|
||||
form.form-horizontal(method='post', role='form')
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label(for='account_id') ID
|
||||
.col-sm-5
|
||||
p#account_id.form-control-static
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label(for='amont') 金额
|
||||
.col-sm-5
|
||||
@@ -25,7 +29,7 @@ block main
|
||||
|
||||
.modal-footer
|
||||
button.btn.btn-danger(type='button', data-dismiss='modal') 关闭
|
||||
button.btn.btn-success(type='button') 创建
|
||||
button.btn.btn-success#create_payment_button(type='button') 创建
|
||||
|
||||
table.table.table-hover
|
||||
thead
|
||||
@@ -37,7 +41,7 @@ block main
|
||||
th 操作
|
||||
tbody
|
||||
for account in accounts
|
||||
tr
|
||||
tr(data-id='#{account._id}')
|
||||
td= account.username
|
||||
td= account.email
|
||||
td= account.attribute.plans.join(', ')
|
||||
@@ -49,8 +53,11 @@ block main
|
||||
spann.caret
|
||||
ul.dropdown-menu
|
||||
li
|
||||
a(href='#', data-toggle='modal', data-target='#crate_payment') 创建充值记录
|
||||
a.create-payment(href='#') 创建充值记录
|
||||
|
||||
prepend sidebar
|
||||
.row
|
||||
a.btn.btn-lg.btn-success(href='/admin/ticket/')= t('ticket.ticket_list')
|
||||
|
||||
append footer
|
||||
script(src='/script/admin/index.js')
|
||||
Reference in New Issue
Block a user