Skip to content

Commit

Permalink
优化页面
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyunpeng committed Aug 25, 2017
1 parent ee15010 commit b0da208
Show file tree
Hide file tree
Showing 37 changed files with 2,331 additions and 628 deletions.
6 changes: 3 additions & 3 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
index: path.resolve(__dirname, '../../web/index.html'),
assetsRoot: path.resolve(__dirname, '../../web'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: false,
Expand All @@ -23,7 +23,7 @@ module.exports = {
},
dev: {
env: require('./dev.env'),
port: 8888,
port: 8889,
autoOpenBrowser: false,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div id="tcopyright" class="tcopyright">
<ul style="list-style: none;">
<li><a href="http://www.tencent.com/" target="_blank">关于腾讯 </a> | <a href="http://henan.qq.com/about_us/" target="_blank">关于腾讯·大豫网</a> | <a href="http://www.qq.com/contract.shtml" target="_blank">服务条款</a> | <a href="http://henan.qq.com/zhihui/"target="_blank">大豫智慧</a> | <a href="http://henan.qq.com/about_us/index.htm#ggfw" target="_blank">广告服务</a> | <a href="http://henan.qq.com/hr/" target="_blank">大豫招聘</a> | <a href="http://gongyi.qq.com/" target="_blank">腾讯公益</a> | <a href="http://henan.qq.com/zt2014/dayufawu/" target="_blank">大豫法务</a> | <a href="http://henan.qq.com/sitemap.htm" target="_blank">网站地图</a> | <a href="http://henan.qq.com/zt2013/mailmanager/" target="_blank">总经理信箱</a> | <a href="http://www.12377.cn/" target="_blank">举报中心</a> | <a href="http://henanjubao.com/main" target="_blank">河南省互联网违法和不良信息举报中心</a></li>
<li class="en">Copyright &copy; 1998 - 2016 Tencent. All Rights Reserved <a href="http://www.sznet110.gov.cn/netalarm/index.jsp" target="_blank"><img src="http://mat1.gtimg.com/www/publicimg/footer.png" hspace="5" border="0" align="absmiddle" /></a></li>
<li class="en">Copyright &copy; 1998 - 2017 Tencent. All Rights Reserved <a href="http://www.sznet110.gov.cn/netalarm/index.jsp" target="_blank"><img src="http://mat1.gtimg.com/www/publicimg/footer.png" hspace="5" border="0" align="absmiddle" /></a></li>
<li>腾讯公司 <a href="http://www.tencent.com/zh-cn/le/copyrightstatement.shtml" target="_blank">版权所有</a></li>
</ul>
</div>
Expand Down
44 changes: 22 additions & 22 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,99 +74,99 @@ function config() {
export default {
//查询商家首页列表
qryStoreList:function (data) {
return axios.post('/store/comments', qs.stringify(data), config())
return axios.post('/api/store/comments', qs.stringify(data), config())
},
//商家首页分类
qryStoreTag:function(data){
return axios.post('/store/index', qs.stringify(data), config())
return axios.post('/api/store/index', qs.stringify(data), config())
},
//商家详情
qryStoreDetails:function(data){
return axios.post('/store/detail', qs.stringify(data), config())
return axios.post('/api/store/detail', qs.stringify(data), config())
},
//查询商家的官方案例
qryBusSample:function(data){
return axios.post('/store/sample', qs.stringify(data), config())
return axios.post('/api/store/sample', qs.stringify(data), config())
},
//商家官方案例的分类
qryBusSampleTag:function(data){
return axios.post('/store/sample_tag', qs.stringify(data), config())
return axios.post('/api/store/sample_tag', qs.stringify(data), config())
},


//查询套餐首页列表
qryMealList:function (data) {
return axios.post('/package/list', qs.stringify(data), config())
return axios.post('/api/package/list', qs.stringify(data), config())
},
//套餐首页分类
qryMealTag:function(data){
return axios.get('/package/index', config())
return axios.get('/api/package/index', config())
},
//套餐详情
qryMealDetails:function(data){
return axios.post('/package/detail', qs.stringify(data), config())
return axios.post('/api/package/detail', qs.stringify(data), config())
},
//查询商家的套餐列表
qryThisMealList:function(data){
return axios.post('/package/storelist', qs.stringify(data), config())
return axios.post('/api/package/storelist', qs.stringify(data), config())
},
//查询商家的套餐列表的分类
qryThisMealTag:function(data){
return axios.post('/package/search_tag', qs.stringify(data), config())
return axios.post('/api/package/search_tag', qs.stringify(data), config())
},


//摄影师详情
qryCamaramanDetails:function(data){
return axios.post('/cameraman', qs.stringify(data), config())
return axios.post('/api/cameraman', qs.stringify(data), config())
},
//化妆师详情
qryMakeupDetails:function(data){
return axios.post('/makeup', qs.stringify(data), config())
return axios.post('/api/makeup', qs.stringify(data), config())
},

//首页未登录状态
qryIndex:function(){
return axios.get('/site/index', config())
return axios.get('/api/site/index', config())
},
//查看图组详情
qryViewPhoto:function(data){
return axios.post('/site/view_photo',qs.stringify(data), config())
return axios.post('/api/site/view_photo',qs.stringify(data), config())
},
//首页已登录状态
qryLoginIndex:function(data){
return axios.post('/site/index_login',qs.stringify(data), config())
return axios.post('/api/site/index_login',qs.stringify(data), config())
},

//首页图片瀑布流
qryPhotoFlow:function(data){
return axios.post('/site/photo_flow',qs.stringify(data), config())
return axios.post('/api/site/photo_flow',qs.stringify(data), config())
},

//攻略
qryGuideList:function(){
return axios.get('/guide/index', config())
return axios.get('/api/guide/index', config())
},

//收藏图片
collectPhoto:function(data){
return axios.post('/user/collect',qs.stringify(data), config())
return axios.post('/api/user/collect',qs.stringify(data), config())
},
//取消收藏
cancelCollectPhoto:function(data){
return axios.post('/user/cancel',qs.stringify(data), config())
return axios.post('/api/user/cancel',qs.stringify(data), config())
},

//获取用户信息
getUserInfo:function(){
return axios.get('/user/get', config())
return axios.get('/api/user/get', config())
},
//退出登录
loginOut:function(){
return axios.get('/user/logout', config())
return axios.get('/api/user/logout', config())
},
//我的收藏
qryMyCollectList:function(data){
return axios.post('/user/collect_list',qs.stringify(data), config())
return axios.post('/api/user/collect_list',qs.stringify(data), config())
},
}
172 changes: 172 additions & 0 deletions src/api/index_back.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
import axios from 'axios'
import store from './../store/index'
const qs = require('querystring');

axios.defaults.timeout = 50000;
// http request interceptor
axios.interceptors.request.use(function (config) {
// Do something before request is sent
return config;
}, function (error) {
// Do something with request error
return Promise.reject(error);
});
axios.interceptors.response.use(function (response) {
// 通过状态码来识别服务器提示信息
switch (response.status) {
case 200:
break;
}
let code=response.data.code
if(code==-99){
//说明登录失效
localStorage.removeItem('user');
window.location.href = '/'
return false
}
if(code==-1){
//说明服务端错误
const data = {
content: response.data.msg,
type: 'info'
};
store.dispatch('showMsg',data);
}
return response;
}, function (error) {
// 非状态码错误 在此通过正则处理
console.log('捕获到一个错误,错误信息:' + error)
if (/Network Error/i.test(error)) {
const data = {
content: '网络异常,请稍后重试',
type: 'info'
};
store.dispatch('showMsg',data);
}
if (/ms exceeded/i.test(error)) {
const data = {
content: '网络异常,请稍后重试',
type: 'info'
};
store.dispatch('showMsg',data);
}
if (/code 500/i.test(error)) {
const data = {
content: '网络异常,请稍后重试',
type: 'info'
};
store.dispatch('showMsg',data);
}
return Promise.reject(error);
});

const ROOT = (process.env.NODE_ENV === 'production')
? ''
:'http://localhost:1300';
//http://10.97.204.142:81
function config() {
const base = {
baseURL: ROOT
};
return base
}

export default {
//查询商家首页列表
qryStoreList:function (data) {
return axios.post('/store/comments', qs.stringify(data), config())
},
//商家首页分类
qryStoreTag:function(data){
return axios.post('/store/index', qs.stringify(data), config())
},
//商家详情
qryStoreDetails:function(data){
return axios.post('/store/detail', qs.stringify(data), config())
},
//查询商家的官方案例
qryBusSample:function(data){
return axios.post('/store/sample', qs.stringify(data), config())
},
//商家官方案例的分类
qryBusSampleTag:function(data){
return axios.post('/store/sample_tag', qs.stringify(data), config())
},


//查询套餐首页列表
qryMealList:function (data) {
return axios.post('/package/list', qs.stringify(data), config())
},
//套餐首页分类
qryMealTag:function(data){
return axios.get('/package/index', config())
},
//套餐详情
qryMealDetails:function(data){
return axios.post('/package/detail', qs.stringify(data), config())
},
//查询商家的套餐列表
qryThisMealList:function(data){
return axios.post('/package/storelist', qs.stringify(data), config())
},
//查询商家的套餐列表的分类
qryThisMealTag:function(data){
return axios.post('/package/search_tag', qs.stringify(data), config())
},


//摄影师详情
qryCamaramanDetails:function(data){
return axios.post('/cameraman', qs.stringify(data), config())
},
//化妆师详情
qryMakeupDetails:function(data){
return axios.post('/makeup', qs.stringify(data), config())
},

//首页未登录状态
qryIndex:function(){
return axios.get('/site/index', config())
},
//查看图组详情
qryViewPhoto:function(data){
return axios.post('/site/view_photo',qs.stringify(data), config())
},
//首页已登录状态
qryLoginIndex:function(data){
return axios.post('/site/index_login',qs.stringify(data), config())
},

//首页图片瀑布流
qryPhotoFlow:function(data){
return axios.post('/site/photo_flow',qs.stringify(data), config())
},

//攻略
qryGuideList:function(){
return axios.get('/guide/index', config())
},

//收藏图片
collectPhoto:function(data){
return axios.post('/user/collect',qs.stringify(data), config())
},
//取消收藏
cancelCollectPhoto:function(data){
return axios.post('/user/cancel',qs.stringify(data), config())
},

//获取用户信息
getUserInfo:function(){
return axios.get('/user/get', config())
},
//退出登录
loginOut:function(){
return axios.get('/user/logout', config())
},
//我的收藏
qryMyCollectList:function(data){
return axios.post('/user/collect_list',qs.stringify(data), config())
},
}
2 changes: 2 additions & 0 deletions src/assets/css/comment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
margin-left: 8px;
height: 56px;
span{
width: 100px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
display: block;
color: #262626;
font-size: 18px;
Expand All @@ -227,6 +228,7 @@
overflow: hidden;
margin-left: 30px;
a{
display: block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
Expand Down
Loading

0 comments on commit b0da208

Please sign in to comment.