代码修改后的版本,全部提交
This commit is contained in:
616
Mtxfw.VipSite/mobile/appzjfws.html
Normal file
616
Mtxfw.VipSite/mobile/appzjfws.html
Normal file
@@ -0,0 +1,616 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
|
||||
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
|
||||
<title>申请镇街服务商</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/api.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/css/content.css" />
|
||||
<script type="text/javascript" src="/scripts/jquery-3.4.1.min.js"></script>
|
||||
<script type="text/javascript" src="/script/main.js?t=0"></script>
|
||||
<script type="text/javascript" src="/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="/Scripts/long.js"></script>
|
||||
<script type="text/javascript" src="/script/moment.js"></script>
|
||||
<script type="text/javascript" src="/script/area.js?t=0"></script>
|
||||
<script type="text/javascript" src="/script/api.js"></script>
|
||||
<script src="/Scripts/qiniu.min.js" type="text/javascript"></script>
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.pullDown {
|
||||
position: absolute;
|
||||
top: -1.25rem;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pullUp {
|
||||
position: absolute;
|
||||
bottom: -1.25rem;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pullDown.loading, .pullUp.loading, .pullDown.refresh, .pullUp.refresh {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
select {
|
||||
color: #848484;
|
||||
width: 18em;
|
||||
}
|
||||
|
||||
.dbtnbox {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.dbtnbox input[type='button'] {
|
||||
height: 3.5em;
|
||||
line-height: 3.5em;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.uploadpic_btn {
|
||||
position: absolute;
|
||||
width: 5em;
|
||||
height: 5em;
|
||||
right: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity=0);
|
||||
}
|
||||
|
||||
.layer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layer img {
|
||||
width: auto;
|
||||
max-width: 20em;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var userId = null;
|
||||
var LoginId = null;
|
||||
var opentimes = null;
|
||||
var sInterval0 = null;
|
||||
var address = null;
|
||||
var uploading = 0, ifupuser = 0;
|
||||
var image0 = "", image1 = "", image2 = "", image3 = "", image4 = "";
|
||||
var myScroll = null;
|
||||
var pullDown = 1; // 下拉刷新避免多次执行
|
||||
var pullUp = 1; // 上拉加载避免多次执行
|
||||
var downHeight = 0;
|
||||
var upHeight = 0;
|
||||
var isload = true;//设置是否终止滚动加载
|
||||
var curScrollHeight = 0;//当前滚动位置
|
||||
var curCount = 1;//计数器,防止滚动时重复执行加载下一页
|
||||
|
||||
$(document).ready(function () {
|
||||
userId = getlocalStorage("userId");
|
||||
LoginId = getlocalStorage("LoginId");
|
||||
opentimes = setInterval(function () {
|
||||
var selectqydatas = getlocalStorage("address_selectqy_datas");
|
||||
if (selectqydatas != null) {
|
||||
var adatas = selectqydatas.split(",");
|
||||
showaddress(adatas[0], adatas[1], adatas[2], adatas[3], adatas[4])
|
||||
clearlocalStorage("address_selectqy_datas");
|
||||
}
|
||||
|
||||
}, 1000);
|
||||
|
||||
var ifapp = 0;
|
||||
var aifapp = getlocalStorage("ifapp");
|
||||
if (aifapp != null) {
|
||||
ifapp = aifapp;
|
||||
}
|
||||
|
||||
|
||||
rdata();
|
||||
|
||||
});
|
||||
function rdata() {
|
||||
userId = getlocalStorage("userId");
|
||||
LoginId = getlocalStorage("LoginId");
|
||||
$(".ajaxLoader").removeClass("uhide");
|
||||
var userinfo = getlocalStorage("userinfo");
|
||||
var userdata = JSON.parse(userinfo);
|
||||
$("#txtTel").val(userdata.Phone);
|
||||
$(".ajaxLoader").addClass("uhide");
|
||||
|
||||
|
||||
}
|
||||
function getcity() {
|
||||
var showqy = $("#Province").val() + "," + $("#City").val() + "," + $("#County").val() + "," + $("#IFFill").val() + "," + $("#Tradingarea").val();
|
||||
setlocalStorage("showqy", showqy);
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: false,
|
||||
content: "address_selectqy.html",
|
||||
area: ['100%', '100%']
|
||||
|
||||
});
|
||||
}
|
||||
function showaddress(Province, City, County, IFFill, Tradingarea) {
|
||||
$('#Province').val(Province);
|
||||
$('#City').val(City);
|
||||
$('#County').val(County);
|
||||
$('#IFFill').val(IFFill);
|
||||
$('#Tradingarea').val(Tradingarea);
|
||||
$('#area').val(getname(Province, City, County, IFFill, Tradingarea));
|
||||
}
|
||||
|
||||
function onsave() {
|
||||
var tel = $("#txtTel").val();
|
||||
var province = $("#Province").val();
|
||||
var city = $("#City").val();
|
||||
var county = $("#County").val();
|
||||
var IFFill = fTrim($('#IFFill').val());
|
||||
var Tradingarea = fTrim($('#Tradingarea').val());
|
||||
var address = $("#txtAAddress").val();
|
||||
|
||||
var ifb = true;
|
||||
|
||||
|
||||
if (ifb) {
|
||||
if (tel == "") {
|
||||
tishi3("联系电话不能为空!");
|
||||
$("#txtTel").focus();
|
||||
ifb = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ifb) {
|
||||
if (province == "" || city == "") {
|
||||
tishi3("所在地区未选择!");
|
||||
ifb = false;
|
||||
}
|
||||
}
|
||||
if (ifb) {
|
||||
if (IFFill == "-1") {
|
||||
if (Tradingarea == "") {
|
||||
tishi3("街道或乡镇不能为空!");
|
||||
$("#Tradingarea").focus();
|
||||
ifb = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ifb) {
|
||||
if (address == "") {
|
||||
tishi3("详细地址不能为空!");
|
||||
$("#txtAAddress").focus();
|
||||
ifb = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ifb) {
|
||||
if ($("#savebtn").val() != "提交") {
|
||||
ifb = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ifb) {
|
||||
$("#savebtn").attr("disabled");
|
||||
$("#savebtn").val("请稍候...");
|
||||
|
||||
try {
|
||||
var datas = {
|
||||
action: "appzjfws",
|
||||
userId: userId,
|
||||
LoginId: LoginId,
|
||||
tel: tel,
|
||||
province: province,
|
||||
city: city,
|
||||
county: county,
|
||||
address: address,
|
||||
IFFill: IFFill,
|
||||
Tradingarea: Tradingarea
|
||||
|
||||
};
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "/apiajax.ashx?ifweb=1",
|
||||
data: datas,
|
||||
dataType: "json",
|
||||
error: function (xhr) {
|
||||
tishi3("发生错误:" + JSON.stringify(xhr));
|
||||
},
|
||||
success: function (data) {
|
||||
|
||||
$("#savebtn").removeAttr("disabled");
|
||||
$("#savebtn").val("提交");
|
||||
if (data) {
|
||||
if (data.status == 1) {
|
||||
setlocalStorage("userinfo", JSON.stringify(data.userInfo));
|
||||
setlocalStorage("myrefresh", 1);
|
||||
layer.confirm("您的申请已经提交成功了,请等待审核!", {
|
||||
title: "申请提示",
|
||||
btn: ['确认'] //按钮
|
||||
}, function () {
|
||||
closeWin();
|
||||
});
|
||||
|
||||
} if (data.status == 0) {
|
||||
tishi3(data.msg);
|
||||
}
|
||||
} else {
|
||||
tishi3('网络异常,请稍后重试');
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
tishi3(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function dpreview(t) {
|
||||
if (ifupuser == -1) {
|
||||
|
||||
var file = document.getElementById("uploadpic" + t).files[0];
|
||||
|
||||
var myForm = document.getElementById("myForm");
|
||||
if (t == 1) {
|
||||
myForm = document.getElementById("myForm1");
|
||||
}
|
||||
if (t == 2) {
|
||||
myForm = document.getElementById("myForm3");
|
||||
}
|
||||
if (t == 3) {
|
||||
myForm = document.getElementById("myForm5");
|
||||
}
|
||||
if (t == 4) {
|
||||
myForm = document.getElementById("myForm7");
|
||||
}
|
||||
$(myForm).find("img").attr("src", "../image/loading.gif");
|
||||
/*try {
|
||||
// 七牛云uptoken
|
||||
var token = upToken;
|
||||
|
||||
// config信息 object 参数可选
|
||||
var config = {
|
||||
//表示是否使用 cdn 加速域名,为布尔值,true 表示使用,默认为 false。
|
||||
useCdnDomain: false,
|
||||
// 是否禁用日志报告,为布尔值,默认为 false。
|
||||
disableStatisticsReport: true,
|
||||
// 选择上传域名区域;当为 null 或 undefined 时,自动分析上传域名区域。
|
||||
retryCount: 3,
|
||||
// 选择上传域名区域;当为 null 或 undefined 时,自动分析上传域名区域。
|
||||
region: "",
|
||||
// 是否开启 MD5 校验,为布尔值;在断点续传时,开启 MD5 校验会将已上传的分片与当前分片进行 MD5 值比对,若不一致,则重传该分片,避免使用错误的分片。读取分片内容并计算 MD5 需要花费一定的时间,因此会稍微增加断点续传时的耗时,默认为 false,不开启。
|
||||
checkByMD5: false,
|
||||
// 分片上传时每片的大小
|
||||
chunkSize: 4,
|
||||
};
|
||||
|
||||
// putExtra
|
||||
var putExtra = {
|
||||
customVars: {}
|
||||
};
|
||||
|
||||
// 设置key key为上传后的文件名 自定义即可
|
||||
var name = file.name;
|
||||
var key = "ksd2023/userid_" + userId + "_" + judgetime1() + name.substring(name.lastIndexOf("."));
|
||||
|
||||
const observable = qiniu.upload(file, key, token, putExtra, config)
|
||||
// 开始上传
|
||||
observable.subscribe({
|
||||
next: (result) => {
|
||||
//alert(JSON.stringify(result));
|
||||
//上传进度
|
||||
//if (response.total.percent > 0) {
|
||||
|
||||
// }
|
||||
},
|
||||
error: (err) => {
|
||||
//上传失败
|
||||
|
||||
$(myForm).find("img").attr("src", "../image/add1.png");
|
||||
},
|
||||
complete: (res) => {
|
||||
//上传成功
|
||||
//alert(JSON.stringify()+"|");
|
||||
$(myForm).find("img").attr("src", "https://fv.cibeibei.cn/" + key);
|
||||
if (t == 4) {
|
||||
image4 = "https://fv.cibeibei.cn/" + key;
|
||||
} else if (t == 3) {
|
||||
image3 = "https://fv.cibeibei.cn/" + key;
|
||||
} else if (t == 2) {
|
||||
image2 = "https://fv.cibeibei.cn/" + key;
|
||||
} else if (t == 1) {
|
||||
image1 = "https://fv.cibeibei.cn/" + key;
|
||||
} else {
|
||||
image0 = "https://fv.cibeibei.cn/" + key;
|
||||
}
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
}*/
|
||||
var formdata0 = new FormData(myForm);
|
||||
formdata0.append("action", "uploadImage");
|
||||
formdata0.append("userId", userId);
|
||||
formdata0.append("LoginId", LoginId);
|
||||
formdata0.append("uploadpic", file);
|
||||
|
||||
uploading = 1;
|
||||
$(myForm).find("img").attr("src", "../image/loading.gif");
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/apiajax.ashx?ifweb=1",
|
||||
data: formdata0,
|
||||
dataType: 'JSON',
|
||||
cache: false, // 不缓存
|
||||
processData: false, // jQuery不要去处理发送的数据
|
||||
contentType: false, // jQuery不要去设置Content-Type请求头
|
||||
success: function (data) {
|
||||
tishi2close();
|
||||
uploading = 0;
|
||||
if (data.status == 1) {
|
||||
var thumb = data.url[0];
|
||||
var image = data.url[1];
|
||||
$(myForm).find("img").attr("src", thumb);
|
||||
if (t == 4) {
|
||||
image4 = image;
|
||||
} else if (t == 3) {
|
||||
image3 = image;
|
||||
} else if (t == 2) {
|
||||
image2 = image;
|
||||
} else if (t == 1) {
|
||||
image1 = image;
|
||||
} else {
|
||||
image0 = image;
|
||||
}
|
||||
|
||||
} else {
|
||||
$(myForm).find("img").attr("src", "../image/add1.png");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
function dpreview0(t) {
|
||||
|
||||
if (ifupuser == -1) {
|
||||
var myForm = document.getElementById("myForm0");
|
||||
if (t == 1) {
|
||||
myForm = document.getElementById("myForm2");
|
||||
}
|
||||
if (t == 2) {
|
||||
myForm = document.getElementById("myForm4");
|
||||
}
|
||||
if (t == 3) {
|
||||
myForm = document.getElementById("myForm6");
|
||||
}
|
||||
if (t == 4) {
|
||||
myForm = document.getElementById("myForm8");
|
||||
}
|
||||
$(myForm).find("img").attr("src", "../image/loading.gif");
|
||||
try {
|
||||
uploading = 1;
|
||||
api.getPicture({
|
||||
sourceType: 'album',
|
||||
encodingType: 'png',
|
||||
mediaValue: 'pic',
|
||||
destinationType: 'url',
|
||||
allowEdit: false,
|
||||
quality: 100,
|
||||
saveToPhotoAlbum: false
|
||||
}, function (ret, err) {
|
||||
if (ret) {
|
||||
$(myForm).find("img").attr("src", "../image/loading.gif");
|
||||
/*var img_url = ret.data;
|
||||
var filetype = img_url.substring(img_url.lastIndexOf("."));
|
||||
var filename = "ksd2023/userid_" + userId + "_" + judgetime1(new Date()) + filetype;
|
||||
var qiniu = api.require('qiniuKodo');
|
||||
qiniu.putObject({
|
||||
token: upToken,
|
||||
objectKey: filename,
|
||||
filePath: img_url
|
||||
}, function (ret, err) {
|
||||
if (ret) {
|
||||
|
||||
if (ret.eventType == "onComplete") {
|
||||
$(myForm).find("img").attr("src", "https://fv.cibeibei.cn/" + filename);
|
||||
if (t == 4) {
|
||||
image4 = "https://fv.cibeibei.cn/" + filename;
|
||||
} else if (t == 3) {
|
||||
image3 = "https://fv.cibeibei.cn/" + filename;
|
||||
} else if (t == 2) {
|
||||
image2 = "https://fv.cibeibei.cn/" + filename;
|
||||
} else if (t == 1) {
|
||||
image1 = "https://fv.cibeibei.cn/" + filename;
|
||||
} else {
|
||||
image0 = "https://fv.cibeibei.cn/" + filename;
|
||||
}
|
||||
uploading = 0;
|
||||
} else if (ret.eventType == "onProgress") {
|
||||
|
||||
} else if (ret.eventType == "onError") {
|
||||
$(myForm).find("img").attr("src", "../image/add1.png");
|
||||
uploading = 0;
|
||||
|
||||
}
|
||||
}
|
||||
});*/
|
||||
api.ajax({
|
||||
url: apiurl + "/apiajax.ashx",
|
||||
method: 'post',
|
||||
contentType: "application/x-www-form-urlencoded; charset=utf-8",
|
||||
data: {
|
||||
values: { "action": "uploadImage", "userId": userId, "LoginId": LoginId, t: 0 },
|
||||
files: {
|
||||
"file1": ret.data
|
||||
}
|
||||
},
|
||||
dataType: 'json'
|
||||
},
|
||||
function (data, status) {
|
||||
if (data) {
|
||||
uploading = 0;
|
||||
if (data.status == 1) {
|
||||
var thumb = data.url[0];
|
||||
var image = data.url[1];
|
||||
$(myForm).find("img").attr("src", thumb);
|
||||
if (t == 4) {
|
||||
image4 = image;
|
||||
} else if (t == 3) {
|
||||
image3 = image;
|
||||
} else if (t == 2) {
|
||||
image2 = image;
|
||||
} else if (t == 1) {
|
||||
image1 = image;
|
||||
} else {
|
||||
image0 = image;
|
||||
}
|
||||
} else {
|
||||
$(myForm).find("img").attr("src", "../image/add1.png");
|
||||
}
|
||||
} else {
|
||||
$(myForm).find("img").attr("src", "../image/add1.png");
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
uploading = 0;
|
||||
alert(JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
} catch (errr) {
|
||||
alert(errr);
|
||||
uploading = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
function onbz() {
|
||||
if (ifupuser == -1) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: false,
|
||||
content: "bzmap.html?xcoo=" + $("#txtlongitude").val() + "&ycoo=" + $("#txtlatitude").val() + "&key=" + $("#txtAAddress").val() + "&cityid=" + $("#City").val(),
|
||||
area: ['100%', '100%']
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="wrap">
|
||||
<header>
|
||||
<div class="ub">
|
||||
<div class="nav-btn" id="nav-left" style=" margin:0; padding:0; padding-top:0.2em; min-width:3em" onclick="closeWin()">
|
||||
|
||||
<img src="../image/faifei.png" style="margin-left:0; margin-top:0em; height:1.2em;width:1.2em;" />
|
||||
|
||||
|
||||
</div>
|
||||
<h1 class="ub-f1">
|
||||
申请镇街服务商
|
||||
</h1>
|
||||
<div class="nav-btn blue" id="nav-right" style="color:#fff; margin:0; padding:0; min-width:4em; padding-right:1em;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="ub-f1" id="wrapper" style="padding:0.8em;">
|
||||
|
||||
<div class="tixin-item" style="">
|
||||
|
||||
|
||||
<div class="ub ub-ac" style="margin-bottom: .08em;">
|
||||
<div class="ub font_box" style="padding:0.8em 0em;width:5em;">
|
||||
联系电话<font color="red">*</font>
|
||||
</div>
|
||||
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
|
||||
<input type="text" id="txtTel" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ub ub-ac" style="margin-bottom: .08em; border-top: 1px solid #f1f1f1;">
|
||||
<div class="ub font_box" style="padding:0.8em 0em;width:5em;">
|
||||
所在地区<font color="red">*</font>
|
||||
</div>
|
||||
<div class="ub ub-f1 uinput11" style="" onclick="getcity()">
|
||||
<input id="area" class="ub-f1" type="text" disabled value="" style="border:0; width: 12em;background:none;" />
|
||||
<div class="ub" style="margin-right: .5em; margin-top:0.5em; width: 1.2em; height:1.2em;"><img style="width: 1.2em;" src="../image/faifeito.png" /></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ub ub-ac" style="margin-bottom: .08em;">
|
||||
<div class="ub font_box" style="padding:0.8em 0em;width:5em;">
|
||||
详细地址<font color="red">*</font>
|
||||
</div>
|
||||
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
|
||||
<input type="text" id="txtAAddress" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<input id="Province" type="hidden" />
|
||||
<input id="City" type="hidden" />
|
||||
<input id="County" type="hidden" />
|
||||
<input id="IFFill" type="hidden" />
|
||||
<input id="Tradingarea" type="hidden" />
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<footer>
|
||||
<div class="dbtnbox">
|
||||
|
||||
<input id="savebtn" type="button" class="mybtn" onclick="onsave()" value="提交">
|
||||
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
<div class="ajaxLoader ub ub-ac uhide" onclick="reload()">
|
||||
<div class="ub ub-ac ub-ver"><img src="image/load.gif" /><br>正在加载...</div>
|
||||
</div>
|
||||
<div class="layer" onclick='$(".layer").fadeOut();'>
|
||||
<img src="/images/jt.png" alt="">
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user