diff --git a/package.json b/package.json index 639b210645a54f1bbcafa5be614933d75e115c91..15a9b78ac0b79bb4b15734270bf24d947c6c8491 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "element-ui": "^2.4.7", "font-awesome": "^4.7.0", "vue": "^2.5.2", + "vue-lazyload": "^1.2.6", "vue-router": "^3.0.1" }, "devDependencies": { diff --git a/src/assets/css/common.scss b/src/assets/css/common.scss index 1094f00b91f959d2ae035c3ef9f9e3219cdb7d88..e50c436fe4e025fcdb3e2a553e2a446dbb7dc530 100644 --- a/src/assets/css/common.scss +++ b/src/assets/css/common.scss @@ -44,6 +44,45 @@ a { .theme-color:hover { color: #38f; } +//页面固定的宽度 +.w{ + width: 1120px; + margin: 0 auto; + position: relative; + overflow: hidden; +} +//错误提示 +.err-tips{ + color: #c62003; + margin: 50px; + font-size: 20px; +} +.btn{ + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: 400; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + font-family: inherit; + color: #fff; + background-color: #409EFF; +} +.btn:hover{ + opacity: 0.8; +} #app { font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", diff --git a/src/assets/js/login/login.js b/src/assets/js/login/login.js index 6b8a3599c1754458a5894538418089232fe20dce..7a1b84e95e9e244f8685e26a39f72ec379e84fcf 100644 --- a/src/assets/js/login/login.js +++ b/src/assets/js/login/login.js @@ -103,12 +103,7 @@ export default { } _user.login2(userInfo).then( res => { - this.$notify({ - //请求成功的回调 - title: '警告', - message: '这是一条警告的提示消息', - type: 'warning' - }) + vue.$router.push({path: '/home'}) }, err => { _tips.notifyTips(vue, err.msg) diff --git a/src/components/Breadcrumb.vue b/src/components/Breadcrumb.vue index 0d1d7a09d7c89361fbbc3c4a253e0cc49c1c081a..bd68df6f09047527df134c96626239081e866ec0 100644 --- a/src/components/Breadcrumb.vue +++ b/src/components/Breadcrumb.vue @@ -2,12 +2,12 @@ * @Author: mikey.zhaopeng * @Date: 2018-10-06 17:26:41 * @Last Modified by: mikey.zhaopeng - * @Last Modified time: 2018-10-06 17:40:19 + * @Last Modified time: 2018-10-13 17:25:17 */ - 首页 | + 首页 | diff --git a/src/components/Header.vue b/src/components/Header.vue index 4a4ace1d250cca6627a5012b2603bd3da3b15324..b7a25e1a9a60734bde779976babdcc6571f1a3e1 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -4,50 +4,23 @@ - login - logout + Login + Logout - - - 学习 - 选项1 - 选项2 - 选项3 - - 选项4 - 选项1 - 选项2 - 选项3 - - - - 我的工作台 - 选项1 - 选项2 - 选项3 - - 选项4 - 选项1 - 选项2 - 选项3 - - - 消息中心 - - 订单管理 - - - 订单管理 - - + + + CampusO2O + + + 个人中心 - 我的账号 + 我的账号 购物车 我的订单 身份 @@ -94,13 +67,25 @@ export default { padding-left: 10px; font-size: 15px; } - .header-main ul { - display: inline-block !important; - overflow: auto !important; - padding: 0; - li { - display: inline !important; - } + .header-main { + text-align: left; + ul{ + li{ + display: inline-block; + height: 66px; + line-height: 66px; + padding-left: 10px; + } + .logo{ + margin-left:30px; + font-size: 20px; + color: #409EFF; + font-weight: 700; + text-decoration: none; + + } + } + } .header-about-us { float: right; diff --git a/src/config/CartURLConfig.js b/src/config/CartURLConfig.js new file mode 100644 index 0000000000000000000000000000000000000000..d5d39693d70ba077c684c3d883877ca49ceccf88 --- /dev/null +++ b/src/config/CartURLConfig.js @@ -0,0 +1,15 @@ +/* + * @Author: Kingsley + * @Date: 2018-10-13 22:25:57 + * @Last Modified by: mikey.zhaopeng + * @Last Modified time: 2018-10-13 23:01:57 + * 商品种类模块的URL配置 + */ +const server = '/api' +export const addPro2Cart = '/cart/add_list.do' //获取商品种类 //快速注册 + + +export default { + addPro2Cart, + server +} diff --git a/src/config/CategoryURLConfig.js b/src/config/CategoryURLConfig.js new file mode 100644 index 0000000000000000000000000000000000000000..3d48f6b40d13eb545ba82d6089c287c87ac23f9b --- /dev/null +++ b/src/config/CategoryURLConfig.js @@ -0,0 +1,15 @@ +/* + * @Author: Kingsley + * @Date: 2018-10-13 22:25:57 + * @Last Modified by: mikey.zhaopeng + * @Last Modified time: 2018-10-13 22:26:22 + * 商品种类模块的URL配置 + */ +const server = '/api' +export const getCategoryByParentId = '/category/get_category.do' //获取商品种类 //快速注册 + + +export default { + getCategoryByParentId, + server +} diff --git a/src/config/ProductURLConfig.js b/src/config/ProductURLConfig.js new file mode 100644 index 0000000000000000000000000000000000000000..6de54b1a6fcd8d9a25c84c2c2f78978e863e1c8a --- /dev/null +++ b/src/config/ProductURLConfig.js @@ -0,0 +1,15 @@ +/* + * @Author: Mark + * @Date: 2018-10-08 10:01:35 + * @LastEditors: Mark + * @LastEditTime: 2018-10-08 10:04:37 + * @Description: 商品的URL的配置 + */ +const server = '/api' +export const getProducts = '/product/product_list.do' //获取商品列表信息 +export const product_detail = '/product/product_detail.do' //获取商品详情 +export default { + getProducts, + product_detail, + server +} diff --git a/src/config/UserURLConfig.js b/src/config/UserURLConfig.js index 3b7f7bbb027c86ff337d681c95fc96f3c9cb64f1..4f8d0f3d863a126744d495a962f628cbf52573f3 100644 --- a/src/config/UserURLConfig.js +++ b/src/config/UserURLConfig.js @@ -2,38 +2,37 @@ * @Author: mikey.zhaopeng * @Date: 2018-10-06 09:31:25 * @Last Modified by: mikey.zhaopeng - * @Last Modified time: 2018-10-06 13:38:46 + * @Last Modified time: 2018-10-13 22:29:45 */ -const server = '/api' -export const registerQuick = '/user/register_quick.do' //快速注册 -export const login = '/user/login.do' //登录 -export const register = '/user/register.do' //注册 -export const getQuestion = '/user/forget_get_question.do' //忘记密码时 step1 根据用户名查找问题 -export const checkAnswer = '/user/forget_check_answer.do' //忘记密码时 step2 根据提交回调问题的答案 -export const forgetResetPassword = '/user/forget_reset_password.do' //忘记密码时 step3 重置密码 -export const getInfromation = '/user/get_information.do' -export const updateInfromation = '/user/update_information.do' -export const checkValid = '/user/check_valid.do' -export const resetpwd = '/user/reset_password.do' -export const uploadImage = '/image/upload' -export const getImages = '/user/get_images.do' -export const updateImage = '/user/update_image.do' - +const server = "/api"; +export const registerQuick = "/user/register_quick.do"; //快速注册 +export const login = "/user/login.do"; //登录 +export const register = "/user/register.do"; //注册 +export const getQuestion = "/user/forget_get_question.do"; //忘记密码时 step1 根据用户名查找问题 +export const checkAnswer = "/user/forget_check_answer.do"; //忘记密码时 step2 根据提交回调问题的答案 +export const forgetResetPassword = "/user/forget_reset_password.do"; //忘记密码时 step3 重置密码 +export const getInfromation = "/user/get_information.do";//获取用户信息 +export const updateInfromation = "/user/update_information.do";//更新用户信息 +export const checkValid = "/user/check_valid.do";//检验字段 +export const resetpwd = "/user/reset_password.do";//重置用户密码 +export const uploadImage = "/image/upload";//用户头像更新 +export const getImages = "/user/get_images.do";//获取用户头像 +export const updateImage = "/user/update_image.do";//更新用户头像 export default { - registerQuick, - login, - register, - getQuestion, - checkAnswer, - forgetResetPassword, - getInfromation, - updateInfromation, - checkValid, - resetpwd, - uploadImage, - getImages, - updateImage, - server -} + registerQuick, + login, + register, + getQuestion, + checkAnswer, + forgetResetPassword, + getInfromation, + updateInfromation, + checkValid, + resetpwd, + uploadImage, + getImages, + updateImage, + server +}; diff --git a/src/main.js b/src/main.js index 686d438f4d53d61156b4f281ce64961a7c3401f0..06833177ee39c41f9204282ef0ae8381d6cf5b8c 100644 --- a/src/main.js +++ b/src/main.js @@ -40,7 +40,11 @@ router.beforeEach((to,from,next)=>{ */ Vue.use(ElementUI) Vue.use(Echarts) -Vue.use(VueLazyload) +Vue.use(VueLazyload,{ + preLoad : 1.3, + loading: '../static/images/loading.gif', + attempt: 1 +}) Vue.config.productionTip = false Vue.prototype.$uriConf = uriConf Vue.prototype.$resUtil = resUtil diff --git a/src/modules/cart/Cart.vue b/src/modules/cart/Cart.vue new file mode 100644 index 0000000000000000000000000000000000000000..7efcf7b96691161cb7b51c25992806efb1a5633e --- /dev/null +++ b/src/modules/cart/Cart.vue @@ -0,0 +1,193 @@ + + + + + + + + + + + + 全选 + + + + 商品信息 + 单价 + 数量 + 合计 + 操作 + + + + + + + + + + + + + + + + + + + 短袖 + + 50 + + + + 总计100 + + + 删除 + + + + + + + + + + + + + + + + diff --git a/src/modules/home/Home.vue b/src/modules/home/Home.vue new file mode 100644 index 0000000000000000000000000000000000000000..998539dcac640adb781a2511e63d1fad687a48d8 --- /dev/null +++ b/src/modules/home/Home.vue @@ -0,0 +1,43 @@ + + + + + + + + + + + + diff --git a/src/modules/home/HomeBanner.vue b/src/modules/home/HomeBanner.vue index db26b75bd67d4e026c7ce573284d8f099d1c161e..e4bbe117d6320a4778c5154e824ca56ab17293a1 100644 --- a/src/modules/home/HomeBanner.vue +++ b/src/modules/home/HomeBanner.vue @@ -6,21 +6,16 @@ * @Description: 首页banner */ - + - + {{ item }} - - Web服务器 - - - - + 444 @@ -28,12 +23,12 @@ diff --git a/src/modules/product/ProductDetail.vue b/src/modules/product/ProductDetail.vue new file mode 100644 index 0000000000000000000000000000000000000000..be6c0d571e7f6cc6c42601343462d9725b536e13 --- /dev/null +++ b/src/modules/product/ProductDetail.vue @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + {{data.product.productName}} + {{data.product.productSubtitle}} + + + 原价: + ¥{{data.product.promotionPrice}} + + + 售价: + ¥{{data.product.normalPrice}} + + + 库存: + {{data.product.productStock}}(件) + + + 发布: + {{data.product.createTime}} + + + 数量: + + + + + + 加入购物车 + + + + + + + + + + 店家 + + + + + {{data.product.ownerName}} + + + + + + + + + + + + + 商品评论 + 店家商品推荐 + todo + + + + + + + + + + 继续购物 + 查看购物车 + + + + + + + + + \ No newline at end of file diff --git a/src/modules/product/ProductList.vue b/src/modules/product/ProductList.vue new file mode 100644 index 0000000000000000000000000000000000000000..9847ea2bd936a6e45f22e93f12cc683a5c01476b --- /dev/null +++ b/src/modules/product/ProductList.vue @@ -0,0 +1,462 @@ + + + + + + + + + + + + + + + + + + + + + + + + + {{category.productCategoryName}} + + + + + + + + + + + {{breadcrumbMsg}} + + + + + + + + + + {{secondCategory.productCategoryName}} + + {{secondCategory.createTime}} + 瞧-瞧 + + + + + + + + + + + + {{breadcrumbMsg}} | {{breadcrumbCateMsg}} + + + + + + + + + + + + + + + + + + {{product.productName}} + + + + + ¥ {{product.promotionPrice}} + + + + + + ¥ {{product.normalPrice}} + + + {{product.createTime}} + + + + + + {{product.ownerName}} + + + + + + + + + 商品空空如也! + + + + + + + + + + + + + + + diff --git a/src/modules/user/UserCenter.vue b/src/modules/user/UserCenter.vue index 059a501c58be1fb292ab71cb9c7a33bf432bf6ab..8210b462c0b6444539edec1ab221ba86494fa8c2 100644 --- a/src/modules/user/UserCenter.vue +++ b/src/modules/user/UserCenter.vue @@ -2,7 +2,7 @@ * @Author: Sa * @Date: 2018-10-06 22:32:02 * @Last Modified by: mikey.zhaopeng - * @Last Modified time: 2018-10-06 23:57:40 + * @Last Modified time: 2018-10-07 20:28:03 * @Description: 用户个人中心页面 */ @@ -11,12 +11,12 @@ - + 个人中心 - + @@ -117,7 +117,7 @@ - + @@ -604,12 +604,12 @@ export default {
商品空空如也!