Commit 2fc2824f by felix

后台界面优化

parent 3414a351
...@@ -6,14 +6,6 @@ require_once(PLUGIN_DIR . 'Tools/Core.php'); ...@@ -6,14 +6,6 @@ require_once(PLUGIN_DIR . 'Tools/Core.php');
require_once(PLUGIN_DIR . 'Admin/Tospur_House.php'); require_once(PLUGIN_DIR . 'Admin/Tospur_House.php');
class House extends Tospur_House{ class House extends Tospur_House{
public static function init_view(){ public static function init_view(){
wp_enqueue_script('jquery-ui');
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('publicjs');
wp_enqueue_script('validate');
wp_enqueue_style('jquery-ui_css');
wp_enqueue_style('bootstrapMinCss');
global $wpdb; global $wpdb;
$type = $_POST["type"]; $type = $_POST["type"];
$context = array(); $context = array();
......
...@@ -5,11 +5,6 @@ require_once(PLUGIN_DIR . 'Tools/Image.php'); ...@@ -5,11 +5,6 @@ require_once(PLUGIN_DIR . 'Tools/Image.php');
class RentHouse extends Tospur_House{ class RentHouse extends Tospur_House{
//二手房信息 //二手房信息
public static function rentHouse_html(){ public static function rentHouse_html(){
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('publicjs');
wp_enqueue_script('validate');
wp_enqueue_style('bootstrapMinCss');
global $wpdb; global $wpdb;
$type = $_POST["type"]; $type = $_POST["type"];
$context = array(); $context = array();
......
...@@ -5,11 +5,6 @@ require_once(PLUGIN_DIR . 'Tools/Image.php'); ...@@ -5,11 +5,6 @@ require_once(PLUGIN_DIR . 'Tools/Image.php');
class SecHandHouse extends Tospur_House{ class SecHandHouse extends Tospur_House{
//二手房信息 //二手房信息
public static function secHandHouse_html(){ public static function secHandHouse_html(){
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('publicjs');
wp_enqueue_script('validate');
wp_enqueue_style('bootstrapMinCss');
global $wpdb; global $wpdb;
$type = $_POST["type"]; $type = $_POST["type"];
$context = array(); $context = array();
......
{% block addTag %}
{% if feature %}
<style>
.table td {
text-align: center;
}
</style>
<!-- 房源特色出层 -->
<div class="modal fade" id="houseFeature" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document" style="position: absolute;top: 0;bottom: 0;left: 0;right: 0; margin: auto;height: 200px;overflow-y: auto;overflow-x: hidden;">
<div class="modal-content">
<div class="row" id="featureTable">
<div class="col-md-12">
<table class="table">
{% for item in feature %}
{% if loop.index0%4 == 0%}
<tr>
{% endif %}
<td>{{ item.value }}</td>
{% if loop.index0%4 == 3%}
</tr>
{% endif %}
{% endfor %}
</table>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
\ No newline at end of file
<br />
<div class="row">
<div class="col-md-6">
<label for="total_price">总价:</label>
<input name="total_price" id="total_price" type="text" value="{{result.total_price}}" class="form-control"> 万元
</div>
<div class="col-md-6">
<label for="average_price">单价:</label>
<input name="average_price" id="average_price" type="text" value="{{result.average_price}}" class="form-control">
</div>
</div>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<br />
<div class="row">
<div class="col-md-6">
<label for="owner_name">业主姓名:</label>
<input name="owner_name" id="owner_name" type="text" value="" class="form-control">
</div>
<div class="col-md-6">
<label for="owner_phone">业主电话:</label>
<input name="owner_phone" id="owner_phone" type="text" value="" class="form-control">
</div>
</div>
\ No newline at end of file
<table class="form-table">
<thead>
<tr>
<th>类型</th>
<th>相册</th>
<th>设为封面</th>
<th></th>
</tr>
</thead>
<tbody id="photosTbody">
{% set exists_photo_ids = "" %}
{% for item in images %}
{% if exists_photo_ids != "" %}
{% set exists_photo_ids = exists_photo_ids~"," %}
{% endif %}
{% set exists_photo_ids = exists_photo_ids~item.image_id %}
<tr>
<td>
<select name="exists_photo[{{ item.image_id }}][type]" style="margin-right: 50px">
{% for i in photoType %}
<option {{ i.id == item.image_type?"selected":"" }} value="{{ i.id }}">{{ i.value }}</option>
{% endfor %}
</select>
</td>
<td>
<img src="{{siteUrl}}{{item.path}}" height="90" width="140" style="margin-right: 50px">
</td>
<td>
<input type="radio" name="frontCover" style="margin-right: 50px" value="{{item.image_id}}" {{ result.frontCover_id == item.image_id?"checked":"" }} />
</td>
<td>
<input type="button" value="删除" class="button action cancel existsCancel">
</div>
</tr>
{% endfor %}
</tbody>
</table>
<input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" >
<button type="button" id="housePicture" class="button action" data-toggle="modal" style="margin-top: 10px">
新增
</button>
<script>
(function($){
$(document).ready(function(){
//新增房源相册
var j = 0;
$("#housePicture").click(function(){
var tr = $("<tr>");
var td = $("<td>");
var select = $("<select>").attr({"name":"data["+j+"][type]"}).addClass("form-control");
{% for item in photoType %}
select.append($("<option>").attr("value",{{item.id}}).append('{{item.value}}'));
{% endfor%}
var td1 = td.clone().append(select);
var file = $("<input>").attr({"type":"file","name":"files["+j+"]"}).addClass("picFiles form-control");
var td2 = td.clone().append(file);
var radio = $("<input>").attr({"type":"radio","name":"frontCover","value":j}).addClass("form-control");
var td3 = td.clone().append(radio);
var picDelet = $("<input>").attr({"type":"button","value":"删除"}).addClass("button action existsCancel form-control");
var td4 = td.clone().append(picDelet);
tr.append(td1).append(td2).append(td3).append(td4);
$("#photosTbody").append(tr);
j++
});
$("#photosTbody").on("change",".picFiles",function(){
var that = this;
if (this.files && this.files[0]){
var reader = new FileReader();
reader.onload = function (e){
var img = $("<img>").attr({"src":e.target.result,"heghit":90,"width":140});
$(that).before(img);
$(that).hide();
}
reader.readAsDataURL(this.files[0]);
}
});
$("#photosTbody").on("click",".existsCancel",function(){
$(this).parent().parent().remove();
});
});
})(jQuery);
</script>
\ No newline at end of file
<br />
<div class="row">
<div class="col-md-12">
<label for="housename">标题:</label>
<input name="housename" id="housename" type="text" value="{{result.name}}" class="form-control" >
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<label for="mark">标签:</label>
<input name="mark" id="mark" type="text" value="{{mark}}" class="form-control">
</div>
</div>
\ No newline at end of file
...@@ -38,6 +38,7 @@ function tospur_theme_format(){ ...@@ -38,6 +38,7 @@ function tospur_theme_format(){
add_filter('admin_footer_text', tospur_remove_admin_footer_text, 1000); add_filter('admin_footer_text', tospur_remove_admin_footer_text, 1000);
add_filter('update_footer', tospur_remove_admin_footer_upgrade, 1000); add_filter('update_footer', tospur_remove_admin_footer_upgrade, 1000);
add_action('login_enqueue_scripts', 'tospur_login_logo'); add_action('login_enqueue_scripts', 'tospur_login_logo');
add_action( 'admin_enqueue_scripts', 'tospur_load_resources');
//admin bar //admin bar
add_action('wp_before_admin_bar_render', 'tospur_remove_admin_bar'); add_action('wp_before_admin_bar_render', 'tospur_remove_admin_bar');
function tospur_remove_admin_footer_text($footer_text =''){ function tospur_remove_admin_footer_text($footer_text =''){
...@@ -68,6 +69,19 @@ function tospur_theme_format(){ ...@@ -68,6 +69,19 @@ function tospur_theme_format(){
<?php } <?php }
} }
function tospur_load_resources(){
wp_enqueue_script('jquery-ui');
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('publicjs');
wp_enqueue_script('validate');
wp_enqueue_style('jquery-ui_css');
wp_enqueue_style('bootstrapMinCss');
}
function tospur_register_script_style(){ function tospur_register_script_style(){
wp_register_script('jquery-ui',plugins_url('Admin/views', __FILE__)."/js/jquery-ui.js"); wp_register_script('jquery-ui',plugins_url('Admin/views', __FILE__)."/js/jquery-ui.js");
wp_register_script('validate',plugins_url('Admin/views', __FILE__)."/js/jquery.validate.js"); wp_register_script('validate',plugins_url('Admin/views', __FILE__)."/js/jquery.validate.js");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment