deit_info.html 3.3 KB
<!doctype html>
<html lang="en" style="font-size: 100px">
<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">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_724267_hizrwxnkr3j.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/style.css">
    <!--<script type="text/javascript" src="__TMPL__/public/assets/js/fontsize.js"></script>-->
    <script type="text/javascript" src="__TMPL__/public/assets/js/base.js"></script>
    <title>修改个人资料</title>
</head>
<body>
<div class="container">
    <div class="deit_top">
        修改个人信息
    </div>
    <div class="re_item deit_infoitem">
        <div class="item myinfo_item">
            <div class="item_name">姓名</div>
            <div class="item_input"><input type="text" value="{$list.name}" placeholder="请填写姓名" class="name"></div>
        </div>
        <div class="item myinfo_item">
            <div class="item_name">手机号</div>
            <div class="item_input" style="color: #B2B2B2;"><input type="text" value="{$list.tel}" class="tel" readonly style="color: #B2B2B2;"></div>

        </div>
        <div class="item myinfo_item">
            <div class="item_name">微信</div>
            <div class="item_input"><input type="text" value="{$list.wx}" placeholder="请输入您的微信号" class="wx"></div>

        </div>
        <div class="item myinfo_item">
            <div class="item_name">钱包地址</div>
            <div class="item_input" ><input type="text" value="{$list.wallet}" readonly class="play" style="color: #B2B2B2;"></div>

        </div>
    </div>
    <div class="re_btn myinfo_btn btn_yes">完成</div>
    <div class="re_btn myinfo_btn btn_return">返回</div>
    <div id="toast" style="display: none;">
        <div class="weui-mask_transparent"></div>
        <div class="weui-toast">
            <i class="weui-icon-success-no-circle weui-icon_toast"></i>
            <p class="weui-toast__content">已完成</p>
        </div>
    </div>
</div>

<script src="__TMPL__/public/assets/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/assets/js/common.js" type="text/javascript" charset="utf-8"></script>
</body>
<script>
    $('.btn_yes').click(function () {
        var name = $(".name").val();
        var wx = $(".wx").val();
        var user_id = "{$Think.session.user_id}";
        $.ajax({
            type: "POST",
            url: "{:url('Index/changeUser')}",
            data: {
                "name": name,
                "wx": wx,
                "id": user_id,
            },
            success: function (data) {
                console.log(data)
                if (data.code == 1) {
                    alert(data.msg);
                    location.href = "{:url('Index/user')}";
                }
                else {
                    alert(data.msg);
                }
            },
            error: function () {
                alert("网络错误");
            }
        })
    })


    $('.btn_return').click(function () {
        var url  ="{:url('Index/user')}";
        location.href = url;
    })
</script>
</html>