Skip to content

Instantly share code, notes, and snippets.

@zason1001
Created April 6, 2017 09:55
Show Gist options
  • Select an option

  • Save zason1001/6fa0a7268a1d9ba78bc86e23c1f27303 to your computer and use it in GitHub Desktop.

Select an option

Save zason1001/6fa0a7268a1d9ba78bc86e23c1f27303 to your computer and use it in GitHub Desktop.
App城市索引列表
<!DOCTYPE html>
<html>
<!-- <script>
function stop(){
return false;
}
document.oncontextmenu=stop;
</script> -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>发布借款</title>
<link href="https://img.huijieapp.com/h5/css/mui.min.css" rel="stylesheet" />
<link href="https://img.huijieapp.com/h5/css/mui.indexedlist.css" rel="stylesheet" />
<style type="text/css">
body {
margin: 0 auto;
padding: 0;
}
body {
font-size: 15px;
color: #333;
background-color: #f5f5f9;
height: 100%;
overflow: hidden;
}
.mui-content {
background-color: #f5f5f9;
}
.warn {
position: relative;
height: 40px;
line-height: 15px;
padding: 6px 30px 6px 15px;
color: #666;
font-size: 12px;
background-color: #ffeead;
}
.mui-table-view.custom-table-view {
margin-bottom: 10px;
}
.mui-table-view.custom-table-view:before,
.mui-table-view.custom-table-view:after {
height: 0px;
}
.custom-table-view .mui-table-view-cell:after {
position: absolute;
right: 0;
bottom: 0;
left: 15px;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #fff;
}
.custom-table-view .mui-input-row {
border: none;
width: 100%;
height: 50px !important;
border-bottom: solid 1px #E5E5E5;
}
.custom-table-view .mui-input-row label {
font-family: 'Helvetica Neue', Helvetica, sans-serif;
line-height: 1.1;
float: left;
width: auto !important;
padding: 16px 0px 15px 10px;
color: #333;
}
.custom-table-view .mui-table-view-cell {
height: 60px;
border-bottom: solid 1px #E5E5E5;
position: static;
margin: 0px 15px;
padding: 11px 0px;
line-height: 60px;
}
/* .city-list {
height: 100%;
}
.city-list .mui-group-list {
height: 100%;
overflow-y: auto;
}
.city-list .mui-group-list-bar {
} */
#bottomBtn {
position: fixed;
height: 70px;
bottom: 0px;
width: 100%;
max-width: 750px;
font-size: 20px;
color: #fff;
background-color: #f5f5f9;
}
#buttonSubmit {
height: 45px;
border: 0px;
left: 4%;
top: 13px;
bottom: 15px;
width: 92%;
/*background-color: #8585FD;*/
color: #fff;
font-size: 15px;
}
#btn:hover {
background-color: #5858EC;
}
#btn:active {
background-color: #5858EC;
}
.selectBox {
position: relative;
padding-right: 30px!important;
width: 72%!important;
height: 46px!important;
border: 0;
font-size: 15px!important;
color: #ccc;
display: inline-block;
background: url("https://image4iou.oss-cn-hangzhou.aliyuncs.com/pro/h5_wx/assets/img/app_index/Rectangle.png") no-repeat;
background-size: auto 40%;
background-position: 95%;
}
@media(min-width:360px) {
#tecent_geo {
padding-left: 15px!important;
}
}
@media(min-width:375px) {
.selectBox {
width: 75%!important;
}
#tecent_geo {
padding-left: 10px!important;
}
.mui-group-list-bar {
background-color: #fff;
height: 590px!important;
padding-top: 10px;
}
}
@media(min-width:414px) {
.selectBox {
width: 78%!important;
}
.mui-group-list-bar {
background-color: #fff;
height: 615px!important;
padding-top: 10px;
}
}
@media(min-width:540px) {
#tecent_geo {
padding-left: 35px!important;
}
}
@media(min-width:720px) {
#tecent_geo {
padding-left: 74px!important;
}
}
@media(min-width:768px) {
#tecent_geo {
padding-left: 85px!important;
}
}
#bg {
display: none;
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1001;
-moz-opacity: 0.7;
opacity: .70;
filter: alpha(opacity=70);
}
#show {
display: none;
top: 30%;
text-align: center;
position: fixed;
width: 100%;
padding: 6px;
z-index: 1002;
overflow: auto;
/* opacity: 0.1; */
}
#show1 {
/* display: none; */
/* top: 30%; */
/* text-align: center; */
position: fixed;
width: 100%;
height: 100%;
/* padding: 6px; */
z-index: 1002;
overflow: auto;
/* opacity: 0.1; */
}
.ui-label-list {
font-size: 14px;
color: #666;
padding: 10px 15px;
}
.ui-label-s {
height: 28px;
width: 30%;
text-align: center;
line-height: 28px;
border-radius: 3px;
background-color: #f5f5f9;
padding: 0px 10px;
margin: 5px 0px 5px 0px;
display: inline-block;
}
.mui-group-list-group {
background-color: #f5f5f9;
}
.mui-table-view-divider {
position: initial;
}
.mui-group-list-bar {
background-color: #fff;
height: 480px;
padding-top: 10px;
}
.mui-group-list-bar.active {
background-color: #fff;
}
.mui-group-list-bar a {
color: #8481ff;
}
</style>
<script src="//cdn.staticfile.org/raven.js/3.12.1/raven.min.js"></script>
<script>
Raven.config('https://6cacff5fdfae471a87ed6b19720143de@sentry.io/145230').install();
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?5dadd5d3ac19312b946ea04b380ccae5";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body>
<div id="bg"></div>
<div id="show">
<div class="showContent" style="width:90%;height:140px;background-color:#fff;margin:0 auto;border-radius:10px;">
<!--<div style="color:#333;padding:20px 5px 15px 5px;">
<img src="https://img.huijieapp.com/h5/xuanzhe_h.png" style="width: 20px;margin-bottom: -3px;"/>
恭喜您注册成功!</div>-->
<div style="color:#333;padding:20px 20px 0px 20px;">是否允许"金牛贷"获取位置?</div>
<div style="color:#333;padding:20px 20px 15px 20px;border-bottom:1px solid #e5e5e5;">获取您的位置,借款流程更流畅哦~</div>
<div style="color:#8481ff;width:100%;margin-bottom:20px;background-color:#fff;">
<div id="cancel" style="text-align:center;padding-top:10px;height:40px;width: 50%;float: left;border-right: 1px solid #e5e5e5;">不允许</div>
<div id="quickDownload" style="text-align:center;padding-top:10px;height:40px;width: 50%;float: right;">允许</div>
</div>
</div>
</div>
<div id="show1" style="display:none">
<img id="closeCity" src="http://huijieapp.oss-cn-shanghai.aliyuncs.com/h5/xdj/guanbi.png" style="z-index: 1002;width:20px;float: right;position: absolute;top: 10px;right: 10px;" />
<div class="showContent" style="width:100%;height:100%;background-color:#fff;">
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="display:none;"></a>
<h1 class="mui-title">城市列表</h1>
</header>
<div class="mui-content city-list">
<div id='list' class="mui-group-list">
<div class="mui-group-list-search mui-input-row mui-search" style="display: none;">
<input id="input_search" type="search" class="mui-input-clear mui-group-list-search-input" placeholder="搜索城市">
</div>
<div class="mui-group-list-bar" id="alphabet">
<!--<a>#</a>
<a>热</a>-->
</div>
<div class="mui-group-list-alert"></div>
<div class="mui-group-list-inner">
<div class="mui-group-list-empty-alert">没有数据</div>
<ul id="ul_city" class="mui-table-view">
<li data-group="当前定位城市" class="mui-table-view-divider mui-group-list-group">当前定位城市</li>
<div class="hotCity">
<div class="ui-label-list" style="display:block;">
<label class="ui-label-s" data="A" onclick="tag(this);" id="dingWei"></label>
<label class="ui-label-s" data="A" id="dingWeiError"></label>
<label>当前定位城市</label>
</div>
</div>
<li data-group="热门城市" class="mui-table-view-divider mui-group-list-group">热门城市</li>
<div class="hotCity">
<div class="ui-label-list">
<label class="ui-label-s" data="A" onclick="tag(this);">深圳市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">成都市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">重庆市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">广州市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">上海市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">武汉市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">北京市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">苏州市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">杭州市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">东莞市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">西安市</label>
<label class="ui-label-s" data="A" onclick="tag(this);">宁波市</label>
</div>
</div>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="mui-content">
<div class="warn">
提示:添加真实信息,会加速您的放款过程,信息完整或不真实可能会影响您的个人信用和贷款结果
<img id="close" src="http://huijieapp.oss-cn-shanghai.aliyuncs.com/h5/xdj/guanbi.png" style="width:20px;float: right;position: absolute;top: 10px;right: 10px;" />
</div>
<ul class="mui-table-view custom-table-view">
<!--<li class="mui-input-row">
<label>放款金额:</label>
<input type="text" id="money" name="money" maxlength=8 placeholder="请输入您的放款金额" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')};" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')};" style="position: absolute; font-size:15px;font-color:#333!important;width:100%;height:47px;border:0;">
<label style="padding-left:30px;float:right;">元</label>
</li>-->
<li class="mui-input-row">
<label>贷款用途:</label>
<!-- <input type="text" id="days" name="days" maxlength=8 placeholder="请输入您的放款期限" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')};" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')};" style="position: absolute; font-size:15px;font-color:#333!important;width:100%;height:47px;border:0;"> -->
<select tabindex="1" name="yongtu" id="yongtu" class="selectBox" onchange='changeOption(this)'>
<option value="-1" disabled selected style='display:none;'>请输入贷款的目的</option>
</select>
</li>
<li class="mui-input-row">
<label>贷款金额:</label>
<select tabindex="1" name="money" id="money" class="selectBox" onchange='changeOption(this)'>
<option value="-1" disabled selected style='display:none;'>请输入贷款的金额</option>
</select>
</li>
<li class="mui-input-row">
<label>贷款期限:</label>
<select tabindex="1" name="days" id="days" class="selectBox" onchange='changeOption(this)'>
<option value="-1" disabled selected style='display:none;'>请输入贷款期限</option>
</select>
</li>
<li class="mui-input-row">
<label>职业身份:</label>
<select tabindex="1" name="identity" id="identity" class="selectBox" onchange='changeOption(this)'>
<option value="-1" id="defaultOpt" disabled selected style='display:none;'>请选择您的职业身份</option>
</select>
</li>
<li class="mui-input-row" id="showCitylist">
<label>所在城市:</label>
<label id="tecent_geo" disabled selected style='color:#ccc;padding-left:5px;'>请选择您所在城市</label>
<img src="https://image4iou.oss-cn-hangzhou.aliyuncs.com/pro/h5_wx/assets/img/app_index/Rectangle.png" style="float: right;width: 9px;margin: 15px 3.5%;" />
</li>
</ul>
<!--<input type="button" id="buttonSubmit" class="operationButton" value="放款给朋友" >-->
<div id="bottomBtn">
<button id="buttonSubmit" onclick="">下一步</button>
</div>
</div>
<input type="hidden" id="lat" value="">
<input type="hidden" id="lng" value="">
<input type="hidden" id="app_user_status" value="">
<script src="https://img.huijieapp.com/h5/js/jquery.min.js"></script>
<script src="https://img.huijieapp.com/h5/js/mui.min.js"></script>
<script src="https://img.huijieapp.com/h5/js/layer.m.js"></script>
<script src="https://img.huijieapp.com/h5/js/common.js"></script>
<script src="https://img.huijieapp.com/h5/js/mui.indexedlist.js"></script>
<script type="text/javascript" src="//3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
<script type="text/javascript">
$('#showCitylist').on('click', function() {
$('#show1').toggle();
showCitylist();
})
$('#bg').on('click', function() {
$(this).hide()
})
$('#cancel').on('click', function() {
hideDiv();
$("#dingWeiError").html("定位失败");
$("#dingWei").css('display', 'none');
})
var hideDiv = function() {
$('#bg').hide()
$('#show').hide()
$('#show1').hide()
}
$("#quickDownload").click(function() {
hideDiv()
//getLocation();//允许获取城市定位
// geolocation.getLocation(showPosition, showErr, options);
})
var geolocation = new qq.maps.Geolocation("U66BZ-S4NCR-37ZW2-W3BOR-Y7AAK-XAFER", "huijieapp");
positionNum = 0;
options = {
timeout: 8000
};
function showPosition(position) {
//alert(JSON.stringify(position));
$("#tecent_geo").html(position.city);
$("#dingWei").html(position.city);
$("#lat").val(position.lat);
$("#lng").val(position.lng);
// lat = position.lat;
// lng = position.lng;
//console.log(lat)
$("#dingWeiError").css('display', 'none');
$("#tecent_geo").css("color", "#333");
};
function showErr() {
$("#tecent_geo").html("定位失败,请手动选择城市");
$("#dingWeiError").html("定位失败");
$("#dingWei").css('display', 'none');
//$("#cities").val("0");
$("#tecent_geo").css("color", "#333");
};
function tag(a) {
var hotCityName = $(a).html();
$("#tecent_geo").css("color", "#333");
$("#tecent_geo").html(hotCityName);
hideDiv();
}
String.prototype.format = function(args) {
var result = this;
if (arguments.length > 0) {
if (arguments.length == 1 && typeof(args) == "object") {
for (var key in args) {
if (args[key] != undefined) {
var reg = new RegExp("({" + key + "})", "g");
result = result.replace(reg, args[key]);
}
}
} else {
for (var i = 0; i < arguments.length; i++) {
if (arguments[i] != undefined) {
var reg = new RegExp("({[" + i + "]})", "g");
result = result.replace(reg, arguments[i]);
}
}
}
}
return result;
};
/* var citiesList = {} */
var newList = {},
cityArray = [];
var lat, lng;
$(function() {
getData();
$.getJSON("https://img.huijieapp.com/h5/json/cityList.json", function(data) {
//console.log(data);
$.each(data.RECORDS.RECORD || [], function(k, v) {
if (newList.hasOwnProperty(v.hotKey)) {
newList[v.hotKey].push(v);
} else {
newList[v.hotKey] = [];
newList[v.hotKey].push(v);
cityArray.push(v.hotKey);
}
});
cityArray.sort();
//alert(JSON.stringify(data.RECORDS.RECORD));
var html = '';
var alphabetHtml = '';
$.each(cityArray, function(k, v) {
alphabetHtml += '<a>{0}</a>'.format(v)
html += '<li data-group="{0}" class="mui-table-view-divider mui-group-list-group">{0}</li>'.format(v);
$.each(newList[v] || [], function(m, n) {
html += '<li class="mui-table-view-cell mui-group-list-item">{0}</li>'.format(n.city);
})
})
//console.log(html)
$("#alphabet").append(alphabetHtml);
$("#ul_city").append(html);
});
})
$("#close").click(function() {
$(".warn").css("display", "none");
})
$("#closeCity").click(function() {
$("#show1").hide();
})
function changeOption(ele) {
$(ele).css("color", "#333");
}
$(function() {
// showdiv();
var $yongtu = $('#yongtu');
var $money = $('#money');
var $days = $('#days');
var $identity = $('#identity');
var $cities = $('#cities');
var $buttonSubmit = $('#buttonSubmit');
$buttonSubmit.on('click', function() {
var yongtu = $yongtu.val();
var money = $money.val();
var days = $days.val();
var identity = $identity.val();
var cities = $cities.val();
if ($("#yongtu option:selected").val() == '-1') {
showMessage('请输入贷款用途');
return;
} else if ($("#money option:selected").val() == '-1') {
showMessage('请输入贷款金额');
return;
} else if ($("#days option:selected").val() == '-1') {
showMessage('请输入贷款期限');
return;
} else if ($("#identity option:selected").val() == '-1') {
showMessage('请输入职业身份');
return;
} else if ($("#tecent_geo").html() == '定位失败,请手动选择城市' || $("#tecent_geo").html() == '定位失败') {
showMessage('请选择所在城市');
return;
} else {
//下一步到信用信息页面
var identityType = $("#identity option:selected").val(); // 职业身份类型
document.cookie = "yongtu=" + $("#yongtu option:selected").val();
document.cookie = "money=" + $("#money option:selected").val();
document.cookie = "days=" + $("#days option:selected").val();
document.cookie = "identity=" + $("#identity option:selected").val();
// document.cookie="cities="+$("#cities option:selected").html();
document.cookie = "cities=" + escape($("#tecent_geo").html());
document.cookie = "union=" + url_track_param.track.union;
document.cookie = "track_id=" + url_track_param.track.track_id;
document.cookie = "product=" + url_track_param.product;
document.cookie = "from=" + from;
//alert(document.cookie);
if (appFrom == 'com.jinniudai.iphone' || appFrom == 'com.huijie.bull') {
//点击后改变css样式
$("#buttonSubmit").css("background-color", "#EC4C2C");
//alert(app_user_status);
window.location.href = window.location.protocol + '//' +
window.location.host + '/h5/iou/thirdReleaseLoan/creditInfo.html' +
'?common_json=' + common_json +
// '&tracking=' + tracking +
"&identityType=" + identityType +
"&is_identified=" + app_user_status +
"&identify_type=" + identify_type;
} else {
if (quick_auth_token == null || quick_auth_token == "" || quick_auth_token == undefined) {
//alert(JSON.stringify(common_json));
//合作渠道>>>正常注册流程
window.location.href = window.location.protocol + '//' +
window.location.host + '/h5/iou/thirdReleaseLoan/creditInfo.html' +
'?common_json=' + common_json +
'&tracking=' + tracking +
"&identityType=" + identityType +
"&is_identified=" + is_identified +
"&identify_type=" + identify_type;
} else {
//合作渠道>>>免密登录流程
if (!($("#lat").val() == "" || $("#lat").val() == null || $("#lat").val() == undefined)) {
common_json.lat = $("#lat").val();
common_json.lng = $("#lng").val();
}
//console.log(common_json);
window.location.href = window.location.protocol + '//' +
window.location.host + '/h5/iou/thirdReleaseLoan/creditInfo.html' +
'?common_json=' + JSON.stringify(common_json) +
'&tracking=' + tracking +
"&identityType=" + identityType +
"&is_identified=" + is_identified +
"&identify_type=" + identify_type;
}
}
}
});
});
var common_json;
var appFrom; //注册应用来源
var is_identified = getUrlParam("is_identified"); // 是否认证
var identify_type; // 发布订单 认证类型
var app_user_status;
// 记录 URL 上的跟踪参数信息
var url_track_param = {
track: {
union: getUrlParam('union') || undefined,
track_id: getUrlParam('track_id') || undefined,
},
product: getUrlParam('product') || undefined
};
var tracking = getUrlParam('tracking')
if (!tracking) {
tracking = encodeURIComponent(JSON.stringify({
track: url_track_param.track,
product: url_track_param.product
}))
//console.log("1111"+decodeURIComponent(JSON.stringify(tracking)));
}
var new_user = getUrlParam("new_user");
var product = getUrlParam("product");
var user_id = getUrlParam("user_id");
var client_user_id = getUrlParam("client_user_id");
var track_id = getUrlParam("track_id");
var from = getUrlParam("from");
var union = getUrlParam("union");
var quick_auth_token = getUrlParam("quick_auth_token"); //是否免密登陆
// function geodocder(response) {
// console.log(response.result)
// }
function getData() {
common_json = decodeURIComponent(getUrlParam("common_json")); // 正常注册入口进来或金牛贷App
// console.log(common_json);
// console.log(getUrlParam("common_json"));
var data = {
common_json: common_json
};
appFrom = JSON.parse(common_json || '{}').from;
var lat = JSON.parse(common_json || '{}').lat;
var lng = JSON.parse(common_json || '{}').lng;
// console.log(lat);
// console.log(lng);
if (appFrom == 'com.jinniudai.iphone' || appFrom == 'com.huijie.bull') {
//alert(common_json);
//改变css样式
$("#buttonSubmit").css("background-color", "#FF6142");
//获取用户是否实名认证
getUserStatus();
$.ajax({
type: "GET",
url: "http://apis.map.qq.com/ws/geocoder/v1?coord_type=1&location=" + lat + "," + lng + "&key=U66BZ-S4NCR-37ZW2-W3BOR-Y7AAK-XAFER&output=jsonp",
dataType: 'jsonp',
success: function(response) {
//console.log(JSON.stringify(response.result.address_component.city));
var current_city = response.result.address_component.city;
$("#tecent_geo").html(current_city);
$("#dingWei").html(current_city);
$("#tecent_geo").css("color", "#333");
$("#dingWeiError").css('display', 'none');
},
});
} else {
$("#buttonSubmit").css("background-color", "#8585FD");
geolocation.getLocation(showPosition, showErr, options);
}
//合作渠道免密登陆进入,需自定义common_json
//console.log(typeof(common_json))
if (common_json == null || common_json == "" || common_json == undefined) {
appFrom = from;
common_json = {
"c_id": "normal",
"d_id": "fromWeb",
"lat": "30.2819429999999982783265295438468456268310546875",
"lng": "120.0730420000000009395080269314348697662353515625",
"p": "web",
"from": from,
"ver": "2.3.0",
"q_token": quick_auth_token,
"u_id": client_user_id,
"timestemp": "1484618895792"
}
data = {
common_json: JSON.stringify(common_json)
};
}
if (tracking) {
data['data_json'] = tracking
}
//console.log(JSON.stringify(data));
$.ajax({
type: "POST",
url: window.location.protocol + '//' +
window.location.host +
'/iou-site/api/web/create_loan_order_entry.json',
data: data,
dataType: "JSON",
success: function(response) {
//console.log(JSON.stringify(response));
if (response.code == '1') {
var data = response.data.detail;
identify_type = data.identify_type; // 发布订单 认证类型 1 认证允许实名和非实名 2 认证只允许实名 3 只允许非实名
var purpose_list = data.purpose.list;
var money_list = data.money.list;
var days_list = data.time_limit.list;
var job_identity = data.job_identity;
var job_identity_list = data.job_identity.list;
var info = $("#yongtu");
var showYongtuContent = "";
var showMoneyContent = "";
var showDaysContent = "";
var showShenfenContent = "";
var showCityContent = "";
//贷款用途
for (var i = 0; i < purpose_list.length; i++) {
showYongtuContent += "<option value=\'" + purpose_list[i].code + "'\>" + purpose_list[i].name + "</option>";
}
$("#yongtu").append(showYongtuContent);
//贷款金额
for (var i = 0; i < money_list.length; i++) {
showMoneyContent += "<option value=\'" + money_list[i].code + "'\>" + money_list[i].name + "</option>";
}
$("#money").append(showMoneyContent);
//借款期限
for (var i = 0; i < days_list.length; i++) {
showDaysContent += "<option value=\'" + days_list[i].code + "'\>" + days_list[i].name + "</option>";
}
$("#days").append(showDaysContent);
//职业身份
for (var i = 0; i < job_identity_list.length; i++) {
if (job_identity.c_code == job_identity_list[i].code) {
$('#identity').attr('style', 'color: #333');
showShenfenContent += "<option value=\'" + job_identity_list[i].code + "'\ selected>" + job_identity_list[i].name + "</option>";
} else {
showShenfenContent += "<option value=\'" + job_identity_list[i].code + "'\>" + job_identity_list[i].name + "</option>";
}
}
$("#identity").append(showShenfenContent);
var html = '';
$.each(cityArray, function(k, v) {
html += '<option disabled="">{0}</option>'.format(v);
$.each(newList[v] || [], function(m, n) {
html += "<option value=\'" + n.baiduid + "'\>" + n.city + "</option>";
});
});
$("#cities").append(html);
} else {
//alert(response.message)
}
},
error: function(response) {
}
});
}
function getUserStatus() {
//alert(JSON.stringify(common_json));
$.ajax({
type: "POST",
url: window.location.protocol + '//' + window.location.host + "/iou-site/api/user/get_user_info.json",
data: {
common_json: common_json,
},
dataType: "JSON",
success: function(response) {
//alert(JSON.stringify(response));
if (response.code == '1') {
var identification = response.data.detail.identification;
if (identification & 1 > 0) {
app_user_status = true;
//alert("true:" + app_user_status);
} else {
app_user_status = false;
//alert("false:" + app_user_status);
}
} else {
console.log(response.message)
}
},
error: function(response) {
console.log(response.message);
}
});
};
/*
function changeProfit(){
var money=$('#money').val();
var profitMoney=$('#profitMoney').val();
var days=$("#days option:selected").val();
if(money && profitMoney){
if (days!='-1'){
var yearProfit=(profitMoney*100*360/money/(days*1)).toFixed(2);
$("#percent_profit").html(yearProfit+"%");
}
}
} */
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) {
return decodeURIComponent(r[2]);
}
return ''; //返回参数值
}
mui.init();
var showCitylist = function() {
var header = document.querySelector('header.mui-bar');
var list = document.getElementById('list');
list.style.height = (window.screen.availHeight - header.offsetHeight) + 'px';
if (!window.groupList) {
window.groupList = new mui.GroupList(list);
}
}
//点击列表选择城市
$('#ul_city').on('tap', function(e) {
// e.preventDefault();
setTimeout(function() {
var tagClass = e.target.getAttribute("class");
//console.log("tagClass==" + tagClass);
if (tagClass && tagClass.indexOf("mui-table-view-cell") != -1) {
var selectCity = e.target.innerText;
//console.log("选择的城市=" + selectCity);
$("#tecent_geo").text(selectCity);
$('#show1').hide();
}
}, 350)
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment