mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-01 22:18:54 +08:00
42 lines
1.2 KiB
CoffeeScript
42 lines
1.2 KiB
CoffeeScript
$ ->
|
|
$('.action-create-payment').click ->
|
|
$('#account_id').html $(@).parents('tr').data 'id'
|
|
$('#create-payment-modal').modal 'show'
|
|
|
|
$('.action-delete-account').click (e) ->
|
|
e.preventDefault()
|
|
$.post '/admin/delete_account/', JSON.stringify
|
|
account_id: $(@).parents('tr').data 'id'
|
|
.success ->
|
|
location.reload()
|
|
|
|
$('.action-disable-site').click (e) ->
|
|
e.preventDefault()
|
|
$.post '/admin/update_site/', JSON.stringify
|
|
site_id: $(@).parents('tr').data 'id'
|
|
is_enable: false
|
|
.success ->
|
|
location.reload()
|
|
|
|
$('.action-enable-site').click (e) ->
|
|
e.preventDefault()
|
|
$.post '/admin/update_site/', JSON.stringify
|
|
site_id: $(@).parents('tr').data 'id'
|
|
is_enable: true
|
|
.success ->
|
|
location.reload()
|
|
|
|
$('#create-payment-modal .action-create-payment').click ->
|
|
$.post '/admin/create_payment/', JSON.stringify
|
|
account_id: $('#account_id').html()
|
|
type: 'taobao'
|
|
amount: $('#amont').val()
|
|
order_id: $('#order_id').val()
|
|
.fail (jqXHR) ->
|
|
if jqXHR.responseJSON?.error
|
|
alert jqXHR.responseJSON.error
|
|
else
|
|
alert jqXHR.statusText
|
|
.success ->
|
|
location.reload()
|