Просмотр исходного кода

usent class 增加句子发送函数 判断发送状态

visuddhinanda 5 лет назад
Родитель
Сommit
045ba6630c

+ 27 - 0
app/channal/function.php

@@ -0,0 +1,27 @@
+<?php
+require_once "../path.php";
+class Channal
+{
+    public $dbh;
+    public function __construct() {
+        $dns = "sqlite:"._FILE_DB_CHANNAL_;
+        $this->dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
+        $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);  
+    }
+
+    public function getChannal($id){
+        $query = "SELECT * FROM channal WHERE id= ? ";
+        $stmt = $this->dbh->prepare($query);
+        $stmt->execute(array($id));
+        $channal = $stmt->fetchAll(PDO::FETCH_ASSOC);
+        if(count($channal)>0){
+            return $channal[0];
+        }
+        else{
+            return false;
+        }
+    }
+
+}
+
+?>

+ 1 - 1
app/channal/my_channal_list.php

@@ -68,7 +68,7 @@ require_once '../ucenter/function.php';
 
 global $PDO;
 PDO_Connect("sqlite:"._FILE_DB_CHANNAL_);
-$query = "select * from channal where owner = '{$_COOKIE["userid"]}'   limit 0,100";
+$query = "SELECT * from channal where owner = '{$_COOKIE["userid"]}'   limit 0,100";
 $Fetch = PDO_FetchAll($query);
 
 foreach($Fetch as $row){

+ 35 - 0
app/pcdl/js/reader.js

@@ -85,3 +85,38 @@ function setNaviVisibility(strObjId = "") {
     objNave.className = "viewswitch_off";
   }
 }
+
+function trans_sent_save() {
+  let textarea = $("#sent_modify_text");
+  if (textarea) {
+    let objsent = new Object();
+    const editor = textarea.attr("editor");
+    if (getCookie("userid") == editor) {
+      objsent.id = textarea.attr("sent_id");
+    } else {
+      objsent.parent = textarea.attr("sent_id");
+      objsent.tag = textarea.attr("translation");
+    }
+    objsent.book = textarea.attr("book");
+    objsent.paragraph = textarea.attr("para");
+    objsent.begin = textarea.attr("begin");
+    objsent.end = textarea.attr("end");
+    objsent.author = textarea.attr("author");
+    objsent.lang = textarea.attr("lang");
+    objsent.text = textarea.val();
+    let sents = new Array();
+    sents.push(objsent);
+    $.post(
+      "../usent/update.php",
+      {
+        data: JSON.stringify(sents),
+      },
+      function (data, status) {
+        if (status == "success") {
+          let result = JSON.parse(data);
+          alert(result);
+        }
+      }
+    );
+  }
+}

+ 161 - 32
app/pcdl/reader.php

@@ -3,6 +3,8 @@ require_once "../public/_pdo.php";
 require_once "../path.php";
 require_once '../public/load_lang.php';
 require_once '../public/function.php';
+require_once '../channal/function.php';
+require_once '../ucenter/function.php';
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html>
@@ -15,6 +17,7 @@ require_once '../public/function.php';
 	<title id="page_title">PCD Reader</title>
 
 	<script src="js/jquery-3.3.1.min.js"></script>
+	<script src="../public/js/jquery-ui-1.12.1/jquery-ui.js"></script>
 	<script src="js/fixedsticky.js"></script>
 	<script src="js/reader.js"></script>
 	<script src="../public/js/comm.js"></script>
@@ -33,6 +36,11 @@ require_once '../public/function.php';
 	</script>
 
 <style>
+	.edit_icon{
+		display:inline-block;
+		width:1.4em;
+		height:1.4em;
+	}
 		#para_nav {
 			display: flex;
 			justify-content: space-between;
@@ -269,7 +277,9 @@ $tocHtml="";
 if(isset($_GET["album"])){
 	$album=$_GET["album"];
 }
-
+if(isset($_GET["channal"])){
+	$channal=$_GET["channal"];
+}
 if(isset($_GET["book"])){
 	$book=$_GET["book"];
 }
@@ -390,28 +400,7 @@ else{
 						$tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}&para={$value["paragraph"]}&display={$_display}'>{$value["toc"]}</a></div>";
 					}
 				}
-			/*
-				if($tocMinLevel==0){
-					if($value["level"]>$tocMaxLevel){
-						$tocMinLevel = $value["level"];
-						$tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}&para={$value["paragraph"]}&display={$_display}'>{$value["toc"]}</a></div>";
-					}
-					else{
-						$tocHtml .= "</div></div><div class='toc_1 {$classCurrToc}'>";
-						$tocHtml .= "<div class='toc_1_title {$classCurrToc}'>{$value["toc"]}</div><div class='toc_2 $classCurrToc2'>";
-					}
-					
-				}
-				else{
-					if($value["level"] == $tocMaxLevel){
-						$tocHtml .= "</div></div><div class='toc_1 {$classCurrToc}'>";
-						$tocHtml .= "<div  class='toc_1_title {$classCurrToc}'>{$value["toc"]}</div><div class='toc_2 $classCurrToc2' >";
-					}
-					else if($value["level"] == $tocMinLevel){
-						$tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}&para={$value["paragraph"]}&display={$_display}'>{$value["toc"]}</a></div>";
-					}
-				}
-*/
+
 				//右侧目录
 				
 				if($value["paragraph"]>$currParaBegin && $value["paragraph"]<$currParaEnd){
@@ -645,9 +634,32 @@ else{
 
 	}
 
+	//查询编辑者数量
+
+		//查询句子译文内容
 	PDO_Connect("sqlite:"._FILE_DB_SENTENCE_);
 	$dbh = new PDO("sqlite:"._FILE_DB_PALI_SENTENCE_, "", "");
-    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+	$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+	//查询channal数量
+	switch ($_view) {
+		case 'chapter':
+			$query = "SELECT channal from 'sentence' where book= ? and (paragraph between  ? and ? ) group by channal";
+			$FetchChannal = PDO_FetchAll($query,array($book,$par_begin,$par_end));
+		break;
+		case 'para':
+			# code...
+			$query = "SELECT channal from 'sentence' where book= ? and paragraph = ? group by channal";
+			$FetchChannal = PDO_FetchAll($query,array($book,$par_begin));
+		break;
+		case 'sent':
+			# code...
+			$query = "SELECT channal from 'sentence' where book= ? and paragraph =  ? AND begin =  ? AND end =  ? group by channal";
+			$FetchChannal = PDO_FetchAll($query,array($book,$par_begin,$_GET["begin"],$_GET["end"]));
+			break;	
+	}
+	
+	
+
 	for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
 		if($_view=="sent"){
 			$FetchPaliSent = array(array("begin" => $_GET["begin"] , "end" => $_GET["end"]));
@@ -661,14 +673,23 @@ else{
 		foreach ($FetchPaliSent as $key => $value) {
 			$begin = $value["begin"];
 			$end = $value["end"];
+			if(isset($_GET["channal"])){
+				$query_channal = " AND channal=".$PDO->quote($_GET["channal"]);
+			}
 			if($_view=="sent"){
-				$query="SELECT * FROM \"sentence\" WHERE (book = '{$book}' AND  \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND length(text)>0 )  order by modify_time  DESC";
+				if(isset($_GET["sent"])){
+					$query="SELECT * FROM \"sentence\" WHERE id = ".$PDO->quote($_GET["sent"]);
+				}
+				else{
+					$query="SELECT * FROM \"sentence\" WHERE (book = ".$PDO->quote($book)." AND  \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end'  AND strlen <> 0  ) {$query_channal}  order by modify_time  DESC";
+				}
+				
 			}
 			else{
-				$query = "SELECT * FROM \"sentence\" WHERE book = '{$book}' AND  \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND length(text)>0  order by modify_time DESC  limit 0, 1";
+				$query = "SELECT * FROM \"sentence\" WHERE book = ".$PDO->quote($book)." AND  \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND strlen <> 0  {$query_channal} order by modify_time DESC  limit 0, 1";
 			}
 
-			$query_count = "SELECT count(book) FROM \"sentence\" WHERE book = '{$book}' AND  \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND length(text)>0  ";
+			$query_count = "SELECT count(book) FROM \"sentence\" WHERE book = ".$PDO->quote($book)." AND  \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND strlen > 0  {$query_channal} ";
 			$sent_count = PDO_FetchOne($query_count);
 			if($sent_count>9){
 				$sent_count = "9+";
@@ -676,6 +697,12 @@ else{
 			$FetchText = PDO_FetchAll($query);
 			$iFetchText=count($FetchText);
 			if($iFetchText>0){
+				if(isset($_GET["sent"])){
+					$query="SELECT * FROM \"sentence\" WHERE parent = ".$PDO->quote($_GET["sent"]);
+					$FetchChildren = PDO_FetchAll($query);
+					$FetchText = array_merge ($FetchText,$FetchChildren);
+				}
+				$iFetchText=count($FetchText);
 				for($i=0;$i<$iFetchText;$i++){
 					$currParNo=$iPar;
 					if($_display=="sent"){
@@ -684,11 +711,37 @@ else{
 					else{
 						$sent_style = "";
 					}
+					if(!empty($FetchText[$i]["parent"])){
+						$reply_style = " sent_reply ";
+					}
+					else{
+						$reply_style = "";
+					}
 					$tran_text = str_replace("[[","<term status='0'>",$FetchText[$i]["text"]);
 					$tran_text = str_replace("]]","</term>",$tran_text);
-					echo "<sent_trans style='{$sent_style}' id='sent-tran-b{$book}-{$currParNo}-{$FetchText[$i]["begin"]}-{$i}' class='sent_trans ' book='$book' para='$currParNo' begin='{$FetchText[$i]["begin"]}'>".$tran_text;
+					echo "<sent_trans style='{$sent_style}{$reply_style}' id='sent-tran-b{$book}-{$currParNo}-{$FetchText[$i]["begin"]}-{$i}' class='sent_trans ' book='$book' para='$currParNo' begin='{$FetchText[$i]["begin"]}'>";
+					echo "<span class='sent_text' ";
+					echo " sent_id='".$FetchText[$i]["id"]."'";
+					echo " editor='".$FetchText[$i]["editor"]."'";
+					echo " book='".$FetchText[$i]["book"]."'";
+					echo " para='".$FetchText[$i]["paragraph"]."'";
+					echo " begin='".$FetchText[$i]["begin"]."'";
+					echo " end='".$FetchText[$i]["end"]."'";
+					echo " lang='".$FetchText[$i]["language"]."'";
+					echo " channal='".$FetchText[$i]["channal"]."'";
+					echo " tag='".$FetchText[$i]["tag"]."'";
+					echo " author='".$FetchText[$i]["author"]."'";
+					echo " text='".$FetchText[$i]["text"]."'";
+					echo ">";
+					echo $tran_text;
+					echo "</span>";
 					if($_view!="sent" && $_display=="sent"){
-						echo "<span class='sent_count'>$sent_count</span>";
+						if(isset($_GET["channal"])){
+							echo "<svg class='edit_icon';'><use xlink:href='../studio/svg/icon.svg#ic_mode_edit'></use></svg>";
+						}
+						else{
+							echo "<span class='sent_count'>$sent_count</span>";
+						}
 					}
 					echo "</sent_trans>";
 					echo "<script>";
@@ -704,8 +757,6 @@ else{
 	
 		}
 	}
-		//查询句子译文内容
-
 		//查询句子译文内容结束
 
 	echo "<div id='para_nav'><a name='nav_foot'></a>";
@@ -787,6 +838,45 @@ else{
 	if($currLevel>=$tocMinLevel){
 		echo $htmlToc2; 
 	}
+
+	echo "<div>Channal</div>";
+	$_channal = new Channal();
+	$_userinfo = new UserInfo();
+	echo "<div>";
+	echo "<a href='../pcdl/reader.php?view={$_GET["view"]}";
+	echo "&book=".$_GET["book"];
+	echo "&para=".$_GET["para"];
+	if(isset($_GET["begin"])){
+		echo "&begin=".$_GET["begin"];
+	}
+	if(isset($_GET["end"])){
+		echo "&end=".$_GET["end"];
+	}
+	echo "' >";
+	echo "全部";
+	echo "</a>";
+	echo "</div>";
+	foreach ($FetchChannal as $key => $value) {
+		# code...
+		echo "<div>";
+		echo "<a href='../pcdl/reader.php?view={$_GET["view"]}";
+		echo "&book=".$_GET["book"];
+		echo "&para=".$_GET["para"];
+		if(isset($_GET["begin"])){
+			echo "&begin=".$_GET["begin"];
+		}
+		if(isset($_GET["end"])){
+			echo "&end=".$_GET["end"];
+		}
+		echo "&channal=".$value["channal"]."' >";
+		$channalInfo = $_channal->getChannal($value["channal"]);
+		if($channalInfo){
+			echo $_userinfo->getName($channalInfo["owner"]);
+			echo '/'.$channalInfo["name"];			
+		}
+		echo "</a>";
+		echo "</div>";
+	}
 	?>
 
 	</div>
@@ -844,8 +934,20 @@ else{
 	</div>
 
 	<div id="mean_menu" ></div>
+
+	<div id="sent_modify_win">
+		<div>
+			<textarea id="sent_modify_text" style="width:100%;">
+			</textarea><br>
+			<button onclick="trans_sent_save()">发送</button>				
+		</div>
+	</div>
+
+
+
 <script>
-		//lookup();
+
+
 		$(".pali").mouseover(function(e){
 			var targ
 			if (!e) var e = window.event;
@@ -910,6 +1012,33 @@ else{
 			$(this).css("background-color","unset");
 			$("sent[book='"+book+"'][para='"+para+"'][begin='"+begin+"']").css("background-color","unset");
 		});
+		$(".sent_text").click(function(e){
+			let book = $(this).attr("book");
+			let para = $(this).attr("para");
+			let begin = $(this).attr("begin");
+			let end = $(this).attr("end");
+			let id = $(this).attr("sent_id");
+			window.location.assign("reader.php?view=sent&book="+book+"&para="+para+"&begin="+begin+"&end="+end+"&sent="+id);
+		});
+
+
+		$(".edit_icon").click(function(e){
+			let objSent = $(this).parent().children(".sent_text").first();
+			if(objSent){
+				let text = objSent.attr("text");
+				$("#sent_modify_text").val(text);
+				$("#sent_modify_text").attr("sent_id",objSent.attr("sent_id"));
+				$("#sent_modify_text").attr("editor",objSent.attr("editor"));
+				$("#sent_modify_text").attr("book",objSent.attr("book"));
+				$("#sent_modify_text").attr("para",objSent.attr("para"));
+				$("#sent_modify_text").attr("begin",objSent.attr("begin"));
+				$("#sent_modify_text").attr("end",objSent.attr("end"));
+				$("#sent_modify_text").attr("lang",objSent.attr("lang"));
+				$("#sent_modify_text").attr("tag",objSent.attr("tag"));
+				$(this).parent().append($("#sent_modify_win"));				
+			}
+
+		});
 
 		$("para").click(function(e){
 			let book = $(this).attr("book");

+ 18 - 14
app/studio/js/render.js

@@ -1763,16 +1763,32 @@ function render_tran_sent_block(
   }
   output += "'>";
   output += "<div class='trans_text_info' style='border:none;'>";
+
   if (channal == 0) {
     output += "<span class='author'>" + sender + "</span><span>[滤]</span>";
   } else {
+    output +=
+      "<span><span class='send_status' id='send_" +
+      book +
+      "_" +
+      para +
+      "_" +
+      begin +
+      "_" +
+      end +
+      "_" +
+      channal +
+      "'></span>";
+    output += "<span>";
     let thischannal = channal_getById(channal);
     if (thischannal) {
       output += thischannal.name;
     } else {
       output += "未知的频道名";
     }
+    output += "</span>";
   }
+  output += "</span><span></span>";
   output += "</div>";
   output +=
     "<div class='trans_text_content'  pcds='sent-net' book='" +
@@ -1920,22 +1936,10 @@ function trans_text_save(book, para, begin, end, channal) {
     objsent.author = textarea.attr("author");
     objsent.lang = textarea.attr("lang");
     objsent.text = textarea.val();
-    let sents = new Array();
-    sents.push(objsent);
-    $.post(
-      "../usent/update.php",
-      {
-        data: JSON.stringify(sents),
-      },
-      function (data, status) {
-        if (status == "success") {
-          let result = JSON.parse(data);
-          console.log(result);
-        }
-      }
-    );
+    _user_sent_buffer.setSent(objsent);
   }
 }
+
 function sent_edit_click(book, para, begin, end, channal) {
   $(".trans_sent_edit").parent().hide(200);
   $(

+ 28 - 0
app/ucenter/function.php

@@ -37,4 +37,32 @@ function ucenter_getA($userid,$fields="nickname"){
     }
 
 }
+
+class UserInfo
+{
+    public $dbh;
+    public function __construct() {
+        $dns = "sqlite:"._FILE_DB_USERINFO_;
+        $this->dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
+        $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);  
+    }
+
+    public function getName($id){
+        if($this->dbh){
+            $query = "SELECT nickname FROM user WHERE userid= ? ";
+            $stmt = $this->dbh->prepare($query);
+            $stmt->execute(array($id));
+            $user = $stmt->fetchAll(PDO::FETCH_ASSOC);
+            if(count($user)>0){
+                return $user[0]["nickname"];
+            }
+            else{
+                return "";
+            }            
+        }
+        else{
+            return "";
+        }
+    }
+}
 ?>

+ 1 - 1
app/usent/sent_query.php

@@ -18,7 +18,7 @@ $dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);  
 /* 开始一个事务,关闭自动提交 */
 
-$query="SELECT * FROM sentence WHERE (book = ?  AND paragraph = ? AND begin = ? AND end = ? AND text <> '' ) order by modify_time DESC limit 0,10";
+$query="SELECT * FROM sentence WHERE (book = ?  AND paragraph = ? AND begin = ? AND end = ? AND strlen > 0  ) order by modify_time DESC limit 0,10";
 $stmt = $dbh->prepare($query);
 foreach ($sentList as $key => $value) {
     # code...

+ 19 - 7
app/usent/update.php

@@ -35,12 +35,14 @@ foreach ($aData as $data) {
 		$oldList[] = $data;
 	}
 }
+$update_list = array(); //已经成功修改数据库的数据列表 回传客户端
 
 /* 修改现有数据 */
 $PDO->beginTransaction();
-$query="UPDATE sentence SET text= ?  , status = ? , receive_time= ?  , modify_time= ?   where  id= ?  ";
+$query="UPDATE sentence SET text= ?  , status = ? , strlen = ? , receive_time= ?  , modify_time= ?   where  id= ?  ";
 $sth = $PDO->prepare($query);
 
+
 foreach ($oldList as $data) {
 	if(isset($data["id"])){
 		if(isset($data["time"])){
@@ -49,7 +51,7 @@ foreach ($oldList as $data) {
 		else{
 			$modify_time = mTime();
 		}
-		$sth->execute(array($data["text"], $data["status"], mTime(),$modify_time,$data["id"]));
+		$sth->execute(array($data["text"], $data["status"], mb_strlen($data["text"],"UTF-8"), mTime(),$modify_time,$data["id"]));
 	} 
 }
 
@@ -67,10 +69,13 @@ if (!$sth || ($sth && $sth->errorCode() != 0)) {
 else{
 	$respond['status']=0;
 	$respond['message']="成功";
+	foreach ($oldList as $key => $value) {
+		$update_list[] =  $value;
+	}
 }
 
 
-/* 插入数据 */
+/* 插入数据 */
 $PDO->beginTransaction();
 $query = "INSERT INTO sentence (id, 
 														parent,
@@ -86,12 +91,14 @@ $query = "INSERT INTO sentence (id,
 														language,
 														ver,
 														status,
+														strlen,
 														modify_time,
-														receive_time
+														receive_time,
+														create_time
 														) 
-										VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )";
+										VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )";
 $sth = $PDO->prepare($query);
-$new_id = array();
+
 foreach ($newList as $data) {
 		$uuid = UUID::v4();
 		if($data["parent"]){
@@ -114,6 +121,8 @@ foreach ($newList as $data) {
 										  $data["language"],
 										  1,
 										  7,
+										  mb_strlen($data["text"],"UTF-8"),
+										  mTime(),
 										  mTime(),
 										  mTime()
 										));
@@ -131,8 +140,11 @@ if (!$sth || ($sth && $sth->errorCode() != 0)) {
 }
 else{
 	$respond['insert_error']=0;
-	$respond['new_list']=$new_id;
+	foreach ($newList as $key => $value) {
+		$update_list[] =  $value;
+	}
 }
+$respond['update']=$update_list;
 
 echo json_encode($respond, JSON_UNESCAPED_UNICODE);
 ?>

+ 83 - 2
app/usent/usent_ref.js

@@ -1,4 +1,5 @@
 var _usent_buffer;
+
 class USentResult {
   constructor(filter = {}) {
     this.filter = filter;
@@ -19,9 +20,11 @@ class USentResult {
     }
     this.sentList.push({ book: book, para: para, start: start, end: end });
   }
+
   newSent(sent) {
     this.buffer.push(sent);
   }
+
   queryCallback(data, status) {
     switch (status) {
       case "success":
@@ -34,6 +37,7 @@ class USentResult {
         break;
     }
   }
+
   refresh() {
     $.post(
       "../usent/sent_query.php",
@@ -71,13 +75,90 @@ class USentResult {
           for (const sent of iterator.data) {
             if (sent.channal == channal) {
               return sent;
-            } 
+            }
+          }
+          return false;
+        }
+      }
+    }
+    return false;
+  }
+
+  setSent(objSent) {
+    for (let iterator of _usent_buffer) {
+      if (
+        iterator.info.book == objSent.book &&
+        iterator.info.para == objSent.paragraph &&
+        iterator.info.start == objSent.begin &&
+        iterator.info.end == objSent.end
+      ) {
+        let sendSents = new Array();
+
+        if (objSent.id == "") {
+          //新建
+          objSent.sendId = com_uuid();
+          objSent.try = 1;
+          objSent.saveSuccess = false; //是否保存成功
+          iterator.data.push(objSent);
+          sendSents.push(objSent);
+        } else {
+          for (let sent of iterator.data) {
+            if (sent.id == objSent.id) {
+              sent = objSent;
+              sent.sendId = com_uuid();
+              sent.try = 1;
+              sent.saveSuccess = false; //是否保存成功
+              sendSents.push(sent);
+            }
+          }
+        }
+        if (sendSents.length > 0) {
+          for (const oneSent of sendSents) {
+            $(
+              "#send_" +
+                oneSent.book +
+                "_" +
+                oneSent.paragraph +
+                "_" +
+                oneSent.begin +
+                "_" +
+                oneSent.end +
+                "_" +
+                oneSent.channal
+            ).text("发送中");
           }
+          $.post(
+            "../usent/update.php",
+            {
+              data: JSON.stringify(sendSents),
+            },
+            function (data, status) {
+              if (status == "success") {
+                let result = JSON.parse(data);
+                console.log(result);
+                for (const iterator of result.update) {
+                  $(
+                    "#send_" +
+                      iterator.book +
+                      "_" +
+                      iterator.paragraph +
+                      "_" +
+                      iterator.begin +
+                      "_" +
+                      iterator.end +
+                      "_" +
+                      iterator.channal
+                  ).text("");
+                }
+              }
+            }
+          );
+        } else {
           return false;
         }
       }
     }
-    return null;
+    return false;
   }
 }