changeValue.html
3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!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>