Browse Source

自录入及编辑优化

pull/1/head
pengda 2 months ago
parent
commit
c4181486b5
  1. 4
      control/weibo.php
  2. 4
      model/mWeibo.php
  3. 12
      view/js/index.js
  4. 10
      view/templates/weibo/home.html

4
control/weibo.php

@ -55,8 +55,8 @@ class weibo extends publicBase {
public function ajax_edit_weibo() { public function ajax_edit_weibo() {
$id = trim($this->post('id')); $id = trim($this->post('id'));
$text = trim($this->post('desc')); $text = trim($this->post('answer'));
$refer = trim($this->post('answer')); $refer = trim($this->post('desc'));
$status = $this->post('status') + 0; $status = $this->post('status') + 0;
if ($id) { if ($id) {

4
model/mWeibo.php

@ -33,6 +33,10 @@ class mWeibo extends mBase {
if (empty($list)) return array(); if (empty($list)) return array();
foreach ($list as &$v) { foreach ($list as &$v) {
$v['name'] = '微博粉丝';
if($v['uid'] == 2282201403) $v['name'] = '张宝旬';
if($v['uid'] == 1) $v['name'] = '管理员';
$pic_ids = json_decode($v['pic_ids'], 1); $pic_ids = json_decode($v['pic_ids'], 1);
$pic_arr = array(); $pic_arr = array();
if ($pic_ids) { if ($pic_ids) {

12
view/js/index.js

@ -8,13 +8,13 @@ $(document).ready(function () {
var radio_val = $(this).attr('value') var radio_val = $(this).attr('value')
$('.edit-input').val('') $('.edit-input').val('')
if (radio_val == '1') { if (radio_val == '1') {
$('.answer-form').hide() $('.normal-form').hide()
$('.common-input').html('录入信息') $('.common-input').html('录入信息')
$('.normal-input').removeClass('h74') $('.normal-input').removeClass('h74')
} else { } else {
$('.common-input').html('提问信息') $('.common-input').html('回答信息')
$('.normal-input').addClass('h74') $('.normal-input').addClass('h74')
$('.answer-form').show() $('.normal-form').show()
} }
$('.radio-wrap .radio_box').removeClass('radio_box_active'); $('.radio-wrap .radio_box').removeClass('radio_box_active');
$(this).parent().addClass('radio_box_active'); $(this).parent().addClass('radio_box_active');
@ -38,8 +38,8 @@ $(document).ready(function () {
$('.edit-input').val('') $('.edit-input').val('')
$('.radio-form').hide(); $('.radio-form').hide();
$('.answer-form').hide(); $('.normal-form').hide();
$('.normal-input').val(res.data.text); $('.answer-input').val(res.data.text);
$('.char-count').text(res.data.text.length + '/100'); $('.char-count').text(res.data.text.length + '/100');
if ($('.modal').hasClass('addmodal')) { if ($('.modal').hasClass('addmodal')) {
@ -497,7 +497,7 @@ $(document).ready(function () {
<div class="list_item_top_l"> <div class="list_item_top_l">
<span class="${item.wid != '' ? 'green' : 'blue'}">${item.wid != '' ? '微博' :'自录入'}</span> <span class="${item.wid != '' ? 'green' : 'blue'}">${item.wid != '' ? '微博' :'自录入'}</span>
${item.refer ? `<b>${item.refer}</b>` :''} ${item.refer ? `<b>${item.refer}</b>` :''}
<span class="name">` + item.wid + `</span> <span class="name">` + item.name + `</span>
<span>录入` + item.created_at + `</span> <span>录入` + item.created_at + `</span>
</div> </div>
${ ${

10
view/templates/weibo/home.html

@ -107,9 +107,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-item"> <div class="form-item normal-form" style="display: none;">
<div class="form-left common-input"> <div class="form-left">
录入信息 提问信息
</div> </div>
<div class="form-right"> <div class="form-right">
<div class="text-area-container"> <div class="text-area-container">
@ -119,8 +119,8 @@
</div> </div>
</div> </div>
<div class="form-item answer-form" style="display: none;"> <div class="form-item">
<div class="form-left"> <div class="form-left common-input">
回答信息 回答信息
</div> </div>
<div class="form-right"> <div class="form-right">

Loading…
Cancel
Save