<!--{assign var="menu_id" value="cp"}-->
<!--{include file="<!--{$oetplpath}-->block_header.tpl"}-->
<div class="oe_ntop">
  <i class="iconfont" onclick="goBack();">&#xe616;</i>
  <p>店铺留言</p>
</div>

<div class="oe_shopwords" id="json_data">
  <!--{if empty($words)}-->
  <h6>没有符合条件的信息</h6>
  <!--{else}-->
  <!--{foreach $words as $volist}-->
  <dl>
    <dt>
	  <span class="headimg"><img src="<!--{$volist.logourl}-->"/></span>
	  <h3><!--{$volist.shopname}--></h3>
	  <p class="p_1">
          <span f="but_editwords" data-id="<!--{$volist.wordid}-->" style="cursor:pointer;"><i class="iconfont">&#xe62c;</i>编辑</span>
          <!--{if $volist.flag == '1'}-->
          <font color="green">通过</font>
          <!--{else}-->
          <font color="gray">待审核</font>
          <!--{/if}-->
          <label><!--{$volist.addtime|date_format:"%Y-%m-%d"}--></label>
	  </p>
	  <div class="clear"></div>
	</dt>

	<dd class="dd_1" id="words_<!--{$volist.wordid}-->">
	  <span class="span_1">咨询内容：</span>
	  <b style="font-weight:normal;"><!--{$volist.words}--></b>
	</dd>
	<!--{if !empty($volist.reply)}-->
	<dd class="dd_2">
	  <span class="span_1">回复：</span>
	  <!--{$volist.reply}-->  <i class="i_1"><!--{$volist.replytime|date_format:"%Y-%m-%d %H:%M:%S"}--></i>
	</dd>
	<!--{/if}-->

  </dl>
  <div class="ge"></div>
  <!--{/foreach}-->
  <!--{/if}-->
</div>

<input type="hidden" name="page" id="page" value="2" />
<!--{if $pagecount > 1}-->
<div class="oe_page" f="but_loadmore_page" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json" data-box="json_data">点击加载下一页</div>
<!--{/if}-->

<div class="bottom_box" id="var_edit_comment" style="display:none;">
  <div class="bottom_clickbox" style="cursor:pointer;"></div>
  <input type="hidden" name="id" id="id" value="" />
  <div class="bottom_boxcn">
    <dl class="textarea">
      <dt>编辑留言（500个字以内）</dt>
      <dd>
        <textarea style="width:90%;height:100px;" id="content" name="content"></textarea>
      </dd>
    </dl>
    <div class="bottom_btn">
      <p id="tips_submit"></p>
      <span class="span_1" f="but_submit" style="cursor:pointer;">编辑保存</span>
	</div>
  </div>
</div>

<script type="text/javascript">
$(function(){
	
	//弹出编辑框
	$(document).on("click", "[f='but_editwords']", function(){
		$_id = $(this).attr("data-id");
		$("#id").val($_id);
		$("#content").val($("#words_"+$_id+" b").text());
		$("#var_edit_comment").slideDown("fast");
	});

	//取消追评
	$(document).on("click", ".edit_clickbox", function(){
		$("#id").val("");
		$("#content").val("");
		$("#var_edit_comment").slideUp("fast");
	});
	
	//提交修改
	$(document).on("click", "[f='but_submit']", function(){
		$tips_obj = $("#tips_submit");
		$tips_obj.html("");
		$_id = $("#id").val();
		$_content = $("#content").val();
		if ($_id.length == 0) {
			$tips_obj.html("<font color='red'>请选择要编辑的留言</font>");
			return false;
		}
		if ($_content.length == 0) {
			$tips_obj.html("<font color='red'>请输入留言内容</font>");
			return false;
		}
		$_urlitems = "&id="+encodeURIComponent($_id)+"&words="+encodeURIComponent($_content);
		$_url = WAP_APPFILE + "&c=<!--{$c}-->&a=saveedit"+$_urlitems;
		$post_json = {"url":$_url, "type":"reload", "tips_box":"tips_submit", "success_text":"编辑成功", "fail_text":"编辑失败"};
		_oemarryAjaxPost($post_json);
	});
	

});
</script>

</body>
</html>