Blogger Information
Blog 12
fans 0
comment 0
visits 7900
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
2019-12-26 二手商品列表与评论与回复开发思路及实现-PHP培训十期
ys899
Original
580 people have browsed it

1、二手商品列表 组件

首先设计dom结构,分上下结构;
接着写css样式,设计页面元素排版
使用flex排版 按row默认排版,两边对齐
```html code
<!DOCTYPE html>

<html lang="en">

<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="public_second_hand.css">
<title>公共二手交易区组件</title>
</head>

<body>
<!--引入大标题组件-->

<div class="public-headline">
<span>二手交易</span>
</div>

<!--二手交易专区-->

<div class="publi-second-hand">
<!--标题1-->
<div class="title1">
<a href="">抢好货</a>
<span>0低价, 便捷,安全,快速</span>
</div>
<!--标题2-->
<div class="title2">
<span>热门分类</span>
<a href="">美女写真</a>
<a href="">日本美女</a>
<a href="">美国美女</a>
<a href="">国内美女</a>
<a href="">AV美女</a>
</div>

  1. <!--商品展示区-->
  2. <div class="goods">
  3. <!--1.左边商品列表-->
  4. <div class="goods-list">
  5. <!--商品简介-->
  6. <div class="intro">
  7. <a href=""><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  8. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  9. <div>
  10. <span>&yen; 333</span>
  11. <span>美女</span>
  12. </div>
  13. </div>
  14. <div class="intro">
  15. <a href=""><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  16. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  17. <div>
  18. <span>&yen; 333</span>
  19. <span>美女</span>
  20. </div>
  21. </div>
  22. <div class="intro">
  23. <a href=""><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  24. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  25. <div>
  26. <span>&yen; 333</span>
  27. <span>美女</span>
  28. </div>
  29. </div>
  30. <div class="intro">
  31. <a href=""><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  32. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  33. <div>
  34. <span>&yen; 333</span>
  35. <span>美女</span>
  36. </div>
  37. </div>
  38. <div class="intro">
  39. <a href=""><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  40. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  41. <div>
  42. <span>&yen; 333</span>
  43. <span>美女</span>
  44. </div>
  45. </div>
  46. <div class="intro">
  47. <a href=""><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  48. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  49. <div>
  50. <span>&yen; 333</span>
  51. <span>美女</span>
  52. </div>
  53. </div>
  54. <div class="intro">
  55. <a href=""><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  56. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  57. <div>
  58. <span>&yen; 333</span>
  59. <span>美女</span>
  60. </div>
  61. </div>
  62. <div class="intro">
  63. <a href=""><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  64. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  65. <div>
  66. <span>&yen; 333</span>
  67. <span>美女</span>
  68. </div>
  69. </div>
  70. </div>
  71. <!--2. 右侧的功能快速入口-->
  72. <div class="quick-entry">
  73. <a href=""><img src="../../../static/images/ad/1.png" alt=""></a>
  74. <a href=""><img src="../../../static/images/ad/2.png" alt=""></a>
  75. <a href=""><img src="../../../static/images/ad/3.png" alt=""></a>
  76. <a href=""><img src="../../../static/images/ad/4.png" alt=""></a>
  77. <div>
  78. <a href=""><img src="../../../static/images/ad/image.png" alt=""></a>
  79. <a href=""><img src="../../../static/images/ad/ad2.jpg" alt=""></a>
  80. </div>
  81. </div>
  82. </div>

</div>
</body>
</html>

  1. ```CSS code
  2. /*样式重置*/
  3. @import "../public_reset.css";
  4. /*大标题组件*/
  5. @import "../public_headline/public-headline.css";
  6. /*二手交易专区的样式表*/
  7. .publi-second-hand {
  8. width: 1200px;
  9. padding: 10px;
  10. box-sizing: border-box;
  11. margin: auto;
  12. border-radius: 5px;
  13. background-color: #fff;
  14. }
  15. .publi-second-hand:hover {
  16. box-shadow: 0 0 8px #888;
  17. }
  18. /*标题1*/
  19. .publi-second-hand > .title1 {
  20. height: 50px;
  21. border-bottom: 1px solid #cccccc;
  22. box-sizing: border-box;
  23. }
  24. .publi-second-hand > .title1 > a {
  25. font-size: 23px;
  26. margin-right: 20px;
  27. }
  28. .publi-second-hand > .title1 > span {
  29. color: red;
  30. }
  31. /*标题2*/
  32. .publi-second-hand > .title2 {
  33. height: 55px;
  34. }
  35. .publi-second-hand > .title2 > span {
  36. color: red;
  37. font-size: 23px;
  38. }
  39. .publi-second-hand > .title2 > span ~ a {
  40. padding-left: 20px;
  41. }
  42. .publi-second-hand > .title2 > span ~ a:hover {
  43. color: lightcoral;
  44. }
  45. /*商品展示区*/
  46. .publi-second-hand > .goods {
  47. height: 440px;
  48. /*转为flex*/
  49. display: flex;
  50. /*flex-flow: row nowrap;*/
  51. }
  52. .publi-second-hand > .goods > .goods-list {
  53. padding: 10px;
  54. flex-basis: 800px;
  55. display: flex;
  56. flex-flow: row wrap;
  57. justify-content: space-between;
  58. }
  59. .publi-second-hand > .goods > .goods-list > .intro{
  60. width: 178px;
  61. height: 200px;
  62. display: flex;
  63. flex-flow: column nowrap;
  64. justify-content: space-between;
  65. }
  66. .publi-second-hand > .goods > .goods-list > .intro img {
  67. border: 1px solid #cccccc;
  68. border-radius: 5px;
  69. }
  70. .publi-second-hand > .goods > .goods-list > .intro span:first-of-type {
  71. color: red;
  72. }
  73. .publi-second-hand > .goods > .goods-list > .intro > div {
  74. display: flex;
  75. }
  76. .publi-second-hand > .goods > .goods-list > .intro span:last-of-type {
  77. color: white;
  78. background-color: #55ce9f;
  79. padding: 0 5px;
  80. margin-left: auto;
  81. }
  82. /*功能快速入口区*/
  83. .publi-second-hand > .goods > .quick-entry {
  84. flex-basis: 400px;
  85. padding: 10px;
  86. display: flex;
  87. flex-flow: row wrap;
  88. justify-content: space-between;
  89. }
  90. .publi-second-hand > .goods > .quick-entry img {
  91. width: 190px;
  92. height: 130px;
  93. }
  94. .publi-second-hand > .goods > .quick-entry > div {
  95. width: 400px;
  96. display: flex;
  97. flex-direction: column;
  98. }
  99. .publi-second-hand > .goods > .quick-entry > div img {
  100. width: 393px;
  101. height: 60px;
  102. }

效果图

2、评论与回复 组件

首先设计dom结构,分上下结构;
接着写css样式,设计页面元素排版
使用flex排版 按column排版
```html code
<!DOCTYPE html>

<html lang="en">

<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../static/font/iconfont.css">
<link rel="stylesheet" href="public_comment_reply.css">
<title>评论与回复组件</title>
</head>

<body>

<div class="public-comment-reply">
<!--评论区-->
<div class="comment">
<h3>我要评论</h3>
<div>
<label for="commment">
<img src="../../../static/images/user.png" alt="">
</label>
<textarea name="" id="commment"></textarea>
</div>
<button>发表评论</button>
</div>

  1. <!--回复区-->
  2. <div class="reply">
  3. <h3>最新回复</h3>
  4. <div>
  5. <img src="../../../static/images/user.png" alt="">
  6. <div class="detail">
  7. <span>用户昵称</span>
  8. <span>留言内容: php中文网,是一个有温度,有思想的学习平台</span>
  9. <div>
  10. <span>2019-12-12 15:34:23发表</span>
  11. <span><i class="iconfont icon-dianzan"></i>回复</span>
  12. </div>
  13. </div>
  14. </div>
  15. <div>
  16. <img src="../../../static/images/user.png" alt="">
  17. <div class="detail">
  18. <span>用户昵称</span>
  19. <span>留言内容: php中文网,是一个有温度,有思想的学习平台</span>
  20. <div>
  21. <span>2019-12-12 15:34:23发表</span>
  22. <span><i class="iconfont icon-dianzan"></i>回复</span>
  23. </div>
  24. </div>
  25. </div>
  26. <div>
  27. <img src="../../../static/images/user.png" alt="">
  28. <div class="detail">
  29. <span>用户昵称</span>
  30. <span>留言内容: php中文网,是一个有温度,有思想的学习平台</span>
  31. <div>
  32. <span>2019-12-12 15:34:23发表</span>
  33. <span><i class="iconfont icon-dianzan"></i>回复</span>
  34. </div>
  35. </div>
  36. </div>
  37. <div>
  38. <img src="../../../static/images/user.png" alt="">
  39. <div class="detail">
  40. <span>用户昵称</span>
  41. <span>留言内容: php中文网,是一个有温度,有思想的学习平台</span>
  42. <div>
  43. <span>2019-12-12 15:34:23发表</span>
  44. <span><i class="iconfont icon-dianzan"></i>回复</span>
  45. </div>
  46. </div>
  47. </div>
  48. </div>

</div>
</body>
</html>

  1. ```CSS Code
  2. @import url(../public_reset.css);
  3. .public-comment-reply {
  4. padding: 15px;
  5. box-sizing: border-box;
  6. background-color: #fff;
  7. display: flex;
  8. flex-direction: column;
  9. }
  10. .public-comment-reply img {
  11. width: 60px;
  12. height: 60px;
  13. border-radius: 5px;
  14. box-shadow: 1px 1px 3px #cccccc;
  15. }
  16. .public-comment-reply > .comment {
  17. display: flex;
  18. flex-direction: column;
  19. }
  20. .public-comment-reply > .comment h3 {
  21. padding: 20px 0;
  22. border-top: 1px solid #cccccc;
  23. }
  24. .public-comment-reply > .comment > div {
  25. padding: 15px;
  26. height: 200px;
  27. display: flex;
  28. flex-flow: row nowrap;
  29. }
  30. .public-comment-reply > .comment > div img {
  31. align-self: flex-start;
  32. }
  33. .public-comment-reply > .comment > div textarea {
  34. height: 200px;
  35. margin-left: 20px;
  36. resize: none;
  37. flex: auto;
  38. }
  39. .public-comment-reply > .comment > div textarea:hover {
  40. box-shadow: 0 0 8px #888888;
  41. }
  42. .public-comment-reply > .comment > button {
  43. font-size: 14px;
  44. background-color: #f64c59;
  45. border: none;
  46. color: white;
  47. width: 150px;
  48. height: 40px;
  49. align-self: end;
  50. }
  51. .public-comment-reply > .comment > button:hover {
  52. background-color: #178cee;
  53. box-shadow: 0 0 8px #888888;
  54. cursor: pointer;
  55. }
  56. /*回复区*/
  57. .public-comment-reply > .reply {
  58. display: flex;
  59. flex-direction: column;
  60. padding: 15px 0;
  61. }
  62. .public-comment-reply > .reply > h3 {
  63. padding: 20px 0;
  64. }
  65. .public-comment-reply > .reply > div {
  66. display: flex;
  67. margin-top: 30px;
  68. }
  69. .public-comment-reply > .reply > div > img {
  70. align-self: center;
  71. }
  72. .public-comment-reply > .reply > div > .detail {
  73. flex: auto;
  74. display: flex;
  75. flex-direction: column;
  76. margin-left: 20px;
  77. height: 90px;
  78. justify-content: space-between;
  79. }
  80. .public-comment-reply > .reply > div > .detail > div {
  81. display: flex;
  82. justify-content: space-between;
  83. }
  84. .public-comment-reply > .reply > div > .detail > div i {
  85. color: red;
  86. font-size: 1.2rem;
  87. margin-right: 5px;
  88. }

效果图

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:写了这么代码, 不想谈点感受吗? 是不是感觉前端也很有意思呢?
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post