7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
544 lines
28 KiB
HTML
544 lines
28 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<title>搭配-e订通</title>
|
|
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico" />
|
|
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css">
|
|
<link rel="stylesheet" href="index.css">
|
|
<style>
|
|
.pcki-page {overflow-x: hidden; overflow-y: scroll; -webkit-overflow-scrolling: touch;}
|
|
#content #info .title{color: #9b9b9b; text-align: right;}
|
|
#content #info .text{font-weight: bold; text-align: left;}
|
|
#dks td>div {padding: 1px;}
|
|
.kh_list-container {position: relative;}
|
|
.kh_list-container .kh_hide{display:none;min-width:100%;position:absolute;right:0px;bottom:23px;background:#f5f5f5;filter:alpha(Opacity=90);-moz-opacity:0.9;opacity: 0.9;}
|
|
.kh_list-container .kh_hide table {margin: auto;}
|
|
#dks .-body input { max-width: 80px; margin: auto;}
|
|
#dks .-body .layui-input { padding-left: 0px;}
|
|
</style>
|
|
<!-- 引入 -->
|
|
|
|
<!-- jquery -->
|
|
<script src="js/jquery.min.js"></script>
|
|
|
|
<script src="layuiadmin/layui/layui.js"></script>
|
|
<script src="js/function.js"></script>
|
|
<!-- universal -->
|
|
<link rel="stylesheet" href="js/universal/universal.css">
|
|
<script src="js/universal/universal.js"></script>
|
|
<!-- p_custom_keyboard js -->
|
|
<link rel="stylesheet" href="js/p_custom_keyboard/p_custom_keyboard.css">
|
|
<script src="js/p_custom_keyboard/p_custom_keyboard.js"></script>
|
|
<!-- viewer js -->
|
|
<link rel="stylesheet" href="js/viewer/viewer.min.css">
|
|
<script src="js/viewer/viewer.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<div class="pcki-page">
|
|
<!-- 顶部标题栏 -->
|
|
<div class="state_bar">
|
|
<div class="text_title">搭配详情</div>
|
|
<div class="btn_close" onclick="close_this_frame();"><img src="images/close.png" width=30 height=30 border=0></div>
|
|
</div>
|
|
<!--头部 上下款 搜索-->
|
|
<div class="header">
|
|
<a id="btn-prev" class="-btn-into" style="position: absolute; top: 0; left: 20px;"><i class="layui-icon layui-icon-left"></i>上一组</a>
|
|
<div id="s-title" class="layui-input-inline" style="width: 20%; margin-right: 10px; max-width: 150px; min-width: 100px;"><input type="text" name="" placeholder="搭配号" class="layui-input" style="border-radius:10px 10px 10px 10px;"></div>
|
|
<a id="btn-search" class="layui-btn layui-input-inline" style="border-radius:10px 10px 10px 10px; background-color: #F04122; padding: 0 10px;">查询</a>
|
|
<a id="btn-next" class="-btn-into" style="position: absolute; top: 0; right: 20px;">下一组<i class="layui-icon layui-icon-right"></i></a>
|
|
</div>
|
|
<!-- 信息层 -->
|
|
<div id="content">
|
|
<div class="" style="margin-top: 20px; margin-bottom: 20px;">
|
|
<div id="pic" style="box-shadow: 1px 1px 10px 3px #d0d0d0; width: 300px; height: 400px; line-height: 400px;"></div>
|
|
</div>
|
|
<div style="margin: 5px 0;">
|
|
<div id="remark"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="layui-bg-gray">
|
|
<form class="layui-form">
|
|
<!-- 单款详细 -->
|
|
<input id="zsh" name="zsh" style="display: none;">
|
|
<input id="uid" name="uid" style="display: none;">
|
|
<input id="ks_bx_num" name="ks_bx_num" style="display: none;">
|
|
<table id="dks" class="pck-input-wrapper" style="width: 96%; margin: auto;"></table>
|
|
<hr class="layui-bg-gray">
|
|
<!-- 保存 -->
|
|
<div id="dk-opt-box" style="text-align: right;">
|
|
<a id="dk-save" lay-submit lay-filter="dk-save" class="layui-btn" style="background-color: #F04122; margin-right: 10px;">保存订单</a>
|
|
<hr class="layui-bg-gray">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
var is_mobile="n"
|
|
,dp_data // 全局数据
|
|
,original_dd = ""
|
|
,to_page_zsh
|
|
,$
|
|
|
|
layui.config({
|
|
base: './layuiadmin/'
|
|
}).extend({
|
|
index: 'lib/index'
|
|
}).use(['index', 'user','rate'], function(){
|
|
$ = layui.$
|
|
var setter = layui.setter
|
|
,admin = layui.admin
|
|
,form = layui.form
|
|
,rate = layui.rate
|
|
|
|
|
|
var url="./?_m=dp&_a=single&zsh="+get_url_param("zsh");
|
|
$.ajax(
|
|
{
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var json_data=$.parseJSON(res);
|
|
//alert(json_data.ver);
|
|
if(json_data.code==0){
|
|
//------------------本页返回的错误信息
|
|
layer.msg(json_data.msg);
|
|
}else if(json_data.code==1){
|
|
//------------------系统错误
|
|
var msg=json_data.msg;
|
|
var url1="error.htm?msg="+json_data.msg+"&btn_title="+json_data.btn_title+"&btn_url="+json_data.btn_url;
|
|
var obj1=window.parent.parent?window.parent.parent:window.parent; obj1.location.href=url1;
|
|
}else if(json_data.code==2){
|
|
//------------------重新登录
|
|
url1="login.htm?error_msg="+json_data.msg;
|
|
var obj1=window.parent.parent?window.parent.parent:window.parent; obj1.location.href=url1;
|
|
}else{
|
|
//------------------填充内容
|
|
console.log(["初始", json_data])
|
|
|
|
// safari中iframe内的页面宽度会莫名其妙多一点出来,此处强制将本页宽度修正
|
|
$(".pcki-page").width($(self.frameElement).parents(".layui-layer-iframe").width())
|
|
// 修复iphone端,点击按钮时自动滚到页面顶部以及附带的其他一些问题
|
|
$(".pcki-page").height($(self.frameElement).parents(".layui-layer-iframe").height())
|
|
|
|
dp_data = json_data
|
|
//------------上一组
|
|
if (json_data.prev != "") {
|
|
$("#btn-prev").attr("href", "javascript:toPage("+json_data.prev+")")
|
|
} else {
|
|
$("#btn-prev").attr("href", "javascript:layui.layer.msg('已经是第一组了。')")
|
|
}
|
|
//------------下一组
|
|
if (json_data.next != "") {
|
|
$("#btn-next").attr("href", "javascript:toPage("+json_data.next+")")
|
|
} else {
|
|
$("#btn-next").attr("href", "javascript:layui.layer.msg('已经是最后一组了。')")
|
|
}
|
|
//------------展示图片
|
|
$("#content #pic").append("<img data-original='"+json_data.pic_big+"' src='"+json_data.pic_big+"' style='width: "+json_data.pic_big_w+"px; height: "+json_data.pic_big_h+"px; max-width: 300px; max-height: 400px;' watermark>")
|
|
new Viewer(document.getElementById("pic"), {
|
|
url: 'data-original'
|
|
,toolbar: false
|
|
,title: false
|
|
,rotatable: false
|
|
,backdrop: false // 点击非图片层关闭
|
|
,viewed: function(event) {
|
|
USetWatermark({
|
|
el: $(event.detail.image)
|
|
,is_sy: json_data.is_sy
|
|
,text: json_data.username
|
|
,font_size: 64
|
|
})
|
|
}
|
|
})
|
|
//------------说明
|
|
$("#content #remark").html(json_data.dp_remark)
|
|
//------------zsh
|
|
$("#zsh").val(json_data.zsh)
|
|
//------------uid
|
|
$("#uid").val(json_data.uid)
|
|
//------------ks_bx_num
|
|
$("#ks_bx_num").val(json_data.ks_bx_num)
|
|
//------------单款详细
|
|
//--------表头
|
|
var dk_header = "<tr class='-header'>"
|
|
,col_count = 0 // 表头单元列列数(单元列:长度1的列),用于调整列宽
|
|
,cm_front_count = 0 // 尺码前列数,用于放置“合计”的位置
|
|
dk_header += "<td dk-w='3'>单款信息</td>"
|
|
col_count += 3
|
|
cm_front_count++
|
|
dk_header += "<td dk-w='1'>颜色</td>"
|
|
col_count++
|
|
cm_front_count++
|
|
if (json_data.bx_sizegroup_id && json_data.bx_sizegroup_id != "0") {
|
|
dk_header += "<td dk-w='1'>杯型</td>"
|
|
col_count++
|
|
cm_front_count++
|
|
} else if (json_data.child_sizegroup_id && json_data.child_sizegroup_id != "0") {
|
|
dk_header += "<td dk-w='1'>款型</td>"
|
|
col_count++
|
|
cm_front_count++
|
|
}
|
|
if (json_data.have_ggk != "n") {
|
|
dk_header += "<td dk-w='1'>"+json_data.translate_gg+"</td>"
|
|
col_count++
|
|
cm_front_count++
|
|
}
|
|
if (json_data.have_ggk == "y") {
|
|
dk_header += "<td dk-w='1'>"+json_data.translate_gg1+"</td>"
|
|
col_count++
|
|
cm_front_count++
|
|
}
|
|
if (json_data.pm_ms == "m2") {
|
|
dk_header += "<td dk-w='1'>手数</td>"
|
|
col_count++
|
|
cm_front_count++
|
|
}
|
|
dk_header += "<td colspan='?' dk-w='5' class='-col-cm'>尺码</td>"
|
|
col_count += 5
|
|
dk_header += "<td dk-w='1'>小计</td>"
|
|
col_count++
|
|
if (json_data.sys_ver_hy == "xz") { // 若sys_ver_hy=xz,则跳转到单款下单
|
|
dk_header += "<td dk-w='1'></td>"
|
|
col_count++
|
|
}
|
|
dk_header += "</tr>"
|
|
$("#dks").append(dk_header)
|
|
$("#dks .-header td").each(function() {
|
|
$(this).width(100/col_count*parseInt($(this).attr("dk-w"))+"%") // 调整列宽
|
|
})
|
|
//--------表身
|
|
var same_color_flag = 0 // 同款行标志,>0:同款,用于有无规格时样式
|
|
,dk_all_total = 0 // 总合计
|
|
,max_cm_col_count = 0 // 最大尺码列数,用于规范尺码列数样式
|
|
for (var i = 0; i < json_data.dks.length; i++) {
|
|
var dk = json_data.dks[i] // 行数据
|
|
,dk_body_elem = "<tr pcki-mode='row' class='-body'>" // 行文本
|
|
,current_cm_col_count = 0 // 当前行实际尺码列数
|
|
if (same_color_flag == 0) $("#dks").append("<tr class='-line'><td><hr class='layui-bg-gray'></td></tr>") // 单款分割线
|
|
for (var j = 0; j < dk.dd.length; j++) {
|
|
var ddl = dk.dd[j]
|
|
switch(ddl.no) {
|
|
case "1": // 单款信息格等
|
|
if (j==0) { // 单款信息格
|
|
if (same_color_flag == 0) {
|
|
dk_body_elem += "<td rowspan='"+dk.ggs+"' class='layui-row kh_list-container'>"
|
|
dk_body_elem += "<input pcki-mode='none' name='khid_"+i+"' value='"+dk.khid+"' style='display:none;'>"
|
|
dk_body_elem += "<input pcki-mode='none' name='color_"+i+"' value='"+dk.color+"' style='display:none;'>"
|
|
dk_body_elem += "<div class='layui-col-lg6 layui-col-md6 layui-col-sm6 layui-col-xs6 layui-col-xxs12' style=''><a href='javascript:openDkSingle("+dk.khid+")'><div style='width: 100px; height: 100px; line-height: 100px;'>"
|
|
dk_body_elem += "<img src='"+dk.pic+"' style='max-width: 100px; max-height: 100px;' watermark>" // div1 > pic
|
|
if (json_data.bs_kh_dj == "word" && dk.kh_dj) {
|
|
dk_body_elem += "<span style='position: absolute; top: 0; left: 0; width: 18px; word-wrap: break-word; background-color: #F06054; color: white; padding: 4px 2px; border-radius: 4px; z-index: 9; line-height: 20px;'>"+dk.kh_dj+"</span>"
|
|
} else if (json_data.bs_kh_dj == "pic" && dk.kh_dj) {
|
|
dk_body_elem += "<img src='../attachments/"+dk.kh_dj+".png' style='position: absolute; top: 0; left: 0;' watermark>"
|
|
}
|
|
dk_body_elem += "</div></a></div>"
|
|
dk_body_elem += "<div class='layui-col-lg6 layui-col-md6 layui-col-sm6 layui-col-xs6 layui-col-xxs12' style=''>" // div2
|
|
dk_body_elem += "<a href='javascript:openDkSingle("+dk.khid+")'><div id='"+ddl.id+"' style='"+dk.sty1+" display: inline-block;'>"+ddl.value+"</a></div>" // > info
|
|
|
|
//---- > xj_big
|
|
dk_body_elem += "<div id='kh_hide_"+dk.khid+"' class='kh_hide'>"
|
|
dk_body_elem += "<div id='div_pj_"+dk.khid+"_icon_big'>"+get_pj_icon(dk.xj,dk.khid,"big","y")+"</div>"
|
|
dk_body_elem += "<div class='div_button_del_pj' style='display:"+(dk.xj > 0 ? "" : "none")+"; padding: 1px;' id='div_button_del_pj_"+dk.khid+"'><a type='button' id='button_del_pj_"+dk.khid+"' class='layui-btn layui-btn-sm button_del_pj' onclick='del_pj("+dk.khid+")' style='background-color:#F04122;'>删除评价</a></div>"
|
|
dk_body_elem += "</div>"
|
|
//---- end > xj_big
|
|
dk_body_elem += "<div class='xj' id='div_pj_"+dk.khid+"_icon_mini' onclick='show_hide_kh_hide("+dk.khid+")' style='float: right;'>"+get_pj_icon(dk.xj,dk.khid,"mini","n")+"</div>" // > xj_mini
|
|
dk_body_elem += "</div>"
|
|
dk_body_elem += "</td>"
|
|
same_color_flag = dk.ggs - 1
|
|
} else {
|
|
same_color_flag--
|
|
break
|
|
}
|
|
} else { // 规格等其他
|
|
dk_body_elem += "<td><span>"+ddl.value+"</span></td>"
|
|
}
|
|
break
|
|
case "2": // 颜色格
|
|
var ggs = parseInt(dk.ggs ? dk.ggs : '0')
|
|
if (same_color_flag === ggs - 1) {
|
|
dk_body_elem += "<td rowspan='"+dk.ggs+"'>"
|
|
dk_body_elem += (dk.ka != "y" ? "<span>"+ddl.value+"</span>" : "<span style='color: #F04122;'><s class='del-color'>"+ddl.value+"</s></span>")
|
|
dk_body_elem += "<input pcki-mode='none' name='bx_"+i+"' value='"+dk.bx+"' style='display:none;'>"
|
|
dk_body_elem += "</td>"
|
|
}
|
|
break
|
|
case "3": // 尺码格
|
|
// if (json_data.pm_ms === 'm2') {
|
|
// dk_body_elem += "<td class='-col-cm'><div></div><div><input type='number' value='' class='layui-input' style='text-align: center;' pcki-change='changeOrder' pcki-save='saveOrder'"+(ddl.disable || dk.ka == "y" ? ' pcki-mode="disabled"' : '')+"></div></td>"
|
|
// }
|
|
if (json_data.face == "2" || json_data.sys_ver_hy == "xz") {
|
|
dk_body_elem += "<td class='-col-cm'><div>"+ddl.size+"</div><div style='height: 38px; line-height: 38px;'>"+(ddl.value ? ddl.value : "0")+"</div></td>"
|
|
} else {
|
|
dk_body_elem += "<td class='-col-cm'><div>"+ddl.size+"</div><div><input type='number' id='"+ddl.id+"' name='"+ddl.id+"' value='"+ddl.value+"' class='layui-input' style='text-align: center;' pcki-change='changeOrder' pcki-save='saveOrder'"+(json_data.pm_ms==='m2'||ddl.disable || dk.ka == "y" ? ' pcki-mode="disabled"' : '')+"></div></td>"
|
|
}
|
|
max_cm_col_count = Math.max(max_cm_col_count, ++current_cm_col_count)
|
|
original_dd += ddl.value+","
|
|
break
|
|
case "4":
|
|
dk_body_elem += "<td><span>"+ddl.value+"</span></td>"
|
|
break
|
|
case "5": // 小计格
|
|
dk_body_elem += "<td class='-row-total'><div style='height: 20px;'></div><div class='-value' style='height: 38px; line-height: 38px;'>"+ddl.value+"</div></td>"
|
|
dk_all_total += parseInt(ddl.value)
|
|
break
|
|
case "6":
|
|
break
|
|
case "9": // 空位尺码
|
|
dk_body_elem += '<td class="-col-cm"></td>'
|
|
max_cm_col_count = Math.max(max_cm_col_count, ++current_cm_col_count)
|
|
break
|
|
}
|
|
}
|
|
dk_body_elem += '<td><div style="height: 20px;"></div><div>'+((json_data.face == "2" || json_data.sys_ver_hy == "xz") && dk.ka != 'y' ? '<a href="javascript:openDkSingle('+dk.khid+')" class="layui-btn layui-btn-sm" style="background-color: #F04122; margin-right: 10px;">去下单</a>' : '')+'</div></td>' // 区经下单、鞋子下单:去下单
|
|
dk_body_elem += "</tr>"
|
|
|
|
dk_body_elem = $(dk_body_elem)
|
|
if (json_data.pm_ms === 'm2') {
|
|
dk_body_elem.find('.-col-cm:nth(0)').before('<td><div style="height: 18px;"></div><div><input type="number" class="layui-input" pcki-nojpty pcki-move="pm" pcki-nocypm="nocypm" data-pm="'+dk.default_pm+'" style="text-align: center;" pcki-change="changeSh" pcki-save="saveOrder"'+(ddl.disable||dk.ka=='y'?' pcki-mode="disabled"':'')+'></div></td>')
|
|
}
|
|
$("#dks").append(dk_body_elem)
|
|
}
|
|
// $("#dks .-body").each(function() { // 补全表身尺码的列数
|
|
// var col_cm_count = $(this).find(".-col-cm").length
|
|
// for(var i = 0; i < max_cm_col_count - col_cm_count; i++) {
|
|
// $(this).find(".-row-total").before("<td class='-col-cm'></td>")
|
|
// }
|
|
// })
|
|
$("#dks .-body .-col-cm").width((100/col_count*parseInt($("#dks .-header .-col-cm").attr("dk-w")))/max_cm_col_count+"%") // 统一尺码小格长度
|
|
$("#dks .-header .-col-cm").attr({"colspan": max_cm_col_count}) // 补全表头尺码的跨度
|
|
$("#dks .-line td").attr("colspan", col_count+max_cm_col_count) // 补全分割线的跨度
|
|
pInitCustomKeyboard({
|
|
pck_enabled: json_data.sys_ck_input
|
|
,pck_cypm: json_data.cypm
|
|
,pck_jpty: json_data.jpty
|
|
,pck_uid: json_data.uid
|
|
,pck_page: "dp"
|
|
}) // 键盘初始化
|
|
$('.del-color').on('click', function(){ // 设定删除款tip
|
|
layer.tips('已删除', this); //在元素的事件回调体中,follow直接赋予this即可
|
|
})
|
|
//--------表尾
|
|
$("#dks").append("<tr><td colspan='"+col_count+"'><hr class='layui-bg-gray'></td></tr>") // 分割线
|
|
var dk_footer = "<tr class='-footer'><td colspan='"+cm_front_count+"' style='text-align: right;'>合计</td>"
|
|
dk_footer += "<td colspan='"+max_cm_col_count+"'></td>"
|
|
dk_footer += "<td class='-all-total'>"+dk_all_total+"</td></tr>"
|
|
$("#dks").append(dk_footer)
|
|
//------------订单操作
|
|
if (json_data.face == "2" || json_data.sys_ver_hy == "xz") $("#dk-opt-box").css("display", "none")
|
|
|
|
// 添加水印
|
|
USetWatermark({
|
|
is_sy: json_data.is_sy
|
|
,text: json_data.username
|
|
})
|
|
}
|
|
}
|
|
,beforeSend: function() { u_start_loading() }
|
|
,complete: function() { u_stop_loading() }
|
|
,error: function () { layui.layer.msg("与服务器通信失败!") }
|
|
}
|
|
);
|
|
// 保存订单,提交订单
|
|
form.on("submit(dk-save)", function(data) {
|
|
console.log(["提交", data.field])
|
|
original_dd = setDdString()
|
|
var url="./?_m=dp&_a=save";
|
|
$.ajax({
|
|
url: url
|
|
,method: "POST"
|
|
,data: data.field
|
|
,success: function(res) {
|
|
var res_jsondata = $.parseJSON(res)
|
|
console.log(["反馈", res_jsondata])
|
|
if (res_jsondata.code == 101) {
|
|
if (res_jsondata.msg) layui.layer.msg(res_jsondata.msg)
|
|
else layui.layer.msg("操作成功。")
|
|
if (typeof window.parent.update_yd && typeof window.parent.update_yd == "function") window.parent.update_yd()
|
|
else if (window.parent.frames["layadmin-iframe"] && typeof window.parent.frames["layadmin-iframe"].update_yd == "function") window.parent.frames["layadmin-iframe"].update_yd()
|
|
} else {
|
|
if (res_jsondata.msg) layui.layer.msg(res_jsondata.msg)
|
|
else layui.layer.msg("操作失败!")
|
|
}
|
|
if (to_page_zsh
|
|
|
|
) location.href = "dp_single.htm?zsh=" + to_page_zsh
|
|
}
|
|
,beforeSend: function() { u_start_loading() }
|
|
,complete: function() { u_stop_loading() }
|
|
,error: function () { layui.layer.msg("与服务器通信失败!") }
|
|
})
|
|
return true
|
|
})
|
|
|
|
// 搜索,搭配号
|
|
$("#btn-search").click(function() {
|
|
if (!$("#s-title input").val().replace(/ /g, "")) return true
|
|
var url="./?_m=dp&_a=single&s_title="+$("#s-title input").val()
|
|
console.log(url)
|
|
$.ajax({
|
|
url: url
|
|
,method: "POST"
|
|
,success: function(res) {
|
|
var res_jsondata = $.parseJSON(res)
|
|
console.log(res_jsondata)
|
|
if (res_jsondata.code == 100) {
|
|
toPage(res_jsondata.zsh)
|
|
} else if (res_jsondata.code == 101) {
|
|
var content_html = "<div style='padding: 15px;'>找到以下符合条件的多项,请选择:</div>"
|
|
for (var i = 0; i < res_jsondata.msg.length; i++) {
|
|
var msgl = res_jsondata.msg[i]
|
|
content_html += '<a href="javascript:toPage('+msgl.zsh+')" style="display: block; float: left; width: 60px; padding: 10px; color: blue; text-decoration: underline;">'+msgl.title+'</a>'
|
|
}
|
|
layer.open({
|
|
type: 1
|
|
,title: false //不显示标题栏
|
|
,closeBtn: true
|
|
,area: '300px;'
|
|
,shade: 0.8
|
|
,id: 'dp-location' //设定一个id,防止重复弹出
|
|
// ,btn: ['火速围观', '残忍拒绝']
|
|
,btnAlign: 'c'
|
|
,moveType: 1 //拖拽模式,0或者1
|
|
,content: content_html
|
|
})
|
|
} else {
|
|
if (res_jsondata.msg) layui.layer.msg(res_jsondata.msg)
|
|
else layui.layer.msg("操作失败!")
|
|
}
|
|
}
|
|
,beforeSend: function() { u_start_loading() }
|
|
,complete: function() { u_stop_loading() }
|
|
,error: function () { layui.layer.msg("与服务器通信失败!") }
|
|
})
|
|
})
|
|
|
|
if(admin.screen()<2)
|
|
is_mobile="y";
|
|
$(window).on('resize', function(){
|
|
//自动
|
|
if(admin.screen()<2)
|
|
is_mobile="y";
|
|
});
|
|
|
|
$(self.frameElement).parents(".layui-layer-iframe").on("resize", function() {
|
|
// safari中iframe内的页面宽度会莫名其妙多一点出来,此处强制将本页宽度修正
|
|
$(".pcki-page").width($(self.frameElement).parents(".layui-layer-iframe").width())
|
|
// 修复iphone端,点击按钮时自动滚到页面顶部以及附带的其他一些问题
|
|
$(".pcki-page").height($(self.frameElement).parents(".layui-layer-iframe").height())
|
|
// 将iframe的高度同步为其父元素.layui-layer-iframe的高度
|
|
$(this).find("[name="+window_name+"]").height($(this).height())
|
|
})
|
|
})
|
|
|
|
// 修改手数
|
|
function changeSh(elem) {
|
|
if (parseInt(elem.val()) < 0) {
|
|
layui.layer.msg("数值无效。")
|
|
elem.val("")
|
|
}
|
|
var pm = elem.attr('data-pm').split(':')
|
|
var value = parseInt(elem.val() ? elem.val() : '0')
|
|
elem.parents('tr').find('.-col-cm input').each(function(index) {
|
|
var pmv = pm.length > index ? pm[index] : ''
|
|
pmv = parseInt(pmv ? pmv : '0')
|
|
$(this).val(pmv * value)
|
|
$(this).change()
|
|
})
|
|
}
|
|
// 修改订单
|
|
function changeOrder(elem) {
|
|
layui.use('jquery', function(){
|
|
var $ = layui.jquery
|
|
if (parseInt(elem.val()) < 0) {
|
|
layui.layer.msg("数值无效。")
|
|
elem.val("")
|
|
}
|
|
var dk_row_total = 0
|
|
elem.parents(".-body").find(".-col-cm input").each(function() {
|
|
dk_row_total += parseInt($(this).val() != "" ? $(this).val() : "0")
|
|
})
|
|
elem.parents(".-body").find(".-row-total .-value").html(dk_row_total)
|
|
var dk_all_total = 0
|
|
$("#dks .-body .-row-total .-value").each(function() {
|
|
dk_all_total += parseInt($(this).html() ? $(this).html() : 0)
|
|
})
|
|
$("#dks .-footer .-all-total").html(dk_all_total)
|
|
})
|
|
}
|
|
// 保存订单
|
|
function saveOrder() {
|
|
layui.use('jquery', function(){
|
|
var $ = layui.jquery
|
|
$("#dk-save").click()
|
|
})
|
|
}
|
|
//显示,隐藏评价层
|
|
function show_hide_kh_hide(id){
|
|
layui.use('jquery', function(){
|
|
var $=layui.jquery;
|
|
$("#kh_hide_"+id).toggle(500);
|
|
})
|
|
}
|
|
|
|
function setDdString() {
|
|
var dd_string = ""
|
|
layui.use('jquery', function(){
|
|
var $ = layui.jquery
|
|
$("#dks .-body .-col-cm input").each(function() {
|
|
dd_string += $(this).val() + ","
|
|
})
|
|
})
|
|
return dd_string
|
|
}
|
|
// 跳转,上一,下一
|
|
function toPage(zsh) {
|
|
layui.use('jquery', function(){
|
|
var $ = layui.jquery
|
|
var current_dd = setDdString()
|
|
if (dp_data.face != "2" && dp_data.sys_ver_hy != 'xz' && original_dd !== current_dd) {
|
|
if (confirm("您修改了订单,但还没有保存,是否保存?")) {
|
|
to_page_zsh = zsh
|
|
$("#dk-save").click()
|
|
}
|
|
}
|
|
location.href = "dp_single.htm?zsh=" + zsh
|
|
})
|
|
}
|
|
function openDkSingle(khid) {
|
|
layui.use('layer', function(){
|
|
var layer = parent.layer;
|
|
var index = layer.open({
|
|
type: 2,
|
|
title: '',
|
|
content: "dk_single"+(dp_data.face == "2" ? "_qj" : "")+".htm?khid="+khid,
|
|
offset: 'b',
|
|
closeBtn: 0,
|
|
anim: 2
|
|
});
|
|
layer.full(index);
|
|
})
|
|
}
|
|
function update_yd(khid) {
|
|
location.reload()
|
|
}
|
|
// 关闭本页
|
|
function close_this_frame() {
|
|
layui.use('jquery', function(){
|
|
var $ = layui.jquery
|
|
var current_dd = setDdString()
|
|
if (dp_data.face != "2" && dp_data.sys_ver_hy != 'xz' && original_dd !== current_dd) {
|
|
if (confirm("您修改了订单,但还没有保存,是否保存?")) {
|
|
$("#dk-save").click()
|
|
}
|
|
}
|
|
u_close_this_div()
|
|
})
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |