Commit 7b8e5cef by Huang Linyu

提交用户信息页面

parent f942ea19
Showing with 157 additions and 0 deletions
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<title>销售业绩提交</title>
<style>
*{
box-sizing: border-box
}
body, html {
padding: 0;
margin: 0;
}
.upload_file,.upload_success{
display: none
}
.upload_success{
color: green;
}
.upload_file{
color:red;
}
section{
padding: 0 10px;
}
.title{
font-size: 20px;
font-weight: 600;
padding: 10px 0;
}
.label{
line-height: 30px;
height: 30px;
font-size: 14px;
color: #ababab;
}
input,select{
width: 100%;
line-height: 40px;
height: 40px;
border: 1px solid #cdcdcd;
padding: 0 10px
}
#uploadInput{
padding: 20px;
line-height: unset;
height: unset;
background: #cdcdcd
}
button{
background: #6994FF;
width: 100%;
line-height: 40px;
height: 40px;
text-align: center;
color: #ffffff;
font-size: 18px;
margin: 10px 0;
border-radius: 5px
}
</style>
</head>
<body>
<section>
<div class="top">
<div class="title">
销售业绩提交
</div>
<div style="color:red">请务必上传以下真实信息,否则业绩审核将无法通过!!!!!</div>
<div class="label">客户姓名</div>
<div><input type="text" id="username"></div>
<div class="label">客户手机号</div>
<div><input type="text" id="userPhone"></div>
<div class="label">客户性别</div>
<div>
<select id="userGender">
<option value="M"></option>
<option value="F"></option>
</select>
<div class="label">上传支付凭证</div>
<div>
<form enctype="multipart/form-data" id="uploadForm">
<input name="files" id="uploadInput" accept="image/*t" type="file" />
</form>
<div class="upload_file">上传失败</div>
<div class="upload_success">上传成功</div>
<button type="button" onclick="uploadFiles()"> 上传 </button>
</div>
<div class="label">销售手机号</div>
<div><input type="text" id="phone"></div>
</div>
<div>
<button onclick="submitInfo()">提交</button>
</div>
</section>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script>
var img = null;
function uploadFiles() {
//获取上传文件的DOM对象
let form = document.getElementById('uploadForm')
//实例化表单数据对象,并将form对象作为入参传入
let formData = new FormData(form)
//使用append方法添加key/value
// formData.append('name', 'file')
$.ajax({
url: "/fun-golf-mobile/v1/salesperson/payImage/2",
type: "post",
data: formData,
processData: false,
contentType: false,
success: function (res) {
var data = res.body
if (/(jpg|png|jpeg)/.test(data.ext)) {
$('.upload_fail').css('display', 'none')
$('.upload_success').css('display', 'block')
img = 'http://img.iwanoutdoor.com' + data.imagePath
}
},
error: function () {
$('.upload_success').css('display', 'none')
$('.upload_fail').css('display', 'block')
},
dataType: "json"
})
}
function submitInfo() {
if (!img) {
alert('请上传支付凭证');
return
}
var params = {
saleMobile: $('#userPhone').val(),
customerName: $('#username').val(),
customerMobile: $('#phone').val(),
picUrl: img,
sex: $('#userGender').val(),
}
$.ajax({
url: '/fun-golf-mobile/activeCustomer/insertOne',
type: 'POST',
contentType: "application/json;charset=utf-8;",
data: JSON.stringify(params)
})
}
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment