1-4 评论案例

1、使用classnames优化类名处理

1-4 评论案例_第1张图片1-4 评论案例_第2张图片

2、评论案例代码

app.js代码:

import { useState } from "react";

import "./App.scss";

import avatar from "./images/bozai.png";

import orderBy from "lodash/orderBy";

/**

 * 评论列表的渲染和操作

 *

 * 1. 根据状态渲染评论列表

 * 2. 删除评论

 * 3. 喜欢和不喜欢

 */

// 评论列表数据

const defaultList = [

  {

    // 评论id

    rpid: 3,

    // 用户信息

    user: {

      uid: "13258165",

      avatar:

        "https://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/reactbase/comment/zhoujielun.jpeg",

      uname: "周杰伦",

    },

    // 评论内容

    content: "哎哟,不错哦",

    // 评论时间

    ctime: "10-18 08:15",

    // 喜欢数量

    like: 98,

    // 0:未表态 1: 喜欢 2: 不喜欢

    action: 0,

  },

  {

    rpid: 2,

    user: {

      uid: "36080105",

      avatar:

        "https://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/reactbase/comment/xusong.jpeg",

      uname: "许嵩",

    },

    content: "我寻你千百度 日出到迟暮",

    ctime: "11-13 11:29",

    like: 88,

    action: 2,

  },

  {

    rpid: 1,

    user: {

      uid: "30009257",

      avatar,

      uname: "前端",

    },

    content: "前端学习",

    ctime: "10-19 09:00",

    like: 66,

    action: 1,

  },

];

// 当前登录用户信息

const user = {

  // 用户id

  uid: "30009257",

  // 用户头像

  avatar,

  // 用户昵称

  uname: "黑马",

};

/**

 * 导航 Tab 的渲染和操作

 *

 * 1. 渲染导航 Tab 和高亮

 * 2. 评论列表排序

 *  最热 => 喜欢数量降序

 *  最新 => 创建时间降序

 */

// 导航 Tab 数组

const tabs = [

  { type: "hot", text: "最热" },

  { type: "time", text: "最新" },

];

const App = () => {

  const [activeTab, setActiveTab] = useState("hot");

  const [list, setList] = useState(defaultList);

  const onDelete = (rpid) => {

    // console.log(rpid);

    // 如果要删除数组中的元素,需要调用filter方法 并且要调用setList

    setList(list.filter((item) => item.rpid !== rpid));

  };

  const onLike = (rpid) => {

    setList(

      list.map((item) => {

        if (item.rpid === rpid) {

          return {

            ...item,

            // 高亮 action

            action: item.action === 1 ? 0 : 1,

            // 喜欢数量 like

            like: item.action === 1 ? item.like - 1 : item.like + 1,

          };

        }

        return item;

      })

    );

  };

  const onDislike = (rpid) => {

    setList(

      list.map((item) => {

        if (item.rpid === rpid) {

          return {

            ...item,

            action: item.action === 2 ? 0 : 2,

            // 如果现在是喜欢,需要让数量 -1 ;如果不喜欢,则数量不变

            like: item.action === 1 ? item.like - 1 : item.like,

          };

        }

        return item;

      })

    );

  };

  const onToggle = (ty) => {

    setActiveTab(ty);

    let newList;

    if (ty === "time") {

      // orderBy(对谁进行排序,按照谁来排,顺序)

      newList = orderBy(list, "ctime", "desc");

    } else {

      newList = orderBy(list, "like", "desc");

    }

    setList(newList);

  };

  return (

   

      {/* 导航 Tab */}

     

       

             

  •             评论

                {/* 评论数量 */}

                {list.length}

             

  •          

  •             {/* 高亮类名: active */}

                {tabs.map((item) => {

                  return (

                   

                      key={item.type}

                      className={

                        item.type === activeTab ? "nav-item active" : "nav-item"

                      }

                      onClick={() => onToggle(item.type)}

                    >

                      {item.text}

                   

              );

            })}

         

       

     

     

        {/* 发表评论 */}

       

          {/* 当前用户头像 */}

         

           

              用户头像

           

         

         

            {/* 评论框 */}

           

              className="reply-box-textarea"

              placeholder="发一条友善的评论"

            />

            {/* 发布按钮 */}

           

             

发布

           

         

       

        {/* 评论列表 */}

       

          {/* 评论项 */}

          {list.map((item) => {

            return (

             

                {/* 头像 */}

               

                 

                   

                      className="bili-avatar-img"

                      src={item.user.avatar}

                      alt=""

                    />

                 

               

               

                  {/* 用户名 */}

                 

                   

{item.user.uname}

                 

                  {/* 评论内容 */}

                 

                    {item.content}

                   

                      {/* 评论时间 */}

                      {item.ctime}

                      {/* 喜欢 */}

                     

                        {/* 选中类名: liked */}

                       

                          className={

                            item.action === 1

                              ? "icon like-icon liked"

                              : "icon like-icon"

                          }

                          onClick={() => onLike(item.rpid)}

                        />

                        {item.like}

                     

                      {/* 不喜欢 */}

                     

                        {/* 选中类名: disliked */}

                       

                          className={

                            item.action === 2

                              ? "icon dislike-icon disliked"

                              : "icon dislike-icon"

                          }

                          onClick={() => onDislike(item.rpid)}

                        />

                     

                      {user.uid === item.user.uid && (

                       

                          className="delete-btn"

                          onClick={() => onDelete(item.rpid)}

                        >

                          删除

                       

                      )}

                   

                 

               

             

            );

          })}

       

        {list.length === 0 &&

暂无评论
}

     

   

  );

};

export default App;

app.scss代码:

.app {

  width: 80%;

  margin: 50px auto;

}

.icon {

  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAPoCAMAAAB6fSTWAAAA51BMVEUAAACYoKhwd3yboqni5emDjJL7+/yZoqoAodbnix8AodYAodaZoqoAodYAodaln5jnix8Aodbnix8AodaZoqoAodbnix8Aodbnix/yXY6ZoqoAodYAodYAodaZoqoAodaZoqryXY7yXY4AodbyXY6ZoqryXY6ZoqoAodaZoqoAodaZoqryXY7nix8AodYAodbnix+ZoqqZoqrnix8AodYAodbnix+Zoqr19vfM0NcAoda/v7/l6e9MyP//u1PlL+z/s3yS0eWV3bL/bAAVFRX/AACEHPnnix+M2fn/1pbyXY4iIiIkv4BgAAAAOHRSTlMA9fUreZKu4eI+EfDtgtwP7AkexYcv2WfIsP3refnX0mcmGUPyxsScjXkXF++zoZpMMyn+Ppl8Q6/LsKoAAA3QSURBVHja7NvdbtowGIfxP7UsaEqbfkGj0bWVpqofiK0f2nZALyD3f0V7E4KsbULCjpRA9fykQDjw4SOb2BEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG2cF4X64vzAeJc+/sDYeGDH3Q0e1MrV1x9q4eW0LNUTP2j4xPEHDS9gp70O50O1MRk9j5Tu13tZhX4+LdS5ejJUlqCfzZloXsMPym99qFfrZ7Telh54vyop1Xk7VNevbqeas+KT5fD2eOR3b+FhR1/L84dJaz42SZNnPR2UnWZadKV7+Mi1rss7P1THXdB7u47iq83DP/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qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqirtwQEJAAAAgKD/r9sRqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8BfEgGFMI1IvvAAAAABJRU5ErkJggg==)

    no-repeat;

  cursor: pointer;

}

.reply-navigation {

  margin-bottom: 22px;

  .nav-bar {

    display: flex;

    align-items: center;

    margin: 0;

    padding: 0;

    list-style: none;

    .nav-title {

      display: flex;

      align-items: center;

      width: 114px;

      font-size: 20px;

      .nav-title-text {

        color: #18191c;

        font-weight: 500;

      }

      .total-reply {

        margin: 0 36px 0 6px;

        color: #9499a0;

        font-weight: normal;

        font-size: 13px;

      }

    }

    .nav-sort {

      display: flex;

      align-items: center;

      color: #9499a0;

      font-size: 13px;

      .nav-item {

        cursor: pointer;

        &:hover {

          color: #00aeec;

        }

        &:last-child::after {

          display: none;

        }

        &::after {

          content: " ";

          display: inline-block;

          height: 10px;

          width: 1px;

          margin: -1px 12px;

          background-color: #9499a0;

        }

      }

      .nav-item.active {

        color: #18191c;

      }

    }

  }

}

.reply-wrap {

  position: relative;

}

.box-normal {

  display: flex;

  transition: 0.2s;

  .reply-box-avatar {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 80px;

    height: 50px;

  }

  .reply-box-wrap {

    display: flex;

    position: relative;

    flex: 1;

    .reply-box-textarea {

      width: 100%;

      height: 50px;

      padding: 5px 10px;

      box-sizing: border-box;

      color: #181931;

      font-family: inherit;

      line-height: 38px;

      background-color: #f1f2f3;

      border: 1px solid #f1f2f3;

      border-radius: 6px;

      outline: none;

      resize: none;

      transition: 0.2s;

      &::placeholder {

        color: #9499a0;

        font-size: 12px;

      }

      &:focus {

        height: 60px;

        background-color: #fff;

        border-color: #c9ccd0;

      }

    }

  }

  .reply-box-send {

    position: relative;

    display: flex;

    flex-basis: 86px;

    align-items: center;

    justify-content: center;

    margin-left: 10px;

    border-radius: 4px;

    cursor: pointer;

    transition: 0.2s;

    & .send-text {

      position: absolute;

      z-index: 1;

      color: #fff;

      font-size: 16px;

    }

    &::after {

      position: absolute;

      width: 100%;

      height: 100%;

      background-color: #00aeec;

      border-radius: 4px;

      opacity: 0.5;

      content: "";

    }

    &:hover::after {

      opacity: 1;

    }

  }

}

.bili-avatar {

  position: relative;

  display: block;

  width: 48px;

  height: 48px;

  margin: 0;

  padding: 0;

  background-image: url(data:image/gif;base64,R0lGODlhtAC0AOYAALzEy+To7rG6wb/Hzd/k6rK7wsPK0bvDybO8w9/j6dDW3NHX3eHl6+Hm7LnByLa+xeDl6+Lm7M/V27vDyt7j6dHX3r/Gzb/HzsLJ0LS9xLW+xbe/xtLY3s/V3OPn7dne5NXb4eDk67jAx7S8w+Dk6rrCybW9xMXM08TL0sLK0Nrf5cXM0tjd48zS2bO7wsrR17W+xLfAx8fO1La/xsbN07K7wbzEytzh573FzNLX3uLn7cDHzsbN1NPZ377Gzb7FzNbc4sjP1dfd49bb4tvg5svR2LfAxsnQ1s7U293h6Nbb4dTa4MrQ19fc4t3i6L7GzMnP1s7U2tXa4M3T2sDIz97i6N7i6dje5MjO1dfc473Ey8HJz9vg57jBx8jP1tPY38PL0cfO1dne5dXa4ePn7sHIz8vS2Nrf5tDW3djd5M3T2cDIztTZ4L3Fy7rCyMTL0czT2bC5wOXp7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4zLWMwMTEgNjYuMTQ1NjYxLCAyMDEyLzAyLzA2LTE0OjU2OjI3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmR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QNL+EHoB+CJrvwReykAC2xaMHX/80Ij5QEmsbIgJ1j0MYJvFweARglLVfyCHk/JCDGuILLKmBXNkyhII+xOiGACRCrFwV8GeIMyKd6EsHsbKS4ACgQNB4D8NzSBEAZEAGqiEHNzBrOREFhrAELJEBFKMu57FMBcgmrpYTNsB0cpCBHQEXmXYeBYBGkNEAbvYcFxcAXsMSDlhd6WFjkNED6eEDGeN0FgFkguD/BO7HEo82GKKTE+o3CPvEEg7gLdKEHt/GFn2mHnpVZiXRgwQwdeehATYVEommHgIAQSNxHksgCKGmHiwEFgGQdOsRXCH4HPAyPfXRBRwYEiBQH9oWBeixAwEwBffBH1Thc+rxArqXIFZAH/bxA/1lDyFgg+mhARuAHgJgLvchAKdGED7xd9FyHxZ4D23gePmBAIIREkQggJioHmrwEl/4ifXBZvcQAMNEilj4iPOQBZ6oiuixfQRxhLBISs4nDx6QiLV4HxxwD1Kwi/gRWPbghMDIStYnD7tTjPcBa/KgBMp4HxPQfe7AY8+IhdIVDw3gWtVYH/TnDlmwjfaxAVWogg60CI7pkQPxQAbZZ47nUWDvcAWvyI7+N4jocIXyqB4FIH7tEADadI/p8WDtsIT+qB7R6A5IMJBltH7lkFUIiR7uqA7f05DqAQDSWA7/IpHpsXPsUI4YyRJhmA4S1JHpgYPo4AS0J5LPIQI3dw5v2BHnFo/+WAOTZg4yhpLnYX6xEAgAOw==);

  background-size: cover;

  border-radius: 50%;

}

.bili-avatar-img {

  position: absolute;

  top: 50%;

  left: 50%;

  display: block;

  width: 48px;

  height: 48px;

  object-fit: cover;

  border: none;

  border-radius: 50%;

  image-rendering: -webkit-optimize-contrast;

  transform: translate(-50%, -50%);

}

// 评论列表

.reply-list {

  margin-top: 14px;

}

.reply-item {

  padding: 22px 0 0 80px;

  .root-reply-avatar {

    position: absolute;

    left: 0;

    display: flex;

    justify-content: center;

    width: 80px;

    cursor: pointer;

  }

  .content-wrap {

    position: relative;

    flex: 1;

    &::after {

      content: " ";

      display: block;

      height: 1px;

      width: 100%;

      margin-top: 14px;

      background-color: #e3e5e7;

    }

    .user-info {

      display: flex;

      align-items: center;

      margin-bottom: 4px;

      .user-name {

        height: 30px;

        margin-right: 5px;

        color: #61666d;

        font-size: 13px;

        line-height: 30px;

        cursor: pointer;

      }

    }

    .root-reply {

      position: relative;

      padding: 2px 0;

      color: #181931;

      font-size: 15px;

      line-height: 24px;

      .reply-info {

        position: relative;

        display: flex;

        align-items: center;

        margin-top: 2px;

        color: #9499a0;

        font-size: 13px;

        .reply-time {

          width: 76px;

          margin-right: 20px;

        }

        .reply-like {

          display: flex;

          align-items: center;

          margin-right: 19px;

          .like-icon {

            width: 14px;

            height: 14px;

            margin-right: 5px;

            color: #9499a0;

            background-position: -153px -25px;

            &:hover {

              background-position: -218px -25px;

            }

          }

          .like-icon.liked {

            background-position: -154px -89px;

          }

        }

        .reply-dislike {

          display: flex;

          align-items: center;

          margin-right: 19px;

          .dislike-icon {

            width: 16px;

            height: 16px;

            background-position: -153px -153px;

            &:hover {

              background-position: -217px -153px;

            }

          }

          .dislike-icon.disliked {

            background-position: -154px -217px;

          }

        }

        .delete-btn {

          cursor: pointer;

          &:hover {

            color: #00aeec;

          }

        }

      }

    }

  }

}

.reply-none {

  height: 64px;

  margin-bottom: 80px;

  color: #99a2aa;

  font-size: 13px;

  line-height: 64px;

  text-align: center;

}

你可能感兴趣的:(react.js基础,react,前端,react.js)