Browse Source

add fav form ui update

master
filesite 7 months ago
parent
commit
0d5dfa573e
  1. 8
      themes/tajian/views/site/new.php
  2. 7
      www/css/tajian.css
  3. 65
      www/js/tajian.js

8
themes/tajian/views/site/new.php

@ -2,11 +2,7 @@ @@ -2,11 +2,7 @@
<form class="add_video_form g_form_style" id="add_video_form" action="" method="get">
<div class="">
<label for="text_input_link" class="form-label">分享网址/内容</label>
<input type="text" id="text_input_link" name="share_content" placeholder="请粘贴分享网址/内容">
</div>
<div class="mb-3">
<label for="text_input_title" class="form-label">视频标题(可选)</label>
<input type="text" id="text_input_title" name="video_title" placeholder="请输入视频标题">
<textarea rows="5" id="text_input_link" name="share_content" placeholder="请粘贴分享网址/内容"></textarea>
</div>
<div class="mb-3">
<label for="text_input_title" class="form-label">选分类(可选)</label>
@ -30,7 +26,7 @@ eof; @@ -30,7 +26,7 @@ eof;
<circle cx="50" cy="50" r="20"></circle>
</svg>
</div>
<span class="bt_text_JS">提交</span>
<span class="bt_text_JS">保存</span>
<div class="bt_loading_cover bt_class_JS elementNone"></div>
</button>
</div>

7
www/css/tajian.css

@ -21,9 +21,9 @@ a:active{text-decoration:none;} @@ -21,9 +21,9 @@ a:active{text-decoration:none;}
a:visited{text-decoration:none;}
a:link{text-decoration:none;}
.breadcrumbs{padding-left:1em;padding-top:1em}
.footer{margin:5em auto 6em auto;text-align:center}
.footer{margin:7em auto 6em auto;text-align:center}
/* 首页 star*/
/* 首页 start*/
.g_app_lay{padding:56px 0 0 200px;}
/* 顶部导航 */
.top_nav{position:fixed;top:0;left:0;z-index:1100;width:100%;height:56px;overflow:hidden;background:#FFF;padding:8px 22px;display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;justify-content: space-between;}
@ -101,7 +101,7 @@ a:link{text-decoration:none;} @@ -101,7 +101,7 @@ a:link{text-decoration:none;}
.sideboxShow{animation:bounceInRight 0.5s ease forwards;}
/* 添加视频 */
.g_form_style{width:406px;margin:11% auto 0 auto;}
.g_form_style{width:406px;margin:8% auto 0 auto}
.g_form_style input,.g_form_style select{width:100%;font-size:15px;padding:12px 10px;border-radius:5px;border:solid 1px #9b9b9b;margin:6px 0 0 0;}
.g_form_style>div{margin-bottom:11px;}
.avform_bt{margin-top:18px;}
@ -112,6 +112,7 @@ a:link{text-decoration:none;} @@ -112,6 +112,7 @@ a:link{text-decoration:none;}
}
.loading_bt circle {fill: none;stroke: #FFF;stroke-width: 7;stroke-dasharray: 1, 200;stroke-dashoffset: 0;stroke-linecap: round;animation: diansh 2s ease-in-out infinite;
}
.g_form_style textarea{display:block;width:100%;padding:4px}
/* 个人中心 */
.ui_name{padding:3% 0 0 0;margin-bottom:20px;display:flex;align-items: center;justify-content:center;}

65
www/js/tajian.js

@ -106,7 +106,7 @@ if ($('#add_video_form').get(0)) { @@ -106,7 +106,7 @@ if ($('#add_video_form').get(0)) {
// 添加视频表单处理
$('#add_video_form .jsbtn').click(function (e) {
e.preventDefault();
let inputList = $('#add_video_form input');
let inputList = $('#add_video_form textarea');
if (!inputList[0].value) {
alert('请填写分享内容或网址!');
return false;
@ -122,7 +122,6 @@ if ($('#add_video_form').get(0)) { @@ -122,7 +122,6 @@ if ($('#add_video_form').get(0)) {
let datas = {
'content': inputList[0].value,
'title': inputList[1].value,
'tag': $('#add_video_form select').val()
}
@ -199,66 +198,4 @@ function publicAjax(apiUrl, method, datas, callback, fail) { @@ -199,66 +198,4 @@ function publicAjax(apiUrl, method, datas, callback, fail) {
});
};
//--v1.0--
/*
//show modal
$('.btn-open').click(function(evt) {
var target_id = $(evt.target).parents('.btn-open').attr('href');
if ($(evt.target).hasClass('btn-open')) {
target_id = $(evt.target).attr('href');
}
$(target_id).css('display', 'block');
});
//hide modal
$('.btn-close').click(function(evt) {
$(evt.target).parents('.modal-mask').css('display', 'none');
});
$('.modal-mask').click(function(evt) {
if ($(evt.target).hasClass('modal-mask')) {
$(evt.target).css('display', 'none');
}
});
$('#btn_addfav').click(function(e) {
var share_content = $('input[name=share_content]').val(),
select_tag = $('select[name=tag]').val();
if (!share_content) {
alert('请填写分享内容或网址!');
return false;
}else if (/https:\/\/[\w\.]+\/[\w]+/ig.test(share_content) == false) {
alert('目前只支持抖音、快手、西瓜视频和Bilibili的分享网址哦!');
return false;
}
var btn = this;
$(btn).prop('disabled', true);
var postData = {content: share_content};
if (select_tag) {
postData.tag = select_tag;
}
$.ajax({
url: '/frontapi/addfav',
method: 'POST',
dataType: 'JSON',
data: postData
}).done(function(data, textStatus, jqXHR) {
$(btn).removeAttr('disabled');
if (data.code == 1) {
$('input[name=share_content]').val('');
alert(data.msg || data.err);
}else {
alert('保存失败!' + data.err);
}
}).fail(function(jqXHR, textStatus, errorThrown) {
$(btn).removeAttr('disabled');
alert('服务器异常了:' + errorThrown);
});
});
*/
})();

Loading…
Cancel
Save