You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
356 lines
20 KiB
356 lines
20 KiB
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>{$title}</title>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
<meta name="description" content="为{$title}提交数据。">
|
|
<meta property="og:type" content="webpage">
|
|
<meta property="og:title" content="{$title}">
|
|
<meta property="og:description" content="为{$title}提交数据。">
|
|
<link rel="stylesheet" media="screen" href="{$yf_theme_path}index/Public/Css/published.css">
|
|
<link rel="stylesheet" media="screen" href="{$yf_theme_path}index/Public/Css/base.css">
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
|
|
</head>
|
|
<body class="entry-container">
|
|
<img id="shareImg" src="{$share.imgUrl}" width="0" height="0" />
|
|
<div class="entry-container-inner">
|
|
<form class="center with-shadow indent-on-large-phone" id="postForm" action="{:url('activity',array('id'=>$id))}" method="post">
|
|
{:token()}
|
|
<div class="form-header">
|
|
<div class="banner"><div class="banner-text"> </div></div>
|
|
<div class="logo-box">
|
|
<h1 class="form-title ">{$title}</h1>
|
|
<div class="form-txt">
|
|
{$activity.infor|htmlspecialchars_decode}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-content container-fluid">
|
|
<div class="row">
|
|
<div class="fields clearfix">
|
|
|
|
{volist name="apply" id="vo"}
|
|
{switch $vo['ftype']}
|
|
{case value="input"}
|
|
<div class="field {if condition="$vo['frequire'] eq 1"}required{/if} col-sm-12" >
|
|
<div class="form-group">
|
|
<div class="field-label">{$vo.fname}</div>
|
|
<div class="field-content"><input type="text" name="{$vo.ftag}" id="{$vo.ftag}" placeholder="{$vo.fnotice}"></div>
|
|
</div>
|
|
</div>
|
|
{/case}
|
|
{case value="radio"}
|
|
<div class="field {if condition="$vo['frequire'] eq 1"}required{/if} col-sm-12 custom-grids">
|
|
<div class="form-group">
|
|
<div class="field-label" >{$vo.fname}</div>
|
|
<div class="field-content">
|
|
<div class="choices" data-random-choices="false">
|
|
{volist name="vo['foptions']" id="jo" key="jey"}
|
|
<label class="radio inline">
|
|
<div class="radio-button-wrapper"><input class="needsclick field-transformed" {if condition="$jey eq 1"}checked{/if} type="radio" value="{$jey}" id="{$vo.ftag}{$jey}" name="{$vo.ftag}"><i class="selected-icon"></i></div>
|
|
<div class="choice-description">{$jo}<span class="quota" style="display:inline-block;vertical-align:top;margin-left:5px;margin-top:-5px;">{if condition="$jo eq '其他'"}<input type="text" name="uother" id="uother">{/if}</span></div>
|
|
</label>
|
|
{/volist}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/case}
|
|
{case value="checkbox"}
|
|
<div class="field {if condition="$vo['frequire'] eq 1"}required{/if} col-sm-12 custom-grids">
|
|
<div class="form-group">
|
|
<div class="field-label" >{$vo.fname}</div>
|
|
<div class="field-content">
|
|
<div class="choices" data-random-choices="false">
|
|
{volist name="vo['foptions']" id="jo" key="jey"}
|
|
<label class="radio inline">
|
|
<div class="radio-button-wrapper"><input class="needsclick field-transformed" {if condition="$jey eq 1"}checked{/if} type="checkbox" value="{$jey}" id="{$vo.ftag}{$jey}" name="{$vo.ftag}[]"><i class="selected-icon"></i></div>
|
|
<div class="choice-description">{$jo}<span class="quota"></span></div>
|
|
</label>
|
|
{/volist}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/case}
|
|
{case value="textarea"}
|
|
<div class="field {if condition="$vo['frequire'] eq 1"}required{/if} col-sm-12" >
|
|
<div class="form-group">
|
|
<div class="field-label">{$vo.fname}</div>
|
|
<div class="field-content">
|
|
<textarea rows="3" name="{$vo.ftag}" id="{$vo.ftag}" style="overflow: hidden; overflow-wrap: break-word; height: 66px;" placeholder="{$vo.fnotice}"></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/case}
|
|
{case value="select"}
|
|
<div class="field {if condition="$vo['frequire'] eq 1"}required{/if} col-sm-12" >
|
|
<div class="form-group">
|
|
<div class="field-label">{$vo.fname}</div>
|
|
<div class="field-content">
|
|
<select name="{$vo.ftag}" id="ptype1">
|
|
<option value="">选择{$vo.fname}</option>
|
|
{volist name="vo['foptions']" id="jo" key="jey"}
|
|
<option value="{$jey}">{$jo}</option>
|
|
{/volist}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/case}
|
|
{case value="notice"}
|
|
<div class="field col-sm-12">
|
|
<div class="form-group">
|
|
<div class="field-label">{$vo.fname}</div>
|
|
<div class="field-content">
|
|
{$vo.fnotice}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/case}
|
|
{/switch}
|
|
{/volist}
|
|
|
|
<div class="col-sm-12 filebox">
|
|
<p style="margin:6px 0px;"><strong>附件</strong></p>
|
|
<div class="row">
|
|
{volist name="apply" id="vo"}
|
|
{switch $vo['ftype']}
|
|
{case value="file"}
|
|
<div class="field {if condition="$vo['frequire'] eq 1"}required{/if} field-attachment-field col-sm-12">
|
|
<div class="form-group">
|
|
<div class="field-label">{$vo.fname}</div>
|
|
<div class="field-content">
|
|
<div class="attachment-field">
|
|
<input type="file" name="{$vo.ftag}btn" id="{$vo.ftag}btn" class="jquery-file-upload-file-input" >
|
|
<input type="hidden" name="{$vo.ftag}" id="{$vo.ftag}" >
|
|
<div class="attachments"></div>
|
|
<div class="attachment-select-trigger">
|
|
<label><div class="plus">+</div><div class="select-text-wrapper"><div class="select-text">请选择或拖拽上传文件、限制每个5.0MB以内。仅支持:jpg、jpeg、png、gif,pdf,xls;最多10张</div></div></label>
|
|
</div>
|
|
<div class="attachment-error-message"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/case}
|
|
{/switch}
|
|
{/volist}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="field col-sm-12">
|
|
<div class="form-group">
|
|
<div class="field-label" >声明及承诺</div>
|
|
<div class="field-content">
|
|
<div class="choices">
|
|
<label class="radio ">
|
|
<div class="radio-button-wrapper"><input class="needsclick field-transformed" type="radio" value="1" checked="checked" name="promise"><i class="selected-icon"></i></div>
|
|
<div class="choice-description">本人确认提交的信息准确无误。<span class="quota"></span>
|
|
</div>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="field submit-field col-md-12 text-center clearfix ">
|
|
<input type="submit" name="commit" value="提交" data-disabled-with="提交中..." class="submit gd-btn gd-btn-primary-solid with-shadow">
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script src="{$yf_theme_path}public/js/jquery.js"></script>
|
|
<script src="{$yf_theme_path}index/Public/Js/jquery.form.js"></script>
|
|
<script src="{$yf_theme_path}index/Public/Js/jquery.validate.min.js"></script>
|
|
<script src="{$yf_theme_path}index/Public/Js/layer/layer.js"></script>
|
|
<script src="{$yf_theme_path}index/Public/Js/jquery-ui-1.10.3.min.js"></script>
|
|
<script src="{$yf_theme_path}index/Public/Js/jquery.ui.widget.js"></script>
|
|
<script src="{$yf_theme_path}index/Public/Js/jquery.fileupload.js"></script>
|
|
<script src="{$yf_theme_path}index/Public/Js/base.js"></script>
|
|
<script>
|
|
function change(limit){
|
|
var size = "";
|
|
if(limit < 0.1 * 1024){ //小于0.1KB,则转化成B
|
|
size = limit.toFixed(2) + "B"
|
|
}else if(limit < 0.1 * 1024 * 1024){ //小于0.1MB,则转化成KB
|
|
size = (limit/1024).toFixed(2) + "KB"
|
|
}else if(limit < 0.1 * 1024 * 1024 * 1024){ //小于0.1GB,则转化成MB
|
|
size = (limit/(1024 * 1024)).toFixed(2) + "MB"
|
|
}else{ //其他转化成GB
|
|
size = (limit/(1024 * 1024 * 1024)).toFixed(2) + "GB"
|
|
}
|
|
|
|
var sizeStr = size + ""; //转成字符串
|
|
var index = sizeStr.indexOf("."); //获取小数点处的索引
|
|
var dou = sizeStr.substr(index + 1 ,2) //获取小数点后两位的值
|
|
if(dou == "00"){ //判断后两位是否为00,如果是则删除00
|
|
return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2)
|
|
}
|
|
return size;
|
|
}
|
|
function uploadPic(url,btn,input,current,num){
|
|
//插件jquery.fileupload.js
|
|
jQuery(btn).fileupload({
|
|
url: url,
|
|
dataType: 'json',
|
|
done: function (e, data) {
|
|
var file=data.result;
|
|
tool.msg(file['msg']);
|
|
if(file['code']==1){
|
|
var pic=file['data']['path'];
|
|
if(num==1){
|
|
$(input).val(pic);
|
|
$(btn).val(pic);
|
|
}else{
|
|
var cur=$(input).val();
|
|
var ipic='';
|
|
if(cur)ipic=cur+';'+pic;
|
|
else ipic=pic;
|
|
$(input).val(ipic);
|
|
|
|
}
|
|
}
|
|
},
|
|
progressall: function (e, data) {
|
|
var progress = parseInt(data.loaded / data.total * 100, 10);
|
|
var count=$(".attachments").eq(current).find(".attachment").length;
|
|
var curbar=current;
|
|
if(num>1){
|
|
curbar=count-1;
|
|
}
|
|
console.log('curbar:'+curbar);
|
|
$("#progressbar"+curbar).css({'width':progress+"%"});
|
|
if(progress==100){
|
|
$("#progressbar"+curbar).delay(500).fadeOut();
|
|
}
|
|
}
|
|
}).bind('fileuploadadd',function(e,data){
|
|
var file=data['files'][0];
|
|
var url = null;
|
|
if (window.createObjectURL != undefined) {
|
|
url = window.createObjectURL(file);
|
|
} else if (window.URL != undefined) {
|
|
url = window.URL.createObjectURL(file);
|
|
} else if (window.webkitURL != undefined) {
|
|
url = window.webkitURL.createObjectURL(file);
|
|
}
|
|
var name=file['name'];
|
|
var size=change(file['size']);
|
|
var count=$(".attachments").eq(current).find(".attachment").length;
|
|
var curbar=current;
|
|
if(num>1){
|
|
curbar=count;
|
|
}
|
|
console.log('curbar2:'+curbar);
|
|
if(/^blob/.test(url)){
|
|
var html='<div class="attachment clearfix">';
|
|
html+='<div class="progress-bar" id="progressbar'+curbar+'" role="progressbar" aria-valuenow="0" data-transitiongoal="100" aria-valuemin="0" aria-valuemax="100"></div>';
|
|
html+='<div class="info clearfix"><div class="preview-area pull-left"><div class="preview"><img src="'+url+'" /></div></div>';
|
|
html+='<div class="status pull-left"><span class="file-name">'+name+'</span><span class="file-size-status">(<span class="file-size">'+size+'<span></span></span>)</span></div>';
|
|
html+='<div class="actions web-actions pull-right"><a data-role="cancel" class="delete-link" href="javascript:void(0)">删除</a></div></div></div>';
|
|
if(num==1){
|
|
$(".attachments").eq(current).html(html);
|
|
}else{
|
|
|
|
if(count>=num){
|
|
tool.msg("超过允许上传图片张数");
|
|
return false;
|
|
}
|
|
$(".attachments").eq(current).append(html);
|
|
}
|
|
|
|
}
|
|
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
|
|
}
|
|
$(function(){
|
|
$("body").delegate(".delete-link",'click',function(){
|
|
var parent=$(this).parents(".attachment");
|
|
parent.remove();
|
|
});
|
|
|
|
{volist name="apply" id="vo"}
|
|
{switch $vo['ftype']}
|
|
{case value="file"}
|
|
$(".filebox").show();
|
|
var url="{:url('upload',['key'=>$vo.ftag.'btn'])}";
|
|
uploadPic(url,"#{$vo.ftag}btn","#{$vo.ftag}",0,10);
|
|
{/case}
|
|
{/switch}
|
|
{/volist}
|
|
wx.config({
|
|
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
appId: "{$signPackage.appId}", // 必填,公众号的唯一标识
|
|
timestamp:"{$signPackage.timestamp}", // 必填,生成签名的时间戳
|
|
nonceStr:"{$signPackage.nonceStr}", // 必填,生成签名的随机串
|
|
signature:"{$signPackage.signature}",// 必填,签名
|
|
jsApiList: ['updateAppMessageShareData','updateTimelineShareData'] // 必填,需要使用的JS接口列表
|
|
});
|
|
wx.ready(function(){
|
|
//自定义“分享给朋友”及“分享到QQ”按钮的分享内容
|
|
wx.updateAppMessageShareData({
|
|
title:"{$share.title}", // 分享标题
|
|
desc: "{$share.desc}", // 分享描述
|
|
link:"{$share.link}", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
imgUrl:"{$share.imgUrl}", // 分享图标
|
|
success: function () {
|
|
// 设置成功
|
|
}
|
|
});
|
|
//获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃)
|
|
wx.updateTimelineShareData({
|
|
title:"{$share.title}", // 分享标题
|
|
link:"{$share.link}", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
imgUrl:"{$share.imgUrl}", // 分享图标
|
|
success: function () {
|
|
// 设置成功
|
|
}
|
|
});
|
|
});
|
|
// 手机号码验证
|
|
jQuery.validator.addMethod("isMobile", function(value, element) {
|
|
var length = value.length;
|
|
return this.optional(element) || (length == 11 && /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(value));
|
|
}, "请正确填写您的手机号码。");
|
|
|
|
var rules={{volist name="apply" id="vo"}{if condition="$vo['frequire'] eq 1"}"{$vo.ftag}":"required",{/if}{/volist}};
|
|
var uway=$("input[name='uway']:checked").val();
|
|
if(uway==1){
|
|
$("#uaddr").parents(".field").removeClass('required');
|
|
rules.uaddr='';
|
|
}
|
|
$("input[name='uway']").change(function(){
|
|
uway=$("input[name='uway']:checked").val();
|
|
if(uway==1){
|
|
$("#uaddr").parents(".field").removeClass('required');
|
|
rules.uaddr='';
|
|
}else{
|
|
$("#uaddr").parents(".field").addClass('required');
|
|
rules.uaddr='required';
|
|
}
|
|
});
|
|
if(typeof rules.uaddr!='undefined'&&rules.uaddr=='')delete rules.uaddr;
|
|
console.log("rules",rules);
|
|
var messages={{volist name="apply" id="vo"}{if condition="$vo['frequire'] eq 1"}"{$vo.ftag}":"{$vo.fname}{switch $vo['ftype']}{case value='raido|checkbox'}必选{/case}{case value='file'}必上传{/case}{default/}必填{/switch}",{/if}{/volist}};
|
|
tool.commonForm("#postForm",rules,messages,'','',function(data){
|
|
console.log(data);
|
|
if(typeof data.msg!=undefined){
|
|
tool.msg(data.msg,3000,0.2,function(){
|
|
if(data.code==0){
|
|
$("input[name='__token__']").val(data.data.token);
|
|
}
|
|
if(data.code==1){
|
|
window.location.href=data.url;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|