go语言写的人脸本地化程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

401 regels
9.6 KiB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>管理页面</title>
  7. <style>
  8. body{
  9. margin: 0;
  10. }
  11. li {
  12. list-style-type: none;
  13. }
  14. @media screen and (orientation: portrait) {
  15. .approval_page {
  16. width: 100vw;
  17. height: 100vh;
  18. background-image: url("/static/img/registerBgc.jpg");
  19. background-size: 100% 100%;
  20. overflow: auto;
  21. }
  22. .approval_box {
  23. max-width: 100vw;
  24. min-height: 100vh;
  25. background-color:rgba(237,237,237,0.8);
  26. }
  27. .search_people {
  28. width: 80vw;
  29. height: 5vh;
  30. border-radius: 1vw;
  31. margin: 5vh 0 0 10vw;
  32. border: 0 solid #fff;
  33. font-size: 3vw;
  34. text-align: center;
  35. }
  36. .every_info {
  37. height: 7vh;
  38. margin-top: 3vh;
  39. display: flex;
  40. align-items: center;
  41. justify-content: space-around;
  42. font-size: 3vw;
  43. }
  44. #scroll-to-top-btn {
  45. display: none;
  46. position: fixed;
  47. right: 20px;
  48. bottom: 20px;
  49. width: 7vw;
  50. height: 10vh;
  51. color: #fff;
  52. border: none;
  53. border-radius: 5px;
  54. font-size: 3vw;
  55. cursor: pointer;
  56. }
  57. .people_img {
  58. width: 6vh;
  59. height: 6vh;
  60. border-radius: 50%;
  61. }
  62. .pass_nopass {
  63. display: flex;
  64. }
  65. .pass {
  66. background-color: rgb(92, 186, 45);
  67. width: 12vw;
  68. height: 6vw;
  69. border-radius: 1vw;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. color: white;
  74. }
  75. .no_pass, .del_pass {
  76. background-color: rgb(187, 44, 45);
  77. width: 12vw;
  78. height: 6vw;
  79. border-radius: 1vw;
  80. display: flex;
  81. justify-content: center;
  82. align-items: center;
  83. margin-left: 3vw;
  84. color: white;
  85. }
  86. .goTop_img {
  87. width: 6vw;
  88. height: 6vw;
  89. }
  90. .pass_info{
  91. width: 25vw;
  92. }
  93. .no_pass_info{
  94. line-height: 3vh;
  95. }
  96. }
  97. @media screen and (orientation: landscape) {
  98. input:focus {
  99. border: 0.1vw solid #000;
  100. outline: none; /* 可选,用于去除默认的外边框样式 */
  101. }
  102. .approval_page {
  103. width: 100vw;
  104. height: 100vh;
  105. background-image: url("/static/img/registerBgc.jpg");
  106. background-size: 100% 100%;
  107. overflow: auto;
  108. }
  109. .approval_box {
  110. max-width: 100vw;
  111. min-height: 100vh;
  112. background-color:rgba(237,237,237,0.8);
  113. }
  114. .search_people {
  115. width: 60vw;
  116. height: 6vh;
  117. border-radius: 1vh;
  118. margin: 5vh 0 0 20vw;
  119. border: 0 solid #fff;
  120. font-size: 3vh;
  121. text-align: center;
  122. }
  123. .every_info {
  124. height: 7vw;
  125. margin-top: 3vw;
  126. display: flex;
  127. align-items: center;
  128. justify-content: space-around;
  129. font-size: 3vh;
  130. }
  131. #scroll-to-top-btn {
  132. display: none;
  133. position: fixed;
  134. right: 20px;
  135. bottom: 20px;
  136. width: 7vh;
  137. height: 10vw;
  138. color: #fff;
  139. border: none;
  140. border-radius: 5px;
  141. font-size: 3vh;
  142. cursor: pointer;
  143. }
  144. .people_img {
  145. width: 6vw;
  146. height: 6vw;
  147. border-radius: 50%;
  148. }
  149. .pass_nopass {
  150. display: flex;
  151. }
  152. .pass {
  153. background-color: rgb(92, 186, 45);
  154. width: 10vh;
  155. height: 5vh;
  156. border-radius: 1vh;
  157. display: flex;
  158. justify-content: center;
  159. align-items: center;
  160. color: white;
  161. cursor: pointer;
  162. }
  163. .no_pass, .del_pass {
  164. background-color: rgb(187, 44, 45);
  165. width: 10vh;
  166. height: 5vh;
  167. border-radius: 1vh;
  168. display: flex;
  169. justify-content: center;
  170. align-items: center;
  171. margin-left: 2vh;
  172. color: white;
  173. cursor: pointer;
  174. }
  175. .goTop_img {
  176. width: 6vh;
  177. height: 6vh;
  178. }
  179. }
  180. .list_box{
  181. padding-inline-start: 0px;
  182. }
  183. .uploadImg{
  184. width: 48% !important;
  185. transform: translate(0%, 0%) !important;
  186. }
  187. .upload-img-box {
  188. position: relative;
  189. }
  190. .upload-img-box .input-box {
  191. display: inline-block;
  192. width: 144px;
  193. height: 144px;
  194. /*border: solid black 1px;*/
  195. }
  196. .upload-img-box .befor-img {
  197. display: flex;
  198. /*width: 300px;*/
  199. /*height: 90px;*/
  200. /*border: solid black 1px;*/
  201. position: absolute;
  202. top: 0px;
  203. left: 0px;
  204. /*background: #ffffff;*/
  205. z-index: 30;
  206. align-items: center;
  207. justify-content: center;
  208. }
  209. .upload-img-box .befor-img.hasImg {
  210. display: none;
  211. }
  212. .upload-img-box .after-img {
  213. display: inline-block;
  214. width: 144px;
  215. height: 144px;
  216. border: none;
  217. /*position: absolute;*/
  218. top: 0px;
  219. left: 0px;
  220. /*background: #ffffff;*/
  221. z-index: 20;
  222. }
  223. .after-img img, .uploadImg {
  224. /*position: absolute;*/
  225. width: 100%;
  226. height: 100%;
  227. object-fit: cover; /*根据父容器的尺寸裁剪和缩放图片,以填充整个容器,并保持长宽比例不变。*/
  228. object-position: center; /*指定对象的位置,如果不设置,则默认是center*/
  229. background-size: cover; /*背景图片的大小,如果不设置,则默认是auto*/
  230. background-position: center;
  231. top: 50%;
  232. left: 50%;
  233. transform: translate(-50%, 0%);/*将元素移动到中心*/
  234. border-radius: 50%;
  235. }
  236. .pass_info{
  237. color: green;
  238. }
  239. .no_pass_info{
  240. color: red;
  241. }
  242. </style>
  243. </head>
  244. <body>
  245. <!-- 管理员页面 -->
  246. <div class="approval_page" style="display: none;">
  247. <div id="scroll_box" class="approval_box">
  248. <input id="search" class="search_people" value="{{.key}}" type="text" placeholder="🔍 搜索">
  249. <ul class="list_box">
  250. {{ range $i, $v := .users }}
  251. <li class="every_info" itemid="{{$v.ID}}">
  252. <img class="people_img" src="{{$v.Avatar}}" alt="">
  253. <div class="name">{{$v.Name}}</div>
  254. <div class="people_code">{{$v.Phone}}</div>
  255. <div class="pass_nopass">
  256. {{ if eq $v.Status 1 }}
  257. <div class="pass_info">通过</div>
  258. {{ else if eq $v.Status 2 }}
  259. <div class="no_pass_info">不通过</div>
  260. <div class="del_pass">删除X</div>
  261. {{ else }}
  262. <div class="pass">通过</div>
  263. <div class="no_pass">不通过</div>
  264. {{ end }}
  265. </div>
  266. </li>
  267. {{ end }}
  268. </ul>
  269. </div>
  270. <a id="scroll-to-top-btn" href="">
  271. <img class="goTop_img" src="/static/img/goTop.png" alt="">
  272. </a>
  273. </div>
  274. <script src="/static/js/jquery.min.js"></script>
  275. <script src="/static/js/msg-box.js"></script>
  276. <script>
  277. var token= sessionStorage.getItem('token');
  278. console.log(token)
  279. if (!token){
  280. $.MsgBox.AlertWithCallback("提示", "此页面需要先进行登录", function (){
  281. window.location.href = "/?type=mgr";
  282. });
  283. } else {
  284. $(".approval_page").css("display","block");
  285. }
  286. $(function(){
  287. var t=$("#search").val();
  288. $("#search").val("").focus().val(t);
  289. $('.pass').on("click",function(){
  290. var id = $(this).parent().parent().attr('itemid');
  291. $.ajax({
  292. url: "/pass",
  293. type: "post",
  294. data: {
  295. handle: 1,
  296. id: id
  297. },
  298. success: function (data) {
  299. $.MsgBox.AlertWithCallback("提示", data.Message, function (){
  300. location.reload();
  301. });
  302. },
  303. error: function (error) {
  304. console.log(error);
  305. $.MsgBox.Alert("提示", error.responseJSON.Message);
  306. }
  307. })
  308. })
  309. $('.no_pass').on("click",function(){
  310. var id = $(this).parent().parent().attr('itemid');
  311. $.MsgBox.Confirm("提示", "确定要否决这条注册吗?", function () {
  312. $.ajax({
  313. url: "/pass",
  314. type: "post",
  315. data: {
  316. handle: 2,
  317. id: id
  318. },
  319. success: function (data) {
  320. location.reload();
  321. },
  322. error: function (error) {
  323. console.log(error);
  324. $.MsgBox.Alert("提示", error.responseJSON.Message);
  325. }
  326. })
  327. })
  328. })
  329. $('.del_pass').on("click",function(){
  330. var id = $(this).parent().parent().attr('itemid');
  331. $.MsgBox.Confirm("提示", "确定要删除这条注册吗?", function (){
  332. $.ajax({
  333. url: "/pass",
  334. type: "post",
  335. data: {
  336. handle: 4,
  337. id: id
  338. },
  339. success: function (data) {
  340. location.reload();
  341. },
  342. error: function (error) {
  343. console.log(error);
  344. $.MsgBox.Alert("提示", error.responseJSON.Message);
  345. }
  346. })
  347. })
  348. })
  349. $("#search").on('change',function(e){
  350. window.location.href = "/mgr?key="+$(this).val()
  351. });
  352. })
  353. // 点击回到顶部
  354. var element = document.getElementById('search');
  355. var observer = new IntersectionObserver(function(entries) {
  356. entries.forEach(function(entry) {
  357. var scrollToTopBtn = document.getElementById('scroll-to-top-btn');
  358. if (entry.isIntersecting) {
  359. // 元素进入视口,执行代码
  360. scrollToTopBtn.style.display = 'none';
  361. } else {
  362. scrollToTopBtn.style.display = 'block';
  363. }
  364. });
  365. });
  366. observer.observe(element);
  367. document.getElementById('scroll-to-top-btn').addEventListener('click', function() {
  368. document.getElementById("scroll_box").scrollTop = 0
  369. });
  370. </script>
  371. </body>
  372. </html>