From 2ff61eac1a4cb904c299b503a0b796240d6aad28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B1=86=E6=B5=86=E6=B2=B9=E6=9D=A1?= <1685368363@qq.com> Date: Sun, 14 Oct 2018 23:03:53 +0800 Subject: [PATCH] =?UTF-8?q?!2=20=E5=95=86=E5=93=81=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E5=90=88=E5=B9=B6=20Merge=20pull=20request=20!2=20from=20?= =?UTF-8?q?=E8=B1=86=E6=B5=86=E6=B2=B9=E6=9D=A1/dev1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/assets/css/common.scss | 39 +++ src/assets/js/login/login.js | 7 +- src/components/Breadcrumb.vue | 4 +- src/components/Header.vue | 71 ++-- src/config/CartURLConfig.js | 15 + src/config/CategoryURLConfig.js | 15 + src/config/ProductURLConfig.js | 15 + src/config/UserURLConfig.js | 61 ++-- src/main.js | 6 +- src/modules/cart/Cart.vue | 193 +++++++++++ src/modules/home/Home.vue | 43 +++ src/modules/home/HomeBanner.vue | 21 +- src/modules/product/ProductDetail.vue | 229 +++++++++++++ src/modules/product/ProductList.vue | 462 ++++++++++++++++++++++++++ src/modules/user/UserCenter.vue | 12 +- src/router/index.js | 35 +- src/service/cart-service.js | 15 + src/service/category-service.js | 24 ++ src/service/product-service.js | 36 ++ src/utils/requestUtil.js | 2 +- static/images/loading-cat.gif | Bin 0 -> 198217 bytes static/images/loading.gif | Bin 0 -> 22356 bytes 23 files changed, 1199 insertions(+), 107 deletions(-) create mode 100644 src/config/CartURLConfig.js create mode 100644 src/config/CategoryURLConfig.js create mode 100644 src/config/ProductURLConfig.js create mode 100644 src/modules/cart/Cart.vue create mode 100644 src/modules/home/Home.vue create mode 100644 src/modules/product/ProductDetail.vue create mode 100644 src/modules/product/ProductList.vue create mode 100644 src/service/cart-service.js create mode 100644 src/service/category-service.js create mode 100644 src/service/product-service.js create mode 100644 static/images/loading-cat.gif create mode 100644 static/images/loading.gif diff --git a/package.json b/package.json index 639b210..15a9b78 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 1094f00..e50c436 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 6b8a359..7a1b84e 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 0d1d7a0..bd68df6 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 4a4ace1..b7a25e1 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -4,50 +4,23 @@
- - - - 选项1 - 选项2 - 选项3 - - - 选项1 - 选项2 - 选项3 - - - - - 选项1 - 选项2 - 选项3 - - - 选项1 - 选项2 - 选项3 - - - 消息中心 - - 订单管理 - - - 订单管理 - - +
    + + +
- 我的账号 + 我的账号 购物车 我的订单 身份 @@ -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 0000000..d5d3969 --- /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 0000000..3d48f6b --- /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 0000000..6de54b1 --- /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 3b7f7bb..4f8d0f3 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 686d438..0683317 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 0000000..7efcf7b --- /dev/null +++ b/src/modules/cart/Cart.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/src/modules/home/Home.vue b/src/modules/home/Home.vue new file mode 100644 index 0000000..998539d --- /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 db26b75..e4bbe11 100644 --- a/src/modules/home/HomeBanner.vue +++ b/src/modules/home/HomeBanner.vue @@ -6,21 +6,16 @@ * @Description: 首页banner */