Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
aec557e9
Commit
aec557e9
authored
Apr 21, 2019
by
Junling Bu
Browse files
chore[litemall-vue]: 参考litemall-admin结构,重新调整litemall-vue的src结构
parent
8d262f8b
Changes
64
Show whitespace changes
Inline
Side-by-side
litemall-vue/src/
core/
utils/local-storage.js
→
litemall-vue/src/utils/local-storage.js
View file @
aec557e9
File moved
litemall-vue/src/
core/
utils/location-param.js
→
litemall-vue/src/utils/location-param.js
View file @
aec557e9
File moved
litemall-vue/src/utils/request.js
0 → 100644
View file @
aec557e9
import
axios
from
'
axios
'
import
{
Dialog
,
Toast
}
from
'
vant
'
;
// create an axios instance
const
service
=
axios
.
create
({
baseURL
:
process
.
env
.
BASE_API
,
// api 的 base_url
timeout
:
5000
// request timeout
})
// request interceptor
service
.
interceptors
.
request
.
use
(
config
=>
{
if
(
!
config
.
headers
[
'
X-Litemall-Token
'
])
{
config
.
headers
[
'
X-Litemall-Token
'
]
=
`
${
window
.
localStorage
.
getItem
(
'
Authorization
'
)
||
''
}
`
;
}
return
config
;
},
err
=>
Promise
.
reject
(
err
)
)
// response interceptor
service
.
interceptors
.
response
.
use
(
response
=>
{
const
res
=
response
.
data
if
(
res
.
errno
===
501
)
{
Toast
.
fail
(
'
请登录
'
);
setTimeout
(()
=>
{
window
.
location
=
'
#/login/
'
},
1500
)
return
Promise
.
reject
(
'
error
'
)
}
else
if
(
res
.
errno
===
502
)
{
Toast
.
alert
(
'
网站内部错误,请联系网站维护人员
'
)
return
Promise
.
reject
(
'
error
'
)
}
else
if
(
res
.
errno
!==
0
)
{
// 非5xx的错误属于业务错误,留给具体页面处理
return
Promise
.
reject
(
response
)
}
else
{
return
response
}
},
error
=>
{
console
.
log
(
'
err
'
+
error
)
// for debug
Dialog
.
alert
({
title
:
'
警告
'
,
message
:
'
登录连接超时
'
});
return
Promise
.
reject
(
error
)
})
export
default
service
litemall-vue/src/
core/
utils/scroll.js
→
litemall-vue/src/utils/scroll.js
100755 → 100644
View file @
aec557e9
litemall-vue/src/
core/regexp/index
.js
→
litemall-vue/src/
utils/validate
.js
100755 → 100644
View file @
aec557e9
litemall-vue/src/views/home/tabbar-home.vue
View file @
aec557e9
...
...
@@ -10,29 +10,17 @@
</van-swipe-item>
</van-swipe>
<
van-tabbar
active-color=
"#7d7e80"
v-model=
"active"
class=
"goods-channel"
>
<van-tabbar-
item
<
div
class=
"goods-channel"
>
<div
class=
"
item
"
@
click=
"changeTabbar(iconJson)"
style=
"font-size:14px"
v-if=
"index
<
5"
v-for=
"(iconJson, index) in shopInfos.channel"
:key=
"index"
:icon=
"iconJson.iconUrl"
>
{{
iconJson
.
name
}}
</van-tabbar-item>
</van-tabbar>
<van-tabbar
active-color=
"#7d7e80"
v-model=
"active"
class=
"goods-channel"
>
<van-tabbar-item
@
click=
"changeTabbar(iconJson)"
style=
"font-size:14px"
v-if=
"index >= 5"
v-for=
"(iconJson, index) in shopInfos.channel"
:key=
"index"
:icon=
"iconJson.iconUrl"
>
{{
iconJson
.
name
}}
</van-tabbar-item>
<van-tabbar-item></van-tabbar-item>
</van-tabbar>
:key=
"index"
>
<img
:src=
"iconJson.iconUrl"
background-size=
"cover"
/>
<span>
{{
iconJson
.
name
}}
</span>
</div>
</div>
<!--
<van-panel
title=
"优惠券"
style=
" padding-bottom: 10px;"
>
<van-panel
title=
"优惠券"
style=
" padding-bottom: 10px;"
>
<div
class=
"van-coupon-item"
v-for=
"(coupon,index) in shopInfos.couponList"
...
...
@@ -55,7 +43,8 @@
</div>
</div>
</van-panel>
-->
</van-panel>
<van-panel
title=
"团购专区"
>
<!--
{{
shopInfos
.
grouponList
}}
-->
<van-card
...
...
@@ -143,19 +132,19 @@
<
script
>
import
{
HOME_module
,
ALL_GOODS
}
from
'
@/api/shop
'
;
import
getLocationParam
from
'
core
/utils/location-param
'
;
import
getLocationParam
from
'
@
/utils/location-param
'
;
import
mx_be_to
from
'
@/assets/images/mx_be_to.png
'
;
import
mx_start
from
'
@/assets/images/mx_start.png
'
;
import
SignBoard
from
'
./tabbar-home-sign-board
'
;
import
ShopInfoGroup
from
'
./tabbar-home-shop-info
'
;
import
ItemGroup
from
'
@/
vue/
components/item-group/
'
;
import
ItemCardVert
from
'
@/
vue/
components/item-card-vert/
'
;
import
ItemCardHori
from
'
@/
vue/
components/item-card-hori/
'
;
import
ItemGroup
from
'
@/components/item-group/
'
;
import
ItemCardVert
from
'
@/components/item-card-vert/
'
;
import
ItemCardHori
from
'
@/components/item-card-hori/
'
;
import
loadMore
from
'
@/
vue/
mixin/list-load-more
'
;
import
scrollFixed
from
'
@/
vue/
mixin/scroll-fixed
'
;
import
loadMore
from
'
@/mixin/list-load-more
'
;
import
scrollFixed
from
'
@/mixin/scroll-fixed
'
;
import
_
from
'
lodash
'
;
const
coupon
=
{
...
...
@@ -379,10 +368,38 @@ export default {
.interval_bot
{
margin-bottom
:
10px
;
}
.goods-channel
{
position
:
sticky
;
border-bottom-width
:
0px
;
background
:
#fff
;
display
:
flex
;
align-items
:
center
;
flex-wrap
:
wrap
;
padding-bottom
:
0px
;
padding-top
:
10px
;
}
.goods-channel
.item
{
width
:
50px
;
height
:
50px
;
margin-left
:
10px
;
}
.goods-channel
img
{
display
:
block
;
width
:
30px
;
height
:
30px
;
margin
:
0
auto
;
}
.goods-channel
span
{
display
:
block
;
font-size
:
15px
;
text-align
:
center
;
margin
:
0
auto
;
line-height
:
1
;
color
:
#333
;
}
van-tabbar-item
.van-coupon-cell--selected
{
color
:
#323233
;
}
...
...
@@ -444,6 +461,8 @@ export default {
padding
:
24px
0
0
15px
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
border
:
1px
solid
red
;
}
.van-coupon-item
h2
,
.van-coupon-item
p
{
...
...
litemall-vue/src/views/items/list/index.vue
View file @
aec557e9
...
...
@@ -63,11 +63,11 @@
<
script
>
import
{
GOODS_SEARCH
}
from
'
@/api/goods
'
;
import
ItemGroup
from
'
@/
vue/
components/item-group
'
;
import
ItemCardHori
from
'
@/
vue/
components/item-card-hori/
'
;
import
ItemGroup
from
'
@/components/item-group
'
;
import
ItemCardHori
from
'
@/components/item-card-hori/
'
;
import
{
Search
,
Tab
,
Tabs
,
Popup
}
from
'
vant
'
;
// import { throttle } from 'lodash';
import
InfinityScroll
from
'
@/
vue/
components/infinity-scroll
'
;
import
InfinityScroll
from
'
@/components/infinity-scroll
'
;
export
default
{
name
:
'
Item-list
'
,
...
...
litemall-vue/src/views/items/search-result/index.vue
View file @
aec557e9
...
...
@@ -32,14 +32,14 @@
<
script
>
import
{
GOODS_SEARCH
}
from
'
@/api/goods
'
;
import
ItemGroup
from
'
@/
vue/
components/item-group/
'
;
import
IsEmpty
from
'
@/
vue/
components/is-empty/
'
;
import
ItemCardHori
from
'
@/
vue/
components/item-card-hori/
'
;
import
ItemGroup
from
'
@/components/item-group/
'
;
import
IsEmpty
from
'
@/components/is-empty/
'
;
import
ItemCardHori
from
'
@/components/item-card-hori/
'
;
import
{
Search
,
List
}
from
'
vant
'
;
import
_
from
'
lodash
'
;
import
loadMore
from
'
@/
vue/
mixin/list-load-more
'
;
import
scrollFixed
from
'
@/
vue/
mixin/scroll-fixed
'
;
import
loadMore
from
'
@/mixin/list-load-more
'
;
import
scrollFixed
from
'
@/mixin/scroll-fixed
'
;
export
default
{
name
:
'
Item-list
'
,
...
...
litemall-vue/src/views/items/tabbar-class.vue
View file @
aec557e9
...
...
@@ -20,10 +20,10 @@
<
script
>
import
{
GOODS_CATEGORY
,
GOODS_CHANNGE_CATEGORY
}
from
'
@/api/goods
'
;
import
getLocationParam
from
'
core
/utils/location-param
'
;
import
getLocationParam
from
'
@
/utils/location-param
'
;
import
{
Search
}
from
'
vant
'
;
import
classTree
from
'
./tabbar-class-tree
'
;
import
IsEmpty
from
'
@/
vue/
components/is-empty
'
;
import
IsEmpty
from
'
@/components/is-empty
'
;
import
_
from
'
lodash
'
;
import
{
async
}
from
'
q
'
;
...
...
litemall-vue/src/views/login/forget-reset/index.vue
View file @
aec557e9
...
...
@@ -21,8 +21,8 @@
</
template
>
<
script
>
import
field
from
'
@/
vue/
components/field/
'
;
import
fieldGroup
from
'
@/
vue/
components/field-group/
'
;
import
field
from
'
@/components/field/
'
;
import
fieldGroup
from
'
@/components/field-group/
'
;
export
default
{
data
()
{
...
...
litemall-vue/src/views/login/forget/index.vue
View file @
aec557e9
...
...
@@ -25,8 +25,8 @@
</template>
<
script
>
import
field
from
'
@/
vue/
components/field/
'
;
import
fieldGroup
from
'
@/
vue/
components/field-group/
'
;
import
field
from
'
@/components/field/
'
;
import
fieldGroup
from
'
@/components/field-group/
'
;
export
default
{
data
()
{
...
...
litemall-vue/src/views/login/login.vue
View file @
aec557e9
...
...
@@ -50,12 +50,12 @@
</
template
>
<
script
>
import
field
from
'
@/
vue/
components/field/
'
;
import
fieldGroup
from
'
@/
vue/
components/field-group/
'
;
import
field
from
'
@/components/field/
'
;
import
fieldGroup
from
'
@/components/field-group/
'
;
import
{
USER_LOGIN
,
USER_PROFILE
}
from
'
@/api/user
'
;
import
{
setLocalStorage
}
from
'
core
/utils/local-storage
'
;
import
{
emailReg
,
mobileReg
}
from
'
@/
core/regexp
'
;
import
{
loginByUsername
,
USER_LOGIN
,
USER_PROFILE
}
from
'
@/api/user
'
;
import
{
setLocalStorage
}
from
'
@
/utils/local-storage
'
;
import
{
emailReg
,
mobileReg
}
from
'
@/
utils/validate
'
;
import
{
Toast
}
from
'
vant
'
;
...
...
@@ -93,6 +93,7 @@ export default {
async
login
()
{
let
loginData
=
this
.
getLoginData
();
loginByUsername
(
loginData
)
let
{
data
}
=
await
this
.
$reqPost
(
USER_LOGIN
,
loginData
);
this
.
userInfo
=
data
.
data
.
userInfo
;
console
.
log
(
this
.
userInfo
);
...
...
@@ -139,9 +140,9 @@ export default {
getLoginData
()
{
const
password
=
this
.
password
;
const
username
=
this
.
getUserType
(
this
.
account
);
const
account
=
this
.
getUserType
(
this
.
account
);
return
{
username
:
this
.
account
,
[
account
]
:
this
.
account
,
password
:
password
};
},
...
...
litemall-vue/src/views/login/register-getCode/index.vue
View file @
aec557e9
...
...
@@ -18,8 +18,8 @@
</
template
>
<
script
>
import
field
from
'
@/
vue/
components/field/
'
;
import
fieldGroup
from
'
@/
vue/
components/field-group/
'
;
import
field
from
'
@/components/field/
'
;
import
fieldGroup
from
'
@/components/field-group/
'
;
export
default
{
data
()
{
...
...
litemall-vue/src/views/login/register-submit/index.vue
View file @
aec557e9
...
...
@@ -18,8 +18,8 @@
</template>
<
script
>
import
field
from
'
@/
vue/
components/field/
'
;
import
fieldGroup
from
'
@/
vue/
components/field-group/
'
;
import
field
from
'
@/components/field/
'
;
import
fieldGroup
from
'
@/components/field-group/
'
;
export
default
{
data
()
{
...
...
litemall-vue/src/views/order/tabbar-cart.vue
View file @
aec557e9
...
...
@@ -49,7 +49,7 @@
<
script
>
import
{
Checkbox
,
CheckboxGroup
,
Card
,
SubmitBar
,
Stepper
,
Tag
}
from
'
vant
'
;
import
isEmpty
from
'
@/
vue/
components/is-empty/
'
;
import
isEmpty
from
'
@/components/is-empty/
'
;
import
_
from
'
lodash
'
;
import
{
debug
}
from
'
util
'
;
...
...
litemall-vue/src/views/user/module-collect/index.vue
View file @
aec557e9
...
...
@@ -40,13 +40,13 @@
<
script
>
import
{
GOODS_COLLECT_LIST
}
from
'
@/api/user
'
;
import
ItemGroup
from
'
@/
vue/
components/item-group/
'
;
import
ItemCardHori
from
'
@/
vue/
components/item-card-hori/
'
;
import
IsEmpty
from
'
@/
vue/
components/is-empty/
'
;
import
ItemGroup
from
'
@/components/item-group/
'
;
import
ItemCardHori
from
'
@/components/item-card-hori/
'
;
import
IsEmpty
from
'
@/components/is-empty/
'
;
import
{
Search
,
List
}
from
'
vant
'
;
import
loadMore
from
'
@/
vue/
mixin/list-load-more
'
;
import
scrollFixed
from
'
@/
vue/
mixin/scroll-fixed
'
;
import
loadMore
from
'
@/mixin/list-load-more
'
;
import
scrollFixed
from
'
@/mixin/scroll-fixed
'
;
export
default
{
mixins
:
[
loadMore
,
scrollFixed
],
...
...
litemall-vue/src/views/user/order-ele-list/index.vue
View file @
aec557e9
...
...
@@ -55,7 +55,7 @@ import status110 from './handle-status-110';
import
status120
from
'
./handle-status-120
'
;
import
_
from
'
lodash
'
;
import
InfinityScroll
from
'
@/
vue/
components/infinity-scroll
'
;
import
InfinityScroll
from
'
@/components/infinity-scroll
'
;
const
STATUS_TEXT
=
{
10
:
'
待付款
'
,
...
...
litemall-vue/src/views/user/order-entity-list/index.vue
View file @
aec557e9
...
...
@@ -61,7 +61,7 @@ import status50 from './handle-status-50';
import
status60
from
'
./handle-status-60
'
;
import
status70
from
'
./handle-status-70
'
;
import
InfinityScroll
from
'
@/
vue/
components/infinity-scroll
'
;
import
InfinityScroll
from
'
@/components/infinity-scroll
'
;
const
STATUS_TEXT
=
{
10
:
'
待付款
'
,
...
...
litemall-vue/src/views/user/refund-list/index.vue
View file @
aec557e9
...
...
@@ -46,7 +46,7 @@
import
{
REFUND_LIST
}
from
'
@/api/order
'
;
import
{
Tab
,
Tabs
,
Panel
,
Card
,
List
}
from
'
vant
'
;
import
InfinityScroll
from
'
@/
vue/
components/infinity-scroll
'
;
import
InfinityScroll
from
'
@/components/infinity-scroll
'
;
const
STATUS_TEXT
=
{
10
:
'
退款中
'
,
...
...
litemall-vue/src/views/user/tabbar-user-header.vue
View file @
aec557e9
...
...
@@ -9,9 +9,9 @@
</
template
>
<
script
>
import
avatar_default
from
'
../..
/assets/images/avatar_default.png
'
;
import
bg_default
from
'
../..
/assets/images/user_head_bg.png
'
;
import
{
getLocalStorage
}
from
'
core
/utils/local-storage
'
;
import
avatar_default
from
'
@
/assets/images/avatar_default.png
'
;
import
bg_default
from
'
@
/assets/images/user_head_bg.png
'
;
import
{
getLocalStorage
}
from
'
@
/utils/local-storage
'
;
import
_
from
'
lodash
'
;
export
default
{
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment