Files
g.hnyhua.cn/Mtxfw.VipSite/mobile/mybusiness_sjzl.html

1488 lines
63 KiB
HTML
Raw Normal View History

<!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">
* {
margin: 0;
padding: 0;
}
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: #000;
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%);
}
.signature_box {
width: 100%;
height: 80.3vh;
border: solid 1px #f0514d;
}
.signature_box .empty_canvas {
display: block;
height: 100%;
width: 100%;
}
</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, step = 0, ifedit=0;
var ylmoney = 0, ylmoney0 = 0;
var image0 = "", image1 = "", image2 = "", image3 = "", image4 = "", image5 = "", upToken = "";
var clsid = "";
var name = "";
var aylmoney = "";
var number = "";
var dgzh = "";
var frname = "";
var fridcard = "";
var tel = "";
var province = "";
var city = "";
var county = "";
var IFFill = "";
var Agentrading = "";
var address = "";
var longitude = "";
var latitude = "";
var fwbody = "";
var accountname = "";
var bankname = "";
var bankcard = "";
var bankaddress = "";
var writeCanvas = null;
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");
}
var qydatas = getlocalStorage("bzmap_position");
if (qydatas != null) {
var adata = qydatas.split("|");
$("#txtlongitude").val(adata[0]);
$("#txtlatitude").val(adata[1]);
clearlocalStorage("bzmap_position");
}
}, 1000);
step = 0;
getstep();
var ifapp = 0;
var aifapp = getlocalStorage("ifapp");
if (aifapp != null) {
ifapp = aifapp;
}
if (ifapp == 0) {
$("#myForm").css("display", "block");
$("#myForm0").css("display", "none");
$("#myForm1").css("display", "block");
$("#myForm2").css("display", "none");
$("#myForm3").css("display", "block");
$("#myForm4").css("display", "none");
$("#myForm5").css("display", "block");
$("#myForm6").css("display", "none");
$("#myForm7").css("display", "block");
$("#myForm8").css("display", "none");
} else {
$("#myForm").css("display", "none");
$("#myForm0").css("display", "block");
$("#myForm1").css("display", "none");
$("#myForm2").css("display", "block");
$("#myForm3").css("display", "none");
$("#myForm4").css("display", "block");
$("#myForm5").css("display", "none");
$("#myForm6").css("display", "block");
$("#myForm7").css("display", "none");
$("#myForm8").css("display", "block");
}
rdata();
});
function rdata() {
userId = getlocalStorage("userId");
LoginId = getlocalStorage("LoginId");
$(".ajaxLoader").removeClass("uhide");
$.ajax({
type: 'GET',
url: "/apiajax.ashx",
data: "&action=getbusinessinfo&ifweb=1&userId=" + (userId != null ? userId : "") + "&LoginId=" + (LoginId != null ? LoginId : ""),
dataType: "JSON",
error: function (xhr, type) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data) {
if (data) {
if (data.status == 1) {
var clslist = data.clslist;
var html = "";
for (var i = 0; i < clslist.length; i++) {
var selected = "";
if (data.clsid == clslist[i].id) {
selected = " selected";
}
html += "<option value=\"" + clslist[i].id + "\" " + selected + ">" + clslist[i].name + "</option>";
}
$("#clslist").html(html);
upToken = data.upToken;
ylmoney = data.ylmoney;
ylmoney0 = data.ylmoney0;
$("#txtName").val(data.name);
/*$("#txtylmoney").attr("placeholder", "门店让利范围" + ylmoney + " % 至" + ylmoney0 + " %");
$("#txtylmoney").val(data.sjylmoney);
$("#txtNumber").val(data.xydm);
$("#txtdgzh").val(data.dgzh);
$("#txtfrname").val(data.frname);
$("#txtfridcard").val(data.fridcard);*/
$("#txtTel").val(data.phone);
image0 = data.image;
image1 = data.image0;
image2 = data.image1;
image3 = data.image2;
image4 = data.image3;
if (data.minimage != "") {
var _src = data.minimage;
$("#myForm img").attr("src", _src);
$("#myForm0 img").attr("src", _src);
}
if (data.minimage0 != "") {
var _src = data.minimage0;
$("#myForm1 img").attr("src", _src);
$("#myForm2 img").attr("src", _src);
}
if (data.minimage1 != "") {
var _src = data.minimage1;
$("#myForm3 img").attr("src", _src);
$("#myForm4 img").attr("src", _src);
}
if (data.minimage2 != "") {
var _src = data.minimage2;
$("#myForm5 img").attr("src", _src);
$("#myForm6 img").attr("src", _src);
}
if (data.minimage3 != "") {
var _src = data.minimage3;
$("#myForm7 img").attr("src", _src);
$("#myForm8 img").attr("src", _src);
}
$("#Province").val(data.province);
$("#City").val(data.city);
$("#County").val(data.county);
$("#hidIFFill").val(data.IFFill);
$("#hidAgentrading").val(data.Agentrading);
$('#area').val(getname(data.province, data.city, data.county, data.IFFill, data.Agentrading));
$("#txtAAddress").val(data.address);
$("#txtlongitude").val(data.ycoo);
$("#txtlatitude").val(data.xcoo);
$("#txtfwbody").val(data.range);
$("#txtaccountname").val(data.khname);
var webbank = data.webbank.split("|");
html = "";
for (var i = 0; i < webbank.length; i++) {
var selected = "";
if (webbank[i] == data.bank) {
selected = " selected='true'";
}
html += "<option value=\"" + webbank[i] + "\" " + selected + ">" + webbank[i] + "</option>";
}
$("#txtbankname").html(html);
$("#txtbankcard").val(data.bankcard);
$("#txtbankaddress").val(data.bankname);
ifedit=data.ifedit;
if (data.ifedit == 0) {
$("#txtName").attr("disabled", true);
$("#txtylmoney").attr("disabled", true);
$("#txtNumber").attr("disabled", true);
$("#txtdgzh").attr("disabled", true);
$("#txtfrname").attr("disabled", true);
$("#txtfridcard").attr("disabled", true);
$("#txtTel").attr("disabled", true);
$("#uploadpic0").attr("disabled", true);
$("#uploadpic1").attr("disabled", true);
$("#uploadpic2").attr("disabled", true);
$("#uploadpic3").attr("disabled", true);
$("#uploadpic4").attr("disabled", true);
$("#txtAAddress").attr("disabled", true);
$("#txtfwbody").attr("disabled", true);
$("#txtaccountname").attr("disabled", true);
$("#txtbankname").attr("disabled", true);
$("#txtbankcard").attr("disabled", true);
$("#txtbankaddress").attr("disabled", true);
$("#savebtn").val("暂时不能修改");
$("#savebtn").attr("disabled", true);
}
$(".ajaxLoader").addClass("uhide");
} else {
tishi3(data.msg);
$(".ajaxLoader").addClass("uhide");
if (data.msg == "您未登录") {
onlink("/");
}
}
} else {
tishi3("网络错误!");
$(".ajaxLoader").addClass("uhide");
}
}
});
}
function getcity() {
if (ifedit == 1) {
var showqy = $("#Province").val() + "," + $("#City").val() + "," + $("#County").val() + "," + $("#hidIFFill").val() + "," + $("#hidAgentrading").val();
setlocalStorage("showqy", showqy);
layer.open({
type: 2,
title: false,
closeBtn: false,
content: "address_selectqy.html",
area: ['100%', '100%']
});
}
//onlink("address_selectqy.html");
}
function showaddress(Province, City, County, IFFill, Agentrading) {
$('#Province').val(Province);
$('#City').val(City);
$('#County').val(County);
$("#hidIFFill").val(IFFill);
$("#hidAgentrading").val(Agentrading);
$('#area').val(getname(Province, City, County, IFFill, Agentrading));
}
function getstep() {
if (step == 0) {
$("#step_msg").css("display", "block");
$("#clearbtn").addClass("uhide");
}else if (step == 1) {
$("#step_msg").css("display", "block");
$("#step_box").addClass("uhide");
$("#step_box0").removeClass("uhide");
$("#step_box1").addClass("uhide");
$("#step_box2").addClass("uhide");
$("#clearbtn").addClass("uhide");
} else if (step == 2) {
$("#step_msg").css("display", "none");
$("#step_box").addClass("uhide");
$("#step_box0").addClass("uhide");
$("#step_box1").removeClass("uhide");
$("#step_box2").addClass("uhide");
$("#clearbtn").addClass("uhide");
} else if (step == 3) {
$("#step_msg").css("display", "none");
$("#step_box").addClass("uhide");
$("#step_box0").addClass("uhide");
$("#step_box1").addClass("uhide");
$("#step_box2").removeClass("uhide");
$("#clearbtn").removeClass("uhide");
$("#clearbtn").css("width", "50%");
$("#savebtn").val("提交");
$("#savebtn").css("width", "50%");
//定义画布常量宽高(如果屏幕的大小-20比650小的话则在移动端反之在pc端)
var canvasWidth = $(".signature_box").width();
var canvasHeight = $(".signature_box").height();
writeCanvas = new WriteFont('emptyCanvas', {
canvasWidth: canvasWidth,
canvasHeight: canvasHeight,
borderWidth: 10,
writeWidth: 3,
borderColor: '#ff6666',
isWriteName: true
});
}
}
//验证canvas画布是否为空函数
function isCanvasBlank(canvas) {
var blank = document.getElementById("blankemptyCanvas");//系统获取一个空canvas对象
blank.width = canvas.width;
blank.height = canvas.height;
return canvas.toDataURL() == blank.toDataURL();//比较值相等则为空
}
function WriteFont(id, options) {
var self = this;
this.canvas = document.getElementById(id);
var obj = {
canvas: this.canvas,
context: this.canvas.getContext("2d"),
isWrite: false, //是否开始
lastWriteTime: -1,
lastWriteSpeed: 0,
lastWriteWidth: 0,
canvasWidth: options.canvasWidth, //canvas宽高
canvasHeight: options.canvasHeight,
isShowBorder: true, //是否显示网格
bgColor: '#fff', //背景色
borderWidth: 2, // 网格线宽度
borderColor: "#fff", //网格颜色
lastPoint: {}, //
writeWidth: 2, //基础轨迹宽度
maxWriteWidth: 30, // 写字模式最大线宽
minWriteWidth: 1, // 写字模式最小线宽
writeColor: '#000', // 轨迹颜色
isWriteName: false //签名模式
}
for (var name in options) {
obj[name] = options[name];
}
/**
* 轨迹宽度
*/
this.setLineWidth = function () {
var nowTime = new Date().getTime();
var diffTime = nowTime - obj.lastWriteTime;
obj.lastWriteTime = nowTime;
var returnNum = obj.minWriteWidth + (obj.maxWriteWidth - obj.minWriteWidth) * diffTime / 30;
if (returnNum < obj.minWriteWidth) {
returnNum = obj.minWriteWidth;
} else if (returnNum > obj.maxWriteWidth) {
returnNum = obj.maxWriteWidth;
}
returnNum = returnNum.toFixed(2);
//写字模式和签名模式
if (obj.isWriteName) {
obj.context.lineWidth = obj.writeWidth;
} else {
obj.context.lineWidth = obj.lastWriteWidth = obj.lastWriteWidth / 4 * 3 + returnNum / 4;
}
}
/**
* 绘制轨迹
*/
this.writing = function (point) {
obj.context.beginPath();
obj.context.moveTo(obj.lastPoint.x, obj.lastPoint.y);
obj.context.lineTo(point.x, point.y);
self.setLineWidth();
obj.context.stroke();
obj.lastPoint = point;
obj.context.closePath();
}
/**
* 轨迹样式
*/
this.writeContextStyle = function () {
obj.context.beginPath();
obj.context.strokeStyle = obj.writeColor;
obj.context.lineCap = 'round';
obj.context.lineJoin = "round";
}
/**
* 写开始
*/
this.writeBegin = function (point) {
obj.isWrite = true;
obj.lastWriteTime = new Date().getTime();
obj.lastPoint = point;
self.writeContextStyle();
}
/**
* 写结束
*/
this.writeEnd = function () {
obj.isWrite = false;
}
/**
* 清空画板
*/
this.canvasClear = function () {
obj.context.save();
obj.context.strokeStyle = '#fff';
obj.context.clearRect(0, 0, obj.canvasWidth, obj.canvasHeight);
if (obj.isShowBorder && !obj.isWriteName) {
obj.context.beginPath();
var size = obj.borderWidth / 2;
//画外面的框
obj.context.moveTo(size, size);
obj.context.lineTo(obj.canvasWidth - size, size);
obj.context.lineTo(obj.canvasWidth - size, obj.canvasHeight - size);
obj.context.lineTo(size, obj.canvasHeight - size);
obj.context.closePath();
obj.context.lineWidth = obj.borderWidth;
obj.context.strokeStyle = obj.borderColor;
obj.context.stroke();
//画里面的框
obj.context.moveTo(0, 0);
obj.context.lineTo(obj.canvasWidth, obj.canvasHeight);
obj.context.lineTo(obj.canvasWidth, obj.canvasHeight / 2);
obj.context.lineTo(obj.canvasWidth, obj.canvasHeight / 2);
obj.context.lineTo(0, obj.canvasHeight / 2);
obj.context.lineTo(0, obj.canvasHeight);
obj.context.lineTo(obj.canvasWidth, 0);
obj.context.lineTo(obj.canvasWidth / 2, 0);
obj.context.lineTo(obj.canvasWidth / 2, obj.canvasHeight);
obj.context.stroke();
}
obj.context.restore();
}
/**
* 初始化画板
*/
this.canvasInit = function () {
this.canvas.width = obj.canvasWidth;
this.canvas.height = obj.canvasHeight;
this.emptyCanvas = this.canvas.toDataURL("image/png");
}
/**======================事件绑定===========================**/
this.canvas.addEventListener('mousedown', function (e) {
var point = {
x: e.offsetX || e.clientX,
y: e.offsetY || e.clientY
};
self.writeBegin(point);
});
this.canvas.addEventListener('mouseup', function (e) {
var point = {
x: e.offsetX,
y: e.offsetY
};
self.writeEnd(point);
});
this.canvas.addEventListener('mouseleave', function (e) {
var point = {
x: e.offsetX,
y: e.offsetY
};
self.writeEnd(point);
});
this.canvas.addEventListener('mousemove', function (e) {
if (obj.isWrite) {
var point = {
x: e.offsetX,
y: e.offsetY
};
self.writing(point);
}
});
var h = 0;
var w = 0;
//移动端
this.canvas.addEventListener('touchstart', function (e) {
var touch = e.targetTouches[0];
var point = {
x: (touch.pageX || touch.clientX) - w,
y: (touch.pageY || touch.clientY) - h
};
self.writeBegin(point);
});
this.canvas.addEventListener('touchend', function (e) {
var touch = e.changedTouches[0];
var point = {
x: touch.pageX - w,
y: touch.pageY - h
};
self.writeEnd(point);
});
this.canvas.addEventListener('touchmove', function (e) {
event.preventDefault()
var touch = e.targetTouches[0];
var point = {
x: touch.pageX - w,
y: touch.pageY - h
};
self.writeEnd(point);
});
this.canvas.addEventListener('touchmove', function (e) {
event.preventDefault()
var touch = e.targetTouches[0];
var point = {
x: touch.pageX - w,
y: touch.pageY - h
};
self.writing(point);
});
this.canvasInit();
this.canvasClear();
this.option = obj;
obj.control = {
clearCanvas: self.canvasClear
};
}
function dataURLtoBlob(dataurl) {
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], { type: mime });
}
function onclear() {
writeCanvas.option.control.clearCanvas();
}
function onsave() {
var ifb = true;
clsid = fTrim($('#clslist').val());
name = fTrim($('#txtName').val());
/*aylmoney = fTrim($('#txtylmoney').val());
number = fTrim($('#txtNumber').val());
dgzh = fTrim($('#txtdgzh').val());
frname = fTrim($('#txtfrname').val());
fridcard = fTrim($('#txtfridcard').val());*/
tel = $("#txtTel").val();
province = $("#Province").val();
city = $("#City").val();
county = $("#County").val();
IFFill = $("#hidIFFill").val();
Agentrading = $("#hidAgentrading").val();
address = $("#txtAAddress").val();
longitude = $("#txtlongitude").val();
latitude = $("#txtlatitude").val();
fwbody = $("#txtfwbody").val();
if (ifb) {
if (clsid == "") {
tishi3("门店分类未选择!");
$("#clslist").focus();
ifb = false;
}
}
if (ifb) {
if (name == "") {
tishi3("门店名称不能为空!");
$("#txtName").focus();
ifb = false;
}
}
/*if (ifb) {
if (aylmoney == "") {
tishi3("门店让利不能为空!");
$("#txtylmoney").focus();
ifb = false;
}
}
if (ifb) {
var regex = /^-?\d+(\.\d{1,2})?$/;
if (!regex.test(aylmoney)) {
tishi3("门店让利格式不正确!");
$("#txtylmoney").focus();
ifb = false;
}
}
if (ifb) {
if (parseFloat(aylmoney) < parseFloat(ylmoney) || parseFloat(aylmoney) > parseFloat(ylmoney0)) {
tishi3("门店让利范围" + ylmoney + "%至" + ylmoney0 + "%");
$("#txtylmoney").focus();
ifb = false;
}
}
if (ifb) {
if (number == "") {
tishi3("信用代码不能为空!");
$("#txtNumber").focus();
ifb = false;
}
}
if (ifb) {
if (frname == "") {
tishi3("法人姓名不能为空!");
$("#txtfrname").focus();
ifb = false;
}
}
if (ifb) {
if (fridcard == "") {
tishi3("法人身份证号不能为空!");
$("#txtfridcard").focus();
ifb = false;
}
}*/
if (ifb) {
if (tel == "") {
tishi3("联系电话不能为空!");
$("#txtTel").focus();
ifb = false;
}
}
if (ifb) {
if (image0 == "") {
tishi3("门头照片未上传!");
ifb = false;
}
}
if (ifb) {
if (image1 == "") {
tishi3("营业执照图片未上传!");
ifb = false;
}
}
if (ifb) {
if (image2 == "") {
tishi3("银行卡图片未上传!");
ifb = false;
}
}
if (ifb) {
if (image3 == "") {
tishi3("身份证正面图片未上传!");
ifb = false;
}
}
if (ifb) {
if (image4 == "") {
tishi3("身份证反面图片未上传!");
ifb = false;
}
}
if (ifb) {
if (province == "" || city == "") {
tishi3("所在地区未选择!");
ifb = false;
}
}
if (ifb) {
if (address == "") {
tishi3("详细地址不能为空!");
$("#txtAAddress").focus();
ifb = false;
}
}
if (ifb) {
if (longitude == "" || latitude == "") {
tishi3("地图未标注!");
ifb = false;
}
}
accountname = fTrim($('#txtaccountname').val());
bankname = fTrim($('#txtbankname').val());
bankcard = fTrim($('#txtbankcard').val());
bankaddress = fTrim($('#txtbankaddress').val());
if (ifb) {
if (accountname == "") {
tishi3("开户姓名不能为空!");
$("#txtaccountname").focus();
ifb = false;
}
}
if (ifb) {
if (bankname == "") {
tishi3("银行名称未选择!");
$("#txtbankname").focus();
ifb = false;
}
}
if (ifb) {
if (bankcard == "") {
tishi3("银行卡号不能为空!");
$("#txtbankcard").focus();
ifb = false;
}
}
if (ifb) {
if (bankaddress == "") {
tishi3("开户行不能为空!");
$("#txtbankaddress").focus();
ifb = false;
}
}
if (ifb) {
if ($("#savebtn").val() != "修改资料") {
ifb = false;
}
}
if (ifb) {
$("#savebtn").attr("disabled");
$("#savebtn").val("请稍候...");
try {
var datas = {
action: "appupdatebusiness",
userId: userId,
LoginId: LoginId,
clsid: clsid,
name: name,
money: aylmoney,
number: number,
dgzh: dgzh,
frname: frname,
fridcard: fridcard,
tel: tel,
image0: image0,
image1: image1,
image2: image2,
image3: image3,
image4: image4,
province: province,
city: city,
county: county,
IFFill: IFFill,
Agentrading: Agentrading,
address: address,
longitude: longitude,
latitude: latitude,
fwbody: fwbody,
accountname: accountname,
bankname: bankname,
bankcard: bankcard,
bankaddress: bankaddress,
};
$.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 (ifedit == 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(new Date()) + 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) {
/* code ··· */
// }
},
error: (err) => {
//上传失败
/* code ··· */
alert(JSON.stringify(err));
$(myForm).find("img").attr("src", "../image/add1.png");
},
complete: (res) => {
//上传成功
//alert(JSON.stringify()+"|");
var filepath = image0;
if (t == 1) {
filepath = image1;
} else if (t == 2) {
filepath = image2;
} else if (t == 3) {
filepath = image3;
} else if (t == 4) {
filepath = image4;
}
if (filepath != "") {
deletefile(filepath.replace("https://fv.pmhapp.cn/", ""));
}
$(myForm).find("img").attr("src", "https://fv.pmhapp.cn/" + key);
if (t == 4) {
image4 = "https://fv.pmhapp.cn/" + key;
} else if (t == 3) {
image3 = "https://fv.pmhapp.cn/" + key;
} else if (t == 2) {
image2 = "https://fv.pmhapp.cn/" + key;
} else if (t == 1) {
image1 = "https://fv.pmhapp.cn/" + key;
} else {
image0 = "https://fv.pmhapp.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 (ifedit == 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) {
if (ret.data == "") {
uploading = 0;
$(myForm).find("img").attr("src", "../image/add1.png");
} else {
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") {
var filepath = image0;
if (t == 1) {
filepath = image1;
} else if (t == 2) {
filepath = image2;
} else if (t == 3) {
filepath = image3;
} else if (t == 4) {
filepath = image4;
}
if (filepath != "") {
deletefile(filepath.replace("https://fv.pmhapp.cn/", ""));
}
$(myForm).find("img").attr("src", "https://fv.pmhapp.cn/" + filename);
if (t == 4) {
image4 = "https://fv.pmhapp.cn/" + filename;
} else if (t == 3) {
image3 = "https://fv.pmhapp.cn/" + filename;
} else if (t == 2) {
image2 = "https://fv.pmhapp.cn/" + filename;
} else if (t == 1) {
image1 = "https://fv.pmhapp.cn/" + filename;
} else {
image0 = "https://fv.pmhapp.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 (ifedit == 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%']
});
}
}
function deletefile(filepath) {
if (filepath != "") {
$.post("/ajax.ashx", { action: "deleteimage", delpics: escape(filepath) }, function (data) {
if (data.success) {
}
});
}
}
</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 id="step_msg" style="margin-bottom: 0.8em; font-weight: 800; color: #ff4d00;">
请仔细填写、需提交三方审核
</div>
<div class="tixin-item" id="step_box" style=" padding:0.4em;">
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
门店分类
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<select id="clslist" style=" height:2.2em;width:12em;"></select>
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
门店名称<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtName" />
</div>
</div>
<!-- <div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
门店让利<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtylmoney" style="width:15em" /><div style="margin-top:0.4em;">%</div>
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
信用代码<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtNumber" />
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
对公账号
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtdgzh" placeholder="没有可为空" />
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
法人姓名<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtfrname" />
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
法人身份证号<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtfridcard" />
</div>
</div>-->
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
联系电话<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;margin-top: .5em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
门头照片<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<form id="myForm">
<div class="ub ub-ac ub-pc upload_image">
<img src="../image/add1.png" />
<input type="file" id="uploadpic0" class="uploadpic_btn" onchange="dpreview(0)" accept="image/*" />
</div>
</form>
<form id="myForm0">
<div class="ub ub-ac ub-pc upload_image" onclick="dpreview0(0)">
<img src="../image/add1.png" />
</div>
</form>
</div>
</div>
<div class="ub ub-ac company_box" style="padding:1em 0;margin-top: .8em;border-top:1px solid #f1f1f1;">
<div class="ub ub-ac ub-ver">
<div class="ub ub-ac">上传营业执照<font color="red">*</font></div>
<div class="ub ub-ac ub-pc" id="upload_image1">
<form id="myForm1">
<div class="ub ub-ac ub-pc upload_image">
<img src="../image/add1.png" />
<input type="file" id="uploadpic1" class="uploadpic_btn" onchange="dpreview(1)" accept="image/*" />
</div>
</form>
<form id="myForm2">
<div class="ub ub-ac ub-pc upload_image" onclick="dpreview0(1)">
<img src="../image/add1.png" />
</div>
</form>
</div>
</div>
<div class="ub ub-ac ub-ver" style="margin-left:0.4em;">
<div class="ub ub-ac">银行卡<font color="red">*</font></div>
<div class="ub ub-ac ub-pc" id="upload_image2">
<form id="myForm3">
<div class="ub ub-ac ub-pc upload_image">
<img src="../image/add1.png" />
<input type="file" id="uploadpic2" class="uploadpic_btn" onchange="dpreview(2)" accept="image/*" />
</div>
</form>
<form id="myForm4">
<div class="ub ub-ac ub-pc upload_image" onclick="dpreview0(2)">
<img src="../image/add1.png" />
</div>
</form>
</div>
</div>
<div class="ub ub-ac ub-ver" style="margin-left:0.3em;">
<div class="ub ub-ac">身份证正反面<font color="red">*</font></div>
<div class="ub ub-ac">
<div class="ub ub-ac ub-pc" id="upload_image3">
<form id="myForm5">
<div class="ub ub-ac ub-pc upload_image">
<img src="../image/add1.png" />
<input type="file" id="uploadpic3" class="uploadpic_btn" onchange="dpreview(3)" accept="image/*" />
</div>
</form>
<form id="myForm6">
<div class="ub ub-ac ub-pc upload_image" onclick="dpreview0(3)">
<img src="../image/add1.png" />
</div>
</form>
</div>
<div class="ub ub-ac ub-pc" id="upload_image4">
<form id="myForm7">
<div class="ub ub-ac ub-pc upload_image">
<img src="../image/add1.png" />
<input type="file" id="uploadpic4" class="uploadpic_btn" onchange="dpreview(4)" accept="image/*" />
</div>
</form>
<form id="myForm8">
<div class="ub ub-ac ub-pc upload_image" onclick="dpreview0(4)">
<img src="../image/add1.png" />
</div>
</form>
</div>
</div>
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
所在地区<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: 10em;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:7em;">
详细地址<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtAAddress" />
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
标注地图<font color="red">*</font>
</div>
<div class="ub ub-ver ub-f1" style="box-sizing:border-box;">
<div class="ub ub-ac ub-pc uinput11" style="">
<div class="ub" style="width:2.5em;">lon</div><input type="text" id="txtlongitude" disabled="disabled" style=" width: 10em;border:0; background-color:rgba(0, 0, 0, .2)" />
</div>
<div class="ub ub-ac ub-pc uinput11" style="margin-top:0.4em;">
<div class="ub" style="width:2.5em;">lat</div><input type="text" id="txtlatitude" disabled="disabled" style=" width: 10em;border:0;background-color:rgba(0, 0, 0, .2)" />
</div>
<div class="ub ub-ac ub-pc" style="margin-top:0.4em;">
<input id="btntj" type="button" class="mybtn" style="padding:0.5em 0.8em;color:#fff;border-radius: 0.5em;" onclick="onbz()" value="去标注">
</div>
</div>
</div>
<div class="ub ub-ac" style="margin-top: .8em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
服务内容
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<textarea id="txtfwbody" style=" width: 15em;height:5em;"></textarea>
</div>
</div>
<input id="Province" type="hidden" />
<input id="City" type="hidden" />
<input id="County" type="hidden" />
<input type="hidden" id="hidIFFill" value="" />
<input type="hidden" id="hidAgentrading" value="" />
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
开户姓名<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtaccountname" />
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
银行名称<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<select id="txtbankname" style="width: 16em;height:2em"></select>
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
银行卡号<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtbankcard" />
</div>
</div>
<div class="ub ub-ac" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;width:7em;">
开户行或联行号<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="text" id="txtbankaddress" placeholder="对公请填写联行号" />
</div>
</div>
</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>