Commit 3057d888 by lixiaofeng

增加修改字段

1 parent 929874d9
<!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')
$('.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\":\"网点1\"}",
infos:"[{\"fieldName\":"+ name +",\"fieldValue\":"+ value +"}]"
},
success:function (data) {
console.log(data)
}
})
})
$('.back').on('click',function () {
window.history.back()
})
</script>
</html>
\ No newline at end of file
...@@ -133,6 +133,7 @@ ...@@ -133,6 +133,7 @@
<!--<hr class="layui-bg-gray"><br>--> <!--<hr class="layui-bg-gray"><br>-->
<!--<p style=" margin:5px; text-align:center;"><input type="submit" value="保 存" id="submit"/></p>--> <!--<p style=" margin:5px; text-align:center;"><input type="submit" value="保 存" id="submit"/></p>-->
</form> </form>
<div></div>
</body> </body>
<script src="./src/js/saasService.js"></script> <script src="./src/js/saasService.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
...@@ -156,8 +157,8 @@ ...@@ -156,8 +157,8 @@
for(var i=0;i<msg.length;i++){ for(var i=0;i<msg.length;i++){
// console.log(msg[i]) // console.log(msg[i])
var num = i+1 var num = i+1
str += "<input type=\"text\" name=\"key0"+num+"\" class=\"key\" value="+(msg[i].fieldName?msg[i].fieldName:'')+"><br>\n" + str += "<input type=\"text\" readonly name=\"key0"+num+"\" class=\"key\" value="+(msg[i].fieldName?msg[i].fieldName:'')+"><br>\n" +
"\t\t\t<input type=\"text\" name=\"value0"+num+"\" class=\"value\" value="+(msg[i].fieldValue?msg[i].fieldValue:'')+"><br>\n" + "\t\t\t<input type=\"text\" readonly name=\"value0"+num+"\" class=\"value change\" change='change' value="+(msg[i].fieldValue?msg[i].fieldValue:'')+"><br>\n" +
"\t\t\t\n" + "\t\t\t\n" +
"\t\t\t<hr class=\"layui-bg-gray\">" "\t\t\t<hr class=\"layui-bg-gray\">"
} }
...@@ -180,5 +181,18 @@ ...@@ -180,5 +181,18 @@
window.location.href = './uploadImage.html' window.location.href = './uploadImage.html'
} }
}) })
$('#form').on('click',function (e) {
// console.log($(e.target).attr('change') == 'change')
if($(e.target).attr('change') == 'change'){
console.log($(e.target))
console.log($(e.target).attr('name').substring(5))
var num = $(e.target).attr('name').substring(5)
console.log($("input[name=key"+num+"]").val())
var name = $("input[name=key"+num+"]").val()
localStorage.setItem('name',name)
location.href = './changeValue.html'
}
})
</script> </script>
</html> </html>
@charset "utf-8";
*{
margin:0;
padding: 0;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
img{
border: 0px;
}
body {
/*line-height: 1;*/
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
input[type="number"]{-moz-appearance:textfield;}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{
appearance:none;
-moz-appearance:none;
-webkit-appearance:none;
margin: 0;
}
.hide{
display: none !important;
}
label{
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
i,b{
font-style: normal;
font-weight: normal;
}
button,
input {
margin: 0;
-webkit-box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
word-wrap: break-word;
word-break: break-all;
padding: 0;
margin: 0;
}
button, input, select, textarea {
outline: 0;
}
textarea, input {
resize: none;
outline: 0
}
button {
outline: none;
border: none;
background: none;
}
button, html input[type=button], input[type=submit] {
-webkit-appearance: none;
cursor: pointer;
outline: none;
border: none;
}
*:not(input,textarea) {
-webkit-touch-callout: inherit;
-webkit-user-select: auto
}
a {
text-decoration: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
color: #424954;
cursor: pointer;
}
body {
width: 100%;
font-family: Hiragino Sans GB, Arial, Helvetica, "微软雅黑", sans-serif;
font-size: 16px;
-webkit-touch-callout: inherit;
/*-webkit-user-select: auto;*/
background:#f6f6f6;
color: #424954;
/*-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;*/
}
dt, dd {
display: inline-block
}
img {
vertical-align:middle;
}
textarea {
resize: none;
-webkit-appearance: none
}
ul, ol, li {
list-style: none
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal
}
a:hover{
text-decoration: underline;
}
.left{
float: left;
}
.right{
float: right;
}
.boverflow {
overflow:hidden;
}
...@@ -125,11 +125,7 @@ $(function(){ ...@@ -125,11 +125,7 @@ $(function(){
} }
return arrFiles; return arrFiles;
} }
}) })
/** /**
* 返回上一页 * 返回上一页
*/ */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!