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.
421 lines
14 KiB
421 lines
14 KiB
{template 'header', 'member'}
|
|
<div id="head-bar">
|
|
<div class="head-bar">
|
|
<div class="head-bar-back"><a href="{if $back_link}{$back_link}{else}javascript:Dback();" id="back-{$js_pageid}{/if}" data-direction="reverse"><img src="{DT_MOB}static/img/icon-back.png" width="24" height="24"/></a></div>
|
|
<div class="head-bar-title">{$MOD[name]}{if $action=='add'}发布{elseif $action=='edit'}修改{else}管理{/if}</div>
|
|
<div class="head-bar-right">
|
|
{if $action=='add' || $action=='edit'}
|
|
<a href="?mid={$mid}&status=3"><img src="{DT_MOB}static/img/icon-cancel.png" width="24" height="24"/></a>
|
|
{else}
|
|
<a href="?mid={$mid}&action=add"><img src="{DT_MOB}static/img/icon-add.png" width="24" height="24"/></a>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
<div class="head-bar-fix" id="load-fix-{$js_pageid}" style="height:0;"></div>
|
|
<div class="head-bar-fix" id="head-fix-{$js_pageid}"></div>
|
|
</div>
|
|
{if $action=='add' || $action=='edit'}
|
|
<script type="text/javascript" src="{DT_MOB}static/lib/webuploader.min.js?v={if DT_DEBUG}{DT_TIME}{else}{DT_REFRESH}{/if}"></script>
|
|
<div class="ui-form">
|
|
<iframe src="" name="send" id="send" style="display:none;"></iframe>
|
|
<form method="post" action="?" id="dform" target="send" data-ajax="false" onsubmit="return check();">
|
|
<input type="hidden" name="action" value="{$action}"/>
|
|
<input type="hidden" name="mid" value="{$mid}"/>
|
|
<input type="hidden" name="itemid" value="{$itemid}"/>
|
|
<input type="hidden" name="forward" value="{$forward}"/>
|
|
<input type="hidden" name="post[linkurl]" value="{$linkurl}"/>
|
|
<p>信息类型<em>*</em><b id="dtypeid"></b></p>
|
|
<div>
|
|
{loop $TYPE $k $v}
|
|
<input type="radio" name="post[typeid]" value="{$k}" {if $k==$typeid}checked{/if} id="typeid_{$k}"><label for="typeid_{$k}" id="t_{$k}">{$v}</label><br/>
|
|
{/loop}
|
|
</div>
|
|
<p>所属分类<em>*</em><b id="dcatid"></b></p>
|
|
<div>{ajax_category_select('post[catid]', '选择分类', $catid, $moduleid)}</div>
|
|
<p>{$MOD[name]}标题<em>*</em><b id="dtitle"></b></p>
|
|
<div><input name="post[title]" type="text" id="title" value="{$title}"/></div>
|
|
{if $CP}
|
|
<script type="text/javascript">
|
|
var property_catid = {$catid};
|
|
var property_itemid = {$itemid};
|
|
var property_admin = 0;
|
|
</script>
|
|
<script type="text/javascript" src="{DT_STATIC}file/script/property.js?v={if DT_DEBUG}{DT_TIME}{else}{DT_REFRESH}{/if}"></script>
|
|
<section id="load_property" style="display:none;"></section>
|
|
{/if}
|
|
{if $FD}{fields_html('', '', $item)}{/if}
|
|
<p>详细内容<b id="dcontent"></b></p>
|
|
</div>
|
|
<input type="hidden" name="post[content]" id="content"/>
|
|
<ul class="ui-editor-toolbar">
|
|
<li class="ui-editor-img"><div id="editor-picker"></div></li>
|
|
<li class="ui-editor-bold" id="editor-bold" editor-action="bold">B</li>
|
|
<li class="ui-editor-italic" id="editor-italic" editor-action="italic">I</li>
|
|
<li class="ui-editor-underline" id="editor-underline" editor-action="underline">U</li>
|
|
</ul>
|
|
<div class="ui-editor-content" id="editor">{$content}</div>
|
|
<script type="text/javascript" src="{DT_MOB}static/js/editor.js?v={if DT_DEBUG}{DT_TIME}{else}{DT_REFRESH}{/if}"></script>
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$('#editor').DEditor({
|
|
editorid: 'editor',
|
|
textareaid: 'content',
|
|
server: UPPath+'?moduleid={$moduleid}&action=webuploader&from=editor'
|
|
});
|
|
});
|
|
</script>
|
|
<div class="ui-form">
|
|
<p>过期时间</p>
|
|
<div><input type="datetime-local" name="post[totime]" value="{str_replace(' ', 'T', $totime)}" step="1"/></div>
|
|
<p>主要参数</p>
|
|
<div>
|
|
<table cellspacing="1">
|
|
<tr>
|
|
<th>参数名称</th>
|
|
<th>参数值</th>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:35%;"><input name="post[n1]" type="text" value="{$n1}" id="n1"/></td>
|
|
<td style="width:50%;"><input name="post[v1]" type="text" value="{$v1}" id="v1"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:35%;"><input name="post[n2]" type="text" value="{$n2}" id="n2"/></td>
|
|
<td style="width:50%;"><input name="post[v2]" type="text" value="{$v2}" id="v2"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:35%;"><input name="post[n3]" type="text" value="{$n3}" id="n3"/></td>
|
|
<td style="width:50%;"><input name="post[v3]" type="text" value="{$v3}" id="v3"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="f_gray">例如:规格</td>
|
|
<td class="f_gray">例如:10cm*20cm</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<p>交易条件</p>
|
|
<div>
|
|
<table width="90%">
|
|
<tr>
|
|
<td style="width:20%;">需求数量</td>
|
|
<td style="width:50%;"><input name="post[amount]" type="text" value="{$amount}"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:20%;">价格要求</td>
|
|
<td style="width:50%;"><input name="post[price]" type="text" value="{$price}"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:20%;">包装要求</td>
|
|
<td style="width:50%;"><input name="post[pack]" type="text" value="{$pack}"/></td>
|
|
</tr>
|
|
</table>
|
|
<span class="f_gray">*建议详细填写交易条件,以便符合要求的卖家与您取得联系</span>
|
|
</div>
|
|
<p>产品图片</p>
|
|
<div>
|
|
<script type="text/javascript">
|
|
var album_max = parseInt({$DT[thumb_max]});
|
|
if(album_max < 5 || album_max > 99) album_max = 9;
|
|
for(var i = 0;i < album_max; i++) {
|
|
document.write('<input type="hidden" name="post[thumbs][]" id="thumb'+i+'"/>');
|
|
document.write('<div class="ui-form-album-show" id="album'+i+'" onclick="album_action('+i+');"></div>');
|
|
}
|
|
</script>
|
|
<div class="ui-form-album-upload"><div id="album-picker"></div></div>
|
|
<script type="text/javascript">
|
|
function album_action(id) {
|
|
Dsheet('{$js_pageid}','<a href="javascript:album_delete('+id+');void(0);"><span style="color:red;">删除图片</span></a>', '取消', '确定要删除图片吗?');
|
|
}
|
|
function album_delete(id) {
|
|
$('#thumb'+id).val('');
|
|
$('#album'+id).html('');
|
|
$('#album'+id).hide();
|
|
$('.ui-form-album-upload').show();
|
|
}
|
|
function album_show(id, url) {
|
|
if($('#thumb'+id).length == 0) return false;
|
|
$('#thumb'+id).val(url);
|
|
$('#album'+id).html('<img src="'+url+'"/>');
|
|
$('#album'+id).show();
|
|
}
|
|
function album_hide() {
|
|
var j = 1;
|
|
for(var i = 0; i < album_max; i++) {
|
|
if($('#thumb'+i).val() == '') {
|
|
j = 0;
|
|
break;
|
|
}
|
|
}
|
|
if(j) $('.ui-form-album-upload').hide();
|
|
}
|
|
var albumu = WebUploader.create({
|
|
auto: true,
|
|
server: UPPath+'?moduleid={$moduleid}&action=webuploader&from=album&width={$MOD[thumb_width]}&height={$MOD[thumb_height]}',
|
|
pick: '#album-picker',
|
|
accept: {
|
|
title: 'Images',
|
|
extensions: 'gif,jpg,jpeg,bmp,png',
|
|
mimeTypes: 'image/*'
|
|
},
|
|
resize: false
|
|
});
|
|
albumu.on('fileQueued', function(file) {
|
|
Dtoast('{$js_pageid}',L['uploading'], '', 30);
|
|
});
|
|
albumu.on('uploadProgress', function(file, percentage) {
|
|
var p = parseInt(percentage * 100);
|
|
$('#toast-{$js_pageid}').html(p > 99 ? L['processing'] : L['uploading']+p+'%');
|
|
});
|
|
albumu.on( 'uploadSuccess', function(file, data) {
|
|
if(data.error) {
|
|
Dtoast('{$js_pageid}',data.message, '', 5);
|
|
} else {
|
|
for(var i = 0; i < album_max; i++) {
|
|
if($('#thumb'+i).val() == '') {
|
|
album_show(i, data.url);
|
|
break;
|
|
}
|
|
}
|
|
album_hide();
|
|
}
|
|
});
|
|
albumu.on( 'uploadError', function(file, data) {
|
|
Dtoast('{$js_pageid}',data.message, '', 5);
|
|
});
|
|
albumu.on('uploadComplete', function(file) {
|
|
$('#toast-{$js_pageid}').hide();
|
|
});
|
|
{if $thumbs}
|
|
$(function(){
|
|
{loop $thumbs $k $v}
|
|
{if $v}album_show({$k}, '{$v}');{/if}
|
|
{/loop}
|
|
album_hide();
|
|
});
|
|
{/if}
|
|
</script>
|
|
</div>
|
|
<p>宣传视频</p>
|
|
<div>
|
|
<input type="text" name="post[video]" value="{$video}" id="video"/>
|
|
<div class="ui-form-file-upload"><div id="video-picker"></div></div>
|
|
<script type="text/javascript">
|
|
var fileu = WebUploader.create({
|
|
auto: true,
|
|
server: UPPath+'?moduleid={$moduleid}&action=webuploader&from=file',
|
|
pick: '#video-picker',
|
|
accept: {
|
|
title: 'video',
|
|
extensions: 'mp4',
|
|
mimeTypes: 'video/*'
|
|
},
|
|
resize: false
|
|
});
|
|
fileu.on('fileQueued', function(file) {
|
|
Dtoast('{$js_pageid}',L['uploading'], '', 30);
|
|
});
|
|
fileu.on('uploadProgress', function(file, percentage) {
|
|
var p = parseInt(percentage * 100);
|
|
$('#toast-{$js_pageid}').html(p > 99 ? L['processing'] : L['uploading']+p+'%');
|
|
});
|
|
fileu.on( 'uploadSuccess', function(file, data) {
|
|
if(data.error) {
|
|
Dtoast('{$js_pageid}',data.message, '', 5);
|
|
} else {
|
|
$('#video').val(data.url);
|
|
}
|
|
});
|
|
fileu.on( 'uploadError', function(file, data) {
|
|
Dtoast('{$js_pageid}',data.message, '', 5);
|
|
});
|
|
fileu.on('uploadComplete', function(file) {
|
|
$('#toast-{$js_pageid}').hide();
|
|
});
|
|
</script>
|
|
</div>
|
|
{if !$_userid}
|
|
{template 'guest_contact', 'chip'}
|
|
{/if}
|
|
{if $fee_add}
|
|
<p>发布此信息需消费</p>
|
|
<div><span class="f_b f_red">{$fee_add}</span> {$fee_unit}</div>
|
|
{if $fee_currency == 'money'}
|
|
<p>{$DT[money_name]}余额</p>
|
|
<div><span class="f_blue f_b">{$_money}{$fee_unit}</span> <a href="charge.php?action=pay" class="b">[充值]</a></div>
|
|
{else}
|
|
<p>{$DT[credit_name]}余额</p>
|
|
<div><span class="f_blue f_b">{$_credit}{$fee_unit}</span> <a href="credit.php?action=buy" class="b">[购买]</a></div>
|
|
{/if}
|
|
{/if}
|
|
{if $need_password}
|
|
<p>支付密码<em>*</em><b id="dpassword"></b></p>
|
|
<div><input type="password" name="password" value="" id="password" autocomplete="off"/></div>
|
|
{/if}
|
|
{if $need_question}
|
|
<p>验证问题<em>*</em><b id="danswer"></b></p>
|
|
<div>{template 'question', 'chip'}</div>
|
|
{/if}
|
|
{if $need_captcha}
|
|
<p>验证码<em>*</em><b id="dcaptcha"></b></p>
|
|
<div>{template 'captcha', 'chip'}</div>
|
|
{/if}
|
|
<div class="blank-16"></div>
|
|
<input type="submit" name="submit" value="{if $action == 'edit'}修改{else}发布{/if}" class="btn-blue"/>
|
|
<div class="blank-32"></div>
|
|
</div>
|
|
</form>
|
|
{load('clear.js')}
|
|
{else}
|
|
<div class="ui-form">
|
|
<form action="?">
|
|
<input type="hidden" name="mid" value="{$mid}"/>
|
|
<input type="hidden" name="status" value="{$status}"/>
|
|
<div><input type="search" name="kw" value="{$kw}" placeholder="{$L[kw]}"/></div>
|
|
</form>
|
|
</div>
|
|
{if $_userid}
|
|
<script type="text/javascript">$(function(){Stabs('{$js_pageid}');});</script>
|
|
<div class="list-menu" id="tabs-{$js_pageid}">
|
|
<ul>
|
|
<a href="?mid={$mid}&status=3"><li{if $status==3} class="on"{/if} id="s3">已发布{if !$kw} {$nums[3]}{/if}</li></a>
|
|
<a href="?mid={$mid}&status=2"><li{if $status==2} class="on"{/if} id="s2">审核中{if !$kw} {$nums[2]}{/if}</li></a>
|
|
<a href="?mid={$mid}&status=1"><li{if $status==1} class="on"{/if} id="s1">未通过{if !$kw} {$nums[1]}{/if}</li></a>
|
|
<a href="?mid={$mid}&status=4"><li{if $status==4} class="on"{/if} id="s4">已过期{if !$kw} {$nums[4]}{/if}</li></a>
|
|
</ul>
|
|
</div>
|
|
{/if}
|
|
<form method="post">
|
|
{if $lists}
|
|
{loop $lists $v}
|
|
<div class="list-img">
|
|
<input type="checkbox" name="itemid[]" value="{$v[itemid]}" class="dsn" id="checkbox-{$v[itemid]}"/>
|
|
<a href="{$v[linkurl]}"><img src="{if $v[thumb]}{$v[thumb]}{else}{DT_MOB}static/img/80x60.png{/if}" width="80" height="60" alt="" onerror="this.src='{DT_MOB}static/img/80x60.png';"/></a>
|
|
<ul>
|
|
<li><em class="check" id="check-{$v[itemid]}"></em><a href="?mid={$mid}&action=edit&itemid={$v[itemid]}" rel="external"><strong>{$v[title]}</strong></a></li>
|
|
<li><em class="sheet" id="sheet-{$v[itemid]}"></em><span>{$v[date]}</span></li>
|
|
</ul>
|
|
</div>
|
|
{/loop}
|
|
{/if}
|
|
{if $mod_limit || (!$MG[fee_mode] && $MOD[fee_add])}
|
|
<div class="limit">
|
|
{if $mod_limit}
|
|
总共可发 <span class="f_b f_red">{$mod_limit}</span> 条
|
|
当前已发 <span class="f_b">{$limit_used}</span> 条
|
|
还可以发 <span class="f_b f_blue">{$limit_free}</span> 条
|
|
{/if}
|
|
{if !$MG[fee_mode] && $MOD[fee_add]}
|
|
发布信息收费 <span class="f_b f_red">{$MOD[fee_add]}</span> {if $MOD[fee_currency] == 'money'}{$DT[money_unit]}{else}{$DT[credit_unit]}{/if}/条
|
|
可免费发布 <span class="f_b">{if $mod_free_limit<0}无限{else}{$mod_free_limit}{/if}</span> 条
|
|
{/if}
|
|
</div>
|
|
{/if}
|
|
{if $pages}<div class="pages" id="pages-{$js_pageid}">{$pages}</div>{/if}
|
|
<div id="foot-bar" class="dsn">
|
|
<div class="foot-bar-fix"></div>
|
|
<div class="foot-bar btns">
|
|
{if $timetype!='add'}<input type="submit" value="刷新选中" class="btn-green" onclick="this.form.action='?mid={$mid}&status={$status}&action=refresh';"/>{/if}
|
|
{if $MG[delete]}<input type="submit" name="submit" value="删除选中" class="btn-red" onclick="if(confirm('确定要删除选中{$MOD[name]}吗?')){this.form.action='?mid={$mid}&status={$status}&action=delete'}else{return false;}"/>{/if}
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
if($('#foot-bar input').length == 0) $('.check').hide();
|
|
$('.list-img em').click(function() {
|
|
if($(this).attr('class') == 'sheet') {
|
|
var id = $(this).attr('id').replace('sheet-', '');
|
|
Dsheet('{$js_pageid}','<a href="?mid={$mid}&action=edit&itemid='+id+'"><span>修改</span></a>{if $MG[copy]}|<a href="?mid={$mid}&action=add&itemid='+id+'"><span>复制</span></a>{/if}{if $MG[delete]}|<a href="?mid={$mid}&action=delete&itemid='+id+'" onclick="return _delete();"><span style="color:red;">删除</span></a>{/if}', '取消');
|
|
} else {
|
|
var id = $(this).attr('id').replace('check-', '');
|
|
if($('#checkbox-'+id).attr('checked')) {
|
|
$('#checkbox-'+id).attr('checked', false);
|
|
$(this).attr('class', 'check');
|
|
} else {
|
|
$('#checkbox-'+id).attr('checked', true);
|
|
$(this).attr('class', 'checked');
|
|
}
|
|
if($('.checked').length > 0) {
|
|
$('#foot-bar').fadeIn(300);
|
|
} else {
|
|
$('#foot-bar').fadeOut(300);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{/if}
|
|
{if $action == 'add' || $action == 'edit'}
|
|
<script type="text/javascript">
|
|
function _p() {
|
|
if(Dd('tag').value) {
|
|
Ds('reccate');
|
|
}
|
|
}
|
|
function check() {
|
|
var l;
|
|
var f;
|
|
f = 'title';
|
|
l = Dd(f).value.length;
|
|
if(l < 2 || l > 30) {
|
|
Dmsg('信息标题应为2-30字,当前已输入'+l+'字', f);
|
|
return false;
|
|
}
|
|
f = 'catid_1';
|
|
if(Dd(f).value == 0) {
|
|
Dmsg('请选择所属行业', 'catid', 1);
|
|
return false;
|
|
}
|
|
{if !$_userid}
|
|
f = 'company';
|
|
l = Dd(f).value.length;
|
|
if(l < 2) {
|
|
Dmsg('请填写公司名称', f);
|
|
return false;
|
|
}
|
|
if(Dd('areaid_1').value == 0) {
|
|
Dmsg('请选择所在地区', 'areaid');
|
|
return false;
|
|
}
|
|
f = 'truename';
|
|
l = Dd(f).value.length;
|
|
if(l < 2) {
|
|
Dmsg('请填写联系人', f);
|
|
return false;
|
|
}
|
|
f = 'mobile';
|
|
l = Dd(f).value.length;
|
|
if(l < 7) {
|
|
Dmsg('请填写手机', f);
|
|
return false;
|
|
}
|
|
{/if}
|
|
{if $FD}{fields_js()}{/if}
|
|
{if $CP}{property_js()}{/if}
|
|
{if $need_password}
|
|
f = 'password';
|
|
l = Dd(f).value.length;
|
|
if(l < 6) {
|
|
Dmsg('请填写支付密码', f);
|
|
return false;
|
|
}
|
|
{/if}
|
|
{if $need_question}
|
|
f = 'answer';
|
|
if($('#c'+f).html().indexOf('ok.png') == -1) {
|
|
Dmsg('请填写正确的验证问题', f);
|
|
return false;
|
|
}
|
|
{/if}
|
|
{if $need_captcha}
|
|
f = 'captcha';
|
|
if($('#c'+f).html().indexOf('ok.png') == -1) {
|
|
Dmsg('请填写正确的验证码', f);
|
|
return false;
|
|
}
|
|
{/if}
|
|
return true;
|
|
}
|
|
var destoon_oauth = '{$EXT[oauth]}';
|
|
</script>
|
|
{/if}
|
|
{template 'footer', 'member'}
|