Example #1
0
def details(member_id):
    deposit_form = DepositForm()
    change_password_form = ChangePasswordForm()
    change_security_form = ChangeSecurityForm()
    change_profile_form = ChangeProfileForm()
    payment_form = PaymentForm()
    data = Api.get('/admin/member/detail/' + urllib2.quote(member_id))
    change_security_form.security_id.data = data['id']
    change_password_form.password_id.data = data['id']
    change_profile_form.id.data = data['id']
    deposit_form.id.data = data['assets']['id']
    payment_form.user_id.data = data['id']
    change_profile_form.mobile.data = data['mobile']
    change_profile_form.name.data = data['name']
    change_profile_form.wechat.data = data['wechat']
    payment_list = Api.get('/admin/payment/list',
                           {'user_id': data['id']})['objects']

    payment_dic = {}
    payment_flag = [
        'bank_payment', 'wechat_payment', 'alipay_payment', 'usdt_payment'
    ]
    for item in payment_list:
        payment_dic[payment_flag[item['type']]] = item

    return render_template('member/details.html',
                           data=data,
                           payment_dic=payment_dic,
                           payment_form=payment_form,
                           change_password_form=change_password_form,
                           change_profile_form=change_profile_form,
                           change_security_form=change_security_form,
                           deposit_form=deposit_form)