Commit e2d78274 by shz

tospur

parent ef304d65
......@@ -8,8 +8,10 @@ class House extends Tospur_House{
public static function init_view(){
wp_enqueue_script('jquery-ui');
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('validate');
wp_enqueue_style('jquery-ui_css');
wp_enqueue_style('bootstrapcss');
wp_enqueue_style('bootstrapMinCss');
global $wpdb;
$type = $_POST["type"];
......@@ -56,7 +58,6 @@ class House extends Tospur_House{
}
}else{
$result = House::data_insert($insert_tospur_house_array);
print_r($result);
if($result != 200){
$wpdb->query("ROLLBACK");
print_r($result);;
......
......@@ -47,3 +47,5 @@ class introduction
return $current_user->ID;
}
}
?>
\ No newline at end of file
......@@ -7,6 +7,7 @@ class SecHandHouse extends Tospur_House{
public static function secHandHouse_html(){
wp_enqueue_script('bootstrapjs');
wp_enqueue_style('bootstrapcss');
wp_enqueue_style('bootstrapMinCss');
global $wpdb;
$type = $_POST["type"];
$context = array();
......@@ -69,6 +70,7 @@ class SecHandHouse extends Tospur_House{
$context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id);
$context["mark"] = SearchDao::searchHouseTag($_GET['id']);
$context["featureOld"] = SearchDao::searchFeatureByHouse($_GET['id']);
}
$context['role'] = SecHandHouse::getCurrentRole();
$context["city"] = SearchDao::searchCity();
......@@ -144,7 +146,6 @@ class SecHandHouse extends Tospur_House{
$wpdb->delete(Config::A_HOUSE_USER_TABLE,array("house_id" => $houseId));
InsertDao::addRecConsultant($houseId,$data);
// $wpdb->delete(Config::A_HOUSE_TAG_TABLE,array("house_id" => $houseId));
$wpdb->query(
$wpdb->prepare(
"DELETE FROM a_house_tag
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -285,7 +285,7 @@
<script>
(function($){
$(document).ready(function(){
var titleFlag = 0;
//主力房源中选择图片file的下标
var i = 0;
//基本信息的联动AJAX
......@@ -482,14 +482,29 @@
//新增房源相册
$("#housePicture").click(function(){
var checkBox = $("<input>").attr({"type":"radio","name":"frontCover","value":i});
var picDelet = $("<input>").attr({"type":"button","value":"删除"}).addClass("picDelet");
var picDelet = $("<input>").attr({"type":"button","value":"删除"}).addClass("button action picDelet");
var file = $("<input>").attr({"type":"file","name":"files["+i+"]"}).addClass("picFiles");
var select = $("<select>").attr("name","data["+i+"][type]");
var checkTd = $("<th>").append(checkBox);
var picDeletTd = $("<td>").append(picDelet);
var selectTd = $("<th>").append(select);
var fileTd = $("<th>").append(file);
{% for item in photoType %}
select.append($("<option>").attr("value",{{item.id}}).append('{{item.value}}'));
{% endfor%}
var p = $("<p>").append(checkBox).append(select).append(file).append(picDelet);
var p = $("<p>").append(checkTd).append(selectTd).append(fileTd).append(picDeletTd);
var fontA = $("<font>").append("设为封面");
var fontB = $("<font>").append("类型");
var fontC = $("<font>").append("相册");
var tdA = $("<th>").append(fontA);
var tdB = $("<th>").append(fontB);
var tdC = $("<th>").append(fontC);
var titleP = $("<p>").append(tdA).append(tdB).append(tdC);
$("#picList").append(p);
if( titleFlag== 0){
$("#picList").before(titleP);
titleFlag = 1
}
i++
});
......
......@@ -15,5 +15,4 @@ if ($user_id != 0) {
exit;
}
?>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=360, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title>评分</title>
<link rel="stylesheet" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ theme }}/css/star-rating.min.css">
<script src="{{ theme }}/js/jquery.min.js"></script>
<script src="{{ theme }}/js/star-rating.min.js"></script>
<script>
$(document).ready(function () {
var score = 0;
$('#score').rating({
min: 0,
max: 5,
step: 0.5,
size: 'xs',
showClear: false,
showCaption: false,
hoverEnabled: false,
starCaptions: function (data) {
score = data;
$(this).val(score);
}
});
var scoreForm = $('#scoreForm');
scoreForm.submit(function () {
if (score > 0) {
$.ajax({
type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=add_score&' + scoreForm.serialize(),
success: function (data) {
if (data.code == 2000) {
alert('评分成功');
}else{
alert('不能重复评分');
}
}
});
} else {
alert('请选择评分');
}
return false;
});
});
</script>
</head>
<body>
<form id="scoreForm" method="post">
<br>
<label for="score">评分</label>
<input type="hidden" id="score" name="score" value="0">
<input type="hidden" name="user_id" value="{{ user_id }}">
<input type="hidden" name="consultant_id" value="{{ consultant_id }}">
<br>
<p class="submit">
<input type="submit" id="score_submit" value="提交">
</p>
</form>
</body>
</html>
\ No newline at end of file
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