Commit 0eb21bb3 by gyy

Merge branch 'trunk' into Gyy

# Conflicts:
#	layouts/default.vue
parents a439a912 d521b43e
...@@ -85,150 +85,8 @@ export default { ...@@ -85,150 +85,8 @@ export default {
} }
return true return true
}, },
// 获取搜索页头部列表 // 获取角色权限列表
searchGoods(obj, param) { return this.wRequest('/xhr/goods/search', obj, param) }, roleAuthList(obj) { return this.wRequest('/xhr/getMenus', obj) },
// 获取订单列表
getOrderList(obj, param) { return this.wRequest('/xhr/order/searchList.json', obj, param) },
// 获取所有订单页面,广州二次支付订单导入按钮是否显示
orderPageBtnShow(obj) { return this.wRequest('/xhr/order/orderPageStatus.json', obj) },
// 获取未支付订单列表
getUnpaylist(obj, param) { return this.wRequest('/xhr/order/unpaidOrderList.json', obj, param) },
// 获取选中未支付订单,应支付金额明细
getUnpayAmount(obj, param) { return this.wRequest('/xhr/order/neddedFees.json', obj, param) },
// 获取需要编辑的订单的地址信息
editOrderAddress(obj, param) { return this.wRequest('/xhr/order/getOrderAddress.json', obj, param) },
// 保存编辑的订单的地址信息
saveOrderAddr(obj, param) { return this.wRequest('/xhr/order/orderAddressUpdate.json', obj, param) },
// 获取购物车列表
getCartlist(obj, param) { return this.postByJson('/xhr/cart/list.json', obj, param) },
// 更改购物车数量
changeNumInCart(obj, param) { return this.wRequest('/xhr/cart/updateById.json', obj, param) },
// 添加到购物车
addGoodToCart(obj, param) { return this.wRequest('/xhr/cart/addCartByCode.json', obj, param) },
// 获取购物车数量
cartGoodNum(obj) { return this.wRequest('/xhr/cart/getCount.json', obj) },
// 删除购物车商品
delCartGoods(obj, param) { return this.wRequest('/xhr/cart/deleteById.json', obj, param) },
// 获取头部类目列表
getClassify(obj) { return this.wRequest('/xhr/category/all.json', obj) },
// 获取商品详情
getGoodsDetail(obj, goodCode) { return this.wRequest('/xhr/goods/' + goodCode + '.json', obj) },
// 商品详情推荐商品
detailHotGoods(obj) { return this.wRequest('/xhr/goods/recommend.json', obj) },
// 获取首页内容
getIndexGoods(obj) { return this.wRequest('/xhr/goods/indexGoods', obj) },
getAddressById(obj, param) { return this.wRequest('/xhr/area/child.json', obj, param) },
// 获取平台分销列表
getPlatformList(obj, param) { return this.wRequest('/xhr/financial/orderPackageList/queryByPage.json', obj, param) },
// 获取采购财务列表
getPurchaseList(obj, param) { return this.wRequest('/xhr/report/purchaseFinancial.json', obj, param) },
// 获取供货财务列表
getSupplyList(obj, param) { return this.wRequest('/xhr/report/supplyFinancial.json', obj, param) },
// 取消订单
cancelOrder(obj, param) { return this.wRequest('/xhr/order/orderCancel', obj, param) },
// 删除订单
deleteOrder(obj, param) { return this.wRequest('/xhr/order/orderDelete.json', obj, param) },
// 订单详情获取商品和订单编号等
orderDetailInfo(obj, param) { return this.wRequest('/xhr/order/detail.json', obj, param) },
// 订单详情-获取海关状态
orderCustomSts(obj, param) { return this.wRequest('/xhr/order/packageCustomsLog.json', obj, param) },
// 修改身份证号
changePaper(obj, param) { return this.wRequest('/xhr/order/changePaper.json', obj, param) },
// 获取确认订单页面商品信息
getConfirmOrder(obj) { return this.wRequest('/xhr/order/confirmOrder', obj) },
// 获取用户地址列表
addressListGet(obj) { return this.wRequest('/xhr/userAddress/list.json', obj) },
// 设置为用户默认地址
setAddrDefault(obj, param) { return this.wRequest('/xhr/userAddress/setDefault.json', obj, param) },
// 删除用户地址
delUserAddr(obj, param) { return this.wRequest('/xhr/userAddress/delete.json', obj, param) },
// 根据地址id获取单个地址详细信息
getAddrFullById(obj, param) { return this.wRequest('/xhr/userAddress/getById.json', obj, param) },
// 添加或者修改地址
updateAddrById(obj, param) { return this.wRequest('/xhr/userAddress/upsert.json', obj, param) },
// 地址-添加身份证
addIdentityNumber(obj, param) { return this.wRequest('/xhr/userAddress/addIdentityNumber.json', obj, param) },
// 提交订单
submitOrder(obj, param) { return this.postByJson('/xhr/order/submitOrder2.json', obj, param) },
// 去支付页面获取可使用支付方式和收款方信息
goPayInfo(obj, param) { return this.wRequest('/xhr/pay/payWay.json', obj, param) },
// 支付(包含单个订单直接付款和未支付订单页面整体提交)
ordersPay(obj, param) { return this.wRequest('/xhr/pay/payment.json', obj, param) },
// 获取账户明细列表
getFinanceDetail(obj, param) { return this.wRequest('/xhr/financial/accountDetail/queryByPage.json', obj, param) },
// 获取余额提现列表
getwithdrawList(obj) { return this.wRequest('/xhr/finance/withdrawList', obj) },
// 获取自有货源列表
getSourceList(obj, param) { return this.wRequest('/xhr/goods/supplierSearch.json', obj, param) },
// 获取库存变动列表
getInventoryList(obj, param) { return this.wRequest('/xhr/goods/inventoryLogSum.json', obj, param) },
// 获取库存变动详情
getInventoryDetail(obj, param) { return this.wRequest('/xhr/goods/inventoryLog.json', obj, param) },
// 库存变动详情导出
InventoryExport(obj, param) { return this.wRequest('/xhr/goods/exportInventoryLog', obj, param) },
// 登录页面相关
usrLogin(obj, param) { return this.wRequest('/xhr/login/submit.json', obj, param) },
// 退出登录
usrLogout(obj) { return this.wRequest('/xhr/login/logout.json', obj) },
placeOrderInfo(obj, param) { return this.postByJson('/xhr/order/initOrder2.json', obj, param) },
// 获取包裹状态
getPackageType(obj) { return this.wRequest('/xhr/order/packageStatus.json', obj) },
// 获取海关状态
getCustomType(obj) { return this.wRequest('/xhr/order/customsStatus.json', obj) },
// 快递接口
getExpress(obj, param) { return this.wRequest('/xhr/order/getPackageExpInfo.json', obj, param) },
// 手机验证码(注册用)
getMobileCode(obj, param) { return this.wRequest('/xhr/login/mobileCode', obj, param) },
// 注册
register(obj, param) { return this.wRequest('/xhr/login/register', obj, param) },
// 获取用户信息
getUserInfo(obj) { return this.wRequest('/xhr/web/user/getInfo', obj) },
// 手机验证码(修改手机号、修改密码用)
getChangeMobileCode(obj, param) { return this.wRequest('/xhr/findPassword/getMobileCode.json', obj, param) },
// 确认输入的验证码是否正确(修改手机号、修改密码用)
confirmMobileCode(obj, param) { return this.wRequest('/xhr/findPassword/verifyMobileCode.json', obj, param) },
// 更新手机号码接口
updateMobile(obj, param) { return this.wRequest('/xhr/web/user/updateMobile.json', obj, param) },
// 更新用户名
updateName(obj, param) { return this.wRequest('/xhr/web/user/updateName.json', obj, param) },
// 修改用户密码
changePassword(obj, param) { return this.wRequest('/xhr/login/changePassword', obj, param) },
// 上传头像信息
saveHeadr(obj, param) { return this.wRequest('/xhr/web/user/updateAvatar.json', obj, param) },
// 找回密码(第一步):账号验证
verifyAccount(obj, param) { return this.wRequest('/xhr/findPassword/verifyAccount.json', obj, param) },
// 找回密码(第三步):手机验证码修改密码
retrievePassword(obj, param) { return this.wRequest('/xhr/findPassword/retrievePw.json', obj, param) },
// 找回密码(第二步):发送邮件
sendEmail(obj, param) { return this.wRequest('/xhr/findPassword/sendEmail.json', obj, param) },
// 找回密码(第三步):邮件验证
verifyEmail(obj, param) { return this.wRequest('/xhr/findPassword/verifyEmail.json', obj, param) },
// 仓库列表
depotList(obj) { return this.wRequest('/xhr/depot/list.json', obj) },
// 供应商自有货源导出
sourceExport(obj, param) { return this.wRequest('/xhr/goods/selfGoodsDerive.json', obj, param) },
// 批量提货即批量添加购物车
addCartBatch(obj, param) { return this.postByJson('/xhr/cart/addCartBatch', obj, param) },
// 用户余额信息
moneyInfo(obj) { return this.wRequest('/xhr/financial/moneyInfo.json', obj) },
// 余额充值
recharge(obj, param) { return this.wRequest('/xhr/order/recharge.json', obj, param) },
// 售后申请页面初始化数据
afterSaleInit(obj, param) { return this.wRequest('/xhr/order/afterSale/applyDetail.json', obj, param) },
// 售后申请提交
afterSaleSubmit(obj, param) { return this.wRequest('/xhr/order/afterSale/applySubmit.json', obj, param) },
// 售后详情
afterSaleDetail(obj, param) { return this.wRequest('/xhr/order/afterSale/detail.json', obj, param) },
// 提交售后发货信息
afterSaleSubmitLogis(obj, param) { return this.wRequest('/xhr/order/afterSale/deliverySubmit.json', obj, param) },
// 售后申请取消
afterSalecancel(obj, param) { return this.wRequest('/xhr/order/afterSale/applyCancel.json', obj, param) },
// 提现页面-提现提交
withdrawCash(obj, param) { return this.wRequest('/cashWithdraw/confirm.json', obj, param) },
// 获取订单数量
getSearchCount(obj, param) { return this.wRequest('/xhr/order/searchCount.json', obj, param) },
// 获取支付信息
getPayInfo(obj) { return this.wRequest('/mock/47/api/shop/profile/pay/list', obj) },
server_getConfig(key) { server_getConfig(key) {
if (process.env.WD_ENV === 'production') { if (process.env.WD_ENV === 'production') {
var configp = require('../config/config-prod.json') var configp = require('../config/config-prod.json')
......
/**
* 邮箱
* @param {*} s
*/
export function isEmail (s) {
return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
}
/**
* 手机号码
* @param {*} s
*/
export function isMobile (s) {
return /^1[0-9]{10}$/.test(s)
}
/**
* 电话号码
* @param {*} s
*/
export function isPhone (s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
}
/**
* URL地址
* @param {*} s
*/
export function isURL (s) {
return /^http[s]?:\/\/.*/.test(s)
}
...@@ -11,17 +11,24 @@ ...@@ -11,17 +11,24 @@
</div> </div>
</div> </div>
<div class="y_default_start"> <div class="y_default_start">
<keep-alive>
<div class="main_left" :style="{height: clientHeight + 'px'}"> <div class="main_left" :style="{height: clientHeight + 'px'}">
<div class="orderCtg_txt"> <el-menu
<p v-for="(item, index) in orderList" :class="$route.path===item.pagePath?'orderCtg_list_now':''" @click="entriesClick(item)">{{item.name}}</p> :default-active="item.name"
</div> class="el-menu-vertical-demo"
<div class="orderCtg_txt"> @open="handleOpen"
<p v-for="(item, index) in lapsList" :class="$route.path===item.pagePath?'orderCtg_list_now':''" @click="entriesClick(item)">{{item.name}}</p> @close="handleClose" v-for="(item, index) in leftMenuList">
</div> <el-submenu :index="item.name" :default-openeds="[]">
<div class="orderCtg_txt"> <template slot="title">
<p v-for="(item, index) in financeList" :class="$route.path===item.pagePath?'orderCtg_list_now':''" @click="entriesClick(item)">{{item.name}}</p> <i class="el-icon-location"></i>
</div> <span>{{item.name}}</span>
</template>
<el-menu-item :index="sub.name" v-for="(sub, subIndex) in item.pageList">{{sub.name}}</el-menu-item>
</el-submenu>
</el-menu>
</div> </div>
</keep-alive>
<!-- 侧边栏结束 -->
<div class="main_right"> <div class="main_right">
<div class="crumbs"> <div class="crumbs">
<div class="y_flex_start"> <div class="y_flex_start">
...@@ -45,19 +52,26 @@ ...@@ -45,19 +52,26 @@
</template> </template>
<script> <script>
import Vue from 'vue'
import Menu from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import YCookie from '../assets/js/yCookie.js' import YCookie from '../assets/js/yCookie.js'
import requestApi from '../assets/js/requestApi.js'
Vue.use(Menu)
export default { export default {
data() { data() {
return { return {
tab: ['系统管理', '商品管理', '订单管理', '财务管理'], tab: ['系统管理', '商品管理', '订单管理', '财务管理'],
tabNow: 0, tabNow: 0,
systemList: [],
goodManageList: [],
orderList: [], orderList: [],
lapsList: [],
financeList: [], financeList: [],
clientHeight: 0, clientHeight: 0,
visible: false, visible: false,
left: 0, left: 0,
selectedTag: {} selectedTag: {},
leftMenuList: []
} }
}, },
computed: { computed: {
...@@ -73,6 +87,17 @@ export default { ...@@ -73,6 +87,17 @@ export default {
return this.$store.state.financalTags.fVisitedViews return this.$store.state.financalTags.fVisitedViews
} }
} }
// leftMenuList() {
// if (this.tabNow === 0) {
// return this.systemList
// } else if (this.tabNow === 1) {
// return this.goodManageList
// } else if (this.tabNow === 2) {
// return this.orderList
// } else {
// return this.financeList
// }
// }
}, },
watch: { watch: {
$route() { $route() {
...@@ -87,6 +112,23 @@ export default { ...@@ -87,6 +112,23 @@ export default {
} }
}, },
methods: { methods: {
initMenuList() {
console.log('11111111')
this.leftMenuList = []
if (this.tabNow === 0) {
this.leftMenuList = this.systemList
} else if (this.tabNow === 1) {
this.leftMenuList = this.goodManageList
} else if (this.tabNow === 2) {
this.leftMenuList = this.orderList
} else {
this.leftMenuList = this.financeList
}
},
handleOpen() {
},
handleClose() {
},
generateRoute() { generateRoute() {
if (this.$route.name) { if (this.$route.name) {
return this.$route return this.$route
...@@ -189,68 +231,15 @@ export default { ...@@ -189,68 +231,15 @@ export default {
this.visible = false this.visible = false
}, },
// 获取列表数据 // 获取列表数据
getOrderCtg() { getOrderCtg: async function () {
let order = [] console.log('get data ==== ')
let orderPath = [] let obj = await requestApi.roleAuthList(this)
let orderId = [] if (obj.code === 'success') {
let laps = [] this.systemList = obj.data.sys.pageList
let lapPath = [] this.goodManageList = obj.data.goods.pageList
let lapId = [] this.orderList = obj.data.order.pageList
let finance = [] this.financeList = obj.data.finance.pageList
let accountPath = [] this.initMenuList()
let accountId = []
if (this.tabNow === 0) {
order = ['所有订单']
orderPath = ['/y-order/order']
orderId = ['0']
laps = []
lapPath = []
lapId = []
finance = ['账户安全', '账户信息']
accountPath = ['/account/security', '/account/message']
accountId = ['0', '1']
} else if (this.tabNow === 1) {
order = ['所有订单', '导入订单', '未支付订单']
orderPath = ['/y-order/order', '/y-order/order-import', '/y-order/order-unpaid']
orderId = ['0', '1', '2']
laps = ['账户明细', '采购财务']
lapPath = ['/finance/finance-detail', '/finance/purchase']
lapId = ['0', '2']
finance = ['账户安全', '账户信息']
accountPath = ['/account/security', '/account/message']
accountId = ['0', '1']
} else if (this.tabNow === 2) {
order = ['所有订单', '导入订单', '未支付订单']
orderPath = ['/y-order/order', '/y-order/order-import', '/y-order/order-unpaid']
orderId = ['0', '1', '2']
laps = ['账户明细', '采购财务', '供货财物', '平台分销']
lapPath = ['/finance/finance-detail', '/finance/purchase', '/finance/supply', '/finance/platform']
lapId = ['0', '2', '3', '4']
finance = ['账户安全', '账户信息']
accountPath = ['/account/security', '/account/message']
accountId = ['0', '1']
} else {
order = ['所有订单', '未支付订单']
orderPath = ['/y-order/order', '/y-order/order-unpaid']
orderId = ['0', '2']
laps = ['账户明细', '采购财务', '供货财物', '平台分销']
lapPath = ['/finance/finance-detail', '/finance/purchase', '/finance/supply', '/finance/platform']
lapId = ['0', '2', '3', '4']
finance = ['账户安全', '账户信息']
accountPath = ['/account/security', '/account/message']
accountId = ['0', '1']
}
for (let i = 0; i < order.length; i++) {
let itemOrder = {name: order[i], id: orderId[i], pagePath: orderPath[i]}
this.orderList.push(itemOrder)
}
for (let i = 0; i < laps.length; i++) {
let itemLaps = {name: laps[i], id: lapId[i], pagePath: lapPath[i]}
this.lapsList.push(itemLaps)
}
for (let i = 0; i < finance.length; i++) {
let itemFinance = {name: finance[i], id: accountId[i], pagePath: accountPath[i]}
this.financeList.push(itemFinance)
} }
}, },
switchTab(e) { switchTab(e) {
...@@ -264,11 +253,8 @@ export default { ...@@ -264,11 +253,8 @@ export default {
YCookie.setLocalCookie('fourthPath', this.$route.path) YCookie.setLocalCookie('fourthPath', this.$route.path)
} }
this.tabNow = e this.tabNow = e
this.initMenuList()
YCookie.setLocalCookie('tabNow', this.tabNow) YCookie.setLocalCookie('tabNow', this.tabNow)
this.orderList = []
this.lapsList = []
this.financeList = []
this.getOrderCtg()
let nowPath let nowPath
if (e === 0) { if (e === 0) {
nowPath = YCookie.readLocalCookie('firstPath') nowPath = YCookie.readLocalCookie('firstPath')
...@@ -392,11 +378,11 @@ export default { ...@@ -392,11 +378,11 @@ export default {
font-weight: bold; font-weight: bold;
} }
.main_left{ .main_left{
width: 10%; width: 13%;
background: #E8E9EE; background: #E8E9EE;
} }
.main_right{ .main_right{
width: 90%; width: 87%;
position: relative; position: relative;
} }
.crumbs{ .crumbs{
......
export default function ({store, redirect}) { export default function ({store, redirect}) {
console.log('aut userId' + store.state.auth) console.log('aut userId' + store.state.usrAuth.auth)
if (store.state.auth === undefined || store.state.auth === null || Object.keys(store.state.auth).length === 0 || store.state.auth.userId === 0) { if (store.state.usrAuth.auth === undefined || store.state.usrAuth.auth === null || Object.keys(store.state.usrAuth.auth).length === 0 || store.state.usrAuth.auth.userId === 0) {
redirect('/login/login') redirect('/login/login')
} }
} }
export default function ({ route, redirect, store }) { export default function ({ route, redirect, store }) {
console.log('route.fullPath == ' + route.fullPath) console.log('route.fullPath == ' + route.fullPath)
if (route.fullPath === '/login') { if (route.fullPath === '/login') {
store.state.loginPath = store.state.forePath store.state.usrAuth.loginPath = store.state.usrAuth.forePath
} }
store.state.forePath = route.fullPath store.state.usrAuth.forePath = route.fullPath
} }
...@@ -2,7 +2,6 @@ var merge = require('webpack-merge') ...@@ -2,7 +2,6 @@ var merge = require('webpack-merge')
var baseConfig = require('./nuxt.config.js') var baseConfig = require('./nuxt.config.js')
module.exports = merge(baseConfig, { module.exports = merge(baseConfig, {
proxy: { proxy: {
'/xhr/': 'http://www.yang800.com/backend', '/xhr/': 'http://yapi.yang800.cn/mock/31'
'/order': 'http://www.yang800.com/backend'
} }
}) })
<template>
<section class="container">
<img src="../assets/img/logo.png" alt="Nuxt.js Logo" class="logo" />
<h1 class="title">
This page is loaded from the {{ name }}
</h1>
<h2 class="info" v-if="name === 'client'">
Please refresh the page
</h2>
<nuxt-link class="button" to="/">
Home page
</nuxt-link>
</section>
</template>
<script>
export default {
asyncData({ req }) {
return {
name: req ? 'server' : 'client'
}
},
head() {
return {
title: `About Page (${this.name}-side)`
}
}
}
</script>
<style scoped>
.title
{
margin-top: 50px;
}
.info
{
font-weight: 300;
color: #9aabb1;
margin: 0;
margin-top: 10px;
}
.button
{
margin-top: 50px;
}
</style>
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
<h1 class="title"> <h1 class="title">
Universal Vue.js Application Framework Universal Vue.js Application Framework
</h1> </h1>
<nuxt-link class="button" to="/about">
About page
</nuxt-link>
</section> </section>
</template> </template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment