@ -5,7 +5,8 @@
< div class = "bg" > < / div >
< div class = "info jz d-flex" >
< img src = "../assets/photo.png" >
< p class = "f_36 c_1B" > welcome , 用户名 < / p >
< p class = "f_36 c_1B" v-if ="this.userInfo().username==null" > 请登录 < / p >
< p class = "f_36 c_1B" v-if ="this.userInfo().username!=null" > welcome , {{ this.userInfo ( ) .username }} < / p >
< a > 量体数据 < / a >
< / div >
< div class = "jz" >
@ -90,14 +91,20 @@
import Header from "../components/Header/HeaderView" ;
import Footer from "../components/Footer/FooterView"
import { mapGetters } from 'vuex'
import { getFileAccessHttpUrl , getAction } from "@/api/manage"
import { getFileAccessHttpUrl } from "@/api/manage"
import { httpAction , getAction } from '@/api/manage'
export default {
name : "gerenzhongxin" ,
components : { Header , Footer } ,
data ( ) { 0
return {
model : {
username1 : ""
} ,
current : [ 'allorders' ] , / / 目 前 打 开 的 菜 单
key : '' , / / 当 前 选 择 的 订 单 状 态 ( 待 支 付 、 待 收 货 等 )
allOrders2 : [ ] ,
allOrders1 : [
{
id : 1 ,
@ -143,22 +150,60 @@
}
] , / / 所 有 订 单 , 包 括 未 支 付 、 未 收 获 等
allOrders : [ ] , / / 目 前 展 示 的 订 单
url : {
list : "/starehouse/starehouse/list" ,
getusername : "/sys/user/getusername" ,
findgoods : "/sys/user/findgoods"
} ,
} ;
} ,
created ( ) {
this . getusername ( ) ;
this . getallgoods ( ) ;
} ,
mounted ( ) {
if ( this . current [ 0 ] == 'allorders' ) {
this . allOrders = this . allOrders1
/*this.allOrders = this.allOrders1*/
this . allOrders = this . allOrders2
}
} ,
methods : {
... mapGetters ( [ "nickname" , "avatar" , "userInfo" ] ) ,
getallgoods ( ) {
getAction ( this . url . findgoods ) . then ( ( res ) => {
if ( res . success ) {
this . allOrders2 = res . result ;
console . log ( "===========" )
console . log ( res . result )
console . log ( this . allOrders2 )
console . log ( "===========" )
this . visible = true ;
} else {
console . log ( "-----------" )
}
} ) ;
} ,
getusername ( ) {
getAction ( this . url . getusername ) . then ( ( res ) => {
if ( res . success ) {
this . model . username1 = res . result ;
console . log ( res . message )
this . visible = true ;
} else {
}
} ) ;
} ,
... mapGetters ( [ "nickname" , "avatar" , "userInfo" , "addRouters" , "username" , "permissionList" ] ) ,
/ / 获 取 用 户 头 像
getAvatar ( ) {
return getFileAccessHttpUrl ( this . avatar ( ) )
} ,
callback ( key ) {
console . log ( key ) ;
} ,
@ -195,16 +240,20 @@
this . current . shift ( )
this . current . push ( key . key )
if ( key . key == 'allorders' ) {
this . allOrders = this . allOrders1
/* this.allOrders = this.allOrders1*/
this . allOrders = this . allOrders2
}
else if ( key . key == 'daizhifu' ) {
this . allOrders = this . allOrders1 . filter ( item => item . pay == false )
/* this.allOrders = this.allOrders1.filter(item=>item.pay == false)*/
this . allOrders = this . allOrders2 . filter ( item => item . pay == false )
}
else if ( key . key == 'daishouhuo' ) {
this . allOrders = this . allOrders1 . filter ( item => item . receipt == false && item . pay == true )
/*this.allOrders = this.allOrders1.filter(item=>item.receipt == false && item.pay == true)*/
this . allOrders = this . allOrders2 . filter ( item => item . receipt == false && item . pay == true )
}
else if ( key . key == 'yiwancheng' ) {
this . allOrders = this . allOrders1 . filter ( item => item . receipt == true )
/*this.allOrders = this.allOrders1.filter(item=>item.receipt == true)*/
this . allOrders = this . allOrders2 . filter ( item => item . receipt == true )
} else {
this . allOrders = [ ]
}