Files

1493 lines
68 KiB
HTML
Raw Permalink 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">
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;
}
#wrapper_content .ub-f1 {
color: #fff;
}
.appadv_title {
width: 100%;
padding: 0 0em;
height: 2em;
line-height: 2em;
box-sizing: border-box;
}
.appadv_title div {
height: 2em;
line-height: 2em;
box-sizing: border-box;
color: #19A868;
}
select {
color: #848484;
}
.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%);
}
.tixin-item .account li {
border-bottom: 1px solid #f5f5f5;
}
</style>
<script type="text/javascript">
var userId = null;
var LoginId = null;
var opentimes = null;
var sInterval0 = null;
var viewId = 0, ifytfg = 0, zftype = 0, guige = 0, type=0;
var address = null;
var uploading = 0, ifupuser = 0, cutvideoseconds = 0;
var video0="", image1 = "", image2 = "", image3 = "", image4 = "", upToken="";
var myScroll = null;
var pullDown = 1; // 下拉刷新避免多次执行
var pullUp = 1; // 上拉加载避免多次执行
var downHeight = 0;
var upHeight = 0;
var isload = true;//设置是否终止滚动加载
var curScrollHeight = 0;//当前滚动位置
var curCount = 1;//计数器,防止滚动时重复执行加载下一页
var myXhr = null;
$(document).ready(function () {
userId = getlocalStorage("userId");
LoginId = getlocalStorage("LoginId");
var dParam = $.getUrlParam("id");
if (dParam != null) {
viewId = dParam;
}
opentimes = setInterval(function () {
var selectqydatas = getlocalStorage("address_selectqy_datas");
if (selectqydatas != null) {
var adatas = selectqydatas.split(",");
showaddress(adatas[0], adatas[1], adatas[2])
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);
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");
if (userId != null && LoginId) {
var userdata = JSON.parse(getlocalStorage("userinfo"));
}
$(".ajaxLoader").removeClass("uhide");
$.ajax({
type: 'GET',
url: "/apiajax.ashx",
data: "&action=getshopview&ifweb=1&viewId=" + viewId + "&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) {
$("#ggje_box").html(data.hyje);
$("#gxz_num").html(data.fxjl);
$("#bfcs_num").html(data.fxjl0);
$("#kscspsl_num").html(parseFloat(data.scje).toFixed(0) + "个");
upToken = data.upToken;
guige = data.guige[0].id;
//ifytfg = data.ifytfg;
type = data.type;
cutvideoseconds = data.seconds;
$("#gxz_box").removeClass("uhide");
$("#bfcs_box").removeClass("uhide");
$("#kscspsl_box").removeClass("uhide");
//$("#uploadvideo_box").removeClass("uhide");
/*if (ifytfg == 1) {
$(".company_box").addClass("uhide");
}
else {
$(".company_box").removeClass("uhide");
}*/
$(".ajaxLoader").addClass("uhide");
} else {
tishi3(data.msg);
$(".ajaxLoader").addClass("uhide");
if (data.msg == "您未登录") {
onlink("/");
}
}
} else {
tishi3("网络错误!");
$(".ajaxLoader").addClass("uhide");
}
}
});
}
function getcity() {
var showqy = $("#Province").val() + "," + $("#City").val() + "," + $("#County").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) {
$('#Province').val(Province);
$('#City').val(City);
$('#County').val(County);
$('#area').val(getname(Province, City, County));
}
function stopPropagation(e) {
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
}
function onselectout(event) {
if ($(".select_box_bg").css("display") != "none") {
$(".select_box_bg").css("display", "none");
}
}
function closeselect() {
$(".select_box_bg").css("display", "none");
$("#savebtn").val("提交");
}
function onzftype(t) {
zftype = t;
if (t == 0) {
$("#zftype0 .current").addClass("on");
$("#zftype6 .current").removeClass("on");
$("#zftype7 .current").removeClass("on");
$("#zftype2 .current").removeClass("on");
$("#zftype3 .current").removeClass("on");
} else if (t == 6) {
$("#zftype0 .current").removeClass("on");
$("#zftype6 .current").addClass("on");
$("#zftype7 .current").removeClass("on");
$("#zftype2 .current").removeClass("on");
$("#zftype3 .current").removeClass("on");
} else if (t == 7) {
$("#zftype0 .current").removeClass("on");
$("#zftype6 .current").removeClass("on");
$("#zftype7 .current").addClass("on");
$("#zftype2 .current").removeClass("on");
$("#zftype3 .current").removeClass("on");
} else if (t == 2) {
$("#zftype0 .current").removeClass("on");
$("#zftype6 .current").removeClass("on");
$("#zftype7 .current").removeClass("on");
$("#zftype2 .current").addClass("on");
$("#zftype3 .current").removeClass("on");
} else if (t == 3) {
$("#zftype0 .current").removeClass("on");
$("#zftype6 .current").removeClass("on");
$("#zftype7 .current").removeClass("on");
$("#zftype2 .current").removeClass("on");
$("#zftype3 .current").addClass("on");
}
}
function onsave() {
var ifb = true;
var province = $("#Province").val();
var city = $("#City").val();
var county = $("#County").val();
var address = $("#txtAAddress").val();
if (ifb) {
if (province == "" || city == "") {
tishi3("所在地区未选择!");
ifb = false;
}
}
if (ifb) {
if (address == "") {
tishi3("详细地址不能为空!");
$("#txtAAddress").focus();
ifb = false;
}
}
/*var name = "";
var tel = "";
var province = "";
var city = "";
var county = "";
var address = "";
var longitude = "";
var latitude = "";
if (ifytfg == 0) {
name = fTrim($('#txtName').val());
tel = $("#txtTel").val();
province = $("#Province").val();
city = $("#City").val();
county = $("#County").val();
address = $("#txtAAddress").val();
longitude = $("#txtlongitude").val();
latitude = $("#txtlatitude").val();
if (ifb) {
if (name == "") {
tishi3("公司名称不能为空!");
$("#txtName").focus();
ifb = false;
}
}
if (ifb) {
if (tel == "") {
tishi3("联系电话不能为空!");
$("#txtTel").focus();
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;
}
}
}*/
/*if (type < 4) {
if (ifb) {
if (video0 == "") {
tishi3("视频未上传!");
ifb = false;
}
}
}*/
/*if (ifb) {
if (uploading == 1) {
tishi3("正在上传中!");
ifb = false;
}
}*/
if (ifb) {
if ($("#savebtn").val() == "提交") {
$("#savebtn").val("确认");
$(".select_box_bg").css("display", "block");
} else {
if (ifb) {
if (zftype == 0 || zftype == 1 || zftype == 4 || zftype == 5 || zftype == 6 || zftype == 7) {
var _index = layer.prompt({ title: '请输入安全密码,并确定下单', formType: 1 }, function (pass) {
if (pass == "") {
tishi3("请输入您的安全密码");
return false;
}
layer.close(_index);
qysave(pass);
})
} else {
qysave("");
}
}
}
}
}
var ResultId = 0;
function qysave(pwd) {
var ifb = true;
var province = $("#Province").val();
var city = $("#City").val();
var county = $("#County").val();
var address = $("#txtAAddress").val();
if (ifb) {
if (province == "" || city == "") {
tishi3("所在地区未选择!");
ifb = false;
}
}
if (ifb) {
if (address == "") {
tishi3("详细地址不能为空!");
$("#txtAAddress").focus();
ifb = false;
}
}
/*var name = "";
var tel = "";
var province = "";
var city = "";
var county = "";
var address = "";
var longitude = "";
var latitude = "";
if (ifytfg == 0) {
name = fTrim($('#txtName').val());
tel = $("#txtTel").val();
province = $("#Province").val();
city = $("#City").val();
county = $("#County").val();
address = $("#txtAAddress").val();
longitude = $("#txtlongitude").val();
latitude = $("#txtlatitude").val();
}*/
if (ifb) {
if ($("#savebtn").val() != "确认") {
ifb = false;
}
}
if (ifb) {
$("#savebtn").attr("disabled");
$("#savebtn").val("请稍候...");
try {
var datas = {
action: "appadv",
userId: userId,
LoginId: LoginId,
//name: name,
//tel: tel,
//video0: video0,
//image1: image1,
//image2: image2,
//image3: image3,
//image4: image4,
province: province,
city: city,
county: county,
address: address,
//longitude: longitude,
//latitude: latitude,
viewId: viewId,
guige: guige,
zftype: zftype,
pwd: pwd
};
$.ajax({
type: 'POST',
url: "/apiajax.ashx?ifweb=" + (ifapp == 1 ? "0" : "1"),
data: datas,
dataType: "json",
error: function (xhr) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data) {
if (data) {
if (data.status == 1) {
tishi3(data.msg);
ResultId = data.ResultId;
if (zftype == 2) {
if (ifapp == 1) {
var wxPayPlus = api.require('wxPayPlus');
wxPayPlus.getOrderId({
info: data.reResult
}, function (ret, err) {
if (ret.return_code == "SUCCESS") {
$.ajax({
type: 'POST',
url: "/apiajax.ashx?action=car_pay_sign&ifweb=0",
data: {
userId: userId,
LoginId: LoginId,
ResultId: data.ResultId,
prepayid: ret.prepay_id,
package: "Sign=WXPay",
noncestr: data.noncestr
},
dataType: "json",
error: function (xhr) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data2) {
if (data2.status == 1) {
wxPayPlus.payOrder({
apiKey: appId_weixin,
orderId: ret.prepay_id,
mchId: data2.partnerid,
nonceStr: data2.noncestr,
timeStamp: data2.timestamp,
package: 'Sign=WXPay',
sign: data2.sign
}, function (ret2, err2) {
if (ret2.status) {
tishi3("支付成功");
setlocalStorage("fnstrefresh", 1);
var closeInterval = setInterval(function () {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
$(".ajaxLoader").addClass("uhide");
clearInterval(closeInterval);
if (data.busid == 0) {
onlink("fnst_app0.html?t=" + type);
} else {
onlink("fnst_upvideo.html?t=" + type);
}
}, 1000);
} else {
tishi3(err2.code);
var closeInterval = setInterval(function () {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
$(".ajaxLoader").addClass("uhide");
clearInterval(closeInterval);
}, 500);
//location.replace("myorders.html?pay=1");
}
});
} else {
tishi3(data.msg);
}
}
});
} else {
tishi3(ret.return_msg);
}
});
} else {
tishi3(data.msg);
var closeInterval = setInterval(function () {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
$(".ajaxLoader").addClass("uhide");
clearInterval(closeInterval);
}, 500);
onlink("pay.html?t=1&PayID=" + ResultId);
}
} else if (zftype == 3) {
if (ifapp == 1) {
var aliPayPlus = api.require('aliPayPlus');
aliPayPlus.payOrder({
orderInfo: data.reResult
}, function (ret, err) {
if (ret.code == 9000) {
rdata(1);
setlocalStorage("fnstrefresh", 1);
var closeInterval = setInterval(function () {
$("#save").removeAttr("disabled");
$("#save").val("提交");
$(".ajaxLoader").addClass("uhide");
clearInterval(closeInterval);
}, 500);
onlink("fnst_upvideo.html?t=" + type);
} else if (ret.code == 8000) {
tishi3("正在处理中");
} else if (ret.code == 4000) {
tishi3("订单支付失败");
} else if (ret.code == 5000) {
tishi3("重复请求");
} else if (ret.code == 6001) {
tishi3("用户中途取消支付操作");
} else if (ret.code == 6002) {
tishi3("网络连接出错");
} else if (ret.code == 6003) {
tishi3("支付结果未知,请查询订单");
if (data.busid == 0) {
onlink("fnst_app0.html?t=" + type);
} else {
onlink("fnst_upvideo.html?t=" + type);
}
}
});
} else {
var closeInterval = setInterval(function () {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
$(".ajaxLoader").addClass("uhide");
clearInterval(closeInterval);
}, 500);
onlink("pay.html?t=0&PayID=" + ResultId);
}
} else {
tishi3(data.msg);
layer.closeAll();
setlocalStorage("fnstrefresh", 1);
var closeInterval = setInterval(function () {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
$(".ajaxLoader").addClass("uhide");
clearInterval(closeInterval);
if (data.busid == 0) {
onlink("fnst_app0.html?t=" + type);
} else {
onlink("fnst_upvideo.html?t=" + type);
}
}, 1000);
}
} if (data.status == 0) {
tishi3(data.msg);
$("#savebtn").val("确认");
}
} else {
tishi3('网络异常,请稍后重试');
$("#savebtn").val("确认");
}
}
});
} catch (err) {
tishi3(err);
}
}
}
function dpreview(t) {
if (ifupuser == 0) {
var val = $("#uploadpic0").val();
if (val != "") {
var file = document.getElementById("uploadpic" + t).files[0];
var myForm = null;
if (t == 0) {
myForm = document.getElementById("myForm");
}
else if (t == 1) {
myForm = document.getElementById("myForm1");
}
else if (t == 2) {
myForm = document.getElementById("myForm3");
}
else if (t == 3) {
myForm = document.getElementById("myForm5");
}
else 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 (t == 0) {
$('.processbox').removeClass("uhide");
$(".processbox .child").css("width", result.total.percent + "%");
}
},
error: (err) => {
//上传失败
/* code ··· */
$(myForm).find("img").attr("src", "../image/add1.png");
},
complete: (res) => {
//上传成功
//alert(JSON.stringify()+"|");
var filepath = video0;
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/", ""));
}
if (t == 0) {
$('.processbox').addClass("uhide");
video0 = "https://fv.pmhapp.cn/" + key;
$("#ysc_box").removeClass("uhide");
$(myForm).find("img").attr("src", "../image/add1.png");
} else {
$(myForm).find("img").attr("src", "https://fv.pmhapp.cn/" + key);
if (t == 1) {
image1 = "https://fv.pmhapp.cn/" + key;
} else if (t == 2) {
image2 = "https://fv.pmhapp.cn/" + key;
} else if (t == 3) {
image3 = "https://fv.pmhapp.cn/" + key;
} else if (t == 4) {
image4 = "https://fv.pmhapp.cn/" + key;
}
}
},
});
} catch (err) {
alert(err);
}
/*
var formdata0 = new FormData(myForm);
formdata0.append("action", "uploadImage");
formdata0.append("uploadpic", file);
formdata0.append("userId", userId);
formdata0.append("LoginId", LoginId);
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请求头
xhr: function () { //获取ajaxSettings中的xhr对象为它的upload属性绑定progress事件的处理函数
myXhr = $.ajaxSettings.xhr();
if (myXhr.upload) { //检查upload属性是否存在
//绑定progress事件的回调函数
myXhr.upload.addEventListener('progress', progressHandlingFunction, false);
}
return myXhr; //xhr对象返回给jQuery使用
},
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 == 1) {
image1 = image;
} else if (t == 2) {
image2 = image;
} else if (t == 3) {
image3 = image;
} else if (t == 4) {
image4 = image;
}
} else {
tishi3(data.msg);
$(myForm).find("img").attr("src", "../image/add1.png");
}
}
});*/
}
}
}
//上传进度回调函数:
function progressHandlingFunction(e) {
if (e.lengthComputable) {
var percent = e.loaded / e.total * 100;
$('.processbox .child').css("width", percent.toFixed(2) + "%");
}
}
function dpreview0(t) {
if (ifupuser == 0) {
var ifb = true;
try {
var permission = ['camera', 'photos'];
var resultList = api.hasPermission({
list: permission
});
var granted = resultList[0].granted;
if (!granted) {
ifb = false;
api.confirm({
title: '开启权限提示',
msg: "应用需要您的授权才能访问相机和相册,是否要授权?",
buttons: ['确认授权', '暂不授权']
}, function (ret, err) {
var index = ret.buttonIndex;
if (index == 1) {
api.requestPermission({
list: permission,
}, function (res) {
if (res.list[0].granted) {
// 已授权,可以继续下一步操作
tishi3('已授权');
} else {
ifb = false;
}
});
}
});
}
} catch (err) {
ifb = true;
}
if (ifb) {
try {
uploading = 1;
var pdatas = {
sourceType: 'album',
encodingType: 'png',
mediaValue: 'pic',
destinationType: 'url',
allowEdit: false,
quality: 100,
saveToPhotoAlbum: false
}
if (t == 0) {
pdatas = {
sourceType: 'album',
mediaValue: 'video',
destinationType: 'url',
allowEdit: false,
videoQuality: 'medium',
saveToPhotoAlbum: true
}
}
var myForm = null;
if (t == 0) {
myForm = document.getElementById("myForm0");
}
else 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");
api.getPicture(pdatas, function (ret, err) {
if (ret) {
var img_url = ret.data;
if (img_url == "") {
uploading = 0;
$(myForm).find("img").attr("src", "../image/add1.png");
} else {
if (t == 0) {
cutvideo(ret.data);
} else {
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 = "";
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 == 1) {
image1 = "https://fv.pmhapp.cn/" + filename;
} else if (t == 2) {
image2 = "https://fv.pmhapp.cn/" + filename;
} else if (t == 3) {
image3 = "https://fv.pmhapp.cn/" + filename;
} else if (t == 4) {
image4 = "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;
}
}
});
}
}
/*var datas = {
values: { "action": "uploadImage", "userId": userId, "LoginId": LoginId, t: 0 },
files: {
"uploadpic": ret.data
}
}
api.ajax({
url: apiurl + "/apiajax.ashx",
method: 'post',
contentType: "application/x-www-form-urlencoded; charset=utf-8",
data: datas,
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 == 1) {
image1 = image;
} else if (t == 2) {
image2 = image;
} else if (t == 3) {
image3 = image;
} else if (t == 4) {
image4 = image;
}
} else {
tishi3(data.msg);
$(myForm).find("img").attr("src", "../image/add1.png");
}
} else {
$(myForm).find("img").attr("src", "../image/add1.png");
}
});*/
} else {
uploading = 0;
$(".ajaxLoader").addClass("uhide");
alert(JSON.stringify(err));
}
});
} catch (errr) {
alert(errr);
uploading = 0;
}
}
}
}
function cutvideo(url) {
try {
var videoTool = api.require('videoTools');
videoTool.interceptionVideo({
path: url,
startTime: 0,
endTime: cutvideoseconds
}, function (ret) {
if (ret.status) {
uploadvideo(ret.compressPath);
} else {
uploading = 0;
var myForm = document.getElementById("myForm0");
$(myForm).find("img").attr("src", "../image/add1.png");
tishi3('截取视频失败');
}
});
} catch (err) {
tishi3(err);
uploading = 0;
var myForm = document.getElementById("myForm0");
$(myForm).find("img").attr("src", "../image/add1.png");
}
}
function uploadvideo(video_url) {
var filetype = video_url.substring(video_url.lastIndexOf("."));
var filename = "ksd2023/userid_" + userId + "_" + judgetime1(new Date()) + filetype;
var qiniu = api.require('qiniuKodo');
qiniu.putObject({
token: upToken,
objectKey: filename,
filePath: video_url
}, function (ret, err) {
if (ret) {
if (ret.eventType == "onComplete") {
var filepath = video0;
if (filepath != "") {
deletefile(filepath.replace("https://fv.pmhapp.cn/", ""));
}
video0 = "https://fv.pmhapp.cn/" + filename;
uploading = 0;
$('.processbox').addClass("uhide");
var myForm = document.getElementById("myForm0");
$(myForm).find("img").attr("src", "../image/add1.png");
$("#ysc_box").removeClass("uhide");
} else if (ret.eventType == "onProgress") {
$('.processbox').removeClass("uhide");
$('.processbox .child').css("width", ret.percent + "%");
} else if (ret.eventType == "onError") {
uploading = 0;
$('.processbox').addClass("uhide");
var myForm = document.getElementById("myForm0");
$(myForm).find("img").attr("src", "../image/add1.png");
tishi3("上传失败");
}
}
});
/*var datas = {
values: { "action": "uploadFile", "userId": userId, "LoginId": LoginId, t: 1 },
files: {
"file1": url
}
}
api.ajax({
url: apiurl + "/apiajax.ashx",
method: 'post',
contentType: "application/x-www-form-urlencoded; charset=utf-8",
data: datas,
report: true,
dataType: 'json'
},
function (data, status) {
if (data) {
if (data.status == 0) {
$('.processbox .child').css("width", data.progress + "%");
} else if (data.status == 1) {
uploading = 0;
$('.processbox').addClass("uhide");
video0 = data.body.url;
FileId = data.body.FileId;
$("#ysc_box").removeClass("uhide");
} else if (data.status == 2) {
uploading = 0;
$('.processbox').addClass("uhide");
tishi3("上传失败");
}
}
});*/
}
function onbz() {
if (ifupuser == 0) {
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; box-sizing:border-box;">
<div style="padding:0 0.8em;box-sizing:border-box;background-color:#fff;border-radius: 0.4em;">
<div class="ub ub-ver appadv_box" style="padding:0; box-sizing:border-box;">
<div class="ub appadv_title"><div class="ub">金额:</div><div class="ub-f1" id="ggje_box">0</div></div>
<div class="ub appadv_title" id="gxz_box"><div class="ub">贡献值:</div><div class="ub-f1" id="gxz_num">0</div></div>
<div class="ub appadv_title" id="bfcs_box"><div class="ub">展示次数:</div><div class="ub-f1" id="bfcs_num">0</div></div>
<div class="ub appadv_title" id="kscspsl_box"><div class="ub">可上传视频数量:</div><div class="ub-f1" id="kscspsl_num">0</div></div>
</div>
<div class="ub ub-ac company_box" id="city" style="margin-bottom: .04em;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:7em;">
所在地区<font color="red">*</font>
</div>
<div class="ub ub-f1" style="padding-right: 0;box-sizing:border-box;" onclick="getcity()">
<div class="ub-f1 uinput11">
<input id="area" type="text" disabled value="" style=" border:0; width: 100%;background:none;" />
</div>
<div class="ub ub-ac ub-pc" style="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 company_box" id="tjrbox" style="margin-bottom: .04em;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:7em;">
详细地址<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="padding-right: 0;box-sizing:border-box;">
<input type="text" id="txtAAddress" style="" />
</div>
</div>
<!--
<div class="ub ub-ac company_box" style="margin-bottom:.04em; box-sizing:border-box;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:7em;">
公司名称<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="padding-right: 0;box-sizing:border-box;">
<input type="text" id="txtName" style="" />
</div>
</div>
<div class="ub ub-ac company_box" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:7em;">
联系电话<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="padding-right: 0;box-sizing:border-box;">
<input type="text" id="txtTel" style="" />
</div>
</div>
<div class="ub ub-ac company_box" style="padding:1em 0;margin-top: .08em;">
<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 company_box" id="city" style="margin-bottom: .04em;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:7em;">
所在地区<font color="red">*</font>
</div>
<div class="ub ub-f1" style="padding-right: 0;box-sizing:border-box;" onclick="getcity()">
<div class="ub-f1 uinput11">
<input id="area" type="text" disabled value="" style=" border:0; width: 100%;background:none;" />
</div>
<div class="ub ub-ac ub-pc" style="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 company_box" id="tjrbox" style="margin-bottom: .04em;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:7em;">
详细地址<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="padding-right: 0;box-sizing:border-box;">
<input type="text" id="txtAAddress" style="" />
</div>
</div>
<div class="ub ub-ac company_box" id="tjrbox" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:7em;">
标注地图<font color="red">*</font>
</div>
<div class="ub ub-f1 ub-ver" style="padding-right: 0;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-bottom: .08em;">
<div class="ub ub-f1" style="padding:0.8em;width:4em;">
服务内容
</div>
<div class="ub ub-ac ub-pc" style="">
<div class="ub ub-ac ub-pc uinput11" style="padding: 0.6em">
<textarea id="txtfwbody" style=" width: 15em;height:5em;"></textarea>
</div>
</div>
</div>-->
<!--<div class="ub ub-ac uhide" id="uploadvideo_box" style="padding:1em 0; padding-bottom:0; background-color: #FFFFFF;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:7em;">
上传视频<font color="red">*</font>
</div>
<div class="ub ub-ac ub-ver" style="padding:0.8em 0; 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="video/mp4" />
</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 class="uhide ub ub-ac ub-pc" id="ysc_box">已上传</div>
</div>
<div class="ub ub-ac ub-f1" style="padding:0 0.8em; padding-left:0; box-sizing:border-box;">
<div class="uhide processbox">
<div class="child" style="width:0%">
</div>
</div>
</div>
</div>-->
<input id="Province" type="hidden" />
<input id="City" type="hidden" />
<input id="County" 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>
<div class="select_box_bg" onclick="closeselect()" style="bottom:2.8em;">
<div class="select_box" onclick="stopPropagation(event)" style="background-color:#fff;">
<div class="select_box_to" style="background-color:#fff;border:0;">
<div class="title_pic">
<div class="title" style="padding:0.8em 0;">
确认支付
</div>
<div class="close" style="top:0.3em;right:0.8em;" onclick='closeselect()'><img src="../image/close.png" /></div>
</div>
<div class="clear"></div>
<div class="selguige_box_to">
<div class="clear"></div>
<div class="tixin-item" style="margin-bottom:0.8em;border: 0;padding:0;background:none;">
<ul class="account" style="border: 0;border-top: 1px solid #f1f1f1;">
<li class="flex-end" onclick="onzftype(0)" id="zftype0">
<p>
<i><img src="../image/jianjinpay.png" /></i>
<span>余额支付</span>
</p>
<i class="current on"></i>
</li>
<li class="flex-end" onclick="onzftype(6)" id="zftype6">
<p>
<i><img src="../image/jianjinpay.png" /></i>
<span>佣金支付</span>
</p>
<i class="current"></i>
</li>
<li class="flex-end" onclick="onzftype(7)" id="zftype7">
<p>
<i><img src="../image/jianjinpay.png" /></i>
<span>KSD支付</span>
</p>
<i class="current"></i>
</li>
<li class="flex-end" onclick="onzftype(2)" id="zftype2">
<p>
<i><img src="../image/weixinpay.png" /></i>
<span>微信支付</span>
</p>
<i class="current"></i>
</li>
<li class="flex-end" onclick="onzftype(3)" id="zftype3">
<p>
<i><img src="../image/alipay.png" /></i>
<span>支付宝支付</span>
</p>
<i class="current"></i>
</li>
</ul>
</div>
<div class="clear"></div>
<input id="addtype" type="hidden" value="" />
</div>
</div>
</div>
</div>
</body>
</html>