发表于: 2020-02-14 22:56:55

2 1241


一、今天完成的事

完成表设计

Category分类表存放分类信息,如女装,平板电视,沙发等
Property属性表存放属性信息,如颜色,重量,品牌,厂商,型号等
Product产品表存放产品信息,如LED40EC平板电视机,海尔EC6005热水器
PropertyValue属性值表存放属性值信息,如重量是900g,颜色是粉红色
ProductImage产品图片表存放产品图片信息,如产品页显示的5个图片
Review评论表存放评论信息,如买回来的蜡烛很好用,么么哒
User用户表存放用户信息,如斩手狗,千手小粉红
Order订单表存放订单信息,包括邮寄地址,电话号码等信息
OrderItem订单项表存放订单项信息,包括购买产品种类,数量等

user:

CREATE TABLE user (
 id int(11) NOT NULL AUTO_INCREMENT,
 name varchar(255) DEFAULT NULL,
 password varchar(255) DEFAULT NULL,
 salt varchar(255) DEFAULT NULL,
 PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

category:

CREATE TABLE category (
 id int(11) NOT NULL AUTO_INCREMENT,
 name varchar(255) DEFAULT NULL,
 PRIMARY KEY (id)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

property:

CREATE TABLE property (
 id int(11) NOT NULL AUTO_INCREMENT,
 cid int(11) DEFAULT NULL,
 name varchar(255) DEFAULT NULL,
 PRIMARY KEY (id),
 CONSTRAINT fk_property_category FOREIGN KEY (cid) REFERENCES category (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

product:

CREATE TABLE product (
 id int(11) NOT NULL AUTO_INCREMENT,
 name varchar(255) DEFAULT NULL,
 subTitle varchar(255) DEFAULT NULL,
 originalPrice float DEFAULT NULL,
 promotePrice float DEFAULT NULL,
 stock int(11) DEFAULT NULL,
 cid int(11) DEFAULT NULL,
 createDate datetime DEFAULT NULL,
 PRIMARY KEY (id),
 CONSTRAINT fk_product_category FOREIGN KEY (cid) REFERENCES category (id)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

propertyvalue:

CREATE TABLE propertyvalue (
 id int(11) NOT NULL AUTO_INCREMENT,
 pid int(11) DEFAULT NULL,
 ptid int(11) DEFAULT NULL,
 value varchar(255) DEFAULT NULL,
 PRIMARY KEY (id),
 CONSTRAINT fk_propertyvalue_property FOREIGN KEY (ptid) REFERENCES property (id),
 CONSTRAINT fk_propertyvalue_product FOREIGN KEY (pid) REFERENCES product (id)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

productimage:

CREATE TABLE propertyvalue (
 id int(11) NOT NULL AUTO_INCREMENT,
 pid int(11) DEFAULT NULL,
 ptid int(11) DEFAULT NULL,
 value varchar(255) DEFAULT NULL,
 PRIMARY KEY (id),
 CONSTRAINT fk_propertyvalue_property FOREIGN KEY (ptid) REFERENCES property (id),
 CONSTRAINT fk_propertyvalue_product FOREIGN KEY (pid) REFERENCES product (id)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

review:

CREATE TABLE review (
 id int(11) NOT NULL AUTO_INCREMENT,
 content varchar(4000) DEFAULT NULL,
 uid int(11) DEFAULT NULL,
 pid int(11) DEFAULT NULL,
 createDate datetime DEFAULT NULL,
 PRIMARY KEY (id),
 CONSTRAINT fk_review_product FOREIGN KEY (pid) REFERENCES product (id),
   CONSTRAINT fk_review_user FOREIGN KEY (uid) REFERENCES user (id)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

2.学习css,写出九宫格代码

<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="utf-8">
        <title>task1</title>
        <link rel="stylesheet" type="text/css" href="css/style.css">
    </head>
  
    <body>
        <div class="box-wrep">
            <div class="box">1</div>
            <div class="box">2</div>
            <div class="box">3</div>
            <div class="box">4</div>
            <div class="box">5</div>
            <div class="box">6</div>
            <div class="box">7</div>
            <div class="box">8</div>
            <div class="box">9</div>
    </body>
</html>



.box-wrep{
    text-align:center;
    background-color#d4d4f5;
    overflowhidden;
}
.box-wrep>div{
    width31%;
    padding-bottom31%;
    margin:1%;
    border-radius:10%;
    float:left;
    background-colororange;
}


效果

二、遇到的问题

css标签好多。。。

三、收获

css选择器

类选择器和id选择器

类选择器就是

.box-wrep{
    text-align:center;
    background-color#d4d4f5;
    overflowhidden;
}


id选择器就是

#box1 {
    text-align:center;
    colorred;
}


还有标签选择器如

p{
    text-aligncenter;
    background-colorred;
}

指定p标签下所有样式

还有伪类选择器用于文档以外的其他条件来应用元素的样式,以及其他各种选择器,意思都差不多


css的样式表

1.外部样式表

<head lang="en">
        <link rel="stylesheet" type="text/css" href="css/style.css">
 </head>

用link标签链接外部css文件

2.内部样式表

   <head>
        <style>
            .box-wrep{
                max-resolution: left 20px;
                background-colorred;
            }
        </style>
    </head>

在html文件内部使用<style>标签展示样式

3.内联样式

<p style="color:sienna;margin-left:20px">这是一个段落。</p>

在body内修改样式,不推荐使用


css背景background

  • background-color 背景颜色
  • background-image 背景图片
  • background-repeat 背景图像水平或垂直平铺 水平平铺background-repeat:repeat-x,可以设置不平铺 background-repeat:no-repeat;
  • background-attachment  背景图像是否固定或者随着页面的其余部分滚动。
  • background-position 设置图像定位

css文本样式

使用

body {

color:red;

}

h1 {

color:#00ff00;

}

h2 {

color:rgb(255,0,0);

}

可以设置文本颜色


文本对齐方式有

h1 {

text-align:center;

}

p.date {

text-align:right;

}

p.main {

text-align:justify;

}

justify为每一行被展开为宽度相等,左右外边距是对齐的


text-decoration主要用于删除链接的下划线:

<style>

a {

text-decoration:none;

}

</style>

没有样式:

执行之后

还有

h1 {text-decoration:overline;}

h2 {text-decoration:line-through;}

h3 {text-decoration:underline;}

执行之后效果

text-transform是用于转换所有文本字母大小写常用值为uppercase全大写,lowercase全小写

text-indent用于指定文本的第一行缩进

四、明天的计划

白天学习css,晚上开始天猫整站项目后端代码,先把首页写了



返回列表 返回列表
评论

    分享到