changeValue.html 3.54 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=750, user-scalable=no,maximum-scale=1.2, minimum-scale=0.3">
    <title>修改字段</title>
    <link rel="stylesheet" href="src/css/reset.css">
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body{
            background: #fff;
        }
        .wrap .title{
            width:100%;
            height: 80px;
            line-height: 80px;
            text-align: center;
            font-size: 32px;
            position: relative;
        }
        .wrap .title .back{
            display: block;
            width: 34px;
            height: 30px;
            position: absolute;
            top: 25px;
            left: 15px;
            background: url("src/image/btn_back.png") no-repeat 0 0;
            -webkit-background-size: 100%;
            background-size: 100%;
            -webkit-transform: scale(0.8);
            -moz-transform: scale(0.8);
            -ms-transform: scale(0.8);
            -o-transform: scale(0.8);
            transform: scale(0.8);
        }
        .wrap .title .confirm{
            display: block;
            width: 100px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            color: #fff;
            background: #27B1A4;
            font-size:24px;
            position: absolute;
            top:15px;
            right: 15px;
        }
        .wrap input{
            width: 92%;
            display: block;
            margin: 0 auto;
            padding: 10px 0;
            box-sizing: border-box;
            border: none;
            border-bottom: 2px solid #27B1A4;
            font-size: 24px;
        }
        p{
            font-size: 28px;
            box-sizing: border-box;
            padding: 0 4%;
            color:#c1c1c1;
            margin-top:5px;
        }
    </style>
</head>
<body>
    <div class="wrap">
        <div class="title">
            <span class="back"></span>
            修改字段
            <span class="confirm">保存</span>
        </div>
        <input type="text" />
        <p>字段</p>
    </div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="src/js/saasService.js"></script>
<script src="src/js/main.js"></script>
<script>
    var name = localStorage.getItem('name')
    var phone = localStorage.getItem('phone')
    $('.confirm').on('click',function (e) {
        var value = $('input').val()
        if(!value){
            alert('请输入字段!');
            return
        }
        // $.ajax({
        //     type: "POST",
        //     url:saas.customUrl + "/point/updatePoint",
        //     data:{
        //         custom_id:"{\"fieldName\":\"手机号\",\"fieldValue\":\""+phone+"\"}",
        //         infos:"[{\"fieldName\":"+ name +",\"fieldValue\":"+ value +"}]"
        //     },
        //     success:function (data) {
        //         console.log(data)
        //     }
        // })

        var method = "/point/updatePoint";
        var parameter = {
            custom_id:"{\"fieldName\":\"手机号\",\"fieldValue\":\""+phone+"\"}",
            infos:"[{\"fieldName\":"+ name +",\"fieldValue\":"+ value +"}]"
        };
        saas.customHttpRequest(method,parameter,function (data) {

            if(data.code == "s001"){
                alert('字段修改成功');
            }
        },function (error) {

        });
    })
    $('.back').on('click',function () {
        window.history.back()
    })
</script>
</html>